ffmpeg-all.html 2.9 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080660816608266083660846608566086660876608866089660906609166092660936609466095660966609766098660996610066101661026610366104661056610666107661086610966110661116611266113661146611566116661176611866119661206612166122661236612466125661266612766128661296613066131661326613366134661356613666137661386613966140661416614266143661446614566146661476614866149661506615166152661536615466155661566615766158661596616066161661626616366164661656616666167661686616966170661716617266173661746617566176661776617866179661806618166182661836618466185661866618766188661896619066191661926619366194661956619666197661986619966200662016620266203662046620566206662076620866209662106621166212662136621466215662166621766218662196622066221662226622366224662256622666227662286622966230662316623266233662346623566236662376623866239662406624166242662436624466245662466624766248662496625066251662526625366254662556625666257662586625966260662616626266263662646626566266662676626866269662706627166272662736627466275662766627766278662796628066281662826628366284662856628666287662886628966290662916629266293662946629566296662976629866299663006630166302663036630466305663066630766308663096631066311663126631366314663156631666317663186631966320663216632266323663246632566326663276632866329663306633166332663336633466335663366633766338663396634066341663426634366344663456634666347663486634966350663516635266353663546635566356663576635866359663606636166362663636636466365663666636766368663696637066371663726637366374663756637666377663786637966380663816638266383663846638566386663876638866389663906639166392663936639466395663966639766398663996640066401664026640366404664056640666407664086640966410664116641266413664146641566416664176641866419664206642166422664236642466425664266642766428664296643066431664326643366434664356643666437664386643966440664416644266443664446644566446664476644866449664506645166452664536645466455664566645766458664596646066461664626646366464664656646666467664686646966470664716647266473664746647566476664776647866479664806648166482664836648466485664866648766488664896649066491664926649366494664956649666497664986649966500665016650266503665046650566506665076650866509665106651166512665136651466515665166651766518665196652066521665226652366524665256652666527665286652966530665316653266533665346653566536665376653866539665406654166542665436654466545665466654766548665496655066551665526655366554665556655666557665586655966560665616656266563665646656566566665676656866569665706657166572665736657466575665766657766578665796658066581665826658366584665856658666587665886658966590665916659266593665946659566596665976659866599666006660166602666036660466605666066660766608666096661066611666126661366614666156661666617666186661966620666216662266623666246662566626666276662866629666306663166632666336663466635666366663766638666396664066641666426664366644666456664666647666486664966650666516665266653666546665566656666576665866659666606666166662666636666466665666666666766668666696667066671666726667366674666756667666677666786667966680666816668266683666846668566686666876668866689666906669166692666936669466695666966669766698666996670066701667026670366704667056670666707667086670966710667116671266713667146671566716667176671866719667206672166722667236672466725667266672766728667296673066731667326673366734667356673666737667386673966740667416674266743667446674566746667476674866749667506675166752667536675466755667566675766758667596676066761667626676366764667656676666767667686676966770667716677266773667746677566776667776677866779667806678166782667836678466785667866678766788667896679066791667926679366794667956679666797667986679966800668016680266803668046680566806668076680866809668106681166812668136681466815668166681766818668196682066821668226682366824668256682666827668286682966830668316683266833668346683566836668376683866839668406684166842668436684466845668466684766848668496685066851668526685366854668556685666857668586685966860668616686266863668646686566866668676686866869668706687166872668736687466875668766687766878668796688066881668826688366884668856688666887668886688966890668916689266893668946689566896668976689866899669006690166902669036690466905669066690766908669096691066911669126691366914669156691666917669186691966920669216692266923669246692566926669276692866929669306693166932669336693466935669366693766938669396694066941669426694366944669456694666947669486694966950669516695266953669546695566956669576695866959669606696166962669636696466965669666696766968669696697066971669726697366974669756697666977669786697966980669816698266983669846698566986669876698866989669906699166992669936699466995669966699766998669996700067001670026700367004670056700667007670086700967010670116701267013670146701567016670176701867019670206702167022670236702467025670266702767028670296703067031670326703367034670356703667037670386703967040670416704267043670446704567046670476704867049670506705167052670536705467055670566705767058670596706067061670626706367064670656706667067670686706967070670716707267073670746707567076670776707867079670806708167082670836708467085670866708767088670896709067091670926709367094670956709667097670986709967100671016710267103671046710567106671076710867109671106711167112671136711467115671166711767118671196712067121671226712367124671256712667127671286712967130671316713267133671346713567136671376713867139671406714167142671436714467145671466714767148671496715067151671526715367154671556715667157671586715967160671616716267163671646716567166671676716867169671706717167172671736717467175671766717767178671796718067181671826718367184671856718667187671886718967190671916719267193671946719567196671976719867199672006720167202672036720467205672066720767208672096721067211672126721367214672156721667217672186721967220672216722267223672246722567226672276722867229672306723167232672336723467235672366723767238672396724067241672426724367244672456724667247672486724967250672516725267253672546725567256672576725867259672606726167262672636726467265672666726767268672696727067271672726727367274672756727667277672786727967280672816728267283672846728567286672876728867289672906729167292672936729467295672966729767298672996730067301673026730367304673056730667307673086730967310673116731267313673146731567316673176731867319673206732167322673236732467325673266732767328673296733067331673326733367334673356733667337673386733967340673416734267343673446734567346673476734867349673506735167352673536735467355673566735767358673596736067361673626736367364673656736667367673686736967370673716737267373673746737567376673776737867379673806738167382673836738467385673866738767388673896739067391673926739367394673956739667397673986739967400674016740267403674046740567406674076740867409674106741167412674136741467415674166741767418674196742067421674226742367424674256742667427674286742967430674316743267433674346743567436674376743867439674406744167442674436744467445674466744767448674496745067451674526745367454674556745667457674586745967460674616746267463674646746567466674676746867469674706747167472674736747467475674766747767478674796748067481674826748367484674856748667487674886748967490674916749267493674946749567496674976749867499675006750167502675036750467505675066750767508675096751067511675126751367514675156751667517675186751967520675216752267523675246752567526675276752867529675306753167532675336753467535675366753767538675396754067541675426754367544675456754667547675486754967550675516755267553675546755567556675576755867559675606756167562675636756467565675666756767568675696757067571675726757367574675756757667577675786757967580675816758267583675846758567586675876758867589675906759167592675936759467595675966759767598675996760067601676026760367604676056760667607676086760967610676116761267613676146761567616676176761867619676206762167622676236762467625676266762767628676296763067631676326763367634676356763667637676386763967640676416764267643676446764567646676476764867649676506765167652676536765467655676566765767658676596766067661676626766367664676656766667667676686766967670676716767267673676746767567676676776767867679676806768167682676836768467685676866768767688676896769067691676926769367694676956769667697676986769967700677016770267703677046770567706677076770867709677106771167712677136771467715677166771767718677196772067721677226772367724677256772667727677286772967730677316773267733677346773567736677376773867739677406774167742677436774467745677466774767748677496775067751677526775367754677556775667757677586775967760677616776267763677646776567766677676776867769677706777167772677736777467775677766777767778677796778067781677826778367784677856778667787677886778967790677916779267793677946779567796677976779867799678006780167802678036780467805678066780767808678096781067811678126781367814678156781667817678186781967820678216782267823678246782567826678276782867829678306783167832678336783467835678366783767838678396784067841678426784367844678456784667847678486784967850678516785267853678546785567856678576785867859678606786167862678636786467865678666786767868678696787067871678726787367874678756787667877678786787967880678816788267883678846788567886678876788867889678906789167892678936789467895678966789767898678996790067901679026790367904679056790667907679086790967910679116791267913679146791567916679176791867919679206792167922679236792467925679266792767928679296793067931679326793367934679356793667937679386793967940679416794267943679446794567946679476794867949679506795167952679536795467955679566795767958679596796067961679626796367964679656796667967679686796967970679716797267973679746797567976679776797867979679806798167982679836798467985679866798767988679896799067991679926799367994679956799667997679986799968000680016800268003680046800568006680076800868009680106801168012680136801468015680166801768018680196802068021680226802368024680256802668027680286802968030680316803268033680346803568036680376803868039680406804168042680436804468045680466804768048680496805068051680526805368054680556805668057680586805968060680616806268063680646806568066680676806868069680706807168072680736807468075680766807768078680796808068081680826808368084680856808668087680886808968090680916809268093680946809568096680976809868099681006810168102681036810468105681066810768108681096811068111681126811368114681156811668117681186811968120681216812268123681246812568126681276812868129681306813168132681336813468135681366813768138681396814068141681426814368144681456814668147681486814968150681516815268153681546815568156681576815868159681606816168162681636816468165681666816768168681696817068171681726817368174681756817668177681786817968180681816818268183681846818568186681876818868189681906819168192681936819468195681966819768198681996820068201682026820368204682056820668207682086820968210682116821268213682146821568216682176821868219682206822168222682236822468225682266822768228682296823068231682326823368234682356823668237682386823968240682416824268243682446824568246682476824868249682506825168252682536825468255682566825768258682596826068261682626826368264682656826668267682686826968270682716827268273682746827568276682776827868279682806828168282682836828468285682866828768288682896829068291682926829368294682956829668297682986829968300683016830268303683046830568306683076830868309683106831168312683136831468315683166831768318683196832068321683226832368324683256832668327683286832968330683316833268333683346833568336683376833868339683406834168342683436834468345683466834768348683496835068351683526835368354683556835668357683586835968360683616836268363683646836568366683676836868369683706837168372683736837468375683766837768378683796838068381683826838368384683856838668387683886838968390683916839268393683946839568396683976839868399684006840168402684036840468405684066840768408684096841068411684126841368414684156841668417684186841968420684216842268423684246842568426684276842868429684306843168432684336843468435684366843768438684396844068441684426844368444684456844668447684486844968450684516845268453684546845568456684576845868459684606846168462684636846468465684666846768468684696847068471684726847368474684756847668477684786847968480684816848268483684846848568486684876848868489684906849168492684936849468495684966849768498684996850068501685026850368504685056850668507685086850968510685116851268513685146851568516685176851868519685206852168522685236852468525685266852768528685296853068531685326853368534685356853668537685386853968540685416854268543685446854568546685476854868549685506855168552685536855468555685566855768558685596856068561685626856368564685656856668567685686856968570685716857268573685746857568576685776857868579685806858168582685836858468585685866858768588685896859068591685926859368594685956859668597685986859968600686016860268603686046860568606686076860868609686106861168612686136861468615686166861768618686196862068621686226862368624686256862668627686286862968630686316863268633686346863568636686376863868639686406864168642686436864468645686466864768648686496865068651686526865368654686556865668657686586865968660686616866268663686646866568666686676866868669686706867168672686736867468675686766867768678686796868068681686826868368684686856868668687686886868968690686916869268693686946869568696686976869868699687006870168702687036870468705687066870768708687096871068711687126871368714687156871668717687186871968720687216872268723687246872568726687276872868729687306873168732687336873468735687366873768738687396874068741687426874368744687456874668747687486874968750687516875268753687546875568756687576875868759687606876168762687636876468765687666876768768687696877068771687726877368774687756877668777687786877968780687816878268783687846878568786687876878868789687906879168792
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by , GNU Texinfo 7.1.1 -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. ffmpeg Documentation
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. ffmpeg Documentation
  17. </h1>
  18. <a name="SEC_Top"></a>
  19. <div class="element-contents" id="SEC_Contents">
  20. <h2 class="contents-heading">Table of Contents</h2>
  21. <div class="contents">
  22. <ul class="toc-numbered-mark">
  23. <li><a id="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
  24. <li><a id="toc-Description" href="#Description">2 Description</a></li>
  25. <li><a id="toc-Detailed-description" href="#Detailed-description">3 Detailed description</a>
  26. <ul class="toc-numbered-mark">
  27. <li><a id="toc-Streamcopy" href="#Streamcopy">3.1 Streamcopy</a></li>
  28. <li><a id="toc-Transcoding" href="#Transcoding">3.2 Transcoding</a></li>
  29. <li><a id="toc-Filtering" href="#Filtering">3.3 Filtering</a>
  30. <ul class="toc-numbered-mark">
  31. <li><a id="toc-Simple-filtergraphs" href="#Simple-filtergraphs">3.3.1 Simple filtergraphs</a></li>
  32. <li><a id="toc-Complex-filtergraphs" href="#Complex-filtergraphs">3.3.2 Complex filtergraphs</a></li>
  33. </ul></li>
  34. <li><a id="toc-Loopback-decoders-1" href="#Loopback-decoders-1">3.4 Loopback decoders</a></li>
  35. </ul></li>
  36. <li><a id="toc-Stream-selection-1" href="#Stream-selection-1">4 Stream selection</a>
  37. <ul class="toc-numbered-mark">
  38. <li><a id="toc-Description-1" href="#Description-1">4.1 Description</a>
  39. <ul class="toc-numbered-mark">
  40. <li><a id="toc-Automatic-stream-selection" href="#Automatic-stream-selection">4.1.1 Automatic stream selection</a></li>
  41. <li><a id="toc-Manual-stream-selection" href="#Manual-stream-selection">4.1.2 Manual stream selection</a></li>
  42. <li><a id="toc-Complex-filtergraphs-1" href="#Complex-filtergraphs-1">4.1.3 Complex filtergraphs</a></li>
  43. <li><a id="toc-Stream-handling" href="#Stream-handling">4.1.4 Stream handling</a></li>
  44. </ul></li>
  45. <li><a id="toc-Examples" href="#Examples">4.2 Examples</a></li>
  46. </ul></li>
  47. <li><a id="toc-Options" href="#Options">5 Options</a>
  48. <ul class="toc-numbered-mark">
  49. <li><a id="toc-Stream-specifiers-1" href="#Stream-specifiers-1">5.1 Stream specifiers</a></li>
  50. <li><a id="toc-Generic-options" href="#Generic-options">5.2 Generic options</a></li>
  51. <li><a id="toc-AVOptions" href="#AVOptions">5.3 AVOptions</a></li>
  52. <li><a id="toc-Main-options" href="#Main-options">5.4 Main options</a></li>
  53. <li><a id="toc-Video-Options" href="#Video-Options">5.5 Video Options</a></li>
  54. <li><a id="toc-Advanced-Video-options" href="#Advanced-Video-options">5.6 Advanced Video options</a></li>
  55. <li><a id="toc-Audio-Options" href="#Audio-Options">5.7 Audio Options</a></li>
  56. <li><a id="toc-Advanced-Audio-options" href="#Advanced-Audio-options">5.8 Advanced Audio options</a></li>
  57. <li><a id="toc-Subtitle-options" href="#Subtitle-options">5.9 Subtitle options</a></li>
  58. <li><a id="toc-Advanced-Subtitle-options" href="#Advanced-Subtitle-options">5.10 Advanced Subtitle options</a></li>
  59. <li><a id="toc-Advanced-options" href="#Advanced-options">5.11 Advanced options</a></li>
  60. <li><a id="toc-Preset-files" href="#Preset-files">5.12 Preset files</a>
  61. <ul class="toc-numbered-mark">
  62. <li><a id="toc-ffpreset-files" href="#ffpreset-files">5.12.1 ffpreset files</a></li>
  63. <li><a id="toc-avpreset-files" href="#avpreset-files">5.12.2 avpreset files</a></li>
  64. </ul></li>
  65. <li><a id="toc-vstats-file-format" href="#vstats-file-format">5.13 vstats file format</a></li>
  66. </ul></li>
  67. <li><a id="toc-Examples-1" href="#Examples-1">6 Examples</a>
  68. <ul class="toc-numbered-mark">
  69. <li><a id="toc-Video-and-Audio-grabbing" href="#Video-and-Audio-grabbing">6.1 Video and Audio grabbing</a></li>
  70. <li><a id="toc-X11-grabbing" href="#X11-grabbing">6.2 X11 grabbing</a></li>
  71. <li><a id="toc-Video-and-Audio-file-format-conversion" href="#Video-and-Audio-file-format-conversion">6.3 Video and Audio file format conversion</a></li>
  72. </ul></li>
  73. <li><a id="toc-Syntax" href="#Syntax">7 Syntax</a>
  74. <ul class="toc-numbered-mark">
  75. <li><a id="toc-Quoting-and-escaping" href="#Quoting-and-escaping">7.1 Quoting and escaping</a>
  76. <ul class="toc-numbered-mark">
  77. <li><a id="toc-Examples-2" href="#Examples-2">7.1.1 Examples</a></li>
  78. </ul></li>
  79. <li><a id="toc-Date" href="#Date">7.2 Date</a></li>
  80. <li><a id="toc-Time-duration" href="#Time-duration">7.3 Time duration</a>
  81. <ul class="toc-numbered-mark">
  82. <li><a id="toc-Examples-3" href="#Examples-3">7.3.1 Examples</a></li>
  83. </ul></li>
  84. <li><a id="toc-Video-size" href="#Video-size">7.4 Video size</a></li>
  85. <li><a id="toc-Video-rate" href="#Video-rate">7.5 Video rate</a></li>
  86. <li><a id="toc-Ratio" href="#Ratio">7.6 Ratio</a></li>
  87. <li><a id="toc-Color" href="#Color">7.7 Color</a></li>
  88. <li><a id="toc-Channel-Layout" href="#Channel-Layout">7.8 Channel Layout</a></li>
  89. </ul></li>
  90. <li><a id="toc-Expression-Evaluation" href="#Expression-Evaluation">8 Expression Evaluation</a></li>
  91. <li><a id="toc-Codec-Options" href="#Codec-Options">9 Codec Options</a></li>
  92. <li><a id="toc-Decoders" href="#Decoders">10 Decoders</a></li>
  93. <li><a id="toc-Video-Decoders" href="#Video-Decoders">11 Video Decoders</a>
  94. <ul class="toc-numbered-mark">
  95. <li><a id="toc-av1" href="#av1">11.1 av1</a>
  96. <ul class="toc-numbered-mark">
  97. <li><a id="toc-Options-1" href="#Options-1">11.1.1 Options</a></li>
  98. </ul></li>
  99. <li><a id="toc-hevc" href="#hevc">11.2 hevc</a>
  100. <ul class="toc-numbered-mark">
  101. <li><a id="toc-Options-2" href="#Options-2">11.2.1 Options</a></li>
  102. </ul></li>
  103. <li><a id="toc-rawvideo" href="#rawvideo">11.3 rawvideo</a>
  104. <ul class="toc-numbered-mark">
  105. <li><a id="toc-Options-3" href="#Options-3">11.3.1 Options</a></li>
  106. </ul></li>
  107. <li><a id="toc-libdav1d" href="#libdav1d">11.4 libdav1d</a>
  108. <ul class="toc-numbered-mark">
  109. <li><a id="toc-Options-4" href="#Options-4">11.4.1 Options</a></li>
  110. </ul></li>
  111. <li><a id="toc-libdavs2" href="#libdavs2">11.5 libdavs2</a></li>
  112. <li><a id="toc-libuavs3d" href="#libuavs3d">11.6 libuavs3d</a>
  113. <ul class="toc-numbered-mark">
  114. <li><a id="toc-Options-5" href="#Options-5">11.6.1 Options</a></li>
  115. </ul></li>
  116. <li><a id="toc-libxevd" href="#libxevd">11.7 libxevd</a>
  117. <ul class="toc-numbered-mark">
  118. <li><a id="toc-Options-6" href="#Options-6">11.7.1 Options</a></li>
  119. </ul></li>
  120. <li><a id="toc-QSV-Decoders" href="#QSV-Decoders">11.8 QSV Decoders</a>
  121. <ul class="toc-numbered-mark">
  122. <li><a id="toc-Common-Options" href="#Common-Options">11.8.1 Common Options</a></li>
  123. <li><a id="toc-HEVC-Options" href="#HEVC-Options">11.8.2 HEVC Options</a></li>
  124. </ul></li>
  125. <li><a id="toc-v210" href="#v210">11.9 v210</a>
  126. <ul class="toc-numbered-mark">
  127. <li><a id="toc-Options-7" href="#Options-7">11.9.1 Options</a></li>
  128. </ul></li>
  129. </ul></li>
  130. <li><a id="toc-Audio-Decoders" href="#Audio-Decoders">12 Audio Decoders</a>
  131. <ul class="toc-numbered-mark">
  132. <li><a id="toc-ac3" href="#ac3">12.1 ac3</a>
  133. <ul class="toc-numbered-mark">
  134. <li><a id="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">12.1.1 AC-3 Decoder Options</a></li>
  135. </ul></li>
  136. <li><a id="toc-flac-1" href="#flac-1">12.2 flac</a>
  137. <ul class="toc-numbered-mark">
  138. <li><a id="toc-FLAC-Decoder-options" href="#FLAC-Decoder-options">12.2.1 FLAC Decoder options</a></li>
  139. </ul></li>
  140. <li><a id="toc-ffwavesynth" href="#ffwavesynth">12.3 ffwavesynth</a></li>
  141. <li><a id="toc-libcelt" href="#libcelt">12.4 libcelt</a></li>
  142. <li><a id="toc-libgsm" href="#libgsm">12.5 libgsm</a></li>
  143. <li><a id="toc-libilbc" href="#libilbc">12.6 libilbc</a>
  144. <ul class="toc-numbered-mark">
  145. <li><a id="toc-Options-8" href="#Options-8">12.6.1 Options</a></li>
  146. </ul></li>
  147. <li><a id="toc-libmpeghdec" href="#libmpeghdec">12.7 libmpeghdec</a></li>
  148. <li><a id="toc-libopencore_002damrnb" href="#libopencore_002damrnb">12.8 libopencore-amrnb</a></li>
  149. <li><a id="toc-libopencore_002damrwb" href="#libopencore_002damrwb">12.9 libopencore-amrwb</a></li>
  150. <li><a id="toc-libopus" href="#libopus">12.10 libopus</a></li>
  151. </ul></li>
  152. <li><a id="toc-Subtitles-Decoders" href="#Subtitles-Decoders">13 Subtitles Decoders</a>
  153. <ul class="toc-numbered-mark">
  154. <li><a id="toc-libaribb24" href="#libaribb24">13.1 libaribb24</a>
  155. <ul class="toc-numbered-mark">
  156. <li><a id="toc-libaribb24-Decoder-Options" href="#libaribb24-Decoder-Options">13.1.1 libaribb24 Decoder Options</a></li>
  157. </ul></li>
  158. <li><a id="toc-libaribcaption" href="#libaribcaption">13.2 libaribcaption</a>
  159. <ul class="toc-numbered-mark">
  160. <li><a id="toc-libaribcaption-Decoder-Options" href="#libaribcaption-Decoder-Options">13.2.1 libaribcaption Decoder Options</a></li>
  161. <li><a id="toc-libaribcaption-decoder-usage-examples" href="#libaribcaption-decoder-usage-examples">13.2.2 libaribcaption decoder usage examples</a></li>
  162. </ul></li>
  163. <li><a id="toc-dvbsub" href="#dvbsub">13.3 dvbsub</a>
  164. <ul class="toc-numbered-mark">
  165. <li><a id="toc-Options-9" href="#Options-9">13.3.1 Options</a></li>
  166. </ul></li>
  167. <li><a id="toc-dvdsub" href="#dvdsub">13.4 dvdsub</a>
  168. <ul class="toc-numbered-mark">
  169. <li><a id="toc-Options-10" href="#Options-10">13.4.1 Options</a></li>
  170. </ul></li>
  171. <li><a id="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">13.5 libzvbi-teletext</a>
  172. <ul class="toc-numbered-mark">
  173. <li><a id="toc-Options-11" href="#Options-11">13.5.1 Options</a></li>
  174. </ul></li>
  175. </ul></li>
  176. <li><a id="toc-Encoders" href="#Encoders">14 Encoders</a></li>
  177. <li><a id="toc-Audio-Encoders" href="#Audio-Encoders">15 Audio Encoders</a>
  178. <ul class="toc-numbered-mark">
  179. <li><a id="toc-aac" href="#aac">15.1 aac</a>
  180. <ul class="toc-numbered-mark">
  181. <li><a id="toc-Options-12" href="#Options-12">15.1.1 Options</a></li>
  182. </ul></li>
  183. <li><a id="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">15.2 ac3 and ac3_fixed</a>
  184. <ul class="toc-numbered-mark">
  185. <li><a id="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">15.2.1 AC-3 Metadata</a>
  186. <ul class="toc-numbered-mark">
  187. <li><a id="toc-Metadata-Control-Options" href="#Metadata-Control-Options">15.2.1.1 Metadata Control Options</a></li>
  188. <li><a id="toc-Downmix-Levels" href="#Downmix-Levels">15.2.1.2 Downmix Levels</a></li>
  189. <li><a id="toc-Audio-Production-Information" href="#Audio-Production-Information">15.2.1.3 Audio Production Information</a></li>
  190. <li><a id="toc-Other-Metadata-Options" href="#Other-Metadata-Options">15.2.1.4 Other Metadata Options</a></li>
  191. </ul></li>
  192. <li><a id="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">15.2.2 Extended Bitstream Information</a>
  193. <ul class="toc-numbered-mark">
  194. <li><a id="toc-Extended-Bitstream-Information-_002d-Part-1" href="#Extended-Bitstream-Information-_002d-Part-1">15.2.2.1 Extended Bitstream Information - Part 1</a></li>
  195. <li><a id="toc-Extended-Bitstream-Information-_002d-Part-2" href="#Extended-Bitstream-Information-_002d-Part-2">15.2.2.2 Extended Bitstream Information - Part 2</a></li>
  196. </ul></li>
  197. <li><a id="toc-Other-AC_002d3-Encoding-Options" href="#Other-AC_002d3-Encoding-Options">15.2.3 Other AC-3 Encoding Options</a></li>
  198. <li><a id="toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">15.2.4 Floating-Point-Only AC-3 Encoding Options</a></li>
  199. </ul></li>
  200. <li><a id="toc-flac-2" href="#flac-2">15.3 flac</a>
  201. <ul class="toc-numbered-mark">
  202. <li><a id="toc-Options-13" href="#Options-13">15.3.1 Options</a></li>
  203. </ul></li>
  204. <li><a id="toc-opus" href="#opus">15.4 opus</a>
  205. <ul class="toc-numbered-mark">
  206. <li><a id="toc-Options-14" href="#Options-14">15.4.1 Options</a></li>
  207. </ul></li>
  208. <li><a id="toc-libfdk_005faac" href="#libfdk_005faac">15.5 libfdk_aac</a>
  209. <ul class="toc-numbered-mark">
  210. <li><a id="toc-Options-15" href="#Options-15">15.5.1 Options</a></li>
  211. <li><a id="toc-Examples-4" href="#Examples-4">15.5.2 Examples</a></li>
  212. </ul></li>
  213. <li><a id="toc-liblc3" href="#liblc3">15.6 liblc3</a>
  214. <ul class="toc-numbered-mark">
  215. <li><a id="toc-Options-16" href="#Options-16">15.6.1 Options</a></li>
  216. </ul></li>
  217. <li><a id="toc-libmp3lame-1" href="#libmp3lame-1">15.7 libmp3lame</a>
  218. <ul class="toc-numbered-mark">
  219. <li><a id="toc-Options-17" href="#Options-17">15.7.1 Options</a></li>
  220. </ul></li>
  221. <li><a id="toc-libopencore_002damrnb-1" href="#libopencore_002damrnb-1">15.8 libopencore-amrnb</a>
  222. <ul class="toc-numbered-mark">
  223. <li><a id="toc-Options-18" href="#Options-18">15.8.1 Options</a></li>
  224. </ul></li>
  225. <li><a id="toc-libopus-1" href="#libopus-1">15.9 libopus</a>
  226. <ul class="toc-numbered-mark">
  227. <li><a id="toc-Option-Mapping" href="#Option-Mapping">15.9.1 Option Mapping</a></li>
  228. </ul></li>
  229. <li><a id="toc-libshine-1" href="#libshine-1">15.10 libshine</a>
  230. <ul class="toc-numbered-mark">
  231. <li><a id="toc-Options-19" href="#Options-19">15.10.1 Options</a></li>
  232. </ul></li>
  233. <li><a id="toc-libtwolame" href="#libtwolame">15.11 libtwolame</a>
  234. <ul class="toc-numbered-mark">
  235. <li><a id="toc-Options-20" href="#Options-20">15.11.1 Options</a></li>
  236. </ul></li>
  237. <li><a id="toc-libvo_002damrwbenc" href="#libvo_002damrwbenc">15.12 libvo-amrwbenc</a>
  238. <ul class="toc-numbered-mark">
  239. <li><a id="toc-Options-21" href="#Options-21">15.12.1 Options</a></li>
  240. </ul></li>
  241. <li><a id="toc-libvorbis" href="#libvorbis">15.13 libvorbis</a>
  242. <ul class="toc-numbered-mark">
  243. <li><a id="toc-Options-22" href="#Options-22">15.13.1 Options</a></li>
  244. </ul></li>
  245. <li><a id="toc-mjpeg" href="#mjpeg">15.14 mjpeg</a>
  246. <ul class="toc-numbered-mark">
  247. <li><a id="toc-Options-23" href="#Options-23">15.14.1 Options</a></li>
  248. </ul></li>
  249. <li><a id="toc-wavpack" href="#wavpack">15.15 wavpack</a>
  250. <ul class="toc-numbered-mark">
  251. <li><a id="toc-Options-24" href="#Options-24">15.15.1 Options</a>
  252. <ul class="toc-numbered-mark">
  253. <li><a id="toc-Shared-options" href="#Shared-options">15.15.1.1 Shared options</a></li>
  254. <li><a id="toc-Private-options" href="#Private-options">15.15.1.2 Private options</a></li>
  255. </ul></li>
  256. </ul></li>
  257. </ul></li>
  258. <li><a id="toc-Video-Encoders" href="#Video-Encoders">16 Video Encoders</a>
  259. <ul class="toc-numbered-mark">
  260. <li><a id="toc-a64_005fmulti_002c-a64_005fmulti5" href="#a64_005fmulti_002c-a64_005fmulti5">16.1 a64_multi, a64_multi5</a></li>
  261. <li><a id="toc-Cinepak" href="#Cinepak">16.2 Cinepak</a>
  262. <ul class="toc-numbered-mark">
  263. <li><a id="toc-Options-25" href="#Options-25">16.2.1 Options</a></li>
  264. </ul></li>
  265. <li><a id="toc-ffv1-1" href="#ffv1-1">16.3 ffv1</a>
  266. <ul class="toc-numbered-mark">
  267. <li><a id="toc-Options-26" href="#Options-26">16.3.1 Options</a></li>
  268. </ul></li>
  269. <li><a id="toc-GIF" href="#GIF">16.4 GIF</a>
  270. <ul class="toc-numbered-mark">
  271. <li><a id="toc-Options-27" href="#Options-27">16.4.1 Options</a></li>
  272. </ul></li>
  273. <li><a id="toc-Hap" href="#Hap">16.5 Hap</a>
  274. <ul class="toc-numbered-mark">
  275. <li><a id="toc-Options-28" href="#Options-28">16.5.1 Options</a></li>
  276. </ul></li>
  277. <li><a id="toc-jpeg2000" href="#jpeg2000">16.6 jpeg2000</a>
  278. <ul class="toc-numbered-mark">
  279. <li><a id="toc-Options-29" href="#Options-29">16.6.1 Options</a></li>
  280. </ul></li>
  281. <li><a id="toc-librav1e" href="#librav1e">16.7 librav1e</a>
  282. <ul class="toc-numbered-mark">
  283. <li><a id="toc-Options-30" href="#Options-30">16.7.1 Options</a></li>
  284. </ul></li>
  285. <li><a id="toc-libaom_002dav1" href="#libaom_002dav1">16.8 libaom-av1</a>
  286. <ul class="toc-numbered-mark">
  287. <li><a id="toc-Options-31" href="#Options-31">16.8.1 Options</a></li>
  288. </ul></li>
  289. <li><a id="toc-liboapv" href="#liboapv">16.9 liboapv</a>
  290. <ul class="toc-numbered-mark">
  291. <li><a id="toc-Options-32" href="#Options-32">16.9.1 Options</a></li>
  292. </ul></li>
  293. <li><a id="toc-libsvtav1" href="#libsvtav1">16.10 libsvtav1</a>
  294. <ul class="toc-numbered-mark">
  295. <li><a id="toc-Options-33" href="#Options-33">16.10.1 Options</a></li>
  296. </ul></li>
  297. <li><a id="toc-libsvtjpegxs" href="#libsvtjpegxs">16.11 libsvtjpegxs</a>
  298. <ul class="toc-numbered-mark">
  299. <li><a id="toc-Options-34" href="#Options-34">16.11.1 Options</a></li>
  300. </ul></li>
  301. <li><a id="toc-libjxl" href="#libjxl">16.12 libjxl</a>
  302. <ul class="toc-numbered-mark">
  303. <li><a id="toc-Options-35" href="#Options-35">16.12.1 Options</a></li>
  304. </ul></li>
  305. <li><a id="toc-libkvazaar" href="#libkvazaar">16.13 libkvazaar</a>
  306. <ul class="toc-numbered-mark">
  307. <li><a id="toc-Options-36" href="#Options-36">16.13.1 Options</a></li>
  308. </ul></li>
  309. <li><a id="toc-libopenh264" href="#libopenh264">16.14 libopenh264</a>
  310. <ul class="toc-numbered-mark">
  311. <li><a id="toc-Options-37" href="#Options-37">16.14.1 Options</a></li>
  312. </ul></li>
  313. <li><a id="toc-libtheora" href="#libtheora">16.15 libtheora</a>
  314. <ul class="toc-numbered-mark">
  315. <li><a id="toc-Options-38" href="#Options-38">16.15.1 Options</a></li>
  316. <li><a id="toc-Examples-5" href="#Examples-5">16.15.2 Examples</a></li>
  317. </ul></li>
  318. <li><a id="toc-libvpx" href="#libvpx">16.16 libvpx</a>
  319. <ul class="toc-numbered-mark">
  320. <li><a id="toc-Options-39" href="#Options-39">16.16.1 Options</a></li>
  321. </ul></li>
  322. <li><a id="toc-libvvenc" href="#libvvenc">16.17 libvvenc</a>
  323. <ul class="toc-numbered-mark">
  324. <li><a id="toc-Supported-Pixel-Formats" href="#Supported-Pixel-Formats">16.17.1 Supported Pixel Formats</a></li>
  325. <li><a id="toc-Options-40" href="#Options-40">16.17.2 Options</a></li>
  326. </ul></li>
  327. <li><a id="toc-libwebp" href="#libwebp">16.18 libwebp</a>
  328. <ul class="toc-numbered-mark">
  329. <li><a id="toc-Pixel-Format" href="#Pixel-Format">16.18.1 Pixel Format</a></li>
  330. <li><a id="toc-Options-41" href="#Options-41">16.18.2 Options</a></li>
  331. </ul></li>
  332. <li><a id="toc-libx264_002c-libx264rgb" href="#libx264_002c-libx264rgb">16.19 libx264, libx264rgb</a>
  333. <ul class="toc-numbered-mark">
  334. <li><a id="toc-Supported-Pixel-Formats-1" href="#Supported-Pixel-Formats-1">16.19.1 Supported Pixel Formats</a></li>
  335. <li><a id="toc-Options-42" href="#Options-42">16.19.2 Options</a></li>
  336. </ul></li>
  337. <li><a id="toc-libx265" href="#libx265">16.20 libx265</a>
  338. <ul class="toc-numbered-mark">
  339. <li><a id="toc-Options-43" href="#Options-43">16.20.1 Options</a></li>
  340. </ul></li>
  341. <li><a id="toc-libxavs2" href="#libxavs2">16.21 libxavs2</a>
  342. <ul class="toc-numbered-mark">
  343. <li><a id="toc-Options-44" href="#Options-44">16.21.1 Options</a></li>
  344. </ul></li>
  345. <li><a id="toc-libxeve" href="#libxeve">16.22 libxeve</a>
  346. <ul class="toc-numbered-mark">
  347. <li><a id="toc-Options-45" href="#Options-45">16.22.1 Options</a></li>
  348. </ul></li>
  349. <li><a id="toc-libxvid" href="#libxvid">16.23 libxvid</a>
  350. <ul class="toc-numbered-mark">
  351. <li><a id="toc-Options-46" href="#Options-46">16.23.1 Options</a></li>
  352. </ul></li>
  353. <li><a id="toc-MediaCodec" href="#MediaCodec">16.24 MediaCodec</a></li>
  354. <li><a id="toc-MediaFoundation" href="#MediaFoundation">16.25 MediaFoundation</a>
  355. <ul class="toc-numbered-mark">
  356. <li><a id="toc-Options-47" href="#Options-47">16.25.1 Options</a></li>
  357. <li><a id="toc-Examples-6" href="#Examples-6">16.25.2 Examples</a></li>
  358. </ul></li>
  359. <li><a id="toc-Microsoft-RLE" href="#Microsoft-RLE">16.26 Microsoft RLE</a>
  360. <ul class="toc-numbered-mark">
  361. <li><a id="toc-Options-48" href="#Options-48">16.26.1 Options</a></li>
  362. </ul></li>
  363. <li><a id="toc-mpeg2" href="#mpeg2">16.27 mpeg2</a>
  364. <ul class="toc-numbered-mark">
  365. <li><a id="toc-Options-49" href="#Options-49">16.27.1 Options</a></li>
  366. </ul></li>
  367. <li><a id="toc-png" href="#png">16.28 png</a>
  368. <ul class="toc-numbered-mark">
  369. <li><a id="toc-Options-50" href="#Options-50">16.28.1 Options</a></li>
  370. <li><a id="toc-Private-options-1" href="#Private-options-1">16.28.2 Private options</a></li>
  371. </ul></li>
  372. <li><a id="toc-ProRes" href="#ProRes">16.29 ProRes</a>
  373. <ul class="toc-numbered-mark">
  374. <li><a id="toc-Private-Options-for-prores_002dks" href="#Private-Options-for-prores_002dks">16.29.1 Private Options for prores-ks</a></li>
  375. <li><a id="toc-Speed-considerations" href="#Speed-considerations">16.29.2 Speed considerations</a></li>
  376. </ul></li>
  377. <li><a id="toc-QSV-Encoders" href="#QSV-Encoders">16.30 QSV Encoders</a>
  378. <ul class="toc-numbered-mark">
  379. <li><a id="toc-Ratecontrol-Method" href="#Ratecontrol-Method">16.30.1 Ratecontrol Method</a></li>
  380. <li><a id="toc-Global-Options-_002d_003e-MSDK-Options" href="#Global-Options-_002d_003e-MSDK-Options">16.30.2 Global Options -&gt; MSDK Options</a></li>
  381. <li><a id="toc-Common-Options-1" href="#Common-Options-1">16.30.3 Common Options</a></li>
  382. <li><a id="toc-Runtime-Options" href="#Runtime-Options">16.30.4 Runtime Options</a></li>
  383. <li><a id="toc-H264-options" href="#H264-options">16.30.5 H264 options</a></li>
  384. <li><a id="toc-HEVC-Options-1" href="#HEVC-Options-1">16.30.6 HEVC Options</a></li>
  385. <li><a id="toc-MPEG2-Options" href="#MPEG2-Options">16.30.7 MPEG2 Options</a></li>
  386. <li><a id="toc-VP9-Options" href="#VP9-Options">16.30.8 VP9 Options</a></li>
  387. <li><a id="toc-AV1-Options" href="#AV1-Options">16.30.9 AV1 Options</a></li>
  388. </ul></li>
  389. <li><a id="toc-snow" href="#snow">16.31 snow</a>
  390. <ul class="toc-numbered-mark">
  391. <li><a id="toc-Options-51" href="#Options-51">16.31.1 Options</a></li>
  392. </ul></li>
  393. <li><a id="toc-VAAPI-encoders" href="#VAAPI-encoders">16.32 VAAPI encoders</a></li>
  394. <li><a id="toc-vbn" href="#vbn">16.33 vbn</a>
  395. <ul class="toc-numbered-mark">
  396. <li><a id="toc-Options-52" href="#Options-52">16.33.1 Options</a></li>
  397. </ul></li>
  398. <li><a id="toc-vc2" href="#vc2">16.34 vc2</a>
  399. <ul class="toc-numbered-mark">
  400. <li><a id="toc-Options-53" href="#Options-53">16.34.1 Options</a></li>
  401. </ul></li>
  402. </ul></li>
  403. <li><a id="toc-Subtitles-Encoders" href="#Subtitles-Encoders">17 Subtitles Encoders</a>
  404. <ul class="toc-numbered-mark">
  405. <li><a id="toc-dvbsub-1" href="#dvbsub-1">17.1 dvbsub</a>
  406. <ul class="toc-numbered-mark">
  407. <li><a id="toc-Options-54" href="#Options-54">17.1.1 Options</a></li>
  408. </ul></li>
  409. <li><a id="toc-dvdsub-1" href="#dvdsub-1">17.2 dvdsub</a>
  410. <ul class="toc-numbered-mark">
  411. <li><a id="toc-Options-55" href="#Options-55">17.2.1 Options</a></li>
  412. </ul></li>
  413. <li><a id="toc-lrc" href="#lrc">17.3 lrc</a>
  414. <ul class="toc-numbered-mark">
  415. <li><a id="toc-Options-56" href="#Options-56">17.3.1 Options</a></li>
  416. </ul></li>
  417. </ul></li>
  418. <li><a id="toc-Bitstream-Filters" href="#Bitstream-Filters">18 Bitstream Filters</a>
  419. <ul class="toc-numbered-mark">
  420. <li><a id="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">18.1 aac_adtstoasc</a></li>
  421. <li><a id="toc-av1_005fmetadata" href="#av1_005fmetadata">18.2 av1_metadata</a></li>
  422. <li><a id="toc-chomp" href="#chomp">18.3 chomp</a></li>
  423. <li><a id="toc-dca_005fcore" href="#dca_005fcore">18.4 dca_core</a></li>
  424. <li><a id="toc-dovi_005frpu" href="#dovi_005frpu">18.5 dovi_rpu</a></li>
  425. <li><a id="toc-dump_005fextra" href="#dump_005fextra">18.6 dump_extra</a></li>
  426. <li><a id="toc-dv_005ferror_005fmarker" href="#dv_005ferror_005fmarker">18.7 dv_error_marker</a></li>
  427. <li><a id="toc-eac3_005fcore" href="#eac3_005fcore">18.8 eac3_core</a></li>
  428. <li><a id="toc-eia608_005fto_005fsmpte436m" href="#eia608_005fto_005fsmpte436m">18.9 eia608_to_smpte436m</a></li>
  429. <li><a id="toc-extract_005fextradata" href="#extract_005fextradata">18.10 extract_extradata</a></li>
  430. <li><a id="toc-filter_005funits" href="#filter_005funits">18.11 filter_units</a></li>
  431. <li><a id="toc-hapqa_005fextract" href="#hapqa_005fextract">18.12 hapqa_extract</a></li>
  432. <li><a id="toc-h264_005fmetadata" href="#h264_005fmetadata">18.13 h264_metadata</a></li>
  433. <li><a id="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">18.14 h264_mp4toannexb</a></li>
  434. <li><a id="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">18.15 h264_redundant_pps</a></li>
  435. <li><a id="toc-hevc_005fmetadata" href="#hevc_005fmetadata">18.16 hevc_metadata</a></li>
  436. <li><a id="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">18.17 hevc_mp4toannexb</a></li>
  437. <li><a id="toc-imxdump" href="#imxdump">18.18 imxdump</a></li>
  438. <li><a id="toc-mjpeg2jpeg" href="#mjpeg2jpeg">18.19 mjpeg2jpeg</a></li>
  439. <li><a id="toc-mjpegadump" href="#mjpegadump">18.20 mjpegadump</a></li>
  440. <li><a id="toc-mov2textsub-1" href="#mov2textsub-1">18.21 mov2textsub</a></li>
  441. <li><a id="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">18.22 mpeg2_metadata</a></li>
  442. <li><a id="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">18.23 mpeg4_unpack_bframes</a></li>
  443. <li><a id="toc-noise" href="#noise">18.24 noise</a>
  444. <ul class="toc-numbered-mark">
  445. <li><a id="toc-Examples-7" href="#Examples-7">18.24.1 Examples</a></li>
  446. </ul></li>
  447. <li><a id="toc-null" href="#null">18.25 null</a></li>
  448. <li><a id="toc-pcm_005frechunk" href="#pcm_005frechunk">18.26 pcm_rechunk</a></li>
  449. <li><a id="toc-pgs_005fframe_005fmerge" href="#pgs_005fframe_005fmerge">18.27 pgs_frame_merge</a></li>
  450. <li><a id="toc-prores_005fmetadata" href="#prores_005fmetadata">18.28 prores_metadata</a></li>
  451. <li><a id="toc-remove_005fextra" href="#remove_005fextra">18.29 remove_extra</a></li>
  452. <li><a id="toc-setts" href="#setts">18.30 setts</a></li>
  453. <li><a id="toc-showinfo" href="#showinfo">18.31 showinfo</a></li>
  454. <li><a id="toc-smpte436m_005fto_005feia608" href="#smpte436m_005fto_005feia608">18.32 smpte436m_to_eia608</a></li>
  455. <li><a id="toc-text2movsub-1" href="#text2movsub-1">18.33 text2movsub</a></li>
  456. <li><a id="toc-trace_005fheaders" href="#trace_005fheaders">18.34 trace_headers</a></li>
  457. <li><a id="toc-truehd_005fcore" href="#truehd_005fcore">18.35 truehd_core</a></li>
  458. <li><a id="toc-vp9_005fmetadata" href="#vp9_005fmetadata">18.36 vp9_metadata</a></li>
  459. <li><a id="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">18.37 vp9_superframe</a></li>
  460. <li><a id="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">18.38 vp9_superframe_split</a></li>
  461. <li><a id="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">18.39 vp9_raw_reorder</a></li>
  462. </ul></li>
  463. <li><a id="toc-Format-Options" href="#Format-Options">19 Format Options</a>
  464. <ul class="toc-numbered-mark">
  465. <li><a id="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">19.1 Format stream specifiers</a></li>
  466. </ul></li>
  467. <li><a id="toc-Demuxers" href="#Demuxers">20 Demuxers</a>
  468. <ul class="toc-numbered-mark">
  469. <li><a id="toc-aa" href="#aa">20.1 aa</a></li>
  470. <li><a id="toc-aac-1" href="#aac-1">20.2 aac</a></li>
  471. <li><a id="toc-apng" href="#apng">20.3 apng</a></li>
  472. <li><a id="toc-asf-1" href="#asf-1">20.4 asf</a></li>
  473. <li><a id="toc-concat-1" href="#concat-1">20.5 concat</a>
  474. <ul class="toc-numbered-mark">
  475. <li><a id="toc-Syntax-1" href="#Syntax-1">20.5.1 Syntax</a></li>
  476. <li><a id="toc-Options-57" href="#Options-57">20.5.2 Options</a></li>
  477. <li><a id="toc-Examples-8" href="#Examples-8">20.5.3 Examples</a></li>
  478. </ul></li>
  479. <li><a id="toc-dash-1" href="#dash-1">20.6 dash</a>
  480. <ul class="toc-numbered-mark">
  481. <li><a id="toc-Options-58" href="#Options-58">20.6.1 Options</a></li>
  482. </ul></li>
  483. <li><a id="toc-dvdvideo" href="#dvdvideo">20.7 dvdvideo</a>
  484. <ul class="toc-numbered-mark">
  485. <li><a id="toc-Background" href="#Background">20.7.1 Background</a></li>
  486. <li><a id="toc-Options-59" href="#Options-59">20.7.2 Options</a></li>
  487. <li><a id="toc-Examples-9" href="#Examples-9">20.7.3 Examples</a></li>
  488. </ul></li>
  489. <li><a id="toc-ea" href="#ea">20.8 ea</a>
  490. <ul class="toc-numbered-mark">
  491. <li><a id="toc-Options-60" href="#Options-60">20.8.1 Options</a></li>
  492. </ul></li>
  493. <li><a id="toc-imf" href="#imf">20.9 imf</a></li>
  494. <li><a id="toc-flv_002c-live_005fflv_002c-kux" href="#flv_002c-live_005fflv_002c-kux">20.10 flv, live_flv, kux</a></li>
  495. <li><a id="toc-gif-1" href="#gif-1">20.11 gif</a></li>
  496. <li><a id="toc-hls-1" href="#hls-1">20.12 hls</a></li>
  497. <li><a id="toc-image2-1" href="#image2-1">20.13 image2</a>
  498. <ul class="toc-numbered-mark">
  499. <li><a id="toc-Examples-10" href="#Examples-10">20.13.1 Examples</a></li>
  500. </ul></li>
  501. <li><a id="toc-libgme" href="#libgme">20.14 libgme</a></li>
  502. <li><a id="toc-libmodplug" href="#libmodplug">20.15 libmodplug</a></li>
  503. <li><a id="toc-libopenmpt" href="#libopenmpt">20.16 libopenmpt</a></li>
  504. <li><a id="toc-mcc" href="#mcc">20.17 mcc</a>
  505. <ul class="toc-numbered-mark">
  506. <li><a id="toc-Examples-11" href="#Examples-11">20.17.1 Examples</a></li>
  507. </ul></li>
  508. <li><a id="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">20.18 mov/mp4/3gp</a>
  509. <ul class="toc-numbered-mark">
  510. <li><a id="toc-Options-61" href="#Options-61">20.18.1 Options</a></li>
  511. <li><a id="toc-Audible-AAX" href="#Audible-AAX">20.18.2 Audible AAX</a></li>
  512. </ul></li>
  513. <li><a id="toc-mpegts" href="#mpegts">20.19 mpegts</a></li>
  514. <li><a id="toc-mpjpeg" href="#mpjpeg">20.20 mpjpeg</a></li>
  515. <li><a id="toc-rawvideo-1" href="#rawvideo-1">20.21 rawvideo</a></li>
  516. <li><a id="toc-rcwt" href="#rcwt">20.22 rcwt</a>
  517. <ul class="toc-numbered-mark">
  518. <li><a id="toc-Examples-12" href="#Examples-12">20.22.1 Examples</a></li>
  519. </ul></li>
  520. <li><a id="toc-sbg" href="#sbg">20.23 sbg</a></li>
  521. <li><a id="toc-tedcaptions" href="#tedcaptions">20.24 tedcaptions</a></li>
  522. <li><a id="toc-vapoursynth" href="#vapoursynth">20.25 vapoursynth</a></li>
  523. <li><a id="toc-w64" href="#w64">20.26 w64</a></li>
  524. <li><a id="toc-wav-1" href="#wav-1">20.27 wav</a></li>
  525. </ul></li>
  526. <li><a id="toc-Muxers" href="#Muxers">21 Muxers</a>
  527. <ul class="toc-numbered-mark">
  528. <li><a id="toc-Raw-muxers" href="#Raw-muxers">21.1 Raw muxers</a>
  529. <ul class="toc-numbered-mark">
  530. <li><a id="toc-Examples-13" href="#Examples-13">21.1.1 Examples</a></li>
  531. </ul></li>
  532. <li><a id="toc-Raw-PCM-muxers" href="#Raw-PCM-muxers">21.2 Raw PCM muxers</a></li>
  533. <li><a id="toc-MPEG_002d1_002fMPEG_002d2-program-stream-muxers" href="#MPEG_002d1_002fMPEG_002d2-program-stream-muxers">21.3 MPEG-1/MPEG-2 program stream muxers</a>
  534. <ul class="toc-numbered-mark">
  535. <li><a id="toc-Options-62" href="#Options-62">21.3.1 Options</a></li>
  536. </ul></li>
  537. <li><a id="toc-MOV_002fMPEG_002d4_002fISOMBFF-muxers" href="#MOV_002fMPEG_002d4_002fISOMBFF-muxers">21.4 MOV/MPEG-4/ISOMBFF muxers</a>
  538. <ul class="toc-numbered-mark">
  539. <li><a id="toc-Fragmentation" href="#Fragmentation">21.4.1 Fragmentation</a></li>
  540. <li><a id="toc-Options-63" href="#Options-63">21.4.2 Options</a></li>
  541. <li><a id="toc-Examples-14" href="#Examples-14">21.4.3 Examples</a></li>
  542. </ul></li>
  543. <li><a id="toc-a64-1" href="#a64-1">21.5 a64</a></li>
  544. <li><a id="toc-ac4" href="#ac4">21.6 ac4</a>
  545. <ul class="toc-numbered-mark">
  546. <li><a id="toc-Options-64" href="#Options-64">21.6.1 Options</a></li>
  547. </ul></li>
  548. <li><a id="toc-adts-1" href="#adts-1">21.7 adts</a>
  549. <ul class="toc-numbered-mark">
  550. <li><a id="toc-Options-65" href="#Options-65">21.7.1 Options</a></li>
  551. </ul></li>
  552. <li><a id="toc-aea-1" href="#aea-1">21.8 aea</a></li>
  553. <li><a id="toc-aiff-1" href="#aiff-1">21.9 aiff</a>
  554. <ul class="toc-numbered-mark">
  555. <li><a id="toc-Options-66" href="#Options-66">21.9.1 Options</a></li>
  556. </ul></li>
  557. <li><a id="toc-alp-1" href="#alp-1">21.10 alp</a>
  558. <ul class="toc-numbered-mark">
  559. <li><a id="toc-Options-67" href="#Options-67">21.10.1 Options</a></li>
  560. </ul></li>
  561. <li><a id="toc-amr" href="#amr">21.11 amr</a></li>
  562. <li><a id="toc-amv" href="#amv">21.12 amv</a></li>
  563. <li><a id="toc-apm" href="#apm">21.13 apm</a></li>
  564. <li><a id="toc-apng-1" href="#apng-1">21.14 apng</a>
  565. <ul class="toc-numbered-mark">
  566. <li><a id="toc-Options-68" href="#Options-68">21.14.1 Options</a></li>
  567. <li><a id="toc-Examples-15" href="#Examples-15">21.14.2 Examples</a></li>
  568. </ul></li>
  569. <li><a id="toc-argo_005fasf" href="#argo_005fasf">21.15 argo_asf</a>
  570. <ul class="toc-numbered-mark">
  571. <li><a id="toc-Options-69" href="#Options-69">21.15.1 Options</a></li>
  572. </ul></li>
  573. <li><a id="toc-argo_005fcvg" href="#argo_005fcvg">21.16 argo_cvg</a>
  574. <ul class="toc-numbered-mark">
  575. <li><a id="toc-Options-70" href="#Options-70">21.16.1 Options</a></li>
  576. </ul></li>
  577. <li><a id="toc-asf_002c-asf_005fstream" href="#asf_002c-asf_005fstream">21.17 asf, asf_stream</a>
  578. <ul class="toc-numbered-mark">
  579. <li><a id="toc-Options-71" href="#Options-71">21.17.1 Options</a></li>
  580. </ul></li>
  581. <li><a id="toc-ass" href="#ass">21.18 ass</a>
  582. <ul class="toc-numbered-mark">
  583. <li><a id="toc-Options-72" href="#Options-72">21.18.1 Options</a></li>
  584. </ul></li>
  585. <li><a id="toc-ast" href="#ast">21.19 ast</a>
  586. <ul class="toc-numbered-mark">
  587. <li><a id="toc-Options-73" href="#Options-73">21.19.1 Options</a></li>
  588. </ul></li>
  589. <li><a id="toc-au" href="#au">21.20 au</a></li>
  590. <li><a id="toc-avi-1" href="#avi-1">21.21 avi</a>
  591. <ul class="toc-numbered-mark">
  592. <li><a id="toc-Options-74" href="#Options-74">21.21.1 Options</a></li>
  593. </ul></li>
  594. <li><a id="toc-avif" href="#avif">21.22 avif</a>
  595. <ul class="toc-numbered-mark">
  596. <li><a id="toc-Options-75" href="#Options-75">21.22.1 Options</a></li>
  597. </ul></li>
  598. <li><a id="toc-avm2" href="#avm2">21.23 avm2</a></li>
  599. <li><a id="toc-bit" href="#bit">21.24 bit</a></li>
  600. <li><a id="toc-caf" href="#caf">21.25 caf</a></li>
  601. <li><a id="toc-codec2" href="#codec2">21.26 codec2</a></li>
  602. <li><a id="toc-chromaprint-1" href="#chromaprint-1">21.27 chromaprint</a>
  603. <ul class="toc-numbered-mark">
  604. <li><a id="toc-Options-76" href="#Options-76">21.27.1 Options</a></li>
  605. </ul></li>
  606. <li><a id="toc-crc-1" href="#crc-1">21.28 crc</a>
  607. <ul class="toc-numbered-mark">
  608. <li><a id="toc-Examples-16" href="#Examples-16">21.28.1 Examples</a></li>
  609. </ul></li>
  610. <li><a id="toc-dash-2" href="#dash-2">21.29 dash</a>
  611. <ul class="toc-numbered-mark">
  612. <li><a id="toc-Options-77" href="#Options-77">21.29.1 Options</a></li>
  613. <li><a id="toc-Example" href="#Example">21.29.2 Example</a></li>
  614. </ul></li>
  615. <li><a id="toc-daud" href="#daud">21.30 daud</a>
  616. <ul class="toc-numbered-mark">
  617. <li><a id="toc-Example-1" href="#Example-1">21.30.1 Example</a></li>
  618. </ul></li>
  619. <li><a id="toc-dv" href="#dv">21.31 dv</a>
  620. <ul class="toc-numbered-mark">
  621. <li><a id="toc-Example-2" href="#Example-2">21.31.1 Example</a></li>
  622. </ul></li>
  623. <li><a id="toc-ffmetadata" href="#ffmetadata">21.32 ffmetadata</a>
  624. <ul class="toc-numbered-mark">
  625. <li><a id="toc-Example-3" href="#Example-3">21.32.1 Example</a></li>
  626. </ul></li>
  627. <li><a id="toc-fifo-1" href="#fifo-1">21.33 fifo</a>
  628. <ul class="toc-numbered-mark">
  629. <li><a id="toc-Options-78" href="#Options-78">21.33.1 Options</a></li>
  630. <li><a id="toc-Example-4" href="#Example-4">21.33.2 Example</a></li>
  631. </ul></li>
  632. <li><a id="toc-film_005fcpk" href="#film_005fcpk">21.34 film_cpk</a></li>
  633. <li><a id="toc-filmstrip" href="#filmstrip">21.35 filmstrip</a></li>
  634. <li><a id="toc-fits" href="#fits">21.36 fits</a></li>
  635. <li><a id="toc-flac-3" href="#flac-3">21.37 flac</a>
  636. <ul class="toc-numbered-mark">
  637. <li><a id="toc-Options-79" href="#Options-79">21.37.1 Options</a></li>
  638. <li><a id="toc-Example-5" href="#Example-5">21.37.2 Example</a></li>
  639. </ul></li>
  640. <li><a id="toc-flv" href="#flv">21.38 flv</a>
  641. <ul class="toc-numbered-mark">
  642. <li><a id="toc-Options-80" href="#Options-80">21.38.1 Options</a></li>
  643. </ul></li>
  644. <li><a id="toc-framecrc-1" href="#framecrc-1">21.39 framecrc</a>
  645. <ul class="toc-numbered-mark">
  646. <li><a id="toc-Examples-17" href="#Examples-17">21.39.1 Examples</a></li>
  647. </ul></li>
  648. <li><a id="toc-framehash-1" href="#framehash-1">21.40 framehash</a>
  649. <ul class="toc-numbered-mark">
  650. <li><a id="toc-Examples-18" href="#Examples-18">21.40.1 Examples</a></li>
  651. </ul></li>
  652. <li><a id="toc-framemd5-1" href="#framemd5-1">21.41 framemd5</a>
  653. <ul class="toc-numbered-mark">
  654. <li><a id="toc-Examples-19" href="#Examples-19">21.41.1 Examples</a></li>
  655. </ul></li>
  656. <li><a id="toc-gif-2" href="#gif-2">21.42 gif</a>
  657. <ul class="toc-numbered-mark">
  658. <li><a id="toc-Options-81" href="#Options-81">21.42.1 Options</a></li>
  659. <li><a id="toc-Example-6" href="#Example-6">21.42.2 Example</a></li>
  660. </ul></li>
  661. <li><a id="toc-gxf" href="#gxf">21.43 gxf</a></li>
  662. <li><a id="toc-hash-1" href="#hash-1">21.44 hash</a>
  663. <ul class="toc-numbered-mark">
  664. <li><a id="toc-Examples-20" href="#Examples-20">21.44.1 Examples</a></li>
  665. </ul></li>
  666. <li><a id="toc-hds-1" href="#hds-1">21.45 hds</a>
  667. <ul class="toc-numbered-mark">
  668. <li><a id="toc-Options-82" href="#Options-82">21.45.1 Options</a></li>
  669. <li><a id="toc-Example-7" href="#Example-7">21.45.2 Example</a></li>
  670. </ul></li>
  671. <li><a id="toc-hls-2" href="#hls-2">21.46 hls</a>
  672. <ul class="toc-numbered-mark">
  673. <li><a id="toc-Options-83" href="#Options-83">21.46.1 Options</a></li>
  674. </ul></li>
  675. <li><a id="toc-iamf" href="#iamf">21.47 iamf</a></li>
  676. <li><a id="toc-ico-1" href="#ico-1">21.48 ico</a></li>
  677. <li><a id="toc-ilbc" href="#ilbc">21.49 ilbc</a></li>
  678. <li><a id="toc-image2_002c-image2pipe" href="#image2_002c-image2pipe">21.50 image2, image2pipe</a>
  679. <ul class="toc-numbered-mark">
  680. <li><a id="toc-Options-84" href="#Options-84">21.50.1 Options</a></li>
  681. <li><a id="toc-Examples-21" href="#Examples-21">21.50.2 Examples</a></li>
  682. </ul></li>
  683. <li><a id="toc-ircam" href="#ircam">21.51 ircam</a></li>
  684. <li><a id="toc-ivf" href="#ivf">21.52 ivf</a></li>
  685. <li><a id="toc-jacosub" href="#jacosub">21.53 jacosub</a></li>
  686. <li><a id="toc-kvag" href="#kvag">21.54 kvag</a></li>
  687. <li><a id="toc-lc3" href="#lc3">21.55 lc3</a></li>
  688. <li><a id="toc-lrc-1" href="#lrc-1">21.56 lrc</a>
  689. <ul class="toc-numbered-mark">
  690. <li><a id="toc-Metadata" href="#Metadata">21.56.1 Metadata</a></li>
  691. </ul></li>
  692. <li><a id="toc-matroska" href="#matroska">21.57 matroska</a>
  693. <ul class="toc-numbered-mark">
  694. <li><a id="toc-Metadata-1" href="#Metadata-1">21.57.1 Metadata</a></li>
  695. <li><a id="toc-Options-85" href="#Options-85">21.57.2 Options</a></li>
  696. </ul></li>
  697. <li><a id="toc-md5-1" href="#md5-1">21.58 md5</a>
  698. <ul class="toc-numbered-mark">
  699. <li><a id="toc-Examples-22" href="#Examples-22">21.58.1 Examples</a></li>
  700. </ul></li>
  701. <li><a id="toc-mcc-1" href="#mcc-1">21.59 mcc</a>
  702. <ul class="toc-numbered-mark">
  703. <li><a id="toc-Options-86" href="#Options-86">21.59.1 Options</a></li>
  704. <li><a id="toc-Examples-23" href="#Examples-23">21.59.2 Examples</a></li>
  705. </ul></li>
  706. <li><a id="toc-microdvd" href="#microdvd">21.60 microdvd</a></li>
  707. <li><a id="toc-mmf" href="#mmf">21.61 mmf</a></li>
  708. <li><a id="toc-mp3" href="#mp3">21.62 mp3</a></li>
  709. <li><a id="toc-mpegts-1" href="#mpegts-1">21.63 mpegts</a>
  710. <ul class="toc-numbered-mark">
  711. <li><a id="toc-Options-87" href="#Options-87">21.63.1 Options</a></li>
  712. <li><a id="toc-Example-8" href="#Example-8">21.63.2 Example</a></li>
  713. </ul></li>
  714. <li><a id="toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">21.64 mxf, mxf_d10, mxf_opatom</a>
  715. <ul class="toc-numbered-mark">
  716. <li><a id="toc-Options-88" href="#Options-88">21.64.1 Options</a></li>
  717. </ul></li>
  718. <li><a id="toc-null-1" href="#null-1">21.65 null</a></li>
  719. <li><a id="toc-nut" href="#nut">21.66 nut</a></li>
  720. <li><a id="toc-ogg" href="#ogg">21.67 ogg</a></li>
  721. <li><a id="toc-rcwt-1" href="#rcwt-1">21.68 rcwt</a>
  722. <ul class="toc-numbered-mark">
  723. <li><a id="toc-Examples-24" href="#Examples-24">21.68.1 Examples</a></li>
  724. </ul></li>
  725. <li><a id="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">21.69 segment, stream_segment, ssegment</a>
  726. <ul class="toc-numbered-mark">
  727. <li><a id="toc-Options-89" href="#Options-89">21.69.1 Options</a></li>
  728. <li><a id="toc-Examples-25" href="#Examples-25">21.69.2 Examples</a></li>
  729. </ul></li>
  730. <li><a id="toc-smoothstreaming" href="#smoothstreaming">21.70 smoothstreaming</a></li>
  731. <li><a id="toc-streamhash-1" href="#streamhash-1">21.71 streamhash</a>
  732. <ul class="toc-numbered-mark">
  733. <li><a id="toc-Examples-26" href="#Examples-26">21.71.1 Examples</a></li>
  734. </ul></li>
  735. <li><a id="toc-tee-1" href="#tee-1">21.72 tee</a>
  736. <ul class="toc-numbered-mark">
  737. <li><a id="toc-Options-90" href="#Options-90">21.72.1 Options</a></li>
  738. <li><a id="toc-Examples-27" href="#Examples-27">21.72.2 Examples</a></li>
  739. </ul></li>
  740. <li><a id="toc-webm_005fchunk" href="#webm_005fchunk">21.73 webm_chunk</a>
  741. <ul class="toc-numbered-mark">
  742. <li><a id="toc-Options-91" href="#Options-91">21.73.1 Options</a></li>
  743. <li><a id="toc-Example-9" href="#Example-9">21.73.2 Example</a></li>
  744. </ul></li>
  745. <li><a id="toc-webm_005fdash_005fmanifest" href="#webm_005fdash_005fmanifest">21.74 webm_dash_manifest</a>
  746. <ul class="toc-numbered-mark">
  747. <li><a id="toc-Options-92" href="#Options-92">21.74.1 Options</a></li>
  748. <li><a id="toc-Example-10" href="#Example-10">21.74.2 Example</a></li>
  749. </ul></li>
  750. <li><a id="toc-whip-1" href="#whip-1">21.75 whip</a>
  751. <ul class="toc-numbered-mark">
  752. <li><a id="toc-Options-93" href="#Options-93">21.75.1 Options</a></li>
  753. </ul></li>
  754. </ul></li>
  755. <li><a id="toc-Metadata-2" href="#Metadata-2">22 Metadata</a></li>
  756. <li><a id="toc-Protocol-Options" href="#Protocol-Options">23 Protocol Options</a></li>
  757. <li><a id="toc-Protocols" href="#Protocols">24 Protocols</a>
  758. <ul class="toc-numbered-mark">
  759. <li><a id="toc-amqp" href="#amqp">24.1 amqp</a></li>
  760. <li><a id="toc-async" href="#async">24.2 async</a></li>
  761. <li><a id="toc-bluray" href="#bluray">24.3 bluray</a></li>
  762. <li><a id="toc-cache" href="#cache">24.4 cache</a></li>
  763. <li><a id="toc-concat-2" href="#concat-2">24.5 concat</a></li>
  764. <li><a id="toc-concatf" href="#concatf">24.6 concatf</a></li>
  765. <li><a id="toc-crypto" href="#crypto">24.7 crypto</a></li>
  766. <li><a id="toc-data" href="#data">24.8 data</a></li>
  767. <li><a id="toc-fd" href="#fd">24.9 fd</a></li>
  768. <li><a id="toc-file" href="#file">24.10 file</a></li>
  769. <li><a id="toc-ftp" href="#ftp">24.11 ftp</a></li>
  770. <li><a id="toc-gopher" href="#gopher">24.12 gopher</a></li>
  771. <li><a id="toc-gophers" href="#gophers">24.13 gophers</a></li>
  772. <li><a id="toc-hls-3" href="#hls-3">24.14 hls</a></li>
  773. <li><a id="toc-http" href="#http">24.15 http</a>
  774. <ul class="toc-numbered-mark">
  775. <li><a id="toc-HTTP-Cookies" href="#HTTP-Cookies">24.15.1 HTTP Cookies</a></li>
  776. </ul></li>
  777. <li><a id="toc-Icecast" href="#Icecast">24.16 Icecast</a></li>
  778. <li><a id="toc-ipfs" href="#ipfs">24.17 ipfs</a></li>
  779. <li><a id="toc-mmst" href="#mmst">24.18 mmst</a></li>
  780. <li><a id="toc-mmsh" href="#mmsh">24.19 mmsh</a></li>
  781. <li><a id="toc-md5-2" href="#md5-2">24.20 md5</a></li>
  782. <li><a id="toc-pipe" href="#pipe">24.21 pipe</a></li>
  783. <li><a id="toc-prompeg" href="#prompeg">24.22 prompeg</a></li>
  784. <li><a id="toc-rist" href="#rist">24.23 rist</a></li>
  785. <li><a id="toc-rtmp" href="#rtmp">24.24 rtmp</a></li>
  786. <li><a id="toc-rtmpe" href="#rtmpe">24.25 rtmpe</a></li>
  787. <li><a id="toc-rtmps" href="#rtmps">24.26 rtmps</a></li>
  788. <li><a id="toc-rtmpt" href="#rtmpt">24.27 rtmpt</a></li>
  789. <li><a id="toc-rtmpte" href="#rtmpte">24.28 rtmpte</a></li>
  790. <li><a id="toc-rtmpts" href="#rtmpts">24.29 rtmpts</a></li>
  791. <li><a id="toc-libsmbclient" href="#libsmbclient">24.30 libsmbclient</a></li>
  792. <li><a id="toc-libssh" href="#libssh">24.31 libssh</a></li>
  793. <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">24.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  794. <li><a id="toc-rtp" href="#rtp">24.33 rtp</a></li>
  795. <li><a id="toc-rtsp" href="#rtsp">24.34 rtsp</a>
  796. <ul class="toc-numbered-mark">
  797. <li><a id="toc-Muxer" href="#Muxer">24.34.1 Muxer</a></li>
  798. <li><a id="toc-Demuxer" href="#Demuxer">24.34.2 Demuxer</a></li>
  799. <li><a id="toc-Examples-28" href="#Examples-28">24.34.3 Examples</a></li>
  800. </ul></li>
  801. <li><a id="toc-sap" href="#sap">24.35 sap</a>
  802. <ul class="toc-numbered-mark">
  803. <li><a id="toc-Muxer-1" href="#Muxer-1">24.35.1 Muxer</a></li>
  804. <li><a id="toc-Demuxer-1" href="#Demuxer-1">24.35.2 Demuxer</a></li>
  805. </ul></li>
  806. <li><a id="toc-sctp" href="#sctp">24.36 sctp</a></li>
  807. <li><a id="toc-srt" href="#srt">24.37 srt</a></li>
  808. <li><a id="toc-srtp" href="#srtp">24.38 srtp</a></li>
  809. <li><a id="toc-subfile" href="#subfile">24.39 subfile</a></li>
  810. <li><a id="toc-tee-2" href="#tee-2">24.40 tee</a></li>
  811. <li><a id="toc-tcp" href="#tcp">24.41 tcp</a></li>
  812. <li><a id="toc-tls" href="#tls">24.42 tls</a></li>
  813. <li><a id="toc-dtls" href="#dtls">24.43 dtls</a></li>
  814. <li><a id="toc-udp" href="#udp">24.44 udp</a>
  815. <ul class="toc-numbered-mark">
  816. <li><a id="toc-Examples-29" href="#Examples-29">24.44.1 Examples</a></li>
  817. </ul></li>
  818. <li><a id="toc-unix" href="#unix">24.45 unix</a></li>
  819. <li><a id="toc-zmq" href="#zmq">24.46 zmq</a></li>
  820. </ul></li>
  821. <li><a id="toc-Device-Options" href="#Device-Options">25 Device Options</a></li>
  822. <li><a id="toc-Input-Devices" href="#Input-Devices">26 Input Devices</a>
  823. <ul class="toc-numbered-mark">
  824. <li><a id="toc-alsa" href="#alsa">26.1 alsa</a>
  825. <ul class="toc-numbered-mark">
  826. <li><a id="toc-Options-94" href="#Options-94">26.1.1 Options</a></li>
  827. </ul></li>
  828. <li><a id="toc-android_005fcamera" href="#android_005fcamera">26.2 android_camera</a>
  829. <ul class="toc-numbered-mark">
  830. <li><a id="toc-Options-95" href="#Options-95">26.2.1 Options</a></li>
  831. </ul></li>
  832. <li><a id="toc-avfoundation" href="#avfoundation">26.3 avfoundation</a>
  833. <ul class="toc-numbered-mark">
  834. <li><a id="toc-Options-96" href="#Options-96">26.3.1 Options</a></li>
  835. <li><a id="toc-Examples-30" href="#Examples-30">26.3.2 Examples</a></li>
  836. </ul></li>
  837. <li><a id="toc-decklink" href="#decklink">26.4 decklink</a>
  838. <ul class="toc-numbered-mark">
  839. <li><a id="toc-Options-97" href="#Options-97">26.4.1 Options</a></li>
  840. <li><a id="toc-Examples-31" href="#Examples-31">26.4.2 Examples</a></li>
  841. </ul></li>
  842. <li><a id="toc-dshow" href="#dshow">26.5 dshow</a>
  843. <ul class="toc-numbered-mark">
  844. <li><a id="toc-Options-98" href="#Options-98">26.5.1 Options</a></li>
  845. <li><a id="toc-Examples-32" href="#Examples-32">26.5.2 Examples</a></li>
  846. </ul></li>
  847. <li><a id="toc-fbdev" href="#fbdev">26.6 fbdev</a>
  848. <ul class="toc-numbered-mark">
  849. <li><a id="toc-Options-99" href="#Options-99">26.6.1 Options</a></li>
  850. </ul></li>
  851. <li><a id="toc-gdigrab" href="#gdigrab">26.7 gdigrab</a>
  852. <ul class="toc-numbered-mark">
  853. <li><a id="toc-Options-100" href="#Options-100">26.7.1 Options</a></li>
  854. </ul></li>
  855. <li><a id="toc-iec61883" href="#iec61883">26.8 iec61883</a>
  856. <ul class="toc-numbered-mark">
  857. <li><a id="toc-Options-101" href="#Options-101">26.8.1 Options</a></li>
  858. <li><a id="toc-Examples-33" href="#Examples-33">26.8.2 Examples</a></li>
  859. </ul></li>
  860. <li><a id="toc-jack" href="#jack">26.9 jack</a>
  861. <ul class="toc-numbered-mark">
  862. <li><a id="toc-Options-102" href="#Options-102">26.9.1 Options</a></li>
  863. </ul></li>
  864. <li><a id="toc-kmsgrab" href="#kmsgrab">26.10 kmsgrab</a>
  865. <ul class="toc-numbered-mark">
  866. <li><a id="toc-Options-103" href="#Options-103">26.10.1 Options</a></li>
  867. <li><a id="toc-Examples-34" href="#Examples-34">26.10.2 Examples</a></li>
  868. </ul></li>
  869. <li><a id="toc-lavfi" href="#lavfi">26.11 lavfi</a>
  870. <ul class="toc-numbered-mark">
  871. <li><a id="toc-Options-104" href="#Options-104">26.11.1 Options</a></li>
  872. <li><a id="toc-Examples-35" href="#Examples-35">26.11.2 Examples</a></li>
  873. </ul></li>
  874. <li><a id="toc-libcdio" href="#libcdio">26.12 libcdio</a>
  875. <ul class="toc-numbered-mark">
  876. <li><a id="toc-Options-105" href="#Options-105">26.12.1 Options</a></li>
  877. </ul></li>
  878. <li><a id="toc-libdc1394" href="#libdc1394">26.13 libdc1394</a>
  879. <ul class="toc-numbered-mark">
  880. <li><a id="toc-Options-106" href="#Options-106">26.13.1 Options</a></li>
  881. </ul></li>
  882. <li><a id="toc-openal" href="#openal">26.14 openal</a>
  883. <ul class="toc-numbered-mark">
  884. <li><a id="toc-Options-107" href="#Options-107">26.14.1 Options</a></li>
  885. <li><a id="toc-Examples-36" href="#Examples-36">26.14.2 Examples</a></li>
  886. </ul></li>
  887. <li><a id="toc-oss" href="#oss">26.15 oss</a>
  888. <ul class="toc-numbered-mark">
  889. <li><a id="toc-Options-108" href="#Options-108">26.15.1 Options</a></li>
  890. </ul></li>
  891. <li><a id="toc-pulse" href="#pulse">26.16 pulse</a>
  892. <ul class="toc-numbered-mark">
  893. <li><a id="toc-Options-109" href="#Options-109">26.16.1 Options</a></li>
  894. <li><a id="toc-Examples-37" href="#Examples-37">26.16.2 Examples</a></li>
  895. </ul></li>
  896. <li><a id="toc-sndio" href="#sndio">26.17 sndio</a>
  897. <ul class="toc-numbered-mark">
  898. <li><a id="toc-Options-110" href="#Options-110">26.17.1 Options</a></li>
  899. </ul></li>
  900. <li><a id="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">26.18 video4linux2, v4l2</a>
  901. <ul class="toc-numbered-mark">
  902. <li><a id="toc-Options-111" href="#Options-111">26.18.1 Options</a></li>
  903. </ul></li>
  904. <li><a id="toc-vfwcap" href="#vfwcap">26.19 vfwcap</a>
  905. <ul class="toc-numbered-mark">
  906. <li><a id="toc-Options-112" href="#Options-112">26.19.1 Options</a></li>
  907. </ul></li>
  908. <li><a id="toc-x11grab" href="#x11grab">26.20 x11grab</a>
  909. <ul class="toc-numbered-mark">
  910. <li><a id="toc-Options-113" href="#Options-113">26.20.1 Options</a></li>
  911. </ul></li>
  912. </ul></li>
  913. <li><a id="toc-Output-Devices" href="#Output-Devices">27 Output Devices</a>
  914. <ul class="toc-numbered-mark">
  915. <li><a id="toc-alsa-1" href="#alsa-1">27.1 alsa</a>
  916. <ul class="toc-numbered-mark">
  917. <li><a id="toc-Examples-38" href="#Examples-38">27.1.1 Examples</a></li>
  918. </ul></li>
  919. <li><a id="toc-AudioToolbox" href="#AudioToolbox">27.2 AudioToolbox</a>
  920. <ul class="toc-numbered-mark">
  921. <li><a id="toc-Options-114" href="#Options-114">27.2.1 Options</a></li>
  922. <li><a id="toc-Examples-39" href="#Examples-39">27.2.2 Examples</a></li>
  923. </ul></li>
  924. <li><a id="toc-caca" href="#caca">27.3 caca</a>
  925. <ul class="toc-numbered-mark">
  926. <li><a id="toc-Options-115" href="#Options-115">27.3.1 Options</a></li>
  927. <li><a id="toc-Examples-40" href="#Examples-40">27.3.2 Examples</a></li>
  928. </ul></li>
  929. <li><a id="toc-decklink-1" href="#decklink-1">27.4 decklink</a>
  930. <ul class="toc-numbered-mark">
  931. <li><a id="toc-Options-116" href="#Options-116">27.4.1 Options</a></li>
  932. <li><a id="toc-Examples-41" href="#Examples-41">27.4.2 Examples</a></li>
  933. </ul></li>
  934. <li><a id="toc-fbdev-1" href="#fbdev-1">27.5 fbdev</a>
  935. <ul class="toc-numbered-mark">
  936. <li><a id="toc-Options-117" href="#Options-117">27.5.1 Options</a></li>
  937. <li><a id="toc-Examples-42" href="#Examples-42">27.5.2 Examples</a></li>
  938. </ul></li>
  939. <li><a id="toc-oss-1" href="#oss-1">27.6 oss</a></li>
  940. <li><a id="toc-pulse-1" href="#pulse-1">27.7 pulse</a>
  941. <ul class="toc-numbered-mark">
  942. <li><a id="toc-Options-118" href="#Options-118">27.7.1 Options</a></li>
  943. <li><a id="toc-Examples-43" href="#Examples-43">27.7.2 Examples</a></li>
  944. </ul></li>
  945. <li><a id="toc-sndio-1" href="#sndio-1">27.8 sndio</a></li>
  946. <li><a id="toc-v4l2" href="#v4l2">27.9 v4l2</a></li>
  947. <li><a id="toc-xv" href="#xv">27.10 xv</a>
  948. <ul class="toc-numbered-mark">
  949. <li><a id="toc-Options-119" href="#Options-119">27.10.1 Options</a></li>
  950. <li><a id="toc-Examples-44" href="#Examples-44">27.10.2 Examples</a></li>
  951. </ul></li>
  952. </ul></li>
  953. <li><a id="toc-Resampler-Options" href="#Resampler-Options">28 Resampler Options</a></li>
  954. <li><a id="toc-Scaler-Options" href="#Scaler-Options">29 Scaler Options</a></li>
  955. <li><a id="toc-Filtering-Introduction" href="#Filtering-Introduction">30 Filtering Introduction</a></li>
  956. <li><a id="toc-graph2dot" href="#graph2dot">31 graph2dot</a></li>
  957. <li><a id="toc-Filtergraph-description" href="#Filtergraph-description">32 Filtergraph description</a>
  958. <ul class="toc-numbered-mark">
  959. <li><a id="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">32.1 Filtergraph syntax</a></li>
  960. <li><a id="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></li>
  961. </ul></li>
  962. <li><a id="toc-Timeline-editing" href="#Timeline-editing">33 Timeline editing</a></li>
  963. <li><a id="toc-Changing-options-at-runtime-with-a-command" href="#Changing-options-at-runtime-with-a-command">34 Changing options at runtime with a command</a></li>
  964. <li><a id="toc-Options-for-filters-with-several-inputs-_0028framesync_0029" href="#Options-for-filters-with-several-inputs-_0028framesync_0029">35 Options for filters with several inputs (framesync)</a></li>
  965. <li><a id="toc-Audio-Filters" href="#Audio-Filters">36 Audio Filters</a>
  966. <ul class="toc-numbered-mark">
  967. <li><a id="toc-aap" href="#aap">36.1 aap</a></li>
  968. <li><a id="toc-acompressor" href="#acompressor">36.2 acompressor</a>
  969. <ul class="toc-numbered-mark">
  970. <li><a id="toc-Commands" href="#Commands">36.2.1 Commands</a></li>
  971. </ul></li>
  972. <li><a id="toc-acontrast" href="#acontrast">36.3 acontrast</a></li>
  973. <li><a id="toc-acopy" href="#acopy">36.4 acopy</a></li>
  974. <li><a id="toc-acrossfade" href="#acrossfade">36.5 acrossfade</a>
  975. <ul class="toc-numbered-mark">
  976. <li><a id="toc-Examples-45" href="#Examples-45">36.5.1 Examples</a></li>
  977. </ul></li>
  978. <li><a id="toc-acrossover" href="#acrossover">36.6 acrossover</a>
  979. <ul class="toc-numbered-mark">
  980. <li><a id="toc-Examples-46" href="#Examples-46">36.6.1 Examples</a></li>
  981. </ul></li>
  982. <li><a id="toc-acrusher" href="#acrusher">36.7 acrusher</a>
  983. <ul class="toc-numbered-mark">
  984. <li><a id="toc-Commands-1" href="#Commands-1">36.7.1 Commands</a></li>
  985. </ul></li>
  986. <li><a id="toc-acue" href="#acue">36.8 acue</a></li>
  987. <li><a id="toc-adeclick" href="#adeclick">36.9 adeclick</a></li>
  988. <li><a id="toc-adeclip" href="#adeclip">36.10 adeclip</a></li>
  989. <li><a id="toc-adecorrelate" href="#adecorrelate">36.11 adecorrelate</a></li>
  990. <li><a id="toc-adelay" href="#adelay">36.12 adelay</a>
  991. <ul class="toc-numbered-mark">
  992. <li><a id="toc-Examples-47" href="#Examples-47">36.12.1 Examples</a></li>
  993. </ul></li>
  994. <li><a id="toc-adenorm" href="#adenorm">36.13 adenorm</a>
  995. <ul class="toc-numbered-mark">
  996. <li><a id="toc-Commands-2" href="#Commands-2">36.13.1 Commands</a></li>
  997. </ul></li>
  998. <li><a id="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">36.14 aderivative, aintegral</a></li>
  999. <li><a id="toc-adrc" href="#adrc">36.15 adrc</a>
  1000. <ul class="toc-numbered-mark">
  1001. <li><a id="toc-Commands-3" href="#Commands-3">36.15.1 Commands</a></li>
  1002. <li><a id="toc-Examples-48" href="#Examples-48">36.15.2 Examples</a></li>
  1003. </ul></li>
  1004. <li><a id="toc-adynamicequalizer" href="#adynamicequalizer">36.16 adynamicequalizer</a>
  1005. <ul class="toc-numbered-mark">
  1006. <li><a id="toc-Commands-4" href="#Commands-4">36.16.1 Commands</a></li>
  1007. </ul></li>
  1008. <li><a id="toc-adynamicsmooth" href="#adynamicsmooth">36.17 adynamicsmooth</a>
  1009. <ul class="toc-numbered-mark">
  1010. <li><a id="toc-Commands-5" href="#Commands-5">36.17.1 Commands</a></li>
  1011. </ul></li>
  1012. <li><a id="toc-aecho" href="#aecho">36.18 aecho</a>
  1013. <ul class="toc-numbered-mark">
  1014. <li><a id="toc-Examples-49" href="#Examples-49">36.18.1 Examples</a></li>
  1015. </ul></li>
  1016. <li><a id="toc-aemphasis" href="#aemphasis">36.19 aemphasis</a>
  1017. <ul class="toc-numbered-mark">
  1018. <li><a id="toc-Commands-6" href="#Commands-6">36.19.1 Commands</a></li>
  1019. </ul></li>
  1020. <li><a id="toc-aeval" href="#aeval">36.20 aeval</a>
  1021. <ul class="toc-numbered-mark">
  1022. <li><a id="toc-Examples-50" href="#Examples-50">36.20.1 Examples</a></li>
  1023. </ul></li>
  1024. <li><a id="toc-aexciter" href="#aexciter">36.21 aexciter</a>
  1025. <ul class="toc-numbered-mark">
  1026. <li><a id="toc-Commands-7" href="#Commands-7">36.21.1 Commands</a></li>
  1027. </ul></li>
  1028. <li><a id="toc-afade-1" href="#afade-1">36.22 afade</a>
  1029. <ul class="toc-numbered-mark">
  1030. <li><a id="toc-Commands-8" href="#Commands-8">36.22.1 Commands</a></li>
  1031. <li><a id="toc-Examples-51" href="#Examples-51">36.22.2 Examples</a></li>
  1032. </ul></li>
  1033. <li><a id="toc-afftdn" href="#afftdn">36.23 afftdn</a>
  1034. <ul class="toc-numbered-mark">
  1035. <li><a id="toc-Commands-9" href="#Commands-9">36.23.1 Commands</a></li>
  1036. <li><a id="toc-Examples-52" href="#Examples-52">36.23.2 Examples</a></li>
  1037. </ul></li>
  1038. <li><a id="toc-afftfilt" href="#afftfilt">36.24 afftfilt</a>
  1039. <ul class="toc-numbered-mark">
  1040. <li><a id="toc-Examples-53" href="#Examples-53">36.24.1 Examples</a></li>
  1041. </ul></li>
  1042. <li><a id="toc-afir-1" href="#afir-1">36.25 afir</a>
  1043. <ul class="toc-numbered-mark">
  1044. <li><a id="toc-Examples-54" href="#Examples-54">36.25.1 Examples</a></li>
  1045. </ul></li>
  1046. <li><a id="toc-aformat-1" href="#aformat-1">36.26 aformat</a></li>
  1047. <li><a id="toc-afreqshift" href="#afreqshift">36.27 afreqshift</a>
  1048. <ul class="toc-numbered-mark">
  1049. <li><a id="toc-Commands-10" href="#Commands-10">36.27.1 Commands</a></li>
  1050. </ul></li>
  1051. <li><a id="toc-afwtdn" href="#afwtdn">36.28 afwtdn</a>
  1052. <ul class="toc-numbered-mark">
  1053. <li><a id="toc-Commands-11" href="#Commands-11">36.28.1 Commands</a></li>
  1054. </ul></li>
  1055. <li><a id="toc-agate" href="#agate">36.29 agate</a>
  1056. <ul class="toc-numbered-mark">
  1057. <li><a id="toc-Commands-12" href="#Commands-12">36.29.1 Commands</a></li>
  1058. </ul></li>
  1059. <li><a id="toc-aiir" href="#aiir">36.30 aiir</a>
  1060. <ul class="toc-numbered-mark">
  1061. <li><a id="toc-Examples-55" href="#Examples-55">36.30.1 Examples</a></li>
  1062. </ul></li>
  1063. <li><a id="toc-alimiter" href="#alimiter">36.31 alimiter</a></li>
  1064. <li><a id="toc-allpass" href="#allpass">36.32 allpass</a>
  1065. <ul class="toc-numbered-mark">
  1066. <li><a id="toc-Commands-13" href="#Commands-13">36.32.1 Commands</a></li>
  1067. </ul></li>
  1068. <li><a id="toc-aloop" href="#aloop">36.33 aloop</a></li>
  1069. <li><a id="toc-amerge-1" href="#amerge-1">36.34 amerge</a>
  1070. <ul class="toc-numbered-mark">
  1071. <li><a id="toc-Examples-56" href="#Examples-56">36.34.1 Examples</a></li>
  1072. </ul></li>
  1073. <li><a id="toc-amix" href="#amix">36.35 amix</a>
  1074. <ul class="toc-numbered-mark">
  1075. <li><a id="toc-Examples-57" href="#Examples-57">36.35.1 Examples</a></li>
  1076. <li><a id="toc-Commands-14" href="#Commands-14">36.35.2 Commands</a></li>
  1077. </ul></li>
  1078. <li><a id="toc-amultiply" href="#amultiply">36.36 amultiply</a></li>
  1079. <li><a id="toc-anequalizer" href="#anequalizer">36.37 anequalizer</a>
  1080. <ul class="toc-numbered-mark">
  1081. <li><a id="toc-Examples-58" href="#Examples-58">36.37.1 Examples</a></li>
  1082. <li><a id="toc-Commands-15" href="#Commands-15">36.37.2 Commands</a></li>
  1083. </ul></li>
  1084. <li><a id="toc-anlmdn" href="#anlmdn">36.38 anlmdn</a>
  1085. <ul class="toc-numbered-mark">
  1086. <li><a id="toc-Commands-16" href="#Commands-16">36.38.1 Commands</a></li>
  1087. </ul></li>
  1088. <li><a id="toc-anlmf_002c-anlms" href="#anlmf_002c-anlms">36.39 anlmf, anlms</a>
  1089. <ul class="toc-numbered-mark">
  1090. <li><a id="toc-Examples-59" href="#Examples-59">36.39.1 Examples</a></li>
  1091. <li><a id="toc-Commands-17" href="#Commands-17">36.39.2 Commands</a></li>
  1092. </ul></li>
  1093. <li><a id="toc-anull" href="#anull">36.40 anull</a></li>
  1094. <li><a id="toc-apad" href="#apad">36.41 apad</a>
  1095. <ul class="toc-numbered-mark">
  1096. <li><a id="toc-Examples-60" href="#Examples-60">36.41.1 Examples</a></li>
  1097. </ul></li>
  1098. <li><a id="toc-aphaser" href="#aphaser">36.42 aphaser</a></li>
  1099. <li><a id="toc-aphaseshift" href="#aphaseshift">36.43 aphaseshift</a>
  1100. <ul class="toc-numbered-mark">
  1101. <li><a id="toc-Commands-18" href="#Commands-18">36.43.1 Commands</a></li>
  1102. </ul></li>
  1103. <li><a id="toc-apsnr" href="#apsnr">36.44 apsnr</a></li>
  1104. <li><a id="toc-apsyclip" href="#apsyclip">36.45 apsyclip</a>
  1105. <ul class="toc-numbered-mark">
  1106. <li><a id="toc-Commands-19" href="#Commands-19">36.45.1 Commands</a></li>
  1107. </ul></li>
  1108. <li><a id="toc-apulsator" href="#apulsator">36.46 apulsator</a></li>
  1109. <li><a id="toc-aresample-1" href="#aresample-1">36.47 aresample</a>
  1110. <ul class="toc-numbered-mark">
  1111. <li><a id="toc-Examples-61" href="#Examples-61">36.47.1 Examples</a></li>
  1112. </ul></li>
  1113. <li><a id="toc-areverse" href="#areverse">36.48 areverse</a>
  1114. <ul class="toc-numbered-mark">
  1115. <li><a id="toc-Examples-62" href="#Examples-62">36.48.1 Examples</a></li>
  1116. </ul></li>
  1117. <li><a id="toc-arls" href="#arls">36.49 arls</a></li>
  1118. <li><a id="toc-arnndn" href="#arnndn">36.50 arnndn</a>
  1119. <ul class="toc-numbered-mark">
  1120. <li><a id="toc-Commands-20" href="#Commands-20">36.50.1 Commands</a></li>
  1121. </ul></li>
  1122. <li><a id="toc-asdr" href="#asdr">36.51 asdr</a></li>
  1123. <li><a id="toc-asetnsamples" href="#asetnsamples">36.52 asetnsamples</a></li>
  1124. <li><a id="toc-asetrate" href="#asetrate">36.53 asetrate</a></li>
  1125. <li><a id="toc-ashowinfo" href="#ashowinfo">36.54 ashowinfo</a></li>
  1126. <li><a id="toc-asisdr" href="#asisdr">36.55 asisdr</a></li>
  1127. <li><a id="toc-asoftclip" href="#asoftclip">36.56 asoftclip</a>
  1128. <ul class="toc-numbered-mark">
  1129. <li><a id="toc-Commands-21" href="#Commands-21">36.56.1 Commands</a></li>
  1130. </ul></li>
  1131. <li><a id="toc-aspectralstats" href="#aspectralstats">36.57 aspectralstats</a></li>
  1132. <li><a id="toc-asr" href="#asr">36.58 asr</a></li>
  1133. <li><a id="toc-astats-1" href="#astats-1">36.59 astats</a></li>
  1134. <li><a id="toc-asubboost" href="#asubboost">36.60 asubboost</a>
  1135. <ul class="toc-numbered-mark">
  1136. <li><a id="toc-Commands-22" href="#Commands-22">36.60.1 Commands</a></li>
  1137. </ul></li>
  1138. <li><a id="toc-asubcut" href="#asubcut">36.61 asubcut</a>
  1139. <ul class="toc-numbered-mark">
  1140. <li><a id="toc-Commands-23" href="#Commands-23">36.61.1 Commands</a></li>
  1141. </ul></li>
  1142. <li><a id="toc-asupercut" href="#asupercut">36.62 asupercut</a>
  1143. <ul class="toc-numbered-mark">
  1144. <li><a id="toc-Commands-24" href="#Commands-24">36.62.1 Commands</a></li>
  1145. </ul></li>
  1146. <li><a id="toc-asuperpass" href="#asuperpass">36.63 asuperpass</a>
  1147. <ul class="toc-numbered-mark">
  1148. <li><a id="toc-Commands-25" href="#Commands-25">36.63.1 Commands</a></li>
  1149. </ul></li>
  1150. <li><a id="toc-asuperstop" href="#asuperstop">36.64 asuperstop</a>
  1151. <ul class="toc-numbered-mark">
  1152. <li><a id="toc-Commands-26" href="#Commands-26">36.64.1 Commands</a></li>
  1153. </ul></li>
  1154. <li><a id="toc-atempo" href="#atempo">36.65 atempo</a>
  1155. <ul class="toc-numbered-mark">
  1156. <li><a id="toc-Examples-63" href="#Examples-63">36.65.1 Examples</a></li>
  1157. <li><a id="toc-Commands-27" href="#Commands-27">36.65.2 Commands</a></li>
  1158. </ul></li>
  1159. <li><a id="toc-atilt" href="#atilt">36.66 atilt</a>
  1160. <ul class="toc-numbered-mark">
  1161. <li><a id="toc-Commands-28" href="#Commands-28">36.66.1 Commands</a></li>
  1162. </ul></li>
  1163. <li><a id="toc-atrim" href="#atrim">36.67 atrim</a></li>
  1164. <li><a id="toc-axcorrelate" href="#axcorrelate">36.68 axcorrelate</a>
  1165. <ul class="toc-numbered-mark">
  1166. <li><a id="toc-Examples-64" href="#Examples-64">36.68.1 Examples</a></li>
  1167. </ul></li>
  1168. <li><a id="toc-bandpass" href="#bandpass">36.69 bandpass</a>
  1169. <ul class="toc-numbered-mark">
  1170. <li><a id="toc-Commands-29" href="#Commands-29">36.69.1 Commands</a></li>
  1171. </ul></li>
  1172. <li><a id="toc-bandreject" href="#bandreject">36.70 bandreject</a>
  1173. <ul class="toc-numbered-mark">
  1174. <li><a id="toc-Commands-30" href="#Commands-30">36.70.1 Commands</a></li>
  1175. </ul></li>
  1176. <li><a id="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">36.71 bass, lowshelf</a>
  1177. <ul class="toc-numbered-mark">
  1178. <li><a id="toc-Commands-31" href="#Commands-31">36.71.1 Commands</a></li>
  1179. </ul></li>
  1180. <li><a id="toc-biquad" href="#biquad">36.72 biquad</a>
  1181. <ul class="toc-numbered-mark">
  1182. <li><a id="toc-Commands-32" href="#Commands-32">36.72.1 Commands</a></li>
  1183. </ul></li>
  1184. <li><a id="toc-bs2b" href="#bs2b">36.73 bs2b</a></li>
  1185. <li><a id="toc-channelmap" href="#channelmap">36.74 channelmap</a>
  1186. <ul class="toc-numbered-mark">
  1187. <li><a id="toc-Examples-65" href="#Examples-65">36.74.1 Examples</a></li>
  1188. </ul></li>
  1189. <li><a id="toc-channelsplit" href="#channelsplit">36.75 channelsplit</a>
  1190. <ul class="toc-numbered-mark">
  1191. <li><a id="toc-Examples-66" href="#Examples-66">36.75.1 Examples</a></li>
  1192. </ul></li>
  1193. <li><a id="toc-chorus" href="#chorus">36.76 chorus</a>
  1194. <ul class="toc-numbered-mark">
  1195. <li><a id="toc-Examples-67" href="#Examples-67">36.76.1 Examples</a></li>
  1196. </ul></li>
  1197. <li><a id="toc-compand" href="#compand">36.77 compand</a>
  1198. <ul class="toc-numbered-mark">
  1199. <li><a id="toc-Examples-68" href="#Examples-68">36.77.1 Examples</a></li>
  1200. </ul></li>
  1201. <li><a id="toc-compensationdelay" href="#compensationdelay">36.78 compensationdelay</a>
  1202. <ul class="toc-numbered-mark">
  1203. <li><a id="toc-Commands-33" href="#Commands-33">36.78.1 Commands</a></li>
  1204. </ul></li>
  1205. <li><a id="toc-crossfeed" href="#crossfeed">36.79 crossfeed</a>
  1206. <ul class="toc-numbered-mark">
  1207. <li><a id="toc-Commands-34" href="#Commands-34">36.79.1 Commands</a></li>
  1208. </ul></li>
  1209. <li><a id="toc-crystalizer" href="#crystalizer">36.80 crystalizer</a>
  1210. <ul class="toc-numbered-mark">
  1211. <li><a id="toc-Commands-35" href="#Commands-35">36.80.1 Commands</a></li>
  1212. </ul></li>
  1213. <li><a id="toc-dcshift" href="#dcshift">36.81 dcshift</a></li>
  1214. <li><a id="toc-deesser" href="#deesser">36.82 deesser</a></li>
  1215. <li><a id="toc-dialoguenhance" href="#dialoguenhance">36.83 dialoguenhance</a>
  1216. <ul class="toc-numbered-mark">
  1217. <li><a id="toc-Commands-36" href="#Commands-36">36.83.1 Commands</a></li>
  1218. </ul></li>
  1219. <li><a id="toc-drmeter" href="#drmeter">36.84 drmeter</a></li>
  1220. <li><a id="toc-dynaudnorm" href="#dynaudnorm">36.85 dynaudnorm</a>
  1221. <ul class="toc-numbered-mark">
  1222. <li><a id="toc-Commands-37" href="#Commands-37">36.85.1 Commands</a></li>
  1223. </ul></li>
  1224. <li><a id="toc-earwax" href="#earwax">36.86 earwax</a></li>
  1225. <li><a id="toc-equalizer" href="#equalizer">36.87 equalizer</a>
  1226. <ul class="toc-numbered-mark">
  1227. <li><a id="toc-Examples-69" href="#Examples-69">36.87.1 Examples</a></li>
  1228. <li><a id="toc-Commands-38" href="#Commands-38">36.87.2 Commands</a></li>
  1229. </ul></li>
  1230. <li><a id="toc-extrastereo" href="#extrastereo">36.88 extrastereo</a>
  1231. <ul class="toc-numbered-mark">
  1232. <li><a id="toc-Commands-39" href="#Commands-39">36.88.1 Commands</a></li>
  1233. </ul></li>
  1234. <li><a id="toc-firequalizer" href="#firequalizer">36.89 firequalizer</a>
  1235. <ul class="toc-numbered-mark">
  1236. <li><a id="toc-Examples-70" href="#Examples-70">36.89.1 Examples</a></li>
  1237. </ul></li>
  1238. <li><a id="toc-flanger" href="#flanger">36.90 flanger</a></li>
  1239. <li><a id="toc-haas" href="#haas">36.91 haas</a></li>
  1240. <li><a id="toc-hdcd" href="#hdcd">36.92 hdcd</a></li>
  1241. <li><a id="toc-headphone" href="#headphone">36.93 headphone</a>
  1242. <ul class="toc-numbered-mark">
  1243. <li><a id="toc-Examples-71" href="#Examples-71">36.93.1 Examples</a></li>
  1244. </ul></li>
  1245. <li><a id="toc-highpass" href="#highpass">36.94 highpass</a>
  1246. <ul class="toc-numbered-mark">
  1247. <li><a id="toc-Commands-40" href="#Commands-40">36.94.1 Commands</a></li>
  1248. </ul></li>
  1249. <li><a id="toc-join" href="#join">36.95 join</a></li>
  1250. <li><a id="toc-ladspa" href="#ladspa">36.96 ladspa</a>
  1251. <ul class="toc-numbered-mark">
  1252. <li><a id="toc-Examples-72" href="#Examples-72">36.96.1 Examples</a></li>
  1253. <li><a id="toc-Commands-41" href="#Commands-41">36.96.2 Commands</a></li>
  1254. </ul></li>
  1255. <li><a id="toc-loudnorm" href="#loudnorm">36.97 loudnorm</a></li>
  1256. <li><a id="toc-lowpass" href="#lowpass">36.98 lowpass</a>
  1257. <ul class="toc-numbered-mark">
  1258. <li><a id="toc-Examples-73" href="#Examples-73">36.98.1 Examples</a></li>
  1259. <li><a id="toc-Commands-42" href="#Commands-42">36.98.2 Commands</a></li>
  1260. </ul></li>
  1261. <li><a id="toc-lv2" href="#lv2">36.99 lv2</a>
  1262. <ul class="toc-numbered-mark">
  1263. <li><a id="toc-Examples-74" href="#Examples-74">36.99.1 Examples</a></li>
  1264. <li><a id="toc-Commands-43" href="#Commands-43">36.99.2 Commands</a></li>
  1265. </ul></li>
  1266. <li><a id="toc-mcompand" href="#mcompand">36.100 mcompand</a></li>
  1267. <li><a id="toc-pan-1" href="#pan-1">36.101 pan</a>
  1268. <ul class="toc-numbered-mark">
  1269. <li><a id="toc-Mixing-examples" href="#Mixing-examples">36.101.1 Mixing examples</a></li>
  1270. <li><a id="toc-Remapping-examples" href="#Remapping-examples">36.101.2 Remapping examples</a></li>
  1271. </ul></li>
  1272. <li><a id="toc-replaygain" href="#replaygain">36.102 replaygain</a></li>
  1273. <li><a id="toc-resample" href="#resample">36.103 resample</a></li>
  1274. <li><a id="toc-rubberband" href="#rubberband">36.104 rubberband</a>
  1275. <ul class="toc-numbered-mark">
  1276. <li><a id="toc-Commands-44" href="#Commands-44">36.104.1 Commands</a></li>
  1277. </ul></li>
  1278. <li><a id="toc-sidechaincompress" href="#sidechaincompress">36.105 sidechaincompress</a>
  1279. <ul class="toc-numbered-mark">
  1280. <li><a id="toc-Commands-45" href="#Commands-45">36.105.1 Commands</a></li>
  1281. <li><a id="toc-Examples-75" href="#Examples-75">36.105.2 Examples</a></li>
  1282. </ul></li>
  1283. <li><a id="toc-sidechaingate" href="#sidechaingate">36.106 sidechaingate</a>
  1284. <ul class="toc-numbered-mark">
  1285. <li><a id="toc-Commands-46" href="#Commands-46">36.106.1 Commands</a></li>
  1286. </ul></li>
  1287. <li><a id="toc-silencedetect" href="#silencedetect">36.107 silencedetect</a>
  1288. <ul class="toc-numbered-mark">
  1289. <li><a id="toc-Examples-76" href="#Examples-76">36.107.1 Examples</a></li>
  1290. </ul></li>
  1291. <li><a id="toc-silenceremove" href="#silenceremove">36.108 silenceremove</a>
  1292. <ul class="toc-numbered-mark">
  1293. <li><a id="toc-Examples-77" href="#Examples-77">36.108.1 Examples</a></li>
  1294. <li><a id="toc-Commands-47" href="#Commands-47">36.108.2 Commands</a></li>
  1295. </ul></li>
  1296. <li><a id="toc-sofalizer" href="#sofalizer">36.109 sofalizer</a>
  1297. <ul class="toc-numbered-mark">
  1298. <li><a id="toc-Examples-78" href="#Examples-78">36.109.1 Examples</a></li>
  1299. </ul></li>
  1300. <li><a id="toc-speechnorm" href="#speechnorm">36.110 speechnorm</a>
  1301. <ul class="toc-numbered-mark">
  1302. <li><a id="toc-Commands-48" href="#Commands-48">36.110.1 Commands</a></li>
  1303. <li><a id="toc-Examples-79" href="#Examples-79">36.110.2 Examples</a></li>
  1304. </ul></li>
  1305. <li><a id="toc-stereotools" href="#stereotools">36.111 stereotools</a>
  1306. <ul class="toc-numbered-mark">
  1307. <li><a id="toc-Commands-49" href="#Commands-49">36.111.1 Commands</a></li>
  1308. <li><a id="toc-Examples-80" href="#Examples-80">36.111.2 Examples</a></li>
  1309. </ul></li>
  1310. <li><a id="toc-stereowiden" href="#stereowiden">36.112 stereowiden</a>
  1311. <ul class="toc-numbered-mark">
  1312. <li><a id="toc-Commands-50" href="#Commands-50">36.112.1 Commands</a></li>
  1313. </ul></li>
  1314. <li><a id="toc-superequalizer" href="#superequalizer">36.113 superequalizer</a></li>
  1315. <li><a id="toc-surround" href="#surround">36.114 surround</a></li>
  1316. <li><a id="toc-tiltshelf" href="#tiltshelf">36.115 tiltshelf</a>
  1317. <ul class="toc-numbered-mark">
  1318. <li><a id="toc-Commands-51" href="#Commands-51">36.115.1 Commands</a></li>
  1319. </ul></li>
  1320. <li><a id="toc-treble_002c-highshelf" href="#treble_002c-highshelf">36.116 treble, highshelf</a>
  1321. <ul class="toc-numbered-mark">
  1322. <li><a id="toc-Commands-52" href="#Commands-52">36.116.1 Commands</a></li>
  1323. </ul></li>
  1324. <li><a id="toc-tremolo" href="#tremolo">36.117 tremolo</a></li>
  1325. <li><a id="toc-vibrato" href="#vibrato">36.118 vibrato</a></li>
  1326. <li><a id="toc-virtualbass" href="#virtualbass">36.119 virtualbass</a></li>
  1327. <li><a id="toc-volume" href="#volume">36.120 volume</a>
  1328. <ul class="toc-numbered-mark">
  1329. <li><a id="toc-Commands-53" href="#Commands-53">36.120.1 Commands</a></li>
  1330. <li><a id="toc-Examples-81" href="#Examples-81">36.120.2 Examples</a></li>
  1331. </ul></li>
  1332. <li><a id="toc-volumedetect" href="#volumedetect">36.121 volumedetect</a>
  1333. <ul class="toc-numbered-mark">
  1334. <li><a id="toc-Examples-82" href="#Examples-82">36.121.1 Examples</a></li>
  1335. </ul></li>
  1336. <li><a id="toc-whisper-1" href="#whisper-1">36.122 whisper</a>
  1337. <ul class="toc-numbered-mark">
  1338. <li><a id="toc-Examples-83" href="#Examples-83">36.122.1 Examples</a></li>
  1339. </ul></li>
  1340. </ul></li>
  1341. <li><a id="toc-Audio-Sources" href="#Audio-Sources">37 Audio Sources</a>
  1342. <ul class="toc-numbered-mark">
  1343. <li><a id="toc-abuffer" href="#abuffer">37.1 abuffer</a>
  1344. <ul class="toc-numbered-mark">
  1345. <li><a id="toc-Examples-84" href="#Examples-84">37.1.1 Examples</a></li>
  1346. </ul></li>
  1347. <li><a id="toc-aevalsrc" href="#aevalsrc">37.2 aevalsrc</a>
  1348. <ul class="toc-numbered-mark">
  1349. <li><a id="toc-Examples-85" href="#Examples-85">37.2.1 Examples</a></li>
  1350. </ul></li>
  1351. <li><a id="toc-afdelaysrc" href="#afdelaysrc">37.3 afdelaysrc</a></li>
  1352. <li><a id="toc-afireqsrc" href="#afireqsrc">37.4 afireqsrc</a></li>
  1353. <li><a id="toc-afirsrc" href="#afirsrc">37.5 afirsrc</a></li>
  1354. <li><a id="toc-anullsrc" href="#anullsrc">37.6 anullsrc</a>
  1355. <ul class="toc-numbered-mark">
  1356. <li><a id="toc-Examples-86" href="#Examples-86">37.6.1 Examples</a></li>
  1357. </ul></li>
  1358. <li><a id="toc-flite" href="#flite">37.7 flite</a>
  1359. <ul class="toc-numbered-mark">
  1360. <li><a id="toc-Examples-87" href="#Examples-87">37.7.1 Examples</a></li>
  1361. </ul></li>
  1362. <li><a id="toc-anoisesrc" href="#anoisesrc">37.8 anoisesrc</a>
  1363. <ul class="toc-numbered-mark">
  1364. <li><a id="toc-Examples-88" href="#Examples-88">37.8.1 Examples</a></li>
  1365. </ul></li>
  1366. <li><a id="toc-hilbert" href="#hilbert">37.9 hilbert</a></li>
  1367. <li><a id="toc-sinc" href="#sinc">37.10 sinc</a></li>
  1368. <li><a id="toc-sine" href="#sine">37.11 sine</a>
  1369. <ul class="toc-numbered-mark">
  1370. <li><a id="toc-Examples-89" href="#Examples-89">37.11.1 Examples</a></li>
  1371. </ul></li>
  1372. </ul></li>
  1373. <li><a id="toc-Audio-Sinks" href="#Audio-Sinks">38 Audio Sinks</a>
  1374. <ul class="toc-numbered-mark">
  1375. <li><a id="toc-abuffersink" href="#abuffersink">38.1 abuffersink</a></li>
  1376. <li><a id="toc-anullsink" href="#anullsink">38.2 anullsink</a></li>
  1377. </ul></li>
  1378. <li><a id="toc-Video-Filters" href="#Video-Filters">39 Video Filters</a>
  1379. <ul class="toc-numbered-mark">
  1380. <li><a id="toc-addroi" href="#addroi">39.1 addroi</a>
  1381. <ul class="toc-numbered-mark">
  1382. <li><a id="toc-Examples-90" href="#Examples-90">39.1.1 Examples</a></li>
  1383. </ul></li>
  1384. <li><a id="toc-alphaextract" href="#alphaextract">39.2 alphaextract</a></li>
  1385. <li><a id="toc-alphamerge" href="#alphamerge">39.3 alphamerge</a></li>
  1386. <li><a id="toc-amplify" href="#amplify">39.4 amplify</a>
  1387. <ul class="toc-numbered-mark">
  1388. <li><a id="toc-Commands-54" href="#Commands-54">39.4.1 Commands</a></li>
  1389. </ul></li>
  1390. <li><a id="toc-ass-1" href="#ass-1">39.5 ass</a></li>
  1391. <li><a id="toc-atadenoise" href="#atadenoise">39.6 atadenoise</a>
  1392. <ul class="toc-numbered-mark">
  1393. <li><a id="toc-Commands-55" href="#Commands-55">39.6.1 Commands</a></li>
  1394. </ul></li>
  1395. <li><a id="toc-avgblur" href="#avgblur">39.7 avgblur</a>
  1396. <ul class="toc-numbered-mark">
  1397. <li><a id="toc-Commands-56" href="#Commands-56">39.7.1 Commands</a></li>
  1398. </ul></li>
  1399. <li><a id="toc-backgroundkey" href="#backgroundkey">39.8 backgroundkey</a>
  1400. <ul class="toc-numbered-mark">
  1401. <li><a id="toc-Commands-57" href="#Commands-57">39.8.1 Commands</a></li>
  1402. </ul></li>
  1403. <li><a id="toc-bbox" href="#bbox">39.9 bbox</a>
  1404. <ul class="toc-numbered-mark">
  1405. <li><a id="toc-Commands-58" href="#Commands-58">39.9.1 Commands</a></li>
  1406. </ul></li>
  1407. <li><a id="toc-bilateral" href="#bilateral">39.10 bilateral</a>
  1408. <ul class="toc-numbered-mark">
  1409. <li><a id="toc-Commands-59" href="#Commands-59">39.10.1 Commands</a></li>
  1410. </ul></li>
  1411. <li><a id="toc-bitplanenoise" href="#bitplanenoise">39.11 bitplanenoise</a></li>
  1412. <li><a id="toc-blackdetect_002c-blackdetect_005fvulkan" href="#blackdetect_002c-blackdetect_005fvulkan">39.12 blackdetect, blackdetect_vulkan</a></li>
  1413. <li><a id="toc-blackframe" href="#blackframe">39.13 blackframe</a></li>
  1414. <li><a id="toc-blend-1" href="#blend-1">39.14 blend</a>
  1415. <ul class="toc-numbered-mark">
  1416. <li><a id="toc-Examples-91" href="#Examples-91">39.14.1 Examples</a></li>
  1417. <li><a id="toc-Commands-60" href="#Commands-60">39.14.2 Commands</a></li>
  1418. </ul></li>
  1419. <li><a id="toc-blockdetect-1" href="#blockdetect-1">39.15 blockdetect</a>
  1420. <ul class="toc-numbered-mark">
  1421. <li><a id="toc-Examples-92" href="#Examples-92">39.15.1 Examples</a></li>
  1422. </ul></li>
  1423. <li><a id="toc-blurdetect-1" href="#blurdetect-1">39.16 blurdetect</a>
  1424. <ul class="toc-numbered-mark">
  1425. <li><a id="toc-Examples-93" href="#Examples-93">39.16.1 Examples</a></li>
  1426. </ul></li>
  1427. <li><a id="toc-bm3d" href="#bm3d">39.17 bm3d</a>
  1428. <ul class="toc-numbered-mark">
  1429. <li><a id="toc-Examples-94" href="#Examples-94">39.17.1 Examples</a></li>
  1430. </ul></li>
  1431. <li><a id="toc-boxblur" href="#boxblur">39.18 boxblur</a>
  1432. <ul class="toc-numbered-mark">
  1433. <li><a id="toc-Examples-95" href="#Examples-95">39.18.1 Examples</a></li>
  1434. </ul></li>
  1435. <li><a id="toc-bwdif-1" href="#bwdif-1">39.19 bwdif</a></li>
  1436. <li><a id="toc-ccrepack" href="#ccrepack">39.20 ccrepack</a></li>
  1437. <li><a id="toc-cas" href="#cas">39.21 cas</a>
  1438. <ul class="toc-numbered-mark">
  1439. <li><a id="toc-Commands-61" href="#Commands-61">39.21.1 Commands</a></li>
  1440. </ul></li>
  1441. <li><a id="toc-chromahold" href="#chromahold">39.22 chromahold</a>
  1442. <ul class="toc-numbered-mark">
  1443. <li><a id="toc-Commands-62" href="#Commands-62">39.22.1 Commands</a></li>
  1444. </ul></li>
  1445. <li><a id="toc-chromakey-1" href="#chromakey-1">39.23 chromakey</a>
  1446. <ul class="toc-numbered-mark">
  1447. <li><a id="toc-Commands-63" href="#Commands-63">39.23.1 Commands</a></li>
  1448. <li><a id="toc-Examples-96" href="#Examples-96">39.23.2 Examples</a></li>
  1449. </ul></li>
  1450. <li><a id="toc-chromanr" href="#chromanr">39.24 chromanr</a>
  1451. <ul class="toc-numbered-mark">
  1452. <li><a id="toc-Commands-64" href="#Commands-64">39.24.1 Commands</a></li>
  1453. </ul></li>
  1454. <li><a id="toc-chromashift" href="#chromashift">39.25 chromashift</a>
  1455. <ul class="toc-numbered-mark">
  1456. <li><a id="toc-Commands-65" href="#Commands-65">39.25.1 Commands</a></li>
  1457. </ul></li>
  1458. <li><a id="toc-ciescope" href="#ciescope">39.26 ciescope</a></li>
  1459. <li><a id="toc-codecview" href="#codecview">39.27 codecview</a>
  1460. <ul class="toc-numbered-mark">
  1461. <li><a id="toc-Examples-97" href="#Examples-97">39.27.1 Examples</a></li>
  1462. </ul></li>
  1463. <li><a id="toc-colorbalance" href="#colorbalance">39.28 colorbalance</a>
  1464. <ul class="toc-numbered-mark">
  1465. <li><a id="toc-Examples-98" href="#Examples-98">39.28.1 Examples</a></li>
  1466. <li><a id="toc-Commands-66" href="#Commands-66">39.28.2 Commands</a></li>
  1467. </ul></li>
  1468. <li><a id="toc-colorcontrast" href="#colorcontrast">39.29 colorcontrast</a>
  1469. <ul class="toc-numbered-mark">
  1470. <li><a id="toc-Commands-67" href="#Commands-67">39.29.1 Commands</a></li>
  1471. </ul></li>
  1472. <li><a id="toc-colorcorrect" href="#colorcorrect">39.30 colorcorrect</a>
  1473. <ul class="toc-numbered-mark">
  1474. <li><a id="toc-Commands-68" href="#Commands-68">39.30.1 Commands</a></li>
  1475. </ul></li>
  1476. <li><a id="toc-colorchannelmixer" href="#colorchannelmixer">39.31 colorchannelmixer</a>
  1477. <ul class="toc-numbered-mark">
  1478. <li><a id="toc-Examples-99" href="#Examples-99">39.31.1 Examples</a></li>
  1479. <li><a id="toc-Commands-69" href="#Commands-69">39.31.2 Commands</a></li>
  1480. </ul></li>
  1481. <li><a id="toc-colordetect" href="#colordetect">39.32 colordetect</a></li>
  1482. <li><a id="toc-colorize" href="#colorize">39.33 colorize</a>
  1483. <ul class="toc-numbered-mark">
  1484. <li><a id="toc-Commands-70" href="#Commands-70">39.33.1 Commands</a></li>
  1485. </ul></li>
  1486. <li><a id="toc-colorkey" href="#colorkey">39.34 colorkey</a>
  1487. <ul class="toc-numbered-mark">
  1488. <li><a id="toc-Examples-100" href="#Examples-100">39.34.1 Examples</a></li>
  1489. <li><a id="toc-Commands-71" href="#Commands-71">39.34.2 Commands</a></li>
  1490. </ul></li>
  1491. <li><a id="toc-colorhold" href="#colorhold">39.35 colorhold</a>
  1492. <ul class="toc-numbered-mark">
  1493. <li><a id="toc-Commands-72" href="#Commands-72">39.35.1 Commands</a></li>
  1494. </ul></li>
  1495. <li><a id="toc-colorlevels" href="#colorlevels">39.36 colorlevels</a>
  1496. <ul class="toc-numbered-mark">
  1497. <li><a id="toc-Examples-101" href="#Examples-101">39.36.1 Examples</a></li>
  1498. <li><a id="toc-Commands-73" href="#Commands-73">39.36.2 Commands</a></li>
  1499. </ul></li>
  1500. <li><a id="toc-colormap" href="#colormap">39.37 colormap</a></li>
  1501. <li><a id="toc-colormatrix" href="#colormatrix">39.38 colormatrix</a></li>
  1502. <li><a id="toc-colorspace" href="#colorspace">39.39 colorspace</a></li>
  1503. <li><a id="toc-colortemperature" href="#colortemperature">39.40 colortemperature</a>
  1504. <ul class="toc-numbered-mark">
  1505. <li><a id="toc-Commands-74" href="#Commands-74">39.40.1 Commands</a></li>
  1506. </ul></li>
  1507. <li><a id="toc-convolution" href="#convolution">39.41 convolution</a>
  1508. <ul class="toc-numbered-mark">
  1509. <li><a id="toc-Commands-75" href="#Commands-75">39.41.1 Commands</a></li>
  1510. <li><a id="toc-Examples-102" href="#Examples-102">39.41.2 Examples</a></li>
  1511. </ul></li>
  1512. <li><a id="toc-convolve" href="#convolve">39.42 convolve</a></li>
  1513. <li><a id="toc-copy" href="#copy">39.43 copy</a></li>
  1514. <li><a id="toc-coreimage-1" href="#coreimage-1">39.44 coreimage</a>
  1515. <ul class="toc-numbered-mark">
  1516. <li><a id="toc-Examples-103" href="#Examples-103">39.44.1 Examples</a></li>
  1517. </ul></li>
  1518. <li><a id="toc-corr" href="#corr">39.45 corr</a></li>
  1519. <li><a id="toc-cover_005frect" href="#cover_005frect">39.46 cover_rect</a>
  1520. <ul class="toc-numbered-mark">
  1521. <li><a id="toc-Examples-104" href="#Examples-104">39.46.1 Examples</a></li>
  1522. </ul></li>
  1523. <li><a id="toc-crop" href="#crop">39.47 crop</a>
  1524. <ul class="toc-numbered-mark">
  1525. <li><a id="toc-Examples-105" href="#Examples-105">39.47.1 Examples</a></li>
  1526. <li><a id="toc-Commands-76" href="#Commands-76">39.47.2 Commands</a></li>
  1527. </ul></li>
  1528. <li><a id="toc-cropdetect" href="#cropdetect">39.48 cropdetect</a>
  1529. <ul class="toc-numbered-mark">
  1530. <li><a id="toc-Examples-106" href="#Examples-106">39.48.1 Examples</a></li>
  1531. <li><a id="toc-Commands-77" href="#Commands-77">39.48.2 Commands</a></li>
  1532. </ul></li>
  1533. <li><a id="toc-cue-1" href="#cue-1">39.49 cue</a></li>
  1534. <li><a id="toc-curves-1" href="#curves-1">39.50 curves</a>
  1535. <ul class="toc-numbered-mark">
  1536. <li><a id="toc-Commands-78" href="#Commands-78">39.50.1 Commands</a></li>
  1537. <li><a id="toc-Examples-107" href="#Examples-107">39.50.2 Examples</a></li>
  1538. </ul></li>
  1539. <li><a id="toc-datascope" href="#datascope">39.51 datascope</a>
  1540. <ul class="toc-numbered-mark">
  1541. <li><a id="toc-Commands-79" href="#Commands-79">39.51.1 Commands</a></li>
  1542. </ul></li>
  1543. <li><a id="toc-dblur" href="#dblur">39.52 dblur</a>
  1544. <ul class="toc-numbered-mark">
  1545. <li><a id="toc-Commands-80" href="#Commands-80">39.52.1 Commands</a></li>
  1546. </ul></li>
  1547. <li><a id="toc-dctdnoiz" href="#dctdnoiz">39.53 dctdnoiz</a>
  1548. <ul class="toc-numbered-mark">
  1549. <li><a id="toc-Examples-108" href="#Examples-108">39.53.1 Examples</a></li>
  1550. </ul></li>
  1551. <li><a id="toc-deband" href="#deband">39.54 deband</a>
  1552. <ul class="toc-numbered-mark">
  1553. <li><a id="toc-Commands-81" href="#Commands-81">39.54.1 Commands</a></li>
  1554. </ul></li>
  1555. <li><a id="toc-deblock" href="#deblock">39.55 deblock</a>
  1556. <ul class="toc-numbered-mark">
  1557. <li><a id="toc-Examples-109" href="#Examples-109">39.55.1 Examples</a></li>
  1558. <li><a id="toc-Commands-82" href="#Commands-82">39.55.2 Commands</a></li>
  1559. </ul></li>
  1560. <li><a id="toc-decimate-1" href="#decimate-1">39.56 decimate</a></li>
  1561. <li><a id="toc-deconvolve" href="#deconvolve">39.57 deconvolve</a></li>
  1562. <li><a id="toc-dedot" href="#dedot">39.58 dedot</a></li>
  1563. <li><a id="toc-deflate" href="#deflate">39.59 deflate</a>
  1564. <ul class="toc-numbered-mark">
  1565. <li><a id="toc-Commands-83" href="#Commands-83">39.59.1 Commands</a></li>
  1566. </ul></li>
  1567. <li><a id="toc-deflicker" href="#deflicker">39.60 deflicker</a></li>
  1568. <li><a id="toc-dejudder" href="#dejudder">39.61 dejudder</a></li>
  1569. <li><a id="toc-delogo" href="#delogo">39.62 delogo</a>
  1570. <ul class="toc-numbered-mark">
  1571. <li><a id="toc-Examples-110" href="#Examples-110">39.62.1 Examples</a></li>
  1572. </ul></li>
  1573. <li><a id="toc-derain-1" href="#derain-1">39.63 derain</a></li>
  1574. <li><a id="toc-deshake" href="#deshake">39.64 deshake</a></li>
  1575. <li><a id="toc-despill" href="#despill">39.65 despill</a>
  1576. <ul class="toc-numbered-mark">
  1577. <li><a id="toc-Commands-84" href="#Commands-84">39.65.1 Commands</a></li>
  1578. </ul></li>
  1579. <li><a id="toc-detelecine" href="#detelecine">39.66 detelecine</a></li>
  1580. <li><a id="toc-dilation-1" href="#dilation-1">39.67 dilation</a>
  1581. <ul class="toc-numbered-mark">
  1582. <li><a id="toc-Commands-85" href="#Commands-85">39.67.1 Commands</a></li>
  1583. </ul></li>
  1584. <li><a id="toc-displace" href="#displace">39.68 displace</a>
  1585. <ul class="toc-numbered-mark">
  1586. <li><a id="toc-Examples-111" href="#Examples-111">39.68.1 Examples</a></li>
  1587. </ul></li>
  1588. <li><a id="toc-dnn_005fclassify" href="#dnn_005fclassify">39.69 dnn_classify</a></li>
  1589. <li><a id="toc-dnn_005fdetect" href="#dnn_005fdetect">39.70 dnn_detect</a></li>
  1590. <li><a id="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">39.71 dnn_processing</a>
  1591. <ul class="toc-numbered-mark">
  1592. <li><a id="toc-Examples-112" href="#Examples-112">39.71.1 Examples</a></li>
  1593. </ul></li>
  1594. <li><a id="toc-drawbox" href="#drawbox">39.72 drawbox</a>
  1595. <ul class="toc-numbered-mark">
  1596. <li><a id="toc-Examples-113" href="#Examples-113">39.72.1 Examples</a></li>
  1597. <li><a id="toc-Commands-86" href="#Commands-86">39.72.2 Commands</a></li>
  1598. </ul></li>
  1599. <li><a id="toc-drawgraph-1" href="#drawgraph-1">39.73 drawgraph</a></li>
  1600. <li><a id="toc-drawgrid" href="#drawgrid">39.74 drawgrid</a>
  1601. <ul class="toc-numbered-mark">
  1602. <li><a id="toc-Examples-114" href="#Examples-114">39.74.1 Examples</a></li>
  1603. <li><a id="toc-Commands-87" href="#Commands-87">39.74.2 Commands</a></li>
  1604. </ul></li>
  1605. <li><a id="toc-drawtext-1" href="#drawtext-1">39.75 drawtext</a>
  1606. <ul class="toc-numbered-mark">
  1607. <li><a id="toc-Syntax-2" href="#Syntax-2">39.75.1 Syntax</a></li>
  1608. <li><a id="toc-Text-expansion" href="#Text-expansion">39.75.2 Text expansion</a></li>
  1609. <li><a id="toc-Commands-88" href="#Commands-88">39.75.3 Commands</a></li>
  1610. <li><a id="toc-Examples-115" href="#Examples-115">39.75.4 Examples</a></li>
  1611. </ul></li>
  1612. <li><a id="toc-drawvg-1" href="#drawvg-1">39.76 drawvg</a>
  1613. <ul class="toc-numbered-mark">
  1614. <li><a id="toc-Parameters" href="#Parameters">39.76.1 Parameters</a></li>
  1615. <li><a id="toc-Pixel-Formats" href="#Pixel-Formats">39.76.2 Pixel Formats</a></li>
  1616. <li><a id="toc-Examples-116" href="#Examples-116">39.76.3 Examples</a></li>
  1617. </ul></li>
  1618. <li><a id="toc-edgedetect" href="#edgedetect">39.77 edgedetect</a>
  1619. <ul class="toc-numbered-mark">
  1620. <li><a id="toc-Examples-117" href="#Examples-117">39.77.1 Examples</a></li>
  1621. </ul></li>
  1622. <li><a id="toc-elbg" href="#elbg">39.78 elbg</a></li>
  1623. <li><a id="toc-entropy" href="#entropy">39.79 entropy</a></li>
  1624. <li><a id="toc-epx" href="#epx">39.80 epx</a></li>
  1625. <li><a id="toc-eq" href="#eq">39.81 eq</a>
  1626. <ul class="toc-numbered-mark">
  1627. <li><a id="toc-Commands-89" href="#Commands-89">39.81.1 Commands</a></li>
  1628. </ul></li>
  1629. <li><a id="toc-erosion-1" href="#erosion-1">39.82 erosion</a>
  1630. <ul class="toc-numbered-mark">
  1631. <li><a id="toc-Commands-90" href="#Commands-90">39.82.1 Commands</a></li>
  1632. </ul></li>
  1633. <li><a id="toc-estdif" href="#estdif">39.83 estdif</a>
  1634. <ul class="toc-numbered-mark">
  1635. <li><a id="toc-Commands-91" href="#Commands-91">39.83.1 Commands</a></li>
  1636. </ul></li>
  1637. <li><a id="toc-exposure" href="#exposure">39.84 exposure</a>
  1638. <ul class="toc-numbered-mark">
  1639. <li><a id="toc-Commands-92" href="#Commands-92">39.84.1 Commands</a></li>
  1640. </ul></li>
  1641. <li><a id="toc-extractplanes" href="#extractplanes">39.85 extractplanes</a>
  1642. <ul class="toc-numbered-mark">
  1643. <li><a id="toc-Examples-118" href="#Examples-118">39.85.1 Examples</a></li>
  1644. </ul></li>
  1645. <li><a id="toc-fade" href="#fade">39.86 fade</a>
  1646. <ul class="toc-numbered-mark">
  1647. <li><a id="toc-Examples-119" href="#Examples-119">39.86.1 Examples</a></li>
  1648. </ul></li>
  1649. <li><a id="toc-feedback" href="#feedback">39.87 feedback</a>
  1650. <ul class="toc-numbered-mark">
  1651. <li><a id="toc-Examples-120" href="#Examples-120">39.87.1 Examples</a></li>
  1652. </ul></li>
  1653. <li><a id="toc-fftdnoiz" href="#fftdnoiz">39.88 fftdnoiz</a></li>
  1654. <li><a id="toc-fftfilt" href="#fftfilt">39.89 fftfilt</a>
  1655. <ul class="toc-numbered-mark">
  1656. <li><a id="toc-Examples-121" href="#Examples-121">39.89.1 Examples</a></li>
  1657. </ul></li>
  1658. <li><a id="toc-field" href="#field">39.90 field</a></li>
  1659. <li><a id="toc-fieldhint" href="#fieldhint">39.91 fieldhint</a></li>
  1660. <li><a id="toc-fieldmatch" href="#fieldmatch">39.92 fieldmatch</a>
  1661. <ul class="toc-numbered-mark">
  1662. <li><a id="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">39.92.1 p/c/n/u/b meaning</a>
  1663. <ul class="toc-numbered-mark">
  1664. <li><a id="toc-p_002fc_002fn" href="#p_002fc_002fn">39.92.1.1 p/c/n</a></li>
  1665. <li><a id="toc-u_002fb" href="#u_002fb">39.92.1.2 u/b</a></li>
  1666. </ul></li>
  1667. <li><a id="toc-Examples-122" href="#Examples-122">39.92.2 Examples</a></li>
  1668. </ul></li>
  1669. <li><a id="toc-fieldorder" href="#fieldorder">39.93 fieldorder</a></li>
  1670. <li><a id="toc-fillborders" href="#fillborders">39.94 fillborders</a>
  1671. <ul class="toc-numbered-mark">
  1672. <li><a id="toc-Commands-93" href="#Commands-93">39.94.1 Commands</a></li>
  1673. </ul></li>
  1674. <li><a id="toc-find_005frect" href="#find_005frect">39.95 find_rect</a>
  1675. <ul class="toc-numbered-mark">
  1676. <li><a id="toc-Examples-123" href="#Examples-123">39.95.1 Examples</a></li>
  1677. </ul></li>
  1678. <li><a id="toc-floodfill" href="#floodfill">39.96 floodfill</a></li>
  1679. <li><a id="toc-format-1" href="#format-1">39.97 format</a>
  1680. <ul class="toc-numbered-mark">
  1681. <li><a id="toc-Examples-124" href="#Examples-124">39.97.1 Examples</a></li>
  1682. </ul></li>
  1683. <li><a id="toc-fps-1" href="#fps-1">39.98 fps</a>
  1684. <ul class="toc-numbered-mark">
  1685. <li><a id="toc-Examples-125" href="#Examples-125">39.98.1 Examples</a></li>
  1686. </ul></li>
  1687. <li><a id="toc-framepack" href="#framepack">39.99 framepack</a></li>
  1688. <li><a id="toc-framerate" href="#framerate">39.100 framerate</a></li>
  1689. <li><a id="toc-framestep" href="#framestep">39.101 framestep</a></li>
  1690. <li><a id="toc-freezedetect" href="#freezedetect">39.102 freezedetect</a></li>
  1691. <li><a id="toc-freezeframes" href="#freezeframes">39.103 freezeframes</a></li>
  1692. <li><a id="toc-frei0r-1" href="#frei0r-1">39.104 frei0r</a>
  1693. <ul class="toc-numbered-mark">
  1694. <li><a id="toc-Examples-126" href="#Examples-126">39.104.1 Examples</a></li>
  1695. <li><a id="toc-Commands-94" href="#Commands-94">39.104.2 Commands</a></li>
  1696. </ul></li>
  1697. <li><a id="toc-fspp" href="#fspp">39.105 fspp</a></li>
  1698. <li><a id="toc-fsync-1" href="#fsync-1">39.106 fsync</a></li>
  1699. <li><a id="toc-gblur" href="#gblur">39.107 gblur</a>
  1700. <ul class="toc-numbered-mark">
  1701. <li><a id="toc-Commands-95" href="#Commands-95">39.107.1 Commands</a></li>
  1702. </ul></li>
  1703. <li><a id="toc-geq" href="#geq">39.108 geq</a>
  1704. <ul class="toc-numbered-mark">
  1705. <li><a id="toc-Examples-127" href="#Examples-127">39.108.1 Examples</a></li>
  1706. </ul></li>
  1707. <li><a id="toc-gradfun" href="#gradfun">39.109 gradfun</a>
  1708. <ul class="toc-numbered-mark">
  1709. <li><a id="toc-Examples-128" href="#Examples-128">39.109.1 Examples</a></li>
  1710. </ul></li>
  1711. <li><a id="toc-graphmonitor-1" href="#graphmonitor-1">39.110 graphmonitor</a></li>
  1712. <li><a id="toc-grayworld" href="#grayworld">39.111 grayworld</a></li>
  1713. <li><a id="toc-greyedge" href="#greyedge">39.112 greyedge</a>
  1714. <ul class="toc-numbered-mark">
  1715. <li><a id="toc-Examples-129" href="#Examples-129">39.112.1 Examples</a></li>
  1716. </ul></li>
  1717. <li><a id="toc-guided" href="#guided">39.113 guided</a>
  1718. <ul class="toc-numbered-mark">
  1719. <li><a id="toc-Commands-96" href="#Commands-96">39.113.1 Commands</a></li>
  1720. <li><a id="toc-Examples-130" href="#Examples-130">39.113.2 Examples</a></li>
  1721. </ul></li>
  1722. <li><a id="toc-haldclut-1" href="#haldclut-1">39.114 haldclut</a>
  1723. <ul class="toc-numbered-mark">
  1724. <li><a id="toc-Commands-97" href="#Commands-97">39.114.1 Commands</a></li>
  1725. <li><a id="toc-Workflow-examples" href="#Workflow-examples">39.114.2 Workflow examples</a>
  1726. <ul class="toc-numbered-mark">
  1727. <li><a id="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">39.114.2.1 Hald CLUT video stream</a></li>
  1728. <li><a id="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">39.114.2.2 Hald CLUT with preview</a></li>
  1729. </ul></li>
  1730. </ul></li>
  1731. <li><a id="toc-hflip" href="#hflip">39.115 hflip</a></li>
  1732. <li><a id="toc-histeq" href="#histeq">39.116 histeq</a></li>
  1733. <li><a id="toc-histogram-1" href="#histogram-1">39.117 histogram</a>
  1734. <ul class="toc-numbered-mark">
  1735. <li><a id="toc-Examples-131" href="#Examples-131">39.117.1 Examples</a></li>
  1736. </ul></li>
  1737. <li><a id="toc-hqdn3d-1" href="#hqdn3d-1">39.118 hqdn3d</a>
  1738. <ul class="toc-numbered-mark">
  1739. <li><a id="toc-Commands-98" href="#Commands-98">39.118.1 Commands</a></li>
  1740. </ul></li>
  1741. <li><a id="toc-hwdownload-1" href="#hwdownload-1">39.119 hwdownload</a></li>
  1742. <li><a id="toc-hwmap" href="#hwmap">39.120 hwmap</a></li>
  1743. <li><a id="toc-hwupload-1" href="#hwupload-1">39.121 hwupload</a></li>
  1744. <li><a id="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">39.122 hwupload_cuda</a></li>
  1745. <li><a id="toc-hqx" href="#hqx">39.123 hqx</a></li>
  1746. <li><a id="toc-hstack-1" href="#hstack-1">39.124 hstack</a></li>
  1747. <li><a id="toc-hsvhold" href="#hsvhold">39.125 hsvhold</a></li>
  1748. <li><a id="toc-hsvkey" href="#hsvkey">39.126 hsvkey</a></li>
  1749. <li><a id="toc-hue" href="#hue">39.127 hue</a>
  1750. <ul class="toc-numbered-mark">
  1751. <li><a id="toc-Examples-132" href="#Examples-132">39.127.1 Examples</a></li>
  1752. <li><a id="toc-Commands-99" href="#Commands-99">39.127.2 Commands</a></li>
  1753. </ul></li>
  1754. <li><a id="toc-huesaturation" href="#huesaturation">39.128 huesaturation</a></li>
  1755. <li><a id="toc-hysteresis" href="#hysteresis">39.129 hysteresis</a></li>
  1756. <li><a id="toc-iccdetect" href="#iccdetect">39.130 iccdetect</a></li>
  1757. <li><a id="toc-iccgen" href="#iccgen">39.131 iccgen</a></li>
  1758. <li><a id="toc-identity" href="#identity">39.132 identity</a></li>
  1759. <li><a id="toc-idet" href="#idet">39.133 idet</a>
  1760. <ul class="toc-numbered-mark">
  1761. <li><a id="toc-Examples-133" href="#Examples-133">39.133.1 Examples</a></li>
  1762. </ul></li>
  1763. <li><a id="toc-il" href="#il">39.134 il</a>
  1764. <ul class="toc-numbered-mark">
  1765. <li><a id="toc-Commands-100" href="#Commands-100">39.134.1 Commands</a></li>
  1766. </ul></li>
  1767. <li><a id="toc-inflate" href="#inflate">39.135 inflate</a>
  1768. <ul class="toc-numbered-mark">
  1769. <li><a id="toc-Commands-101" href="#Commands-101">39.135.1 Commands</a></li>
  1770. </ul></li>
  1771. <li><a id="toc-interlace_002c-interlace_005fvulkan" href="#interlace_002c-interlace_005fvulkan">39.136 interlace, interlace_vulkan</a></li>
  1772. <li><a id="toc-kerndeint" href="#kerndeint">39.137 kerndeint</a>
  1773. <ul class="toc-numbered-mark">
  1774. <li><a id="toc-Examples-134" href="#Examples-134">39.137.1 Examples</a></li>
  1775. </ul></li>
  1776. <li><a id="toc-kirsch" href="#kirsch">39.138 kirsch</a>
  1777. <ul class="toc-numbered-mark">
  1778. <li><a id="toc-Commands-102" href="#Commands-102">39.138.1 Commands</a></li>
  1779. </ul></li>
  1780. <li><a id="toc-lagfun" href="#lagfun">39.139 lagfun</a>
  1781. <ul class="toc-numbered-mark">
  1782. <li><a id="toc-Commands-103" href="#Commands-103">39.139.1 Commands</a></li>
  1783. </ul></li>
  1784. <li><a id="toc-lenscorrection" href="#lenscorrection">39.140 lenscorrection</a>
  1785. <ul class="toc-numbered-mark">
  1786. <li><a id="toc-Options-120" href="#Options-120">39.140.1 Options</a></li>
  1787. <li><a id="toc-Commands-104" href="#Commands-104">39.140.2 Commands</a></li>
  1788. </ul></li>
  1789. <li><a id="toc-lensfun" href="#lensfun">39.141 lensfun</a>
  1790. <ul class="toc-numbered-mark">
  1791. <li><a id="toc-Examples-135" href="#Examples-135">39.141.1 Examples</a></li>
  1792. </ul></li>
  1793. <li><a id="toc-lcevc" href="#lcevc">39.142 lcevc</a></li>
  1794. <li><a id="toc-libplacebo" href="#libplacebo">39.143 libplacebo</a>
  1795. <ul class="toc-numbered-mark">
  1796. <li><a id="toc-Options-121" href="#Options-121">39.143.1 Options</a>
  1797. <ul class="toc-numbered-mark">
  1798. <li><a id="toc-Output-mode" href="#Output-mode">39.143.1.1 Output mode</a></li>
  1799. <li><a id="toc-Scaling" href="#Scaling">39.143.1.2 Scaling</a></li>
  1800. <li><a id="toc-Deinterlacing" href="#Deinterlacing">39.143.1.3 Deinterlacing</a></li>
  1801. <li><a id="toc-Debanding" href="#Debanding">39.143.1.4 Debanding</a></li>
  1802. <li><a id="toc-Color-adjustment" href="#Color-adjustment">39.143.1.5 Color adjustment</a></li>
  1803. <li><a id="toc-Peak-detection" href="#Peak-detection">39.143.1.6 Peak detection</a></li>
  1804. <li><a id="toc-Tone-mapping" href="#Tone-mapping">39.143.1.7 Tone mapping</a></li>
  1805. <li><a id="toc-Dithering" href="#Dithering">39.143.1.8 Dithering</a></li>
  1806. <li><a id="toc-Custom-shaders" href="#Custom-shaders">39.143.1.9 Custom shaders</a></li>
  1807. <li><a id="toc-Debugging-_002f-performance" href="#Debugging-_002f-performance">39.143.1.10 Debugging / performance</a></li>
  1808. </ul></li>
  1809. <li><a id="toc-Commands-105" href="#Commands-105">39.143.2 Commands</a></li>
  1810. <li><a id="toc-Examples-136" href="#Examples-136">39.143.3 Examples</a></li>
  1811. </ul></li>
  1812. <li><a id="toc-libvmaf-1" href="#libvmaf-1">39.144 libvmaf</a>
  1813. <ul class="toc-numbered-mark">
  1814. <li><a id="toc-Examples-137" href="#Examples-137">39.144.1 Examples</a></li>
  1815. </ul></li>
  1816. <li><a id="toc-libvmaf_005fcuda" href="#libvmaf_005fcuda">39.145 libvmaf_cuda</a>
  1817. <ul class="toc-numbered-mark">
  1818. <li><a id="toc-Examples-138" href="#Examples-138">39.145.1 Examples</a></li>
  1819. </ul></li>
  1820. <li><a id="toc-limitdiff" href="#limitdiff">39.146 limitdiff</a>
  1821. <ul class="toc-numbered-mark">
  1822. <li><a id="toc-Commands-106" href="#Commands-106">39.146.1 Commands</a></li>
  1823. </ul></li>
  1824. <li><a id="toc-limiter" href="#limiter">39.147 limiter</a>
  1825. <ul class="toc-numbered-mark">
  1826. <li><a id="toc-Commands-107" href="#Commands-107">39.147.1 Commands</a></li>
  1827. </ul></li>
  1828. <li><a id="toc-loop" href="#loop">39.148 loop</a>
  1829. <ul class="toc-numbered-mark">
  1830. <li><a id="toc-Examples-139" href="#Examples-139">39.148.1 Examples</a></li>
  1831. </ul></li>
  1832. <li><a id="toc-lut1d" href="#lut1d">39.149 lut1d</a>
  1833. <ul class="toc-numbered-mark">
  1834. <li><a id="toc-Commands-108" href="#Commands-108">39.149.1 Commands</a></li>
  1835. </ul></li>
  1836. <li><a id="toc-lut3d-1" href="#lut3d-1">39.150 lut3d</a>
  1837. <ul class="toc-numbered-mark">
  1838. <li><a id="toc-Commands-109" href="#Commands-109">39.150.1 Commands</a></li>
  1839. </ul></li>
  1840. <li><a id="toc-lumakey" href="#lumakey">39.151 lumakey</a>
  1841. <ul class="toc-numbered-mark">
  1842. <li><a id="toc-Commands-110" href="#Commands-110">39.151.1 Commands</a></li>
  1843. </ul></li>
  1844. <li><a id="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">39.152 lut, lutrgb, lutyuv</a>
  1845. <ul class="toc-numbered-mark">
  1846. <li><a id="toc-Commands-111" href="#Commands-111">39.152.1 Commands</a></li>
  1847. <li><a id="toc-Examples-140" href="#Examples-140">39.152.2 Examples</a></li>
  1848. </ul></li>
  1849. <li><a id="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">39.153 lut2, tlut2</a>
  1850. <ul class="toc-numbered-mark">
  1851. <li><a id="toc-Commands-112" href="#Commands-112">39.153.1 Commands</a></li>
  1852. <li><a id="toc-Examples-141" href="#Examples-141">39.153.2 Examples</a></li>
  1853. </ul></li>
  1854. <li><a id="toc-maskedclamp" href="#maskedclamp">39.154 maskedclamp</a>
  1855. <ul class="toc-numbered-mark">
  1856. <li><a id="toc-Commands-113" href="#Commands-113">39.154.1 Commands</a></li>
  1857. </ul></li>
  1858. <li><a id="toc-maskedmax" href="#maskedmax">39.155 maskedmax</a>
  1859. <ul class="toc-numbered-mark">
  1860. <li><a id="toc-Commands-114" href="#Commands-114">39.155.1 Commands</a></li>
  1861. </ul></li>
  1862. <li><a id="toc-maskedmerge" href="#maskedmerge">39.156 maskedmerge</a>
  1863. <ul class="toc-numbered-mark">
  1864. <li><a id="toc-Commands-115" href="#Commands-115">39.156.1 Commands</a></li>
  1865. </ul></li>
  1866. <li><a id="toc-maskedmin" href="#maskedmin">39.157 maskedmin</a>
  1867. <ul class="toc-numbered-mark">
  1868. <li><a id="toc-Commands-116" href="#Commands-116">39.157.1 Commands</a></li>
  1869. </ul></li>
  1870. <li><a id="toc-maskedthreshold" href="#maskedthreshold">39.158 maskedthreshold</a>
  1871. <ul class="toc-numbered-mark">
  1872. <li><a id="toc-Commands-117" href="#Commands-117">39.158.1 Commands</a></li>
  1873. </ul></li>
  1874. <li><a id="toc-maskfun" href="#maskfun">39.159 maskfun</a>
  1875. <ul class="toc-numbered-mark">
  1876. <li><a id="toc-Commands-118" href="#Commands-118">39.159.1 Commands</a></li>
  1877. </ul></li>
  1878. <li><a id="toc-mcdeint" href="#mcdeint">39.160 mcdeint</a></li>
  1879. <li><a id="toc-median" href="#median">39.161 median</a>
  1880. <ul class="toc-numbered-mark">
  1881. <li><a id="toc-Commands-119" href="#Commands-119">39.161.1 Commands</a></li>
  1882. </ul></li>
  1883. <li><a id="toc-mergeplanes" href="#mergeplanes">39.162 mergeplanes</a>
  1884. <ul class="toc-numbered-mark">
  1885. <li><a id="toc-Examples-142" href="#Examples-142">39.162.1 Examples</a></li>
  1886. </ul></li>
  1887. <li><a id="toc-mestimate" href="#mestimate">39.163 mestimate</a></li>
  1888. <li><a id="toc-midequalizer" href="#midequalizer">39.164 midequalizer</a></li>
  1889. <li><a id="toc-minterpolate" href="#minterpolate">39.165 minterpolate</a></li>
  1890. <li><a id="toc-mix" href="#mix">39.166 mix</a>
  1891. <ul class="toc-numbered-mark">
  1892. <li><a id="toc-Commands-120" href="#Commands-120">39.166.1 Commands</a></li>
  1893. </ul></li>
  1894. <li><a id="toc-monochrome" href="#monochrome">39.167 monochrome</a>
  1895. <ul class="toc-numbered-mark">
  1896. <li><a id="toc-Commands-121" href="#Commands-121">39.167.1 Commands</a></li>
  1897. </ul></li>
  1898. <li><a id="toc-morpho" href="#morpho">39.168 morpho</a>
  1899. <ul class="toc-numbered-mark">
  1900. <li><a id="toc-Commands-122" href="#Commands-122">39.168.1 Commands</a></li>
  1901. </ul></li>
  1902. <li><a id="toc-mpdecimate" href="#mpdecimate">39.169 mpdecimate</a></li>
  1903. <li><a id="toc-msad" href="#msad">39.170 msad</a></li>
  1904. <li><a id="toc-multiply" href="#multiply">39.171 multiply</a>
  1905. <ul class="toc-numbered-mark">
  1906. <li><a id="toc-Commands-123" href="#Commands-123">39.171.1 Commands</a></li>
  1907. </ul></li>
  1908. <li><a id="toc-negate" href="#negate">39.172 negate</a>
  1909. <ul class="toc-numbered-mark">
  1910. <li><a id="toc-Commands-124" href="#Commands-124">39.172.1 Commands</a></li>
  1911. </ul></li>
  1912. <li><a id="toc-nlmeans-1" href="#nlmeans-1">39.173 nlmeans</a></li>
  1913. <li><a id="toc-nnedi" href="#nnedi">39.174 nnedi</a>
  1914. <ul class="toc-numbered-mark">
  1915. <li><a id="toc-Commands-125" href="#Commands-125">39.174.1 Commands</a></li>
  1916. </ul></li>
  1917. <li><a id="toc-noformat" href="#noformat">39.175 noformat</a>
  1918. <ul class="toc-numbered-mark">
  1919. <li><a id="toc-Examples-143" href="#Examples-143">39.175.1 Examples</a></li>
  1920. </ul></li>
  1921. <li><a id="toc-noise-1" href="#noise-1">39.176 noise</a>
  1922. <ul class="toc-numbered-mark">
  1923. <li><a id="toc-Examples-144" href="#Examples-144">39.176.1 Examples</a></li>
  1924. </ul></li>
  1925. <li><a id="toc-normalize" href="#normalize">39.177 normalize</a>
  1926. <ul class="toc-numbered-mark">
  1927. <li><a id="toc-Commands-126" href="#Commands-126">39.177.1 Commands</a></li>
  1928. <li><a id="toc-Examples-145" href="#Examples-145">39.177.2 Examples</a></li>
  1929. </ul></li>
  1930. <li><a id="toc-null-2" href="#null-2">39.178 null</a></li>
  1931. <li><a id="toc-ocr" href="#ocr">39.179 ocr</a></li>
  1932. <li><a id="toc-ocv" href="#ocv">39.180 ocv</a>
  1933. <ul class="toc-numbered-mark">
  1934. <li><a id="toc-dilate-1" href="#dilate-1">39.180.1 dilate</a></li>
  1935. <li><a id="toc-erode" href="#erode">39.180.2 erode</a></li>
  1936. <li><a id="toc-smooth" href="#smooth">39.180.3 smooth</a></li>
  1937. </ul></li>
  1938. <li><a id="toc-oscilloscope" href="#oscilloscope">39.181 oscilloscope</a>
  1939. <ul class="toc-numbered-mark">
  1940. <li><a id="toc-Commands-127" href="#Commands-127">39.181.1 Commands</a></li>
  1941. <li><a id="toc-Examples-146" href="#Examples-146">39.181.2 Examples</a></li>
  1942. </ul></li>
  1943. <li><a id="toc-overlay-1" href="#overlay-1">39.182 overlay</a>
  1944. <ul class="toc-numbered-mark">
  1945. <li><a id="toc-Commands-128" href="#Commands-128">39.182.1 Commands</a></li>
  1946. <li><a id="toc-Examples-147" href="#Examples-147">39.182.2 Examples</a></li>
  1947. </ul></li>
  1948. <li><a id="toc-owdenoise" href="#owdenoise">39.183 owdenoise</a></li>
  1949. <li><a id="toc-pad-1" href="#pad-1">39.184 pad</a>
  1950. <ul class="toc-numbered-mark">
  1951. <li><a id="toc-Examples-148" href="#Examples-148">39.184.1 Examples</a></li>
  1952. </ul></li>
  1953. <li><a id="toc-palettegen-1" href="#palettegen-1">39.185 palettegen</a>
  1954. <ul class="toc-numbered-mark">
  1955. <li><a id="toc-Examples-149" href="#Examples-149">39.185.1 Examples</a></li>
  1956. </ul></li>
  1957. <li><a id="toc-paletteuse" href="#paletteuse">39.186 paletteuse</a>
  1958. <ul class="toc-numbered-mark">
  1959. <li><a id="toc-Examples-150" href="#Examples-150">39.186.1 Examples</a></li>
  1960. </ul></li>
  1961. <li><a id="toc-perspective" href="#perspective">39.187 perspective</a></li>
  1962. <li><a id="toc-phase" href="#phase">39.188 phase</a>
  1963. <ul class="toc-numbered-mark">
  1964. <li><a id="toc-Commands-129" href="#Commands-129">39.188.1 Commands</a></li>
  1965. </ul></li>
  1966. <li><a id="toc-photosensitivity" href="#photosensitivity">39.189 photosensitivity</a></li>
  1967. <li><a id="toc-pixdesctest" href="#pixdesctest">39.190 pixdesctest</a></li>
  1968. <li><a id="toc-pixelize" href="#pixelize">39.191 pixelize</a>
  1969. <ul class="toc-numbered-mark">
  1970. <li><a id="toc-Commands-130" href="#Commands-130">39.191.1 Commands</a></li>
  1971. </ul></li>
  1972. <li><a id="toc-pixscope" href="#pixscope">39.192 pixscope</a>
  1973. <ul class="toc-numbered-mark">
  1974. <li><a id="toc-Commands-131" href="#Commands-131">39.192.1 Commands</a></li>
  1975. </ul></li>
  1976. <li><a id="toc-pp7" href="#pp7">39.193 pp7</a></li>
  1977. <li><a id="toc-premultiply" href="#premultiply">39.194 premultiply</a></li>
  1978. <li><a id="toc-premultiply_005fdynamic" href="#premultiply_005fdynamic">39.195 premultiply_dynamic</a></li>
  1979. <li><a id="toc-prewitt" href="#prewitt">39.196 prewitt</a>
  1980. <ul class="toc-numbered-mark">
  1981. <li><a id="toc-Commands-132" href="#Commands-132">39.196.1 Commands</a></li>
  1982. </ul></li>
  1983. <li><a id="toc-pseudocolor" href="#pseudocolor">39.197 pseudocolor</a>
  1984. <ul class="toc-numbered-mark">
  1985. <li><a id="toc-Commands-133" href="#Commands-133">39.197.1 Commands</a></li>
  1986. <li><a id="toc-Examples-151" href="#Examples-151">39.197.2 Examples</a></li>
  1987. </ul></li>
  1988. <li><a id="toc-psnr-1" href="#psnr-1">39.198 psnr</a>
  1989. <ul class="toc-numbered-mark">
  1990. <li><a id="toc-Examples-152" href="#Examples-152">39.198.1 Examples</a></li>
  1991. </ul></li>
  1992. <li><a id="toc-pullup-1" href="#pullup-1">39.199 pullup</a></li>
  1993. <li><a id="toc-qp" href="#qp">39.200 qp</a>
  1994. <ul class="toc-numbered-mark">
  1995. <li><a id="toc-Examples-153" href="#Examples-153">39.200.1 Examples</a></li>
  1996. </ul></li>
  1997. <li><a id="toc-qrencode" href="#qrencode">39.201 qrencode</a>
  1998. <ul class="toc-numbered-mark">
  1999. <li><a id="toc-qrencode-Expressions" href="#qrencode-Expressions">39.201.1 qrencode Expressions</a></li>
  2000. <li><a id="toc-qrencode-Text-expansion" href="#qrencode-Text-expansion">39.201.2 qrencode Text expansion</a></li>
  2001. <li><a id="toc-Examples-154" href="#Examples-154">39.201.3 Examples</a></li>
  2002. </ul></li>
  2003. <li><a id="toc-quirc" href="#quirc">39.202 quirc</a></li>
  2004. <li><a id="toc-random" href="#random">39.203 random</a></li>
  2005. <li><a id="toc-readeia608" href="#readeia608">39.204 readeia608</a>
  2006. <ul class="toc-numbered-mark">
  2007. <li><a id="toc-Commands-134" href="#Commands-134">39.204.1 Commands</a></li>
  2008. <li><a id="toc-Examples-155" href="#Examples-155">39.204.2 Examples</a></li>
  2009. </ul></li>
  2010. <li><a id="toc-readvitc" href="#readvitc">39.205 readvitc</a>
  2011. <ul class="toc-numbered-mark">
  2012. <li><a id="toc-Examples-156" href="#Examples-156">39.205.1 Examples</a></li>
  2013. </ul></li>
  2014. <li><a id="toc-remap" href="#remap">39.206 remap</a></li>
  2015. <li><a id="toc-removegrain" href="#removegrain">39.207 removegrain</a></li>
  2016. <li><a id="toc-removelogo" href="#removelogo">39.208 removelogo</a></li>
  2017. <li><a id="toc-repeatfields" href="#repeatfields">39.209 repeatfields</a></li>
  2018. <li><a id="toc-reverse" href="#reverse">39.210 reverse</a>
  2019. <ul class="toc-numbered-mark">
  2020. <li><a id="toc-Examples-157" href="#Examples-157">39.210.1 Examples</a></li>
  2021. </ul></li>
  2022. <li><a id="toc-rgbashift" href="#rgbashift">39.211 rgbashift</a>
  2023. <ul class="toc-numbered-mark">
  2024. <li><a id="toc-Commands-135" href="#Commands-135">39.211.1 Commands</a></li>
  2025. </ul></li>
  2026. <li><a id="toc-roberts" href="#roberts">39.212 roberts</a>
  2027. <ul class="toc-numbered-mark">
  2028. <li><a id="toc-Commands-136" href="#Commands-136">39.212.1 Commands</a></li>
  2029. </ul></li>
  2030. <li><a id="toc-rotate" href="#rotate">39.213 rotate</a>
  2031. <ul class="toc-numbered-mark">
  2032. <li><a id="toc-Examples-158" href="#Examples-158">39.213.1 Examples</a></li>
  2033. <li><a id="toc-Commands-137" href="#Commands-137">39.213.2 Commands</a></li>
  2034. </ul></li>
  2035. <li><a id="toc-sab" href="#sab">39.214 sab</a></li>
  2036. <li><a id="toc-scale-1" href="#scale-1">39.215 scale</a>
  2037. <ul class="toc-numbered-mark">
  2038. <li><a id="toc-Options-122" href="#Options-122">39.215.1 Options</a></li>
  2039. <li><a id="toc-Examples-159" href="#Examples-159">39.215.2 Examples</a></li>
  2040. <li><a id="toc-Commands-138" href="#Commands-138">39.215.3 Commands</a></li>
  2041. </ul></li>
  2042. <li><a id="toc-scharr" href="#scharr">39.216 scharr</a>
  2043. <ul class="toc-numbered-mark">
  2044. <li><a id="toc-Commands-139" href="#Commands-139">39.216.1 Commands</a></li>
  2045. </ul></li>
  2046. <li><a id="toc-scroll" href="#scroll">39.217 scroll</a>
  2047. <ul class="toc-numbered-mark">
  2048. <li><a id="toc-Commands-140" href="#Commands-140">39.217.1 Commands</a></li>
  2049. </ul></li>
  2050. <li><a id="toc-scdet-1" href="#scdet-1">39.218 scdet</a></li>
  2051. <li><a id="toc-selectivecolor-1" href="#selectivecolor-1">39.219 selectivecolor</a>
  2052. <ul class="toc-numbered-mark">
  2053. <li><a id="toc-Examples-160" href="#Examples-160">39.219.1 Examples</a></li>
  2054. </ul></li>
  2055. <li><a id="toc-separatefields-1" href="#separatefields-1">39.220 separatefields</a></li>
  2056. <li><a id="toc-setdar_002c-setsar" href="#setdar_002c-setsar">39.221 setdar, setsar</a>
  2057. <ul class="toc-numbered-mark">
  2058. <li><a id="toc-Examples-161" href="#Examples-161">39.221.1 Examples</a></li>
  2059. </ul></li>
  2060. <li><a id="toc-setfield-1" href="#setfield-1">39.222 setfield</a></li>
  2061. <li><a id="toc-setparams-1" href="#setparams-1">39.223 setparams</a></li>
  2062. <li><a id="toc-shear" href="#shear">39.224 shear</a>
  2063. <ul class="toc-numbered-mark">
  2064. <li><a id="toc-Commands-141" href="#Commands-141">39.224.1 Commands</a></li>
  2065. </ul></li>
  2066. <li><a id="toc-showinfo-1" href="#showinfo-1">39.225 showinfo</a></li>
  2067. <li><a id="toc-showpalette" href="#showpalette">39.226 showpalette</a></li>
  2068. <li><a id="toc-shuffleframes" href="#shuffleframes">39.227 shuffleframes</a>
  2069. <ul class="toc-numbered-mark">
  2070. <li><a id="toc-Examples-162" href="#Examples-162">39.227.1 Examples</a></li>
  2071. </ul></li>
  2072. <li><a id="toc-shufflepixels" href="#shufflepixels">39.228 shufflepixels</a></li>
  2073. <li><a id="toc-shuffleplanes" href="#shuffleplanes">39.229 shuffleplanes</a>
  2074. <ul class="toc-numbered-mark">
  2075. <li><a id="toc-Examples-163" href="#Examples-163">39.229.1 Examples</a></li>
  2076. </ul></li>
  2077. <li><a id="toc-signalstats-1" href="#signalstats-1">39.230 signalstats</a>
  2078. <ul class="toc-numbered-mark">
  2079. <li><a id="toc-Examples-164" href="#Examples-164">39.230.1 Examples</a></li>
  2080. </ul></li>
  2081. <li><a id="toc-signature-1" href="#signature-1">39.231 signature</a>
  2082. <ul class="toc-numbered-mark">
  2083. <li><a id="toc-Examples-165" href="#Examples-165">39.231.1 Examples</a></li>
  2084. </ul></li>
  2085. <li><a id="toc-siti-1" href="#siti-1">39.232 siti</a>
  2086. <ul class="toc-numbered-mark">
  2087. <li><a id="toc-Examples-166" href="#Examples-166">39.232.1 Examples</a></li>
  2088. </ul></li>
  2089. <li><a id="toc-smartblur-1" href="#smartblur-1">39.233 smartblur</a></li>
  2090. <li><a id="toc-sobel" href="#sobel">39.234 sobel</a>
  2091. <ul class="toc-numbered-mark">
  2092. <li><a id="toc-Commands-142" href="#Commands-142">39.234.1 Commands</a></li>
  2093. </ul></li>
  2094. <li><a id="toc-spp-1" href="#spp-1">39.235 spp</a>
  2095. <ul class="toc-numbered-mark">
  2096. <li><a id="toc-Commands-143" href="#Commands-143">39.235.1 Commands</a></li>
  2097. </ul></li>
  2098. <li><a id="toc-sr-1" href="#sr-1">39.236 sr</a></li>
  2099. <li><a id="toc-sr_005famf-1" href="#sr_005famf-1">39.237 sr_amf</a>
  2100. <ul class="toc-numbered-mark">
  2101. <li><a id="toc-Examples-167" href="#Examples-167">39.237.1 Examples</a></li>
  2102. </ul></li>
  2103. <li><a id="toc-ssim" href="#ssim">39.238 ssim</a>
  2104. <ul class="toc-numbered-mark">
  2105. <li><a id="toc-Examples-168" href="#Examples-168">39.238.1 Examples</a></li>
  2106. </ul></li>
  2107. <li><a id="toc-stereo3d" href="#stereo3d">39.239 stereo3d</a>
  2108. <ul class="toc-numbered-mark">
  2109. <li><a id="toc-Examples-169" href="#Examples-169">39.239.1 Examples</a></li>
  2110. </ul></li>
  2111. <li><a id="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">39.240 streamselect, astreamselect</a>
  2112. <ul class="toc-numbered-mark">
  2113. <li><a id="toc-Commands-144" href="#Commands-144">39.240.1 Commands</a></li>
  2114. <li><a id="toc-Examples-170" href="#Examples-170">39.240.2 Examples</a></li>
  2115. </ul></li>
  2116. <li><a id="toc-subtitles-1" href="#subtitles-1">39.241 subtitles</a></li>
  2117. <li><a id="toc-super2xsai" href="#super2xsai">39.242 super2xsai</a></li>
  2118. <li><a id="toc-swaprect" href="#swaprect">39.243 swaprect</a>
  2119. <ul class="toc-numbered-mark">
  2120. <li><a id="toc-Commands-145" href="#Commands-145">39.243.1 Commands</a></li>
  2121. </ul></li>
  2122. <li><a id="toc-swapuv" href="#swapuv">39.244 swapuv</a></li>
  2123. <li><a id="toc-tblend" href="#tblend">39.245 tblend</a></li>
  2124. <li><a id="toc-telecine" href="#telecine">39.246 telecine</a></li>
  2125. <li><a id="toc-thistogram" href="#thistogram">39.247 thistogram</a></li>
  2126. <li><a id="toc-threshold" href="#threshold">39.248 threshold</a>
  2127. <ul class="toc-numbered-mark">
  2128. <li><a id="toc-Commands-146" href="#Commands-146">39.248.1 Commands</a></li>
  2129. <li><a id="toc-Examples-171" href="#Examples-171">39.248.2 Examples</a></li>
  2130. </ul></li>
  2131. <li><a id="toc-thumbnail" href="#thumbnail">39.249 thumbnail</a>
  2132. <ul class="toc-numbered-mark">
  2133. <li><a id="toc-Examples-172" href="#Examples-172">39.249.1 Examples</a></li>
  2134. </ul></li>
  2135. <li><a id="toc-tile-1" href="#tile-1">39.250 tile</a>
  2136. <ul class="toc-numbered-mark">
  2137. <li><a id="toc-Examples-173" href="#Examples-173">39.250.1 Examples</a></li>
  2138. </ul></li>
  2139. <li><a id="toc-tiltandshift" href="#tiltandshift">39.251 tiltandshift</a></li>
  2140. <li><a id="toc-tinterlace" href="#tinterlace">39.252 tinterlace</a></li>
  2141. <li><a id="toc-tmedian" href="#tmedian">39.253 tmedian</a>
  2142. <ul class="toc-numbered-mark">
  2143. <li><a id="toc-Commands-147" href="#Commands-147">39.253.1 Commands</a></li>
  2144. </ul></li>
  2145. <li><a id="toc-tmidequalizer" href="#tmidequalizer">39.254 tmidequalizer</a></li>
  2146. <li><a id="toc-tmix" href="#tmix">39.255 tmix</a>
  2147. <ul class="toc-numbered-mark">
  2148. <li><a id="toc-Examples-174" href="#Examples-174">39.255.1 Examples</a></li>
  2149. <li><a id="toc-Commands-148" href="#Commands-148">39.255.2 Commands</a></li>
  2150. </ul></li>
  2151. <li><a id="toc-tonemap-1" href="#tonemap-1">39.256 tonemap</a>
  2152. <ul class="toc-numbered-mark">
  2153. <li><a id="toc-Options-123" href="#Options-123">39.256.1 Options</a></li>
  2154. </ul></li>
  2155. <li><a id="toc-tpad" href="#tpad">39.257 tpad</a></li>
  2156. <li><a id="toc-transpose-1" href="#transpose-1">39.258 transpose</a></li>
  2157. <li><a id="toc-trim" href="#trim">39.259 trim</a></li>
  2158. <li><a id="toc-unpremultiply" href="#unpremultiply">39.260 unpremultiply</a></li>
  2159. <li><a id="toc-unsharp-1" href="#unsharp-1">39.261 unsharp</a>
  2160. <ul class="toc-numbered-mark">
  2161. <li><a id="toc-Examples-175" href="#Examples-175">39.261.1 Examples</a></li>
  2162. </ul></li>
  2163. <li><a id="toc-untile-1" href="#untile-1">39.262 untile</a>
  2164. <ul class="toc-numbered-mark">
  2165. <li><a id="toc-Examples-176" href="#Examples-176">39.262.1 Examples</a></li>
  2166. </ul></li>
  2167. <li><a id="toc-uspp" href="#uspp">39.263 uspp</a></li>
  2168. <li><a id="toc-v360" href="#v360">39.264 v360</a>
  2169. <ul class="toc-numbered-mark">
  2170. <li><a id="toc-Examples-177" href="#Examples-177">39.264.1 Examples</a></li>
  2171. <li><a id="toc-Commands-149" href="#Commands-149">39.264.2 Commands</a></li>
  2172. </ul></li>
  2173. <li><a id="toc-vaguedenoiser" href="#vaguedenoiser">39.265 vaguedenoiser</a></li>
  2174. <li><a id="toc-varblur" href="#varblur">39.266 varblur</a>
  2175. <ul class="toc-numbered-mark">
  2176. <li><a id="toc-Commands-150" href="#Commands-150">39.266.1 Commands</a></li>
  2177. </ul></li>
  2178. <li><a id="toc-vectorscope" href="#vectorscope">39.267 vectorscope</a></li>
  2179. <li><a id="toc-vidstabdetect-1" href="#vidstabdetect-1">39.268 vidstabdetect</a>
  2180. <ul class="toc-numbered-mark">
  2181. <li><a id="toc-Examples-178" href="#Examples-178">39.268.1 Examples</a></li>
  2182. </ul></li>
  2183. <li><a id="toc-vidstabtransform-1" href="#vidstabtransform-1">39.269 vidstabtransform</a>
  2184. <ul class="toc-numbered-mark">
  2185. <li><a id="toc-Options-124" href="#Options-124">39.269.1 Options</a></li>
  2186. <li><a id="toc-Examples-179" href="#Examples-179">39.269.2 Examples</a></li>
  2187. </ul></li>
  2188. <li><a id="toc-vflip" href="#vflip">39.270 vflip</a></li>
  2189. <li><a id="toc-vfrdet" href="#vfrdet">39.271 vfrdet</a></li>
  2190. <li><a id="toc-vibrance" href="#vibrance">39.272 vibrance</a>
  2191. <ul class="toc-numbered-mark">
  2192. <li><a id="toc-Commands-151" href="#Commands-151">39.272.1 Commands</a></li>
  2193. </ul></li>
  2194. <li><a id="toc-vif" href="#vif">39.273 vif</a></li>
  2195. <li><a id="toc-vignette-1" href="#vignette-1">39.274 vignette</a>
  2196. <ul class="toc-numbered-mark">
  2197. <li><a id="toc-Expressions" href="#Expressions">39.274.1 Expressions</a></li>
  2198. <li><a id="toc-Examples-180" href="#Examples-180">39.274.2 Examples</a></li>
  2199. </ul></li>
  2200. <li><a id="toc-vmafmotion" href="#vmafmotion">39.275 vmafmotion</a></li>
  2201. <li><a id="toc-vpp_005famf-1" href="#vpp_005famf-1">39.276 vpp_amf</a>
  2202. <ul class="toc-numbered-mark">
  2203. <li><a id="toc-Examples-181" href="#Examples-181">39.276.1 Examples</a></li>
  2204. </ul></li>
  2205. <li><a id="toc-vstack-1" href="#vstack-1">39.277 vstack</a></li>
  2206. <li><a id="toc-w3fdif" href="#w3fdif">39.278 w3fdif</a>
  2207. <ul class="toc-numbered-mark">
  2208. <li><a id="toc-Commands-152" href="#Commands-152">39.278.1 Commands</a></li>
  2209. </ul></li>
  2210. <li><a id="toc-waveform" href="#waveform">39.279 waveform</a></li>
  2211. <li><a id="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">39.280 weave, doubleweave</a>
  2212. <ul class="toc-numbered-mark">
  2213. <li><a id="toc-Examples-182" href="#Examples-182">39.280.1 Examples</a></li>
  2214. </ul></li>
  2215. <li><a id="toc-xbr" href="#xbr">39.281 xbr</a></li>
  2216. <li><a id="toc-xcorrelate" href="#xcorrelate">39.282 xcorrelate</a></li>
  2217. <li><a id="toc-xfade" href="#xfade">39.283 xfade</a>
  2218. <ul class="toc-numbered-mark">
  2219. <li><a id="toc-Examples-183" href="#Examples-183">39.283.1 Examples</a></li>
  2220. </ul></li>
  2221. <li><a id="toc-xmedian" href="#xmedian">39.284 xmedian</a>
  2222. <ul class="toc-numbered-mark">
  2223. <li><a id="toc-Commands-153" href="#Commands-153">39.284.1 Commands</a></li>
  2224. </ul></li>
  2225. <li><a id="toc-xpsnr-1" href="#xpsnr-1">39.285 xpsnr</a>
  2226. <ul class="toc-numbered-mark">
  2227. <li><a id="toc-Examples-184" href="#Examples-184">39.285.1 Examples</a></li>
  2228. </ul></li>
  2229. <li><a id="toc-xstack-1" href="#xstack-1">39.286 xstack</a>
  2230. <ul class="toc-numbered-mark">
  2231. <li><a id="toc-Examples-185" href="#Examples-185">39.286.1 Examples</a></li>
  2232. </ul></li>
  2233. <li><a id="toc-yadif-1" href="#yadif-1">39.287 yadif</a></li>
  2234. <li><a id="toc-yaepblur" href="#yaepblur">39.288 yaepblur</a>
  2235. <ul class="toc-numbered-mark">
  2236. <li><a id="toc-Commands-154" href="#Commands-154">39.288.1 Commands</a></li>
  2237. </ul></li>
  2238. <li><a id="toc-zoompan" href="#zoompan">39.289 zoompan</a>
  2239. <ul class="toc-numbered-mark">
  2240. <li><a id="toc-Examples-186" href="#Examples-186">39.289.1 Examples</a></li>
  2241. </ul></li>
  2242. <li><a id="toc-zscale-1" href="#zscale-1">39.290 zscale</a>
  2243. <ul class="toc-numbered-mark">
  2244. <li><a id="toc-Options-125" href="#Options-125">39.290.1 Options</a></li>
  2245. <li><a id="toc-Commands-155" href="#Commands-155">39.290.2 Commands</a></li>
  2246. </ul></li>
  2247. </ul></li>
  2248. <li><a id="toc-CUDA-Video-Filters" href="#CUDA-Video-Filters">40 CUDA Video Filters</a>
  2249. <ul class="toc-numbered-mark">
  2250. <li><a id="toc-CUDA-1" href="#CUDA-1">40.1 CUDA</a>
  2251. <ul class="toc-numbered-mark">
  2252. <li><a id="toc-bilateral_005fcuda" href="#bilateral_005fcuda">40.1.1 bilateral_cuda</a>
  2253. <ul class="toc-numbered-mark">
  2254. <li><a id="toc-Examples-187" href="#Examples-187">40.1.1.1 Examples</a></li>
  2255. </ul></li>
  2256. <li><a id="toc-bwdif_005fcuda" href="#bwdif_005fcuda">40.1.2 bwdif_cuda</a></li>
  2257. <li><a id="toc-chromakey_005fcuda" href="#chromakey_005fcuda">40.1.3 chromakey_cuda</a>
  2258. <ul class="toc-numbered-mark">
  2259. <li><a id="toc-Examples-188" href="#Examples-188">40.1.3.1 Examples</a></li>
  2260. </ul></li>
  2261. <li><a id="toc-colorspace_005fcuda" href="#colorspace_005fcuda">40.1.4 colorspace_cuda</a></li>
  2262. <li><a id="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">40.1.5 overlay_cuda</a></li>
  2263. <li><a id="toc-pad_005fcuda-1" href="#pad_005fcuda-1">40.1.6 pad_cuda</a>
  2264. <ul class="toc-numbered-mark">
  2265. <li><a id="toc-Examples-189" href="#Examples-189">40.1.6.1 Examples</a></li>
  2266. </ul></li>
  2267. <li><a id="toc-scale_005fcuda-1" href="#scale_005fcuda-1">40.1.7 scale_cuda</a>
  2268. <ul class="toc-numbered-mark">
  2269. <li><a id="toc-Examples-190" href="#Examples-190">40.1.7.1 Examples</a></li>
  2270. </ul></li>
  2271. <li><a id="toc-thumbnail_005fcuda" href="#thumbnail_005fcuda">40.1.8 thumbnail_cuda</a>
  2272. <ul class="toc-numbered-mark">
  2273. <li><a id="toc-Example-11" href="#Example-11">40.1.8.1 Example</a></li>
  2274. </ul></li>
  2275. <li><a id="toc-yadif_005fcuda" href="#yadif_005fcuda">40.1.9 yadif_cuda</a></li>
  2276. </ul></li>
  2277. <li><a id="toc-CUDA-NPP-1" href="#CUDA-NPP-1">40.2 CUDA NPP</a>
  2278. <ul class="toc-numbered-mark">
  2279. <li><a id="toc-scale_005fnpp-1" href="#scale_005fnpp-1">40.2.1 scale_npp</a></li>
  2280. <li><a id="toc-scale2ref_005fnpp" href="#scale2ref_005fnpp">40.2.2 scale2ref_npp</a>
  2281. <ul class="toc-numbered-mark">
  2282. <li><a id="toc-Examples-191" href="#Examples-191">40.2.2.1 Examples</a></li>
  2283. </ul></li>
  2284. <li><a id="toc-sharpen_005fnpp" href="#sharpen_005fnpp">40.2.3 sharpen_npp</a></li>
  2285. <li><a id="toc-transpose_005fnpp" href="#transpose_005fnpp">40.2.4 transpose_npp</a></li>
  2286. </ul></li>
  2287. </ul></li>
  2288. <li><a id="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">41 OpenCL Video Filters</a>
  2289. <ul class="toc-numbered-mark">
  2290. <li><a id="toc-avgblur_005fopencl" href="#avgblur_005fopencl">41.1 avgblur_opencl</a>
  2291. <ul class="toc-numbered-mark">
  2292. <li><a id="toc-Example-12" href="#Example-12">41.1.1 Example</a></li>
  2293. </ul></li>
  2294. <li><a id="toc-boxblur_005fopencl" href="#boxblur_005fopencl">41.2 boxblur_opencl</a>
  2295. <ul class="toc-numbered-mark">
  2296. <li><a id="toc-Examples-192" href="#Examples-192">41.2.1 Examples</a></li>
  2297. </ul></li>
  2298. <li><a id="toc-colorkey_005fopencl" href="#colorkey_005fopencl">41.3 colorkey_opencl</a>
  2299. <ul class="toc-numbered-mark">
  2300. <li><a id="toc-Examples-193" href="#Examples-193">41.3.1 Examples</a></li>
  2301. </ul></li>
  2302. <li><a id="toc-convolution_005fopencl" href="#convolution_005fopencl">41.4 convolution_opencl</a>
  2303. <ul class="toc-numbered-mark">
  2304. <li><a id="toc-Examples-194" href="#Examples-194">41.4.1 Examples</a></li>
  2305. </ul></li>
  2306. <li><a id="toc-erosion_005fopencl" href="#erosion_005fopencl">41.5 erosion_opencl</a>
  2307. <ul class="toc-numbered-mark">
  2308. <li><a id="toc-Example-13" href="#Example-13">41.5.1 Example</a></li>
  2309. </ul></li>
  2310. <li><a id="toc-deshake_005fopencl" href="#deshake_005fopencl">41.6 deshake_opencl</a>
  2311. <ul class="toc-numbered-mark">
  2312. <li><a id="toc-Examples-195" href="#Examples-195">41.6.1 Examples</a></li>
  2313. </ul></li>
  2314. <li><a id="toc-dilation_005fopencl" href="#dilation_005fopencl">41.7 dilation_opencl</a>
  2315. <ul class="toc-numbered-mark">
  2316. <li><a id="toc-Example-14" href="#Example-14">41.7.1 Example</a></li>
  2317. </ul></li>
  2318. <li><a id="toc-nlmeans_005fopencl-1" href="#nlmeans_005fopencl-1">41.8 nlmeans_opencl</a></li>
  2319. <li><a id="toc-overlay_005fopencl" href="#overlay_005fopencl">41.9 overlay_opencl</a>
  2320. <ul class="toc-numbered-mark">
  2321. <li><a id="toc-Examples-196" href="#Examples-196">41.9.1 Examples</a></li>
  2322. </ul></li>
  2323. <li><a id="toc-pad_005fopencl" href="#pad_005fopencl">41.10 pad_opencl</a></li>
  2324. <li><a id="toc-prewitt_005fopencl" href="#prewitt_005fopencl">41.11 prewitt_opencl</a>
  2325. <ul class="toc-numbered-mark">
  2326. <li><a id="toc-Example-15" href="#Example-15">41.11.1 Example</a></li>
  2327. </ul></li>
  2328. <li><a id="toc-program_005fopencl-1" href="#program_005fopencl-1">41.12 program_opencl</a></li>
  2329. <li><a id="toc-remap_005fopencl" href="#remap_005fopencl">41.13 remap_opencl</a></li>
  2330. <li><a id="toc-roberts_005fopencl" href="#roberts_005fopencl">41.14 roberts_opencl</a>
  2331. <ul class="toc-numbered-mark">
  2332. <li><a id="toc-Example-16" href="#Example-16">41.14.1 Example</a></li>
  2333. </ul></li>
  2334. <li><a id="toc-sobel_005fopencl" href="#sobel_005fopencl">41.15 sobel_opencl</a>
  2335. <ul class="toc-numbered-mark">
  2336. <li><a id="toc-Example-17" href="#Example-17">41.15.1 Example</a></li>
  2337. </ul></li>
  2338. <li><a id="toc-tonemap_005fopencl" href="#tonemap_005fopencl">41.16 tonemap_opencl</a>
  2339. <ul class="toc-numbered-mark">
  2340. <li><a id="toc-Example-18" href="#Example-18">41.16.1 Example</a></li>
  2341. </ul></li>
  2342. <li><a id="toc-unsharp_005fopencl" href="#unsharp_005fopencl">41.17 unsharp_opencl</a>
  2343. <ul class="toc-numbered-mark">
  2344. <li><a id="toc-Examples-197" href="#Examples-197">41.17.1 Examples</a></li>
  2345. </ul></li>
  2346. <li><a id="toc-xfade_005fopencl" href="#xfade_005fopencl">41.18 xfade_opencl</a></li>
  2347. </ul></li>
  2348. <li><a id="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">42 VAAPI Video Filters</a>
  2349. <ul class="toc-numbered-mark">
  2350. <li><a id="toc-overlay_005fvaapi" href="#overlay_005fvaapi">42.1 overlay_vaapi</a>
  2351. <ul class="toc-numbered-mark">
  2352. <li><a id="toc-Examples-198" href="#Examples-198">42.1.1 Examples</a></li>
  2353. </ul></li>
  2354. <li><a id="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">42.2 tonemap_vaapi</a>
  2355. <ul class="toc-numbered-mark">
  2356. <li><a id="toc-Example-19" href="#Example-19">42.2.1 Example</a></li>
  2357. </ul></li>
  2358. <li><a id="toc-hstack_005fvaapi" href="#hstack_005fvaapi">42.3 hstack_vaapi</a></li>
  2359. <li><a id="toc-vstack_005fvaapi" href="#vstack_005fvaapi">42.4 vstack_vaapi</a></li>
  2360. <li><a id="toc-xstack_005fvaapi" href="#xstack_005fvaapi">42.5 xstack_vaapi</a></li>
  2361. <li><a id="toc-pad_005fvaapi" href="#pad_005fvaapi">42.6 pad_vaapi</a></li>
  2362. <li><a id="toc-drawbox_005fvaapi" href="#drawbox_005fvaapi">42.7 drawbox_vaapi</a>
  2363. <ul class="toc-numbered-mark">
  2364. <li><a id="toc-Examples-199" href="#Examples-199">42.7.1 Examples</a></li>
  2365. </ul></li>
  2366. </ul></li>
  2367. <li><a id="toc-VideoToolbox-Video-Filters" href="#VideoToolbox-Video-Filters">43 VideoToolbox Video Filters</a>
  2368. <ul class="toc-numbered-mark">
  2369. <li><a id="toc-scale_005fvt" href="#scale_005fvt">43.1 scale_vt</a>
  2370. <ul class="toc-numbered-mark">
  2371. <li><a id="toc-Examples-200" href="#Examples-200">43.1.1 Examples</a></li>
  2372. </ul></li>
  2373. <li><a id="toc-transpose_005fvt" href="#transpose_005fvt">43.2 transpose_vt</a></li>
  2374. </ul></li>
  2375. <li><a id="toc-Vulkan-Video-Filters" href="#Vulkan-Video-Filters">44 Vulkan Video Filters</a>
  2376. <ul class="toc-numbered-mark">
  2377. <li><a id="toc-avgblur_005fvulkan" href="#avgblur_005fvulkan">44.1 avgblur_vulkan</a></li>
  2378. <li><a id="toc-blend_005fvulkan" href="#blend_005fvulkan">44.2 blend_vulkan</a></li>
  2379. <li><a id="toc-bwdif_005fvulkan" href="#bwdif_005fvulkan">44.3 bwdif_vulkan</a></li>
  2380. <li><a id="toc-chromaber_005fvulkan" href="#chromaber_005fvulkan">44.4 chromaber_vulkan</a></li>
  2381. <li><a id="toc-color_005fvulkan" href="#color_005fvulkan">44.5 color_vulkan</a></li>
  2382. <li><a id="toc-vflip_005fvulkan" href="#vflip_005fvulkan">44.6 vflip_vulkan</a></li>
  2383. <li><a id="toc-hflip_005fvulkan" href="#hflip_005fvulkan">44.7 hflip_vulkan</a></li>
  2384. <li><a id="toc-flip_005fvulkan" href="#flip_005fvulkan">44.8 flip_vulkan</a></li>
  2385. <li><a id="toc-gblur_005fvulkan" href="#gblur_005fvulkan">44.9 gblur_vulkan</a></li>
  2386. <li><a id="toc-nlmeans_005fvulkan" href="#nlmeans_005fvulkan">44.10 nlmeans_vulkan</a></li>
  2387. <li><a id="toc-overlay_005fvulkan" href="#overlay_005fvulkan">44.11 overlay_vulkan</a></li>
  2388. <li><a id="toc-transpose_005fvulkan" href="#transpose_005fvulkan">44.12 transpose_vulkan</a></li>
  2389. </ul></li>
  2390. <li><a id="toc-QSV-Video-Filters" href="#QSV-Video-Filters">45 QSV Video Filters</a>
  2391. <ul class="toc-numbered-mark">
  2392. <li><a id="toc-hstack_005fqsv" href="#hstack_005fqsv">45.1 hstack_qsv</a></li>
  2393. <li><a id="toc-vstack_005fqsv" href="#vstack_005fqsv">45.2 vstack_qsv</a></li>
  2394. <li><a id="toc-xstack_005fqsv" href="#xstack_005fqsv">45.3 xstack_qsv</a></li>
  2395. </ul></li>
  2396. <li><a id="toc-Video-Sources" href="#Video-Sources">46 Video Sources</a>
  2397. <ul class="toc-numbered-mark">
  2398. <li><a id="toc-buffer" href="#buffer">46.1 buffer</a></li>
  2399. <li><a id="toc-cellauto" href="#cellauto">46.2 cellauto</a>
  2400. <ul class="toc-numbered-mark">
  2401. <li><a id="toc-Examples-201" href="#Examples-201">46.2.1 Examples</a></li>
  2402. </ul></li>
  2403. <li><a id="toc-coreimagesrc-1" href="#coreimagesrc-1">46.3 coreimagesrc</a>
  2404. <ul class="toc-numbered-mark">
  2405. <li><a id="toc-Examples-202" href="#Examples-202">46.3.1 Examples</a></li>
  2406. </ul></li>
  2407. <li><a id="toc-ddagrab" href="#ddagrab">46.4 ddagrab</a>
  2408. <ul class="toc-numbered-mark">
  2409. <li><a id="toc-Examples-203" href="#Examples-203">46.4.1 Examples</a></li>
  2410. </ul></li>
  2411. <li><a id="toc-gfxcapture" href="#gfxcapture">46.5 gfxcapture</a>
  2412. <ul class="toc-numbered-mark">
  2413. <li><a id="toc-Examples-204" href="#Examples-204">46.5.1 Examples</a></li>
  2414. </ul></li>
  2415. <li><a id="toc-gradients" href="#gradients">46.6 gradients</a>
  2416. <ul class="toc-numbered-mark">
  2417. <li><a id="toc-Commands-156" href="#Commands-156">46.6.1 Commands</a></li>
  2418. </ul></li>
  2419. <li><a id="toc-mandelbrot" href="#mandelbrot">46.7 mandelbrot</a></li>
  2420. <li><a id="toc-mptestsrc" href="#mptestsrc">46.8 mptestsrc</a></li>
  2421. <li><a id="toc-frei0r_005fsrc" href="#frei0r_005fsrc">46.9 frei0r_src</a></li>
  2422. <li><a id="toc-life" href="#life">46.10 life</a>
  2423. <ul class="toc-numbered-mark">
  2424. <li><a id="toc-Examples-205" href="#Examples-205">46.10.1 Examples</a></li>
  2425. </ul></li>
  2426. <li><a id="toc-perlin" href="#perlin">46.11 perlin</a>
  2427. <ul class="toc-numbered-mark">
  2428. <li><a id="toc-Options-126" href="#Options-126">46.11.1 Options</a></li>
  2429. <li><a id="toc-Examples-206" href="#Examples-206">46.11.2 Examples</a></li>
  2430. </ul></li>
  2431. <li><a id="toc-qrencodesrc" href="#qrencodesrc">46.12 qrencodesrc</a>
  2432. <ul class="toc-numbered-mark">
  2433. <li><a id="toc-Examples-207" href="#Examples-207">46.12.1 Examples</a></li>
  2434. </ul></li>
  2435. <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">46.13 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  2436. <ul class="toc-numbered-mark">
  2437. <li><a id="toc-Examples-208" href="#Examples-208">46.13.1 Examples</a></li>
  2438. <li><a id="toc-Commands-157" href="#Commands-157">46.13.2 Commands</a></li>
  2439. </ul></li>
  2440. <li><a id="toc-openclsrc" href="#openclsrc">46.14 openclsrc</a></li>
  2441. <li><a id="toc-sierpinski" href="#sierpinski">46.15 sierpinski</a></li>
  2442. <li><a id="toc-zoneplate" href="#zoneplate">46.16 zoneplate</a>
  2443. <ul class="toc-numbered-mark">
  2444. <li><a id="toc-Commands-158" href="#Commands-158">46.16.1 Commands</a></li>
  2445. <li><a id="toc-Examples-209" href="#Examples-209">46.16.2 Examples</a></li>
  2446. </ul></li>
  2447. </ul></li>
  2448. <li><a id="toc-Video-Sinks" href="#Video-Sinks">47 Video Sinks</a>
  2449. <ul class="toc-numbered-mark">
  2450. <li><a id="toc-buffersink" href="#buffersink">47.1 buffersink</a></li>
  2451. <li><a id="toc-nullsink" href="#nullsink">47.2 nullsink</a></li>
  2452. </ul></li>
  2453. <li><a id="toc-Multimedia-Filters" href="#Multimedia-Filters">48 Multimedia Filters</a>
  2454. <ul class="toc-numbered-mark">
  2455. <li><a id="toc-a3dscope" href="#a3dscope">48.1 a3dscope</a>
  2456. <ul class="toc-numbered-mark">
  2457. <li><a id="toc-Commands-159" href="#Commands-159">48.1.1 Commands</a></li>
  2458. </ul></li>
  2459. <li><a id="toc-abitscope" href="#abitscope">48.2 abitscope</a></li>
  2460. <li><a id="toc-adrawgraph" href="#adrawgraph">48.3 adrawgraph</a></li>
  2461. <li><a id="toc-agraphmonitor" href="#agraphmonitor">48.4 agraphmonitor</a></li>
  2462. <li><a id="toc-ahistogram" href="#ahistogram">48.5 ahistogram</a></li>
  2463. <li><a id="toc-aphasemeter" href="#aphasemeter">48.6 aphasemeter</a>
  2464. <ul class="toc-numbered-mark">
  2465. <li><a id="toc-phasing-detection" href="#phasing-detection">48.6.1 phasing detection</a></li>
  2466. <li><a id="toc-Examples-210" href="#Examples-210">48.6.2 Examples</a></li>
  2467. </ul></li>
  2468. <li><a id="toc-avectorscope" href="#avectorscope">48.7 avectorscope</a>
  2469. <ul class="toc-numbered-mark">
  2470. <li><a id="toc-Examples-211" href="#Examples-211">48.7.1 Examples</a></li>
  2471. <li><a id="toc-Commands-160" href="#Commands-160">48.7.2 Commands</a></li>
  2472. </ul></li>
  2473. <li><a id="toc-bench_002c-abench" href="#bench_002c-abench">48.8 bench, abench</a>
  2474. <ul class="toc-numbered-mark">
  2475. <li><a id="toc-Examples-212" href="#Examples-212">48.8.1 Examples</a></li>
  2476. </ul></li>
  2477. <li><a id="toc-concat-3" href="#concat-3">48.9 concat</a>
  2478. <ul class="toc-numbered-mark">
  2479. <li><a id="toc-Examples-213" href="#Examples-213">48.9.1 Examples</a></li>
  2480. <li><a id="toc-Commands-161" href="#Commands-161">48.9.2 Commands</a></li>
  2481. </ul></li>
  2482. <li><a id="toc-ebur128-1" href="#ebur128-1">48.10 ebur128</a>
  2483. <ul class="toc-numbered-mark">
  2484. <li><a id="toc-Examples-214" href="#Examples-214">48.10.1 Examples</a></li>
  2485. </ul></li>
  2486. <li><a id="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">48.11 interleave, ainterleave</a>
  2487. <ul class="toc-numbered-mark">
  2488. <li><a id="toc-Examples-215" href="#Examples-215">48.11.1 Examples</a></li>
  2489. </ul></li>
  2490. <li><a id="toc-latency_002c-alatency" href="#latency_002c-alatency">48.12 latency, alatency</a></li>
  2491. <li><a id="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">48.13 metadata, ametadata</a>
  2492. <ul class="toc-numbered-mark">
  2493. <li><a id="toc-Examples-216" href="#Examples-216">48.13.1 Examples</a></li>
  2494. </ul></li>
  2495. <li><a id="toc-perms_002c-aperms" href="#perms_002c-aperms">48.14 perms, aperms</a></li>
  2496. <li><a id="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">48.15 realtime, arealtime</a>
  2497. <ul class="toc-numbered-mark">
  2498. <li><a id="toc-Commands-162" href="#Commands-162">48.15.1 Commands</a></li>
  2499. </ul></li>
  2500. <li><a id="toc-segment_002c-asegment" href="#segment_002c-asegment">48.16 segment, asegment</a>
  2501. <ul class="toc-numbered-mark">
  2502. <li><a id="toc-Examples-217" href="#Examples-217">48.16.1 Examples</a></li>
  2503. </ul></li>
  2504. <li><a id="toc-select_002c-aselect" href="#select_002c-aselect">48.17 select, aselect</a>
  2505. <ul class="toc-numbered-mark">
  2506. <li><a id="toc-Examples-218" href="#Examples-218">48.17.1 Examples</a></li>
  2507. </ul></li>
  2508. <li><a id="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">48.18 sendcmd, asendcmd</a>
  2509. <ul class="toc-numbered-mark">
  2510. <li><a id="toc-Commands-syntax" href="#Commands-syntax">48.18.1 Commands syntax</a></li>
  2511. <li><a id="toc-Examples-219" href="#Examples-219">48.18.2 Examples</a></li>
  2512. </ul></li>
  2513. <li><a id="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">48.19 setpts, asetpts</a>
  2514. <ul class="toc-numbered-mark">
  2515. <li><a id="toc-Examples-220" href="#Examples-220">48.19.1 Examples</a></li>
  2516. <li><a id="toc-Commands-163" href="#Commands-163">48.19.2 Commands</a></li>
  2517. </ul></li>
  2518. <li><a id="toc-setrange" href="#setrange">48.20 setrange</a></li>
  2519. <li><a id="toc-settb_002c-asettb" href="#settb_002c-asettb">48.21 settb, asettb</a>
  2520. <ul class="toc-numbered-mark">
  2521. <li><a id="toc-Examples-221" href="#Examples-221">48.21.1 Examples</a></li>
  2522. </ul></li>
  2523. <li><a id="toc-showcqt" href="#showcqt">48.22 showcqt</a>
  2524. <ul class="toc-numbered-mark">
  2525. <li><a id="toc-Examples-222" href="#Examples-222">48.22.1 Examples</a></li>
  2526. </ul></li>
  2527. <li><a id="toc-showcwt" href="#showcwt">48.23 showcwt</a></li>
  2528. <li><a id="toc-showfreqs" href="#showfreqs">48.24 showfreqs</a></li>
  2529. <li><a id="toc-showspatial" href="#showspatial">48.25 showspatial</a></li>
  2530. <li><a id="toc-showspectrum-1" href="#showspectrum-1">48.26 showspectrum</a>
  2531. <ul class="toc-numbered-mark">
  2532. <li><a id="toc-Examples-223" href="#Examples-223">48.26.1 Examples</a></li>
  2533. </ul></li>
  2534. <li><a id="toc-showspectrumpic" href="#showspectrumpic">48.27 showspectrumpic</a>
  2535. <ul class="toc-numbered-mark">
  2536. <li><a id="toc-Examples-224" href="#Examples-224">48.27.1 Examples</a></li>
  2537. </ul></li>
  2538. <li><a id="toc-showvolume" href="#showvolume">48.28 showvolume</a></li>
  2539. <li><a id="toc-showwaves" href="#showwaves">48.29 showwaves</a>
  2540. <ul class="toc-numbered-mark">
  2541. <li><a id="toc-Examples-225" href="#Examples-225">48.29.1 Examples</a></li>
  2542. </ul></li>
  2543. <li><a id="toc-showwavespic" href="#showwavespic">48.30 showwavespic</a>
  2544. <ul class="toc-numbered-mark">
  2545. <li><a id="toc-Examples-226" href="#Examples-226">48.30.1 Examples</a></li>
  2546. </ul></li>
  2547. <li><a id="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">48.31 sidedata, asidedata</a></li>
  2548. <li><a id="toc-spectrumsynth" href="#spectrumsynth">48.32 spectrumsynth</a>
  2549. <ul class="toc-numbered-mark">
  2550. <li><a id="toc-Examples-227" href="#Examples-227">48.32.1 Examples</a></li>
  2551. </ul></li>
  2552. <li><a id="toc-split_002c-asplit" href="#split_002c-asplit">48.33 split, asplit</a>
  2553. <ul class="toc-numbered-mark">
  2554. <li><a id="toc-Examples-228" href="#Examples-228">48.33.1 Examples</a></li>
  2555. </ul></li>
  2556. <li><a id="toc-zmq_002c-azmq" href="#zmq_002c-azmq">48.34 zmq, azmq</a>
  2557. <ul class="toc-numbered-mark">
  2558. <li><a id="toc-Examples-229" href="#Examples-229">48.34.1 Examples</a></li>
  2559. </ul></li>
  2560. </ul></li>
  2561. <li><a id="toc-Multimedia-Sources" href="#Multimedia-Sources">49 Multimedia Sources</a>
  2562. <ul class="toc-numbered-mark">
  2563. <li><a id="toc-amovie" href="#amovie">49.1 amovie</a></li>
  2564. <li><a id="toc-avsynctest" href="#avsynctest">49.2 avsynctest</a>
  2565. <ul class="toc-numbered-mark">
  2566. <li><a id="toc-Commands-164" href="#Commands-164">49.2.1 Commands</a></li>
  2567. </ul></li>
  2568. <li><a id="toc-movie-1" href="#movie-1">49.3 movie</a>
  2569. <ul class="toc-numbered-mark">
  2570. <li><a id="toc-Examples-230" href="#Examples-230">49.3.1 Examples</a></li>
  2571. <li><a id="toc-Commands-165" href="#Commands-165">49.3.2 Commands</a></li>
  2572. </ul></li>
  2573. </ul></li>
  2574. <li><a id="toc-External-libraries" href="#External-libraries">50 External libraries</a>
  2575. <ul class="toc-numbered-mark">
  2576. <li><a id="toc-Alliance-for-Open-Media-_0028AOM_0029" href="#Alliance-for-Open-Media-_0028AOM_0029">50.1 Alliance for Open Media (AOM)</a></li>
  2577. <li><a id="toc-AMD-AMF_002fVCE" href="#AMD-AMF_002fVCE">50.2 AMD AMF/VCE</a></li>
  2578. <li><a id="toc-AviSynth" href="#AviSynth">50.3 AviSynth</a></li>
  2579. <li><a id="toc-Chromaprint" href="#Chromaprint">50.4 Chromaprint</a></li>
  2580. <li><a id="toc-codec2-1" href="#codec2-1">50.5 codec2</a></li>
  2581. <li><a id="toc-dav1d" href="#dav1d">50.6 dav1d</a></li>
  2582. <li><a id="toc-davs2" href="#davs2">50.7 davs2</a></li>
  2583. <li><a id="toc-uavs3d" href="#uavs3d">50.8 uavs3d</a></li>
  2584. <li><a id="toc-Game-Music-Emu" href="#Game-Music-Emu">50.9 Game Music Emu</a></li>
  2585. <li><a id="toc-Intel-QuickSync-Video" href="#Intel-QuickSync-Video">50.10 Intel QuickSync Video</a></li>
  2586. <li><a id="toc-Kvazaar" href="#Kvazaar">50.11 Kvazaar</a></li>
  2587. <li><a id="toc-LAME" href="#LAME">50.12 LAME</a></li>
  2588. <li><a id="toc-LCEVCdec" href="#LCEVCdec">50.13 LCEVCdec</a></li>
  2589. <li><a id="toc-libilbc-1" href="#libilbc-1">50.14 libilbc</a></li>
  2590. <li><a id="toc-libjxl-1" href="#libjxl-1">50.15 libjxl</a></li>
  2591. <li><a id="toc-libvpx-1" href="#libvpx-1">50.16 libvpx</a></li>
  2592. <li><a id="toc-ModPlug" href="#ModPlug">50.17 ModPlug</a></li>
  2593. <li><a id="toc-OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">50.18 OpenCORE, VisualOn, and Fraunhofer libraries</a>
  2594. <ul class="toc-numbered-mark">
  2595. <li><a id="toc-OpenCORE-AMR" href="#OpenCORE-AMR">50.18.1 OpenCORE AMR</a></li>
  2596. <li><a id="toc-VisualOn-AMR_002dWB-encoder-library" href="#VisualOn-AMR_002dWB-encoder-library">50.18.2 VisualOn AMR-WB encoder library</a></li>
  2597. <li><a id="toc-Fraunhofer-AAC-library" href="#Fraunhofer-AAC-library">50.18.3 Fraunhofer AAC library</a></li>
  2598. <li><a id="toc-Fraunhofer-MPEG_002dH-3D-Audio-decoder-library" href="#Fraunhofer-MPEG_002dH-3D-Audio-decoder-library">50.18.4 Fraunhofer MPEG-H 3D Audio decoder library</a></li>
  2599. <li><a id="toc-LC3-library" href="#LC3-library">50.18.5 LC3 library</a></li>
  2600. </ul></li>
  2601. <li><a id="toc-OpenH264" href="#OpenH264">50.19 OpenH264</a></li>
  2602. <li><a id="toc-OpenJPEG" href="#OpenJPEG">50.20 OpenJPEG</a></li>
  2603. <li><a id="toc-rav1e" href="#rav1e">50.21 rav1e</a></li>
  2604. <li><a id="toc-SVT_002dAV1" href="#SVT_002dAV1">50.22 SVT-AV1</a></li>
  2605. <li><a id="toc-SVT_002dJPEG_002dXS" href="#SVT_002dJPEG_002dXS">50.23 SVT-JPEG-XS</a></li>
  2606. <li><a id="toc-TwoLAME" href="#TwoLAME">50.24 TwoLAME</a></li>
  2607. <li><a id="toc-VapourSynth" href="#VapourSynth">50.25 VapourSynth</a></li>
  2608. <li><a id="toc-x264" href="#x264">50.26 x264</a></li>
  2609. <li><a id="toc-x265" href="#x265">50.27 x265</a></li>
  2610. <li><a id="toc-xavs" href="#xavs">50.28 xavs</a></li>
  2611. <li><a id="toc-xavs2" href="#xavs2">50.29 xavs2</a></li>
  2612. <li><a id="toc-eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029" href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029">50.30 eXtra-fast Essential Video Encoder (XEVE)</a></li>
  2613. <li><a id="toc-eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029" href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029">50.31 eXtra-fast Essential Video Decoder (XEVD)</a></li>
  2614. <li><a id="toc-ZVBI" href="#ZVBI">50.32 ZVBI</a></li>
  2615. </ul></li>
  2616. <li><a id="toc-Supported-File-Formats_002c-Codecs-or-Features" href="#Supported-File-Formats_002c-Codecs-or-Features">51 Supported File Formats, Codecs or Features</a>
  2617. <ul class="toc-numbered-mark">
  2618. <li><a id="toc-File-Formats" href="#File-Formats">51.1 File Formats</a></li>
  2619. <li><a id="toc-Image-Formats" href="#Image-Formats">51.2 Image Formats</a></li>
  2620. <li><a id="toc-Video-Codecs" href="#Video-Codecs">51.3 Video Codecs</a></li>
  2621. <li><a id="toc-Audio-Codecs" href="#Audio-Codecs">51.4 Audio Codecs</a></li>
  2622. <li><a id="toc-Subtitle-Formats" href="#Subtitle-Formats">51.5 Subtitle Formats</a></li>
  2623. <li><a id="toc-Network-Protocols" href="#Network-Protocols">51.6 Network Protocols</a></li>
  2624. <li><a id="toc-Input_002fOutput-Devices" href="#Input_002fOutput-Devices">51.7 Input/Output Devices</a></li>
  2625. <li><a id="toc-Timecode" href="#Timecode">51.8 Timecode</a></li>
  2626. </ul></li>
  2627. <li><a id="toc-See-Also" href="#See-Also">52 See Also</a></li>
  2628. <li><a id="toc-Authors" href="#Authors">53 Authors</a></li>
  2629. </ul>
  2630. </div>
  2631. </div>
  2632. <a name="Synopsis"></a>
  2633. <h2 class="chapter">1 Synopsis<span class="pull-right"><a class="anchor hidden-xs" href="#Synopsis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Synopsis" aria-hidden="true">TOC</a></span></h2>
  2634. <p>ffmpeg [<var class="var">global_options</var>] {[<var class="var">input_file_options</var>] -i <samp class="file">input_url</samp>} ... {[<var class="var">output_file_options</var>] <samp class="file">output_url</samp>} ...
  2635. </p>
  2636. <a name="Description"></a>
  2637. <h2 class="chapter">2 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
  2638. <p><code class="command">ffmpeg</code> is a universal media converter. It can read a wide variety of
  2639. inputs - including live grabbing/recording devices - filter, and transcode them
  2640. into a plethora of output formats.
  2641. </p>
  2642. <p><code class="command">ffmpeg</code> reads from an arbitrary number of inputs (which can be regular
  2643. files, pipes, network streams, grabbing devices, etc.), specified by the
  2644. <code class="code">-i</code> option, and writes to an arbitrary number of outputs, which are
  2645. specified by a plain output url. Anything found on the command line which cannot
  2646. be interpreted as an option is considered to be an output url.
  2647. </p>
  2648. <p>Each input or output can, in principle, contain any number of elementary streams
  2649. of different types (video/audio/subtitle/attachment/data), though the allowed
  2650. stream counts and/or types may be limited by the container format. Selecting
  2651. which streams from which inputs will go into which output is either done
  2652. automatically or with the <code class="code">-map</code> option (see the <a class="ref" href="#Stream-selection">Stream selection</a>
  2653. chapter).
  2654. </p>
  2655. <p>To refer to inputs/outputs in options, you must use their indices (0-based).
  2656. E.g. the first input is <code class="code">0</code>, the second is <code class="code">1</code>, etc. Similarly,
  2657. streams within an input/output are referred to by their indices. E.g. <code class="code">2:3</code>
  2658. refers to the fourth stream in the third input or output. Also see the
  2659. <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter.
  2660. </p>
  2661. <p>As a general rule, options are applied to the next specified
  2662. file. Therefore, order is important, and you can have the same
  2663. option on the command line multiple times. Each occurrence is
  2664. then applied to the next input or output file.
  2665. Exceptions from this rule are the global options (e.g. verbosity level),
  2666. which should be specified first.
  2667. </p>
  2668. <p>Do not mix input and output files &ndash; first specify all input files, then all
  2669. output files. Also do not mix options which belong to different files. All
  2670. options apply ONLY to the next input or output file and are reset between files.
  2671. </p>
  2672. <p>Some simple examples follow.
  2673. </p>
  2674. <ul class="itemize mark-bullet">
  2675. <li>Convert an input media file to a different format, by re-encoding media streams:
  2676. <div class="example">
  2677. <pre class="example-preformatted">ffmpeg -i input.avi output.mp4
  2678. </pre></div>
  2679. </li><li>Set the video bitrate of the output file to 64 kbit/s:
  2680. <div class="example">
  2681. <pre class="example-preformatted">ffmpeg -i input.avi -b:v 64k -bufsize 64k output.mp4
  2682. </pre></div>
  2683. </li><li>Force the frame rate of the output file to 24 fps:
  2684. <div class="example">
  2685. <pre class="example-preformatted">ffmpeg -i input.avi -r 24 output.mp4
  2686. </pre></div>
  2687. </li><li>Force the frame rate of the input file (valid for raw formats only) to 1 fps and
  2688. the frame rate of the output file to 24 fps:
  2689. <div class="example">
  2690. <pre class="example-preformatted">ffmpeg -r 1 -i input.m2v -r 24 output.mp4
  2691. </pre></div>
  2692. </li></ul>
  2693. <p>The format option may be needed for raw input files.
  2694. </p>
  2695. <a name="Detailed-description"></a>
  2696. <h2 class="chapter">3 Detailed description<span class="pull-right"><a class="anchor hidden-xs" href="#Detailed-description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Detailed-description" aria-hidden="true">TOC</a></span></h2>
  2697. <p><code class="command">ffmpeg</code> builds a transcoding pipeline out of the components listed
  2698. below. The program&rsquo;s operation then consists of input data chunks flowing from
  2699. the sources down the pipes towards the sinks, while being transformed by the
  2700. components they encounter along the way.
  2701. </p>
  2702. <p>The following kinds of components are available:
  2703. </p><ul class="itemize mark-bullet">
  2704. <li><em class="emph">Demuxers</em> (short for &quot;demultiplexers&quot;) read an input source in order to
  2705. extract
  2706. <ul class="itemize mark-bullet">
  2707. <li>global properties such as metadata or chapters;
  2708. </li><li>list of input elementary streams and their properties
  2709. </li></ul>
  2710. <p>One demuxer instance is created for each <samp class="option">-i</samp> option, and sends encoded
  2711. <em class="emph">packets</em> to <em class="emph">decoders</em> or <em class="emph">muxers</em>.
  2712. </p>
  2713. <p>In other literature, demuxers are sometimes called <em class="emph">splitters</em>, because
  2714. their main function is splitting a file into elementary streams (though some
  2715. files only contain one elementary stream).
  2716. </p>
  2717. <p>A schematic representation of a demuxer looks like this:
  2718. </p><pre class="verbatim">┌──────────┬───────────────────────┐
  2719. │ demuxer │ │ packets for stream 0
  2720. ╞══════════╡ elementary stream 0 ├──────────────────────►
  2721. │ │ │
  2722. │ global ├───────────────────────┤
  2723. │properties│ │ packets for stream 1
  2724. │ and │ elementary stream 1 ├──────────────────────►
  2725. │ metadata │ │
  2726. │ ├───────────────────────┤
  2727. │ │ │
  2728. │ │ ........... │
  2729. │ │ │
  2730. │ ├───────────────────────┤
  2731. │ │ │ packets for stream N
  2732. │ │ elementary stream N ├──────────────────────►
  2733. │ │ │
  2734. └──────────┴───────────────────────┘
  2735. │ read from file, network stream,
  2736. │ grabbing device, etc.
  2737. </pre>
  2738. </li><li><em class="emph">Decoders</em> receive encoded (compressed) <em class="emph">packets</em> for an audio, video,
  2739. or subtitle elementary stream, and decode them into raw <em class="emph">frames</em> (arrays of
  2740. pixels for video, PCM for audio). A decoder is typically associated with (and
  2741. receives its input from) an elementary stream in a <em class="emph">demuxer</em>, but sometimes
  2742. may also exist on its own (see <a class="ref" href="#Loopback-decoders">Loopback decoders</a>).
  2743. <p>A schematic representation of a decoder looks like this:
  2744. </p><pre class="verbatim"> ┌─────────┐
  2745. packets │ │ raw frames
  2746. ─────────►│ decoder ├────────────►
  2747. │ │
  2748. └─────────┘
  2749. </pre>
  2750. </li><li><em class="emph">Filtergraphs</em> process and transform raw audio or video <em class="emph">frames</em>. A
  2751. filtergraph consists of one or more individual <em class="emph">filters</em> linked into a
  2752. graph. Filtergraphs come in two flavors - <em class="emph">simple</em> and <em class="emph">complex</em>,
  2753. configured with the <samp class="option">-filter</samp> and <samp class="option">-filter_complex</samp> options,
  2754. respectively.
  2755. <p>A simple filtergraph is associated with an <em class="emph">output elementary stream</em>; it
  2756. receives the input to be filtered from a <em class="emph">decoder</em> and sends filtered
  2757. output to that output stream&rsquo;s <em class="emph">encoder</em>.
  2758. </p>
  2759. <p>A simple video filtergraph that performs deinterlacing (using the <code class="code">yadif</code>
  2760. deinterlacer) followed by resizing (using the <code class="code">scale</code> filter) can look like
  2761. this:
  2762. </p><pre class="verbatim">
  2763. ┌────────────────────────┐
  2764. │ simple filtergraph │
  2765. frames from ╞════════════════════════╡ frames for
  2766. a decoder │ ┌───────┐ ┌───────┐ │ an encoder
  2767. ────────────►├─►│ yadif ├─►│ scale ├─►│────────────►
  2768. │ └───────┘ └───────┘ │
  2769. └────────────────────────┘
  2770. </pre>
  2771. <p>A complex filtergraph is standalone and not associated with any specific stream.
  2772. It may have multiple (or zero) inputs, potentially of different types (audio or
  2773. video), each of which receiving data either from a decoder or another complex
  2774. filtergraph&rsquo;s output. It also has one or more outputs that feed either an
  2775. encoder or another complex filtergraph&rsquo;s input.
  2776. </p>
  2777. <p>The following example diagram represents a complex filtergraph with 3 inputs and
  2778. 2 outputs (all video):
  2779. </p><pre class="verbatim"> ┌─────────────────────────────────────────────────┐
  2780. │ complex filtergraph │
  2781. ╞═════════════════════════════════════════════════╡
  2782. frames ├───────┐ ┌─────────┐ ┌─────────┐ ┌────────┤ frames
  2783. ─────────►│input 0├─►│ overlay ├─────►│ overlay ├─►│output 0├────────►
  2784. ├───────┘ │ │ │ │ └────────┤
  2785. frames ├───────┐╭►│ │ ╭►│ │ │
  2786. ─────────►│input 1├╯ └─────────┘ │ └─────────┘ │
  2787. ├───────┘ │ │
  2788. frames ├───────┐ ┌─────┐ ┌─────┬─╯ ┌────────┤ frames
  2789. ─────────►│input 2├►│scale├►│split├───────────────►│output 1├────────►
  2790. ├───────┘ └─────┘ └─────┘ └────────┤
  2791. └─────────────────────────────────────────────────┘
  2792. </pre><p>Frames from second input are overlaid over those from the first. Frames from the
  2793. third input are rescaled, then the duplicated into two identical streams. One of
  2794. them is overlaid over the combined first two inputs, with the result exposed as
  2795. the filtergraph&rsquo;s first output. The other duplicate ends up being the
  2796. filtergraph&rsquo;s second output.
  2797. </p>
  2798. </li><li><em class="emph">Encoders</em> receive raw audio, video, or subtitle <em class="emph">frames</em> and encode
  2799. them into encoded <em class="emph">packets</em>. The encoding (compression) process is
  2800. typically <em class="emph">lossy</em> - it degrades stream quality to make the output smaller;
  2801. some encoders are <em class="emph">lossless</em>, but at the cost of much higher output size. A
  2802. video or audio encoder receives its input from some filtergraph&rsquo;s output,
  2803. subtitle encoders receive input from a decoder (since subtitle filtering is not
  2804. supported yet). Every encoder is associated with some muxer&rsquo;s <em class="emph">output
  2805. elementary stream</em> and sends its output to that muxer.
  2806. <p>A schematic representation of an encoder looks like this:
  2807. </p><pre class="verbatim"> ┌─────────┐
  2808. raw frames │ │ packets
  2809. ────────────►│ encoder ├─────────►
  2810. │ │
  2811. └─────────┘
  2812. </pre>
  2813. </li><li><em class="emph">Muxers</em> (short for &quot;multiplexers&quot;) receive encoded <em class="emph">packets</em> for
  2814. their elementary streams from encoders (the <em class="emph">transcoding</em> path) or directly
  2815. from demuxers (the <em class="emph">streamcopy</em> path), interleave them (when there is more
  2816. than one elementary stream), and write the resulting bytes into the output file
  2817. (or pipe, network stream, etc.).
  2818. <p>A schematic representation of a muxer looks like this:
  2819. </p><pre class="verbatim"> ┌──────────────────────┬───────────┐
  2820. packets for stream 0 │ │ muxer │
  2821. ──────────────────────►│ elementary stream 0 ╞═══════════╡
  2822. │ │ │
  2823. ├──────────────────────┤ global │
  2824. packets for stream 1 │ │properties │
  2825. ──────────────────────►│ elementary stream 1 │ and │
  2826. │ │ metadata │
  2827. ├──────────────────────┤ │
  2828. │ │ │
  2829. │ ........... │ │
  2830. │ │ │
  2831. ├──────────────────────┤ │
  2832. packets for stream N │ │ │
  2833. ──────────────────────►│ elementary stream N │ │
  2834. │ │ │
  2835. └──────────────────────┴─────┬─────┘
  2836. write to file, network stream, │
  2837. grabbing device, etc. │
  2838. </pre>
  2839. </li></ul>
  2840. <a name="Streamcopy"></a>
  2841. <h3 class="section">3.1 Streamcopy<span class="pull-right"><a class="anchor hidden-xs" href="#Streamcopy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Streamcopy" aria-hidden="true">TOC</a></span></h3>
  2842. <p>The simplest pipeline in <code class="command">ffmpeg</code> is single-stream
  2843. <em class="emph">streamcopy</em>, that is copying one <em class="emph">input elementary stream</em>&rsquo;s packets
  2844. without decoding, filtering, or encoding them. As an example, consider an input
  2845. file called <samp class="file">INPUT.mkv</samp> with 3 elementary streams, from which we take the
  2846. second and write it to file <samp class="file">OUTPUT.mp4</samp>. A schematic representation of
  2847. such a pipeline looks like this:
  2848. </p><pre class="verbatim">┌──────────┬─────────────────────┐
  2849. │ demuxer │ │ unused
  2850. ╞══════════╡ elementary stream 0 ├────────╳
  2851. │ │ │
  2852. │INPUT.mkv ├─────────────────────┤ ┌──────────────────────┬───────────┐
  2853. │ │ │ packets │ │ muxer │
  2854. │ │ elementary stream 1 ├─────────►│ elementary stream 0 ╞═══════════╡
  2855. │ │ │ │ │OUTPUT.mp4 │
  2856. │ ├─────────────────────┤ └──────────────────────┴───────────┘
  2857. │ │ │ unused
  2858. │ │ elementary stream 2 ├────────╳
  2859. │ │ │
  2860. └──────────┴─────────────────────┘
  2861. </pre>
  2862. <p>The above pipeline can be constructed with the following commandline:
  2863. </p><div class="example">
  2864. <pre class="example-preformatted">ffmpeg -i INPUT.mkv -map 0:1 -c copy OUTPUT.mp4
  2865. </pre></div>
  2866. <p>In this commandline
  2867. </p><ul class="itemize mark-bullet">
  2868. <li>there is a single input <samp class="file">INPUT.mkv</samp>;
  2869. </li><li>there are no input options for this input;
  2870. </li><li>there is a single output <samp class="file">OUTPUT.mp4</samp>;
  2871. </li><li>there are two output options for this output:
  2872. <ul class="itemize mark-bullet">
  2873. <li><code class="code">-map 0:1</code> selects the input stream to be used - from input with index 0
  2874. (i.e. the first one) the stream with index 1 (i.e. the second one);
  2875. </li><li><code class="code">-c copy</code> selects the <code class="code">copy</code> encoder, i.e. streamcopy with no decoding
  2876. or encoding.
  2877. </li></ul>
  2878. </li></ul>
  2879. <p>Streamcopy is useful for changing the elementary stream count, container format,
  2880. or modifying container-level metadata. Since there is no decoding or encoding,
  2881. it is very fast and there is no quality loss. However, it might not work in some
  2882. cases because of a variety of factors (e.g. certain information required by the
  2883. target container is not available in the source). Applying filters is obviously
  2884. also impossible, since filters work on decoded frames.
  2885. </p>
  2886. <p>More complex streamcopy scenarios can be constructed - e.g. combining streams
  2887. from two input files into a single output:
  2888. </p><pre class="verbatim">┌──────────┬────────────────────┐ ┌────────────────────┬───────────┐
  2889. │ demuxer 0│ │ packets │ │ muxer │
  2890. ╞══════════╡elementary stream 0 ├────────►│elementary stream 0 ╞═══════════╡
  2891. │INPUT0.mkv│ │ │ │OUTPUT.mp4 │
  2892. └──────────┴────────────────────┘ ├────────────────────┤ │
  2893. ┌──────────┬────────────────────┐ │ │ │
  2894. │ demuxer 1│ │ packets │elementary stream 1 │ │
  2895. ╞══════════╡elementary stream 0 ├────────►│ │ │
  2896. │INPUT1.aac│ │ └────────────────────┴───────────┘
  2897. └──────────┴────────────────────┘
  2898. </pre><p>that can be built by the commandline
  2899. </p><div class="example">
  2900. <pre class="example-preformatted">ffmpeg -i INPUT0.mkv -i INPUT1.aac -map 0:0 -map 1:0 -c copy OUTPUT.mp4
  2901. </pre></div>
  2902. <p>The output <samp class="option">-map</samp> option is used twice here, creating two streams in the
  2903. output file - one fed by the first input and one by the second. The single
  2904. instance of the <samp class="option">-c</samp> option selects streamcopy for both of those streams.
  2905. You could also use multiple instances of this option together with
  2906. <a class="ref" href="#Stream-specifiers">Stream specifiers</a> to apply different values to each stream, as will be
  2907. demonstrated in following sections.
  2908. </p>
  2909. <p>A converse scenario is splitting multiple streams from a single input into
  2910. multiple outputs:
  2911. </p><pre class="verbatim">┌──────────┬─────────────────────┐ ┌───────────────────┬───────────┐
  2912. │ demuxer │ │ packets │ │ muxer 0 │
  2913. ╞══════════╡ elementary stream 0 ├─────────►│elementary stream 0╞═══════════╡
  2914. │ │ │ │ │OUTPUT0.mp4│
  2915. │INPUT.mkv ├─────────────────────┤ └───────────────────┴───────────┘
  2916. │ │ │ packets ┌───────────────────┬───────────┐
  2917. │ │ elementary stream 1 ├─────────►│ │ muxer 1 │
  2918. │ │ │ │elementary stream 0╞═══════════╡
  2919. └──────────┴─────────────────────┘ │ │OUTPUT1.mp4│
  2920. └───────────────────┴───────────┘
  2921. </pre><p>built with
  2922. </p><div class="example">
  2923. <pre class="example-preformatted">ffmpeg -i INPUT.mkv -map 0:0 -c copy OUTPUT0.mp4 -map 0:1 -c copy OUTPUT1.mp4
  2924. </pre></div>
  2925. <p>Note how a separate instance of the <samp class="option">-c</samp> option is needed for every
  2926. output file even though their values are the same. This is because non-global
  2927. options (which is most of them) only apply in the context of the file before
  2928. which they are placed.
  2929. </p>
  2930. <p>These examples can of course be further generalized into arbitrary remappings
  2931. of any number of inputs into any number of outputs.
  2932. </p>
  2933. <a name="Transcoding"></a>
  2934. <h3 class="section">3.2 Transcoding<span class="pull-right"><a class="anchor hidden-xs" href="#Transcoding" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Transcoding" aria-hidden="true">TOC</a></span></h3>
  2935. <p><em class="emph">Transcoding</em> is the process of decoding a stream and then encoding it
  2936. again. Since encoding tends to be computationally expensive and in most cases
  2937. degrades the stream quality (i.e. it is <em class="emph">lossy</em>), you should only transcode
  2938. when you need to and perform streamcopy otherwise. Typical reasons to transcode
  2939. are:
  2940. </p>
  2941. <ul class="itemize mark-bullet">
  2942. <li>applying filters - e.g. resizing, deinterlacing, or overlaying video; resampling
  2943. or mixing audio;
  2944. </li><li>you want to feed the stream to something that cannot decode the original codec.
  2945. </li></ul>
  2946. <p>Note that <code class="command">ffmpeg</code> will transcode all audio, video, and subtitle streams
  2947. unless you specify <samp class="option">-c copy</samp> for them.
  2948. </p>
  2949. <p>Consider an example pipeline that reads an input file with one audio and one
  2950. video stream, transcodes the video and copies the audio into a single output
  2951. file. This can be schematically represented as follows
  2952. </p><pre class="verbatim">┌──────────┬─────────────────────┐
  2953. │ demuxer │ │ audio packets
  2954. ╞══════════╡ stream 0 (audio) ├─────────────────────────────────────╮
  2955. │ │ │ │
  2956. │INPUT.mkv ├─────────────────────┤ video ┌─────────┐ raw │
  2957. │ │ │ packets │ video │ video frames │
  2958. │ │ stream 1 (video) ├─────────►│ decoder ├──────────────╮ │
  2959. │ │ │ │ │ │ │
  2960. └──────────┴─────────────────────┘ └─────────┘ │ │
  2961. ▼ ▼
  2962. │ │
  2963. ┌──────────┬─────────────────────┐ video ┌─────────┐ │ │
  2964. │ muxer │ │ packets │ video │ │ │
  2965. ╞══════════╡ stream 0 (video) │◄─────────┤ encoder ├──────────────╯ │
  2966. │ │ │ │(libx264)│ │
  2967. │OUTPUT.mp4├─────────────────────┤ └─────────┘ │
  2968. │ │ │ │
  2969. │ │ stream 1 (audio) │◄────────────────────────────────────╯
  2970. │ │ │
  2971. └──────────┴─────────────────────┘
  2972. </pre><p>and implemented with the following commandline:
  2973. </p><div class="example">
  2974. <pre class="example-preformatted">ffmpeg -i INPUT.mkv -map 0:v -map 0:a -c:v libx264 -c:a copy OUTPUT.mp4
  2975. </pre></div>
  2976. <p>Note how it uses stream specifiers <code class="code">:v</code> and <code class="code">:a</code> to select input
  2977. streams and apply different values of the <samp class="option">-c</samp> option to them; see the
  2978. <a class="ref" href="#Stream-specifiers">Stream specifiers</a> section for more details.
  2979. </p>
  2980. <a name="Filtering"></a>
  2981. <h3 class="section">3.3 Filtering<span class="pull-right"><a class="anchor hidden-xs" href="#Filtering" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtering" aria-hidden="true">TOC</a></span></h3>
  2982. <p>When transcoding, audio and video streams can be filtered before encoding, with
  2983. either a <em class="emph">simple</em> or <em class="emph">complex</em> filtergraph.
  2984. </p>
  2985. <a name="Simple-filtergraphs"></a>
  2986. <h4 class="subsection">3.3.1 Simple filtergraphs<span class="pull-right"><a class="anchor hidden-xs" href="#Simple-filtergraphs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Simple-filtergraphs" aria-hidden="true">TOC</a></span></h4>
  2987. <p>Simple filtergraphs are those that have exactly one input and output, both of
  2988. the same type (audio or video). They are configured with the per-stream
  2989. <samp class="option">-filter</samp> option (with <samp class="option">-vf</samp> and <samp class="option">-af</samp> aliases for
  2990. <samp class="option">-filter:v</samp> (video) and <samp class="option">-filter:a</samp> (audio) respectively). Note
  2991. that simple filtergraphs are tied to their output stream, so e.g. if you have
  2992. multiple audio streams, <samp class="option">-af</samp> will create a separate filtergraph for each
  2993. one.
  2994. </p>
  2995. <p>Taking the transcoding example from above, adding filtering (and omitting audio,
  2996. for clarity) makes it look like this:
  2997. </p><pre class="verbatim">┌──────────┬───────────────┐
  2998. │ demuxer │ │ ┌─────────┐
  2999. ╞══════════╡ video stream │ packets │ video │ frames
  3000. │INPUT.mkv │ ├─────────►│ decoder ├─────►───╮
  3001. │ │ │ └─────────┘ │
  3002. └──────────┴───────────────┘ │
  3003. ╭───────────◄───────────╯
  3004. │ ┌────────────────────────┐
  3005. │ │ simple filtergraph │
  3006. │ ╞════════════════════════╡
  3007. │ │ ┌───────┐ ┌───────┐ │
  3008. ╰──►├─►│ yadif ├─►│ scale ├─►├╮
  3009. │ └───────┘ └───────┘ ││
  3010. └────────────────────────┘│
  3011. ┌──────────┬───────────────┐ video ┌─────────┐ │
  3012. │ muxer │ │ packets │ video │ │
  3013. ╞══════════╡ video stream │◄─────────┤ encoder ├───────◄───────╯
  3014. │OUTPUT.mp4│ │ │ │
  3015. │ │ │ └─────────┘
  3016. └──────────┴───────────────┘
  3017. </pre>
  3018. <a name="Complex-filtergraphs"></a>
  3019. <h4 class="subsection">3.3.2 Complex filtergraphs<span class="pull-right"><a class="anchor hidden-xs" href="#Complex-filtergraphs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Complex-filtergraphs" aria-hidden="true">TOC</a></span></h4>
  3020. <p>Complex filtergraphs are those which cannot be described as simply a linear
  3021. processing chain applied to one stream. This is the case, for example, when the
  3022. graph has more than one input and/or output, or when output stream type is
  3023. different from input. Complex filtergraphs are configured with the
  3024. <samp class="option">-filter_complex</samp> option. Note that this option is global, since a
  3025. complex filtergraph, by its nature, cannot be unambiguously associated with a
  3026. single stream or file. Each instance of <samp class="option">-filter_complex</samp> creates a new
  3027. complex filtergraph, and there can be any number of them.
  3028. </p>
  3029. <p>A trivial example of a complex filtergraph is the <code class="code">overlay</code> filter, which
  3030. has two video inputs and one video output, containing one video overlaid on top
  3031. of the other. Its audio counterpart is the <code class="code">amix</code> filter.
  3032. </p>
  3033. <a class="anchor" id="Loopback-decoders"></a><a name="Loopback-decoders-1"></a>
  3034. <h3 class="section">3.4 Loopback decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Loopback-decoders-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Loopback-decoders-1" aria-hidden="true">TOC</a></span></h3>
  3035. <p>While decoders are normally associated with demuxer streams, it is also possible
  3036. to create &quot;loopback&quot; decoders that decode the output from some encoder and allow
  3037. it to be fed back to complex filtergraphs. This is done with the <code class="code">-dec</code>
  3038. directive, which takes as a parameter the index of the output stream that should
  3039. be decoded. Every such directive creates a new loopback decoder, indexed with
  3040. successive integers starting at zero. These indices should then be used to refer
  3041. to loopback decoders in complex filtergraph link labels, as described in the
  3042. documentation for <samp class="option">-filter_complex</samp>.
  3043. </p>
  3044. <p>Decoding AVOptions can be passed to loopback decoders by placing them before
  3045. <code class="code">-dec</code>, analogously to input/output options.
  3046. </p>
  3047. <p>E.g. the following example:
  3048. </p>
  3049. <div class="example">
  3050. <pre class="example-preformatted">ffmpeg -i INPUT \
  3051. -map 0:v:0 -c:v libx264 -crf 45 -f null - \
  3052. -threads 3 -dec 0:0 \
  3053. -filter_complex '[0:v][dec:0]hstack[stack]' \
  3054. -map '[stack]' -c:v ffv1 OUTPUT
  3055. </pre></div>
  3056. <p>reads an input video and
  3057. </p><ul class="itemize mark-bullet">
  3058. <li>(line 2) encodes it with <code class="code">libx264</code> at low quality;
  3059. </li><li>(line 3) decodes this encoded stream using 3 threads;
  3060. </li><li>(line 4) places decoded video side by side with the original input video;
  3061. </li><li>(line 5) combined video is then losslessly encoded and written into
  3062. <samp class="file">OUTPUT</samp>.
  3063. </li></ul>
  3064. <p>Such a transcoding pipeline can be represented with the following diagram:
  3065. </p><pre class="verbatim">┌──────────┬───────────────┐
  3066. │ demuxer │ │ ┌─────────┐ ┌─────────┐ ┌────────────────────┐
  3067. ╞══════════╡ video stream │ │ video │ │ video │ │ null muxer │
  3068. │ INPUT │ ├──►│ decoder ├──┬────────►│ encoder ├─┬─►│(discards its input)│
  3069. │ │ │ └─────────┘ │ │(libx264)│ │ └────────────────────┘
  3070. └──────────┴───────────────┘ │ └─────────┘ │
  3071. ╭───────◄──╯ ┌─────────┐ │
  3072. │ │loopback │ │
  3073. │ ╭─────◄──────┤ decoder ├────◄──╯
  3074. │ │ └─────────┘
  3075. │ │
  3076. │ │
  3077. │ │ ┌───────────────────┐
  3078. │ │ │complex filtergraph│
  3079. │ │ ╞═══════════════════╡
  3080. │ │ │ ┌─────────────┐ │
  3081. ╰─╫─►├─►│ hstack ├─►├╮
  3082. ╰─►├─►│ │ ││
  3083. │ └─────────────┘ ││
  3084. └───────────────────┘│
  3085. ┌──────────┬───────────────┐ ┌─────────┐ │
  3086. │ muxer │ │ │ video │ │
  3087. ╞══════════╡ video stream │◄─┤ encoder ├───────◄──────────╯
  3088. │ OUTPUT │ │ │ (ffv1) │
  3089. │ │ │ └─────────┘
  3090. └──────────┴───────────────┘
  3091. </pre>
  3092. <a class="anchor" id="Stream-selection"></a><a name="Stream-selection-1"></a>
  3093. <h2 class="chapter">4 Stream selection<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-selection-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-selection-1" aria-hidden="true">TOC</a></span></h2>
  3094. <p><code class="command">ffmpeg</code> provides the <code class="code">-map</code> option for manual control of stream selection in each
  3095. output file. Users can skip <code class="code">-map</code> and let ffmpeg perform automatic stream selection as
  3096. described below. The <code class="code">-vn / -an / -sn / -dn</code> options can be used to skip inclusion of
  3097. video, audio, subtitle and data streams respectively, whether manually mapped or automatically
  3098. selected, except for those streams which are outputs of complex filtergraphs.
  3099. </p>
  3100. <a name="Description-1"></a>
  3101. <h3 class="section">4.1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description-1" aria-hidden="true">TOC</a></span></h3>
  3102. <p>The sub-sections that follow describe the various rules that are involved in stream selection.
  3103. The examples that follow next show how these rules are applied in practice.
  3104. </p>
  3105. <p>While every effort is made to accurately reflect the behavior of the program, FFmpeg is under
  3106. continuous development and the code may have changed since the time of this writing.
  3107. </p>
  3108. <a name="Automatic-stream-selection"></a>
  3109. <h4 class="subsection">4.1.1 Automatic stream selection<span class="pull-right"><a class="anchor hidden-xs" href="#Automatic-stream-selection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Automatic-stream-selection" aria-hidden="true">TOC</a></span></h4>
  3110. <p>In the absence of any map options for a particular output file, ffmpeg inspects the output
  3111. format to check which type of streams can be included in it, viz. video, audio and/or
  3112. subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available,
  3113. from among all the inputs.
  3114. </p>
  3115. <p>It will select that stream based upon the following criteria:
  3116. </p><ul class="itemize mark-bullet">
  3117. <li>for video, it is the stream with the highest resolution,
  3118. </li><li>for audio, it is the stream with the most channels,
  3119. </li><li>for subtitles, it is the first subtitle stream found but there&rsquo;s a caveat.
  3120. The output format&rsquo;s default subtitle encoder can be either text-based or image-based,
  3121. and only a subtitle stream of the same type will be chosen.
  3122. </li></ul>
  3123. <p>In the case where several streams of the same type rate equally, the stream with the lowest
  3124. index is chosen.
  3125. </p>
  3126. <p>Data or attachment streams are not automatically selected and can only be included
  3127. using <code class="code">-map</code>.
  3128. </p><a name="Manual-stream-selection"></a>
  3129. <h4 class="subsection">4.1.2 Manual stream selection<span class="pull-right"><a class="anchor hidden-xs" href="#Manual-stream-selection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Manual-stream-selection" aria-hidden="true">TOC</a></span></h4>
  3130. <p>When <code class="code">-map</code> is used, only user-mapped streams are included in that output file,
  3131. with one possible exception for filtergraph outputs described below.
  3132. </p>
  3133. <a name="Complex-filtergraphs-1"></a>
  3134. <h4 class="subsection">4.1.3 Complex filtergraphs<span class="pull-right"><a class="anchor hidden-xs" href="#Complex-filtergraphs-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Complex-filtergraphs-1" aria-hidden="true">TOC</a></span></h4>
  3135. <p>If there are any complex filtergraph output streams with unlabeled pads, they will be added
  3136. to the first output file. This will lead to a fatal error if the stream type is not supported
  3137. by the output format. In the absence of the map option, the inclusion of these streams leads
  3138. to the automatic stream selection of their types being skipped. If map options are present,
  3139. these filtergraph streams are included in addition to the mapped streams.
  3140. </p>
  3141. <p>Complex filtergraph output streams with labeled pads must be mapped once and exactly once.
  3142. </p>
  3143. <a name="Stream-handling"></a>
  3144. <h4 class="subsection">4.1.4 Stream handling<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-handling" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-handling" aria-hidden="true">TOC</a></span></h4>
  3145. <p>Stream handling is independent of stream selection, with an exception for subtitles described
  3146. below. Stream handling is set via the <code class="code">-codec</code> option addressed to streams within a
  3147. specific <em class="emph">output</em> file. In particular, codec options are applied by ffmpeg after the
  3148. stream selection process and thus do not influence the latter. If no <code class="code">-codec</code> option is
  3149. specified for a stream type, ffmpeg will select the default encoder registered by the output
  3150. file muxer.
  3151. </p>
  3152. <p>An exception exists for subtitles. If a subtitle encoder is specified for an output file, the
  3153. first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate
  3154. if the specified encoder can convert the selected stream or if the converted stream is acceptable
  3155. within the output format. This applies generally as well: when the user sets an encoder manually,
  3156. the stream selection process cannot check if the encoded stream can be muxed into the output file.
  3157. If it cannot, ffmpeg will abort and <em class="emph">all</em> output files will fail to be processed.
  3158. </p>
  3159. <a name="Examples"></a>
  3160. <h3 class="section">4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h3>
  3161. <p>The following examples illustrate the behavior, quirks and limitations of ffmpeg&rsquo;s stream
  3162. selection methods.
  3163. </p>
  3164. <p>They assume the following three input files.
  3165. </p>
  3166. <pre class="verbatim">
  3167. input file 'A.avi'
  3168. stream 0: video 640x360
  3169. stream 1: audio 2 channels
  3170. input file 'B.mp4'
  3171. stream 0: video 1920x1080
  3172. stream 1: audio 2 channels
  3173. stream 2: subtitles (text)
  3174. stream 3: audio 5.1 channels
  3175. stream 4: subtitles (text)
  3176. input file 'C.mkv'
  3177. stream 0: video 1280x720
  3178. stream 1: audio 2 channels
  3179. stream 2: subtitles (image)
  3180. </pre>
  3181. <a name="Example_003a-automatic-stream-selection"></a>
  3182. <div class="example">
  3183. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
  3184. </pre></div>
  3185. <p>There are three output files specified, and for the first two, no <code class="code">-map</code> options
  3186. are set, so ffmpeg will select streams for these two files automatically.
  3187. </p>
  3188. <p><samp class="file">out1.mkv</samp> is a Matroska container file and accepts video, audio and subtitle streams,
  3189. so ffmpeg will try to select one of each type.<br>
  3190. For video, it will select <code class="code">stream 0</code> from <samp class="file">B.mp4</samp>, which has the highest
  3191. resolution among all the input video streams.<br>
  3192. For audio, it will select <code class="code">stream 3</code> from <samp class="file">B.mp4</samp>, since it has the greatest
  3193. number of channels.<br>
  3194. For subtitles, it will select <code class="code">stream 2</code> from <samp class="file">B.mp4</samp>, which is the first subtitle
  3195. stream from among <samp class="file">A.avi</samp> and <samp class="file">B.mp4</samp>.
  3196. </p>
  3197. <p><samp class="file">out2.wav</samp> accepts only audio streams, so only <code class="code">stream 3</code> from <samp class="file">B.mp4</samp> is
  3198. selected.
  3199. </p>
  3200. <p>For <samp class="file">out3.mov</samp>, since a <code class="code">-map</code> option is set, no automatic stream selection will
  3201. occur. The <code class="code">-map 1:a</code> option will select all audio streams from the second input
  3202. <samp class="file">B.mp4</samp>. No other streams will be included in this output file.
  3203. </p>
  3204. <p>For the first two outputs, all included streams will be transcoded. The encoders chosen will
  3205. be the default ones registered by each output format, which may not match the codec of the
  3206. selected input streams.
  3207. </p>
  3208. <p>For the third output, codec option for audio streams has been set
  3209. to <code class="code">copy</code>, so no decoding-filtering-encoding operations will occur, or <em class="emph">can</em> occur.
  3210. Packets of selected streams shall be conveyed from the input file and muxed within the output
  3211. file.
  3212. </p>
  3213. <a name="Example_003a-automatic-subtitles-selection"></a>
  3214. <div class="example">
  3215. <pre class="example-preformatted">ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
  3216. </pre></div>
  3217. <p>Although <samp class="file">out1.mkv</samp> is a Matroska container file which accepts subtitle streams, only a
  3218. video and audio stream shall be selected. The subtitle stream of <samp class="file">C.mkv</samp> is image-based
  3219. and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation
  3220. for the subtitles is expected to fail and hence the stream isn&rsquo;t selected. However, in
  3221. <samp class="file">out2.mkv</samp>, a subtitle encoder is specified in the command and so, the subtitle stream is
  3222. selected, in addition to the video stream. The presence of <code class="code">-an</code> disables audio stream
  3223. selection for <samp class="file">out2.mkv</samp>.
  3224. </p>
  3225. <a name="Example_003a-unlabeled-filtergraph-outputs"></a>
  3226. <div class="example">
  3227. <pre class="example-preformatted">ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex &quot;overlay&quot; out1.mp4 out2.srt
  3228. </pre></div>
  3229. <p>A filtergraph is setup here using the <code class="code">-filter_complex</code> option and consists of a single
  3230. video filter. The <code class="code">overlay</code> filter requires exactly two video inputs, but none are
  3231. specified, so the first two available video streams are used, those of <samp class="file">A.avi</samp> and
  3232. <samp class="file">C.mkv</samp>. The output pad of the filter has no label and so is sent to the first output file
  3233. <samp class="file">out1.mp4</samp>. Due to this, automatic selection of the video stream is skipped, which would
  3234. have selected the stream in <samp class="file">B.mp4</samp>. The audio stream with most channels viz. <code class="code">stream 3</code>
  3235. in <samp class="file">B.mp4</samp>, is chosen automatically. No subtitle stream is chosen however, since the MP4
  3236. format has no default subtitle encoder registered, and the user hasn&rsquo;t specified a subtitle encoder.
  3237. </p>
  3238. <p>The 2nd output file, <samp class="file">out2.srt</samp>, only accepts text-based subtitle streams. So, even though
  3239. the first subtitle stream available belongs to <samp class="file">C.mkv</samp>, it is image-based and hence skipped.
  3240. The selected stream, <code class="code">stream 2</code> in <samp class="file">B.mp4</samp>, is the first text-based subtitle stream.
  3241. </p>
  3242. <a name="Example_003a-labeled-filtergraph-outputs"></a>
  3243. <div class="example">
  3244. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0[outv];overlay;aresample&quot; \
  3245. -map '[outv]' -an out1.mp4 \
  3246. out2.mkv \
  3247. -map '[outv]' -map 1:a:0 out3.mkv
  3248. </pre></div>
  3249. <p>The above command will fail, as the output pad labelled <code class="code">[outv]</code> has been mapped twice.
  3250. None of the output files shall be processed.
  3251. </p>
  3252. <div class="example">
  3253. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0[outv];overlay;aresample&quot; \
  3254. -an out1.mp4 \
  3255. out2.mkv \
  3256. -map 1:a:0 out3.mkv
  3257. </pre></div>
  3258. <p>This command above will also fail as the hue filter output has a label, <code class="code">[outv]</code>,
  3259. and hasn&rsquo;t been mapped anywhere.
  3260. </p>
  3261. <p>The command should be modified as follows,
  3262. </p><div class="example">
  3263. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0,split=2[outv1][outv2];overlay;aresample&quot; \
  3264. -map '[outv1]' -an out1.mp4 \
  3265. out2.mkv \
  3266. -map '[outv2]' -map 1:a:0 out3.mkv
  3267. </pre></div>
  3268. <p>The video stream from <samp class="file">B.mp4</samp> is sent to the hue filter, whose output is cloned once using
  3269. the split filter, and both outputs labelled. Then a copy each is mapped to the first and third
  3270. output files.
  3271. </p>
  3272. <p>The overlay filter, requiring two video inputs, uses the first two unused video streams. Those
  3273. are the streams from <samp class="file">A.avi</samp> and <samp class="file">C.mkv</samp>. The overlay output isn&rsquo;t labelled, so it is
  3274. sent to the first output file <samp class="file">out1.mp4</samp>, regardless of the presence of the <code class="code">-map</code> option.
  3275. </p>
  3276. <p>The aresample filter is sent the first unused audio stream, that of <samp class="file">A.avi</samp>. Since this filter
  3277. output is also unlabelled, it too is mapped to the first output file. The presence of <code class="code">-an</code>
  3278. only suppresses automatic or manual stream selection of audio streams, not outputs sent from
  3279. filtergraphs. Both these mapped streams shall be ordered before the mapped stream in <samp class="file">out1.mp4</samp>.
  3280. </p>
  3281. <p>The video, audio and subtitle streams mapped to <code class="code">out2.mkv</code> are entirely determined by
  3282. automatic stream selection.
  3283. </p>
  3284. <p><samp class="file">out3.mkv</samp> consists of the cloned video output from the hue filter and the first audio
  3285. stream from <samp class="file">B.mp4</samp>.
  3286. <br>
  3287. </p>
  3288. <a name="Options"></a>
  3289. <h2 class="chapter">5 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h2>
  3290. <p>All the numerical options, if not specified otherwise, accept a string
  3291. representing a number as input, which may be followed by one of the SI
  3292. unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
  3293. </p>
  3294. <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
  3295. interpreted as a unit prefix for binary multiples, which are based on
  3296. powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
  3297. prefix multiplies the value by 8. This allows using, for example:
  3298. &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
  3299. </p>
  3300. <p>Options which do not take arguments are boolean options, and set the
  3301. corresponding value to true. They can be set to false by prefixing
  3302. the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
  3303. will set the boolean option with name &quot;foo&quot; to false.
  3304. </p>
  3305. <p>Options that take arguments support a special syntax where the argument given on
  3306. the command line is interpreted as a path to the file from which the actual
  3307. argument value is loaded. To use this feature, add a forward slash &rsquo;/&rsquo;
  3308. immediately before the option name (after the leading dash). E.g.
  3309. </p><div class="example">
  3310. <pre class="example-preformatted">ffmpeg -i INPUT -/filter:v filter.script OUTPUT
  3311. </pre></div>
  3312. <p>will load a filtergraph description from the file named <samp class="file">filter.script</samp>.
  3313. </p>
  3314. <a class="anchor" id="Stream-specifiers"></a><a name="Stream-specifiers-1"></a>
  3315. <h3 class="section">5.1 Stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
  3316. <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  3317. are used to precisely specify which stream(s) a given option belongs to.
  3318. </p>
  3319. <p>A stream specifier is a string generally appended to the option name and
  3320. separated from it by a colon. E.g. <code class="code">-codec:a:1 ac3</code> contains the
  3321. <code class="code">a:1</code> stream specifier, which matches the second audio stream. Therefore, it
  3322. would select the ac3 codec for the second audio stream.
  3323. </p>
  3324. <p>A stream specifier can match several streams, so that the option is applied to all
  3325. of them. E.g. the stream specifier in <code class="code">-b:a 128k</code> matches all audio
  3326. streams.
  3327. </p>
  3328. <p>An empty stream specifier matches all streams. For example, <code class="code">-codec copy</code>
  3329. or <code class="code">-codec: copy</code> would copy all the streams without reencoding.
  3330. </p>
  3331. <p>Possible forms of stream specifiers are:
  3332. </p><dl class="table">
  3333. <dt><samp class="option"><var class="var">stream_index</var></samp></dt>
  3334. <dd><p>Matches the stream with this index. E.g. <code class="code">-threads:1 4</code> would set the
  3335. thread count for the second stream to 4. If <var class="var">stream_index</var> is used as an
  3336. additional stream specifier (see below), then it selects stream number
  3337. <var class="var">stream_index</var> from the matching streams. Stream numbering is based on the
  3338. order of the streams as detected by libavformat except when a stream group
  3339. specifier or program ID is also specified. In this case it is based on the
  3340. ordering of the streams in the group or program.
  3341. </p></dd>
  3342. <dt><samp class="option"><var class="var">stream_type</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  3343. <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;
  3344. for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
  3345. streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
  3346. thumbnails or cover arts. If <var class="var">additional_stream_specifier</var> is used, then
  3347. it matches streams which both have this type and match the
  3348. <var class="var">additional_stream_specifier</var>. Otherwise, it matches all streams of the
  3349. specified type.
  3350. </p></dd>
  3351. <dt><samp class="option">g:<var class="var">group_specifier</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  3352. <dd><p>Matches streams which are in the group with the specifier <var class="var">group_specifier</var>.
  3353. if <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  3354. are part of the group and match the <var class="var">additional_stream_specifier</var>.
  3355. <var class="var">group_specifier</var> may be one of the following:
  3356. </p><dl class="table">
  3357. <dt><samp class="option"><var class="var">group_index</var></samp></dt>
  3358. <dd><p>Match the stream with this group index.
  3359. </p></dd>
  3360. <dt><samp class="option">#<var class="var">group_id</var> or i:<var class="var">group_id</var></samp></dt>
  3361. <dd><p>Match the stream with this group id.
  3362. </p></dd>
  3363. </dl>
  3364. </dd>
  3365. <dt><samp class="option">p:<var class="var">program_id</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  3366. <dd><p>Matches streams which are in the program with the id <var class="var">program_id</var>. If
  3367. <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  3368. are part of the program and match the <var class="var">additional_stream_specifier</var>.
  3369. </p>
  3370. </dd>
  3371. <dt><samp class="option">#<var class="var">stream_id</var> or i:<var class="var">stream_id</var></samp></dt>
  3372. <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
  3373. </p></dd>
  3374. <dt><samp class="option">m:<var class="var">key</var>[:<var class="var">value</var>]</samp></dt>
  3375. <dd><p>Matches streams with the metadata tag <var class="var">key</var> having the specified value. If
  3376. <var class="var">value</var> is not given, matches streams that contain the given tag with any
  3377. value. The colon character &rsquo;:&rsquo; in <var class="var">key</var> or <var class="var">value</var> needs to be
  3378. backslash-escaped.
  3379. </p></dd>
  3380. <dt><samp class="option">disp:<var class="var">dispositions</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  3381. <dd><p>Matches streams with the given disposition(s). <var class="var">dispositions</var> is a list of
  3382. one or more dispositions (as printed by the <samp class="option">-dispositions</samp> option)
  3383. joined with &rsquo;+&rsquo;.
  3384. </p></dd>
  3385. <dt><samp class="option">u</samp></dt>
  3386. <dd><p>Matches streams with usable configuration, the codec must be defined and the
  3387. essential information such as video dimension or audio sample rate must be present.
  3388. </p>
  3389. <p>Note that in <code class="command">ffmpeg</code>, matching by metadata will only work properly for
  3390. input files.
  3391. </p></dd>
  3392. </dl>
  3393. <a name="Generic-options"></a>
  3394. <h3 class="section">5.2 Generic options<span class="pull-right"><a class="anchor hidden-xs" href="#Generic-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Generic-options" aria-hidden="true">TOC</a></span></h3>
  3395. <p>These options are shared amongst the ff* tools.
  3396. </p>
  3397. <dl class="table">
  3398. <dt><samp class="option">-L, -license</samp></dt>
  3399. <dd><p>Show license.
  3400. </p>
  3401. </dd>
  3402. <dt><samp class="option">-h, -?, -help, --help [<var class="var">arg</var>]</samp></dt>
  3403. <dd><p>Show help. An optional parameter may be specified to print help about a specific
  3404. item. If no argument is specified, only basic (non advanced) tool
  3405. options are shown.
  3406. </p>
  3407. <p>Possible values of <var class="var">arg</var> are:
  3408. </p><dl class="table">
  3409. <dt><samp class="option">long</samp></dt>
  3410. <dd><p>Print advanced tool options in addition to the basic tool options.
  3411. </p>
  3412. </dd>
  3413. <dt><samp class="option">full</samp></dt>
  3414. <dd><p>Print complete list of options, including shared and private options
  3415. for encoders, decoders, demuxers, muxers, filters, etc.
  3416. </p>
  3417. </dd>
  3418. <dt><samp class="option">decoder=<var class="var">decoder_name</var></samp></dt>
  3419. <dd><p>Print detailed information about the decoder named <var class="var">decoder_name</var>. Use the
  3420. <samp class="option">-decoders</samp> option to get a list of all decoders.
  3421. </p>
  3422. </dd>
  3423. <dt><samp class="option">encoder=<var class="var">encoder_name</var></samp></dt>
  3424. <dd><p>Print detailed information about the encoder named <var class="var">encoder_name</var>. Use the
  3425. <samp class="option">-encoders</samp> option to get a list of all encoders.
  3426. </p>
  3427. </dd>
  3428. <dt><samp class="option">demuxer=<var class="var">demuxer_name</var></samp></dt>
  3429. <dd><p>Print detailed information about the demuxer named <var class="var">demuxer_name</var>. Use the
  3430. <samp class="option">-formats</samp> option to get a list of all demuxers and muxers.
  3431. </p>
  3432. </dd>
  3433. <dt><samp class="option">muxer=<var class="var">muxer_name</var></samp></dt>
  3434. <dd><p>Print detailed information about the muxer named <var class="var">muxer_name</var>. Use the
  3435. <samp class="option">-formats</samp> option to get a list of all muxers and demuxers.
  3436. </p>
  3437. </dd>
  3438. <dt><samp class="option">filter=<var class="var">filter_name</var></samp></dt>
  3439. <dd><p>Print detailed information about the filter named <var class="var">filter_name</var>. Use the
  3440. <samp class="option">-filters</samp> option to get a list of all filters.
  3441. </p>
  3442. </dd>
  3443. <dt><samp class="option">bsf=<var class="var">bitstream_filter_name</var></samp></dt>
  3444. <dd><p>Print detailed information about the bitstream filter named <var class="var">bitstream_filter_name</var>.
  3445. Use the <samp class="option">-bsfs</samp> option to get a list of all bitstream filters.
  3446. </p>
  3447. </dd>
  3448. <dt><samp class="option">protocol=<var class="var">protocol_name</var></samp></dt>
  3449. <dd><p>Print detailed information about the protocol named <var class="var">protocol_name</var>.
  3450. Use the <samp class="option">-protocols</samp> option to get a list of all protocols.
  3451. </p></dd>
  3452. </dl>
  3453. </dd>
  3454. <dt><samp class="option">-version</samp></dt>
  3455. <dd><p>Show version.
  3456. </p>
  3457. </dd>
  3458. <dt><samp class="option">-buildconf</samp></dt>
  3459. <dd><p>Show the build configuration, one option per line.
  3460. </p>
  3461. </dd>
  3462. <dt><samp class="option">-formats</samp></dt>
  3463. <dd><p>Show available formats (including devices).
  3464. </p>
  3465. </dd>
  3466. <dt><samp class="option">-demuxers</samp></dt>
  3467. <dd><p>Show available demuxers.
  3468. </p>
  3469. </dd>
  3470. <dt><samp class="option">-muxers</samp></dt>
  3471. <dd><p>Show available muxers.
  3472. </p>
  3473. </dd>
  3474. <dt><samp class="option">-devices</samp></dt>
  3475. <dd><p>Show available devices.
  3476. </p>
  3477. </dd>
  3478. <dt><samp class="option">-codecs</samp></dt>
  3479. <dd><p>Show all codecs known to libavcodec.
  3480. </p>
  3481. <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
  3482. for what is more correctly called a media bitstream format.
  3483. </p>
  3484. </dd>
  3485. <dt><samp class="option">-decoders</samp></dt>
  3486. <dd><p>Show available decoders.
  3487. </p>
  3488. </dd>
  3489. <dt><samp class="option">-encoders</samp></dt>
  3490. <dd><p>Show all available encoders.
  3491. </p>
  3492. </dd>
  3493. <dt><samp class="option">-bsfs</samp></dt>
  3494. <dd><p>Show available bitstream filters.
  3495. </p>
  3496. </dd>
  3497. <dt><samp class="option">-protocols</samp></dt>
  3498. <dd><p>Show available protocols.
  3499. </p>
  3500. </dd>
  3501. <dt><samp class="option">-filters</samp></dt>
  3502. <dd><p>Show available libavfilter filters.
  3503. </p>
  3504. </dd>
  3505. <dt><samp class="option">-pix_fmts</samp></dt>
  3506. <dd><p>Show available pixel formats.
  3507. </p>
  3508. </dd>
  3509. <dt><samp class="option">-sample_fmts</samp></dt>
  3510. <dd><p>Show available sample formats.
  3511. </p>
  3512. </dd>
  3513. <dt><samp class="option">-layouts</samp></dt>
  3514. <dd><p>Show channel names and standard channel layouts.
  3515. </p>
  3516. </dd>
  3517. <dt><samp class="option">-dispositions</samp></dt>
  3518. <dd><p>Show stream dispositions.
  3519. </p>
  3520. </dd>
  3521. <dt><samp class="option">-colors</samp></dt>
  3522. <dd><p>Show recognized color names.
  3523. </p>
  3524. </dd>
  3525. <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>
  3526. <dd><p>Show autodetected sources of the input device.
  3527. Some devices may provide system-dependent source names that cannot be autodetected.
  3528. The returned list cannot be assumed to be always complete.
  3529. </p><div class="example">
  3530. <pre class="example-preformatted">ffmpeg -sources pulse,server=192.168.0.4
  3531. </pre></div>
  3532. </dd>
  3533. <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>
  3534. <dd><p>Show autodetected sinks of the output device.
  3535. Some devices may provide system-dependent sink names that cannot be autodetected.
  3536. The returned list cannot be assumed to be always complete.
  3537. </p><div class="example">
  3538. <pre class="example-preformatted">ffmpeg -sinks pulse,server=192.168.0.4
  3539. </pre></div>
  3540. </dd>
  3541. <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>
  3542. <dd><p>Set logging level and flags used by the library.
  3543. </p>
  3544. <p>The optional <var class="var">flags</var> prefix can consist of the following values:
  3545. </p><dl class="table">
  3546. <dt>&lsquo;<samp class="samp">repeat</samp>&rsquo;</dt>
  3547. <dd><p>Indicates that repeated log output should not be compressed to the first line
  3548. and the &quot;Last message repeated n times&quot; line will be omitted.
  3549. </p></dd>
  3550. <dt>&lsquo;<samp class="samp">level</samp>&rsquo;</dt>
  3551. <dd><p>Indicates that log output should add a <code class="code">[level]</code> prefix to each message
  3552. line. This can be used as an alternative to log coloring, e.g. when dumping the
  3553. log to file.
  3554. </p></dd>
  3555. <dt>&lsquo;<samp class="samp">time</samp>&rsquo;</dt>
  3556. <dd><p>Indicates that log lines should be prefixed with time information.
  3557. </p></dd>
  3558. <dt>&lsquo;<samp class="samp">datetime</samp>&rsquo;</dt>
  3559. <dd><p>Indicates that log lines should be prefixed with date and time information.
  3560. </p></dd>
  3561. </dl>
  3562. <p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
  3563. flag without affecting other <var class="var">flags</var> or changing <var class="var">loglevel</var>. When
  3564. setting both <var class="var">flags</var> and <var class="var">loglevel</var>, a &rsquo;+&rsquo; separator is expected
  3565. between the last <var class="var">flags</var> value and before <var class="var">loglevel</var>.
  3566. </p>
  3567. <p><var class="var">loglevel</var> is a string or a number containing one of the following values:
  3568. </p><dl class="table">
  3569. <dt>&lsquo;<samp class="samp">quiet, -8</samp>&rsquo;</dt>
  3570. <dd><p>Show nothing at all; be silent.
  3571. </p></dd>
  3572. <dt>&lsquo;<samp class="samp">panic, 0</samp>&rsquo;</dt>
  3573. <dd><p>Only show fatal errors which could lead the process to crash, such as
  3574. an assertion failure. This is not currently used for anything.
  3575. </p></dd>
  3576. <dt>&lsquo;<samp class="samp">fatal, 8</samp>&rsquo;</dt>
  3577. <dd><p>Only show fatal errors. These are errors after which the process absolutely
  3578. cannot continue.
  3579. </p></dd>
  3580. <dt>&lsquo;<samp class="samp">error, 16</samp>&rsquo;</dt>
  3581. <dd><p>Show all errors, including ones which can be recovered from.
  3582. </p></dd>
  3583. <dt>&lsquo;<samp class="samp">warning, 24</samp>&rsquo;</dt>
  3584. <dd><p>Show all warnings and errors. Any message related to possibly
  3585. incorrect or unexpected events will be shown.
  3586. </p></dd>
  3587. <dt>&lsquo;<samp class="samp">info, 32</samp>&rsquo;</dt>
  3588. <dd><p>Show informative messages during processing. This is in addition to
  3589. warnings and errors. This is the default value.
  3590. </p></dd>
  3591. <dt>&lsquo;<samp class="samp">verbose, 40</samp>&rsquo;</dt>
  3592. <dd><p>Same as <code class="code">info</code>, except more verbose.
  3593. </p></dd>
  3594. <dt>&lsquo;<samp class="samp">debug, 48</samp>&rsquo;</dt>
  3595. <dd><p>Show everything, including debugging information.
  3596. </p></dd>
  3597. <dt>&lsquo;<samp class="samp">trace, 56</samp>&rsquo;</dt>
  3598. </dl>
  3599. <p>For example to enable repeated log output, add the <code class="code">level</code> prefix, and set
  3600. <var class="var">loglevel</var> to <code class="code">verbose</code>:
  3601. </p><div class="example">
  3602. <pre class="example-preformatted">ffmpeg -loglevel repeat+level+verbose -i input output
  3603. </pre></div>
  3604. <p>Another example that enables repeated log output without affecting current
  3605. state of <code class="code">level</code> prefix flag or <var class="var">loglevel</var>:
  3606. </p><div class="example">
  3607. <pre class="example-preformatted">ffmpeg [...] -loglevel +repeat
  3608. </pre></div>
  3609. <p>By default the program logs to stderr. If coloring is supported by the
  3610. terminal, colors are used to mark errors and warnings. Log coloring
  3611. can be disabled setting the environment variable
  3612. <code class="env">AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
  3613. the environment variable <code class="env">AV_LOG_FORCE_COLOR</code>.
  3614. </p>
  3615. </dd>
  3616. <dt><samp class="option">-report</samp></dt>
  3617. <dd><p>Dump full command line and log output to a file named
  3618. <code class="code"><var class="var">program</var>-<var class="var">YYYYMMDD</var>-<var class="var">HHMMSS</var>.log</code> in the current
  3619. directory.
  3620. This file can be useful for bug reports.
  3621. It also implies <code class="code">-loglevel debug</code>.
  3622. </p>
  3623. <p>Setting the environment variable <code class="env">FFREPORT</code> to any value has the
  3624. same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
  3625. options will affect the report; option values must be escaped if they
  3626. contain special characters or the options delimiter &rsquo;:&rsquo; (see the
  3627. &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
  3628. </p>
  3629. <p>The following options are recognized:
  3630. </p><dl class="table">
  3631. <dt><samp class="option">file</samp></dt>
  3632. <dd><p>set the file name to use for the report; <code class="code">%p</code> is expanded to the name
  3633. of the program, <code class="code">%t</code> is expanded to a timestamp, <code class="code">%%</code> is expanded
  3634. to a plain <code class="code">%</code>
  3635. </p></dd>
  3636. <dt><samp class="option">level</samp></dt>
  3637. <dd><p>set the log verbosity level using a numerical value (see <code class="code">-loglevel</code>).
  3638. </p></dd>
  3639. </dl>
  3640. <p>For example, to output a report to a file named <samp class="file">ffreport.log</samp>
  3641. using a log level of <code class="code">32</code> (alias for log level <code class="code">info</code>):
  3642. </p>
  3643. <div class="example">
  3644. <pre class="example-preformatted">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  3645. </pre></div>
  3646. <p>Errors in parsing the environment variable are not fatal, and will not
  3647. appear in the report.
  3648. </p>
  3649. </dd>
  3650. <dt><samp class="option">-hide_banner</samp></dt>
  3651. <dd><p>Suppress printing banner.
  3652. </p>
  3653. <p>All FFmpeg tools will normally show a copyright notice, build options
  3654. and library versions. This option can be used to suppress printing
  3655. this information.
  3656. </p>
  3657. </dd>
  3658. <dt><samp class="option">-cpuflags flags (<em class="emph">global</em>)</samp></dt>
  3659. <dd><p>Allows setting and clearing cpu flags. This option is intended
  3660. for testing. Do not use it unless you know what you&rsquo;re doing.
  3661. </p><div class="example">
  3662. <pre class="example-preformatted">ffmpeg -cpuflags -sse+mmx ...
  3663. ffmpeg -cpuflags mmx ...
  3664. ffmpeg -cpuflags 0 ...
  3665. </pre></div>
  3666. <p>Possible flags for this option are:
  3667. </p><dl class="table">
  3668. <dt>&lsquo;<samp class="samp">x86</samp>&rsquo;</dt>
  3669. <dd><dl class="table">
  3670. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  3671. <dt>&lsquo;<samp class="samp">mmxext</samp>&rsquo;</dt>
  3672. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  3673. <dt>&lsquo;<samp class="samp">sse2</samp>&rsquo;</dt>
  3674. <dt>&lsquo;<samp class="samp">sse2slow</samp>&rsquo;</dt>
  3675. <dt>&lsquo;<samp class="samp">sse3</samp>&rsquo;</dt>
  3676. <dt>&lsquo;<samp class="samp">sse3slow</samp>&rsquo;</dt>
  3677. <dt>&lsquo;<samp class="samp">ssse3</samp>&rsquo;</dt>
  3678. <dt>&lsquo;<samp class="samp">atom</samp>&rsquo;</dt>
  3679. <dt>&lsquo;<samp class="samp">sse4.1</samp>&rsquo;</dt>
  3680. <dt>&lsquo;<samp class="samp">sse4.2</samp>&rsquo;</dt>
  3681. <dt>&lsquo;<samp class="samp">avx</samp>&rsquo;</dt>
  3682. <dt>&lsquo;<samp class="samp">avx2</samp>&rsquo;</dt>
  3683. <dt>&lsquo;<samp class="samp">xop</samp>&rsquo;</dt>
  3684. <dt>&lsquo;<samp class="samp">fma3</samp>&rsquo;</dt>
  3685. <dt>&lsquo;<samp class="samp">fma4</samp>&rsquo;</dt>
  3686. <dt>&lsquo;<samp class="samp">3dnow</samp>&rsquo;</dt>
  3687. <dt>&lsquo;<samp class="samp">3dnowext</samp>&rsquo;</dt>
  3688. <dt>&lsquo;<samp class="samp">bmi1</samp>&rsquo;</dt>
  3689. <dt>&lsquo;<samp class="samp">bmi2</samp>&rsquo;</dt>
  3690. <dt>&lsquo;<samp class="samp">cmov</samp>&rsquo;</dt>
  3691. </dl>
  3692. </dd>
  3693. <dt>&lsquo;<samp class="samp">ARM</samp>&rsquo;</dt>
  3694. <dd><dl class="table">
  3695. <dt>&lsquo;<samp class="samp">armv5te</samp>&rsquo;</dt>
  3696. <dt>&lsquo;<samp class="samp">armv6</samp>&rsquo;</dt>
  3697. <dt>&lsquo;<samp class="samp">armv6t2</samp>&rsquo;</dt>
  3698. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  3699. <dt>&lsquo;<samp class="samp">vfpv3</samp>&rsquo;</dt>
  3700. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  3701. <dt>&lsquo;<samp class="samp">setend</samp>&rsquo;</dt>
  3702. </dl>
  3703. </dd>
  3704. <dt>&lsquo;<samp class="samp">AArch64</samp>&rsquo;</dt>
  3705. <dd><dl class="table">
  3706. <dt>&lsquo;<samp class="samp">armv8</samp>&rsquo;</dt>
  3707. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  3708. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  3709. </dl>
  3710. </dd>
  3711. <dt>&lsquo;<samp class="samp">PowerPC</samp>&rsquo;</dt>
  3712. <dd><dl class="table">
  3713. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  3714. </dl>
  3715. </dd>
  3716. <dt>&lsquo;<samp class="samp">Specific Processors</samp>&rsquo;</dt>
  3717. <dd><dl class="table">
  3718. <dt>&lsquo;<samp class="samp">pentium2</samp>&rsquo;</dt>
  3719. <dt>&lsquo;<samp class="samp">pentium3</samp>&rsquo;</dt>
  3720. <dt>&lsquo;<samp class="samp">pentium4</samp>&rsquo;</dt>
  3721. <dt>&lsquo;<samp class="samp">k6</samp>&rsquo;</dt>
  3722. <dt>&lsquo;<samp class="samp">k62</samp>&rsquo;</dt>
  3723. <dt>&lsquo;<samp class="samp">athlon</samp>&rsquo;</dt>
  3724. <dt>&lsquo;<samp class="samp">athlonxp</samp>&rsquo;</dt>
  3725. <dt>&lsquo;<samp class="samp">k8</samp>&rsquo;</dt>
  3726. </dl>
  3727. </dd>
  3728. </dl>
  3729. </dd>
  3730. <dt><samp class="option">-cpucount <var class="var">count</var> (<em class="emph">global</em>)</samp></dt>
  3731. <dd><p>Override detection of CPU count. This option is intended
  3732. for testing. Do not use it unless you know what you&rsquo;re doing.
  3733. </p><div class="example">
  3734. <pre class="example-preformatted">ffmpeg -cpucount 2
  3735. </pre></div>
  3736. </dd>
  3737. <dt><samp class="option">-max_alloc <var class="var">bytes</var></samp></dt>
  3738. <dd><p>Set the maximum size limit for allocating a block on the heap by ffmpeg&rsquo;s
  3739. family of malloc functions. Exercise <strong class="strong">extreme caution</strong> when using
  3740. this option. Don&rsquo;t use if you do not understand the full consequence of doing so.
  3741. Default is INT_MAX.
  3742. </p></dd>
  3743. </dl>
  3744. <a name="AVOptions"></a>
  3745. <h3 class="section">5.3 AVOptions<span class="pull-right"><a class="anchor hidden-xs" href="#AVOptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AVOptions" aria-hidden="true">TOC</a></span></h3>
  3746. <p>These options are provided directly by the libavformat, libavdevice and
  3747. libavcodec libraries. To see the list of available AVOptions, use the
  3748. <samp class="option">-help</samp> option. They are separated into two categories:
  3749. </p><dl class="table">
  3750. <dt><samp class="option">generic</samp></dt>
  3751. <dd><p>These options can be set for any container, codec or device. Generic options
  3752. are listed under AVFormatContext options for containers/devices and under
  3753. AVCodecContext options for codecs.
  3754. </p></dd>
  3755. <dt><samp class="option">private</samp></dt>
  3756. <dd><p>These options are specific to the given container, device or codec. Private
  3757. options are listed under their corresponding containers/devices/codecs.
  3758. </p></dd>
  3759. </dl>
  3760. <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  3761. an MP3 file, use the <samp class="option">id3v2_version</samp> private option of the MP3
  3762. muxer:
  3763. </p><div class="example">
  3764. <pre class="example-preformatted">ffmpeg -i input.flac -id3v2_version 3 out.mp3
  3765. </pre></div>
  3766. <p>All codec AVOptions are per-stream, and thus a stream specifier
  3767. should be attached to them:
  3768. </p><div class="example">
  3769. <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
  3770. </pre></div>
  3771. <p>In the above example, a multichannel audio stream is mapped twice for output.
  3772. The first instance is encoded with codec ac3 and bitrate 640k.
  3773. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
  3774. absolute index of the output stream.
  3775. </p>
  3776. <p>Note: the <samp class="option">-nooption</samp> syntax cannot be used for boolean
  3777. AVOptions, use <samp class="option">-option 0</samp>/<samp class="option">-option 1</samp>.
  3778. </p>
  3779. <p>Note: the old undocumented way of specifying per-stream AVOptions by
  3780. prepending v/a/s to the options name is now obsolete and will be
  3781. removed soon.
  3782. </p>
  3783. <a name="Main-options"></a>
  3784. <h3 class="section">5.4 Main options<span class="pull-right"><a class="anchor hidden-xs" href="#Main-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Main-options" aria-hidden="true">TOC</a></span></h3>
  3785. <dl class="table">
  3786. <dt><samp class="option">-f <var class="var">fmt</var> (<em class="emph">input/output</em>)</samp></dt>
  3787. <dd><p>Force input or output file format. The format is normally auto detected for input
  3788. files and guessed from the file extension for output files, so this option is not
  3789. needed in most cases.
  3790. </p>
  3791. </dd>
  3792. <dt><samp class="option">-i <var class="var">url</var> (<em class="emph">input</em>)</samp></dt>
  3793. <dd><p>input file url
  3794. </p>
  3795. </dd>
  3796. <dt><samp class="option">-y (<em class="emph">global</em>)</samp></dt>
  3797. <dd><p>Overwrite output files without asking.
  3798. </p>
  3799. </dd>
  3800. <dt><samp class="option">-n (<em class="emph">global</em>)</samp></dt>
  3801. <dd><p>Do not overwrite output files, and exit immediately if a specified
  3802. output file already exists.
  3803. </p>
  3804. </dd>
  3805. <dt><samp class="option">-stream_loop <var class="var">number</var> (<em class="emph">input</em>)</samp></dt>
  3806. <dd><p>Set number of times input stream shall be looped. Loop 0 means no loop,
  3807. loop -1 means infinite loop.
  3808. </p>
  3809. </dd>
  3810. <dt><samp class="option">-recast_media (<em class="emph">global</em>)</samp></dt>
  3811. <dd><p>Allow forcing a decoder of a different media type than the one
  3812. detected or designated by the demuxer. Useful for decoding media
  3813. data muxed as data streams.
  3814. </p>
  3815. </dd>
  3816. <dt><samp class="option">-c[:<var class="var">stream_specifier</var>] <var class="var">codec</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  3817. <dt><samp class="option">-codec[:<var class="var">stream_specifier</var>] <var class="var">codec</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  3818. <dd><p>Select an encoder (when used before an output file) or a decoder (when used
  3819. before an input file) for one or more streams. <var class="var">codec</var> is the name of a
  3820. decoder/encoder or a special value <code class="code">copy</code> (output only) to indicate that
  3821. the stream is not to be re-encoded.
  3822. </p>
  3823. <p>For example
  3824. </p><div class="example">
  3825. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
  3826. </pre></div>
  3827. <p>encodes all video streams with libx264 and copies all audio streams.
  3828. </p>
  3829. <p>For each stream, the last matching <code class="code">c</code> option is applied, so
  3830. </p><div class="example">
  3831. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
  3832. </pre></div>
  3833. <p>will copy all the streams except the second video, which will be encoded with
  3834. libx264, and the 138th audio, which will be encoded with libvorbis.
  3835. </p>
  3836. </dd>
  3837. <dt><samp class="option">-t <var class="var">duration</var> (<em class="emph">input/output</em>)</samp></dt>
  3838. <dd><p>When used as an input option (before <code class="code">-i</code>), limit the <var class="var">duration</var> of
  3839. data read from the input file.
  3840. </p>
  3841. <p>When used as an output option (before an output url), stop writing the
  3842. output after its duration reaches <var class="var">duration</var>.
  3843. </p>
  3844. <p><var class="var">duration</var> must be a time duration specification,
  3845. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  3846. </p>
  3847. <p>-to and -t are mutually exclusive and -t has priority.
  3848. </p>
  3849. </dd>
  3850. <dt><samp class="option">-to <var class="var">position</var> (<em class="emph">input/output</em>)</samp></dt>
  3851. <dd><p>Stop writing the output or reading the input at <var class="var">position</var>.
  3852. <var class="var">position</var> must be a time duration specification,
  3853. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  3854. </p>
  3855. <p>-to and -t are mutually exclusive and -t has priority.
  3856. </p>
  3857. </dd>
  3858. <dt><samp class="option">-fs <var class="var">limit_size</var> (<em class="emph">output</em>)</samp></dt>
  3859. <dd><p>Set the file size limit, expressed in bytes. No further chunk of bytes is written
  3860. after the limit is exceeded. The size of the output file is slightly more than the
  3861. requested file size.
  3862. </p>
  3863. </dd>
  3864. <dt><samp class="option">-ss <var class="var">position</var> (<em class="emph">input/output</em>)</samp></dt>
  3865. <dd><p>When used as an input option (before <code class="code">-i</code>), seeks in this input file to
  3866. <var class="var">position</var>. Note that in most formats it is not possible to seek exactly,
  3867. so <code class="command">ffmpeg</code> will seek to the closest seek point before <var class="var">position</var>.
  3868. When transcoding and <samp class="option">-accurate_seek</samp> is enabled (the default), this
  3869. extra segment between the seek point and <var class="var">position</var> will be decoded and
  3870. discarded. When doing stream copy or when <samp class="option">-noaccurate_seek</samp> is used, it
  3871. will be preserved.
  3872. </p>
  3873. <p>When used as an output option (before an output url), decodes but discards
  3874. input until the timestamps reach <var class="var">position</var>.
  3875. </p>
  3876. <p><var class="var">position</var> must be a time duration specification,
  3877. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  3878. </p>
  3879. </dd>
  3880. <dt><samp class="option">-sseof <var class="var">position</var> (<em class="emph">input</em>)</samp></dt>
  3881. <dd>
  3882. <p>Like the <code class="code">-ss</code> option but relative to the &quot;end of file&quot;. That is negative
  3883. values are earlier in the file, 0 is at EOF.
  3884. </p>
  3885. </dd>
  3886. <dt><samp class="option">-isync <var class="var">input_index</var> (<em class="emph">input</em>)</samp></dt>
  3887. <dd><p>Assign an input as a sync source.
  3888. </p>
  3889. <p>This will take the difference between the start times of the target and reference inputs and
  3890. offset the timestamps of the target file by that difference. The source timestamps of the two
  3891. inputs should derive from the same clock source for expected results. If <code class="code">copyts</code> is set
  3892. then <code class="code">start_at_zero</code> must also be set. If either of the inputs has no starting timestamp
  3893. then no sync adjustment is made.
  3894. </p>
  3895. <p>Acceptable values are those that refer to a valid ffmpeg input index. If the sync reference is
  3896. the target index itself or <var class="var">-1</var>, then no adjustment is made to target timestamps. A sync
  3897. reference may not itself be synced to any other input.
  3898. </p>
  3899. <p>Default value is <var class="var">-1</var>.
  3900. </p>
  3901. </dd>
  3902. <dt><samp class="option">-itsoffset <var class="var">offset</var> (<em class="emph">input</em>)</samp></dt>
  3903. <dd><p>Set the input time offset.
  3904. </p>
  3905. <p><var class="var">offset</var> must be a time duration specification,
  3906. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  3907. </p>
  3908. <p>The offset is added to the timestamps of the input files. Specifying
  3909. a positive offset means that the corresponding streams are delayed by
  3910. the time duration specified in <var class="var">offset</var>.
  3911. </p>
  3912. </dd>
  3913. <dt><samp class="option">-itsscale <var class="var">scale</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  3914. <dd><p>Rescale input timestamps. <var class="var">scale</var> should be a floating point number.
  3915. </p>
  3916. </dd>
  3917. <dt><samp class="option">-timestamp <var class="var">date</var> (<em class="emph">output</em>)</samp></dt>
  3918. <dd><p>Set the recording timestamp in the container.
  3919. </p>
  3920. <p><var class="var">date</var> must be a date specification,
  3921. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#date-syntax">the Date section in the ffmpeg-utils(1) manual</a>.
  3922. </p>
  3923. </dd>
  3924. <dt><samp class="option">-metadata[:metadata_specifier] <var class="var">key</var>=<var class="var">value</var> (<em class="emph">output,per-metadata</em>)</samp></dt>
  3925. <dd><p>Set a metadata key/value pair.
  3926. </p>
  3927. <p>An optional <var class="var">metadata_specifier</var> may be given to set metadata
  3928. on streams, chapters or programs. See <code class="code">-map_metadata</code>
  3929. documentation for details.
  3930. </p>
  3931. <p>This option overrides metadata set with <code class="code">-map_metadata</code>. It is
  3932. also possible to delete metadata by using an empty value.
  3933. </p>
  3934. <p>For example, for setting the title in the output file:
  3935. </p><div class="example">
  3936. <pre class="example-preformatted">ffmpeg -i in.avi -metadata title=&quot;my title&quot; out.flv
  3937. </pre></div>
  3938. <p>To set the language of the first audio stream:
  3939. </p><div class="example">
  3940. <pre class="example-preformatted">ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
  3941. </pre></div>
  3942. </dd>
  3943. <dt><samp class="option">-disposition[:stream_specifier] <var class="var">value</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3944. <dd><p>Sets the disposition flags for a stream.
  3945. </p>
  3946. <p>Default value: by default, all disposition flags are copied from the input stream,
  3947. unless the output stream this option applies to is fed by a complex filtergraph
  3948. - in that case no disposition flags are set by default.
  3949. </p>
  3950. <p><var class="var">value</var> is a sequence of disposition flags separated by &rsquo;+&rsquo; or &rsquo;-&rsquo;. A &rsquo;+&rsquo;
  3951. prefix adds the given disposition, &rsquo;-&rsquo; removes it. If the first flag is also
  3952. prefixed with &rsquo;+&rsquo; or &rsquo;-&rsquo;, the resulting disposition is the default value
  3953. updated by <var class="var">value</var>. If the first flag is not prefixed, the resulting
  3954. disposition is <var class="var">value</var>. It is also possible to clear the disposition by
  3955. setting it to 0.
  3956. </p>
  3957. <p>If no <code class="code">-disposition</code> options were specified for an output file, ffmpeg will
  3958. automatically set the &rsquo;default&rsquo; disposition flag on the first stream of each type,
  3959. when there are multiple streams of this type in the output file and no stream of
  3960. that type is already marked as default.
  3961. </p>
  3962. <p>The <code class="code">-dispositions</code> option lists the known disposition flags.
  3963. </p>
  3964. <p>For example, to make the second audio stream the default stream:
  3965. </p><div class="example">
  3966. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
  3967. </pre></div>
  3968. <p>To make the second subtitle stream the default stream and remove the default
  3969. disposition from the first subtitle stream:
  3970. </p><div class="example">
  3971. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
  3972. </pre></div>
  3973. <p>To add an embedded cover/thumbnail:
  3974. </p><div class="example">
  3975. <pre class="example-preformatted">ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
  3976. </pre></div>
  3977. <p>To add the &rsquo;original&rsquo; and remove the &rsquo;comment&rsquo; disposition flag from the first
  3978. audio stream without removing its other disposition flags:
  3979. </p><div class="example">
  3980. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:a:0 +original-comment out.mkv
  3981. </pre></div>
  3982. <p>To remove the &rsquo;original&rsquo; and add the &rsquo;comment&rsquo; disposition flag to the first
  3983. audio stream without removing its other disposition flags:
  3984. </p><div class="example">
  3985. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:a:0 -original+comment out.mkv
  3986. </pre></div>
  3987. <p>To set only the &rsquo;original&rsquo; and &rsquo;comment&rsquo; disposition flags on the first audio
  3988. stream (and remove its other disposition flags):
  3989. </p><div class="example">
  3990. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:a:0 original+comment out.mkv
  3991. </pre></div>
  3992. <p>To remove all disposition flags from the first audio stream:
  3993. </p><div class="example">
  3994. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:a:0 0 out.mkv
  3995. </pre></div>
  3996. <p>Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.
  3997. </p>
  3998. </dd>
  3999. <dt><samp class="option">-program [title=<var class="var">title</var>:][program_num=<var class="var">program_num</var>:]st=<var class="var">stream</var>[:st=<var class="var">stream</var>...] (<em class="emph">output</em>)</samp></dt>
  4000. <dd>
  4001. <p>Creates a program with the specified <var class="var">title</var>, <var class="var">program_num</var> and adds the specified
  4002. <var class="var">stream</var>(s) to it.
  4003. </p>
  4004. </dd>
  4005. <dt><samp class="option">-stream_group [map=<var class="var">input_file_id</var>=<var class="var">stream_group</var>][type=<var class="var">type</var>:]st=<var class="var">stream</var>[:st=<var class="var">stream</var>][:stg=<var class="var">stream_group</var>][:id=<var class="var">stream_group_id</var>...] (<em class="emph">output</em>)</samp></dt>
  4006. <dd>
  4007. <p>Creates a stream group of the specified <var class="var">type</var> and <var class="var">stream_group_id</var>, or by
  4008. <var class="var">map</var>ping an input group, adding the specified <var class="var">stream</var>(s) and/or previously
  4009. defined <var class="var">stream_group</var>(s) to it.
  4010. </p>
  4011. <p><var class="var">type</var> can be one of the following:
  4012. </p><dl class="table">
  4013. <dt><samp class="option">iamf_audio_element</samp></dt>
  4014. <dd><p>Groups <var class="var">stream</var>s that belong to the same IAMF Audio Element
  4015. </p>
  4016. <p>For this group <var class="var">type</var>, the following options are available
  4017. </p><dl class="table">
  4018. <dt><samp class="option">audio_element_type</samp></dt>
  4019. <dd><p>The Audio Element type. The following values are supported:
  4020. </p>
  4021. <dl class="table">
  4022. <dt><samp class="option">channel</samp></dt>
  4023. <dd><p>Scalable channel audio representation
  4024. </p></dd>
  4025. <dt><samp class="option">scene</samp></dt>
  4026. <dd><p>Ambisonics representation
  4027. </p></dd>
  4028. </dl>
  4029. </dd>
  4030. <dt><samp class="option">demixing</samp></dt>
  4031. <dd><p>Demixing information used to reconstruct a scalable channel audio representation.
  4032. This option must be separated from the rest with a &rsquo;,&rsquo;, and takes the following
  4033. key=value options
  4034. </p>
  4035. <dl class="table">
  4036. <dt><samp class="option">parameter_id</samp></dt>
  4037. <dd><p>An identifier parameters blocks in frames may refer to
  4038. </p></dd>
  4039. <dt><samp class="option">dmixp_mode</samp></dt>
  4040. <dd><p>A pre-defined combination of demixing parameters
  4041. </p></dd>
  4042. </dl>
  4043. </dd>
  4044. <dt><samp class="option">recon_gain</samp></dt>
  4045. <dd><p>Recon gain information used to reconstruct a scalable channel audio representation.
  4046. This option must be separated from the rest with a &rsquo;,&rsquo;, and takes the following
  4047. key=value options
  4048. </p>
  4049. <dl class="table">
  4050. <dt><samp class="option">parameter_id</samp></dt>
  4051. <dd><p>An identifier parameters blocks in frames may refer to
  4052. </p></dd>
  4053. </dl>
  4054. </dd>
  4055. <dt><samp class="option">layer</samp></dt>
  4056. <dd><p>A layer defining a Channel Layout in the Audio Element.
  4057. This option must be separated from the rest with a &rsquo;,&rsquo;. Several &rsquo;,&rsquo; separated entries
  4058. can be defined, and at least one must be set.
  4059. </p>
  4060. <p>It takes the following &quot;:&quot;-separated key=value options
  4061. </p>
  4062. <dl class="table">
  4063. <dt><samp class="option">ch_layout</samp></dt>
  4064. <dd><p>The layer&rsquo;s channel layout
  4065. </p></dd>
  4066. <dt><samp class="option">flags</samp></dt>
  4067. <dd><p>The following flags are available:
  4068. </p>
  4069. <dl class="table">
  4070. <dt><samp class="option">recon_gain</samp></dt>
  4071. <dd><p>Whether to signal if recon_gain is present as metadata in parameter blocks within frames
  4072. </p></dd>
  4073. </dl>
  4074. </dd>
  4075. <dt><samp class="option">output_gain</samp></dt>
  4076. <dt><samp class="option">output_gain_flags</samp></dt>
  4077. <dd><p>Which channels output_gain applies to. The following flags are available:
  4078. </p>
  4079. <dl class="table">
  4080. <dt><samp class="option">FL</samp></dt>
  4081. <dt><samp class="option">FR</samp></dt>
  4082. <dt><samp class="option">BL</samp></dt>
  4083. <dt><samp class="option">BR</samp></dt>
  4084. <dt><samp class="option">TFL</samp></dt>
  4085. <dt><samp class="option">TFR</samp></dt>
  4086. </dl>
  4087. </dd>
  4088. <dt><samp class="option">ambisonics_mode</samp></dt>
  4089. <dd><p>The ambisonics mode. This has no effect if audio_element_type is set to channel.
  4090. </p>
  4091. <p>The following values are supported:
  4092. </p>
  4093. <dl class="table">
  4094. <dt><samp class="option">mono</samp></dt>
  4095. <dd><p>Each ambisonics channel is coded as an individual mono stream in the group
  4096. </p></dd>
  4097. </dl>
  4098. </dd>
  4099. </dl>
  4100. </dd>
  4101. <dt><samp class="option">default_w</samp></dt>
  4102. <dd><p>Default weight value
  4103. </p>
  4104. </dd>
  4105. </dl>
  4106. </dd>
  4107. <dt><samp class="option">iamf_mix_presentation</samp></dt>
  4108. <dd><p>Groups <var class="var">stream</var>s that belong to all IAMF Audio Element the same
  4109. IAMF Mix Presentation references
  4110. </p>
  4111. <p>For this group <var class="var">type</var>, the following options are available
  4112. </p>
  4113. <dl class="table">
  4114. <dt><samp class="option">submix</samp></dt>
  4115. <dd><p>A sub-mix within the Mix Presentation.
  4116. This option must be separated from the rest with a &rsquo;,&rsquo;. Several &rsquo;,&rsquo; separated entries
  4117. can be defined, and at least one must be set.
  4118. </p>
  4119. <p>It takes the following &quot;:&quot;-separated key=value options
  4120. </p>
  4121. <dl class="table">
  4122. <dt><samp class="option">parameter_id</samp></dt>
  4123. <dd><p>An identifier parameters blocks in frames may refer to, for post-processing the mixed
  4124. audio signal to generate the audio signal for playback
  4125. </p></dd>
  4126. <dt><samp class="option">parameter_rate</samp></dt>
  4127. <dd><p>The sample rate duration fields in parameters blocks in frames that refer to this
  4128. <var class="var">parameter_id</var> are expressed as
  4129. </p></dd>
  4130. <dt><samp class="option">default_mix_gain</samp></dt>
  4131. <dd><p>Default mix gain value to apply when there are no parameter blocks sharing the same
  4132. <var class="var">parameter_id</var> for a given frame
  4133. </p>
  4134. </dd>
  4135. <dt><samp class="option">element</samp></dt>
  4136. <dd><p>References an Audio Element used in this Mix Presentation to generate the final output
  4137. audio signal for playback.
  4138. This option must be separated from the rest with a &rsquo;|&rsquo;. Several &rsquo;|&rsquo; separated entries
  4139. can be defined, and at least one must be set.
  4140. </p>
  4141. <p>It takes the following &quot;:&quot;-separated key=value options:
  4142. </p>
  4143. <dl class="table">
  4144. <dt><samp class="option">stg</samp></dt>
  4145. <dd><p>The <var class="var">stream_group_id</var> for an Audio Element which this sub-mix refers to
  4146. </p></dd>
  4147. <dt><samp class="option">parameter_id</samp></dt>
  4148. <dd><p>An identifier parameters blocks in frames may refer to, for applying any processing to
  4149. the referenced and rendered Audio Element before being summed with other processed Audio
  4150. Elements
  4151. </p></dd>
  4152. <dt><samp class="option">parameter_rate</samp></dt>
  4153. <dd><p>The sample rate duration fields in parameters blocks in frames that refer to this
  4154. <var class="var">parameter_id</var> are expressed as
  4155. </p></dd>
  4156. <dt><samp class="option">default_mix_gain</samp></dt>
  4157. <dd><p>Default mix gain value to apply when there are no parameter blocks sharing the same
  4158. <var class="var">parameter_id</var> for a given frame
  4159. </p></dd>
  4160. <dt><samp class="option">annotations</samp></dt>
  4161. <dd><p>A key=value string describing the sub-mix element where &quot;key&quot; is a string conforming to
  4162. BCP-47 that specifies the language for the &quot;value&quot; string. &quot;key&quot; must be the same as the
  4163. one in the mix&rsquo;s <var class="var">annotations</var>
  4164. </p></dd>
  4165. <dt><samp class="option">headphones_rendering_mode</samp></dt>
  4166. <dd><p>Indicates whether the input channel-based Audio Element is rendered to stereo loudspeakers
  4167. or spatialized with a binaural renderer when played back on headphones.
  4168. This has no effect if the referenced Audio Element&rsquo;s <var class="var">audio_element_type</var> is set to
  4169. channel.
  4170. </p>
  4171. <p>The following values are supported:
  4172. </p>
  4173. <dl class="table">
  4174. <dt><samp class="option">stereo</samp></dt>
  4175. <dt><samp class="option">binaural</samp></dt>
  4176. </dl>
  4177. </dd>
  4178. </dl>
  4179. </dd>
  4180. <dt><samp class="option">layout</samp></dt>
  4181. <dd><p>Specifies the layouts for this sub-mix on which the loudness information was measured.
  4182. This option must be separated from the rest with a &rsquo;|&rsquo;. Several &rsquo;|&rsquo; separated entries
  4183. can be defined, and at least one must be set.
  4184. </p>
  4185. <p>It takes the following &quot;:&quot;-separated key=value options:
  4186. </p>
  4187. <dl class="table">
  4188. <dt><samp class="option">layout_type</samp></dt>
  4189. <dd>
  4190. <dl class="table">
  4191. <dt><samp class="option">loudspeakers</samp></dt>
  4192. <dd><p>The layout follows the loudspeaker sound system convention of ITU-2051-3.
  4193. </p></dd>
  4194. <dt><samp class="option">binaural</samp></dt>
  4195. <dd><p>The layout is binaural.
  4196. </p></dd>
  4197. </dl>
  4198. </dd>
  4199. <dt><samp class="option">sound_system</samp></dt>
  4200. <dd><p>Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus 7.1.2 and 3.1.2
  4201. This has no effect if <var class="var">layout_type</var> is set to binaural.
  4202. </p></dd>
  4203. <dt><samp class="option">integrated_loudness</samp></dt>
  4204. <dd><p>The program integrated loudness information, as defined in ITU-1770-4.
  4205. </p></dd>
  4206. <dt><samp class="option">digital_peak</samp></dt>
  4207. <dd><p>The digital (sampled) peak value of the audio signal, as defined in ITU-1770-4.
  4208. </p></dd>
  4209. <dt><samp class="option">true_peak</samp></dt>
  4210. <dd><p>The true peak of the audio signal, as defined in ITU-1770-4.
  4211. </p></dd>
  4212. <dt><samp class="option">dialog_anchored_loudness</samp></dt>
  4213. <dd><p>The Dialogue loudness information, as defined in ITU-1770-4.
  4214. </p></dd>
  4215. <dt><samp class="option">album_anchored_loudness</samp></dt>
  4216. <dd><p>The Album loudness information, as defined in ITU-1770-4.
  4217. </p></dd>
  4218. </dl>
  4219. </dd>
  4220. </dl>
  4221. </dd>
  4222. <dt><samp class="option">annotations</samp></dt>
  4223. <dd><p>A key=value string string describing the mix where &quot;key&quot; is a string conforming to BCP-47
  4224. that specifies the language for the &quot;value&quot; string. &quot;key&quot; must be the same as the ones in
  4225. all sub-mix element&rsquo;s <var class="var">annotations</var>s
  4226. </p></dd>
  4227. </dl>
  4228. </dd>
  4229. </dl>
  4230. <p>E.g. to create an scalable 5.1 IAMF file from several WAV input files
  4231. </p><div class="example">
  4232. <pre class="example-preformatted">ffmpeg -i front.wav -i back.wav -i center.wav -i lfe.wav
  4233. -map 0:0 -map 1:0 -map 2:0 -map 3:0 -c:a opus
  4234. -stream_group type=iamf_audio_element:id=1:st=0:st=1:st=2:st=3,
  4235. demixing=parameter_id=998,
  4236. recon_gain=parameter_id=101,
  4237. layer=ch_layout=stereo,
  4238. layer=ch_layout=5.1(side),
  4239. -stream_group type=iamf_mix_presentation:id=2:stg=0:annotations=en-us=Mix_Presentation,
  4240. submix=parameter_id=100:parameter_rate=48000|element=stg=0:parameter_id=100:annotations=en-us=Scalable_Submix|layout=sound_system=stereo|layout=sound_system=5.1(side)
  4241. -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 output.iamf
  4242. </pre></div>
  4243. <p>To copy the two stream groups (Audio Element and Mix Presentation) from an input IAMF file with four
  4244. streams into an mp4 output
  4245. </p><div class="example">
  4246. <pre class="example-preformatted">ffmpeg -i input.iamf -c:a copy -stream_group map=0=0:st=0:st=1:st=2:st=3 -stream_group map=0=1:stg=0
  4247. -streamid 0:0 -streamid 1:1 -streamid 2:2 -streamid 3:3 output.mp4
  4248. </pre></div>
  4249. </dd>
  4250. <dt><samp class="option">-target <var class="var">type</var> (<em class="emph">output</em>)</samp></dt>
  4251. <dd><p>Specify target file type (<code class="code">vcd</code>, <code class="code">svcd</code>, <code class="code">dvd</code>, <code class="code">dv</code>,
  4252. <code class="code">dv50</code>). <var class="var">type</var> may be prefixed with <code class="code">pal-</code>, <code class="code">ntsc-</code> or
  4253. <code class="code">film-</code> to use the corresponding standard. All the format options
  4254. (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
  4255. </p>
  4256. <div class="example">
  4257. <pre class="example-preformatted">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  4258. </pre></div>
  4259. <p>Nevertheless you can specify additional options as long as you know
  4260. they do not conflict with the standard, as in:
  4261. </p>
  4262. <div class="example">
  4263. <pre class="example-preformatted">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  4264. </pre></div>
  4265. <p>The parameters set for each target are as follows.
  4266. </p>
  4267. <p><strong class="strong">VCD</strong>
  4268. </p><div class="example">
  4269. <pre class="example-preformatted"><var class="var">pal</var>:
  4270. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  4271. -s 352x288 -r 25
  4272. -codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  4273. -ar 44100 -ac 2
  4274. -codec:a mp2 -b:a 224k
  4275. <var class="var">ntsc</var>:
  4276. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  4277. -s 352x240 -r 30000/1001
  4278. -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  4279. -ar 44100 -ac 2
  4280. -codec:a mp2 -b:a 224k
  4281. <var class="var">film</var>:
  4282. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  4283. -s 352x240 -r 24000/1001
  4284. -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  4285. -ar 44100 -ac 2
  4286. -codec:a mp2 -b:a 224k
  4287. </pre></div>
  4288. <p><strong class="strong">SVCD</strong>
  4289. </p><div class="example">
  4290. <pre class="example-preformatted"><var class="var">pal</var>:
  4291. -f svcd -packetsize 2324
  4292. -s 480x576 -pix_fmt yuv420p -r 25
  4293. -codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  4294. -ar 44100
  4295. -codec:a mp2 -b:a 224k
  4296. <var class="var">ntsc</var>:
  4297. -f svcd -packetsize 2324
  4298. -s 480x480 -pix_fmt yuv420p -r 30000/1001
  4299. -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  4300. -ar 44100
  4301. -codec:a mp2 -b:a 224k
  4302. <var class="var">film</var>:
  4303. -f svcd -packetsize 2324
  4304. -s 480x480 -pix_fmt yuv420p -r 24000/1001
  4305. -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  4306. -ar 44100
  4307. -codec:a mp2 -b:a 224k
  4308. </pre></div>
  4309. <p><strong class="strong">DVD</strong>
  4310. </p><div class="example">
  4311. <pre class="example-preformatted"><var class="var">pal</var>:
  4312. -f dvd -muxrate 10080k -packetsize 2048
  4313. -s 720x576 -pix_fmt yuv420p -r 25
  4314. -codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  4315. -ar 48000
  4316. -codec:a ac3 -b:a 448k
  4317. <var class="var">ntsc</var>:
  4318. -f dvd -muxrate 10080k -packetsize 2048
  4319. -s 720x480 -pix_fmt yuv420p -r 30000/1001
  4320. -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  4321. -ar 48000
  4322. -codec:a ac3 -b:a 448k
  4323. <var class="var">film</var>:
  4324. -f dvd -muxrate 10080k -packetsize 2048
  4325. -s 720x480 -pix_fmt yuv420p -r 24000/1001
  4326. -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  4327. -ar 48000
  4328. -codec:a ac3 -b:a 448k
  4329. </pre></div>
  4330. <p><strong class="strong">DV</strong>
  4331. </p><div class="example">
  4332. <pre class="example-preformatted"><var class="var">pal</var>:
  4333. -f dv
  4334. -s 720x576 -pix_fmt yuv420p -r 25
  4335. -ar 48000 -ac 2
  4336. <var class="var">ntsc</var>:
  4337. -f dv
  4338. -s 720x480 -pix_fmt yuv411p -r 30000/1001
  4339. -ar 48000 -ac 2
  4340. <var class="var">film</var>:
  4341. -f dv
  4342. -s 720x480 -pix_fmt yuv411p -r 24000/1001
  4343. -ar 48000 -ac 2
  4344. </pre></div>
  4345. <p>The <code class="code">dv50</code> target is identical to the <code class="code">dv</code> target except that the pixel format set is <code class="code">yuv422p</code> for all three standards.
  4346. </p>
  4347. <p>Any user-set value for a parameter above will override the target preset value. In that case, the output may
  4348. not comply with the target standard.
  4349. </p>
  4350. </dd>
  4351. <dt><samp class="option">-dn (<em class="emph">input/output</em>)</samp></dt>
  4352. <dd><p>As an input option, blocks all data streams of a file from being filtered or
  4353. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  4354. option to disable streams individually.
  4355. </p>
  4356. <p>As an output option, disables data recording i.e. automatic selection or
  4357. mapping of any data stream. For full manual control see the <code class="code">-map</code>
  4358. option.
  4359. </p>
  4360. </dd>
  4361. <dt><samp class="option">-dframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  4362. <dd><p>Set the number of data frames to output. This is an obsolete alias for
  4363. <code class="code">-frames:d</code>, which you should use instead.
  4364. </p>
  4365. </dd>
  4366. <dt><samp class="option">-frames[:<var class="var">stream_specifier</var>] <var class="var">framecount</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4367. <dd><p>Stop writing to the stream after <var class="var">framecount</var> frames.
  4368. </p>
  4369. </dd>
  4370. <dt><samp class="option">-q[:<var class="var">stream_specifier</var>] <var class="var">q</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4371. <dt><samp class="option">-qscale[:<var class="var">stream_specifier</var>] <var class="var">q</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4372. <dd><p>Use fixed quality scale (VBR). The meaning of <var class="var">q</var>/<var class="var">qscale</var> is
  4373. codec-dependent.
  4374. If <var class="var">qscale</var> is used without a <var class="var">stream_specifier</var> then it applies only
  4375. to the video stream, this is to maintain compatibility with previous behavior
  4376. and as specifying the same codec specific value to 2 different codecs that is
  4377. audio and video generally is not what is intended when no stream_specifier is
  4378. used.
  4379. </p>
  4380. <a class="anchor" id="filter_005foption"></a></dd>
  4381. <dt><samp class="option">-filter[:<var class="var">stream_specifier</var>] <var class="var">filtergraph</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4382. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  4383. filter the stream.
  4384. </p>
  4385. <p><var class="var">filtergraph</var> is a description of the filtergraph to apply to
  4386. the stream, and must have a single input and a single output of the
  4387. same type of the stream. In the filtergraph, the input is associated
  4388. to the label <code class="code">in</code>, and the output to the label <code class="code">out</code>. See
  4389. the ffmpeg-filters manual for more information about the filtergraph
  4390. syntax.
  4391. </p>
  4392. <p>See the <a class="ref" href="#filter_005fcomplex_005foption">-filter_complex option</a> if you
  4393. want to create filtergraphs with multiple inputs and/or outputs.
  4394. </p>
  4395. </dd>
  4396. <dt><samp class="option">-reinit_filter[:<var class="var">stream_specifier</var>] <var class="var">integer</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  4397. <dd><p>This boolean option determines if the filtergraph(s) to which this stream is fed gets
  4398. reinitialized when input frame parameters change mid-stream. This option is enabled by
  4399. default as most video and all audio filters cannot handle deviation in input frame properties.
  4400. Upon reinitialization, existing filter state is lost, like e.g. the frame count <code class="code">n</code>
  4401. reference available in some filters. Any frames buffered at time of reinitialization are lost.
  4402. The properties where a change triggers reinitialization are,
  4403. for video, frame resolution or pixel format;
  4404. for audio, sample format, sample rate, channel count or channel layout.
  4405. </p>
  4406. </dd>
  4407. <dt><samp class="option">-drop_changed[:<var class="var">stream_specifier</var>] <var class="var">integer</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  4408. <dd><p>This boolean option determines whether a frame with differing frame parameters mid-stream
  4409. gets dropped instead of leading to filtergraph reinitialization, as that would lead to loss
  4410. of filter state. Generally useful to avoid corrupted yet decodable packets in live streaming
  4411. inputs. Default is false.
  4412. </p>
  4413. </dd>
  4414. <dt><samp class="option">-filter_threads <var class="var">nb_threads</var> (<em class="emph">global</em>)</samp></dt>
  4415. <dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
  4416. will produce a thread pool with this many threads available for parallel processing.
  4417. The default is the number of available CPUs.
  4418. </p>
  4419. </dd>
  4420. <dt><samp class="option">-filter_buffered_frames <var class="var">nb_frames</var> (<em class="emph">global</em>)</samp></dt>
  4421. <dd><p>Defines the maximum number of buffered frames allowed in a filtergraph. Under
  4422. normal circumstances, a filtergraph should not buffer more than a few frames,
  4423. especially if frames are being fed to it and read from it in a balanced way
  4424. (which is the intended behavior in ffmpeg). That said, this option allows you
  4425. to limit the total number of frames buffered across all links in a filtergraph.
  4426. If more frames are generated, filtering is aborted and an error is returned.
  4427. The default value is 0, which means no limit.
  4428. </p>
  4429. </dd>
  4430. <dt><samp class="option">-pre[:<var class="var">stream_specifier</var>] <var class="var">preset_name</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4431. <dd><p>Specify the preset for matching stream(s).
  4432. </p>
  4433. </dd>
  4434. <dt><samp class="option">-stats (<em class="emph">global</em>)</samp></dt>
  4435. <dd><p>Log encoding progress/statistics as &quot;info&quot;-level log (see <code class="code">-loglevel</code>).
  4436. It is on by default, to explicitly disable it you need to specify <code class="code">-nostats</code>.
  4437. </p>
  4438. </dd>
  4439. <dt><samp class="option">-stats_period <var class="var">time</var> (<em class="emph">global</em>)</samp></dt>
  4440. <dd><p>Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
  4441. </p>
  4442. </dd>
  4443. <dt><samp class="option">-print_graphs (<em class="emph">global</em>)</samp></dt>
  4444. <dd><p>Prints execution graph details to stderr in the format set via -print_graphs_format.
  4445. </p>
  4446. </dd>
  4447. <dt><samp class="option">-print_graphs_file <var class="var">filename</var> (<em class="emph">global</em>)</samp></dt>
  4448. <dd><p>Writes execution graph details to the specified file in the format set via -print_graphs_format.
  4449. </p>
  4450. </dd>
  4451. <dt><samp class="option">-print_graphs_format <var class="var">format</var> (<em class="emph">global</em>)</samp></dt>
  4452. <dd><p>Sets the output format (available formats are: default, compact, csv, flat, ini, json, xml, mermaid, mermaidhtml)
  4453. The default format is json.
  4454. </p>
  4455. </dd>
  4456. <dt><samp class="option">-progress <var class="var">url</var> (<em class="emph">global</em>)</samp></dt>
  4457. <dd><p>Send program-friendly progress information to <var class="var">url</var>.
  4458. </p>
  4459. <p>Progress information is written periodically and at the end of
  4460. the encoding process. It is made of &quot;<var class="var">key</var>=<var class="var">value</var>&quot; lines. <var class="var">key</var>
  4461. consists of only alphanumeric characters. The last key of a sequence of
  4462. progress information is always &quot;progress&quot; with the value &quot;continue&quot; or &quot;end&quot;.
  4463. </p>
  4464. <p>The update period is set using <code class="code">-stats_period</code>.
  4465. </p>
  4466. <p>For example, log progress information to stdout:
  4467. </p>
  4468. <div class="example">
  4469. <pre class="example-preformatted">ffmpeg -progress pipe:1 -i in.mkv out.mkv
  4470. </pre></div>
  4471. <a class="anchor" id="stdin-option"></a></dd>
  4472. <dt><samp class="option">-stdin</samp></dt>
  4473. <dd><p>Enable interaction on standard input. On by default unless standard input is
  4474. used as an input. To explicitly disable interaction you need to specify
  4475. <code class="code">-nostdin</code>.
  4476. </p>
  4477. <p>Disabling interaction on standard input is useful, for example, if
  4478. ffmpeg is in the background process group. Roughly the same result can
  4479. be achieved with <code class="code">ffmpeg ... &lt; /dev/null</code> but it requires a
  4480. shell.
  4481. </p>
  4482. </dd>
  4483. <dt><samp class="option">-debug_ts (<em class="emph">global</em>)</samp></dt>
  4484. <dd><p>Print timestamp/latency information. It is off by default. This option is
  4485. mostly useful for testing and debugging purposes, and the output
  4486. format may change from one version to another, so it should not be
  4487. employed by portable scripts.
  4488. </p>
  4489. <p>See also the option <code class="code">-fdebug ts</code>.
  4490. </p>
  4491. </dd>
  4492. <dt><samp class="option">-attach <var class="var">filename</var> (<em class="emph">output</em>)</samp></dt>
  4493. <dd><p>Add an attachment to the output file. This is supported by a few formats
  4494. like Matroska for e.g. fonts used in rendering subtitles. Attachments
  4495. are implemented as a specific type of stream, so this option will add
  4496. a new stream to the file. It is then possible to use per-stream options
  4497. on this stream in the usual way. Attachment streams created with this
  4498. option will be created after all the other streams (i.e. those created
  4499. with <code class="code">-map</code> or automatic mappings).
  4500. </p>
  4501. <p>Note that for Matroska you also have to set the mimetype metadata tag:
  4502. </p><div class="example">
  4503. <pre class="example-preformatted">ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
  4504. </pre></div>
  4505. <p>(assuming that the attachment stream will be third in the output file).
  4506. </p>
  4507. </dd>
  4508. <dt><samp class="option">-dump_attachment[:<var class="var">stream_specifier</var>] <var class="var">filename</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  4509. <dd><p>Extract the matching attachment stream into a file named <var class="var">filename</var>. If
  4510. <var class="var">filename</var> is empty, then the value of the <code class="code">filename</code> metadata tag
  4511. will be used.
  4512. </p>
  4513. <p>E.g. to extract the first attachment to a file named &rsquo;out.ttf&rsquo;:
  4514. </p><div class="example">
  4515. <pre class="example-preformatted">ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
  4516. </pre></div>
  4517. <p>To extract all attachments to files determined by the <code class="code">filename</code> tag:
  4518. </p><div class="example">
  4519. <pre class="example-preformatted">ffmpeg -dump_attachment:t &quot;&quot; -i INPUT
  4520. </pre></div>
  4521. <p>Technical note &ndash; attachments are implemented as codec extradata, so this
  4522. option can actually be used to extract extradata from any stream, not just
  4523. attachments.
  4524. </p></dd>
  4525. </dl>
  4526. <a name="Video-Options"></a>
  4527. <h3 class="section">5.5 Video Options<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Options" aria-hidden="true">TOC</a></span></h3>
  4528. <dl class="table">
  4529. <dt><samp class="option">-vframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  4530. <dd><p>Set the number of video frames to output. This is an obsolete alias for
  4531. <code class="code">-frames:v</code>, which you should use instead.
  4532. </p></dd>
  4533. <dt><samp class="option">-r[:<var class="var">stream_specifier</var>] <var class="var">fps</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  4534. <dd><p>Set frame rate (Hz value, fraction or abbreviation).
  4535. </p>
  4536. <p>As an input option, ignore any timestamps stored in the file and instead
  4537. generate timestamps assuming constant frame rate <var class="var">fps</var>.
  4538. This is not the same as the <samp class="option">-framerate</samp> option used for some input formats
  4539. like image2 or v4l2 (it used to be the same in older versions of FFmpeg).
  4540. If in doubt use <samp class="option">-framerate</samp> instead of the input option <samp class="option">-r</samp>.
  4541. </p>
  4542. <p>As an output option:
  4543. </p><dl class="table">
  4544. <dt><samp class="option">video encoding</samp></dt>
  4545. <dd><p>Duplicate or drop frames right before encoding them to achieve constant output
  4546. frame rate <var class="var">fps</var>.
  4547. </p>
  4548. </dd>
  4549. <dt><samp class="option">video streamcopy</samp></dt>
  4550. <dd><p>Indicate to the muxer that <var class="var">fps</var> is the stream frame rate. No data is
  4551. dropped or duplicated in this case. This may produce invalid files if <var class="var">fps</var>
  4552. does not match the actual stream frame rate as determined by packet timestamps.
  4553. See also the <code class="code">setts</code> bitstream filter.
  4554. </p>
  4555. </dd>
  4556. </dl>
  4557. </dd>
  4558. <dt><samp class="option">-fpsmax[:<var class="var">stream_specifier</var>] <var class="var">fps</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4559. <dd><p>Set maximum frame rate (Hz value, fraction or abbreviation).
  4560. </p>
  4561. <p>Clamps output frame rate when output framerate is auto-set and is higher than this value.
  4562. Useful in batch processing or when input framerate is wrongly detected as very high.
  4563. It cannot be set together with <code class="code">-r</code>. It is ignored during streamcopy.
  4564. </p>
  4565. </dd>
  4566. <dt><samp class="option">-s[:<var class="var">stream_specifier</var>] <var class="var">size</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  4567. <dd><p>Set frame size.
  4568. </p>
  4569. <p>As an input option, this is a shortcut for the <samp class="option">video_size</samp> private
  4570. option, recognized by some demuxers for which the frame size is either not
  4571. stored in the file or is configurable &ndash; e.g. raw video or video grabbers.
  4572. </p>
  4573. <p>As an output option, this inserts the <code class="code">scale</code> video filter to the
  4574. <em class="emph">end</em> of the corresponding filtergraph. Please use the <code class="code">scale</code> filter
  4575. directly to insert it at the beginning or some other place.
  4576. </p>
  4577. <p>The format is &lsquo;<samp class="samp">wxh</samp>&rsquo; (default - same as source).
  4578. </p>
  4579. </dd>
  4580. <dt><samp class="option">-aspect[:<var class="var">stream_specifier</var>] <var class="var">aspect</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4581. <dd><p>Set the video display aspect ratio specified by <var class="var">aspect</var>.
  4582. </p>
  4583. <p><var class="var">aspect</var> can be a floating point number string, or a string of the
  4584. form <var class="var">num</var>:<var class="var">den</var>, where <var class="var">num</var> and <var class="var">den</var> are the
  4585. numerator and denominator of the aspect ratio. For example &quot;4:3&quot;,
  4586. &quot;16:9&quot;, &quot;1.3333&quot;, and &quot;1.7777&quot; are valid argument values.
  4587. </p>
  4588. <p>If used together with <samp class="option">-vcodec copy</samp>, it will affect the aspect ratio
  4589. stored at container level, but not the aspect ratio stored in encoded
  4590. frames, if it exists.
  4591. </p>
  4592. </dd>
  4593. <dt><samp class="option">-display_rotation[:<var class="var">stream_specifier</var>] <var class="var">rotation</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  4594. <dd><p>Set video rotation metadata.
  4595. </p>
  4596. <p><var class="var">rotation</var> is a decimal number specifying the amount in degree by
  4597. which the video should be rotated counter-clockwise before being
  4598. displayed.
  4599. </p>
  4600. <p>This option overrides the rotation/display transform metadata stored in
  4601. the file, if any. When the video is being transcoded (rather than
  4602. copied) and <code class="code">-autorotate</code> is enabled, the video will be rotated at
  4603. the filtering stage. Otherwise, the metadata will be written into the
  4604. output file if the muxer supports it.
  4605. </p>
  4606. <p>If the <code class="code">-display_hflip</code> and/or <code class="code">-display_vflip</code> options are
  4607. given, they are applied after the rotation specified by this option.
  4608. </p>
  4609. </dd>
  4610. <dt><samp class="option">-display_hflip[:<var class="var">stream_specifier</var>] (<em class="emph">input,per-stream</em>)</samp></dt>
  4611. <dd><p>Set whether on display the image should be horizontally flipped.
  4612. </p>
  4613. <p>See the <code class="code">-display_rotation</code> option for more details.
  4614. </p>
  4615. </dd>
  4616. <dt><samp class="option">-display_vflip[:<var class="var">stream_specifier</var>] (<em class="emph">input,per-stream</em>)</samp></dt>
  4617. <dd><p>Set whether on display the image should be vertically flipped.
  4618. </p>
  4619. <p>See the <code class="code">-display_rotation</code> option for more details.
  4620. </p>
  4621. </dd>
  4622. <dt><samp class="option">-vn (<em class="emph">input/output</em>)</samp></dt>
  4623. <dd><p>As an input option, blocks all video streams of a file from being filtered or
  4624. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  4625. option to disable streams individually.
  4626. </p>
  4627. <p>As an output option, disables video recording i.e. automatic selection or
  4628. mapping of any video stream. For full manual control see the <code class="code">-map</code>
  4629. option.
  4630. </p>
  4631. </dd>
  4632. <dt><samp class="option">-vcodec <var class="var">codec</var> (<em class="emph">output</em>)</samp></dt>
  4633. <dd><p>Set the video codec. This is an alias for <code class="code">-codec:v</code>.
  4634. </p>
  4635. </dd>
  4636. <dt><samp class="option">-pass[:<var class="var">stream_specifier</var>] <var class="var">n</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4637. <dd><p>Select the pass number (1 or 2). It is used to do two-pass
  4638. video encoding. The statistics of the video are recorded in the first
  4639. pass into a log file (see also the option -passlogfile),
  4640. and in the second pass that log file is used to generate the video
  4641. at the exact requested bitrate.
  4642. On pass 1, you may just deactivate audio and set output to null,
  4643. examples for Windows and Unix:
  4644. </p><div class="example">
  4645. <pre class="example-preformatted">ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
  4646. ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
  4647. </pre></div>
  4648. </dd>
  4649. <dt><samp class="option">-passlogfile[:<var class="var">stream_specifier</var>] <var class="var">prefix</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4650. <dd><p>Set two-pass log file name prefix to <var class="var">prefix</var>, the default file name
  4651. prefix is &ldquo;ffmpeg2pass&rdquo;. The complete file name will be
  4652. <samp class="file">PREFIX-N.log</samp>, where N is a number specific to the output
  4653. stream
  4654. </p>
  4655. </dd>
  4656. <dt><samp class="option">-vf <var class="var">filtergraph</var> (<em class="emph">output</em>)</samp></dt>
  4657. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  4658. filter the stream.
  4659. </p>
  4660. <p>This is an alias for <code class="code">-filter:v</code>, see the <a class="ref" href="#filter_005foption">-filter option</a>.
  4661. </p>
  4662. </dd>
  4663. <dt><samp class="option">-autorotate</samp></dt>
  4664. <dd><p>Automatically rotate the video according to file metadata. Enabled by
  4665. default, use <samp class="option">-noautorotate</samp> to disable it.
  4666. </p>
  4667. </dd>
  4668. <dt><samp class="option">-autoscale</samp></dt>
  4669. <dd><p>Automatically scale the video according to the resolution of first frame.
  4670. Enabled by default, use <samp class="option">-noautoscale</samp> to disable it. When autoscale is
  4671. disabled, all output frames of filter graph might not be in the same resolution
  4672. and may be inadequate for some encoder/muxer. Therefore, it is not recommended
  4673. to disable it unless you really know what you are doing.
  4674. Disable autoscale at your own risk.
  4675. </p></dd>
  4676. </dl>
  4677. <a name="Advanced-Video-options"></a>
  4678. <h3 class="section">5.6 Advanced Video options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-Video-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-Video-options" aria-hidden="true">TOC</a></span></h3>
  4679. <dl class="table">
  4680. <dt><samp class="option">-pix_fmt[:<var class="var">stream_specifier</var>] <var class="var">format</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  4681. <dd><p>Set pixel format. Use <code class="code">-pix_fmts</code> to show all the supported
  4682. pixel formats.
  4683. If the selected pixel format can not be selected, ffmpeg will print a
  4684. warning and select the best pixel format supported by the encoder.
  4685. If <var class="var">pix_fmt</var> is prefixed by a <code class="code">+</code>, ffmpeg will exit with an error
  4686. if the requested pixel format can not be selected, and automatic conversions
  4687. inside filtergraphs are disabled.
  4688. If <var class="var">pix_fmt</var> is a single <code class="code">+</code>, ffmpeg selects the same pixel format
  4689. as the input (or graph output) and automatic conversions are disabled.
  4690. </p>
  4691. </dd>
  4692. <dt><samp class="option">-sws_flags <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  4693. <dd><p>Set default flags for the libswscale library. These flags are used by
  4694. automatically inserted <code class="code">scale</code> filters and those within simple
  4695. filtergraphs, if not overridden within the filtergraph definition.
  4696. </p>
  4697. <p>See the <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#scaler_005foptions">ffmpeg-scaler manual</a> for a list
  4698. of scaler options.
  4699. </p>
  4700. </dd>
  4701. <dt><samp class="option">-rc_override[:<var class="var">stream_specifier</var>] <var class="var">override</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4702. <dd><p>Rate control override for specific intervals, formatted as &quot;int,int,int&quot;
  4703. list separated with slashes. Two first values are the beginning and
  4704. end frame numbers, last one is quantizer to use if positive, or quality
  4705. factor if negative.
  4706. </p>
  4707. </dd>
  4708. <dt><samp class="option">-vstats</samp></dt>
  4709. <dd><p>Dump video coding statistics to <samp class="file">vstats_HHMMSS.log</samp>. See the
  4710. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  4711. </p>
  4712. </dd>
  4713. <dt><samp class="option">-vstats_file <var class="var">file</var></samp></dt>
  4714. <dd><p>Dump video coding statistics to <var class="var">file</var>. See the
  4715. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  4716. </p>
  4717. </dd>
  4718. <dt><samp class="option">-vstats_version <var class="var">file</var></samp></dt>
  4719. <dd><p>Specify which version of the vstats format to use. Default is <code class="code">2</code>. See the
  4720. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  4721. </p>
  4722. </dd>
  4723. <dt><samp class="option">-vtag <var class="var">fourcc/tag</var> (<em class="emph">output</em>)</samp></dt>
  4724. <dd><p>Force video tag/fourcc. This is an alias for <code class="code">-tag:v</code>.
  4725. </p>
  4726. </dd>
  4727. <dt><samp class="option">-force_key_frames[:<var class="var">stream_specifier</var>] <var class="var">time</var>[,<var class="var">time</var>...] (<em class="emph">output,per-stream</em>)</samp></dt>
  4728. <dt><samp class="option">-force_key_frames[:<var class="var">stream_specifier</var>] expr:<var class="var">expr</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  4729. <dt><samp class="option">-force_key_frames[:<var class="var">stream_specifier</var>] source (<em class="emph">output,per-stream</em>)</samp></dt>
  4730. <dt><samp class="option">-force_key_frames[:<var class="var">stream_specifier</var>] scd_metadata (<em class="emph">output,per-stream</em>)</samp></dt>
  4731. <dd>
  4732. <p><var class="var">force_key_frames</var> can take arguments of the following form:
  4733. </p>
  4734. <dl class="table">
  4735. <dt><samp class="option"><var class="var">time</var>[,<var class="var">time</var>...]</samp></dt>
  4736. <dd><p>If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
  4737. output timestamp as per the encoder time base and force a keyframe at the first frame having
  4738. timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
  4739. coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
  4740. The default encoder time base is the inverse of the output framerate but may be set otherwise
  4741. via <code class="code">-enc_time_base</code>.
  4742. </p>
  4743. <p>If one of the times is &quot;<code class="code">chapters</code>[<var class="var">delta</var>]&quot;, it is expanded into
  4744. the time of the beginning of all chapters in the file, shifted by
  4745. <var class="var">delta</var>, expressed as a time in seconds.
  4746. This option can be useful to ensure that a seek point is present at a
  4747. chapter mark or any other designated place in the output file.
  4748. </p>
  4749. <p>For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
  4750. before the beginning of every chapter:
  4751. </p><div class="example">
  4752. <pre class="example-preformatted">-force_key_frames 0:05:00,chapters-0.1
  4753. </pre></div>
  4754. </dd>
  4755. <dt><samp class="option">expr:<var class="var">expr</var></samp></dt>
  4756. <dd><p>If the argument is prefixed with <code class="code">expr:</code>, the string <var class="var">expr</var>
  4757. is interpreted like an expression and is evaluated for each frame. A
  4758. key frame is forced in case the evaluation is non-zero.
  4759. </p>
  4760. <p>The expression in <var class="var">expr</var> can contain the following constants:
  4761. </p><dl class="table">
  4762. <dt><samp class="option">n</samp></dt>
  4763. <dd><p>the number of current processed frame, starting from 0
  4764. </p></dd>
  4765. <dt><samp class="option">n_forced</samp></dt>
  4766. <dd><p>the number of forced frames
  4767. </p></dd>
  4768. <dt><samp class="option">prev_forced_n</samp></dt>
  4769. <dd><p>the number of the previous forced frame, it is <code class="code">NAN</code> when no
  4770. keyframe was forced yet
  4771. </p></dd>
  4772. <dt><samp class="option">prev_forced_t</samp></dt>
  4773. <dd><p>the time of the previous forced frame, it is <code class="code">NAN</code> when no
  4774. keyframe was forced yet
  4775. </p></dd>
  4776. <dt><samp class="option">t</samp></dt>
  4777. <dd><p>the time of the current processed frame
  4778. </p></dd>
  4779. </dl>
  4780. <p>For example to force a key frame every 5 seconds, you can specify:
  4781. </p><div class="example">
  4782. <pre class="example-preformatted">-force_key_frames expr:gte(t,n_forced*5)
  4783. </pre></div>
  4784. <p>To force a key frame 5 seconds after the time of the last forced one,
  4785. starting from second 13:
  4786. </p><div class="example">
  4787. <pre class="example-preformatted">-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
  4788. </pre></div>
  4789. </dd>
  4790. <dt><samp class="option">source</samp></dt>
  4791. <dd><p>If the argument is <code class="code">source</code>, ffmpeg will force a key frame if
  4792. the current frame being encoded is marked as a key frame in its source.
  4793. In cases where this particular source frame has to be dropped,
  4794. enforce the next available frame to become a key frame instead.
  4795. </p>
  4796. </dd>
  4797. <dt><samp class="option">scd_metadata</samp></dt>
  4798. <dd><p>If the argument is <code class="code">scd_metadata</code>, ffmpeg will force a key frame if
  4799. the current frame contains a metadata entry with the key <code class="code">lavfi.scd.time</code>.
  4800. The metadata can be added by filters like <code class="code">scdet</code> and <code class="code">scdet_vulkan</code>.
  4801. Avoid inserting filters that duplicate frames after <code class="code">scdet</code>, as this can
  4802. cause duplicate metadata for multiple frames and repeated insertion of key
  4803. frames.
  4804. </p>
  4805. </dd>
  4806. </dl>
  4807. <p>Note that forcing too many keyframes is very harmful for the lookahead
  4808. algorithms of certain encoders: using fixed-GOP options or similar
  4809. would be more efficient.
  4810. </p>
  4811. </dd>
  4812. <dt><samp class="option">-apply_cropping[:<var class="var">stream_specifier</var>] <var class="var">source</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  4813. <dd><p>Automatically crop the video after decoding according to file metadata.
  4814. Default is <em class="emph">all</em>.
  4815. </p>
  4816. <dl class="table">
  4817. <dt><samp class="option">none (0)</samp></dt>
  4818. <dd><p>Don&rsquo;t apply any cropping metadata.
  4819. </p></dd>
  4820. <dt><samp class="option">all (1)</samp></dt>
  4821. <dd><p>Apply both codec and container level croppping. This is the default mode.
  4822. </p></dd>
  4823. <dt><samp class="option">codec (2)</samp></dt>
  4824. <dd><p>Apply codec level croppping.
  4825. </p></dd>
  4826. <dt><samp class="option">container (3)</samp></dt>
  4827. <dd><p>Apply container level croppping.
  4828. </p></dd>
  4829. </dl>
  4830. </dd>
  4831. <dt><samp class="option">-copyinkf[:<var class="var">stream_specifier</var>] (<em class="emph">output,per-stream</em>)</samp></dt>
  4832. <dd><p>When doing stream copy, copy also non-key frames found at the
  4833. beginning.
  4834. </p>
  4835. </dd>
  4836. <dt><samp class="option">-init_hw_device <var class="var">type</var>[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  4837. <dd><p>Initialise a new hardware device of type <var class="var">type</var> called <var class="var">name</var>, using the
  4838. given device parameters.
  4839. If no name is specified it will receive a default name of the form &quot;<var class="var">type</var>%d&quot;.
  4840. </p>
  4841. <p>The meaning of <var class="var">device</var> and the following arguments depends on the
  4842. device type:
  4843. </p><dl class="table">
  4844. <dt><samp class="option">cuda</samp></dt>
  4845. <dd><p><var class="var">device</var> is the number of the CUDA device.
  4846. </p>
  4847. <p>The following options are recognized:
  4848. </p><dl class="table">
  4849. <dt><samp class="option">primary_ctx</samp></dt>
  4850. <dd><p>If set to 1, uses the primary device context instead of creating a new one.
  4851. </p></dd>
  4852. </dl>
  4853. <p>Examples:
  4854. </p><dl class="table">
  4855. <dt><em class="emph">-init_hw_device cuda:1</em></dt>
  4856. <dd><p>Choose the second device on the system.
  4857. </p>
  4858. </dd>
  4859. <dt><em class="emph">-init_hw_device cuda:0,primary_ctx=1</em></dt>
  4860. <dd><p>Choose the first device and use the primary device context.
  4861. </p></dd>
  4862. </dl>
  4863. </dd>
  4864. <dt><samp class="option">dxva2</samp></dt>
  4865. <dd><p><var class="var">device</var> is the number of the Direct3D 9 display adapter.
  4866. </p>
  4867. </dd>
  4868. <dt><samp class="option">d3d11va</samp></dt>
  4869. <dd><p><var class="var">device</var> is the number of the Direct3D 11 display adapter.
  4870. If not specified, it will attempt to use the default Direct3D 11 display adapter
  4871. or the first Direct3D 11 display adapter whose hardware VendorId is specified
  4872. by &lsquo;<samp class="samp">vendor_id</samp>&rsquo;.
  4873. </p>
  4874. <p>Examples:
  4875. </p><dl class="table">
  4876. <dt><em class="emph">-init_hw_device d3d11va</em></dt>
  4877. <dd><p>Create a d3d11va device on the default Direct3D 11 display adapter.
  4878. </p>
  4879. </dd>
  4880. <dt><em class="emph">-init_hw_device d3d11va:1</em></dt>
  4881. <dd><p>Create a d3d11va device on the Direct3D 11 display adapter specified by index 1.
  4882. </p>
  4883. </dd>
  4884. <dt><em class="emph">-init_hw_device d3d11va:,vendor_id=0x8086</em></dt>
  4885. <dd><p>Create a d3d11va device on the first Direct3D 11 display adapter whose hardware VendorId is 0x8086.
  4886. </p></dd>
  4887. </dl>
  4888. </dd>
  4889. <dt><samp class="option">vaapi</samp></dt>
  4890. <dd><p><var class="var">device</var> is either an X11 display name, a DRM render node or a DirectX adapter index.
  4891. If not specified, it will attempt to open the default X11 display (<em class="emph">$DISPLAY</em>)
  4892. and then the first DRM render node (<em class="emph">/dev/dri/renderD128</em>), or the default
  4893. DirectX adapter on Windows.
  4894. </p>
  4895. <p>The following options are recognized:
  4896. </p><dl class="table">
  4897. <dt><samp class="option">kernel_driver</samp></dt>
  4898. <dd><p>When <var class="var">device</var> is not specified, use this option to specify the name of the kernel
  4899. driver associated with the desired device. This option is available only when
  4900. the hardware acceleration method <em class="emph">drm</em> and <em class="emph">vaapi</em> are enabled.
  4901. </p></dd>
  4902. <dt><samp class="option">vendor_id</samp></dt>
  4903. <dd><p>When <var class="var">device</var> and <var class="var">kernel_driver</var> are not specified, use this option to specify
  4904. the vendor id associated with the desired device. This option is available only when the
  4905. hardware acceleration method <em class="emph">drm</em> and <em class="emph">vaapi</em> are enabled and <em class="emph">kernel_driver</em>
  4906. is not specified.
  4907. </p></dd>
  4908. </dl>
  4909. <p>Examples:
  4910. </p><dl class="table">
  4911. <dt><em class="emph">-init_hw_device vaapi</em></dt>
  4912. <dd><p>Create a vaapi device on the default device.
  4913. </p>
  4914. </dd>
  4915. <dt><em class="emph">-init_hw_device vaapi:/dev/dri/renderD129</em></dt>
  4916. <dd><p>Create a vaapi device on DRM render node <samp class="file">/dev/dri/renderD129</samp>.
  4917. </p>
  4918. </dd>
  4919. <dt><em class="emph">-init_hw_device vaapi:1</em></dt>
  4920. <dd><p>Create a vaapi device on DirectX adapter 1.
  4921. </p>
  4922. </dd>
  4923. <dt><em class="emph">-init_hw_device vaapi:,kernel_driver=i915</em></dt>
  4924. <dd><p>Create a vaapi device on a device associated with kernel driver &lsquo;<samp class="samp">i915</samp>&rsquo;.
  4925. </p>
  4926. </dd>
  4927. <dt><em class="emph">-init_hw_device vaapi:,vendor_id=0x8086</em></dt>
  4928. <dd><p>Create a vaapi device on a device associated with vendor id &lsquo;<samp class="samp">0x8086</samp>&rsquo;.
  4929. </p></dd>
  4930. </dl>
  4931. </dd>
  4932. <dt><samp class="option">vdpau</samp></dt>
  4933. <dd><p><var class="var">device</var> is an X11 display name.
  4934. If not specified, it will attempt to open the default X11 display (<em class="emph">$DISPLAY</em>).
  4935. </p>
  4936. </dd>
  4937. <dt><samp class="option">qsv</samp></dt>
  4938. <dd><p><var class="var">device</var> selects a value in &lsquo;<samp class="samp">MFX_IMPL_*</samp>&rsquo;. Allowed values are:
  4939. </p><dl class="table">
  4940. <dt><samp class="option">auto</samp></dt>
  4941. <dt><samp class="option">sw</samp></dt>
  4942. <dt><samp class="option">hw</samp></dt>
  4943. <dt><samp class="option">auto_any</samp></dt>
  4944. <dt><samp class="option">hw_any</samp></dt>
  4945. <dt><samp class="option">hw2</samp></dt>
  4946. <dt><samp class="option">hw3</samp></dt>
  4947. <dt><samp class="option">hw4</samp></dt>
  4948. </dl>
  4949. <p>If not specified, &lsquo;<samp class="samp">auto_any</samp>&rsquo; is used.
  4950. (Note that it may be easier to achieve the desired result for QSV by creating the
  4951. platform-appropriate subdevice (&lsquo;<samp class="samp">dxva2</samp>&rsquo; or &lsquo;<samp class="samp">d3d11va</samp>&rsquo; or &lsquo;<samp class="samp">vaapi</samp>&rsquo;) and then deriving a
  4952. QSV device from that.)
  4953. </p>
  4954. <p>The following options are recognized:
  4955. </p><dl class="table">
  4956. <dt><samp class="option">child_device</samp></dt>
  4957. <dd><p>Specify a DRM render node on Linux or DirectX adapter on Windows.
  4958. </p></dd>
  4959. <dt><samp class="option">child_device_type</samp></dt>
  4960. <dd><p>Choose platform-appropriate subdevice type. On Windows &lsquo;<samp class="samp">d3d11va</samp>&rsquo; is used
  4961. as default subdevice type when <code class="code">--enable-libvpl</code> is specified at configuration time,
  4962. &lsquo;<samp class="samp">dxva2</samp>&rsquo; is used as default subdevice type when <code class="code">--enable-libmfx</code> is specified at
  4963. configuration time. On Linux user can use &lsquo;<samp class="samp">vaapi</samp>&rsquo; only as subdevice type.
  4964. </p></dd>
  4965. </dl>
  4966. <p>Examples:
  4967. </p><dl class="table">
  4968. <dt><em class="emph">-init_hw_device qsv:hw,child_device=/dev/dri/renderD129</em></dt>
  4969. <dd><p>Create a QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo; on DRM render node <samp class="file">/dev/dri/renderD129</samp>.
  4970. </p>
  4971. </dd>
  4972. <dt><em class="emph">-init_hw_device qsv:hw,child_device=1</em></dt>
  4973. <dd><p>Create a QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo; on DirectX adapter 1.
  4974. </p>
  4975. </dd>
  4976. <dt><em class="emph">-init_hw_device qsv:hw,child_device_type=d3d11va</em></dt>
  4977. <dd><p>Choose the GPU subdevice with type &lsquo;<samp class="samp">d3d11va</samp>&rsquo; and create QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo;.
  4978. </p>
  4979. </dd>
  4980. <dt><em class="emph">-init_hw_device qsv:hw,child_device_type=dxva2</em></dt>
  4981. <dd><p>Choose the GPU subdevice with type &lsquo;<samp class="samp">dxva2</samp>&rsquo; and create QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo;.
  4982. </p>
  4983. </dd>
  4984. <dt><em class="emph">-init_hw_device qsv:hw,child_device=1,child_device_type=d3d11va</em></dt>
  4985. <dd><p>Create a QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo; on DirectX adapter 1 with subdevice type &lsquo;<samp class="samp">d3d11va</samp>&rsquo;.
  4986. </p>
  4987. </dd>
  4988. <dt><em class="emph">-init_hw_device vaapi=va:/dev/dri/renderD129 -init_hw_device qsv=hw1@<var class="var">va</var></em></dt>
  4989. <dd><p>Create a VAAPI device called &lsquo;<samp class="samp">va</samp>&rsquo; on <samp class="file">/dev/dri/renderD129</samp>, then derive a QSV device called &lsquo;<samp class="samp">hw1</samp>&rsquo;
  4990. from device &lsquo;<samp class="samp">va</samp>&rsquo;.
  4991. </p>
  4992. </dd>
  4993. </dl>
  4994. </dd>
  4995. <dt><samp class="option">opencl</samp></dt>
  4996. <dd><p><var class="var">device</var> selects the platform and device as <em class="emph">platform_index.device_index</em>.
  4997. </p>
  4998. <p>The set of devices can also be filtered using the key-value pairs to find only
  4999. devices matching particular platform or device strings.
  5000. </p>
  5001. <p>The strings usable as filters are:
  5002. </p><dl class="table">
  5003. <dt><samp class="option">platform_profile</samp></dt>
  5004. <dt><samp class="option">platform_version</samp></dt>
  5005. <dt><samp class="option">platform_name</samp></dt>
  5006. <dt><samp class="option">platform_vendor</samp></dt>
  5007. <dt><samp class="option">platform_extensions</samp></dt>
  5008. <dt><samp class="option">device_name</samp></dt>
  5009. <dt><samp class="option">device_vendor</samp></dt>
  5010. <dt><samp class="option">driver_version</samp></dt>
  5011. <dt><samp class="option">device_version</samp></dt>
  5012. <dt><samp class="option">device_profile</samp></dt>
  5013. <dt><samp class="option">device_extensions</samp></dt>
  5014. <dt><samp class="option">device_type</samp></dt>
  5015. </dl>
  5016. <p>The indices and filters must together uniquely select a device.
  5017. </p>
  5018. <p>Examples:
  5019. </p><dl class="table">
  5020. <dt><em class="emph">-init_hw_device opencl:0.1</em></dt>
  5021. <dd><p>Choose the second device on the first platform.
  5022. </p>
  5023. </dd>
  5024. <dt><em class="emph">-init_hw_device opencl:,device_name=Foo9000</em></dt>
  5025. <dd><p>Choose the device with a name containing the string <em class="emph">Foo9000</em>.
  5026. </p>
  5027. </dd>
  5028. <dt><em class="emph">-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16</em></dt>
  5029. <dd><p>Choose the GPU device on the second platform supporting the <em class="emph">cl_khr_fp16</em>
  5030. extension.
  5031. </p></dd>
  5032. </dl>
  5033. </dd>
  5034. <dt><samp class="option">vulkan</samp></dt>
  5035. <dd><p>If <var class="var">device</var> is an integer, it selects the device by its index in a
  5036. system-dependent list of devices. If <var class="var">device</var> is any other string, it
  5037. selects the first device with a name containing that string as a substring.
  5038. </p>
  5039. <p>The following options are recognized:
  5040. </p><dl class="table">
  5041. <dt><samp class="option">debug</samp></dt>
  5042. <dd><p>If set to 1, enables the validation layer, if installed.
  5043. </p></dd>
  5044. <dt><samp class="option">linear_images</samp></dt>
  5045. <dd><p>If set to 1, images allocated by the hwcontext will be linear and locally mappable.
  5046. </p></dd>
  5047. <dt><samp class="option">instance_extensions</samp></dt>
  5048. <dd><p>A plus separated list of additional instance extensions to enable.
  5049. </p></dd>
  5050. <dt><samp class="option">device_extensions</samp></dt>
  5051. <dd><p>A plus separated list of additional device extensions to enable.
  5052. </p></dd>
  5053. </dl>
  5054. <p>Examples:
  5055. </p><dl class="table">
  5056. <dt><em class="emph">-init_hw_device vulkan:1</em></dt>
  5057. <dd><p>Choose the second device on the system.
  5058. </p>
  5059. </dd>
  5060. <dt><em class="emph">-init_hw_device vulkan:RADV</em></dt>
  5061. <dd><p>Choose the first device with a name containing the string <em class="emph">RADV</em>.
  5062. </p>
  5063. </dd>
  5064. <dt><em class="emph">-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface</em></dt>
  5065. <dd><p>Choose the first device and enable the Wayland and XCB instance extensions.
  5066. </p></dd>
  5067. </dl>
  5068. </dd>
  5069. </dl>
  5070. </dd>
  5071. <dt><samp class="option">-init_hw_device <var class="var">type</var>[=<var class="var">name</var>]@<var class="var">source</var></samp></dt>
  5072. <dd><p>Initialise a new hardware device of type <var class="var">type</var> called <var class="var">name</var>,
  5073. deriving it from the existing device with the name <var class="var">source</var>.
  5074. </p>
  5075. </dd>
  5076. <dt><samp class="option">-init_hw_device list</samp></dt>
  5077. <dd><p>List all hardware device types supported in this build of ffmpeg.
  5078. </p>
  5079. </dd>
  5080. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  5081. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  5082. This can be used to set the device to upload to with the <code class="code">hwupload</code> filter,
  5083. or the device to map to with the <code class="code">hwmap</code> filter. Other filters may also
  5084. make use of this parameter when they require a hardware device. Note that this
  5085. is typically only required when the input is not already in hardware frames -
  5086. when it is, filters will derive the device they require from the context of the
  5087. frames they receive as input.
  5088. </p>
  5089. <p>This is a global setting, so all filters will receive the same device.
  5090. </p>
  5091. </dd>
  5092. <dt><samp class="option">-hwaccel[:<var class="var">stream_specifier</var>] <var class="var">hwaccel</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  5093. <dd><p>Use hardware acceleration to decode the matching stream(s). The allowed values
  5094. of <var class="var">hwaccel</var> are:
  5095. </p><dl class="table">
  5096. <dt><samp class="option">none</samp></dt>
  5097. <dd><p>Do not use any hardware acceleration (the default).
  5098. </p>
  5099. </dd>
  5100. <dt><samp class="option">auto</samp></dt>
  5101. <dd><p>Automatically select the hardware acceleration method.
  5102. </p>
  5103. </dd>
  5104. <dt><samp class="option">vdpau</samp></dt>
  5105. <dd><p>Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
  5106. </p>
  5107. </dd>
  5108. <dt><samp class="option">dxva2</samp></dt>
  5109. <dd><p>Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
  5110. </p>
  5111. </dd>
  5112. <dt><samp class="option">d3d11va</samp></dt>
  5113. <dd><p>Use D3D11VA (DirectX Video Acceleration) hardware acceleration.
  5114. </p>
  5115. </dd>
  5116. <dt><samp class="option">vaapi</samp></dt>
  5117. <dd><p>Use VAAPI (Video Acceleration API) hardware acceleration.
  5118. </p>
  5119. </dd>
  5120. <dt><samp class="option">qsv</samp></dt>
  5121. <dd><p>Use the Intel QuickSync Video acceleration for video transcoding.
  5122. </p>
  5123. <p>Unlike most other values, this option does not enable accelerated decoding (that
  5124. is used automatically whenever a qsv decoder is selected), but accelerated
  5125. transcoding, without copying the frames into the system memory.
  5126. </p>
  5127. <p>For it to work, both the decoder and the encoder must support QSV acceleration
  5128. and no filters must be used.
  5129. </p>
  5130. </dd>
  5131. <dt><samp class="option">videotoolbox</samp></dt>
  5132. <dd><p>Use Video Toolbox hardware acceleration.
  5133. </p></dd>
  5134. </dl>
  5135. <p>This option has no effect if the selected hwaccel is not available or not
  5136. supported by the chosen decoder.
  5137. </p>
  5138. <p>Note that most acceleration methods are intended for playback and will not be
  5139. faster than software decoding on modern CPUs. Additionally, <code class="command">ffmpeg</code>
  5140. will usually need to copy the decoded frames from the GPU memory into the system
  5141. memory, resulting in further performance loss. This option is thus mainly
  5142. useful for testing.
  5143. </p>
  5144. </dd>
  5145. <dt><samp class="option">-hwaccel_device[:<var class="var">stream_specifier</var>] <var class="var">hwaccel_device</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  5146. <dd><p>Select a device to use for hardware acceleration.
  5147. </p>
  5148. <p>This option only makes sense when the <samp class="option">-hwaccel</samp> option is also specified.
  5149. It can either refer to an existing device created with <samp class="option">-init_hw_device</samp>
  5150. by name, or it can create a new device as if
  5151. &lsquo;<samp class="samp">-init_hw_device</samp>&rsquo; <var class="var">type</var>:<var class="var">hwaccel_device</var>
  5152. were called immediately before.
  5153. </p>
  5154. </dd>
  5155. <dt><samp class="option">-hwaccels</samp></dt>
  5156. <dd><p>List all hardware acceleration components enabled in this build of ffmpeg.
  5157. Actual runtime availability depends on the hardware and its suitable driver
  5158. being installed.
  5159. </p>
  5160. </dd>
  5161. <dt><samp class="option">-fix_sub_duration_heartbeat[:<var class="var">stream_specifier</var>]</samp></dt>
  5162. <dd><p>Set a specific output video stream as the heartbeat stream according to which
  5163. to split and push through currently in-progress subtitle upon receipt of a
  5164. random access packet.
  5165. </p>
  5166. <p>This lowers the latency of subtitles for which the end packet or the following
  5167. subtitle has not yet been received. As a drawback, this will most likely lead
  5168. to duplication of subtitle events in order to cover the full duration, so
  5169. when dealing with use cases where latency of when the subtitle event is passed
  5170. on to output is not relevant this option should not be utilized.
  5171. </p>
  5172. <p>Requires <samp class="option">-fix_sub_duration</samp> to be set for the relevant input subtitle
  5173. stream for this to have any effect, as well as for the input subtitle stream
  5174. having to be directly mapped to the same output in which the heartbeat stream
  5175. resides.
  5176. </p>
  5177. </dd>
  5178. </dl>
  5179. <a name="Audio-Options"></a>
  5180. <h3 class="section">5.7 Audio Options<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Options" aria-hidden="true">TOC</a></span></h3>
  5181. <dl class="table">
  5182. <dt><samp class="option">-aframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  5183. <dd><p>Set the number of audio frames to output. This is an obsolete alias for
  5184. <code class="code">-frames:a</code>, which you should use instead.
  5185. </p></dd>
  5186. <dt><samp class="option">-ar[:<var class="var">stream_specifier</var>] <var class="var">freq</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  5187. <dd><p>Set the audio sampling frequency. For output streams it is set by
  5188. default to the frequency of the corresponding input stream. For input
  5189. streams this option only makes sense for audio grabbing devices and raw
  5190. demuxers and is mapped to the corresponding demuxer options.
  5191. </p></dd>
  5192. <dt><samp class="option">-aq <var class="var">q</var> (<em class="emph">output</em>)</samp></dt>
  5193. <dd><p>Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
  5194. </p></dd>
  5195. <dt><samp class="option">-ac[:<var class="var">stream_specifier</var>] <var class="var">channels</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  5196. <dd><p>Set the number of audio channels. For output streams it is set by
  5197. default to the number of input audio channels. For input streams
  5198. this option only makes sense for audio grabbing devices and raw demuxers
  5199. and is mapped to the corresponding demuxer options.
  5200. </p></dd>
  5201. <dt><samp class="option">-an (<em class="emph">input/output</em>)</samp></dt>
  5202. <dd><p>As an input option, blocks all audio streams of a file from being filtered or
  5203. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  5204. option to disable streams individually.
  5205. </p>
  5206. <p>As an output option, disables audio recording i.e. automatic selection or
  5207. mapping of any audio stream. For full manual control see the <code class="code">-map</code>
  5208. option.
  5209. </p></dd>
  5210. <dt><samp class="option">-acodec <var class="var">codec</var> (<em class="emph">input/output</em>)</samp></dt>
  5211. <dd><p>Set the audio codec. This is an alias for <code class="code">-codec:a</code>.
  5212. </p></dd>
  5213. <dt><samp class="option">-sample_fmt[:<var class="var">stream_specifier</var>] <var class="var">sample_fmt</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5214. <dd><p>Set the audio sample format. Use <code class="code">-sample_fmts</code> to get a list
  5215. of supported sample formats.
  5216. </p>
  5217. </dd>
  5218. <dt><samp class="option">-af <var class="var">filtergraph</var> (<em class="emph">output</em>)</samp></dt>
  5219. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  5220. filter the stream.
  5221. </p>
  5222. <p>This is an alias for <code class="code">-filter:a</code>, see the <a class="ref" href="#filter_005foption">-filter option</a>.
  5223. </p></dd>
  5224. </dl>
  5225. <a name="Advanced-Audio-options"></a>
  5226. <h3 class="section">5.8 Advanced Audio options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-Audio-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-Audio-options" aria-hidden="true">TOC</a></span></h3>
  5227. <dl class="table">
  5228. <dt><samp class="option">-atag <var class="var">fourcc/tag</var> (<em class="emph">output</em>)</samp></dt>
  5229. <dd><p>Force audio tag/fourcc. This is an alias for <code class="code">-tag:a</code>.
  5230. </p></dd>
  5231. <dt><samp class="option">-ch_layout[:<var class="var">stream_specifier</var>] <var class="var">layout</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  5232. <dd><p>Alias for <code class="code">-channel_layout</code>.
  5233. </p></dd>
  5234. <dt><samp class="option">-channel_layout[:<var class="var">stream_specifier</var>] <var class="var">layout</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  5235. <dd><p>Set the audio channel layout. For output streams it is set by default to the
  5236. input channel layout. For input streams it overrides the channel layout of the
  5237. input. Not all decoders respect the overridden channel layout. This option
  5238. also sets the channel layout for audio grabbing devices and raw demuxers
  5239. and is mapped to the corresponding demuxer option.
  5240. </p></dd>
  5241. <dt><samp class="option">-guess_layout_max <var class="var">channels</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  5242. <dd><p>If some input channel layout is not known, try to guess only if it
  5243. corresponds to at most the specified number of channels. For example, 2
  5244. tells to <code class="command">ffmpeg</code> to recognize 1 channel as mono and 2 channels as
  5245. stereo but not 6 channels as 5.1. The default is to always try to guess. Use
  5246. 0 to disable all guessing. Using the <code class="code">-channel_layout</code> option to
  5247. explicitly specify an input layout also disables guessing.
  5248. </p></dd>
  5249. </dl>
  5250. <a name="Subtitle-options"></a>
  5251. <h3 class="section">5.9 Subtitle options<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitle-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitle-options" aria-hidden="true">TOC</a></span></h3>
  5252. <dl class="table">
  5253. <dt><samp class="option">-scodec <var class="var">codec</var> (<em class="emph">input/output</em>)</samp></dt>
  5254. <dd><p>Set the subtitle codec. This is an alias for <code class="code">-codec:s</code>.
  5255. </p></dd>
  5256. <dt><samp class="option">-sn (<em class="emph">input/output</em>)</samp></dt>
  5257. <dd><p>As an input option, blocks all subtitle streams of a file from being filtered or
  5258. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  5259. option to disable streams individually.
  5260. </p>
  5261. <p>As an output option, disables subtitle recording i.e. automatic selection or
  5262. mapping of any subtitle stream. For full manual control see the <code class="code">-map</code>
  5263. option.
  5264. </p></dd>
  5265. </dl>
  5266. <a name="Advanced-Subtitle-options"></a>
  5267. <h3 class="section">5.10 Advanced Subtitle options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-Subtitle-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-Subtitle-options" aria-hidden="true">TOC</a></span></h3>
  5268. <dl class="table">
  5269. <dt><samp class="option">-fix_sub_duration</samp></dt>
  5270. <dd><p>Fix subtitles durations. For each subtitle, wait for the next packet in the
  5271. same stream and adjust the duration of the first to avoid overlap. This is
  5272. necessary with some subtitles codecs, especially DVB subtitles, because the
  5273. duration in the original packet is only a rough estimate and the end is
  5274. actually marked by an empty subtitle frame. Failing to use this option when
  5275. necessary can result in exaggerated durations or muxing failures due to
  5276. non-monotonic timestamps.
  5277. </p>
  5278. <p>Note that this option will delay the output of all data until the next
  5279. subtitle packet is decoded: it may increase memory consumption and latency a
  5280. lot.
  5281. </p>
  5282. </dd>
  5283. <dt><samp class="option">-canvas_size <var class="var">size</var></samp></dt>
  5284. <dd><p>Set the size of the canvas used to render subtitles.
  5285. </p>
  5286. </dd>
  5287. </dl>
  5288. <a name="Advanced-options"></a>
  5289. <h3 class="section">5.11 Advanced options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-options" aria-hidden="true">TOC</a></span></h3>
  5290. <dl class="table">
  5291. <dt><samp class="option">-map [-]<var class="var">input_file_id</var>[:<var class="var">stream_specifier</var>][:<var class="var">view_specifier</var>][:?] | <var class="var">[linklabel]</var> (<em class="emph">output</em>)</samp></dt>
  5292. <dd>
  5293. <p>Create one or more streams in the output file. This option has two forms for
  5294. specifying the data source(s): the first selects one or more streams from some
  5295. input file (specified with <code class="code">-i</code>), the second takes an output from some
  5296. complex filtergraph (specified with <code class="code">-filter_complex</code>).
  5297. </p>
  5298. <p>In the first form, an output stream is created for every stream from the input
  5299. file with the index <var class="var">input_file_id</var>. If <var class="var">stream_specifier</var> is given,
  5300. only those streams that match the specifier are used (see the
  5301. <a class="ref" href="#Stream-specifiers">Stream specifiers</a> section for the <var class="var">stream_specifier</var> syntax).
  5302. </p>
  5303. <p>A <code class="code">-</code> character before the stream identifier creates a &quot;negative&quot; mapping.
  5304. It disables matching streams from already created mappings.
  5305. </p>
  5306. <p>An optional <var class="var">view_specifier</var> may be given after the stream specifier, which
  5307. for multiview video specifies the view to be used. The view specifier may have
  5308. one of the following formats:
  5309. </p><dl class="table">
  5310. <dt><samp class="option">view:<var class="var">view_id</var></samp></dt>
  5311. <dd><p>select a view by its ID; <var class="var">view_id</var> may be set to &rsquo;all&rsquo; to use all the views
  5312. interleaved into one stream;
  5313. </p>
  5314. </dd>
  5315. <dt><samp class="option">vidx:<var class="var">view_idx</var></samp></dt>
  5316. <dd><p>select a view by its index; i.e. 0 is the base view, 1 is the first non-base
  5317. view, etc.
  5318. </p>
  5319. </dd>
  5320. <dt><samp class="option">vpos:<var class="var">position</var></samp></dt>
  5321. <dd><p>select a view by its display position; <var class="var">position</var> may be <code class="code">left</code> or
  5322. <code class="code">right</code>
  5323. </p></dd>
  5324. </dl>
  5325. <p>The default for transcoding is to only use the base view, i.e. the equivalent of
  5326. <code class="code">vidx:0</code>. For streamcopy, view specifiers are not supported and all views
  5327. are always copied.
  5328. </p>
  5329. <p>A trailing <code class="code">?</code> after the stream index will allow the map to be
  5330. optional: if the map matches no streams the map will be ignored instead
  5331. of failing. Note the map will still fail if an invalid input file index
  5332. is used; such as if the map refers to a non-existent input.
  5333. </p>
  5334. <p>An alternative <var class="var">[linklabel]</var> form will map outputs from complex filter
  5335. graphs (see the <samp class="option">-filter_complex</samp> option) to the output file.
  5336. <var class="var">linklabel</var> must correspond to a defined output link label in the graph.
  5337. </p>
  5338. <p>This option may be specified multiple times, each adding more streams to the
  5339. output file. Any given input stream may also be mapped any number of times as a
  5340. source for different output streams, e.g. in order to use different encoding
  5341. options and/or filters. The streams are created in the output in the same order
  5342. in which the <code class="code">-map</code> options are given on the commandline.
  5343. </p>
  5344. <p>Using this option disables the default mappings for this output file.
  5345. </p>
  5346. <p>Examples:
  5347. </p>
  5348. <dl class="table">
  5349. <dt><em class="emph">map everything</em></dt>
  5350. <dd><p>To map ALL streams from the first input file to output
  5351. </p><div class="example">
  5352. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 output
  5353. </pre></div>
  5354. </dd>
  5355. <dt><em class="emph">select specific stream</em></dt>
  5356. <dd><p>If you have two audio streams in the first input file, these streams are
  5357. identified by <var class="var">0:0</var> and <var class="var">0:1</var>. You can use <code class="code">-map</code> to select which
  5358. streams to place in an output file. For example:
  5359. </p><div class="example">
  5360. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:1 out.wav
  5361. </pre></div>
  5362. <p>will map the second input stream in <samp class="file">INPUT</samp> to the (single) output stream
  5363. in <samp class="file">out.wav</samp>.
  5364. </p>
  5365. </dd>
  5366. <dt><em class="emph">create multiple streams</em></dt>
  5367. <dd><p>To select the stream with index 2 from input file <samp class="file">a.mov</samp> (specified by the
  5368. identifier <var class="var">0:2</var>), and stream with index 6 from input <samp class="file">b.mov</samp>
  5369. (specified by the identifier <var class="var">1:6</var>), and copy them to the output file
  5370. <samp class="file">out.mov</samp>:
  5371. </p><div class="example">
  5372. <pre class="example-preformatted">ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
  5373. </pre></div>
  5374. </dd>
  5375. <dt><em class="emph">create multiple streams 2</em></dt>
  5376. <dd><p>To select all video and the third audio stream from an input file:
  5377. </p><div class="example">
  5378. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
  5379. </pre></div>
  5380. </dd>
  5381. <dt><em class="emph">negative map</em></dt>
  5382. <dd><p>To map all the streams except the second audio, use negative mappings
  5383. </p><div class="example">
  5384. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
  5385. </pre></div>
  5386. </dd>
  5387. <dt><em class="emph">optional map</em></dt>
  5388. <dd><p>To map the video and audio streams from the first input, and using the
  5389. trailing <code class="code">?</code>, ignore the audio mapping if no audio streams exist in
  5390. the first input:
  5391. </p><div class="example">
  5392. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
  5393. </pre></div>
  5394. </dd>
  5395. <dt><em class="emph">map by language</em></dt>
  5396. <dd><p>To pick the English audio stream:
  5397. </p><div class="example">
  5398. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
  5399. </pre></div>
  5400. </dd>
  5401. </dl>
  5402. </dd>
  5403. <dt><samp class="option">-ignore_unknown</samp></dt>
  5404. <dd><p>Ignore input streams with unknown type instead of failing if copying
  5405. such streams is attempted.
  5406. </p>
  5407. </dd>
  5408. <dt><samp class="option">-copy_unknown</samp></dt>
  5409. <dd><p>Allow input streams with unknown type to be copied instead of failing if copying
  5410. such streams is attempted.
  5411. </p>
  5412. </dd>
  5413. <dt><samp class="option">-map_metadata[:<var class="var">metadata_spec_out</var>] <var class="var">infile</var>[:<var class="var">metadata_spec_in</var>] (<em class="emph">output,per-metadata</em>)</samp></dt>
  5414. <dd><p>Set metadata information of the next output file from <var class="var">infile</var>. Note that
  5415. those are file indices (zero-based), not filenames.
  5416. Optional <var class="var">metadata_spec_in/out</var> parameters specify, which metadata to copy.
  5417. A metadata specifier can have the following forms:
  5418. </p><dl class="table">
  5419. <dt><samp class="option"><var class="var">g</var></samp></dt>
  5420. <dd><p>global metadata, i.e. metadata that applies to the whole file
  5421. </p>
  5422. </dd>
  5423. <dt><samp class="option"><var class="var">s</var>[:<var class="var">stream_spec</var>]</samp></dt>
  5424. <dd><p>per-stream metadata. <var class="var">stream_spec</var> is a stream specifier as described
  5425. in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. In an input metadata specifier, the first
  5426. matching stream is copied from. In an output metadata specifier, all matching
  5427. streams are copied to.
  5428. </p>
  5429. </dd>
  5430. <dt><samp class="option"><var class="var">c</var>:<var class="var">chapter_index</var></samp></dt>
  5431. <dd><p>per-chapter metadata. <var class="var">chapter_index</var> is the zero-based chapter index.
  5432. </p>
  5433. </dd>
  5434. <dt><samp class="option"><var class="var">p</var>:<var class="var">program_index</var></samp></dt>
  5435. <dd><p>per-program metadata. <var class="var">program_index</var> is the zero-based program index.
  5436. </p></dd>
  5437. </dl>
  5438. <p>If metadata specifier is omitted, it defaults to global.
  5439. </p>
  5440. <p>By default, global metadata is copied from the first input file,
  5441. per-stream and per-chapter metadata is copied along with streams/chapters. These
  5442. default mappings are disabled by creating any mapping of the relevant type. A negative
  5443. file index can be used to create a dummy mapping that just disables automatic copying.
  5444. </p>
  5445. <p>For example to copy metadata from the first stream of the input file to global metadata
  5446. of the output file:
  5447. </p><div class="example">
  5448. <pre class="example-preformatted">ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
  5449. </pre></div>
  5450. <p>To do the reverse, i.e. copy global metadata to all audio streams:
  5451. </p><div class="example">
  5452. <pre class="example-preformatted">ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
  5453. </pre></div>
  5454. <p>Note that simple <code class="code">0</code> would work as well in this example, since global
  5455. metadata is assumed by default.
  5456. </p>
  5457. </dd>
  5458. <dt><samp class="option">-map_chapters <var class="var">input_file_index</var> (<em class="emph">output</em>)</samp></dt>
  5459. <dd><p>Copy chapters from input file with index <var class="var">input_file_index</var> to the next
  5460. output file. If no chapter mapping is specified, then chapters are copied from
  5461. the first input file with at least one chapter. Use a negative file index to
  5462. disable any chapter copying.
  5463. </p>
  5464. </dd>
  5465. <dt><samp class="option">-benchmark (<em class="emph">global</em>)</samp></dt>
  5466. <dd><p>Show benchmarking information at the end of an encode.
  5467. Shows real, system and user time used and maximum memory consumption.
  5468. Maximum memory consumption is not supported on all systems,
  5469. it will usually display as 0 if not supported.
  5470. </p></dd>
  5471. <dt><samp class="option">-benchmark_all (<em class="emph">global</em>)</samp></dt>
  5472. <dd><p>Show benchmarking information during the encode.
  5473. Shows real, system and user time used in various steps (audio/video encode/decode).
  5474. </p></dd>
  5475. <dt><samp class="option">-timelimit <var class="var">duration</var> (<em class="emph">global</em>)</samp></dt>
  5476. <dd><p>Exit after ffmpeg has been running for <var class="var">duration</var> seconds in CPU user time.
  5477. </p></dd>
  5478. <dt><samp class="option">-dump (<em class="emph">global</em>)</samp></dt>
  5479. <dd><p>Dump each input packet to stderr.
  5480. </p></dd>
  5481. <dt><samp class="option">-hex (<em class="emph">global</em>)</samp></dt>
  5482. <dd><p>When dumping packets, also dump the payload.
  5483. </p></dd>
  5484. <dt><samp class="option">-readrate <var class="var">speed</var> (<em class="emph">input</em>)</samp></dt>
  5485. <dd><p>Limit input read speed.
  5486. </p>
  5487. <p>Its value is a floating-point positive number which represents the maximum duration of
  5488. media, in seconds, that should be ingested in one second of wallclock time.
  5489. Default value is zero and represents no imposed limitation on speed of ingestion.
  5490. Value <code class="code">1</code> represents real-time speed and is equivalent to <code class="code">-re</code>.
  5491. </p>
  5492. <p>Mainly used to simulate a capture device or live input stream (e.g. when reading from a file).
  5493. Should not be used with a low value when input is an actual capture device or live stream as
  5494. it may cause packet loss.
  5495. </p>
  5496. <p>It is useful for when flow speed of output packets is important, such as live streaming.
  5497. </p></dd>
  5498. <dt><samp class="option">-re (<em class="emph">input</em>)</samp></dt>
  5499. <dd><p>Read input at native frame rate. This is equivalent to setting <code class="code">-readrate 1</code>.
  5500. </p></dd>
  5501. <dt><samp class="option">-readrate_initial_burst <var class="var">seconds</var></samp></dt>
  5502. <dd><p>Set an initial read burst time, in seconds, after which <samp class="option">-re/-readrate</samp>
  5503. will be enforced.
  5504. </p></dd>
  5505. <dt><samp class="option">-readrate_catchup <var class="var">speed</var> (<em class="emph">input</em>)</samp></dt>
  5506. <dd><p>If either the input or output is blocked leading to actual read speed falling behind the
  5507. specified readrate, then this rate takes effect till the input catches up with the
  5508. specified readrate. Must not be lower than the primary readrate.
  5509. </p>
  5510. </dd>
  5511. <dt><samp class="option">-vsync <var class="var">parameter</var> (<em class="emph">global</em>)</samp></dt>
  5512. <dt><samp class="option">-fps_mode[:<var class="var">stream_specifier</var>] <var class="var">parameter</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5513. <dd><p>Set video sync method / framerate mode. vsync is applied to all output video streams
  5514. but can be overridden for a stream by setting fps_mode. vsync is deprecated and will be
  5515. removed in the future.
  5516. </p>
  5517. <p>For compatibility reasons some of the values for vsync can be specified as numbers (shown
  5518. in parentheses in the following table).
  5519. </p>
  5520. <dl class="table">
  5521. <dt><samp class="option">passthrough (0)</samp></dt>
  5522. <dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
  5523. </p></dd>
  5524. <dt><samp class="option">cfr (1)</samp></dt>
  5525. <dd><p>Frames will be duplicated and dropped to achieve exactly the requested
  5526. constant frame rate.
  5527. </p></dd>
  5528. <dt><samp class="option">vfr (2)</samp></dt>
  5529. <dd><p>Frames are passed through with their timestamp or dropped so as to
  5530. prevent 2 frames from having the same timestamp.
  5531. </p></dd>
  5532. <dt><samp class="option">auto (-1)</samp></dt>
  5533. <dd><p>Chooses between cfr and vfr depending on muxer capabilities. This is the
  5534. default method.
  5535. </p></dd>
  5536. </dl>
  5537. <p>Note that the timestamps may be further modified by the muxer, after this.
  5538. For example, in the case that the format option <samp class="option">avoid_negative_ts</samp>
  5539. is enabled.
  5540. </p>
  5541. <p>With -map you can select from which stream the timestamps should be
  5542. taken. You can leave either video or audio unchanged and sync the
  5543. remaining stream(s) to the unchanged one.
  5544. </p>
  5545. </dd>
  5546. <dt><samp class="option">-frame_drop_threshold <var class="var">parameter</var></samp></dt>
  5547. <dd><p>Frame drop threshold, which specifies how much behind video frames can
  5548. be before they are dropped. In frame rate units, so 1.0 is one frame.
  5549. The default is -1.1. One possible usecase is to avoid framedrops in case
  5550. of noisy timestamps or to increase frame drop precision in case of exact
  5551. timestamps.
  5552. </p>
  5553. </dd>
  5554. <dt><samp class="option">-apad <var class="var">parameters</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5555. <dd><p>Pad the output audio stream(s). This is the same as applying <code class="code">-af apad</code>.
  5556. Argument is a string of filter parameters composed the same as with the <code class="code">apad</code> filter.
  5557. <code class="code">-shortest</code> must be set for this output for the option to take effect.
  5558. </p>
  5559. </dd>
  5560. <dt><samp class="option">-copyts</samp></dt>
  5561. <dd><p>Do not process input timestamps, but keep their values without trying
  5562. to sanitize them. In particular, do not remove the initial start time
  5563. offset value.
  5564. </p>
  5565. <p>Note that, depending on the <samp class="option">vsync</samp> option or on specific muxer
  5566. processing (e.g. in case the format option <samp class="option">avoid_negative_ts</samp>
  5567. is enabled) the output timestamps may mismatch with the input
  5568. timestamps even when this option is selected.
  5569. </p>
  5570. </dd>
  5571. <dt><samp class="option">-start_at_zero</samp></dt>
  5572. <dd><p>When used with <samp class="option">copyts</samp>, shift input timestamps so they start at zero.
  5573. </p>
  5574. <p>This means that using e.g. <code class="code">-ss 50</code> will make output timestamps start at
  5575. 50 seconds, regardless of what timestamp the input file started at.
  5576. </p>
  5577. </dd>
  5578. <dt><samp class="option">-copytb <var class="var">mode</var></samp></dt>
  5579. <dd><p>Specify how to set the encoder timebase when stream copying. <var class="var">mode</var> is an
  5580. integer numeric value, and can assume one of the following values:
  5581. </p>
  5582. <dl class="table">
  5583. <dt><samp class="option">1</samp></dt>
  5584. <dd><p>Use the demuxer timebase.
  5585. </p>
  5586. <p>The time base is copied to the output encoder from the corresponding input
  5587. demuxer. This is sometimes required to avoid non monotonically increasing
  5588. timestamps when copying video streams with variable frame rate.
  5589. </p>
  5590. </dd>
  5591. <dt><samp class="option">0</samp></dt>
  5592. <dd><p>Use the decoder timebase.
  5593. </p>
  5594. <p>The time base is copied to the output encoder from the corresponding input
  5595. decoder.
  5596. </p>
  5597. </dd>
  5598. <dt><samp class="option">-1</samp></dt>
  5599. <dd><p>Try to make the choice automatically, in order to generate a sane output.
  5600. </p></dd>
  5601. </dl>
  5602. <p>Default value is -1.
  5603. </p>
  5604. </dd>
  5605. <dt><samp class="option">-enc_time_base[:<var class="var">stream_specifier</var>] <var class="var">timebase</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5606. <dd><p>Set the encoder timebase. <var class="var">timebase</var> can assume one of the following values:
  5607. </p>
  5608. <dl class="table">
  5609. <dt><samp class="option">0</samp></dt>
  5610. <dd><p>Assign a default value according to the media type.
  5611. </p>
  5612. <p>For video - use 1/framerate, for audio - use 1/samplerate.
  5613. </p>
  5614. </dd>
  5615. <dt><samp class="option">demux</samp></dt>
  5616. <dd><p>Use the timebase from the demuxer.
  5617. </p>
  5618. </dd>
  5619. <dt><samp class="option">filter</samp></dt>
  5620. <dd><p>Use the timebase from the filtergraph.
  5621. </p>
  5622. </dd>
  5623. <dt><samp class="option">a positive number</samp></dt>
  5624. <dd><p>Use the provided number as the timebase.
  5625. </p>
  5626. <p>This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000)
  5627. or as a decimal number (e.g. 0.04166, 2.0833e-5)
  5628. </p></dd>
  5629. </dl>
  5630. <p>Default value is 0.
  5631. </p>
  5632. </dd>
  5633. <dt><samp class="option">-bitexact (<em class="emph">input/output</em>)</samp></dt>
  5634. <dd><p>Enable bitexact mode for (de)muxer and (de/en)coder
  5635. </p></dd>
  5636. <dt><samp class="option">-shortest (<em class="emph">output</em>)</samp></dt>
  5637. <dd><p>Finish encoding when the shortest output stream ends.
  5638. </p>
  5639. <p>Note that this option may require buffering frames, which introduces extra
  5640. latency. The maximum amount of this latency may be controlled with the
  5641. <code class="code">-shortest_buf_duration</code> option.
  5642. </p>
  5643. </dd>
  5644. <dt><samp class="option">-shortest_buf_duration <var class="var">duration</var> (<em class="emph">output</em>)</samp></dt>
  5645. <dd><p>The <code class="code">-shortest</code> option may require buffering potentially large amounts
  5646. of data when at least one of the streams is &quot;sparse&quot; (i.e. has large gaps
  5647. between frames – this is typically the case for subtitles).
  5648. </p>
  5649. <p>This option controls the maximum duration of buffered frames in seconds.
  5650. Larger values may allow the <code class="code">-shortest</code> option to produce more accurate
  5651. results, but increase memory use and latency.
  5652. </p>
  5653. <p>The default value is 10 seconds.
  5654. </p>
  5655. </dd>
  5656. <dt><samp class="option">-dts_delta_threshold <var class="var">threshold</var></samp></dt>
  5657. <dd><p>Timestamp discontinuity delta threshold, expressed as a decimal number
  5658. of seconds.
  5659. </p>
  5660. <p>The timestamp discontinuity correction enabled by this option is only
  5661. applied to input formats accepting timestamp discontinuity (for which
  5662. the <code class="code">AVFMT_TS_DISCONT</code> flag is enabled), e.g. MPEG-TS and HLS, and
  5663. is automatically disabled when employing the <code class="code">-copyts</code> option
  5664. (unless wrapping is detected).
  5665. </p>
  5666. <p>If a timestamp discontinuity is detected whose absolute value is
  5667. greater than <var class="var">threshold</var>, ffmpeg will remove the discontinuity by
  5668. decreasing/increasing the current DTS and PTS by the corresponding
  5669. delta value.
  5670. </p>
  5671. <p>The default value is 10.
  5672. </p>
  5673. </dd>
  5674. <dt><samp class="option">-dts_error_threshold <var class="var">threshold</var></samp></dt>
  5675. <dd><p>Timestamp error delta threshold, expressed as a decimal number of
  5676. seconds.
  5677. </p>
  5678. <p>The timestamp correction enabled by this option is only applied to
  5679. input formats not accepting timestamp discontinuity (for which the
  5680. <code class="code">AVFMT_TS_DISCONT</code> flag is not enabled).
  5681. </p>
  5682. <p>If a timestamp discontinuity is detected whose absolute value is
  5683. greater than <var class="var">threshold</var>, ffmpeg will drop the PTS/DTS timestamp
  5684. value.
  5685. </p>
  5686. <p>The default value is <code class="code">3600*30</code> (30 hours), which is arbitrarily
  5687. picked and quite conservative.
  5688. </p>
  5689. </dd>
  5690. <dt><samp class="option">-muxdelay <var class="var">seconds</var> (<em class="emph">output</em>)</samp></dt>
  5691. <dd><p>Set the maximum demux-decode delay.
  5692. </p></dd>
  5693. <dt><samp class="option">-muxpreload <var class="var">seconds</var> (<em class="emph">output</em>)</samp></dt>
  5694. <dd><p>Set the initial demux-decode delay.
  5695. </p></dd>
  5696. <dt><samp class="option">-streamid <var class="var">output-stream-index</var>:<var class="var">new-value</var> (<em class="emph">output</em>)</samp></dt>
  5697. <dd><p>Assign a new stream-id value to an output stream. This option should be
  5698. specified prior to the output filename to which it applies.
  5699. For the situation where multiple output files exist, a streamid
  5700. may be reassigned to a different value.
  5701. </p>
  5702. <p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
  5703. an output mpegts file:
  5704. </p><div class="example">
  5705. <pre class="example-preformatted">ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
  5706. </pre></div>
  5707. </dd>
  5708. <dt><samp class="option">-bsf[:<var class="var">stream_specifier</var>] <var class="var">bitstream_filters</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  5709. <dd><p>Apply bitstream filters to matching streams. The filters are applied to each
  5710. packet as it is received from the demuxer (when used as an input option) or
  5711. before it is sent to the muxer (when used as an output option).
  5712. </p>
  5713. <p><var class="var">bitstream_filters</var> is a comma-separated list of bitstream filter
  5714. specifications, each of the form
  5715. </p><div class="example">
  5716. <pre class="example-preformatted"><var class="var">filter</var>[=<var class="var">optname0</var>=<var class="var">optval0</var>:<var class="var">optname1</var>=<var class="var">optval1</var>:...]
  5717. </pre></div>
  5718. <p>Any of the &rsquo;,=:&rsquo; characters that are to be a part of an option value need to be
  5719. escaped with a backslash.
  5720. </p>
  5721. <p>Use the <code class="code">-bsfs</code> option to get the list of bitstream filters.
  5722. </p>
  5723. <p>E.g.
  5724. </p><div class="example">
  5725. <pre class="example-preformatted">ffmpeg -bsf:v h264_mp4toannexb -i h264.mp4 -c:v copy -an out.h264
  5726. </pre></div>
  5727. <p>applies the <code class="code">h264_mp4toannexb</code> bitstream filter (which converts
  5728. MP4-encapsulated H.264 stream to Annex B) to the <em class="emph">input</em> video stream.
  5729. </p>
  5730. <p>On the other hand,
  5731. </p><div class="example">
  5732. <pre class="example-preformatted">ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
  5733. </pre></div>
  5734. <p>applies the <code class="code">mov2textsub</code> bitstream filter (which extracts text from MOV
  5735. subtitles) to the <em class="emph">output</em> subtitle stream. Note, however, that since both
  5736. examples use <code class="code">-c copy</code>, it matters little whether the filters are applied
  5737. on input or output - that would change if transcoding was happening.
  5738. </p>
  5739. </dd>
  5740. <dt><samp class="option">-tag[:<var class="var">stream_specifier</var>] <var class="var">codec_tag</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  5741. <dd><p>Force a tag/fourcc for matching streams.
  5742. </p>
  5743. </dd>
  5744. <dt><samp class="option">-timecode <var class="var">hh</var>:<var class="var">mm</var>:<var class="var">ss</var>SEP<var class="var">ff</var></samp></dt>
  5745. <dd><p>Specify Timecode for writing. <var class="var">SEP</var> is &rsquo;:&rsquo; for non drop timecode and &rsquo;;&rsquo;
  5746. (or &rsquo;.&rsquo;) for drop.
  5747. </p><div class="example">
  5748. <pre class="example-preformatted">ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
  5749. </pre></div>
  5750. <a class="anchor" id="filter_005fcomplex_005foption"></a></dd>
  5751. <dt><samp class="option">-filter_complex <var class="var">filtergraph</var> (<em class="emph">global</em>)</samp></dt>
  5752. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  5753. outputs. For simple graphs &ndash; those with one input and one output of the same
  5754. type &ndash; see the <samp class="option">-filter</samp> options. <var class="var">filtergraph</var> is a description of
  5755. the filtergraph, as described in the &ldquo;Filtergraph syntax&rdquo; section of the
  5756. ffmpeg-filters manual. This option may be specified multiple times - each use
  5757. creates a new complex filtergraph.
  5758. </p>
  5759. <p>Inputs to a complex filtergraph may come from different source types,
  5760. distinguished by the format of the corresponding link label:
  5761. </p><ul class="itemize mark-bullet">
  5762. <li>To connect an input stream, use <code class="code">[file_index:stream_specifier]</code> (i.e. the
  5763. same syntax as <samp class="option">-map</samp>). If <var class="var">stream_specifier</var> matches multiple
  5764. streams, the first one will be used. For multiview video, the stream specifier
  5765. may be followed by the view specifier, see documentation for the <samp class="option">-map</samp>
  5766. option for its syntax.
  5767. </li><li>To connect a loopback decoder use [dec:<var class="var">dec_idx</var>], where <var class="var">dec_idx</var> is
  5768. the index of the loopback decoder to be connected to given input. For multiview
  5769. video, the decoder index may be followed by the view specifier, see
  5770. documentation for the <samp class="option">-map</samp> option for its syntax.
  5771. </li><li>To connect an output from another complex filtergraph, use its link label. E.g
  5772. the following example:
  5773. <div class="example">
  5774. <pre class="example-preformatted">ffmpeg -i input.mkv \
  5775. -filter_complex '[0:v]scale=size=hd1080,split=outputs=2[for_enc][orig_scaled]' \
  5776. -c:v libx264 -map '[for_enc]' output.mkv \
  5777. -dec 0:0 \
  5778. -filter_complex '[dec:0][orig_scaled]hstack[stacked]' \
  5779. -map '[stacked]' -c:v ffv1 comparison.mkv
  5780. </pre></div>
  5781. <p>reads an input video and
  5782. </p><ul class="itemize mark-bullet">
  5783. <li>(line 2) uses a complex filtergraph with one input and two outputs
  5784. to scale the video to 1920x1080 and duplicate the result to both
  5785. outputs;
  5786. </li><li>(line 3) encodes one scaled output with <code class="code">libx264</code> and writes the result to
  5787. <samp class="file">output.mkv</samp>;
  5788. </li><li>(line 4) decodes this encoded stream with a loopback decoder;
  5789. </li><li>(line 5) places the output of the loopback decoder (i.e. the
  5790. <code class="code">libx264</code>-encoded video) side by side with the scaled original input;
  5791. </li><li>(line 6) combined video is then losslessly encoded and written into
  5792. <samp class="file">comparison.mkv</samp>.
  5793. </li></ul>
  5794. <p>Note that the two filtergraphs cannot be combined into one, because then there
  5795. would be a cycle in the transcoding pipeline (filtergraph output goes to
  5796. encoding, from there to decoding, then back to the same graph), and such cycles
  5797. are not allowed.
  5798. </p>
  5799. </li></ul>
  5800. <p>An unlabeled input will be connected to the first unused input stream of the
  5801. matching type.
  5802. </p>
  5803. <p>Output link labels are referred to with <samp class="option">-map</samp>. Unlabeled outputs are
  5804. added to the first output file.
  5805. </p>
  5806. <p>Note that with this option it is possible to use only lavfi sources without
  5807. normal input files.
  5808. </p>
  5809. <p>For example, to overlay an image over video
  5810. </p><div class="example">
  5811. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
  5812. '[out]' out.mkv
  5813. </pre></div>
  5814. <p>Here <code class="code">[0:v]</code> refers to the first video stream in the first input file,
  5815. which is linked to the first (main) input of the overlay filter. Similarly the
  5816. first video stream in the second input is linked to the second (overlay) input
  5817. of overlay.
  5818. </p>
  5819. <p>Assuming there is only one video stream in each input file, we can omit input
  5820. labels, so the above is equivalent to
  5821. </p><div class="example">
  5822. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
  5823. '[out]' out.mkv
  5824. </pre></div>
  5825. <p>Furthermore we can omit the output label and the single output from the filter
  5826. graph will be added to the output file automatically, so we can simply write
  5827. </p><div class="example">
  5828. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
  5829. </pre></div>
  5830. <p>As a special exception, you can use a bitmap subtitle stream as input: it
  5831. will be converted into a video with the same size as the largest video in
  5832. the file, or 720x576 if no video is present. Note that this is an
  5833. experimental and temporary solution. It will be removed once libavfilter has
  5834. proper support for subtitles.
  5835. </p>
  5836. <p>For example, to hardcode subtitles on top of a DVB-T recording stored in
  5837. MPEG-TS format, delaying the subtitles by 1 second:
  5838. </p><div class="example">
  5839. <pre class="example-preformatted">ffmpeg -i input.ts -filter_complex \
  5840. '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
  5841. -sn -map '#0x2dc' output.mkv
  5842. </pre></div>
  5843. <p>(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
  5844. audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
  5845. </p>
  5846. <p>To generate 5 seconds of pure red video using lavfi <code class="code">color</code> source:
  5847. </p><div class="example">
  5848. <pre class="example-preformatted">ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
  5849. </pre></div>
  5850. </dd>
  5851. <dt><samp class="option">-filter_complex_threads <var class="var">nb_threads</var> (<em class="emph">global</em>)</samp></dt>
  5852. <dd><p>Defines how many threads are used to process a filter_complex graph.
  5853. Similar to filter_threads but used for <code class="code">-filter_complex</code> graphs only.
  5854. The default is the number of available CPUs.
  5855. </p>
  5856. </dd>
  5857. <dt><samp class="option">-lavfi <var class="var">filtergraph</var> (<em class="emph">global</em>)</samp></dt>
  5858. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  5859. outputs. Equivalent to <samp class="option">-filter_complex</samp>.
  5860. </p>
  5861. </dd>
  5862. <dt><samp class="option">-accurate_seek (<em class="emph">input</em>)</samp></dt>
  5863. <dd><p>This option enables or disables accurate seeking in input files with the
  5864. <samp class="option">-ss</samp> option. It is enabled by default, so seeking is accurate when
  5865. transcoding. Use <samp class="option">-noaccurate_seek</samp> to disable it, which may be useful
  5866. e.g. when copying some streams and transcoding the others.
  5867. </p>
  5868. </dd>
  5869. <dt><samp class="option">-seek_timestamp (<em class="emph">input</em>)</samp></dt>
  5870. <dd><p>This option enables or disables seeking by timestamp in input files with the
  5871. <samp class="option">-ss</samp> option. It is disabled by default. If enabled, the argument
  5872. to the <samp class="option">-ss</samp> option is considered an actual timestamp, and is not
  5873. offset by the start time of the file. This matters only for files which do
  5874. not start from timestamp 0, such as transport streams.
  5875. </p>
  5876. </dd>
  5877. <dt><samp class="option">-thread_queue_size <var class="var">size</var> (<em class="emph">input/output</em>)</samp></dt>
  5878. <dd><p>For input, this option sets the maximum number of queued packets when reading
  5879. from the file or device. With low latency / high rate live streams, packets may
  5880. be discarded if they are not read in a timely manner; setting this value can
  5881. force ffmpeg to use a separate input thread and read packets as soon as they
  5882. arrive. By default ffmpeg only does this if multiple inputs are specified.
  5883. </p>
  5884. <p>For output, this option specified the maximum number of packets that may be
  5885. queued to each muxing thread.
  5886. </p>
  5887. </dd>
  5888. <dt><samp class="option">-sdp_file <var class="var">file</var> (<em class="emph">global</em>)</samp></dt>
  5889. <dd><p>Print sdp information for an output stream to <var class="var">file</var>.
  5890. This allows dumping sdp information when at least one output isn&rsquo;t an
  5891. rtp stream. (Requires at least one of the output formats to be rtp).
  5892. </p>
  5893. </dd>
  5894. <dt><samp class="option">-discard (<em class="emph">input</em>)</samp></dt>
  5895. <dd><p>Allows discarding specific streams or frames from streams.
  5896. Any input stream can be fully discarded, using value <code class="code">all</code> whereas
  5897. selective discarding of frames from a stream occurs at the demuxer
  5898. and is not supported by all demuxers.
  5899. </p>
  5900. <dl class="table">
  5901. <dt><samp class="option">none</samp></dt>
  5902. <dd><p>Discard no frame.
  5903. </p>
  5904. </dd>
  5905. <dt><samp class="option">default</samp></dt>
  5906. <dd><p>Default, which discards no frames.
  5907. </p>
  5908. </dd>
  5909. <dt><samp class="option">noref</samp></dt>
  5910. <dd><p>Discard all non-reference frames.
  5911. </p>
  5912. </dd>
  5913. <dt><samp class="option">bidir</samp></dt>
  5914. <dd><p>Discard all bidirectional frames.
  5915. </p>
  5916. </dd>
  5917. <dt><samp class="option">nokey</samp></dt>
  5918. <dd><p>Discard all frames excepts keyframes.
  5919. </p>
  5920. </dd>
  5921. <dt><samp class="option">all</samp></dt>
  5922. <dd><p>Discard all frames.
  5923. </p></dd>
  5924. </dl>
  5925. </dd>
  5926. <dt><samp class="option">-abort_on <var class="var">flags</var> (<em class="emph">global</em>)</samp></dt>
  5927. <dd><p>Stop and abort on various conditions. The following flags are available:
  5928. </p>
  5929. <dl class="table">
  5930. <dt><samp class="option">empty_output</samp></dt>
  5931. <dd><p>No packets were passed to the muxer, the output is empty.
  5932. </p></dd>
  5933. <dt><samp class="option">empty_output_stream</samp></dt>
  5934. <dd><p>No packets were passed to the muxer in some of the output streams.
  5935. </p></dd>
  5936. </dl>
  5937. </dd>
  5938. <dt><samp class="option">-max_error_rate (<em class="emph">global</em>)</samp></dt>
  5939. <dd><p>Set fraction of decoding frame failures across all inputs which when crossed
  5940. ffmpeg will return exit code 69. Crossing this threshold does not terminate
  5941. processing. Range is a floating-point number between 0 to 1. Default is 2/3.
  5942. </p>
  5943. </dd>
  5944. <dt><samp class="option">-xerror (<em class="emph">global</em>)</samp></dt>
  5945. <dd><p>Stop and exit on error
  5946. </p>
  5947. </dd>
  5948. <dt><samp class="option">-max_muxing_queue_size <var class="var">packets</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5949. <dd><p>When transcoding audio and/or video streams, ffmpeg will not begin writing into
  5950. the output until it has one packet for each such stream. While waiting for that
  5951. to happen, packets for other streams are buffered. This option sets the size of
  5952. this buffer, in packets, for the matching output stream.
  5953. </p>
  5954. <p>The default value of this option should be high enough for most uses, so only
  5955. touch this option if you are sure that you need it.
  5956. </p>
  5957. </dd>
  5958. <dt><samp class="option">-muxing_queue_data_threshold <var class="var">bytes</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5959. <dd><p>This is a minimum threshold until which the muxing queue size is not taken into
  5960. account. Defaults to 50 megabytes per stream, and is based on the overall size
  5961. of packets passed to the muxer.
  5962. </p>
  5963. </dd>
  5964. <dt><samp class="option">-auto_conversion_filters (<em class="emph">global</em>)</samp></dt>
  5965. <dd><p>Enable automatically inserting format conversion filters in all filter
  5966. graphs, including those defined by <samp class="option">-vf</samp>, <samp class="option">-af</samp>,
  5967. <samp class="option">-filter_complex</samp> and <samp class="option">-lavfi</samp>. If filter format negotiation
  5968. requires a conversion, the initialization of the filters will fail.
  5969. Conversions can still be performed by inserting the relevant conversion
  5970. filter (scale, aresample) in the graph.
  5971. On by default, to explicitly disable it you need to specify
  5972. <code class="code">-noauto_conversion_filters</code>.
  5973. </p>
  5974. </dd>
  5975. <dt><samp class="option">-bits_per_raw_sample[:<var class="var">stream_specifier</var>] <var class="var">value</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5976. <dd><p>Declare the number of bits per raw sample in the given output stream to be
  5977. <var class="var">value</var>. Note that this option sets the information provided to the
  5978. encoder/muxer, it does not change the stream to conform to this value. Setting
  5979. values that do not match the stream properties may result in encoding failures
  5980. or invalid output files.
  5981. </p>
  5982. <a class="anchor" id="stats_005fenc_005foptions"></a></dd>
  5983. <dt><samp class="option">-stats_enc_pre[:<var class="var">stream_specifier</var>] <var class="var">path</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5984. <dt><samp class="option">-stats_enc_post[:<var class="var">stream_specifier</var>] <var class="var">path</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5985. <dt><samp class="option">-stats_mux_pre[:<var class="var">stream_specifier</var>] <var class="var">path</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5986. <dd><p>Write per-frame encoding information about the matching streams into the file
  5987. given by <var class="var">path</var>.
  5988. </p>
  5989. <p><samp class="option">-stats_enc_pre</samp> writes information about raw video or audio frames right
  5990. before they are sent for encoding, while <samp class="option">-stats_enc_post</samp> writes
  5991. information about encoded packets as they are received from the encoder.
  5992. <samp class="option">-stats_mux_pre</samp> writes information about packets just as they are about to
  5993. be sent to the muxer. Every frame or packet produces one line in the specified
  5994. file. The format of this line is controlled by <samp class="option">-stats_enc_pre_fmt</samp> /
  5995. <samp class="option">-stats_enc_post_fmt</samp> / <samp class="option">-stats_mux_pre_fmt</samp>.
  5996. </p>
  5997. <p>When stats for multiple streams are written into a single file, the lines
  5998. corresponding to different streams will be interleaved. The precise order of
  5999. this interleaving is not specified and not guaranteed to remain stable between
  6000. different invocations of the program, even with the same options.
  6001. </p>
  6002. </dd>
  6003. <dt><samp class="option">-stats_enc_pre_fmt[:<var class="var">stream_specifier</var>] <var class="var">format_spec</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  6004. <dt><samp class="option">-stats_enc_post_fmt[:<var class="var">stream_specifier</var>] <var class="var">format_spec</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  6005. <dt><samp class="option">-stats_mux_pre_fmt[:<var class="var">stream_specifier</var>] <var class="var">format_spec</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  6006. <dd><p>Specify the format for the lines written with <samp class="option">-stats_enc_pre</samp> /
  6007. <samp class="option">-stats_enc_post</samp> / <samp class="option">-stats_mux_pre</samp>.
  6008. </p>
  6009. <p><var class="var">format_spec</var> is a string that may contain directives of the form
  6010. <var class="var">{fmt}</var>. <var class="var">format_spec</var> is backslash-escaped &mdash; use \{, \}, and \\
  6011. to write a literal {, }, or \, respectively, into the output.
  6012. </p>
  6013. <p>The directives given with <var class="var">fmt</var> may be one of the following:
  6014. </p><dl class="table">
  6015. <dt><samp class="option">fidx</samp></dt>
  6016. <dd><p>Index of the output file.
  6017. </p>
  6018. </dd>
  6019. <dt><samp class="option">sidx</samp></dt>
  6020. <dd><p>Index of the output stream in the file.
  6021. </p>
  6022. </dd>
  6023. <dt><samp class="option">n</samp></dt>
  6024. <dd><p>Frame number. Pre-encoding: number of frames sent to the encoder so far.
  6025. Post-encoding: number of packets received from the encoder so far.
  6026. Muxing: number of packets submitted to the muxer for this stream so far.
  6027. </p>
  6028. </dd>
  6029. <dt><samp class="option">ni</samp></dt>
  6030. <dd><p>Input frame number. Index of the input frame (i.e. output by a decoder) that
  6031. corresponds to this output frame or packet. -1 if unavailable.
  6032. </p>
  6033. </dd>
  6034. <dt><samp class="option">tb</samp></dt>
  6035. <dd><p>Timebase in which this frame/packet&rsquo;s timestamps are expressed, as a rational
  6036. number <var class="var">num/den</var>. Note that encoder and muxer may use different timebases.
  6037. </p>
  6038. </dd>
  6039. <dt><samp class="option">tbi</samp></dt>
  6040. <dd><p>Timebase for <var class="var">ptsi</var>, as a rational number <var class="var">num/den</var>. Available when
  6041. <var class="var">ptsi</var> is available, <var class="var">0/1</var> otherwise.
  6042. </p>
  6043. </dd>
  6044. <dt><samp class="option">pts</samp></dt>
  6045. <dd><p>Presentation timestamp of the frame or packet, as an integer. Should be
  6046. multiplied by the timebase to compute presentation time.
  6047. </p>
  6048. </dd>
  6049. <dt><samp class="option">ptsi</samp></dt>
  6050. <dd><p>Presentation timestamp of the input frame (see <var class="var">ni</var>), as an integer. Should
  6051. be multiplied by <var class="var">tbi</var> to compute presentation time. Printed as
  6052. (2^63 - 1 = 9223372036854775807) when not available.
  6053. </p>
  6054. </dd>
  6055. <dt><samp class="option">t</samp></dt>
  6056. <dd><p>Presentation time of the frame or packet, as a decimal number. Equal to
  6057. <var class="var">pts</var> multiplied by <var class="var">tb</var>.
  6058. </p>
  6059. </dd>
  6060. <dt><samp class="option">ti</samp></dt>
  6061. <dd><p>Presentation time of the input frame (see <var class="var">ni</var>), as a decimal number. Equal
  6062. to <var class="var">ptsi</var> multiplied by <var class="var">tbi</var>. Printed as inf when not available.
  6063. </p>
  6064. </dd>
  6065. <dt><samp class="option">dts (<em class="emph">packet</em>)</samp></dt>
  6066. <dd><p>Decoding timestamp of the packet, as an integer. Should be multiplied by the
  6067. timebase to compute presentation time.
  6068. </p>
  6069. </dd>
  6070. <dt><samp class="option">dt (<em class="emph">packet</em>)</samp></dt>
  6071. <dd><p>Decoding time of the frame or packet, as a decimal number. Equal to
  6072. <var class="var">dts</var> multiplied by <var class="var">tb</var>.
  6073. </p>
  6074. </dd>
  6075. <dt><samp class="option">sn (<em class="emph">frame,audio</em>)</samp></dt>
  6076. <dd><p>Number of audio samples sent to the encoder so far.
  6077. </p>
  6078. </dd>
  6079. <dt><samp class="option">samp (<em class="emph">frame,audio</em>)</samp></dt>
  6080. <dd><p>Number of audio samples in the frame.
  6081. </p>
  6082. </dd>
  6083. <dt><samp class="option">size (<em class="emph">packet</em>)</samp></dt>
  6084. <dd><p>Size of the encoded packet in bytes.
  6085. </p>
  6086. </dd>
  6087. <dt><samp class="option">br (<em class="emph">packet</em>)</samp></dt>
  6088. <dd><p>Current bitrate in bits per second.
  6089. </p>
  6090. </dd>
  6091. <dt><samp class="option">abr (<em class="emph">packet</em>)</samp></dt>
  6092. <dd><p>Average bitrate for the whole stream so far, in bits per second, -1 if it cannot
  6093. be determined at this point.
  6094. </p>
  6095. </dd>
  6096. <dt><samp class="option">key (<em class="emph">packet</em>)</samp></dt>
  6097. <dd><p>Character &rsquo;K&rsquo; if the packet contains a keyframe, character &rsquo;N&rsquo; otherwise.
  6098. </p></dd>
  6099. </dl>
  6100. <p>Directives tagged with <em class="emph">packet</em> may only be used with
  6101. <samp class="option">-stats_enc_post_fmt</samp> and <samp class="option">-stats_mux_pre_fmt</samp>.
  6102. </p>
  6103. <p>Directives tagged with <em class="emph">frame</em> may only be used with
  6104. <samp class="option">-stats_enc_pre_fmt</samp>.
  6105. </p>
  6106. <p>Directives tagged with <em class="emph">audio</em> may only be used with audio streams.
  6107. </p>
  6108. <p>The default format strings are:
  6109. </p><dl class="table">
  6110. <dt><samp class="option">pre-encoding</samp></dt>
  6111. <dd><p>{fidx} {sidx} {n} {t}
  6112. </p></dd>
  6113. <dt><samp class="option">post-encoding</samp></dt>
  6114. <dd><p>{fidx} {sidx} {n} {t}
  6115. </p></dd>
  6116. </dl>
  6117. <p>In the future, new items may be added to the end of the default formatting
  6118. strings. Users who depend on the format staying exactly the same, should
  6119. prescribe it manually.
  6120. </p>
  6121. <p>Note that stats for different streams written into the same file may have
  6122. different formats.
  6123. </p>
  6124. </dd>
  6125. </dl>
  6126. <a name="Preset-files"></a>
  6127. <h3 class="section">5.12 Preset files<span class="pull-right"><a class="anchor hidden-xs" href="#Preset-files" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Preset-files" aria-hidden="true">TOC</a></span></h3>
  6128. <p>A preset file contains a sequence of <var class="var">option</var>=<var class="var">value</var> pairs,
  6129. one for each line, specifying a sequence of options which would be
  6130. awkward to specify on the command line. Lines starting with the hash
  6131. (&rsquo;#&rsquo;) character are ignored and are used to provide comments. Check
  6132. the <samp class="file">presets</samp> directory in the FFmpeg source tree for examples.
  6133. </p>
  6134. <p>There are two types of preset files: ffpreset and avpreset files.
  6135. </p>
  6136. <a name="ffpreset-files"></a>
  6137. <h4 class="subsection">5.12.1 ffpreset files<span class="pull-right"><a class="anchor hidden-xs" href="#ffpreset-files" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffpreset-files" aria-hidden="true">TOC</a></span></h4>
  6138. <p>ffpreset files are specified with the <code class="code">vpre</code>, <code class="code">apre</code>,
  6139. <code class="code">spre</code>, and <code class="code">fpre</code> options. The <code class="code">fpre</code> option takes the
  6140. filename of the preset instead of a preset name as input and can be
  6141. used for any kind of codec. For the <code class="code">vpre</code>, <code class="code">apre</code>, and
  6142. <code class="code">spre</code> options, the options specified in a preset file are
  6143. applied to the currently selected codec of the same type as the preset
  6144. option.
  6145. </p>
  6146. <p>The argument passed to the <code class="code">vpre</code>, <code class="code">apre</code>, and <code class="code">spre</code>
  6147. preset options identifies the preset file to use according to the
  6148. following rules:
  6149. </p>
  6150. <p>First ffmpeg searches for a file named <var class="var">arg</var>.ffpreset in the
  6151. directories <samp class="file">$FFMPEG_DATADIR</samp> (if set), and <samp class="file">$HOME/.ffmpeg</samp>, and in
  6152. the datadir defined at configuration time (usually <samp class="file">PREFIX/share/ffmpeg</samp>)
  6153. or in a <samp class="file">ffpresets</samp> folder along the executable on win32,
  6154. in that order. For example, if the argument is <code class="code">libvpx-1080p</code>, it will
  6155. search for the file <samp class="file">libvpx-1080p.ffpreset</samp>.
  6156. </p>
  6157. <p>If no such file is found, then ffmpeg will search for a file named
  6158. <var class="var">codec_name</var>-<var class="var">arg</var>.ffpreset in the above-mentioned
  6159. directories, where <var class="var">codec_name</var> is the name of the codec to which
  6160. the preset file options will be applied. For example, if you select
  6161. the video codec with <code class="code">-vcodec libvpx</code> and use <code class="code">-vpre 1080p</code>,
  6162. then it will search for the file <samp class="file">libvpx-1080p.ffpreset</samp>.
  6163. </p>
  6164. <a name="avpreset-files"></a>
  6165. <h4 class="subsection">5.12.2 avpreset files<span class="pull-right"><a class="anchor hidden-xs" href="#avpreset-files" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avpreset-files" aria-hidden="true">TOC</a></span></h4>
  6166. <p>avpreset files are specified with the <code class="code">pre</code> option. They work similar to
  6167. ffpreset files, but they only allow encoder- specific options. Therefore, an
  6168. <var class="var">option</var>=<var class="var">value</var> pair specifying an encoder cannot be used.
  6169. </p>
  6170. <p>When the <code class="code">pre</code> option is specified, ffmpeg will look for files with the
  6171. suffix .avpreset in the directories <samp class="file">$AVCONV_DATADIR</samp> (if set), and
  6172. <samp class="file">$HOME/.avconv</samp>, and in the datadir defined at configuration time (usually
  6173. <samp class="file">PREFIX/share/ffmpeg</samp>), in that order.
  6174. </p>
  6175. <p>First ffmpeg searches for a file named <var class="var">codec_name</var>-<var class="var">arg</var>.avpreset in
  6176. the above-mentioned directories, where <var class="var">codec_name</var> is the name of the codec
  6177. to which the preset file options will be applied. For example, if you select the
  6178. video codec with <code class="code">-vcodec libvpx</code> and use <code class="code">-pre 1080p</code>, then it will
  6179. search for the file <samp class="file">libvpx-1080p.avpreset</samp>.
  6180. </p>
  6181. <p>If no such file is found, then ffmpeg will search for a file named
  6182. <var class="var">arg</var>.avpreset in the same directories.
  6183. </p>
  6184. <a class="anchor" id="vstats_005ffile_005fformat"></a><a name="vstats-file-format"></a>
  6185. <h3 class="section">5.13 vstats file format<span class="pull-right"><a class="anchor hidden-xs" href="#vstats-file-format" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstats-file-format" aria-hidden="true">TOC</a></span></h3>
  6186. <p>The <code class="code">-vstats</code> and <code class="code">-vstats_file</code> options enable generation of a file
  6187. containing statistics about the generated video outputs.
  6188. </p>
  6189. <p>The <code class="code">-vstats_version</code> option controls the format version of the generated
  6190. file.
  6191. </p>
  6192. <p>With version <code class="code">1</code> the format is:
  6193. </p><div class="example">
  6194. <pre class="example-preformatted">frame= <var class="var">FRAME</var> q= <var class="var">FRAME_QUALITY</var> PSNR= <var class="var">PSNR</var> f_size= <var class="var">FRAME_SIZE</var> s_size= <var class="var">STREAM_SIZE</var>kB time= <var class="var">TIMESTAMP</var> br= <var class="var">BITRATE</var>kbits/s avg_br= <var class="var">AVERAGE_BITRATE</var>kbits/s
  6195. </pre></div>
  6196. <p>With version <code class="code">2</code> the format is:
  6197. </p><div class="example">
  6198. <pre class="example-preformatted">out= <var class="var">OUT_FILE_INDEX</var> st= <var class="var">OUT_FILE_STREAM_INDEX</var> frame= <var class="var">FRAME_NUMBER</var> q= <var class="var">FRAME_QUALITY</var>f PSNR= <var class="var">PSNR</var> f_size= <var class="var">FRAME_SIZE</var> s_size= <var class="var">STREAM_SIZE</var>kB time= <var class="var">TIMESTAMP</var> br= <var class="var">BITRATE</var>kbits/s avg_br= <var class="var">AVERAGE_BITRATE</var>kbits/s
  6199. </pre></div>
  6200. <p>The value corresponding to each key is described below:
  6201. </p><dl class="table">
  6202. <dt><samp class="option">avg_br</samp></dt>
  6203. <dd><p>average bitrate expressed in Kbits/s
  6204. </p>
  6205. </dd>
  6206. <dt><samp class="option">br</samp></dt>
  6207. <dd><p>bitrate expressed in Kbits/s
  6208. </p>
  6209. </dd>
  6210. <dt><samp class="option">frame</samp></dt>
  6211. <dd><p>number of encoded frame
  6212. </p>
  6213. </dd>
  6214. <dt><samp class="option">out</samp></dt>
  6215. <dd><p>out file index
  6216. </p>
  6217. </dd>
  6218. <dt><samp class="option">PSNR</samp></dt>
  6219. <dd><p>Peak Signal to Noise Ratio
  6220. </p>
  6221. </dd>
  6222. <dt><samp class="option">q</samp></dt>
  6223. <dd><p>quality of the frame
  6224. </p>
  6225. </dd>
  6226. <dt><samp class="option">f_size</samp></dt>
  6227. <dd><p>encoded packet size expressed as number of bytes
  6228. </p>
  6229. </dd>
  6230. <dt><samp class="option">s_size</samp></dt>
  6231. <dd><p>stream size expressed in KiB
  6232. </p>
  6233. </dd>
  6234. <dt><samp class="option">st</samp></dt>
  6235. <dd><p>out file stream index
  6236. </p>
  6237. </dd>
  6238. <dt><samp class="option">time</samp></dt>
  6239. <dd><p>time of the packet
  6240. </p>
  6241. </dd>
  6242. <dt><samp class="option">type</samp></dt>
  6243. <dd><p>picture type
  6244. </p></dd>
  6245. </dl>
  6246. <p>See also the <a class="ref" href="#stats_005fenc_005foptions">-stats_enc options</a> for an alternative way
  6247. to show encoding statistics.
  6248. </p>
  6249. <a name="Examples-1"></a>
  6250. <h2 class="chapter">6 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h2>
  6251. <a name="Video-and-Audio-grabbing"></a>
  6252. <h3 class="section">6.1 Video and Audio grabbing<span class="pull-right"><a class="anchor hidden-xs" href="#Video-and-Audio-grabbing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-and-Audio-grabbing" aria-hidden="true">TOC</a></span></h3>
  6253. <p>If you specify the input format and device then ffmpeg can grab video
  6254. and audio directly.
  6255. </p>
  6256. <div class="example">
  6257. <pre class="example-preformatted">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  6258. </pre></div>
  6259. <p>Or with an ALSA audio source (mono input, card id 1) instead of OSS:
  6260. </p><div class="example">
  6261. <pre class="example-preformatted">ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
  6262. </pre></div>
  6263. <p>Note that you must activate the right video source and channel before
  6264. launching ffmpeg with any TV viewer such as
  6265. <a class="uref" href="http://linux.bytesex.org/xawtv/">xawtv</a> by Gerd Knorr. You also
  6266. have to set the audio recording levels correctly with a
  6267. standard mixer.
  6268. </p>
  6269. <a name="X11-grabbing"></a>
  6270. <h3 class="section">6.2 X11 grabbing<span class="pull-right"><a class="anchor hidden-xs" href="#X11-grabbing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-X11-grabbing" aria-hidden="true">TOC</a></span></h3>
  6271. <p>Grab the X11 display with ffmpeg via
  6272. </p>
  6273. <div class="example">
  6274. <pre class="example-preformatted">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
  6275. </pre></div>
  6276. <p>0.0 is display.screen number of your X11 server, same as
  6277. the DISPLAY environment variable.
  6278. </p>
  6279. <div class="example">
  6280. <pre class="example-preformatted">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
  6281. </pre></div>
  6282. <p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
  6283. variable. 10 is the x-offset and 20 the y-offset for the grabbing.
  6284. </p>
  6285. <a name="Video-and-Audio-file-format-conversion"></a>
  6286. <h3 class="section">6.3 Video and Audio file format conversion<span class="pull-right"><a class="anchor hidden-xs" href="#Video-and-Audio-file-format-conversion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-and-Audio-file-format-conversion" aria-hidden="true">TOC</a></span></h3>
  6287. <p>Any supported file format and protocol can serve as input to ffmpeg:
  6288. </p>
  6289. <p>Examples:
  6290. </p><ul class="itemize mark-bullet">
  6291. <li>You can use YUV files as input:
  6292. <div class="example">
  6293. <pre class="example-preformatted">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  6294. </pre></div>
  6295. <p>It will use the files:
  6296. </p><div class="example">
  6297. <pre class="example-preformatted">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  6298. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  6299. </pre></div>
  6300. <p>The Y files use twice the resolution of the U and V files. They are
  6301. raw files, without header. They can be generated by all decent video
  6302. decoders. You must specify the size of the image with the <samp class="option">-s</samp> option
  6303. if ffmpeg cannot guess it.
  6304. </p>
  6305. </li><li>You can input from a raw YUV420P file:
  6306. <div class="example">
  6307. <pre class="example-preformatted">ffmpeg -i /tmp/test.yuv /tmp/out.avi
  6308. </pre></div>
  6309. <p>test.yuv is a file containing raw YUV planar data. Each frame is composed
  6310. of the Y plane followed by the U and V planes at half vertical and
  6311. horizontal resolution.
  6312. </p>
  6313. </li><li>You can output to a raw YUV420P file:
  6314. <div class="example">
  6315. <pre class="example-preformatted">ffmpeg -i mydivx.avi hugefile.yuv
  6316. </pre></div>
  6317. </li><li>You can set several input files and output files:
  6318. <div class="example">
  6319. <pre class="example-preformatted">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  6320. </pre></div>
  6321. <p>Converts the audio file a.wav and the raw YUV video file a.yuv
  6322. to MPEG file a.mpg.
  6323. </p>
  6324. </li><li>You can also do audio and video conversions at the same time:
  6325. <div class="example">
  6326. <pre class="example-preformatted">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  6327. </pre></div>
  6328. <p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
  6329. </p>
  6330. </li><li>You can encode to several formats at the same time and define a
  6331. mapping from input stream to output streams:
  6332. <div class="example">
  6333. <pre class="example-preformatted">ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
  6334. </pre></div>
  6335. <p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. &rsquo;-map
  6336. file:index&rsquo; specifies which input stream is used for each output
  6337. stream, in the order of the definition of output streams.
  6338. </p>
  6339. </li><li>You can transcode decrypted VOBs:
  6340. <div class="example">
  6341. <pre class="example-preformatted">ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
  6342. </pre></div>
  6343. <p>This is a typical DVD ripping example; the input is a VOB file, the
  6344. output an AVI file with MPEG-4 video and MP3 audio. Note that in this
  6345. command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
  6346. GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
  6347. input video. Furthermore, the audio stream is MP3-encoded so you need
  6348. to enable LAME support by passing <code class="code">--enable-libmp3lame</code> to configure.
  6349. The mapping is particularly useful for DVD transcoding
  6350. to get the desired audio language.
  6351. </p>
  6352. <p>NOTE: To see the supported input formats, use <code class="code">ffmpeg -demuxers</code>.
  6353. </p>
  6354. </li><li>You can extract images from a video, or create a video from many images:
  6355. <p>For extracting images from a video:
  6356. </p><div class="example">
  6357. <pre class="example-preformatted">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
  6358. </pre></div>
  6359. <p>This will extract one video frame per second from the video and will
  6360. output them in files named <samp class="file">foo-001.jpeg</samp>, <samp class="file">foo-002.jpeg</samp>,
  6361. etc. Images will be rescaled to fit the new WxH values.
  6362. </p>
  6363. <p>If you want to extract just a limited number of frames, you can use the
  6364. above command in combination with the <code class="code">-frames:v</code> or <code class="code">-t</code> option,
  6365. or in combination with -ss to start extracting from a certain point in time.
  6366. </p>
  6367. <p>For creating a video from many images:
  6368. </p><div class="example">
  6369. <pre class="example-preformatted">ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
  6370. </pre></div>
  6371. <p>The syntax <code class="code">foo-%03d.jpeg</code> specifies to use a decimal number
  6372. composed of three digits padded with zeroes to express the sequence
  6373. number. It is the same syntax supported by the C printf function, but
  6374. only formats accepting a normal integer are suitable.
  6375. </p>
  6376. <p>When importing an image sequence, -i also supports expanding
  6377. shell-like wildcard patterns (globbing) internally, by selecting the
  6378. image2-specific <code class="code">-pattern_type glob</code> option.
  6379. </p>
  6380. <p>For example, for creating a video from filenames matching the glob pattern
  6381. <code class="code">foo-*.jpeg</code>:
  6382. </p><div class="example">
  6383. <pre class="example-preformatted">ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
  6384. </pre></div>
  6385. </li><li>You can put many streams of the same type in the output:
  6386. <div class="example">
  6387. <pre class="example-preformatted">ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
  6388. </pre></div>
  6389. <p>The resulting output file <samp class="file">test12.nut</samp> will contain the first four streams
  6390. from the input files in reverse order.
  6391. </p>
  6392. </li><li>To force CBR video output:
  6393. <div class="example">
  6394. <pre class="example-preformatted">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  6395. </pre></div>
  6396. </li><li>The four options lmin, lmax, mblmin and mblmax use &rsquo;lambda&rsquo; units,
  6397. but you may use the QP2LAMBDA constant to easily convert from &rsquo;q&rsquo; units:
  6398. <div class="example">
  6399. <pre class="example-preformatted">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  6400. </pre></div>
  6401. </li></ul>
  6402. <a name="Syntax"></a>
  6403. <h2 class="chapter">7 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax" aria-hidden="true">TOC</a></span></h2>
  6404. <p>This section documents the syntax and formats employed by the FFmpeg
  6405. libraries and tools.
  6406. </p>
  6407. <a class="anchor" id="quoting_005fand_005fescaping"></a><a name="Quoting-and-escaping"></a>
  6408. <h3 class="section">7.1 Quoting and escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Quoting-and-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Quoting-and-escaping" aria-hidden="true">TOC</a></span></h3>
  6409. <p>FFmpeg adopts the following quoting and escaping mechanism, unless
  6410. explicitly specified. The following rules are applied:
  6411. </p>
  6412. <ul class="itemize mark-bullet">
  6413. <li>&lsquo;<samp class="samp">'</samp>&rsquo; and &lsquo;<samp class="samp">\</samp>&rsquo; are special characters (respectively used for
  6414. quoting and escaping). In addition to them, there might be other
  6415. special characters depending on the specific syntax where the escaping
  6416. and quoting are employed.
  6417. </li><li>A special character is escaped by prefixing it with a &lsquo;<samp class="samp">\</samp>&rsquo;.
  6418. </li><li>All characters enclosed between &lsquo;<samp class="samp">''</samp>&rsquo; are included literally in the
  6419. parsed string. The quote character &lsquo;<samp class="samp">'</samp>&rsquo; itself cannot be quoted,
  6420. so you may need to close the quote and escape it.
  6421. </li><li>Leading and trailing whitespaces, unless escaped or quoted, are
  6422. removed from the parsed string.
  6423. </li></ul>
  6424. <p>Note that you may need to add a second level of escaping when using
  6425. the command line or a script, which depends on the syntax of the
  6426. adopted shell language.
  6427. </p>
  6428. <p>The function <code class="code">av_get_token</code> defined in
  6429. <samp class="file">libavutil/avstring.h</samp> can be used to parse a token quoted or
  6430. escaped according to the rules defined above.
  6431. </p>
  6432. <p>The tool <samp class="file">tools/ffescape</samp> in the FFmpeg source tree can be used
  6433. to automatically quote or escape a string in a script.
  6434. </p>
  6435. <a name="Examples-2"></a>
  6436. <h4 class="subsection">7.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-2" aria-hidden="true">TOC</a></span></h4>
  6437. <ul class="itemize mark-bullet">
  6438. <li>Escape the string <code class="code">Crime d'Amour</code> containing the <code class="code">'</code> special
  6439. character:
  6440. <div class="example">
  6441. <pre class="example-preformatted">Crime d\'Amour
  6442. </pre></div>
  6443. </li><li>The string above contains a quote, so the <code class="code">'</code> needs to be escaped
  6444. when quoting it:
  6445. <div class="example">
  6446. <pre class="example-preformatted">'Crime d'\''Amour'
  6447. </pre></div>
  6448. </li><li>Include leading or trailing whitespaces using quoting:
  6449. <div class="example">
  6450. <pre class="example-preformatted">' this string starts and ends with whitespaces '
  6451. </pre></div>
  6452. </li><li>Escaping and quoting can be mixed together:
  6453. <div class="example">
  6454. <pre class="example-preformatted">' The string '\'string\'' is a string '
  6455. </pre></div>
  6456. </li><li>To include a literal &lsquo;<samp class="samp">\</samp>&rsquo; you can use either escaping or quoting:
  6457. <div class="example">
  6458. <pre class="example-preformatted">'c:\foo' can be written as c:\\foo
  6459. </pre></div>
  6460. </li></ul>
  6461. <a class="anchor" id="date-syntax"></a><a name="Date"></a>
  6462. <h3 class="section">7.2 Date<span class="pull-right"><a class="anchor hidden-xs" href="#Date" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Date" aria-hidden="true">TOC</a></span></h3>
  6463. <p>The accepted syntax is:
  6464. </p><div class="example">
  6465. <pre class="example-preformatted">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
  6466. now
  6467. </pre></div>
  6468. <p>If the value is &quot;now&quot; it takes the current time.
  6469. </p>
  6470. <p>Time is local time unless Z is appended, in which case it is
  6471. interpreted as UTC.
  6472. If the year-month-day part is not specified it takes the current
  6473. year-month-day.
  6474. </p>
  6475. <a class="anchor" id="time-duration-syntax"></a><a name="Time-duration"></a>
  6476. <h3 class="section">7.3 Time duration<span class="pull-right"><a class="anchor hidden-xs" href="#Time-duration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Time-duration" aria-hidden="true">TOC</a></span></h3>
  6477. <p>There are two accepted syntaxes for expressing time duration.
  6478. </p>
  6479. <div class="example">
  6480. <pre class="example-preformatted">[-][<var class="var">HH</var>:]<var class="var">MM</var>:<var class="var">SS</var>[.<var class="var">m</var>...]
  6481. </pre></div>
  6482. <p><var class="var">HH</var> expresses the number of hours, <var class="var">MM</var> the number of minutes
  6483. for a maximum of 2 digits, and <var class="var">SS</var> the number of seconds for a
  6484. maximum of 2 digits. The <var class="var">m</var> at the end expresses decimal value for
  6485. <var class="var">SS</var>.
  6486. </p>
  6487. <p><em class="emph">or</em>
  6488. </p>
  6489. <div class="example">
  6490. <pre class="example-preformatted">[-]<var class="var">S</var>+[.<var class="var">m</var>...][s|ms|us]
  6491. </pre></div>
  6492. <p><var class="var">S</var> expresses the number of seconds, with the optional decimal part
  6493. <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;
  6494. indicate to interpret the value as seconds, milliseconds or microseconds,
  6495. respectively.
  6496. </p>
  6497. <p>In both expressions, the optional &lsquo;<samp class="samp">-</samp>&rsquo; indicates negative duration.
  6498. </p>
  6499. <a name="Examples-3"></a>
  6500. <h4 class="subsection">7.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-3" aria-hidden="true">TOC</a></span></h4>
  6501. <p>The following examples are all valid time duration:
  6502. </p>
  6503. <dl class="table">
  6504. <dt>&lsquo;<samp class="samp">55</samp>&rsquo;</dt>
  6505. <dd><p>55 seconds
  6506. </p>
  6507. </dd>
  6508. <dt>&lsquo;<samp class="samp">0.2</samp>&rsquo;</dt>
  6509. <dd><p>0.2 seconds
  6510. </p>
  6511. </dd>
  6512. <dt>&lsquo;<samp class="samp">200ms</samp>&rsquo;</dt>
  6513. <dd><p>200 milliseconds, that&rsquo;s 0.2s
  6514. </p>
  6515. </dd>
  6516. <dt>&lsquo;<samp class="samp">200000us</samp>&rsquo;</dt>
  6517. <dd><p>200000 microseconds, that&rsquo;s 0.2s
  6518. </p>
  6519. </dd>
  6520. <dt>&lsquo;<samp class="samp">12:03:45</samp>&rsquo;</dt>
  6521. <dd><p>12 hours, 03 minutes and 45 seconds
  6522. </p>
  6523. </dd>
  6524. <dt>&lsquo;<samp class="samp">23.189</samp>&rsquo;</dt>
  6525. <dd><p>23.189 seconds
  6526. </p></dd>
  6527. </dl>
  6528. <a class="anchor" id="video-size-syntax"></a><a name="Video-size"></a>
  6529. <h3 class="section">7.4 Video size<span class="pull-right"><a class="anchor hidden-xs" href="#Video-size" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-size" aria-hidden="true">TOC</a></span></h3>
  6530. <p>Specify the size of the sourced video, it may be a string of the form
  6531. <var class="var">width</var>x<var class="var">height</var>, or the name of a size abbreviation.
  6532. </p>
  6533. <p>The following abbreviations are recognized:
  6534. </p><dl class="table">
  6535. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  6536. <dd><p>720x480
  6537. </p></dd>
  6538. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  6539. <dd><p>720x576
  6540. </p></dd>
  6541. <dt>&lsquo;<samp class="samp">qntsc</samp>&rsquo;</dt>
  6542. <dd><p>352x240
  6543. </p></dd>
  6544. <dt>&lsquo;<samp class="samp">qpal</samp>&rsquo;</dt>
  6545. <dd><p>352x288
  6546. </p></dd>
  6547. <dt>&lsquo;<samp class="samp">sntsc</samp>&rsquo;</dt>
  6548. <dd><p>640x480
  6549. </p></dd>
  6550. <dt>&lsquo;<samp class="samp">spal</samp>&rsquo;</dt>
  6551. <dd><p>768x576
  6552. </p></dd>
  6553. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  6554. <dd><p>352x240
  6555. </p></dd>
  6556. <dt>&lsquo;<samp class="samp">ntsc-film</samp>&rsquo;</dt>
  6557. <dd><p>352x240
  6558. </p></dd>
  6559. <dt>&lsquo;<samp class="samp">sqcif</samp>&rsquo;</dt>
  6560. <dd><p>128x96
  6561. </p></dd>
  6562. <dt>&lsquo;<samp class="samp">qcif</samp>&rsquo;</dt>
  6563. <dd><p>176x144
  6564. </p></dd>
  6565. <dt>&lsquo;<samp class="samp">cif</samp>&rsquo;</dt>
  6566. <dd><p>352x288
  6567. </p></dd>
  6568. <dt>&lsquo;<samp class="samp">4cif</samp>&rsquo;</dt>
  6569. <dd><p>704x576
  6570. </p></dd>
  6571. <dt>&lsquo;<samp class="samp">16cif</samp>&rsquo;</dt>
  6572. <dd><p>1408x1152
  6573. </p></dd>
  6574. <dt>&lsquo;<samp class="samp">qqvga</samp>&rsquo;</dt>
  6575. <dd><p>160x120
  6576. </p></dd>
  6577. <dt>&lsquo;<samp class="samp">qvga</samp>&rsquo;</dt>
  6578. <dd><p>320x240
  6579. </p></dd>
  6580. <dt>&lsquo;<samp class="samp">vga</samp>&rsquo;</dt>
  6581. <dd><p>640x480
  6582. </p></dd>
  6583. <dt>&lsquo;<samp class="samp">svga</samp>&rsquo;</dt>
  6584. <dd><p>800x600
  6585. </p></dd>
  6586. <dt>&lsquo;<samp class="samp">xga</samp>&rsquo;</dt>
  6587. <dd><p>1024x768
  6588. </p></dd>
  6589. <dt>&lsquo;<samp class="samp">uxga</samp>&rsquo;</dt>
  6590. <dd><p>1600x1200
  6591. </p></dd>
  6592. <dt>&lsquo;<samp class="samp">qxga</samp>&rsquo;</dt>
  6593. <dd><p>2048x1536
  6594. </p></dd>
  6595. <dt>&lsquo;<samp class="samp">sxga</samp>&rsquo;</dt>
  6596. <dd><p>1280x1024
  6597. </p></dd>
  6598. <dt>&lsquo;<samp class="samp">qsxga</samp>&rsquo;</dt>
  6599. <dd><p>2560x2048
  6600. </p></dd>
  6601. <dt>&lsquo;<samp class="samp">hsxga</samp>&rsquo;</dt>
  6602. <dd><p>5120x4096
  6603. </p></dd>
  6604. <dt>&lsquo;<samp class="samp">wvga</samp>&rsquo;</dt>
  6605. <dd><p>852x480
  6606. </p></dd>
  6607. <dt>&lsquo;<samp class="samp">wxga</samp>&rsquo;</dt>
  6608. <dd><p>1366x768
  6609. </p></dd>
  6610. <dt>&lsquo;<samp class="samp">wsxga</samp>&rsquo;</dt>
  6611. <dd><p>1600x1024
  6612. </p></dd>
  6613. <dt>&lsquo;<samp class="samp">wuxga</samp>&rsquo;</dt>
  6614. <dd><p>1920x1200
  6615. </p></dd>
  6616. <dt>&lsquo;<samp class="samp">woxga</samp>&rsquo;</dt>
  6617. <dd><p>2560x1600
  6618. </p></dd>
  6619. <dt>&lsquo;<samp class="samp">wqsxga</samp>&rsquo;</dt>
  6620. <dd><p>3200x2048
  6621. </p></dd>
  6622. <dt>&lsquo;<samp class="samp">wquxga</samp>&rsquo;</dt>
  6623. <dd><p>3840x2400
  6624. </p></dd>
  6625. <dt>&lsquo;<samp class="samp">whsxga</samp>&rsquo;</dt>
  6626. <dd><p>6400x4096
  6627. </p></dd>
  6628. <dt>&lsquo;<samp class="samp">whuxga</samp>&rsquo;</dt>
  6629. <dd><p>7680x4800
  6630. </p></dd>
  6631. <dt>&lsquo;<samp class="samp">cga</samp>&rsquo;</dt>
  6632. <dd><p>320x200
  6633. </p></dd>
  6634. <dt>&lsquo;<samp class="samp">ega</samp>&rsquo;</dt>
  6635. <dd><p>640x350
  6636. </p></dd>
  6637. <dt>&lsquo;<samp class="samp">hd480</samp>&rsquo;</dt>
  6638. <dd><p>852x480
  6639. </p></dd>
  6640. <dt>&lsquo;<samp class="samp">hd720</samp>&rsquo;</dt>
  6641. <dd><p>1280x720
  6642. </p></dd>
  6643. <dt>&lsquo;<samp class="samp">hd1080</samp>&rsquo;</dt>
  6644. <dd><p>1920x1080
  6645. </p></dd>
  6646. <dt>&lsquo;<samp class="samp">2k</samp>&rsquo;</dt>
  6647. <dd><p>2048x1080
  6648. </p></dd>
  6649. <dt>&lsquo;<samp class="samp">2kflat</samp>&rsquo;</dt>
  6650. <dd><p>1998x1080
  6651. </p></dd>
  6652. <dt>&lsquo;<samp class="samp">2kscope</samp>&rsquo;</dt>
  6653. <dd><p>2048x858
  6654. </p></dd>
  6655. <dt>&lsquo;<samp class="samp">4k</samp>&rsquo;</dt>
  6656. <dd><p>4096x2160
  6657. </p></dd>
  6658. <dt>&lsquo;<samp class="samp">4kflat</samp>&rsquo;</dt>
  6659. <dd><p>3996x2160
  6660. </p></dd>
  6661. <dt>&lsquo;<samp class="samp">4kscope</samp>&rsquo;</dt>
  6662. <dd><p>4096x1716
  6663. </p></dd>
  6664. <dt>&lsquo;<samp class="samp">nhd</samp>&rsquo;</dt>
  6665. <dd><p>640x360
  6666. </p></dd>
  6667. <dt>&lsquo;<samp class="samp">hqvga</samp>&rsquo;</dt>
  6668. <dd><p>240x160
  6669. </p></dd>
  6670. <dt>&lsquo;<samp class="samp">wqvga</samp>&rsquo;</dt>
  6671. <dd><p>400x240
  6672. </p></dd>
  6673. <dt>&lsquo;<samp class="samp">fwqvga</samp>&rsquo;</dt>
  6674. <dd><p>432x240
  6675. </p></dd>
  6676. <dt>&lsquo;<samp class="samp">hvga</samp>&rsquo;</dt>
  6677. <dd><p>480x320
  6678. </p></dd>
  6679. <dt>&lsquo;<samp class="samp">qhd</samp>&rsquo;</dt>
  6680. <dd><p>960x540
  6681. </p></dd>
  6682. <dt>&lsquo;<samp class="samp">2kdci</samp>&rsquo;</dt>
  6683. <dd><p>2048x1080
  6684. </p></dd>
  6685. <dt>&lsquo;<samp class="samp">4kdci</samp>&rsquo;</dt>
  6686. <dd><p>4096x2160
  6687. </p></dd>
  6688. <dt>&lsquo;<samp class="samp">uhd2160</samp>&rsquo;</dt>
  6689. <dd><p>3840x2160
  6690. </p></dd>
  6691. <dt>&lsquo;<samp class="samp">uhd4320</samp>&rsquo;</dt>
  6692. <dd><p>7680x4320
  6693. </p></dd>
  6694. </dl>
  6695. <a class="anchor" id="video-rate-syntax"></a><a name="Video-rate"></a>
  6696. <h3 class="section">7.5 Video rate<span class="pull-right"><a class="anchor hidden-xs" href="#Video-rate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-rate" aria-hidden="true">TOC</a></span></h3>
  6697. <p>Specify the frame rate of a video, expressed as the number of frames
  6698. generated per second. It has to be a string in the format
  6699. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a float
  6700. number or a valid video frame rate abbreviation.
  6701. </p>
  6702. <p>The following abbreviations are recognized:
  6703. </p><dl class="table">
  6704. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  6705. <dd><p>30000/1001
  6706. </p></dd>
  6707. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  6708. <dd><p>25/1
  6709. </p></dd>
  6710. <dt>&lsquo;<samp class="samp">qntsc</samp>&rsquo;</dt>
  6711. <dd><p>30000/1001
  6712. </p></dd>
  6713. <dt>&lsquo;<samp class="samp">qpal</samp>&rsquo;</dt>
  6714. <dd><p>25/1
  6715. </p></dd>
  6716. <dt>&lsquo;<samp class="samp">sntsc</samp>&rsquo;</dt>
  6717. <dd><p>30000/1001
  6718. </p></dd>
  6719. <dt>&lsquo;<samp class="samp">spal</samp>&rsquo;</dt>
  6720. <dd><p>25/1
  6721. </p></dd>
  6722. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  6723. <dd><p>24/1
  6724. </p></dd>
  6725. <dt>&lsquo;<samp class="samp">ntsc-film</samp>&rsquo;</dt>
  6726. <dd><p>24000/1001
  6727. </p></dd>
  6728. </dl>
  6729. <a class="anchor" id="ratio-syntax"></a><a name="Ratio"></a>
  6730. <h3 class="section">7.6 Ratio<span class="pull-right"><a class="anchor hidden-xs" href="#Ratio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Ratio" aria-hidden="true">TOC</a></span></h3>
  6731. <p>A ratio can be expressed as an expression, or in the form
  6732. <var class="var">numerator</var>:<var class="var">denominator</var>.
  6733. </p>
  6734. <p>Note that a ratio with infinite (1/0) or negative value is
  6735. considered valid, so you should check on the returned value if you
  6736. want to exclude those values.
  6737. </p>
  6738. <p>The undefined value can be expressed using the &quot;0:0&quot; string.
  6739. </p>
  6740. <a class="anchor" id="color-syntax"></a><a name="Color"></a>
  6741. <h3 class="section">7.7 Color<span class="pull-right"><a class="anchor hidden-xs" href="#Color" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Color" aria-hidden="true">TOC</a></span></h3>
  6742. <p>It can be the name of a color as defined below (case insensitive match) or a
  6743. <code class="code">[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
  6744. representing the alpha component.
  6745. </p>
  6746. <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
  6747. hexadecimal number or a decimal number between 0.0 and 1.0, which
  6748. represents the opacity value (&lsquo;<samp class="samp">0x00</samp>&rsquo; or &lsquo;<samp class="samp">0.0</samp>&rsquo; means completely
  6749. transparent, &lsquo;<samp class="samp">0xff</samp>&rsquo; or &lsquo;<samp class="samp">1.0</samp>&rsquo; completely opaque). If the alpha
  6750. component is not specified then &lsquo;<samp class="samp">0xff</samp>&rsquo; is assumed.
  6751. </p>
  6752. <p>The string &lsquo;<samp class="samp">random</samp>&rsquo; will result in a random color.
  6753. </p>
  6754. <p>The following names of colors are recognized:
  6755. </p><dl class="table">
  6756. <dt>&lsquo;<samp class="samp">AliceBlue</samp>&rsquo;</dt>
  6757. <dd><p>0xF0F8FF
  6758. </p></dd>
  6759. <dt>&lsquo;<samp class="samp">AntiqueWhite</samp>&rsquo;</dt>
  6760. <dd><p>0xFAEBD7
  6761. </p></dd>
  6762. <dt>&lsquo;<samp class="samp">Aqua</samp>&rsquo;</dt>
  6763. <dd><p>0x00FFFF
  6764. </p></dd>
  6765. <dt>&lsquo;<samp class="samp">Aquamarine</samp>&rsquo;</dt>
  6766. <dd><p>0x7FFFD4
  6767. </p></dd>
  6768. <dt>&lsquo;<samp class="samp">Azure</samp>&rsquo;</dt>
  6769. <dd><p>0xF0FFFF
  6770. </p></dd>
  6771. <dt>&lsquo;<samp class="samp">Beige</samp>&rsquo;</dt>
  6772. <dd><p>0xF5F5DC
  6773. </p></dd>
  6774. <dt>&lsquo;<samp class="samp">Bisque</samp>&rsquo;</dt>
  6775. <dd><p>0xFFE4C4
  6776. </p></dd>
  6777. <dt>&lsquo;<samp class="samp">Black</samp>&rsquo;</dt>
  6778. <dd><p>0x000000
  6779. </p></dd>
  6780. <dt>&lsquo;<samp class="samp">BlanchedAlmond</samp>&rsquo;</dt>
  6781. <dd><p>0xFFEBCD
  6782. </p></dd>
  6783. <dt>&lsquo;<samp class="samp">Blue</samp>&rsquo;</dt>
  6784. <dd><p>0x0000FF
  6785. </p></dd>
  6786. <dt>&lsquo;<samp class="samp">BlueViolet</samp>&rsquo;</dt>
  6787. <dd><p>0x8A2BE2
  6788. </p></dd>
  6789. <dt>&lsquo;<samp class="samp">Brown</samp>&rsquo;</dt>
  6790. <dd><p>0xA52A2A
  6791. </p></dd>
  6792. <dt>&lsquo;<samp class="samp">BurlyWood</samp>&rsquo;</dt>
  6793. <dd><p>0xDEB887
  6794. </p></dd>
  6795. <dt>&lsquo;<samp class="samp">CadetBlue</samp>&rsquo;</dt>
  6796. <dd><p>0x5F9EA0
  6797. </p></dd>
  6798. <dt>&lsquo;<samp class="samp">Chartreuse</samp>&rsquo;</dt>
  6799. <dd><p>0x7FFF00
  6800. </p></dd>
  6801. <dt>&lsquo;<samp class="samp">Chocolate</samp>&rsquo;</dt>
  6802. <dd><p>0xD2691E
  6803. </p></dd>
  6804. <dt>&lsquo;<samp class="samp">Coral</samp>&rsquo;</dt>
  6805. <dd><p>0xFF7F50
  6806. </p></dd>
  6807. <dt>&lsquo;<samp class="samp">CornflowerBlue</samp>&rsquo;</dt>
  6808. <dd><p>0x6495ED
  6809. </p></dd>
  6810. <dt>&lsquo;<samp class="samp">Cornsilk</samp>&rsquo;</dt>
  6811. <dd><p>0xFFF8DC
  6812. </p></dd>
  6813. <dt>&lsquo;<samp class="samp">Crimson</samp>&rsquo;</dt>
  6814. <dd><p>0xDC143C
  6815. </p></dd>
  6816. <dt>&lsquo;<samp class="samp">Cyan</samp>&rsquo;</dt>
  6817. <dd><p>0x00FFFF
  6818. </p></dd>
  6819. <dt>&lsquo;<samp class="samp">DarkBlue</samp>&rsquo;</dt>
  6820. <dd><p>0x00008B
  6821. </p></dd>
  6822. <dt>&lsquo;<samp class="samp">DarkCyan</samp>&rsquo;</dt>
  6823. <dd><p>0x008B8B
  6824. </p></dd>
  6825. <dt>&lsquo;<samp class="samp">DarkGoldenRod</samp>&rsquo;</dt>
  6826. <dd><p>0xB8860B
  6827. </p></dd>
  6828. <dt>&lsquo;<samp class="samp">DarkGray</samp>&rsquo;</dt>
  6829. <dd><p>0xA9A9A9
  6830. </p></dd>
  6831. <dt>&lsquo;<samp class="samp">DarkGreen</samp>&rsquo;</dt>
  6832. <dd><p>0x006400
  6833. </p></dd>
  6834. <dt>&lsquo;<samp class="samp">DarkKhaki</samp>&rsquo;</dt>
  6835. <dd><p>0xBDB76B
  6836. </p></dd>
  6837. <dt>&lsquo;<samp class="samp">DarkMagenta</samp>&rsquo;</dt>
  6838. <dd><p>0x8B008B
  6839. </p></dd>
  6840. <dt>&lsquo;<samp class="samp">DarkOliveGreen</samp>&rsquo;</dt>
  6841. <dd><p>0x556B2F
  6842. </p></dd>
  6843. <dt>&lsquo;<samp class="samp">Darkorange</samp>&rsquo;</dt>
  6844. <dd><p>0xFF8C00
  6845. </p></dd>
  6846. <dt>&lsquo;<samp class="samp">DarkOrchid</samp>&rsquo;</dt>
  6847. <dd><p>0x9932CC
  6848. </p></dd>
  6849. <dt>&lsquo;<samp class="samp">DarkRed</samp>&rsquo;</dt>
  6850. <dd><p>0x8B0000
  6851. </p></dd>
  6852. <dt>&lsquo;<samp class="samp">DarkSalmon</samp>&rsquo;</dt>
  6853. <dd><p>0xE9967A
  6854. </p></dd>
  6855. <dt>&lsquo;<samp class="samp">DarkSeaGreen</samp>&rsquo;</dt>
  6856. <dd><p>0x8FBC8F
  6857. </p></dd>
  6858. <dt>&lsquo;<samp class="samp">DarkSlateBlue</samp>&rsquo;</dt>
  6859. <dd><p>0x483D8B
  6860. </p></dd>
  6861. <dt>&lsquo;<samp class="samp">DarkSlateGray</samp>&rsquo;</dt>
  6862. <dd><p>0x2F4F4F
  6863. </p></dd>
  6864. <dt>&lsquo;<samp class="samp">DarkTurquoise</samp>&rsquo;</dt>
  6865. <dd><p>0x00CED1
  6866. </p></dd>
  6867. <dt>&lsquo;<samp class="samp">DarkViolet</samp>&rsquo;</dt>
  6868. <dd><p>0x9400D3
  6869. </p></dd>
  6870. <dt>&lsquo;<samp class="samp">DeepPink</samp>&rsquo;</dt>
  6871. <dd><p>0xFF1493
  6872. </p></dd>
  6873. <dt>&lsquo;<samp class="samp">DeepSkyBlue</samp>&rsquo;</dt>
  6874. <dd><p>0x00BFFF
  6875. </p></dd>
  6876. <dt>&lsquo;<samp class="samp">DimGray</samp>&rsquo;</dt>
  6877. <dd><p>0x696969
  6878. </p></dd>
  6879. <dt>&lsquo;<samp class="samp">DodgerBlue</samp>&rsquo;</dt>
  6880. <dd><p>0x1E90FF
  6881. </p></dd>
  6882. <dt>&lsquo;<samp class="samp">FireBrick</samp>&rsquo;</dt>
  6883. <dd><p>0xB22222
  6884. </p></dd>
  6885. <dt>&lsquo;<samp class="samp">FloralWhite</samp>&rsquo;</dt>
  6886. <dd><p>0xFFFAF0
  6887. </p></dd>
  6888. <dt>&lsquo;<samp class="samp">ForestGreen</samp>&rsquo;</dt>
  6889. <dd><p>0x228B22
  6890. </p></dd>
  6891. <dt>&lsquo;<samp class="samp">Fuchsia</samp>&rsquo;</dt>
  6892. <dd><p>0xFF00FF
  6893. </p></dd>
  6894. <dt>&lsquo;<samp class="samp">Gainsboro</samp>&rsquo;</dt>
  6895. <dd><p>0xDCDCDC
  6896. </p></dd>
  6897. <dt>&lsquo;<samp class="samp">GhostWhite</samp>&rsquo;</dt>
  6898. <dd><p>0xF8F8FF
  6899. </p></dd>
  6900. <dt>&lsquo;<samp class="samp">Gold</samp>&rsquo;</dt>
  6901. <dd><p>0xFFD700
  6902. </p></dd>
  6903. <dt>&lsquo;<samp class="samp">GoldenRod</samp>&rsquo;</dt>
  6904. <dd><p>0xDAA520
  6905. </p></dd>
  6906. <dt>&lsquo;<samp class="samp">Gray</samp>&rsquo;</dt>
  6907. <dd><p>0x808080
  6908. </p></dd>
  6909. <dt>&lsquo;<samp class="samp">Green</samp>&rsquo;</dt>
  6910. <dd><p>0x008000
  6911. </p></dd>
  6912. <dt>&lsquo;<samp class="samp">GreenYellow</samp>&rsquo;</dt>
  6913. <dd><p>0xADFF2F
  6914. </p></dd>
  6915. <dt>&lsquo;<samp class="samp">HoneyDew</samp>&rsquo;</dt>
  6916. <dd><p>0xF0FFF0
  6917. </p></dd>
  6918. <dt>&lsquo;<samp class="samp">HotPink</samp>&rsquo;</dt>
  6919. <dd><p>0xFF69B4
  6920. </p></dd>
  6921. <dt>&lsquo;<samp class="samp">IndianRed</samp>&rsquo;</dt>
  6922. <dd><p>0xCD5C5C
  6923. </p></dd>
  6924. <dt>&lsquo;<samp class="samp">Indigo</samp>&rsquo;</dt>
  6925. <dd><p>0x4B0082
  6926. </p></dd>
  6927. <dt>&lsquo;<samp class="samp">Ivory</samp>&rsquo;</dt>
  6928. <dd><p>0xFFFFF0
  6929. </p></dd>
  6930. <dt>&lsquo;<samp class="samp">Khaki</samp>&rsquo;</dt>
  6931. <dd><p>0xF0E68C
  6932. </p></dd>
  6933. <dt>&lsquo;<samp class="samp">Lavender</samp>&rsquo;</dt>
  6934. <dd><p>0xE6E6FA
  6935. </p></dd>
  6936. <dt>&lsquo;<samp class="samp">LavenderBlush</samp>&rsquo;</dt>
  6937. <dd><p>0xFFF0F5
  6938. </p></dd>
  6939. <dt>&lsquo;<samp class="samp">LawnGreen</samp>&rsquo;</dt>
  6940. <dd><p>0x7CFC00
  6941. </p></dd>
  6942. <dt>&lsquo;<samp class="samp">LemonChiffon</samp>&rsquo;</dt>
  6943. <dd><p>0xFFFACD
  6944. </p></dd>
  6945. <dt>&lsquo;<samp class="samp">LightBlue</samp>&rsquo;</dt>
  6946. <dd><p>0xADD8E6
  6947. </p></dd>
  6948. <dt>&lsquo;<samp class="samp">LightCoral</samp>&rsquo;</dt>
  6949. <dd><p>0xF08080
  6950. </p></dd>
  6951. <dt>&lsquo;<samp class="samp">LightCyan</samp>&rsquo;</dt>
  6952. <dd><p>0xE0FFFF
  6953. </p></dd>
  6954. <dt>&lsquo;<samp class="samp">LightGoldenRodYellow</samp>&rsquo;</dt>
  6955. <dd><p>0xFAFAD2
  6956. </p></dd>
  6957. <dt>&lsquo;<samp class="samp">LightGreen</samp>&rsquo;</dt>
  6958. <dd><p>0x90EE90
  6959. </p></dd>
  6960. <dt>&lsquo;<samp class="samp">LightGrey</samp>&rsquo;</dt>
  6961. <dd><p>0xD3D3D3
  6962. </p></dd>
  6963. <dt>&lsquo;<samp class="samp">LightPink</samp>&rsquo;</dt>
  6964. <dd><p>0xFFB6C1
  6965. </p></dd>
  6966. <dt>&lsquo;<samp class="samp">LightSalmon</samp>&rsquo;</dt>
  6967. <dd><p>0xFFA07A
  6968. </p></dd>
  6969. <dt>&lsquo;<samp class="samp">LightSeaGreen</samp>&rsquo;</dt>
  6970. <dd><p>0x20B2AA
  6971. </p></dd>
  6972. <dt>&lsquo;<samp class="samp">LightSkyBlue</samp>&rsquo;</dt>
  6973. <dd><p>0x87CEFA
  6974. </p></dd>
  6975. <dt>&lsquo;<samp class="samp">LightSlateGray</samp>&rsquo;</dt>
  6976. <dd><p>0x778899
  6977. </p></dd>
  6978. <dt>&lsquo;<samp class="samp">LightSteelBlue</samp>&rsquo;</dt>
  6979. <dd><p>0xB0C4DE
  6980. </p></dd>
  6981. <dt>&lsquo;<samp class="samp">LightYellow</samp>&rsquo;</dt>
  6982. <dd><p>0xFFFFE0
  6983. </p></dd>
  6984. <dt>&lsquo;<samp class="samp">Lime</samp>&rsquo;</dt>
  6985. <dd><p>0x00FF00
  6986. </p></dd>
  6987. <dt>&lsquo;<samp class="samp">LimeGreen</samp>&rsquo;</dt>
  6988. <dd><p>0x32CD32
  6989. </p></dd>
  6990. <dt>&lsquo;<samp class="samp">Linen</samp>&rsquo;</dt>
  6991. <dd><p>0xFAF0E6
  6992. </p></dd>
  6993. <dt>&lsquo;<samp class="samp">Magenta</samp>&rsquo;</dt>
  6994. <dd><p>0xFF00FF
  6995. </p></dd>
  6996. <dt>&lsquo;<samp class="samp">Maroon</samp>&rsquo;</dt>
  6997. <dd><p>0x800000
  6998. </p></dd>
  6999. <dt>&lsquo;<samp class="samp">MediumAquaMarine</samp>&rsquo;</dt>
  7000. <dd><p>0x66CDAA
  7001. </p></dd>
  7002. <dt>&lsquo;<samp class="samp">MediumBlue</samp>&rsquo;</dt>
  7003. <dd><p>0x0000CD
  7004. </p></dd>
  7005. <dt>&lsquo;<samp class="samp">MediumOrchid</samp>&rsquo;</dt>
  7006. <dd><p>0xBA55D3
  7007. </p></dd>
  7008. <dt>&lsquo;<samp class="samp">MediumPurple</samp>&rsquo;</dt>
  7009. <dd><p>0x9370D8
  7010. </p></dd>
  7011. <dt>&lsquo;<samp class="samp">MediumSeaGreen</samp>&rsquo;</dt>
  7012. <dd><p>0x3CB371
  7013. </p></dd>
  7014. <dt>&lsquo;<samp class="samp">MediumSlateBlue</samp>&rsquo;</dt>
  7015. <dd><p>0x7B68EE
  7016. </p></dd>
  7017. <dt>&lsquo;<samp class="samp">MediumSpringGreen</samp>&rsquo;</dt>
  7018. <dd><p>0x00FA9A
  7019. </p></dd>
  7020. <dt>&lsquo;<samp class="samp">MediumTurquoise</samp>&rsquo;</dt>
  7021. <dd><p>0x48D1CC
  7022. </p></dd>
  7023. <dt>&lsquo;<samp class="samp">MediumVioletRed</samp>&rsquo;</dt>
  7024. <dd><p>0xC71585
  7025. </p></dd>
  7026. <dt>&lsquo;<samp class="samp">MidnightBlue</samp>&rsquo;</dt>
  7027. <dd><p>0x191970
  7028. </p></dd>
  7029. <dt>&lsquo;<samp class="samp">MintCream</samp>&rsquo;</dt>
  7030. <dd><p>0xF5FFFA
  7031. </p></dd>
  7032. <dt>&lsquo;<samp class="samp">MistyRose</samp>&rsquo;</dt>
  7033. <dd><p>0xFFE4E1
  7034. </p></dd>
  7035. <dt>&lsquo;<samp class="samp">Moccasin</samp>&rsquo;</dt>
  7036. <dd><p>0xFFE4B5
  7037. </p></dd>
  7038. <dt>&lsquo;<samp class="samp">NavajoWhite</samp>&rsquo;</dt>
  7039. <dd><p>0xFFDEAD
  7040. </p></dd>
  7041. <dt>&lsquo;<samp class="samp">Navy</samp>&rsquo;</dt>
  7042. <dd><p>0x000080
  7043. </p></dd>
  7044. <dt>&lsquo;<samp class="samp">OldLace</samp>&rsquo;</dt>
  7045. <dd><p>0xFDF5E6
  7046. </p></dd>
  7047. <dt>&lsquo;<samp class="samp">Olive</samp>&rsquo;</dt>
  7048. <dd><p>0x808000
  7049. </p></dd>
  7050. <dt>&lsquo;<samp class="samp">OliveDrab</samp>&rsquo;</dt>
  7051. <dd><p>0x6B8E23
  7052. </p></dd>
  7053. <dt>&lsquo;<samp class="samp">Orange</samp>&rsquo;</dt>
  7054. <dd><p>0xFFA500
  7055. </p></dd>
  7056. <dt>&lsquo;<samp class="samp">OrangeRed</samp>&rsquo;</dt>
  7057. <dd><p>0xFF4500
  7058. </p></dd>
  7059. <dt>&lsquo;<samp class="samp">Orchid</samp>&rsquo;</dt>
  7060. <dd><p>0xDA70D6
  7061. </p></dd>
  7062. <dt>&lsquo;<samp class="samp">PaleGoldenRod</samp>&rsquo;</dt>
  7063. <dd><p>0xEEE8AA
  7064. </p></dd>
  7065. <dt>&lsquo;<samp class="samp">PaleGreen</samp>&rsquo;</dt>
  7066. <dd><p>0x98FB98
  7067. </p></dd>
  7068. <dt>&lsquo;<samp class="samp">PaleTurquoise</samp>&rsquo;</dt>
  7069. <dd><p>0xAFEEEE
  7070. </p></dd>
  7071. <dt>&lsquo;<samp class="samp">PaleVioletRed</samp>&rsquo;</dt>
  7072. <dd><p>0xD87093
  7073. </p></dd>
  7074. <dt>&lsquo;<samp class="samp">PapayaWhip</samp>&rsquo;</dt>
  7075. <dd><p>0xFFEFD5
  7076. </p></dd>
  7077. <dt>&lsquo;<samp class="samp">PeachPuff</samp>&rsquo;</dt>
  7078. <dd><p>0xFFDAB9
  7079. </p></dd>
  7080. <dt>&lsquo;<samp class="samp">Peru</samp>&rsquo;</dt>
  7081. <dd><p>0xCD853F
  7082. </p></dd>
  7083. <dt>&lsquo;<samp class="samp">Pink</samp>&rsquo;</dt>
  7084. <dd><p>0xFFC0CB
  7085. </p></dd>
  7086. <dt>&lsquo;<samp class="samp">Plum</samp>&rsquo;</dt>
  7087. <dd><p>0xDDA0DD
  7088. </p></dd>
  7089. <dt>&lsquo;<samp class="samp">PowderBlue</samp>&rsquo;</dt>
  7090. <dd><p>0xB0E0E6
  7091. </p></dd>
  7092. <dt>&lsquo;<samp class="samp">Purple</samp>&rsquo;</dt>
  7093. <dd><p>0x800080
  7094. </p></dd>
  7095. <dt>&lsquo;<samp class="samp">Red</samp>&rsquo;</dt>
  7096. <dd><p>0xFF0000
  7097. </p></dd>
  7098. <dt>&lsquo;<samp class="samp">RosyBrown</samp>&rsquo;</dt>
  7099. <dd><p>0xBC8F8F
  7100. </p></dd>
  7101. <dt>&lsquo;<samp class="samp">RoyalBlue</samp>&rsquo;</dt>
  7102. <dd><p>0x4169E1
  7103. </p></dd>
  7104. <dt>&lsquo;<samp class="samp">SaddleBrown</samp>&rsquo;</dt>
  7105. <dd><p>0x8B4513
  7106. </p></dd>
  7107. <dt>&lsquo;<samp class="samp">Salmon</samp>&rsquo;</dt>
  7108. <dd><p>0xFA8072
  7109. </p></dd>
  7110. <dt>&lsquo;<samp class="samp">SandyBrown</samp>&rsquo;</dt>
  7111. <dd><p>0xF4A460
  7112. </p></dd>
  7113. <dt>&lsquo;<samp class="samp">SeaGreen</samp>&rsquo;</dt>
  7114. <dd><p>0x2E8B57
  7115. </p></dd>
  7116. <dt>&lsquo;<samp class="samp">SeaShell</samp>&rsquo;</dt>
  7117. <dd><p>0xFFF5EE
  7118. </p></dd>
  7119. <dt>&lsquo;<samp class="samp">Sienna</samp>&rsquo;</dt>
  7120. <dd><p>0xA0522D
  7121. </p></dd>
  7122. <dt>&lsquo;<samp class="samp">Silver</samp>&rsquo;</dt>
  7123. <dd><p>0xC0C0C0
  7124. </p></dd>
  7125. <dt>&lsquo;<samp class="samp">SkyBlue</samp>&rsquo;</dt>
  7126. <dd><p>0x87CEEB
  7127. </p></dd>
  7128. <dt>&lsquo;<samp class="samp">SlateBlue</samp>&rsquo;</dt>
  7129. <dd><p>0x6A5ACD
  7130. </p></dd>
  7131. <dt>&lsquo;<samp class="samp">SlateGray</samp>&rsquo;</dt>
  7132. <dd><p>0x708090
  7133. </p></dd>
  7134. <dt>&lsquo;<samp class="samp">Snow</samp>&rsquo;</dt>
  7135. <dd><p>0xFFFAFA
  7136. </p></dd>
  7137. <dt>&lsquo;<samp class="samp">SpringGreen</samp>&rsquo;</dt>
  7138. <dd><p>0x00FF7F
  7139. </p></dd>
  7140. <dt>&lsquo;<samp class="samp">SteelBlue</samp>&rsquo;</dt>
  7141. <dd><p>0x4682B4
  7142. </p></dd>
  7143. <dt>&lsquo;<samp class="samp">Tan</samp>&rsquo;</dt>
  7144. <dd><p>0xD2B48C
  7145. </p></dd>
  7146. <dt>&lsquo;<samp class="samp">Teal</samp>&rsquo;</dt>
  7147. <dd><p>0x008080
  7148. </p></dd>
  7149. <dt>&lsquo;<samp class="samp">Thistle</samp>&rsquo;</dt>
  7150. <dd><p>0xD8BFD8
  7151. </p></dd>
  7152. <dt>&lsquo;<samp class="samp">Tomato</samp>&rsquo;</dt>
  7153. <dd><p>0xFF6347
  7154. </p></dd>
  7155. <dt>&lsquo;<samp class="samp">Turquoise</samp>&rsquo;</dt>
  7156. <dd><p>0x40E0D0
  7157. </p></dd>
  7158. <dt>&lsquo;<samp class="samp">Violet</samp>&rsquo;</dt>
  7159. <dd><p>0xEE82EE
  7160. </p></dd>
  7161. <dt>&lsquo;<samp class="samp">Wheat</samp>&rsquo;</dt>
  7162. <dd><p>0xF5DEB3
  7163. </p></dd>
  7164. <dt>&lsquo;<samp class="samp">White</samp>&rsquo;</dt>
  7165. <dd><p>0xFFFFFF
  7166. </p></dd>
  7167. <dt>&lsquo;<samp class="samp">WhiteSmoke</samp>&rsquo;</dt>
  7168. <dd><p>0xF5F5F5
  7169. </p></dd>
  7170. <dt>&lsquo;<samp class="samp">Yellow</samp>&rsquo;</dt>
  7171. <dd><p>0xFFFF00
  7172. </p></dd>
  7173. <dt>&lsquo;<samp class="samp">YellowGreen</samp>&rsquo;</dt>
  7174. <dd><p>0x9ACD32
  7175. </p></dd>
  7176. </dl>
  7177. <a class="anchor" id="channel-layout-syntax"></a><a name="Channel-Layout"></a>
  7178. <h3 class="section">7.8 Channel Layout<span class="pull-right"><a class="anchor hidden-xs" href="#Channel-Layout" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Channel-Layout" aria-hidden="true">TOC</a></span></h3>
  7179. <p>A channel layout specifies the spatial disposition of the channels in
  7180. a multi-channel audio stream. To specify a channel layout, FFmpeg
  7181. makes use of a special syntax.
  7182. </p>
  7183. <p>Individual channels are identified by an id, as given by the table
  7184. below:
  7185. </p><dl class="table">
  7186. <dt>&lsquo;<samp class="samp">FL</samp>&rsquo;</dt>
  7187. <dd><p>front left
  7188. </p></dd>
  7189. <dt>&lsquo;<samp class="samp">FR</samp>&rsquo;</dt>
  7190. <dd><p>front right
  7191. </p></dd>
  7192. <dt>&lsquo;<samp class="samp">FC</samp>&rsquo;</dt>
  7193. <dd><p>front center
  7194. </p></dd>
  7195. <dt>&lsquo;<samp class="samp">LFE</samp>&rsquo;</dt>
  7196. <dd><p>low frequency
  7197. </p></dd>
  7198. <dt>&lsquo;<samp class="samp">BL</samp>&rsquo;</dt>
  7199. <dd><p>back left
  7200. </p></dd>
  7201. <dt>&lsquo;<samp class="samp">BR</samp>&rsquo;</dt>
  7202. <dd><p>back right
  7203. </p></dd>
  7204. <dt>&lsquo;<samp class="samp">FLC</samp>&rsquo;</dt>
  7205. <dd><p>front left-of-center
  7206. </p></dd>
  7207. <dt>&lsquo;<samp class="samp">FRC</samp>&rsquo;</dt>
  7208. <dd><p>front right-of-center
  7209. </p></dd>
  7210. <dt>&lsquo;<samp class="samp">BC</samp>&rsquo;</dt>
  7211. <dd><p>back center
  7212. </p></dd>
  7213. <dt>&lsquo;<samp class="samp">SL</samp>&rsquo;</dt>
  7214. <dd><p>side left
  7215. </p></dd>
  7216. <dt>&lsquo;<samp class="samp">SR</samp>&rsquo;</dt>
  7217. <dd><p>side right
  7218. </p></dd>
  7219. <dt>&lsquo;<samp class="samp">TC</samp>&rsquo;</dt>
  7220. <dd><p>top center
  7221. </p></dd>
  7222. <dt>&lsquo;<samp class="samp">TFL</samp>&rsquo;</dt>
  7223. <dd><p>top front left
  7224. </p></dd>
  7225. <dt>&lsquo;<samp class="samp">TFC</samp>&rsquo;</dt>
  7226. <dd><p>top front center
  7227. </p></dd>
  7228. <dt>&lsquo;<samp class="samp">TFR</samp>&rsquo;</dt>
  7229. <dd><p>top front right
  7230. </p></dd>
  7231. <dt>&lsquo;<samp class="samp">TBL</samp>&rsquo;</dt>
  7232. <dd><p>top back left
  7233. </p></dd>
  7234. <dt>&lsquo;<samp class="samp">TBC</samp>&rsquo;</dt>
  7235. <dd><p>top back center
  7236. </p></dd>
  7237. <dt>&lsquo;<samp class="samp">TBR</samp>&rsquo;</dt>
  7238. <dd><p>top back right
  7239. </p></dd>
  7240. <dt>&lsquo;<samp class="samp">DL</samp>&rsquo;</dt>
  7241. <dd><p>downmix left
  7242. </p></dd>
  7243. <dt>&lsquo;<samp class="samp">DR</samp>&rsquo;</dt>
  7244. <dd><p>downmix right
  7245. </p></dd>
  7246. <dt>&lsquo;<samp class="samp">WL</samp>&rsquo;</dt>
  7247. <dd><p>wide left
  7248. </p></dd>
  7249. <dt>&lsquo;<samp class="samp">WR</samp>&rsquo;</dt>
  7250. <dd><p>wide right
  7251. </p></dd>
  7252. <dt>&lsquo;<samp class="samp">SDL</samp>&rsquo;</dt>
  7253. <dd><p>surround direct left
  7254. </p></dd>
  7255. <dt>&lsquo;<samp class="samp">SDR</samp>&rsquo;</dt>
  7256. <dd><p>surround direct right
  7257. </p></dd>
  7258. <dt>&lsquo;<samp class="samp">LFE2</samp>&rsquo;</dt>
  7259. <dd><p>low frequency 2
  7260. </p></dd>
  7261. </dl>
  7262. <p>Standard channel layout compositions can be specified by using the
  7263. following identifiers:
  7264. </p><dl class="table">
  7265. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  7266. <dd><p>FC
  7267. </p></dd>
  7268. <dt>&lsquo;<samp class="samp">stereo</samp>&rsquo;</dt>
  7269. <dd><p>FL+FR
  7270. </p></dd>
  7271. <dt>&lsquo;<samp class="samp">2.1</samp>&rsquo;</dt>
  7272. <dd><p>FL+FR+LFE
  7273. </p></dd>
  7274. <dt>&lsquo;<samp class="samp">3.0</samp>&rsquo;</dt>
  7275. <dd><p>FL+FR+FC
  7276. </p></dd>
  7277. <dt>&lsquo;<samp class="samp">3.0(back)</samp>&rsquo;</dt>
  7278. <dd><p>FL+FR+BC
  7279. </p></dd>
  7280. <dt>&lsquo;<samp class="samp">4.0</samp>&rsquo;</dt>
  7281. <dd><p>FL+FR+FC+BC
  7282. </p></dd>
  7283. <dt>&lsquo;<samp class="samp">quad</samp>&rsquo;</dt>
  7284. <dd><p>FL+FR+BL+BR
  7285. </p></dd>
  7286. <dt>&lsquo;<samp class="samp">quad(side)</samp>&rsquo;</dt>
  7287. <dd><p>FL+FR+SL+SR
  7288. </p></dd>
  7289. <dt>&lsquo;<samp class="samp">3.1</samp>&rsquo;</dt>
  7290. <dd><p>FL+FR+FC+LFE
  7291. </p></dd>
  7292. <dt>&lsquo;<samp class="samp">5.0</samp>&rsquo;</dt>
  7293. <dd><p>FL+FR+FC+BL+BR
  7294. </p></dd>
  7295. <dt>&lsquo;<samp class="samp">5.0(side)</samp>&rsquo;</dt>
  7296. <dd><p>FL+FR+FC+SL+SR
  7297. </p></dd>
  7298. <dt>&lsquo;<samp class="samp">4.1</samp>&rsquo;</dt>
  7299. <dd><p>FL+FR+FC+LFE+BC
  7300. </p></dd>
  7301. <dt>&lsquo;<samp class="samp">5.1</samp>&rsquo;</dt>
  7302. <dd><p>FL+FR+FC+LFE+BL+BR
  7303. </p></dd>
  7304. <dt>&lsquo;<samp class="samp">5.1(side)</samp>&rsquo;</dt>
  7305. <dd><p>FL+FR+FC+LFE+SL+SR
  7306. </p></dd>
  7307. <dt>&lsquo;<samp class="samp">6.0</samp>&rsquo;</dt>
  7308. <dd><p>FL+FR+FC+BC+SL+SR
  7309. </p></dd>
  7310. <dt>&lsquo;<samp class="samp">6.0(front)</samp>&rsquo;</dt>
  7311. <dd><p>FL+FR+FLC+FRC+SL+SR
  7312. </p></dd>
  7313. <dt>&lsquo;<samp class="samp">3.1.2</samp>&rsquo;</dt>
  7314. <dd><p>FL+FR+FC+LFE+TFL+TFR
  7315. </p></dd>
  7316. <dt>&lsquo;<samp class="samp">hexagonal</samp>&rsquo;</dt>
  7317. <dd><p>FL+FR+FC+BL+BR+BC
  7318. </p></dd>
  7319. <dt>&lsquo;<samp class="samp">6.1</samp>&rsquo;</dt>
  7320. <dd><p>FL+FR+FC+LFE+BC+SL+SR
  7321. </p></dd>
  7322. <dt>&lsquo;<samp class="samp">6.1</samp>&rsquo;</dt>
  7323. <dd><p>FL+FR+FC+LFE+BL+BR+BC
  7324. </p></dd>
  7325. <dt>&lsquo;<samp class="samp">6.1(front)</samp>&rsquo;</dt>
  7326. <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
  7327. </p></dd>
  7328. <dt>&lsquo;<samp class="samp">7.0</samp>&rsquo;</dt>
  7329. <dd><p>FL+FR+FC+BL+BR+SL+SR
  7330. </p></dd>
  7331. <dt>&lsquo;<samp class="samp">7.0(front)</samp>&rsquo;</dt>
  7332. <dd><p>FL+FR+FC+FLC+FRC+SL+SR
  7333. </p></dd>
  7334. <dt>&lsquo;<samp class="samp">7.1</samp>&rsquo;</dt>
  7335. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
  7336. </p></dd>
  7337. <dt>&lsquo;<samp class="samp">7.1(wide)</samp>&rsquo;</dt>
  7338. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
  7339. </p></dd>
  7340. <dt>&lsquo;<samp class="samp">7.1(wide-side)</samp>&rsquo;</dt>
  7341. <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
  7342. </p></dd>
  7343. <dt>&lsquo;<samp class="samp">5.1.2</samp>&rsquo;</dt>
  7344. <dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR
  7345. </p></dd>
  7346. <dt>&lsquo;<samp class="samp">octagonal</samp>&rsquo;</dt>
  7347. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
  7348. </p></dd>
  7349. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  7350. <dd><p>FL+FR+BL+BR+TFL+TFR+TBL+TBR
  7351. </p></dd>
  7352. <dt>&lsquo;<samp class="samp">5.1.4</samp>&rsquo;</dt>
  7353. <dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR+TBL+TBR
  7354. </p></dd>
  7355. <dt>&lsquo;<samp class="samp">7.1.2</samp>&rsquo;</dt>
  7356. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR
  7357. </p></dd>
  7358. <dt>&lsquo;<samp class="samp">7.1.4</samp>&rsquo;</dt>
  7359. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR
  7360. </p></dd>
  7361. <dt>&lsquo;<samp class="samp">7.2.3</samp>&rsquo;</dt>
  7362. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBC+LFE2
  7363. </p></dd>
  7364. <dt>&lsquo;<samp class="samp">9.1.4</samp>&rsquo;</dt>
  7365. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR
  7366. </p></dd>
  7367. <dt>&lsquo;<samp class="samp">9.1.6</samp>&rsquo;</dt>
  7368. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR+TSL+TSR
  7369. </p></dd>
  7370. <dt>&lsquo;<samp class="samp">hexadecagonal</samp>&rsquo;</dt>
  7371. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
  7372. </p></dd>
  7373. <dt>&lsquo;<samp class="samp">binaural</samp>&rsquo;</dt>
  7374. <dd><p>BIL+BIR
  7375. </p></dd>
  7376. <dt>&lsquo;<samp class="samp">downmix</samp>&rsquo;</dt>
  7377. <dd><p>DL+DR
  7378. </p></dd>
  7379. <dt>&lsquo;<samp class="samp">22.2</samp>&rsquo;</dt>
  7380. <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
  7381. </p></dd>
  7382. </dl>
  7383. <p>A custom channel layout can be specified as a sequence of terms, separated by &rsquo;+&rsquo;.
  7384. Each term can be:
  7385. </p><ul class="itemize mark-bullet">
  7386. <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.),
  7387. each optionally containing a custom name after a &rsquo;@&rsquo;, (e.g. &lsquo;<samp class="samp">FL@Left</samp>&rsquo;,
  7388. &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.)
  7389. </li></ul>
  7390. <p>A standard channel layout can be specified by the following:
  7391. </p><ul class="itemize mark-bullet">
  7392. <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.)
  7393. </li><li>the name of a standard channel layout (e.g. &lsquo;<samp class="samp">mono</samp>&rsquo;,
  7394. &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.)
  7395. </li><li>a number of channels, in decimal, followed by &rsquo;c&rsquo;, yielding the default channel
  7396. layout for that number of channels (see the function
  7397. <code class="code">av_channel_layout_default</code>). Note that not all channel counts have a
  7398. default layout.
  7399. </li><li>a number of channels, in decimal, followed by &rsquo;C&rsquo;, yielding an unknown channel
  7400. layout with the specified number of channels. Note that not all channel layout
  7401. specification strings support unknown channel layouts.
  7402. </li><li>a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
  7403. <code class="code">AV_CH_*</code> macros in <samp class="file">libavutil/channel_layout.h</samp>.
  7404. </li></ul>
  7405. <p>Before libavutil version 53 the trailing character &quot;c&quot; to specify a number of
  7406. channels was optional, but now it is required, while a channel layout mask can
  7407. also be specified as a decimal number (if and only if not followed by &quot;c&quot; or &quot;C&quot;).
  7408. </p>
  7409. <p>See also the function <code class="code">av_channel_layout_from_string</code> defined in
  7410. <samp class="file">libavutil/channel_layout.h</samp>.
  7411. </p>
  7412. <a name="Expression-Evaluation"></a>
  7413. <h2 class="chapter">8 Expression Evaluation<span class="pull-right"><a class="anchor hidden-xs" href="#Expression-Evaluation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expression-Evaluation" aria-hidden="true">TOC</a></span></h2>
  7414. <p>When evaluating an arithmetic expression, FFmpeg uses an internal
  7415. formula evaluator, implemented through the <samp class="file">libavutil/eval.h</samp>
  7416. interface.
  7417. </p>
  7418. <p>An expression may contain unary, binary operators, constants, and
  7419. functions.
  7420. </p>
  7421. <p>Two expressions <var class="var">expr1</var> and <var class="var">expr2</var> can be combined to form
  7422. another expression &quot;<var class="var">expr1</var>;<var class="var">expr2</var>&quot;.
  7423. <var class="var">expr1</var> and <var class="var">expr2</var> are evaluated in turn, and the new
  7424. expression evaluates to the value of <var class="var">expr2</var>.
  7425. </p>
  7426. <p>The following binary operators are available: <code class="code">+</code>, <code class="code">-</code>,
  7427. <code class="code">*</code>, <code class="code">/</code>, <code class="code">^</code>.
  7428. </p>
  7429. <p>The following unary operators are available: <code class="code">+</code>, <code class="code">-</code>.
  7430. </p>
  7431. <p>Some internal variables can be used to store and load intermediary
  7432. results. They can be accessed using the <code class="code">ld</code> and <code class="code">st</code>
  7433. functions with an index argument varying from 0 to 9 to specify which
  7434. internal variable to access.
  7435. </p>
  7436. <p>The following functions are available:
  7437. </p><dl class="table">
  7438. <dt><samp class="option">abs(x)</samp></dt>
  7439. <dd><p>Compute absolute value of <var class="var">x</var>.
  7440. </p>
  7441. </dd>
  7442. <dt><samp class="option">acos(x)</samp></dt>
  7443. <dd><p>Compute arccosine of <var class="var">x</var>.
  7444. </p>
  7445. </dd>
  7446. <dt><samp class="option">asin(x)</samp></dt>
  7447. <dd><p>Compute arcsine of <var class="var">x</var>.
  7448. </p>
  7449. </dd>
  7450. <dt><samp class="option">atan(x)</samp></dt>
  7451. <dd><p>Compute arctangent of <var class="var">x</var>.
  7452. </p>
  7453. </dd>
  7454. <dt><samp class="option">atan2(y, x)</samp></dt>
  7455. <dd><p>Compute principal value of the arc tangent of <var class="var">y</var>/<var class="var">x</var>.
  7456. </p>
  7457. </dd>
  7458. <dt><samp class="option">between(x, min, max)</samp></dt>
  7459. <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
  7460. equal to <var class="var">max</var>, 0 otherwise.
  7461. </p>
  7462. </dd>
  7463. <dt><samp class="option">bitand(x, y)</samp></dt>
  7464. <dt><samp class="option">bitor(x, y)</samp></dt>
  7465. <dd><p>Compute bitwise and/or operation on <var class="var">x</var> and <var class="var">y</var>.
  7466. </p>
  7467. <p>The results of the evaluation of <var class="var">x</var> and <var class="var">y</var> are converted to
  7468. integers before executing the bitwise operation.
  7469. </p>
  7470. <p>Note that both the conversion to integer and the conversion back to
  7471. floating point can lose precision. Beware of unexpected results for
  7472. large numbers (usually 2^53 and larger).
  7473. </p>
  7474. </dd>
  7475. <dt><samp class="option">ceil(expr)</samp></dt>
  7476. <dd><p>Round the value of expression <var class="var">expr</var> upwards to the nearest
  7477. integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
  7478. </p>
  7479. </dd>
  7480. <dt><samp class="option">clip(x, min, max)</samp></dt>
  7481. <dd><p>Return the value of <var class="var">x</var> clipped between <var class="var">min</var> and <var class="var">max</var>.
  7482. </p>
  7483. </dd>
  7484. <dt><samp class="option">cos(x)</samp></dt>
  7485. <dd><p>Compute cosine of <var class="var">x</var>.
  7486. </p>
  7487. </dd>
  7488. <dt><samp class="option">cosh(x)</samp></dt>
  7489. <dd><p>Compute hyperbolic cosine of <var class="var">x</var>.
  7490. </p>
  7491. </dd>
  7492. <dt><samp class="option">eq(x, y)</samp></dt>
  7493. <dd><p>Return 1 if <var class="var">x</var> and <var class="var">y</var> are equivalent, 0 otherwise.
  7494. </p>
  7495. </dd>
  7496. <dt><samp class="option">exp(x)</samp></dt>
  7497. <dd><p>Compute exponential of <var class="var">x</var> (with base <code class="code">e</code>, the Euler&rsquo;s number).
  7498. </p>
  7499. </dd>
  7500. <dt><samp class="option">floor(expr)</samp></dt>
  7501. <dd><p>Round the value of expression <var class="var">expr</var> downwards to the nearest
  7502. integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
  7503. </p>
  7504. </dd>
  7505. <dt><samp class="option">gauss(x)</samp></dt>
  7506. <dd><p>Compute Gauss function of <var class="var">x</var>, corresponding to
  7507. <code class="code">exp(-x*x/2) / sqrt(2*PI)</code>.
  7508. </p>
  7509. </dd>
  7510. <dt><samp class="option">gcd(x, y)</samp></dt>
  7511. <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
  7512. <var class="var">y</var> are 0 or either or both are less than zero then behavior is undefined.
  7513. </p>
  7514. </dd>
  7515. <dt><samp class="option">gt(x, y)</samp></dt>
  7516. <dd><p>Return 1 if <var class="var">x</var> is greater than <var class="var">y</var>, 0 otherwise.
  7517. </p>
  7518. </dd>
  7519. <dt><samp class="option">gte(x, y)</samp></dt>
  7520. <dd><p>Return 1 if <var class="var">x</var> is greater than or equal to <var class="var">y</var>, 0 otherwise.
  7521. </p>
  7522. </dd>
  7523. <dt><samp class="option">hypot(x, y)</samp></dt>
  7524. <dd><p>This function is similar to the C function with the same name; it returns
  7525. &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
  7526. right triangle with sides of length <var class="var">x</var> and <var class="var">y</var>, or the distance of the
  7527. point (<var class="var">x</var>, <var class="var">y</var>) from the origin.
  7528. </p>
  7529. </dd>
  7530. <dt><samp class="option">if(x, y)</samp></dt>
  7531. <dd><p>Evaluate <var class="var">x</var>, and if the result is non-zero return the result of
  7532. the evaluation of <var class="var">y</var>, return 0 otherwise.
  7533. </p>
  7534. </dd>
  7535. <dt><samp class="option">if(x, y, z)</samp></dt>
  7536. <dd><p>Evaluate <var class="var">x</var>, and if the result is non-zero return the evaluation
  7537. result of <var class="var">y</var>, otherwise the evaluation result of <var class="var">z</var>.
  7538. </p>
  7539. </dd>
  7540. <dt><samp class="option">ifnot(x, y)</samp></dt>
  7541. <dd><p>Evaluate <var class="var">x</var>, and if the result is zero return the result of the
  7542. evaluation of <var class="var">y</var>, return 0 otherwise.
  7543. </p>
  7544. </dd>
  7545. <dt><samp class="option">ifnot(x, y, z)</samp></dt>
  7546. <dd><p>Evaluate <var class="var">x</var>, and if the result is zero return the evaluation
  7547. result of <var class="var">y</var>, otherwise the evaluation result of <var class="var">z</var>.
  7548. </p>
  7549. </dd>
  7550. <dt><samp class="option">isinf(x)</samp></dt>
  7551. <dd><p>Return 1.0 if <var class="var">x</var> is +/-INFINITY, 0.0 otherwise.
  7552. </p>
  7553. </dd>
  7554. <dt><samp class="option">isnan(x)</samp></dt>
  7555. <dd><p>Return 1.0 if <var class="var">x</var> is NAN, 0.0 otherwise.
  7556. </p>
  7557. </dd>
  7558. <dt><samp class="option">ld(idx)</samp></dt>
  7559. <dd><p>Load the value of the internal variable with index <var class="var">idx</var>, which was
  7560. previously stored with st(<var class="var">idx</var>, <var class="var">expr</var>).
  7561. The function returns the loaded value.
  7562. </p>
  7563. </dd>
  7564. <dt><samp class="option">lerp(x, y, z)</samp></dt>
  7565. <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>.
  7566. </p>
  7567. </dd>
  7568. <dt><samp class="option">log(x)</samp></dt>
  7569. <dd><p>Compute natural logarithm of <var class="var">x</var>.
  7570. </p>
  7571. </dd>
  7572. <dt><samp class="option">lt(x, y)</samp></dt>
  7573. <dd><p>Return 1 if <var class="var">x</var> is lesser than <var class="var">y</var>, 0 otherwise.
  7574. </p>
  7575. </dd>
  7576. <dt><samp class="option">lte(x, y)</samp></dt>
  7577. <dd><p>Return 1 if <var class="var">x</var> is lesser than or equal to <var class="var">y</var>, 0 otherwise.
  7578. </p>
  7579. </dd>
  7580. <dt><samp class="option">max(x, y)</samp></dt>
  7581. <dd><p>Return the maximum between <var class="var">x</var> and <var class="var">y</var>.
  7582. </p>
  7583. </dd>
  7584. <dt><samp class="option">min(x, y)</samp></dt>
  7585. <dd><p>Return the minimum between <var class="var">x</var> and <var class="var">y</var>.
  7586. </p>
  7587. </dd>
  7588. <dt><samp class="option">mod(x, y)</samp></dt>
  7589. <dd><p>Compute the remainder of division of <var class="var">x</var> by <var class="var">y</var>.
  7590. </p>
  7591. </dd>
  7592. <dt><samp class="option">not(expr)</samp></dt>
  7593. <dd><p>Return 1.0 if <var class="var">expr</var> is zero, 0.0 otherwise.
  7594. </p>
  7595. </dd>
  7596. <dt><samp class="option">pow(x, y)</samp></dt>
  7597. <dd><p>Compute the power of <var class="var">x</var> elevated <var class="var">y</var>, it is equivalent to
  7598. &quot;(<var class="var">x</var>)^(<var class="var">y</var>)&quot;.
  7599. </p>
  7600. </dd>
  7601. <dt><samp class="option">print(t)</samp></dt>
  7602. <dt><samp class="option">print(t, l)</samp></dt>
  7603. <dd><p>Print the value of expression <var class="var">t</var> with loglevel <var class="var">l</var>. If <var class="var">l</var> is not
  7604. specified then a default log level is used.
  7605. Return the value of the expression printed.
  7606. </p>
  7607. </dd>
  7608. <dt><samp class="option">random(idx)</samp></dt>
  7609. <dd><p>Return a pseudo random value between 0.0 and 1.0. <var class="var">idx</var> is the
  7610. index of the internal variable used to save the seed/state, which can be
  7611. previously stored with <code class="code">st(idx)</code>.
  7612. </p>
  7613. <p>To initialize the seed, you need to store the seed value as a 64-bit
  7614. unsigned integer in the internal variable with index <var class="var">idx</var>.
  7615. </p>
  7616. <p>For example, to store the seed with value <code class="code">42</code> in the internal
  7617. variable with index <code class="code">0</code> and print a few random values:
  7618. </p><div class="example">
  7619. <pre class="example-preformatted">st(0,42); print(random(0)); print(random(0)); print(random(0))
  7620. </pre></div>
  7621. </dd>
  7622. <dt><samp class="option">randomi(idx, min, max)</samp></dt>
  7623. <dd><p>Return a pseudo random value in the interval between <var class="var">min</var> and
  7624. <var class="var">max</var>. <var class="var">idx</var> is the index of the internal variable which will be used to
  7625. save the seed/state, which can be previously stored with <code class="code">st(idx)</code>.
  7626. </p>
  7627. <p>To initialize the seed, you need to store the seed value as a 64-bit
  7628. unsigned integer in the internal variable with index <var class="var">idx</var>.
  7629. </p>
  7630. </dd>
  7631. <dt><samp class="option">root(expr, max)</samp></dt>
  7632. <dd><p>Find an input value for which the function represented by <var class="var">expr</var>
  7633. with argument <var class="var">ld(0)</var> is 0 in the interval 0..<var class="var">max</var>.
  7634. </p>
  7635. <p>The expression in <var class="var">expr</var> must denote a continuous function or the
  7636. result is undefined.
  7637. </p>
  7638. <p><var class="var">ld(0)</var> is used to represent the function input value, which means that the
  7639. given expression will be evaluated multiple times with various input values that
  7640. the expression can access through <code class="code">ld(0)</code>. When the expression evaluates to
  7641. 0 then the corresponding input value will be returned.
  7642. </p>
  7643. </dd>
  7644. <dt><samp class="option">round(expr)</samp></dt>
  7645. <dd><p>Round the value of expression <var class="var">expr</var> to the nearest integer. For example,
  7646. &quot;round(1.5)&quot; is &quot;2.0&quot;.
  7647. </p>
  7648. </dd>
  7649. <dt><samp class="option">sgn(x)</samp></dt>
  7650. <dd><p>Compute sign of <var class="var">x</var>.
  7651. </p>
  7652. </dd>
  7653. <dt><samp class="option">sin(x)</samp></dt>
  7654. <dd><p>Compute sine of <var class="var">x</var>.
  7655. </p>
  7656. </dd>
  7657. <dt><samp class="option">sinh(x)</samp></dt>
  7658. <dd><p>Compute hyperbolic sine of <var class="var">x</var>.
  7659. </p>
  7660. </dd>
  7661. <dt><samp class="option">sqrt(expr)</samp></dt>
  7662. <dd><p>Compute the square root of <var class="var">expr</var>. This is equivalent to
  7663. &quot;(<var class="var">expr</var>)^.5&quot;.
  7664. </p>
  7665. </dd>
  7666. <dt><samp class="option">squish(x)</samp></dt>
  7667. <dd><p>Compute expression <code class="code">1/(1 + exp(4*x))</code>.
  7668. </p>
  7669. </dd>
  7670. <dt><samp class="option">st(idx, expr)</samp></dt>
  7671. <dd><p>Store the value of the expression <var class="var">expr</var> in an internal
  7672. variable. <var class="var">idx</var> specifies the index of the variable where to store
  7673. the value, and it is a value ranging from 0 to 9. The function returns
  7674. the value stored in the internal variable.
  7675. </p>
  7676. <p>The stored value can be retrieved with <code class="code">ld(var)</code>.
  7677. </p>
  7678. <p>Note: variables are currently not shared between expressions.
  7679. </p>
  7680. </dd>
  7681. <dt><samp class="option">tan(x)</samp></dt>
  7682. <dd><p>Compute tangent of <var class="var">x</var>.
  7683. </p>
  7684. </dd>
  7685. <dt><samp class="option">tanh(x)</samp></dt>
  7686. <dd><p>Compute hyperbolic tangent of <var class="var">x</var>.
  7687. </p>
  7688. </dd>
  7689. <dt><samp class="option">taylor(expr, x)</samp></dt>
  7690. <dt><samp class="option">taylor(expr, x, idx)</samp></dt>
  7691. <dd><p>Evaluate a Taylor series at <var class="var">x</var>, given an expression representing
  7692. the <code class="code">ld(idx)</code>-th derivative of a function at 0.
  7693. </p>
  7694. <p>When the series does not converge the result is undefined.
  7695. </p>
  7696. <p><var class="var">ld(idx)</var> is used to represent the derivative order in <var class="var">expr</var>,
  7697. which means that the given expression will be evaluated multiple times
  7698. with various input values that the expression can access through
  7699. <code class="code">ld(idx)</code>. If <var class="var">idx</var> is not specified then 0 is assumed.
  7700. </p>
  7701. <p>Note, when you have the derivatives at y instead of 0,
  7702. <code class="code">taylor(expr, x-y)</code> can be used.
  7703. </p>
  7704. </dd>
  7705. <dt><samp class="option">time(0)</samp></dt>
  7706. <dd><p>Return the current (wallclock) time in seconds.
  7707. </p>
  7708. </dd>
  7709. <dt><samp class="option">trunc(expr)</samp></dt>
  7710. <dd><p>Round the value of expression <var class="var">expr</var> towards zero to the nearest
  7711. integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
  7712. </p>
  7713. </dd>
  7714. <dt><samp class="option">while(cond, expr)</samp></dt>
  7715. <dd><p>Evaluate expression <var class="var">expr</var> while the expression <var class="var">cond</var> is
  7716. non-zero, and returns the value of the last <var class="var">expr</var> evaluation, or
  7717. NAN if <var class="var">cond</var> was always false.
  7718. </p></dd>
  7719. </dl>
  7720. <p>The following constants are available:
  7721. </p><dl class="table">
  7722. <dt><samp class="option">PI</samp></dt>
  7723. <dd><p>area of the unit disc, approximately 3.14
  7724. </p></dd>
  7725. <dt><samp class="option">E</samp></dt>
  7726. <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
  7727. </p></dd>
  7728. <dt><samp class="option">PHI</samp></dt>
  7729. <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
  7730. </p></dd>
  7731. </dl>
  7732. <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
  7733. value, note that:
  7734. </p>
  7735. <p><code class="code">*</code> works like AND
  7736. </p>
  7737. <p><code class="code">+</code> works like OR
  7738. </p>
  7739. <p>For example the construct:
  7740. </p><div class="example">
  7741. <pre class="example-preformatted">if (A AND B) then C
  7742. </pre></div>
  7743. <p>is equivalent to:
  7744. </p><div class="example">
  7745. <pre class="example-preformatted">if(A*B, C)
  7746. </pre></div>
  7747. <p>In your C code, you can extend the list of unary and binary functions,
  7748. and define recognized constants, so that they are available for your
  7749. expressions.
  7750. </p>
  7751. <p>The evaluator also recognizes the International System unit prefixes.
  7752. If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
  7753. are based on powers of 1024 instead of powers of 1000.
  7754. The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
  7755. unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
  7756. &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
  7757. </p>
  7758. <p>The list of available International System prefixes follows, with
  7759. indication of the corresponding powers of 10 and of 2.
  7760. </p><dl class="table">
  7761. <dt><samp class="option">y</samp></dt>
  7762. <dd><p>10^-24 / 2^-80
  7763. </p></dd>
  7764. <dt><samp class="option">z</samp></dt>
  7765. <dd><p>10^-21 / 2^-70
  7766. </p></dd>
  7767. <dt><samp class="option">a</samp></dt>
  7768. <dd><p>10^-18 / 2^-60
  7769. </p></dd>
  7770. <dt><samp class="option">f</samp></dt>
  7771. <dd><p>10^-15 / 2^-50
  7772. </p></dd>
  7773. <dt><samp class="option">p</samp></dt>
  7774. <dd><p>10^-12 / 2^-40
  7775. </p></dd>
  7776. <dt><samp class="option">n</samp></dt>
  7777. <dd><p>10^-9 / 2^-30
  7778. </p></dd>
  7779. <dt><samp class="option">u</samp></dt>
  7780. <dd><p>10^-6 / 2^-20
  7781. </p></dd>
  7782. <dt><samp class="option">m</samp></dt>
  7783. <dd><p>10^-3 / 2^-10
  7784. </p></dd>
  7785. <dt><samp class="option">c</samp></dt>
  7786. <dd><p>10^-2
  7787. </p></dd>
  7788. <dt><samp class="option">d</samp></dt>
  7789. <dd><p>10^-1
  7790. </p></dd>
  7791. <dt><samp class="option">h</samp></dt>
  7792. <dd><p>10^2
  7793. </p></dd>
  7794. <dt><samp class="option">k</samp></dt>
  7795. <dd><p>10^3 / 2^10
  7796. </p></dd>
  7797. <dt><samp class="option">K</samp></dt>
  7798. <dd><p>10^3 / 2^10
  7799. </p></dd>
  7800. <dt><samp class="option">M</samp></dt>
  7801. <dd><p>10^6 / 2^20
  7802. </p></dd>
  7803. <dt><samp class="option">G</samp></dt>
  7804. <dd><p>10^9 / 2^30
  7805. </p></dd>
  7806. <dt><samp class="option">T</samp></dt>
  7807. <dd><p>10^12 / 2^40
  7808. </p></dd>
  7809. <dt><samp class="option">P</samp></dt>
  7810. <dd><p>10^15 / 2^50
  7811. </p></dd>
  7812. <dt><samp class="option">E</samp></dt>
  7813. <dd><p>10^18 / 2^60
  7814. </p></dd>
  7815. <dt><samp class="option">Z</samp></dt>
  7816. <dd><p>10^21 / 2^70
  7817. </p></dd>
  7818. <dt><samp class="option">Y</samp></dt>
  7819. <dd><p>10^24 / 2^80
  7820. </p></dd>
  7821. </dl>
  7822. <a class="anchor" id="codec_002doptions"></a><a name="Codec-Options"></a>
  7823. <h2 class="chapter">9 Codec Options<span class="pull-right"><a class="anchor hidden-xs" href="#Codec-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Codec-Options" aria-hidden="true">TOC</a></span></h2>
  7824. <p>libavcodec provides some generic global options, which can be set on
  7825. all the encoders and decoders. In addition, each codec may support
  7826. so-called private options, which are specific for a given codec.
  7827. </p>
  7828. <p>Sometimes, a global option may only affect a specific kind of codec,
  7829. and may be nonsensical or ignored by another, so you need to be aware
  7830. of the meaning of the specified options. Also some options are
  7831. meant only for decoding or encoding.
  7832. </p>
  7833. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  7834. FFmpeg tools, or by setting the value explicitly in the
  7835. <code class="code">AVCodecContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  7836. for programmatic use.
  7837. </p>
  7838. <p>The list of supported options follow:
  7839. </p>
  7840. <dl class="table">
  7841. <dt><samp class="option">b <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  7842. <dd><p>Set bitrate in bits/s. Default value is 200K.
  7843. </p>
  7844. </dd>
  7845. <dt><samp class="option">ab <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  7846. <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
  7847. </p>
  7848. </dd>
  7849. <dt><samp class="option">bt <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7850. <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
  7851. tolerance specifies how far ratecontrol is willing to deviate from the
  7852. target average bitrate value. This is not related to min/max
  7853. bitrate. Lowering tolerance too much has an adverse effect on quality.
  7854. </p>
  7855. </dd>
  7856. <dt><samp class="option">flags <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  7857. <dd><p>Set generic flags.
  7858. </p>
  7859. <p>Possible values:
  7860. </p><dl class="table">
  7861. <dt>&lsquo;<samp class="samp">mv4</samp>&rsquo;</dt>
  7862. <dd><p>Use four motion vector by macroblock (mpeg4).
  7863. </p></dd>
  7864. <dt>&lsquo;<samp class="samp">qpel</samp>&rsquo;</dt>
  7865. <dd><p>Use 1/4 pel motion compensation.
  7866. </p></dd>
  7867. <dt>&lsquo;<samp class="samp">loop</samp>&rsquo;</dt>
  7868. <dd><p>Use loop filter.
  7869. </p></dd>
  7870. <dt>&lsquo;<samp class="samp">qscale</samp>&rsquo;</dt>
  7871. <dd><p>Use fixed qscale.
  7872. </p></dd>
  7873. <dt>&lsquo;<samp class="samp">pass1</samp>&rsquo;</dt>
  7874. <dd><p>Use internal 2pass ratecontrol in first pass mode.
  7875. </p></dd>
  7876. <dt>&lsquo;<samp class="samp">pass2</samp>&rsquo;</dt>
  7877. <dd><p>Use internal 2pass ratecontrol in second pass mode.
  7878. </p></dd>
  7879. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  7880. <dd><p>Only decode/encode grayscale.
  7881. </p></dd>
  7882. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  7883. <dd><p>Set error[?] variables during encoding.
  7884. </p></dd>
  7885. <dt>&lsquo;<samp class="samp">truncated</samp>&rsquo;</dt>
  7886. <dd><p>Input bitstream might be randomly truncated.
  7887. </p></dd>
  7888. <dt>&lsquo;<samp class="samp">drop_changed</samp>&rsquo;</dt>
  7889. <dd><p>Don&rsquo;t output frames whose parameters differ from first decoded frame in stream.
  7890. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
  7891. </p>
  7892. </dd>
  7893. <dt>&lsquo;<samp class="samp">ildct</samp>&rsquo;</dt>
  7894. <dd><p>Use interlaced DCT.
  7895. </p></dd>
  7896. <dt>&lsquo;<samp class="samp">low_delay</samp>&rsquo;</dt>
  7897. <dd><p>Force low delay.
  7898. </p></dd>
  7899. <dt>&lsquo;<samp class="samp">global_header</samp>&rsquo;</dt>
  7900. <dd><p>Place global headers in extradata instead of every keyframe.
  7901. </p></dd>
  7902. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  7903. <dd><p>Only write platform-, build- and time-independent data. (except (I)DCT).
  7904. This ensures that file and data checksums are reproducible and match between
  7905. platforms. Its primary use is for regression testing.
  7906. </p></dd>
  7907. <dt>&lsquo;<samp class="samp">aic</samp>&rsquo;</dt>
  7908. <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
  7909. </p></dd>
  7910. <dt>&lsquo;<samp class="samp">ilme</samp>&rsquo;</dt>
  7911. <dd><p>Apply interlaced motion estimation.
  7912. </p></dd>
  7913. <dt>&lsquo;<samp class="samp">cgop</samp>&rsquo;</dt>
  7914. <dd><p>Use closed gop.
  7915. </p></dd>
  7916. <dt>&lsquo;<samp class="samp">output_corrupt</samp>&rsquo;</dt>
  7917. <dd><p>Output even potentially corrupted frames.
  7918. </p></dd>
  7919. </dl>
  7920. </dd>
  7921. <dt><samp class="option">time_base <var class="var">rational number</var></samp></dt>
  7922. <dd><p>Set codec time base.
  7923. </p>
  7924. <p>It is the fundamental unit of time (in seconds) in terms of which
  7925. frame timestamps are represented. For fixed-fps content, timebase
  7926. should be <code class="code">1 / frame_rate</code> and timestamp increments should be
  7927. identically 1.
  7928. </p>
  7929. </dd>
  7930. <dt><samp class="option">g <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7931. <dd><p>Set the group of picture (GOP) size. Default value is 12.
  7932. </p>
  7933. </dd>
  7934. <dt><samp class="option">ar <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  7935. <dd><p>Set audio sampling rate (in Hz).
  7936. </p>
  7937. </dd>
  7938. <dt><samp class="option">ac <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  7939. <dd><p>Set number of audio channels.
  7940. </p>
  7941. </dd>
  7942. <dt><samp class="option">cutoff <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  7943. <dd><p>Set cutoff bandwidth. (Supported only by selected encoders, see
  7944. their respective documentation sections.)
  7945. </p>
  7946. </dd>
  7947. <dt><samp class="option">frame_size <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  7948. <dd><p>Set audio frame size.
  7949. </p>
  7950. <p>Each submitted frame except the last must contain exactly frame_size
  7951. samples per channel. May be 0 when the codec has
  7952. CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
  7953. restricted. It is set by some decoders to indicate constant frame
  7954. size.
  7955. </p>
  7956. </dd>
  7957. <dt><samp class="option">frame_number <var class="var">integer</var></samp></dt>
  7958. <dd><p>Set the frame number.
  7959. </p>
  7960. </dd>
  7961. <dt><samp class="option">delay <var class="var">integer</var></samp></dt>
  7962. <dt><samp class="option">qcomp <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7963. <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
  7964. in the ratecontrol equation. Recommended range for default rc_eq:
  7965. 0.0-1.0.
  7966. </p>
  7967. </dd>
  7968. <dt><samp class="option">qblur <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7969. <dd><p>Set video quantizer scale blur (VBR).
  7970. </p>
  7971. </dd>
  7972. <dt><samp class="option">qmin <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7973. <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
  7974. 69, default value is 2.
  7975. </p>
  7976. </dd>
  7977. <dt><samp class="option">qmax <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7978. <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
  7979. 1024, default value is 31.
  7980. </p>
  7981. </dd>
  7982. <dt><samp class="option">qdiff <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7983. <dd><p>Set max difference between the quantizer scale (VBR).
  7984. </p>
  7985. </dd>
  7986. <dt><samp class="option">bf <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7987. <dd><p>Set max number of B frames between non-B-frames.
  7988. </p>
  7989. <p>Must be an integer between -1 and 16. 0 means that B-frames are
  7990. disabled. If a value of -1 is used, it will choose an automatic value
  7991. depending on the encoder.
  7992. </p>
  7993. <p>Default value is 0.
  7994. </p>
  7995. </dd>
  7996. <dt><samp class="option">b_qfactor <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7997. <dd><p>Set qp factor between P and B frames.
  7998. </p>
  7999. </dd>
  8000. <dt><samp class="option">codec_tag <var class="var">integer</var></samp></dt>
  8001. <dt><samp class="option">bug <var class="var">flags</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8002. <dd><p>Workaround not auto detected encoder bugs.
  8003. </p>
  8004. <p>Possible values:
  8005. </p><dl class="table">
  8006. <dt>&lsquo;<samp class="samp">autodetect</samp>&rsquo;</dt>
  8007. <dt>&lsquo;<samp class="samp">xvid_ilace</samp>&rsquo;</dt>
  8008. <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
  8009. </p></dd>
  8010. <dt>&lsquo;<samp class="samp">ump4</samp>&rsquo;</dt>
  8011. <dd><p>(autodetected if fourcc==UMP4)
  8012. </p></dd>
  8013. <dt>&lsquo;<samp class="samp">no_padding</samp>&rsquo;</dt>
  8014. <dd><p>padding bug (autodetected)
  8015. </p></dd>
  8016. <dt>&lsquo;<samp class="samp">amv</samp>&rsquo;</dt>
  8017. <dt>&lsquo;<samp class="samp">qpel_chroma</samp>&rsquo;</dt>
  8018. <dt>&lsquo;<samp class="samp">std_qpel</samp>&rsquo;</dt>
  8019. <dd><p>old standard qpel (autodetected per fourcc/version)
  8020. </p></dd>
  8021. <dt>&lsquo;<samp class="samp">qpel_chroma2</samp>&rsquo;</dt>
  8022. <dt>&lsquo;<samp class="samp">direct_blocksize</samp>&rsquo;</dt>
  8023. <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
  8024. </p></dd>
  8025. <dt>&lsquo;<samp class="samp">edge</samp>&rsquo;</dt>
  8026. <dd><p>edge padding bug (autodetected per fourcc/version)
  8027. </p></dd>
  8028. <dt>&lsquo;<samp class="samp">hpel_chroma</samp>&rsquo;</dt>
  8029. <dt>&lsquo;<samp class="samp">dc_clip</samp>&rsquo;</dt>
  8030. <dt>&lsquo;<samp class="samp">ms</samp>&rsquo;</dt>
  8031. <dd><p>Workaround various bugs in microsoft broken decoders.
  8032. </p></dd>
  8033. <dt>&lsquo;<samp class="samp">trunc</samp>&rsquo;</dt>
  8034. <dd><p>trancated frames
  8035. </p></dd>
  8036. </dl>
  8037. </dd>
  8038. <dt><samp class="option">strict <var class="var">integer</var> (<em class="emph">decoding/encoding,audio,video</em>)</samp></dt>
  8039. <dd><p>Specify how strictly to follow the standards.
  8040. </p>
  8041. <p>Possible values:
  8042. </p><dl class="table">
  8043. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  8044. <dd><p>strictly conform to an older more strict version of the spec or reference software
  8045. </p></dd>
  8046. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  8047. <dd><p>strictly conform to all the things in the spec no matter what consequences
  8048. </p></dd>
  8049. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  8050. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  8051. <dd><p>allow unofficial extensions
  8052. </p></dd>
  8053. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  8054. <dd><p>allow non standardized experimental things, experimental
  8055. (unfinished/work in progress/not well tested) decoders and encoders.
  8056. Note: experimental decoders can pose a security risk, do not use this for
  8057. decoding untrusted input.
  8058. </p></dd>
  8059. </dl>
  8060. </dd>
  8061. <dt><samp class="option">b_qoffset <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8062. <dd><p>Set QP offset between P and B frames.
  8063. </p>
  8064. </dd>
  8065. <dt><samp class="option">err_detect <var class="var">flags</var> (<em class="emph">decoding,audio,video</em>)</samp></dt>
  8066. <dd><p>Set error detection flags.
  8067. </p>
  8068. <p>Possible values:
  8069. </p><dl class="table">
  8070. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  8071. <dd><p>verify embedded CRCs
  8072. </p></dd>
  8073. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  8074. <dd><p>detect bitstream specification deviations
  8075. </p></dd>
  8076. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  8077. <dd><p>detect improper bitstream length
  8078. </p></dd>
  8079. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  8080. <dd><p>abort decoding on minor error detection
  8081. </p></dd>
  8082. <dt>&lsquo;<samp class="samp">ignore_err</samp>&rsquo;</dt>
  8083. <dd><p>ignore decoding errors, and continue decoding.
  8084. This is useful if you want to analyze the content of a video and thus want
  8085. everything to be decoded no matter what. This option will not result in a video
  8086. that is pleasing to watch in case of errors.
  8087. </p></dd>
  8088. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  8089. <dd><p>consider things that violate the spec and have not been seen in the wild as errors
  8090. </p></dd>
  8091. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  8092. <dd><p>consider all spec non compliancies as errors
  8093. </p></dd>
  8094. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  8095. <dd><p>consider things that a sane encoder should not do as an error
  8096. </p></dd>
  8097. </dl>
  8098. </dd>
  8099. <dt><samp class="option">has_b_frames <var class="var">integer</var></samp></dt>
  8100. <dt><samp class="option">block_align <var class="var">integer</var></samp></dt>
  8101. <dt><samp class="option">rc_override_count <var class="var">integer</var></samp></dt>
  8102. <dt><samp class="option">maxrate <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8103. <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
  8104. </p>
  8105. </dd>
  8106. <dt><samp class="option">minrate <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8107. <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
  8108. encode. It is of little use elsewise.
  8109. </p>
  8110. </dd>
  8111. <dt><samp class="option">bufsize <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8112. <dd><p>Set ratecontrol buffer size (in bits).
  8113. </p>
  8114. </dd>
  8115. <dt><samp class="option">i_qfactor <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8116. <dd><p>Set QP factor between P and I frames.
  8117. </p>
  8118. </dd>
  8119. <dt><samp class="option">i_qoffset <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8120. <dd><p>Set QP offset between P and I frames.
  8121. </p>
  8122. </dd>
  8123. <dt><samp class="option">dct <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8124. <dd><p>Set DCT algorithm.
  8125. </p>
  8126. <p>Possible values:
  8127. </p><dl class="table">
  8128. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  8129. <dd><p>autoselect a good one (default)
  8130. </p></dd>
  8131. <dt>&lsquo;<samp class="samp">fastint</samp>&rsquo;</dt>
  8132. <dd><p>fast integer
  8133. </p></dd>
  8134. <dt>&lsquo;<samp class="samp">int</samp>&rsquo;</dt>
  8135. <dd><p>accurate integer
  8136. </p></dd>
  8137. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  8138. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  8139. <dt>&lsquo;<samp class="samp">faan</samp>&rsquo;</dt>
  8140. <dd><p>floating point AAN DCT
  8141. </p></dd>
  8142. </dl>
  8143. </dd>
  8144. <dt><samp class="option">lumi_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8145. <dd><p>Compress bright areas stronger than medium ones.
  8146. </p>
  8147. </dd>
  8148. <dt><samp class="option">tcplx_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8149. <dd><p>Set temporal complexity masking.
  8150. </p>
  8151. </dd>
  8152. <dt><samp class="option">scplx_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8153. <dd><p>Set spatial complexity masking.
  8154. </p>
  8155. </dd>
  8156. <dt><samp class="option">p_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8157. <dd><p>Set inter masking.
  8158. </p>
  8159. </dd>
  8160. <dt><samp class="option">dark_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8161. <dd><p>Compress dark areas stronger than medium ones.
  8162. </p>
  8163. </dd>
  8164. <dt><samp class="option">idct <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8165. <dd><p>Select IDCT implementation.
  8166. </p>
  8167. <p>Possible values:
  8168. </p><dl class="table">
  8169. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  8170. <dt>&lsquo;<samp class="samp">int</samp>&rsquo;</dt>
  8171. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  8172. <dt>&lsquo;<samp class="samp">simplemmx</samp>&rsquo;</dt>
  8173. <dt>&lsquo;<samp class="samp">simpleauto</samp>&rsquo;</dt>
  8174. <dd><p>Automatically pick a IDCT compatible with the simple one
  8175. </p>
  8176. </dd>
  8177. <dt>&lsquo;<samp class="samp">arm</samp>&rsquo;</dt>
  8178. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  8179. <dt>&lsquo;<samp class="samp">sh4</samp>&rsquo;</dt>
  8180. <dt>&lsquo;<samp class="samp">simplearm</samp>&rsquo;</dt>
  8181. <dt>&lsquo;<samp class="samp">simplearmv5te</samp>&rsquo;</dt>
  8182. <dt>&lsquo;<samp class="samp">simplearmv6</samp>&rsquo;</dt>
  8183. <dt>&lsquo;<samp class="samp">simpleneon</samp>&rsquo;</dt>
  8184. <dt>&lsquo;<samp class="samp">xvid</samp>&rsquo;</dt>
  8185. <dt>&lsquo;<samp class="samp">faani</samp>&rsquo;</dt>
  8186. <dd><p>floating point AAN IDCT
  8187. </p></dd>
  8188. </dl>
  8189. </dd>
  8190. <dt><samp class="option">slice_count <var class="var">integer</var></samp></dt>
  8191. <dt><samp class="option">ec <var class="var">flags</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8192. <dd><p>Set error concealment strategy.
  8193. </p>
  8194. <p>Possible values:
  8195. </p><dl class="table">
  8196. <dt>&lsquo;<samp class="samp">guess_mvs</samp>&rsquo;</dt>
  8197. <dd><p>iterative motion vector (MV) search (slow)
  8198. </p></dd>
  8199. <dt>&lsquo;<samp class="samp">deblock</samp>&rsquo;</dt>
  8200. <dd><p>use strong deblock filter for damaged MBs
  8201. </p></dd>
  8202. <dt>&lsquo;<samp class="samp">favor_inter</samp>&rsquo;</dt>
  8203. <dd><p>favor predicting from the previous frame instead of the current
  8204. </p></dd>
  8205. </dl>
  8206. </dd>
  8207. <dt><samp class="option">bits_per_coded_sample <var class="var">integer</var></samp></dt>
  8208. <dt><samp class="option">aspect <var class="var">rational number</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8209. <dd><p>Set sample aspect ratio.
  8210. </p>
  8211. </dd>
  8212. <dt><samp class="option">sar <var class="var">rational number</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8213. <dd><p>Set sample aspect ratio. Alias to <var class="var">aspect</var>.
  8214. </p>
  8215. </dd>
  8216. <dt><samp class="option">debug <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  8217. <dd><p>Print specific debug info.
  8218. </p>
  8219. <p>Possible values:
  8220. </p><dl class="table">
  8221. <dt>&lsquo;<samp class="samp">pict</samp>&rsquo;</dt>
  8222. <dd><p>picture info
  8223. </p></dd>
  8224. <dt>&lsquo;<samp class="samp">rc</samp>&rsquo;</dt>
  8225. <dd><p>rate control
  8226. </p></dd>
  8227. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  8228. <dt>&lsquo;<samp class="samp">mb_type</samp>&rsquo;</dt>
  8229. <dd><p>macroblock (MB) type
  8230. </p></dd>
  8231. <dt>&lsquo;<samp class="samp">qp</samp>&rsquo;</dt>
  8232. <dd><p>per-block quantization parameter (QP)
  8233. </p></dd>
  8234. <dt>&lsquo;<samp class="samp">dct_coeff</samp>&rsquo;</dt>
  8235. <dt>&lsquo;<samp class="samp">green_metadata</samp>&rsquo;</dt>
  8236. <dd><p>display complexity metadata for the upcoming frame, GoP or for a given duration.
  8237. </p>
  8238. </dd>
  8239. <dt>&lsquo;<samp class="samp">skip</samp>&rsquo;</dt>
  8240. <dt>&lsquo;<samp class="samp">startcode</samp>&rsquo;</dt>
  8241. <dt>&lsquo;<samp class="samp">er</samp>&rsquo;</dt>
  8242. <dd><p>error recognition
  8243. </p></dd>
  8244. <dt>&lsquo;<samp class="samp">mmco</samp>&rsquo;</dt>
  8245. <dd><p>memory management control operations (H.264)
  8246. </p></dd>
  8247. <dt>&lsquo;<samp class="samp">bugs</samp>&rsquo;</dt>
  8248. <dt>&lsquo;<samp class="samp">buffers</samp>&rsquo;</dt>
  8249. <dd><p>picture buffer allocations
  8250. </p></dd>
  8251. <dt>&lsquo;<samp class="samp">thread_ops</samp>&rsquo;</dt>
  8252. <dd><p>threading operations
  8253. </p></dd>
  8254. <dt>&lsquo;<samp class="samp">nomc</samp>&rsquo;</dt>
  8255. <dd><p>skip motion compensation
  8256. </p></dd>
  8257. </dl>
  8258. </dd>
  8259. <dt><samp class="option">cmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8260. <dd><p>Set full pel me compare function.
  8261. </p>
  8262. <p>Possible values:
  8263. </p><dl class="table">
  8264. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  8265. <dd><p>sum of absolute differences, fast (default)
  8266. </p></dd>
  8267. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  8268. <dd><p>sum of squared errors
  8269. </p></dd>
  8270. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  8271. <dd><p>sum of absolute Hadamard transformed differences
  8272. </p></dd>
  8273. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  8274. <dd><p>sum of absolute DCT transformed differences
  8275. </p></dd>
  8276. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  8277. <dd><p>sum of squared quantization errors (avoid, low quality)
  8278. </p></dd>
  8279. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  8280. <dd><p>number of bits needed for the block
  8281. </p></dd>
  8282. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  8283. <dd><p>rate distortion optimal, slow
  8284. </p></dd>
  8285. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  8286. <dd><p>0
  8287. </p></dd>
  8288. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  8289. <dd><p>sum of absolute vertical differences
  8290. </p></dd>
  8291. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  8292. <dd><p>sum of squared vertical differences
  8293. </p></dd>
  8294. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  8295. <dd><p>noise preserving sum of squared differences
  8296. </p></dd>
  8297. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  8298. <dd><p>5/3 wavelet, only used in snow
  8299. </p></dd>
  8300. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  8301. <dd><p>9/7 wavelet, only used in snow
  8302. </p></dd>
  8303. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  8304. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  8305. </dl>
  8306. </dd>
  8307. <dt><samp class="option">subcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8308. <dd><p>Set sub pel me compare function.
  8309. </p>
  8310. <p>Possible values:
  8311. </p><dl class="table">
  8312. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  8313. <dd><p>sum of absolute differences, fast (default)
  8314. </p></dd>
  8315. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  8316. <dd><p>sum of squared errors
  8317. </p></dd>
  8318. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  8319. <dd><p>sum of absolute Hadamard transformed differences
  8320. </p></dd>
  8321. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  8322. <dd><p>sum of absolute DCT transformed differences
  8323. </p></dd>
  8324. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  8325. <dd><p>sum of squared quantization errors (avoid, low quality)
  8326. </p></dd>
  8327. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  8328. <dd><p>number of bits needed for the block
  8329. </p></dd>
  8330. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  8331. <dd><p>rate distortion optimal, slow
  8332. </p></dd>
  8333. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  8334. <dd><p>0
  8335. </p></dd>
  8336. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  8337. <dd><p>sum of absolute vertical differences
  8338. </p></dd>
  8339. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  8340. <dd><p>sum of squared vertical differences
  8341. </p></dd>
  8342. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  8343. <dd><p>noise preserving sum of squared differences
  8344. </p></dd>
  8345. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  8346. <dd><p>5/3 wavelet, only used in snow
  8347. </p></dd>
  8348. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  8349. <dd><p>9/7 wavelet, only used in snow
  8350. </p></dd>
  8351. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  8352. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  8353. </dl>
  8354. </dd>
  8355. <dt><samp class="option">mbcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8356. <dd><p>Set macroblock compare function.
  8357. </p>
  8358. <p>Possible values:
  8359. </p><dl class="table">
  8360. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  8361. <dd><p>sum of absolute differences, fast (default)
  8362. </p></dd>
  8363. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  8364. <dd><p>sum of squared errors
  8365. </p></dd>
  8366. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  8367. <dd><p>sum of absolute Hadamard transformed differences
  8368. </p></dd>
  8369. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  8370. <dd><p>sum of absolute DCT transformed differences
  8371. </p></dd>
  8372. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  8373. <dd><p>sum of squared quantization errors (avoid, low quality)
  8374. </p></dd>
  8375. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  8376. <dd><p>number of bits needed for the block
  8377. </p></dd>
  8378. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  8379. <dd><p>rate distortion optimal, slow
  8380. </p></dd>
  8381. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  8382. <dd><p>0
  8383. </p></dd>
  8384. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  8385. <dd><p>sum of absolute vertical differences
  8386. </p></dd>
  8387. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  8388. <dd><p>sum of squared vertical differences
  8389. </p></dd>
  8390. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  8391. <dd><p>noise preserving sum of squared differences
  8392. </p></dd>
  8393. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  8394. <dd><p>5/3 wavelet, only used in snow
  8395. </p></dd>
  8396. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  8397. <dd><p>9/7 wavelet, only used in snow
  8398. </p></dd>
  8399. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  8400. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  8401. </dl>
  8402. </dd>
  8403. <dt><samp class="option">ildctcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8404. <dd><p>Set interlaced dct compare function.
  8405. </p>
  8406. <p>Possible values:
  8407. </p><dl class="table">
  8408. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  8409. <dd><p>sum of absolute differences, fast (default)
  8410. </p></dd>
  8411. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  8412. <dd><p>sum of squared errors
  8413. </p></dd>
  8414. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  8415. <dd><p>sum of absolute Hadamard transformed differences
  8416. </p></dd>
  8417. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  8418. <dd><p>sum of absolute DCT transformed differences
  8419. </p></dd>
  8420. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  8421. <dd><p>sum of squared quantization errors (avoid, low quality)
  8422. </p></dd>
  8423. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  8424. <dd><p>number of bits needed for the block
  8425. </p></dd>
  8426. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  8427. <dd><p>rate distortion optimal, slow
  8428. </p></dd>
  8429. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  8430. <dd><p>0
  8431. </p></dd>
  8432. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  8433. <dd><p>sum of absolute vertical differences
  8434. </p></dd>
  8435. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  8436. <dd><p>sum of squared vertical differences
  8437. </p></dd>
  8438. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  8439. <dd><p>noise preserving sum of squared differences
  8440. </p></dd>
  8441. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  8442. <dd><p>5/3 wavelet, only used in snow
  8443. </p></dd>
  8444. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  8445. <dd><p>9/7 wavelet, only used in snow
  8446. </p></dd>
  8447. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  8448. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  8449. </dl>
  8450. </dd>
  8451. <dt><samp class="option">dia_size <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8452. <dd><p>Set diamond type &amp; size for motion estimation.
  8453. </p><dl class="table">
  8454. <dt>&lsquo;<samp class="samp">(1024, INT_MAX)</samp>&rsquo;</dt>
  8455. <dd><p>full motion estimation(slowest)
  8456. </p></dd>
  8457. <dt>&lsquo;<samp class="samp">(768, 1024]</samp>&rsquo;</dt>
  8458. <dd><p>umh motion estimation
  8459. </p></dd>
  8460. <dt>&lsquo;<samp class="samp">(512, 768]</samp>&rsquo;</dt>
  8461. <dd><p>hex motion estimation
  8462. </p></dd>
  8463. <dt>&lsquo;<samp class="samp">(256, 512]</samp>&rsquo;</dt>
  8464. <dd><p>l2s diamond motion estimation
  8465. </p></dd>
  8466. <dt>&lsquo;<samp class="samp">[2,256]</samp>&rsquo;</dt>
  8467. <dd><p>var diamond motion estimation
  8468. </p></dd>
  8469. <dt>&lsquo;<samp class="samp">(-1, 2)</samp>&rsquo;</dt>
  8470. <dd><p>small diamond motion estimation
  8471. </p></dd>
  8472. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  8473. <dd><p>funny diamond motion estimation
  8474. </p></dd>
  8475. <dt>&lsquo;<samp class="samp">(INT_MIN, -1)</samp>&rsquo;</dt>
  8476. <dd><p>sab diamond motion estimation
  8477. </p></dd>
  8478. </dl>
  8479. </dd>
  8480. <dt><samp class="option">last_pred <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8481. <dd><p>Set amount of motion predictors from the previous frame.
  8482. </p>
  8483. </dd>
  8484. <dt><samp class="option">precmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8485. <dd><p>Set pre motion estimation compare function.
  8486. </p>
  8487. <p>Possible values:
  8488. </p><dl class="table">
  8489. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  8490. <dd><p>sum of absolute differences, fast (default)
  8491. </p></dd>
  8492. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  8493. <dd><p>sum of squared errors
  8494. </p></dd>
  8495. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  8496. <dd><p>sum of absolute Hadamard transformed differences
  8497. </p></dd>
  8498. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  8499. <dd><p>sum of absolute DCT transformed differences
  8500. </p></dd>
  8501. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  8502. <dd><p>sum of squared quantization errors (avoid, low quality)
  8503. </p></dd>
  8504. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  8505. <dd><p>number of bits needed for the block
  8506. </p></dd>
  8507. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  8508. <dd><p>rate distortion optimal, slow
  8509. </p></dd>
  8510. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  8511. <dd><p>0
  8512. </p></dd>
  8513. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  8514. <dd><p>sum of absolute vertical differences
  8515. </p></dd>
  8516. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  8517. <dd><p>sum of squared vertical differences
  8518. </p></dd>
  8519. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  8520. <dd><p>noise preserving sum of squared differences
  8521. </p></dd>
  8522. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  8523. <dd><p>5/3 wavelet, only used in snow
  8524. </p></dd>
  8525. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  8526. <dd><p>9/7 wavelet, only used in snow
  8527. </p></dd>
  8528. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  8529. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  8530. </dl>
  8531. </dd>
  8532. <dt><samp class="option">pre_dia_size <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8533. <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
  8534. </p>
  8535. </dd>
  8536. <dt><samp class="option">subq <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8537. <dd><p>Set sub pel motion estimation quality.
  8538. </p>
  8539. </dd>
  8540. <dt><samp class="option">me_range <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8541. <dd><p>Set limit motion vectors range (1023 for DivX player).
  8542. </p>
  8543. </dd>
  8544. <dt><samp class="option">global_quality <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8545. <dt><samp class="option">slice_flags <var class="var">integer</var></samp></dt>
  8546. <dt><samp class="option">mbd <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8547. <dd><p>Set macroblock decision algorithm (high quality mode).
  8548. </p>
  8549. <p>Possible values:
  8550. </p><dl class="table">
  8551. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  8552. <dd><p>use mbcmp (default)
  8553. </p></dd>
  8554. <dt>&lsquo;<samp class="samp">bits</samp>&rsquo;</dt>
  8555. <dd><p>use fewest bits
  8556. </p></dd>
  8557. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  8558. <dd><p>use best rate distortion
  8559. </p></dd>
  8560. </dl>
  8561. </dd>
  8562. <dt><samp class="option">rc_init_occupancy <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8563. <dd><p>Set number of bits which should be loaded into the rc buffer before
  8564. decoding starts.
  8565. </p>
  8566. </dd>
  8567. <dt><samp class="option">flags2 <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  8568. <dd>
  8569. <p>Possible values:
  8570. </p><dl class="table">
  8571. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  8572. <dd><p>Allow non spec compliant speedup tricks.
  8573. </p></dd>
  8574. <dt>&lsquo;<samp class="samp">noout</samp>&rsquo;</dt>
  8575. <dd><p>Skip bitstream encoding.
  8576. </p></dd>
  8577. <dt>&lsquo;<samp class="samp">ignorecrop</samp>&rsquo;</dt>
  8578. <dd><p>Ignore cropping information from sps.
  8579. </p></dd>
  8580. <dt>&lsquo;<samp class="samp">local_header</samp>&rsquo;</dt>
  8581. <dd><p>Place global headers at every keyframe instead of in extradata.
  8582. </p></dd>
  8583. <dt>&lsquo;<samp class="samp">chunks</samp>&rsquo;</dt>
  8584. <dd><p>Frame data might be split into multiple chunks.
  8585. </p></dd>
  8586. <dt>&lsquo;<samp class="samp">showall</samp>&rsquo;</dt>
  8587. <dd><p>Show all frames before the first keyframe.
  8588. </p></dd>
  8589. <dt>&lsquo;<samp class="samp">export_mvs</samp>&rsquo;</dt>
  8590. <dd><p>Export motion vectors into frame side-data (see <code class="code">AV_FRAME_DATA_MOTION_VECTORS</code>)
  8591. for codecs that support it. See also <samp class="file">doc/examples/export_mvs.c</samp>.
  8592. </p></dd>
  8593. <dt>&lsquo;<samp class="samp">skip_manual</samp>&rsquo;</dt>
  8594. <dd><p>Do not skip samples and export skip information as frame side data.
  8595. </p></dd>
  8596. <dt>&lsquo;<samp class="samp">ass_ro_flush_noop</samp>&rsquo;</dt>
  8597. <dd><p>Do not reset ASS ReadOrder field on flush.
  8598. </p></dd>
  8599. <dt>&lsquo;<samp class="samp">icc_profiles</samp>&rsquo;</dt>
  8600. <dd><p>Generate/parse embedded ICC profiles from/to colorimetry tags.
  8601. </p></dd>
  8602. </dl>
  8603. </dd>
  8604. <dt><samp class="option">export_side_data <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  8605. <dd>
  8606. <p>Possible values:
  8607. </p><dl class="table">
  8608. <dt>&lsquo;<samp class="samp">mvs</samp>&rsquo;</dt>
  8609. <dd><p>Export motion vectors into frame side-data (see <code class="code">AV_FRAME_DATA_MOTION_VECTORS</code>)
  8610. for codecs that support it. See also <samp class="file">doc/examples/export_mvs.c</samp>.
  8611. </p></dd>
  8612. <dt>&lsquo;<samp class="samp">prft</samp>&rsquo;</dt>
  8613. <dd><p>Export encoder Producer Reference Time into packet side-data (see <code class="code">AV_PKT_DATA_PRFT</code>)
  8614. for codecs that support it.
  8615. </p></dd>
  8616. <dt>&lsquo;<samp class="samp">venc_params</samp>&rsquo;</dt>
  8617. <dd><p>Export video encoding parameters through frame side data (see <code class="code">AV_FRAME_DATA_VIDEO_ENC_PARAMS</code>)
  8618. for codecs that support it. At present, those are H.264 and VP9.
  8619. </p></dd>
  8620. <dt>&lsquo;<samp class="samp">film_grain</samp>&rsquo;</dt>
  8621. <dd><p>Export film grain parameters through frame side data (see <code class="code">AV_FRAME_DATA_FILM_GRAIN_PARAMS</code>).
  8622. Supported at present by AV1 decoders.
  8623. </p></dd>
  8624. <dt>&lsquo;<samp class="samp">enhancements</samp>&rsquo;</dt>
  8625. <dd><p>Export picture enhancement metadata through frame side data, e.g. LCEVC (see <code class="code">AV_FRAME_DATA_LCEVC</code>).
  8626. </p></dd>
  8627. </dl>
  8628. </dd>
  8629. <dt><samp class="option">threads <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8630. <dd><p>Set the number of threads to be used, in case the selected codec
  8631. implementation supports multi-threading.
  8632. </p>
  8633. <p>Possible values:
  8634. </p><dl class="table">
  8635. <dt>&lsquo;<samp class="samp">auto, 0</samp>&rsquo;</dt>
  8636. <dd><p>automatically select the number of threads to set
  8637. </p></dd>
  8638. </dl>
  8639. <p>Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  8640. </p>
  8641. </dd>
  8642. <dt><samp class="option">dc <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8643. <dd><p>Set intra_dc_precision.
  8644. </p>
  8645. </dd>
  8646. <dt><samp class="option">nssew <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8647. <dd><p>Set nsse weight.
  8648. </p>
  8649. </dd>
  8650. <dt><samp class="option">skip_top <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8651. <dd><p>Set number of macroblock rows at the top which are skipped.
  8652. </p>
  8653. </dd>
  8654. <dt><samp class="option">skip_bottom <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8655. <dd><p>Set number of macroblock rows at the bottom which are skipped.
  8656. </p>
  8657. </dd>
  8658. <dt><samp class="option">profile <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8659. <dd>
  8660. <p>Set encoder codec profile. Default value is &lsquo;<samp class="samp">unknown</samp>&rsquo;. Encoder specific
  8661. profiles are documented in the relevant encoder documentation.
  8662. </p>
  8663. </dd>
  8664. <dt><samp class="option">level <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8665. <dd>
  8666. <p>Set the encoder level. This level depends on the specific codec, and
  8667. might correspond to the profile level. It is set by default to
  8668. &lsquo;<samp class="samp">unknown</samp>&rsquo;.
  8669. </p>
  8670. <p>Possible values:
  8671. </p><dl class="table">
  8672. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  8673. </dl>
  8674. </dd>
  8675. <dt><samp class="option">lowres <var class="var">integer</var> (<em class="emph">decoding,audio,video</em>)</samp></dt>
  8676. <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
  8677. </p>
  8678. </dd>
  8679. <dt><samp class="option">mblmin <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8680. <dd><p>Set min macroblock lagrange factor (VBR).
  8681. </p>
  8682. </dd>
  8683. <dt><samp class="option">mblmax <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8684. <dd><p>Set max macroblock lagrange factor (VBR).
  8685. </p>
  8686. </dd>
  8687. <dt><samp class="option">skip_loop_filter <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8688. <dt><samp class="option">skip_idct <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8689. <dt><samp class="option">skip_frame <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8690. <dd>
  8691. <p>Make decoder discard processing depending on the frame type selected
  8692. by the option value.
  8693. </p>
  8694. <p><samp class="option">skip_loop_filter</samp> skips frame loop filtering, <samp class="option">skip_idct</samp>
  8695. skips frame IDCT/dequantization, <samp class="option">skip_frame</samp> skips decoding.
  8696. </p>
  8697. <p>Possible values:
  8698. </p><dl class="table">
  8699. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  8700. <dd><p>Discard no frame.
  8701. </p>
  8702. </dd>
  8703. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  8704. <dd><p>Discard useless frames like 0-sized frames.
  8705. </p>
  8706. </dd>
  8707. <dt>&lsquo;<samp class="samp">noref</samp>&rsquo;</dt>
  8708. <dd><p>Discard all non-reference frames.
  8709. </p>
  8710. </dd>
  8711. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  8712. <dd><p>Discard all bidirectional frames.
  8713. </p>
  8714. </dd>
  8715. <dt>&lsquo;<samp class="samp">nokey</samp>&rsquo;</dt>
  8716. <dd><p>Discard all frames excepts keyframes.
  8717. </p>
  8718. </dd>
  8719. <dt>&lsquo;<samp class="samp">nointra</samp>&rsquo;</dt>
  8720. <dd><p>Discard all frames except I frames.
  8721. </p>
  8722. </dd>
  8723. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  8724. <dd><p>Discard all frames.
  8725. </p></dd>
  8726. </dl>
  8727. <p>Default value is &lsquo;<samp class="samp">default</samp>&rsquo;.
  8728. </p>
  8729. </dd>
  8730. <dt><samp class="option">bidir_refine <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8731. <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
  8732. </p>
  8733. </dd>
  8734. <dt><samp class="option">keyint_min <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8735. <dd><p>Set minimum interval between IDR-frames.
  8736. </p>
  8737. </dd>
  8738. <dt><samp class="option">refs <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8739. <dd><p>Set reference frames to consider for motion compensation.
  8740. </p>
  8741. </dd>
  8742. <dt><samp class="option">trellis <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8743. <dd><p>Set rate-distortion optimal quantization.
  8744. </p>
  8745. </dd>
  8746. <dt><samp class="option">mv0_threshold <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8747. <dt><samp class="option">compression_level <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8748. <dt><samp class="option">bits_per_raw_sample <var class="var">integer</var></samp></dt>
  8749. <dt><samp class="option">channel_layout <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  8750. <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>
  8751. for the required syntax.
  8752. </p>
  8753. </dd>
  8754. <dt><samp class="option">rc_max_vbv_use <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8755. <dt><samp class="option">rc_min_vbv_use <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8756. <dt><samp class="option">color_primaries <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8757. <dd><p>Possible values:
  8758. </p><dl class="table">
  8759. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  8760. <dd><p>BT.709
  8761. </p></dd>
  8762. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  8763. <dd><p>BT.470 M
  8764. </p></dd>
  8765. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  8766. <dd><p>BT.470 BG
  8767. </p></dd>
  8768. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  8769. <dd><p>SMPTE 170 M
  8770. </p></dd>
  8771. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  8772. <dd><p>SMPTE 240 M
  8773. </p></dd>
  8774. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  8775. <dd><p>Film
  8776. </p></dd>
  8777. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  8778. <dd><p>BT.2020
  8779. </p></dd>
  8780. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  8781. <dt>&lsquo;<samp class="samp">smpte428_1</samp>&rsquo;</dt>
  8782. <dd><p>SMPTE ST 428-1
  8783. </p></dd>
  8784. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  8785. <dd><p>SMPTE 431-2
  8786. </p></dd>
  8787. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  8788. <dd><p>SMPTE 432-1
  8789. </p></dd>
  8790. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  8791. <dd><p>JEDEC P22
  8792. </p></dd>
  8793. </dl>
  8794. </dd>
  8795. <dt><samp class="option">color_trc <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8796. <dd><p>Possible values:
  8797. </p><dl class="table">
  8798. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  8799. <dd><p>BT.709
  8800. </p></dd>
  8801. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  8802. <dd><p>BT.470 M
  8803. </p></dd>
  8804. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  8805. <dd><p>BT.470 BG
  8806. </p></dd>
  8807. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  8808. <dd><p>SMPTE 170 M
  8809. </p></dd>
  8810. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  8811. <dd><p>SMPTE 240 M
  8812. </p></dd>
  8813. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  8814. <dd><p>Linear
  8815. </p></dd>
  8816. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  8817. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  8818. <dd><p>Log
  8819. </p></dd>
  8820. <dt>&lsquo;<samp class="samp">log_sqrt</samp>&rsquo;</dt>
  8821. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  8822. <dd><p>Log square root
  8823. </p></dd>
  8824. <dt>&lsquo;<samp class="samp">iec61966_2_4</samp>&rsquo;</dt>
  8825. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  8826. <dd><p>IEC 61966-2-4
  8827. </p></dd>
  8828. <dt>&lsquo;<samp class="samp">bt1361</samp>&rsquo;</dt>
  8829. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  8830. <dd><p>BT.1361
  8831. </p></dd>
  8832. <dt>&lsquo;<samp class="samp">iec61966_2_1</samp>&rsquo;</dt>
  8833. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  8834. <dd><p>IEC 61966-2-1
  8835. </p></dd>
  8836. <dt>&lsquo;<samp class="samp">bt2020_10</samp>&rsquo;</dt>
  8837. <dt>&lsquo;<samp class="samp">bt2020_10bit</samp>&rsquo;</dt>
  8838. <dd><p>BT.2020 - 10 bit
  8839. </p></dd>
  8840. <dt>&lsquo;<samp class="samp">bt2020_12</samp>&rsquo;</dt>
  8841. <dt>&lsquo;<samp class="samp">bt2020_12bit</samp>&rsquo;</dt>
  8842. <dd><p>BT.2020 - 12 bit
  8843. </p></dd>
  8844. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  8845. <dd><p>SMPTE ST 2084
  8846. </p></dd>
  8847. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  8848. <dt>&lsquo;<samp class="samp">smpte428_1</samp>&rsquo;</dt>
  8849. <dd><p>SMPTE ST 428-1
  8850. </p></dd>
  8851. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  8852. <dd><p>ARIB STD-B67
  8853. </p></dd>
  8854. </dl>
  8855. </dd>
  8856. <dt><samp class="option">colorspace <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8857. <dd><p>Possible values:
  8858. </p><dl class="table">
  8859. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  8860. <dd><p>RGB
  8861. </p></dd>
  8862. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  8863. <dd><p>BT.709
  8864. </p></dd>
  8865. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  8866. <dd><p>FCC
  8867. </p></dd>
  8868. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  8869. <dd><p>BT.470 BG
  8870. </p></dd>
  8871. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  8872. <dd><p>SMPTE 170 M
  8873. </p></dd>
  8874. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  8875. <dd><p>SMPTE 240 M
  8876. </p></dd>
  8877. <dt>&lsquo;<samp class="samp">ycocg</samp>&rsquo;</dt>
  8878. <dd><p>YCOCG
  8879. </p></dd>
  8880. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  8881. <dt>&lsquo;<samp class="samp">bt2020_ncl</samp>&rsquo;</dt>
  8882. <dd><p>BT.2020 NCL
  8883. </p></dd>
  8884. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  8885. <dt>&lsquo;<samp class="samp">bt2020_cl</samp>&rsquo;</dt>
  8886. <dd><p>BT.2020 CL
  8887. </p></dd>
  8888. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  8889. <dd><p>SMPTE 2085
  8890. </p></dd>
  8891. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  8892. <dd><p>Chroma-derived NCL
  8893. </p></dd>
  8894. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  8895. <dd><p>Chroma-derived CL
  8896. </p></dd>
  8897. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  8898. <dd><p>ICtCp
  8899. </p></dd>
  8900. </dl>
  8901. </dd>
  8902. <dt><samp class="option">color_range <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8903. <dd><p>If used as input parameter, it serves as a hint to the decoder, which
  8904. color_range the input has.
  8905. Possible values:
  8906. </p><dl class="table">
  8907. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  8908. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  8909. <dt>&lsquo;<samp class="samp">limited</samp>&rsquo;</dt>
  8910. <dd><p>MPEG (219*2^(n-8))
  8911. </p></dd>
  8912. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  8913. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  8914. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  8915. <dd><p>JPEG (2^n-1)
  8916. </p></dd>
  8917. </dl>
  8918. </dd>
  8919. <dt><samp class="option">chroma_sample_location <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8920. <dd><p>Possible values:
  8921. </p><dl class="table">
  8922. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  8923. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  8924. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  8925. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  8926. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  8927. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  8928. </dl>
  8929. </dd>
  8930. <dt><samp class="option">alpha_mode <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8931. <dd><p>Possible values:
  8932. </p><dl class="table">
  8933. <dt>&lsquo;<samp class="samp">premultiplied</samp>&rsquo;</dt>
  8934. <dt>&lsquo;<samp class="samp">straight</samp>&rsquo;</dt>
  8935. </dl>
  8936. </dd>
  8937. <dt><samp class="option">log_level_offset <var class="var">integer</var></samp></dt>
  8938. <dd><p>Set the log level offset.
  8939. </p>
  8940. </dd>
  8941. <dt><samp class="option">slices <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8942. <dd><p>Number of slices, used in parallelized encoding.
  8943. </p>
  8944. </dd>
  8945. <dt><samp class="option">thread_type <var class="var">flags</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8946. <dd><p>Select which multithreading methods to use.
  8947. </p>
  8948. <p>Use of &lsquo;<samp class="samp">frame</samp>&rsquo; will increase decoding delay by one frame per
  8949. thread, so clients which cannot provide future frames should not use
  8950. it.
  8951. </p>
  8952. <p>Possible values:
  8953. </p><dl class="table">
  8954. <dt>&lsquo;<samp class="samp">slice</samp>&rsquo;</dt>
  8955. <dd><p>Decode more than one part of a single frame at once.
  8956. </p>
  8957. <p>Multithreading using slices works only when the video was encoded with
  8958. slices.
  8959. </p>
  8960. </dd>
  8961. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  8962. <dd><p>Decode more than one frame at once.
  8963. </p></dd>
  8964. </dl>
  8965. <p>Default value is &lsquo;<samp class="samp">slice+frame</samp>&rsquo;.
  8966. </p>
  8967. </dd>
  8968. <dt><samp class="option">audio_service_type <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  8969. <dd><p>Set audio service type.
  8970. </p>
  8971. <p>Possible values:
  8972. </p><dl class="table">
  8973. <dt>&lsquo;<samp class="samp">ma</samp>&rsquo;</dt>
  8974. <dd><p>Main Audio Service
  8975. </p></dd>
  8976. <dt>&lsquo;<samp class="samp">ef</samp>&rsquo;</dt>
  8977. <dd><p>Effects
  8978. </p></dd>
  8979. <dt>&lsquo;<samp class="samp">vi</samp>&rsquo;</dt>
  8980. <dd><p>Visually Impaired
  8981. </p></dd>
  8982. <dt>&lsquo;<samp class="samp">hi</samp>&rsquo;</dt>
  8983. <dd><p>Hearing Impaired
  8984. </p></dd>
  8985. <dt>&lsquo;<samp class="samp">di</samp>&rsquo;</dt>
  8986. <dd><p>Dialogue
  8987. </p></dd>
  8988. <dt>&lsquo;<samp class="samp">co</samp>&rsquo;</dt>
  8989. <dd><p>Commentary
  8990. </p></dd>
  8991. <dt>&lsquo;<samp class="samp">em</samp>&rsquo;</dt>
  8992. <dd><p>Emergency
  8993. </p></dd>
  8994. <dt>&lsquo;<samp class="samp">vo</samp>&rsquo;</dt>
  8995. <dd><p>Voice Over
  8996. </p></dd>
  8997. <dt>&lsquo;<samp class="samp">ka</samp>&rsquo;</dt>
  8998. <dd><p>Karaoke
  8999. </p></dd>
  9000. </dl>
  9001. </dd>
  9002. <dt><samp class="option">request_sample_fmt <var class="var">sample_fmt</var> (<em class="emph">decoding,audio</em>)</samp></dt>
  9003. <dd><p>Set sample format audio decoders should prefer. Default value is
  9004. <code class="code">none</code>.
  9005. </p>
  9006. </dd>
  9007. <dt><samp class="option">pkt_timebase <var class="var">rational number</var></samp></dt>
  9008. <dt><samp class="option">sub_charenc <var class="var">encoding</var> (<em class="emph">decoding,subtitles</em>)</samp></dt>
  9009. <dd><p>Set the input subtitles character encoding.
  9010. </p>
  9011. </dd>
  9012. <dt><samp class="option">field_order <var class="var">field_order</var> (<em class="emph">video</em>)</samp></dt>
  9013. <dd><p>Set/override the field order of the video.
  9014. Possible values:
  9015. </p><dl class="table">
  9016. <dt>&lsquo;<samp class="samp">progressive</samp>&rsquo;</dt>
  9017. <dd><p>Progressive video
  9018. </p></dd>
  9019. <dt>&lsquo;<samp class="samp">tt</samp>&rsquo;</dt>
  9020. <dd><p>Interlaced video, top field coded and displayed first
  9021. </p></dd>
  9022. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  9023. <dd><p>Interlaced video, bottom field coded and displayed first
  9024. </p></dd>
  9025. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  9026. <dd><p>Interlaced video, top coded first, bottom displayed first
  9027. </p></dd>
  9028. <dt>&lsquo;<samp class="samp">bt</samp>&rsquo;</dt>
  9029. <dd><p>Interlaced video, bottom coded first, top displayed first
  9030. </p></dd>
  9031. </dl>
  9032. </dd>
  9033. <dt><samp class="option">skip_alpha <var class="var">bool</var> (<em class="emph">decoding,video</em>)</samp></dt>
  9034. <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
  9035. &lsquo;<samp class="samp">gray</samp>&rsquo; flag in the <samp class="option">flags</samp> option which skips chroma information
  9036. instead of alpha. Default is 0.
  9037. </p>
  9038. </dd>
  9039. <dt><samp class="option">codec_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  9040. <dd><p>&quot;,&quot; separated list of allowed decoders. By default all are allowed.
  9041. </p>
  9042. </dd>
  9043. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  9044. <dd><p>Separator used to separate the fields printed on the command line about the
  9045. Stream parameters.
  9046. For example, to separate the fields with newlines and indentation:
  9047. </p><div class="example">
  9048. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  9049. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  9050. </pre></div>
  9051. </dd>
  9052. <dt><samp class="option">max_pixels <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  9053. <dd><p>Maximum number of pixels per image. This value can be used to avoid out of
  9054. memory failures due to large images.
  9055. </p>
  9056. </dd>
  9057. <dt><samp class="option">apply_cropping <var class="var">bool</var> (<em class="emph">decoding,video</em>)</samp></dt>
  9058. <dd><p>Enable cropping if cropping parameters are multiples of the required
  9059. alignment for the left and top parameters. If the alignment is not met the
  9060. cropping will be partially applied to maintain alignment.
  9061. Default is 1 (enabled).
  9062. Note: The required alignment depends on if <code class="code">AV_CODEC_FLAG_UNALIGNED</code> is set and the
  9063. CPU. <code class="code">AV_CODEC_FLAG_UNALIGNED</code> cannot be changed from the command line. Also hardware
  9064. decoders will not apply left/top Cropping.
  9065. </p>
  9066. </dd>
  9067. </dl>
  9068. <a name="Decoders"></a>
  9069. <h2 class="chapter">10 Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Decoders" aria-hidden="true">TOC</a></span></h2>
  9070. <p>Decoders are configured elements in FFmpeg which allow the decoding of
  9071. multimedia streams.
  9072. </p>
  9073. <p>When you configure your FFmpeg build, all the supported native decoders
  9074. are enabled by default. Decoders requiring an external library must be enabled
  9075. manually via the corresponding <code class="code">--enable-lib</code> option. You can list all
  9076. available decoders using the configure option <code class="code">--list-decoders</code>.
  9077. </p>
  9078. <p>You can disable all the decoders with the configure option
  9079. <code class="code">--disable-decoders</code> and selectively enable / disable single decoders
  9080. with the options <code class="code">--enable-decoder=<var class="var">DECODER</var></code> /
  9081. <code class="code">--disable-decoder=<var class="var">DECODER</var></code>.
  9082. </p>
  9083. <p>The option <code class="code">-decoders</code> of the ff* tools will display the list of
  9084. enabled decoders.
  9085. </p>
  9086. <a name="Video-Decoders"></a>
  9087. <h2 class="chapter">11 Video Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Decoders" aria-hidden="true">TOC</a></span></h2>
  9088. <p>A description of some of the currently available video decoders
  9089. follows.
  9090. </p>
  9091. <a name="av1"></a>
  9092. <h3 class="section">11.1 av1<span class="pull-right"><a class="anchor hidden-xs" href="#av1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-av1" aria-hidden="true">TOC</a></span></h3>
  9093. <p>AOMedia Video 1 (AV1) decoder.
  9094. </p>
  9095. <a name="Options-1"></a>
  9096. <h4 class="subsection">11.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-1" aria-hidden="true">TOC</a></span></h4>
  9097. <dl class="table">
  9098. <dt><samp class="option">operating_point</samp></dt>
  9099. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
  9100. </p>
  9101. </dd>
  9102. </dl>
  9103. <a name="hevc"></a>
  9104. <h3 class="section">11.2 hevc<span class="pull-right"><a class="anchor hidden-xs" href="#hevc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc" aria-hidden="true">TOC</a></span></h3>
  9105. <p>HEVC (AKA ITU-T H.265 or ISO/IEC 23008-2) decoder.
  9106. </p>
  9107. <p>The decoder supports MV-HEVC multiview streams with at most two views. Views to
  9108. be output are selected by supplying a list of view IDs to the decoder (the
  9109. <samp class="option">view_ids</samp> option). This option may be set either statically before
  9110. decoder init, or from the <code class="code">get_format()</code> callback - useful for the case
  9111. when the view count or IDs change dynamically during decoding.
  9112. </p>
  9113. <p>Only the base layer is decoded by default.
  9114. </p>
  9115. <p>Note that if you are using the <code class="code">ffmpeg</code> CLI tool, you should be using view
  9116. specifiers as documented in its manual, rather than the options documented here.
  9117. </p>
  9118. <a name="Options-2"></a>
  9119. <h4 class="subsection">11.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-2" aria-hidden="true">TOC</a></span></h4>
  9120. <dl class="table">
  9121. <dt><samp class="option">view_ids (MV-HEVC)</samp></dt>
  9122. <dd><p>Specify a list of view IDs that should be output. This option can also be set to
  9123. a single &rsquo;-1&rsquo;, which will cause all views defined in the VPS to be decoded and
  9124. output.
  9125. </p>
  9126. </dd>
  9127. <dt><samp class="option">view_ids_available (MV-HEVC)</samp></dt>
  9128. <dd><p>This option may be read by the caller to retrieve an array of view IDs available
  9129. in the active VPS. The array is empty for single-layer video.
  9130. </p>
  9131. <p>The value of this option is guaranteed to be accurate when read from the
  9132. <code class="code">get_format()</code> callback. It may also be set at other times (e.g. after
  9133. opening the decoder), but the value is informational only and may be incorrect
  9134. (e.g. when the stream contains multiple distinct VPS NALUs).
  9135. </p>
  9136. </dd>
  9137. <dt><samp class="option">view_pos_available (MV-HEVC)</samp></dt>
  9138. <dd><p>This option may be read by the caller to retrieve an array of view positions
  9139. (left, right, or unspecified) available in the active VPS, as
  9140. <code class="code">AVStereo3DView</code> values. When the array is available, its elements apply to
  9141. the corresponding elements of <samp class="option">view_ids_available</samp>, i.e.
  9142. <code class="code">view_pos_available[i]</code> contains the position of view with ID
  9143. <code class="code">view_ids_available[i]</code>.
  9144. </p>
  9145. <p>Same validity restrictions as for <samp class="option">view_ids_available</samp> apply to
  9146. this option.
  9147. </p>
  9148. </dd>
  9149. </dl>
  9150. <a name="rawvideo"></a>
  9151. <h3 class="section">11.3 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo" aria-hidden="true">TOC</a></span></h3>
  9152. <p>Raw video decoder.
  9153. </p>
  9154. <p>This decoder decodes rawvideo streams.
  9155. </p>
  9156. <a name="Options-3"></a>
  9157. <h4 class="subsection">11.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-3" aria-hidden="true">TOC</a></span></h4>
  9158. <dl class="table">
  9159. <dt><samp class="option">top <var class="var">top_field_first</var></samp></dt>
  9160. <dd><p>Specify the assumed field type of the input video.
  9161. </p><dl class="table">
  9162. <dt><samp class="option">-1</samp></dt>
  9163. <dd><p>the video is assumed to be progressive (default)
  9164. </p></dd>
  9165. <dt><samp class="option">0</samp></dt>
  9166. <dd><p>bottom-field-first is assumed
  9167. </p></dd>
  9168. <dt><samp class="option">1</samp></dt>
  9169. <dd><p>top-field-first is assumed
  9170. </p></dd>
  9171. </dl>
  9172. </dd>
  9173. </dl>
  9174. <a name="libdav1d"></a>
  9175. <h3 class="section">11.4 libdav1d<span class="pull-right"><a class="anchor hidden-xs" href="#libdav1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdav1d" aria-hidden="true">TOC</a></span></h3>
  9176. <p>dav1d AV1 decoder.
  9177. </p>
  9178. <p>libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec.
  9179. Requires the presence of the libdav1d headers and library during configuration.
  9180. You need to explicitly configure the build with <code class="code">--enable-libdav1d</code>.
  9181. </p>
  9182. <a name="Options-4"></a>
  9183. <h4 class="subsection">11.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-4" aria-hidden="true">TOC</a></span></h4>
  9184. <p>The following options are supported by the libdav1d wrapper.
  9185. </p>
  9186. <dl class="table">
  9187. <dt><samp class="option">max_frame_delay</samp></dt>
  9188. <dd><p>Set max amount of frames the decoder may buffer internally. The default value is 0
  9189. (autodetect).
  9190. </p>
  9191. </dd>
  9192. <dt><samp class="option">filmgrain</samp></dt>
  9193. <dd><p>Apply film grain to the decoded video if present in the bitstream. Defaults to the
  9194. internal default of the library.
  9195. This option is deprecated and will be removed in the future. See the global option
  9196. <code class="code">export_side_data</code> to export Film Grain parameters instead of applying it.
  9197. </p>
  9198. </dd>
  9199. <dt><samp class="option">oppoint</samp></dt>
  9200. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
  9201. internal default of the library.
  9202. </p>
  9203. </dd>
  9204. <dt><samp class="option">alllayers</samp></dt>
  9205. <dd><p>Output all spatial layers of a scalable AV1 bitstream. The default value is false.
  9206. </p>
  9207. </dd>
  9208. </dl>
  9209. <a name="libdavs2"></a>
  9210. <h3 class="section">11.5 libdavs2<span class="pull-right"><a class="anchor hidden-xs" href="#libdavs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdavs2" aria-hidden="true">TOC</a></span></h3>
  9211. <p>AVS2-P2/IEEE1857.4 video decoder wrapper.
  9212. </p>
  9213. <p>This decoder allows libavcodec to decode AVS2 streams with davs2 library.
  9214. </p>
  9215. <a name="libuavs3d"></a>
  9216. <h3 class="section">11.6 libuavs3d<span class="pull-right"><a class="anchor hidden-xs" href="#libuavs3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libuavs3d" aria-hidden="true">TOC</a></span></h3>
  9217. <p>AVS3-P2/IEEE1857.10 video decoder.
  9218. </p>
  9219. <p>libuavs3d allows libavcodec to decode AVS3 streams.
  9220. Requires the presence of the libuavs3d headers and library during configuration.
  9221. You need to explicitly configure the build with <code class="code">--enable-libuavs3d</code>.
  9222. </p>
  9223. <a name="Options-5"></a>
  9224. <h4 class="subsection">11.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-5" aria-hidden="true">TOC</a></span></h4>
  9225. <p>The following option is supported by the libuavs3d wrapper.
  9226. </p>
  9227. <dl class="table">
  9228. <dt><samp class="option">frame_threads</samp></dt>
  9229. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  9230. </p>
  9231. </dd>
  9232. </dl>
  9233. <a name="libxevd"></a>
  9234. <h3 class="section">11.7 libxevd<span class="pull-right"><a class="anchor hidden-xs" href="#libxevd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libxevd" aria-hidden="true">TOC</a></span></h3>
  9235. <p>eXtra-fast Essential Video Decoder (XEVD) MPEG-5 EVC decoder wrapper.
  9236. </p>
  9237. <p>This decoder requires the presence of the libxevd headers and library
  9238. during configuration. You need to explicitly configure the build with
  9239. <samp class="option">--enable-libxevd</samp>.
  9240. </p>
  9241. <p>The xevd project website is at <a class="url" href="https://github.com/mpeg5/xevd">https://github.com/mpeg5/xevd</a>.
  9242. </p>
  9243. <a name="Options-6"></a>
  9244. <h4 class="subsection">11.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-6" aria-hidden="true">TOC</a></span></h4>
  9245. <p>The following options are supported by the libxevd wrapper.
  9246. The xevd-equivalent options or values are listed in parentheses for easy migration.
  9247. </p>
  9248. <p>To get a more accurate and extensive documentation of the libxevd options,
  9249. invoke the command <code class="code">xevd_app --help</code> or consult the libxevd documentation.
  9250. </p>
  9251. <dl class="table">
  9252. <dt><samp class="option">threads (<em class="emph">threads</em>)</samp></dt>
  9253. <dd><p>Force to use a specific number of threads
  9254. </p>
  9255. </dd>
  9256. </dl>
  9257. <a name="QSV-Decoders"></a>
  9258. <h3 class="section">11.8 QSV Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#QSV-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-QSV-Decoders" aria-hidden="true">TOC</a></span></h3>
  9259. <p>The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
  9260. JPEG/MJPEG, VP8, VP9, AV1, VVC).
  9261. </p>
  9262. <a name="Common-Options"></a>
  9263. <h4 class="subsection">11.8.1 Common Options<span class="pull-right"><a class="anchor hidden-xs" href="#Common-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Common-Options" aria-hidden="true">TOC</a></span></h4>
  9264. <p>The following options are supported by all qsv decoders.
  9265. </p>
  9266. <dl class="table">
  9267. <dt><samp class="option"><var class="var">async_depth</var></samp></dt>
  9268. <dd><p>Internal parallelization depth, the higher the value the higher the latency.
  9269. </p>
  9270. </dd>
  9271. <dt><samp class="option"><var class="var">gpu_copy</var></samp></dt>
  9272. <dd><p>A GPU-accelerated copy between video and system memory
  9273. </p><dl class="table">
  9274. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  9275. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  9276. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  9277. </dl>
  9278. </dd>
  9279. </dl>
  9280. <a name="HEVC-Options"></a>
  9281. <h4 class="subsection">11.8.2 HEVC Options<span class="pull-right"><a class="anchor hidden-xs" href="#HEVC-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-HEVC-Options" aria-hidden="true">TOC</a></span></h4>
  9282. <p>Extra options for hevc_qsv.
  9283. </p>
  9284. <dl class="table">
  9285. <dt><samp class="option"><var class="var">load_plugin</var></samp></dt>
  9286. <dd><p>A user plugin to load in an internal session
  9287. </p><dl class="table">
  9288. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  9289. <dt>&lsquo;<samp class="samp">hevc_sw</samp>&rsquo;</dt>
  9290. <dt>&lsquo;<samp class="samp">hevc_hw</samp>&rsquo;</dt>
  9291. </dl>
  9292. </dd>
  9293. <dt><samp class="option"><var class="var">load_plugins</var></samp></dt>
  9294. <dd><p>A :-separate list of hexadecimal plugin UIDs to load in an internal session
  9295. </p>
  9296. </dd>
  9297. </dl>
  9298. <a name="v210"></a>
  9299. <h3 class="section">11.9 v210<span class="pull-right"><a class="anchor hidden-xs" href="#v210" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v210" aria-hidden="true">TOC</a></span></h3>
  9300. <p>Uncompressed 4:2:2 10-bit decoder.
  9301. </p>
  9302. <a name="Options-7"></a>
  9303. <h4 class="subsection">11.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-7" aria-hidden="true">TOC</a></span></h4>
  9304. <dl class="table">
  9305. <dt><samp class="option">custom_stride</samp></dt>
  9306. <dd><p>Set the line size of the v210 data in bytes. The default value is 0
  9307. (autodetect). You can use the special -1 value for a strideless v210 as seen in
  9308. BOXX files.
  9309. </p>
  9310. </dd>
  9311. </dl>
  9312. <a name="Audio-Decoders"></a>
  9313. <h2 class="chapter">12 Audio Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Decoders" aria-hidden="true">TOC</a></span></h2>
  9314. <p>A description of some of the currently available audio decoders
  9315. follows.
  9316. </p>
  9317. <a name="ac3"></a>
  9318. <h3 class="section">12.1 ac3<span class="pull-right"><a class="anchor hidden-xs" href="#ac3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ac3" aria-hidden="true">TOC</a></span></h3>
  9319. <p>AC-3 audio decoder.
  9320. </p>
  9321. <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  9322. the undocumented RealAudio 3 (a.k.a. dnet).
  9323. </p>
  9324. <a name="AC_002d3-Decoder-Options"></a>
  9325. <h4 class="subsection">12.1.1 AC-3 Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#AC_002d3-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AC_002d3-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
  9326. <dl class="table">
  9327. <dt><samp class="option">-drc_scale <var class="var">value</var></samp></dt>
  9328. <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
  9329. from the AC-3 stream. This factor is applied exponentially. The default value is 1.
  9330. There are 3 notable scale factor ranges:
  9331. </p><dl class="table">
  9332. <dt><samp class="option">drc_scale == 0</samp></dt>
  9333. <dd><p>DRC disabled. Produces full range audio.
  9334. </p></dd>
  9335. <dt><samp class="option">0 &lt; drc_scale &lt;= 1</samp></dt>
  9336. <dd><p>DRC enabled. Applies a fraction of the stream DRC value.
  9337. Audio reproduction is between full range and full compression.
  9338. </p></dd>
  9339. <dt><samp class="option">drc_scale &gt; 1</samp></dt>
  9340. <dd><p>DRC enabled. Applies drc_scale asymmetrically.
  9341. Loud sounds are fully compressed. Soft sounds are enhanced.
  9342. </p></dd>
  9343. </dl>
  9344. </dd>
  9345. </dl>
  9346. <a name="flac-1"></a>
  9347. <h3 class="section">12.2 flac<span class="pull-right"><a class="anchor hidden-xs" href="#flac-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flac-1" aria-hidden="true">TOC</a></span></h3>
  9348. <p>FLAC audio decoder.
  9349. </p>
  9350. <p>This decoder aims to implement the complete FLAC specification from Xiph.
  9351. </p>
  9352. <a name="FLAC-Decoder-options"></a>
  9353. <h4 class="subsection">12.2.1 FLAC Decoder options<span class="pull-right"><a class="anchor hidden-xs" href="#FLAC-Decoder-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FLAC-Decoder-options" aria-hidden="true">TOC</a></span></h4>
  9354. <dl class="table">
  9355. <dt><samp class="option">-use_buggy_lpc</samp></dt>
  9356. <dd><p>The lavc FLAC encoder used to produce buggy streams with high lpc values
  9357. (like the default value). This option makes it possible to decode such streams
  9358. correctly by using lavc&rsquo;s old buggy lpc logic for decoding.
  9359. </p>
  9360. </dd>
  9361. </dl>
  9362. <a name="ffwavesynth"></a>
  9363. <h3 class="section">12.3 ffwavesynth<span class="pull-right"><a class="anchor hidden-xs" href="#ffwavesynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffwavesynth" aria-hidden="true">TOC</a></span></h3>
  9364. <p>Internal wave synthesizer.
  9365. </p>
  9366. <p>This decoder generates wave patterns according to predefined sequences. Its
  9367. use is purely internal and the format of the data it accepts is not publicly
  9368. documented.
  9369. </p>
  9370. <a name="libcelt"></a>
  9371. <h3 class="section">12.4 libcelt<span class="pull-right"><a class="anchor hidden-xs" href="#libcelt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcelt" aria-hidden="true">TOC</a></span></h3>
  9372. <p>libcelt decoder wrapper.
  9373. </p>
  9374. <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
  9375. Requires the presence of the libcelt headers and library during configuration.
  9376. You need to explicitly configure the build with <code class="code">--enable-libcelt</code>.
  9377. </p>
  9378. <a name="libgsm"></a>
  9379. <h3 class="section">12.5 libgsm<span class="pull-right"><a class="anchor hidden-xs" href="#libgsm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgsm" aria-hidden="true">TOC</a></span></h3>
  9380. <p>libgsm decoder wrapper.
  9381. </p>
  9382. <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
  9383. the presence of the libgsm headers and library during configuration. You need
  9384. to explicitly configure the build with <code class="code">--enable-libgsm</code>.
  9385. </p>
  9386. <p>This decoder supports both the ordinary GSM and the Microsoft variant.
  9387. </p>
  9388. <a name="libilbc"></a>
  9389. <h3 class="section">12.6 libilbc<span class="pull-right"><a class="anchor hidden-xs" href="#libilbc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libilbc" aria-hidden="true">TOC</a></span></h3>
  9390. <p>libilbc decoder wrapper.
  9391. </p>
  9392. <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
  9393. audio codec. Requires the presence of the libilbc headers and library during
  9394. configuration. You need to explicitly configure the build with
  9395. <code class="code">--enable-libilbc</code>.
  9396. </p>
  9397. <a name="Options-8"></a>
  9398. <h4 class="subsection">12.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-8" aria-hidden="true">TOC</a></span></h4>
  9399. <p>The following option is supported by the libilbc wrapper.
  9400. </p>
  9401. <dl class="table">
  9402. <dt><samp class="option">enhance</samp></dt>
  9403. <dd>
  9404. <p>Enable the enhancement of the decoded audio when set to 1. The default
  9405. value is 0 (disabled).
  9406. </p>
  9407. </dd>
  9408. </dl>
  9409. <a name="libmpeghdec"></a>
  9410. <h3 class="section">12.7 libmpeghdec<span class="pull-right"><a class="anchor hidden-xs" href="#libmpeghdec" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libmpeghdec" aria-hidden="true">TOC</a></span></h3>
  9411. <p>libmpeghdec decoder wrapper.
  9412. </p>
  9413. <p>libmpeghdec allows libmpeghdec to decode the MPEG-H 3D audio codec.
  9414. Requires the presence of the libmpeghdec headers and library during
  9415. configuration. You need to explicitly configure the build with
  9416. <code class="code">--enable-libmpeghdec --enable-nonfree</code>.
  9417. </p>
  9418. <a name="libopencore_002damrnb"></a>
  9419. <h3 class="section">12.8 libopencore-amrnb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrnb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrnb" aria-hidden="true">TOC</a></span></h3>
  9420. <p>libopencore-amrnb decoder wrapper.
  9421. </p>
  9422. <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
  9423. Narrowband audio codec. Using it requires the presence of the
  9424. libopencore-amrnb headers and library during configuration. You need to
  9425. explicitly configure the build with <code class="code">--enable-libopencore-amrnb</code>.
  9426. </p>
  9427. <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
  9428. without this library.
  9429. </p>
  9430. <a name="libopencore_002damrwb"></a>
  9431. <h3 class="section">12.9 libopencore-amrwb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrwb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrwb" aria-hidden="true">TOC</a></span></h3>
  9432. <p>libopencore-amrwb decoder wrapper.
  9433. </p>
  9434. <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
  9435. Wideband audio codec. Using it requires the presence of the
  9436. libopencore-amrwb headers and library during configuration. You need to
  9437. explicitly configure the build with <code class="code">--enable-libopencore-amrwb</code>.
  9438. </p>
  9439. <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
  9440. without this library.
  9441. </p>
  9442. <a name="libopus"></a>
  9443. <h3 class="section">12.10 libopus<span class="pull-right"><a class="anchor hidden-xs" href="#libopus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopus" aria-hidden="true">TOC</a></span></h3>
  9444. <p>libopus decoder wrapper.
  9445. </p>
  9446. <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
  9447. Requires the presence of the libopus headers and library during
  9448. configuration. You need to explicitly configure the build with
  9449. <code class="code">--enable-libopus</code>.
  9450. </p>
  9451. <p>An FFmpeg native decoder for Opus exists, so users can decode Opus
  9452. without this library.
  9453. </p>
  9454. <a name="Subtitles-Decoders"></a>
  9455. <h2 class="chapter">13 Subtitles Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitles-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitles-Decoders" aria-hidden="true">TOC</a></span></h2>
  9456. <a name="libaribb24"></a>
  9457. <h3 class="section">13.1 libaribb24<span class="pull-right"><a class="anchor hidden-xs" href="#libaribb24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribb24" aria-hidden="true">TOC</a></span></h3>
  9458. <p>ARIB STD-B24 caption decoder.
  9459. </p>
  9460. <p>Implements profiles A and C of the ARIB STD-B24 standard.
  9461. </p>
  9462. <a name="libaribb24-Decoder-Options"></a>
  9463. <h4 class="subsection">13.1.1 libaribb24 Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#libaribb24-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribb24-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
  9464. <dl class="table">
  9465. <dt><samp class="option">-aribb24-base-path <var class="var">path</var></samp></dt>
  9466. <dd><p>Sets the base path for the libaribb24 library. This is utilized for reading of
  9467. configuration files (for custom unicode conversions), and for dumping of
  9468. non-text symbols as images under that location.
  9469. </p>
  9470. <p>Unset by default.
  9471. </p>
  9472. </dd>
  9473. <dt><samp class="option">-aribb24-skip-ruby-text <var class="var">boolean</var></samp></dt>
  9474. <dd><p>Tells the decoder wrapper to skip text blocks that contain half-height ruby
  9475. text.
  9476. </p>
  9477. <p>Enabled by default.
  9478. </p>
  9479. </dd>
  9480. </dl>
  9481. <a name="libaribcaption"></a>
  9482. <h3 class="section">13.2 libaribcaption<span class="pull-right"><a class="anchor hidden-xs" href="#libaribcaption" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribcaption" aria-hidden="true">TOC</a></span></h3>
  9483. <p>Yet another ARIB STD-B24 caption decoder using external <em class="dfn">libaribcaption</em>
  9484. library.
  9485. </p>
  9486. <p>Implements profiles A and C of the Japanese ARIB STD-B24 standard,
  9487. Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T.
  9488. </p>
  9489. <p>Requires the presence of the libaribcaption headers and library
  9490. (<a class="url" href="https://github.com/xqq/libaribcaption">https://github.com/xqq/libaribcaption</a>) during configuration.
  9491. You need to explicitly configure the build with <code class="code">--enable-libaribcaption</code>.
  9492. If both <em class="dfn">libaribb24</em> and <em class="dfn">libaribcaption</em> are enabled, <em class="dfn">libaribcaption</em>
  9493. decoder precedes.
  9494. </p>
  9495. <a name="libaribcaption-Decoder-Options"></a>
  9496. <h4 class="subsection">13.2.1 libaribcaption Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#libaribcaption-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribcaption-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
  9497. <dl class="table">
  9498. <dt><samp class="option">-sub_type <var class="var">subtitle_type</var></samp></dt>
  9499. <dd><p>Specifies the format of the decoded subtitles.
  9500. </p>
  9501. <dl class="table">
  9502. <dt>&lsquo;<samp class="samp">bitmap</samp>&rsquo;</dt>
  9503. <dd><p>Graphical image.
  9504. </p></dd>
  9505. <dt>&lsquo;<samp class="samp">ass</samp>&rsquo;</dt>
  9506. <dd><p>ASS formatted text.
  9507. </p></dd>
  9508. <dt>&lsquo;<samp class="samp">text</samp>&rsquo;</dt>
  9509. <dd><p>Simple text based output without formatting.
  9510. </p></dd>
  9511. </dl>
  9512. <p>The default is <em class="dfn">ass</em> as same as <em class="dfn">libaribb24</em> decoder.
  9513. Some present players (e.g., <em class="dfn">mpv</em>) expect ASS format for ARIB caption.
  9514. </p>
  9515. </dd>
  9516. <dt><samp class="option">-caption_encoding <var class="var">encoding_scheme</var></samp></dt>
  9517. <dd><p>Specifies the encoding scheme of input subtitle text.
  9518. </p>
  9519. <dl class="table">
  9520. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  9521. <dd><p>Automatically detect text encoding (default).
  9522. </p></dd>
  9523. <dt>&lsquo;<samp class="samp">jis</samp>&rsquo;</dt>
  9524. <dd><p>8bit-char JIS encoding defined in ARIB STD B24.
  9525. This encoding used in Japan for ISDB captions.
  9526. </p></dd>
  9527. <dt>&lsquo;<samp class="samp">utf8</samp>&rsquo;</dt>
  9528. <dd><p>UTF-8 encoding defined in ARIB STD B24.
  9529. This encoding is used in Philippines for ISDB-T captions.
  9530. </p></dd>
  9531. <dt>&lsquo;<samp class="samp">latin</samp>&rsquo;</dt>
  9532. <dd><p>Latin character encoding defined in ABNT NBR 15606-1.
  9533. This encoding is used in South America for SBTVD / ISDB-Tb captions.
  9534. </p></dd>
  9535. </dl>
  9536. </dd>
  9537. <dt><samp class="option">-font <var class="var">font_name[,font_name2,...]</var></samp></dt>
  9538. <dd><p>Specify comma-separated list of font family names to be used for <em class="dfn">bitmap</em>
  9539. or <em class="dfn">ass</em> type subtitle rendering.
  9540. Only first font name is used for <em class="dfn">ass</em> type subtitle.
  9541. </p>
  9542. <p>If not specified, use internally defined default font family.
  9543. </p>
  9544. </dd>
  9545. <dt><samp class="option">-ass_single_rect <var class="var">boolean</var></samp></dt>
  9546. <dd><p>ARIB STD-B24 specifies that some captions may be displayed at different
  9547. positions at a time (multi-rectangle subtitle).
  9548. Since some players (e.g., old <em class="dfn">mpv</em>) can&rsquo;t handle multiple ASS rectangles
  9549. in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration
  9550. with the same start timestamp, this option can change the behavior so that
  9551. all the texts are displayed in a single ASS rectangle.
  9552. </p>
  9553. <p>The default is <var class="var">false</var>.
  9554. </p>
  9555. <p>If your player cannot handle AVSubtitles with multiple ASS rectangles properly,
  9556. set this option to <var class="var">true</var> or define <code class="env">ASS_SINGLE_RECT=1</code> to change
  9557. default behavior at compilation.
  9558. </p>
  9559. </dd>
  9560. <dt><samp class="option">-force_outline_text <var class="var">boolean</var></samp></dt>
  9561. <dd><p>Specify whether always render outline text for all characters regardless of
  9562. the indication by character style.
  9563. </p>
  9564. <p>The default is <var class="var">false</var>.
  9565. </p>
  9566. </dd>
  9567. <dt><samp class="option">-outline_width <var class="var">number</var> (0.0 - 3.0)</samp></dt>
  9568. <dd><p>Specify width for outline text, in dots (relative).
  9569. </p>
  9570. <p>The default is <var class="var">1.5</var>.
  9571. </p>
  9572. </dd>
  9573. <dt><samp class="option">-ignore_background <var class="var">boolean</var></samp></dt>
  9574. <dd><p>Specify whether to ignore background color rendering.
  9575. </p>
  9576. <p>The default is <var class="var">false</var>.
  9577. </p>
  9578. </dd>
  9579. <dt><samp class="option">-ignore_ruby <var class="var">boolean</var></samp></dt>
  9580. <dd><p>Specify whether to ignore rendering for ruby-like (furigana) characters.
  9581. </p>
  9582. <p>The default is <var class="var">false</var>.
  9583. </p>
  9584. </dd>
  9585. <dt><samp class="option">-replace_drcs <var class="var">boolean</var></samp></dt>
  9586. <dd><p>Specify whether to render replaced DRCS characters as Unicode characters.
  9587. </p>
  9588. <p>The default is <var class="var">true</var>.
  9589. </p>
  9590. </dd>
  9591. <dt><samp class="option">-replace_msz_ascii <var class="var">boolean</var></samp></dt>
  9592. <dd><p>Specify whether to replace MSZ (Middle Size; half width) fullwidth
  9593. alphanumerics with halfwidth alphanumerics.
  9594. </p>
  9595. <p>The default is <var class="var">true</var>.
  9596. </p>
  9597. </dd>
  9598. <dt><samp class="option">-replace_msz_japanese <var class="var">boolean</var></samp></dt>
  9599. <dd><p>Specify whether to replace some MSZ (Middle Size; half width) fullwidth
  9600. japanese special characters with halfwidth ones.
  9601. </p>
  9602. <p>The default is <var class="var">true</var>.
  9603. </p>
  9604. </dd>
  9605. <dt><samp class="option">-replace_msz_glyph <var class="var">boolean</var></samp></dt>
  9606. <dd><p>Specify whether to replace MSZ (Middle Size; half width) characters
  9607. with halfwidth glyphs if the fonts supports it.
  9608. This option works under FreeType or DirectWrite renderer
  9609. with Adobe-Japan1 compliant fonts.
  9610. e.g., IBM Plex Sans JP, Morisawa BIZ UDGothic, Morisawa BIZ UDMincho,
  9611. Yu Gothic, Yu Mincho, and Meiryo.
  9612. </p>
  9613. <p>The default is <var class="var">true</var>.
  9614. </p>
  9615. </dd>
  9616. <dt><samp class="option">-canvas_size <var class="var">image_size</var></samp></dt>
  9617. <dd><p>Specify the resolution of the canvas to render subtitles to; usually, this
  9618. should be frame size of input video.
  9619. This only applies when <code class="code">-subtitle_type</code> is set to <var class="var">bitmap</var>.
  9620. </p>
  9621. <p>The libaribcaption decoder assumes input frame size for bitmap rendering as below:
  9622. </p><ol class="enumerate">
  9623. <li> PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3
  9624. </li><li> PROFILE_C : 320 x 180 with SAR (PAR) 1:1
  9625. </li></ol>
  9626. <p>If actual frame size of input video does not match above assumption,
  9627. the rendered captions may be distorted.
  9628. To make the captions undistorted, add <code class="code">-canvas_size</code> option to specify
  9629. actual input video size.
  9630. </p>
  9631. <p>Note that the <code class="code">-canvas_size</code> option is not required for video with
  9632. different size but same aspect ratio.
  9633. In such cases, the caption will be stretched or shrunk to actual video size
  9634. if <code class="code">-canvas_size</code> option is not specified.
  9635. If <code class="code">-canvas_size</code> option is specified with different size,
  9636. the caption will be stretched or shrunk as specified size with calculated SAR.
  9637. </p>
  9638. </dd>
  9639. </dl>
  9640. <a name="libaribcaption-decoder-usage-examples"></a>
  9641. <h4 class="subsection">13.2.2 libaribcaption decoder usage examples<span class="pull-right"><a class="anchor hidden-xs" href="#libaribcaption-decoder-usage-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribcaption-decoder-usage-examples" aria-hidden="true">TOC</a></span></h4>
  9642. <p>Display MPEG-TS file with ARIB subtitle by <code class="code">ffplay</code> tool:
  9643. </p><div class="example">
  9644. <pre class="example-preformatted">ffplay -sub_type bitmap MPEG.TS
  9645. </pre></div>
  9646. <p>Display MPEG-TS file with input frame size 1920x1080 by <code class="code">ffplay</code> tool:
  9647. </p><div class="example">
  9648. <pre class="example-preformatted">ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS
  9649. </pre></div>
  9650. <p>Embed ARIB subtitle in transcoded video:
  9651. </p><div class="example">
  9652. <pre class="example-preformatted">ffmpeg -sub_type bitmap -i src.m2t -filter_complex &quot;[0:v][0:s]overlay&quot; -vcodec h264 dest.mp4
  9653. </pre></div>
  9654. <a name="dvbsub"></a>
  9655. <h3 class="section">13.3 dvbsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvbsub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvbsub" aria-hidden="true">TOC</a></span></h3>
  9656. <a name="Options-9"></a>
  9657. <h4 class="subsection">13.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-9" aria-hidden="true">TOC</a></span></h4>
  9658. <dl class="table">
  9659. <dt><samp class="option">compute_clut</samp></dt>
  9660. <dd><dl class="table">
  9661. <dt><samp class="option">-2</samp></dt>
  9662. <dd><p>Compute clut once if no matching CLUT is in the stream.
  9663. </p></dd>
  9664. <dt><samp class="option">-1</samp></dt>
  9665. <dd><p>Compute clut if no matching CLUT is in the stream.
  9666. </p></dd>
  9667. <dt><samp class="option">0</samp></dt>
  9668. <dd><p>Never compute CLUT
  9669. </p></dd>
  9670. <dt><samp class="option">1</samp></dt>
  9671. <dd><p>Always compute CLUT and override the one provided in the stream.
  9672. </p></dd>
  9673. </dl>
  9674. </dd>
  9675. <dt><samp class="option">dvb_substream</samp></dt>
  9676. <dd><p>Selects the dvb substream, or all substreams if -1 which is default.
  9677. </p>
  9678. </dd>
  9679. </dl>
  9680. <a name="dvdsub"></a>
  9681. <h3 class="section">13.4 dvdsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvdsub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvdsub" aria-hidden="true">TOC</a></span></h3>
  9682. <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
  9683. also be found in VobSub file pairs and in some Matroska files.
  9684. </p>
  9685. <a name="Options-10"></a>
  9686. <h4 class="subsection">13.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-10" aria-hidden="true">TOC</a></span></h4>
  9687. <dl class="table">
  9688. <dt><samp class="option">palette</samp></dt>
  9689. <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
  9690. palette is normally specified in the index file; in Matroska, the palette is
  9691. stored in the codec extra-data in the same format as in VobSub. In DVDs, the
  9692. palette is stored in the IFO file, and therefore not available when reading
  9693. from dumped VOB files.
  9694. </p>
  9695. <p>The format for this option is a string containing 16 24-bits hexadecimal
  9696. numbers (without 0x prefix) separated by commas, for example <code class="code">0d00ee,
  9697. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  9698. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  9699. </p>
  9700. </dd>
  9701. <dt><samp class="option">ifo_palette</samp></dt>
  9702. <dd><p>Specify the IFO file from which the global palette is obtained.
  9703. (experimental)
  9704. </p>
  9705. </dd>
  9706. <dt><samp class="option">forced_subs_only</samp></dt>
  9707. <dd><p>Only decode subtitle entries marked as forced. Some titles have forced
  9708. and non-forced subtitles in the same track. Setting this flag to <code class="code">1</code>
  9709. will only keep the forced subtitles. Default value is <code class="code">0</code>.
  9710. </p></dd>
  9711. </dl>
  9712. <a name="libzvbi_002dteletext"></a>
  9713. <h3 class="section">13.5 libzvbi-teletext<span class="pull-right"><a class="anchor hidden-xs" href="#libzvbi_002dteletext" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libzvbi_002dteletext" aria-hidden="true">TOC</a></span></h3>
  9714. <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
  9715. subtitles. Requires the presence of the libzvbi headers and library during
  9716. configuration. You need to explicitly configure the build with
  9717. <code class="code">--enable-libzvbi</code>.
  9718. </p>
  9719. <a name="Options-11"></a>
  9720. <h4 class="subsection">13.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-11" aria-hidden="true">TOC</a></span></h4>
  9721. <dl class="table">
  9722. <dt><samp class="option">txt_page</samp></dt>
  9723. <dd><p>List of teletext page numbers to decode. Pages that do not match the specified
  9724. list are dropped. You may use the special <code class="code">*</code> string to match all pages,
  9725. or <code class="code">subtitle</code> to match all subtitle pages.
  9726. Default value is *.
  9727. </p></dd>
  9728. <dt><samp class="option">txt_default_region</samp></dt>
  9729. <dd><p>Set default character set used for decoding, a value between 0 and 87 (see
  9730. ETS 300 706, Section 15, Table 32). Default value is -1, which does not
  9731. override the libzvbi default. This option is needed for some legacy level 1.0
  9732. transmissions which cannot signal the proper charset.
  9733. </p></dd>
  9734. <dt><samp class="option">txt_chop_top</samp></dt>
  9735. <dd><p>Discards the top teletext line. Default value is 1.
  9736. </p></dd>
  9737. <dt><samp class="option">txt_format</samp></dt>
  9738. <dd><p>Specifies the format of the decoded subtitles.
  9739. </p><dl class="table">
  9740. <dt><samp class="option">bitmap</samp></dt>
  9741. <dd><p>The default format, you should use this for teletext pages, because certain
  9742. graphics and colors cannot be expressed in simple text or even ASS.
  9743. </p></dd>
  9744. <dt><samp class="option">text</samp></dt>
  9745. <dd><p>Simple text based output without formatting.
  9746. </p></dd>
  9747. <dt><samp class="option">ass</samp></dt>
  9748. <dd><p>Formatted ASS output, subtitle pages and teletext pages are returned in
  9749. different styles, subtitle pages are stripped down to text, but an effort is
  9750. made to keep the text alignment and the formatting.
  9751. </p></dd>
  9752. </dl>
  9753. </dd>
  9754. <dt><samp class="option">txt_left</samp></dt>
  9755. <dd><p>X offset of generated bitmaps, default is 0.
  9756. </p></dd>
  9757. <dt><samp class="option">txt_top</samp></dt>
  9758. <dd><p>Y offset of generated bitmaps, default is 0.
  9759. </p></dd>
  9760. <dt><samp class="option">txt_chop_spaces</samp></dt>
  9761. <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
  9762. text. This option is useful for teletext based subtitles where empty spaces may
  9763. be present at the start or at the end of the lines or empty lines may be
  9764. present between the subtitle lines because of double-sized teletext characters.
  9765. Default value is 1.
  9766. </p></dd>
  9767. <dt><samp class="option">txt_duration</samp></dt>
  9768. <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
  9769. milliseconds. Default value is -1 which means infinity or until the next
  9770. subtitle event comes.
  9771. </p></dd>
  9772. <dt><samp class="option">txt_transparent</samp></dt>
  9773. <dd><p>Force transparent background of the generated teletext bitmaps. Default value
  9774. is 0 which means an opaque background.
  9775. </p></dd>
  9776. <dt><samp class="option">txt_opacity</samp></dt>
  9777. <dd><p>Sets the opacity (0-255) of the teletext background. If
  9778. <samp class="option">txt_transparent</samp> is not set, it only affects characters between a start
  9779. box and an end box, typically subtitles. Default value is 0 if
  9780. <samp class="option">txt_transparent</samp> is set, 255 otherwise.
  9781. </p>
  9782. </dd>
  9783. </dl>
  9784. <a name="Encoders"></a>
  9785. <h2 class="chapter">14 Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Encoders" aria-hidden="true">TOC</a></span></h2>
  9786. <p>Encoders are configured elements in FFmpeg which allow the encoding of
  9787. multimedia streams.
  9788. </p>
  9789. <p>When you configure your FFmpeg build, all the supported native encoders
  9790. are enabled by default. Encoders requiring an external library must be enabled
  9791. manually via the corresponding <code class="code">--enable-lib</code> option. You can list all
  9792. available encoders using the configure option <code class="code">--list-encoders</code>.
  9793. </p>
  9794. <p>You can disable all the encoders with the configure option
  9795. <code class="code">--disable-encoders</code> and selectively enable / disable single encoders
  9796. with the options <code class="code">--enable-encoder=<var class="var">ENCODER</var></code> /
  9797. <code class="code">--disable-encoder=<var class="var">ENCODER</var></code>.
  9798. </p>
  9799. <p>The option <code class="code">-encoders</code> of the ff* tools will display the list of
  9800. enabled encoders.
  9801. </p>
  9802. <a name="Audio-Encoders"></a>
  9803. <h2 class="chapter">15 Audio Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Encoders" aria-hidden="true">TOC</a></span></h2>
  9804. <p>A description of some of the currently available audio encoders
  9805. follows.
  9806. </p>
  9807. <a class="anchor" id="aacenc"></a><a name="aac"></a>
  9808. <h3 class="section">15.1 aac<span class="pull-right"><a class="anchor hidden-xs" href="#aac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac" aria-hidden="true">TOC</a></span></h3>
  9809. <p>Advanced Audio Coding (AAC) encoder.
  9810. </p>
  9811. <p>This encoder is the default AAC encoder, natively implemented into FFmpeg.
  9812. </p>
  9813. <a name="Options-12"></a>
  9814. <h4 class="subsection">15.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-12" aria-hidden="true">TOC</a></span></h4>
  9815. <dl class="table">
  9816. <dt><samp class="option">b</samp></dt>
  9817. <dd><p>Set bit rate in bits/s. Setting this automatically activates constant bit rate
  9818. (CBR) mode. If this option is unspecified it is set to 128kbps.
  9819. </p>
  9820. </dd>
  9821. <dt><samp class="option">q</samp></dt>
  9822. <dd><p>Set quality for variable bit rate (VBR) mode. This option is valid only using
  9823. the <code class="command">ffmpeg</code> command-line tool. For library interface users, use
  9824. <samp class="option">global_quality</samp>.
  9825. </p>
  9826. </dd>
  9827. <dt><samp class="option">cutoff</samp></dt>
  9828. <dd><p>Set cutoff frequency. If unspecified will allow the encoder to dynamically
  9829. adjust the cutoff to improve clarity on low bitrates.
  9830. </p>
  9831. </dd>
  9832. <dt><samp class="option">aac_coder</samp></dt>
  9833. <dd><p>Set AAC encoder coding method. Possible values:
  9834. </p>
  9835. <dl class="table">
  9836. <dt>&lsquo;<samp class="samp">twoloop</samp>&rsquo;</dt>
  9837. <dd><p>Two loop searching (TLS) method. This is the default method.
  9838. </p>
  9839. <p>This method first sets quantizers depending on band thresholds and then tries
  9840. to find an optimal combination by adding or subtracting a specific value from
  9841. all quantizers and adjusting some individual quantizer a little. Will tune
  9842. itself based on whether <samp class="option">aac_is</samp>, <samp class="option">aac_ms</samp> and <samp class="option">aac_pns</samp>
  9843. are enabled.
  9844. </p>
  9845. </dd>
  9846. <dt>&lsquo;<samp class="samp">anmr</samp>&rsquo;</dt>
  9847. <dd><p>Average noise to mask ratio (ANMR) trellis-based solution.
  9848. </p>
  9849. <p>This is an experimental coder which currently produces a lower quality, is more
  9850. unstable and is slower than the default twoloop coder but has potential.
  9851. Currently has no support for the <samp class="option">aac_is</samp> or <samp class="option">aac_pns</samp> options.
  9852. Not currently recommended.
  9853. </p>
  9854. </dd>
  9855. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  9856. <dd><p>Constant quantizer method.
  9857. </p>
  9858. <p>Uses a cheaper version of twoloop algorithm that doesn&rsquo;t try to do as many
  9859. clever adjustments. Worse with low bitrates (less than 64kbps), but is better
  9860. and much faster at higher bitrates.
  9861. </p>
  9862. </dd>
  9863. </dl>
  9864. </dd>
  9865. <dt><samp class="option">aac_ms</samp></dt>
  9866. <dd><p>Sets mid/side coding mode. The default value of &quot;auto&quot; will automatically use
  9867. M/S with bands which will benefit from such coding. Can be forced for all bands
  9868. using the value &quot;enable&quot;, which is mainly useful for debugging or disabled using
  9869. &quot;disable&quot;.
  9870. </p>
  9871. </dd>
  9872. <dt><samp class="option">aac_is</samp></dt>
  9873. <dd><p>Sets intensity stereo coding tool usage. By default, it&rsquo;s enabled and will
  9874. automatically toggle IS for similar pairs of stereo bands if it&rsquo;s beneficial.
  9875. Can be disabled for debugging by setting the value to &quot;disable&quot;.
  9876. </p>
  9877. </dd>
  9878. <dt><samp class="option">aac_pns</samp></dt>
  9879. <dd><p>Uses perceptual noise substitution to replace low entropy high frequency bands
  9880. with imperceptible white noise during the decoding process. By default, it&rsquo;s
  9881. enabled, but can be disabled for debugging purposes by using &quot;disable&quot;.
  9882. </p>
  9883. </dd>
  9884. <dt><samp class="option">aac_tns</samp></dt>
  9885. <dd><p>Enables the use of a multitap FIR filter which spans through the high frequency
  9886. bands to hide quantization noise during the encoding process and is reverted
  9887. by the decoder. As well as decreasing unpleasant artifacts in the high range
  9888. this also reduces the entropy in the high bands and allows for more bits to
  9889. be used by the mid-low bands. By default it&rsquo;s enabled but can be disabled for
  9890. debugging by setting the option to &quot;disable&quot;.
  9891. </p>
  9892. </dd>
  9893. <dt><samp class="option">aac_ltp</samp></dt>
  9894. <dd><p>Enables the use of the long term prediction extension which increases coding
  9895. efficiency in very low bandwidth situations such as encoding of voice or
  9896. solo piano music by extending constant harmonic peaks in bands throughout
  9897. frames. This option is implied by profile:a aac_low.
  9898. Use in conjunction with <samp class="option">-ar</samp> to decrease the samplerate.
  9899. </p>
  9900. </dd>
  9901. <dt><samp class="option">profile</samp></dt>
  9902. <dd><p>Sets the encoding profile, possible values:
  9903. </p>
  9904. <dl class="table">
  9905. <dt>&lsquo;<samp class="samp">aac_low</samp>&rsquo;</dt>
  9906. <dd><p>The default, AAC &quot;Low-complexity&quot; profile. Is the most compatible and produces
  9907. decent quality.
  9908. </p>
  9909. </dd>
  9910. <dt>&lsquo;<samp class="samp">mpeg2_aac_low</samp>&rsquo;</dt>
  9911. <dd><p>Equivalent to <code class="code">-profile:a aac_low -aac_pns 0</code>. PNS was introduced with the
  9912. MPEG4 specifications.
  9913. </p>
  9914. </dd>
  9915. <dt>&lsquo;<samp class="samp">aac_ltp</samp>&rsquo;</dt>
  9916. <dd><p>Long term prediction profile, is enabled by and will enable the <samp class="option">aac_ltp</samp>
  9917. option. Introduced in MPEG4.
  9918. </p>
  9919. </dd>
  9920. </dl>
  9921. <p>If this option is unspecified it is set to &lsquo;<samp class="samp">aac_low</samp>&rsquo;.
  9922. </p></dd>
  9923. </dl>
  9924. <a name="ac3-and-ac3_005ffixed"></a>
  9925. <h3 class="section">15.2 ac3 and ac3_fixed<span class="pull-right"><a class="anchor hidden-xs" href="#ac3-and-ac3_005ffixed" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ac3-and-ac3_005ffixed" aria-hidden="true">TOC</a></span></h3>
  9926. <p>AC-3 audio encoders.
  9927. </p>
  9928. <p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366.
  9929. </p>
  9930. <p>The <var class="var">ac3</var> encoder uses floating-point math, while the <var class="var">ac3_fixed</var>
  9931. encoder only uses fixed-point integer math. This does not mean that one is
  9932. always faster, just that one or the other may be better suited to a
  9933. particular system. The <var class="var">ac3_fixed</var> encoder is not the default codec for
  9934. any of the output formats, so it must be specified explicitly using the option
  9935. <code class="code">-acodec ac3_fixed</code> in order to use it.
  9936. </p>
  9937. <a name="AC_002d3-Metadata"></a>
  9938. <h4 class="subsection">15.2.1 AC-3 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#AC_002d3-Metadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AC_002d3-Metadata" aria-hidden="true">TOC</a></span></h4>
  9939. <p>The AC-3 metadata options are used to set parameters that describe the audio,
  9940. but in most cases do not affect the audio encoding itself. Some of the options
  9941. do directly affect or influence the decoding and playback of the resulting
  9942. bitstream, while others are just for informational purposes. A few of the
  9943. options will add bits to the output stream that could otherwise be used for
  9944. audio data, and will thus affect the quality of the output. Those will be
  9945. indicated accordingly with a note in the option list below.
  9946. </p>
  9947. <p>These parameters are described in detail in several publicly-available
  9948. documents.
  9949. </p><ul class="itemize mark-bullet">
  9950. <li><a class="uref" href="http://www.atsc.org/cms/standards/a_52-2010.pdf">A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard</a>
  9951. </li><li><a class="uref" href="http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf">A/54 - Guide to the Use of the ATSC Digital Television Standard</a>
  9952. </li><li><a class="uref" href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf">Dolby Metadata Guide</a>
  9953. </li><li><a class="uref" href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf">Dolby Digital Professional Encoding Guidelines</a>
  9954. </li></ul>
  9955. <a name="Metadata-Control-Options"></a>
  9956. <h4 class="subsubsection">15.2.1.1 Metadata Control Options<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata-Control-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata-Control-Options" aria-hidden="true">TOC</a></span></h4>
  9957. <dl class="table">
  9958. <dt><samp class="option">-per_frame_metadata <var class="var">boolean</var></samp></dt>
  9959. <dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  9960. metadata for each frame.
  9961. </p><dl class="table">
  9962. <dt><samp class="option">0</samp></dt>
  9963. <dd><p>The metadata values set at initialization will be used for every frame in the
  9964. stream. (default)
  9965. </p></dd>
  9966. <dt><samp class="option">1</samp></dt>
  9967. <dd><p>Metadata values can be changed before encoding each frame.
  9968. </p></dd>
  9969. </dl>
  9970. </dd>
  9971. </dl>
  9972. <a name="Downmix-Levels"></a>
  9973. <h4 class="subsubsection">15.2.1.2 Downmix Levels<span class="pull-right"><a class="anchor hidden-xs" href="#Downmix-Levels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Downmix-Levels" aria-hidden="true">TOC</a></span></h4>
  9974. <dl class="table">
  9975. <dt><samp class="option">-center_mixlev <var class="var">level</var></samp></dt>
  9976. <dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
  9977. channel when downmixing to stereo. This field will only be written to the
  9978. bitstream if a center channel is present. The value is specified as a scale
  9979. factor. There are 3 valid values:
  9980. </p><dl class="table">
  9981. <dt><samp class="option">0.707</samp></dt>
  9982. <dd><p>Apply -3dB gain
  9983. </p></dd>
  9984. <dt><samp class="option">0.595</samp></dt>
  9985. <dd><p>Apply -4.5dB gain (default)
  9986. </p></dd>
  9987. <dt><samp class="option">0.500</samp></dt>
  9988. <dd><p>Apply -6dB gain
  9989. </p></dd>
  9990. </dl>
  9991. </dd>
  9992. <dt><samp class="option">-surround_mixlev <var class="var">level</var></samp></dt>
  9993. <dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
  9994. channel(s) when downmixing to stereo. This field will only be written to the
  9995. bitstream if one or more surround channels are present. The value is specified
  9996. as a scale factor. There are 3 valid values:
  9997. </p><dl class="table">
  9998. <dt><samp class="option">0.707</samp></dt>
  9999. <dd><p>Apply -3dB gain
  10000. </p></dd>
  10001. <dt><samp class="option">0.500</samp></dt>
  10002. <dd><p>Apply -6dB gain (default)
  10003. </p></dd>
  10004. <dt><samp class="option">0.000</samp></dt>
  10005. <dd><p>Silence Surround Channel(s)
  10006. </p></dd>
  10007. </dl>
  10008. </dd>
  10009. </dl>
  10010. <a name="Audio-Production-Information"></a>
  10011. <h4 class="subsubsection">15.2.1.3 Audio Production Information<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Production-Information" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Production-Information" aria-hidden="true">TOC</a></span></h4>
  10012. <p>Audio Production Information is optional information describing the mixing
  10013. environment. Either none or both of the fields are written to the bitstream.
  10014. </p>
  10015. <dl class="table">
  10016. <dt><samp class="option">-mixing_level <var class="var">number</var></samp></dt>
  10017. <dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
  10018. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  10019. unknown or not indicated. The default value is -1, but that value cannot be
  10020. used if the Audio Production Information is written to the bitstream. Therefore,
  10021. if the <code class="code">room_type</code> option is not the default value, the <code class="code">mixing_level</code>
  10022. option must not be -1.
  10023. </p>
  10024. </dd>
  10025. <dt><samp class="option">-room_type <var class="var">type</var></samp></dt>
  10026. <dd><p>Room Type. Describes the equalization used during the final mixing session at
  10027. the studio or on the dubbing stage. A large room is a dubbing stage with the
  10028. industry standard X-curve equalization; a small room has flat equalization.
  10029. This field will not be written to the bitstream if both the <code class="code">mixing_level</code>
  10030. option and the <code class="code">room_type</code> option have the default values.
  10031. </p><dl class="table">
  10032. <dt><samp class="option">0</samp></dt>
  10033. <dt><samp class="option">notindicated</samp></dt>
  10034. <dd><p>Not Indicated (default)
  10035. </p></dd>
  10036. <dt><samp class="option">1</samp></dt>
  10037. <dt><samp class="option">large</samp></dt>
  10038. <dd><p>Large Room
  10039. </p></dd>
  10040. <dt><samp class="option">2</samp></dt>
  10041. <dt><samp class="option">small</samp></dt>
  10042. <dd><p>Small Room
  10043. </p></dd>
  10044. </dl>
  10045. </dd>
  10046. </dl>
  10047. <a name="Other-Metadata-Options"></a>
  10048. <h4 class="subsubsection">15.2.1.4 Other Metadata Options<span class="pull-right"><a class="anchor hidden-xs" href="#Other-Metadata-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Other-Metadata-Options" aria-hidden="true">TOC</a></span></h4>
  10049. <dl class="table">
  10050. <dt><samp class="option">-copyright <var class="var">boolean</var></samp></dt>
  10051. <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
  10052. </p><dl class="table">
  10053. <dt><samp class="option">0</samp></dt>
  10054. <dt><samp class="option">off</samp></dt>
  10055. <dd><p>No Copyright Exists (default)
  10056. </p></dd>
  10057. <dt><samp class="option">1</samp></dt>
  10058. <dt><samp class="option">on</samp></dt>
  10059. <dd><p>Copyright Exists
  10060. </p></dd>
  10061. </dl>
  10062. </dd>
  10063. <dt><samp class="option">-dialnorm <var class="var">value</var></samp></dt>
  10064. <dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
  10065. program is below digital 100% full scale (0 dBFS). This parameter determines a
  10066. level shift during audio reproduction that sets the average volume of the
  10067. dialogue to a preset level. The goal is to match volume level between program
  10068. sources. A value of -31dB will result in no volume level change, relative to
  10069. the source volume, during audio reproduction. Valid values are whole numbers in
  10070. the range -31 to -1, with -31 being the default.
  10071. </p>
  10072. </dd>
  10073. <dt><samp class="option">-dsur_mode <var class="var">mode</var></samp></dt>
  10074. <dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  10075. (Pro Logic). This field will only be written to the bitstream if the audio
  10076. stream is stereo. Using this option does <b class="b">NOT</b> mean the encoder will actually
  10077. apply Dolby Surround processing.
  10078. </p><dl class="table">
  10079. <dt><samp class="option">0</samp></dt>
  10080. <dt><samp class="option">notindicated</samp></dt>
  10081. <dd><p>Not Indicated (default)
  10082. </p></dd>
  10083. <dt><samp class="option">1</samp></dt>
  10084. <dt><samp class="option">off</samp></dt>
  10085. <dd><p>Not Dolby Surround Encoded
  10086. </p></dd>
  10087. <dt><samp class="option">2</samp></dt>
  10088. <dt><samp class="option">on</samp></dt>
  10089. <dd><p>Dolby Surround Encoded
  10090. </p></dd>
  10091. </dl>
  10092. </dd>
  10093. <dt><samp class="option">-original <var class="var">boolean</var></samp></dt>
  10094. <dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
  10095. original source and not a copy.
  10096. </p><dl class="table">
  10097. <dt><samp class="option">0</samp></dt>
  10098. <dt><samp class="option">off</samp></dt>
  10099. <dd><p>Not Original Source
  10100. </p></dd>
  10101. <dt><samp class="option">1</samp></dt>
  10102. <dt><samp class="option">on</samp></dt>
  10103. <dd><p>Original Source (default)
  10104. </p></dd>
  10105. </dl>
  10106. </dd>
  10107. </dl>
  10108. <a name="Extended-Bitstream-Information"></a>
  10109. <h4 class="subsection">15.2.2 Extended Bitstream Information<span class="pull-right"><a class="anchor hidden-xs" href="#Extended-Bitstream-Information" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Extended-Bitstream-Information" aria-hidden="true">TOC</a></span></h4>
  10110. <p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
  10111. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  10112. If any one parameter in a group is specified, all values in that group will be
  10113. written to the bitstream. Default values are used for those that are written
  10114. but have not been specified. If the mixing levels are written, the decoder
  10115. will use these values instead of the ones specified in the <code class="code">center_mixlev</code>
  10116. and <code class="code">surround_mixlev</code> options if it supports the Alternate Bit Stream
  10117. Syntax.
  10118. </p>
  10119. <a name="Extended-Bitstream-Information-_002d-Part-1"></a>
  10120. <h4 class="subsubsection">15.2.2.1 Extended Bitstream Information - Part 1<span class="pull-right"><a class="anchor hidden-xs" href="#Extended-Bitstream-Information-_002d-Part-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Extended-Bitstream-Information-_002d-Part-1" aria-hidden="true">TOC</a></span></h4>
  10121. <dl class="table">
  10122. <dt><samp class="option">-dmix_mode <var class="var">mode</var></samp></dt>
  10123. <dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  10124. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  10125. </p><dl class="table">
  10126. <dt><samp class="option">0</samp></dt>
  10127. <dt><samp class="option">notindicated</samp></dt>
  10128. <dd><p>Not Indicated (default)
  10129. </p></dd>
  10130. <dt><samp class="option">1</samp></dt>
  10131. <dt><samp class="option">ltrt</samp></dt>
  10132. <dd><p>Lt/Rt Downmix Preferred
  10133. </p></dd>
  10134. <dt><samp class="option">2</samp></dt>
  10135. <dt><samp class="option">loro</samp></dt>
  10136. <dd><p>Lo/Ro Downmix Preferred
  10137. </p></dd>
  10138. </dl>
  10139. </dd>
  10140. <dt><samp class="option">-ltrt_cmixlev <var class="var">level</var></samp></dt>
  10141. <dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  10142. center channel when downmixing to stereo in Lt/Rt mode.
  10143. </p><dl class="table">
  10144. <dt><samp class="option">1.414</samp></dt>
  10145. <dd><p>Apply +3dB gain
  10146. </p></dd>
  10147. <dt><samp class="option">1.189</samp></dt>
  10148. <dd><p>Apply +1.5dB gain
  10149. </p></dd>
  10150. <dt><samp class="option">1.000</samp></dt>
  10151. <dd><p>Apply 0dB gain
  10152. </p></dd>
  10153. <dt><samp class="option">0.841</samp></dt>
  10154. <dd><p>Apply -1.5dB gain
  10155. </p></dd>
  10156. <dt><samp class="option">0.707</samp></dt>
  10157. <dd><p>Apply -3.0dB gain
  10158. </p></dd>
  10159. <dt><samp class="option">0.595</samp></dt>
  10160. <dd><p>Apply -4.5dB gain (default)
  10161. </p></dd>
  10162. <dt><samp class="option">0.500</samp></dt>
  10163. <dd><p>Apply -6.0dB gain
  10164. </p></dd>
  10165. <dt><samp class="option">0.000</samp></dt>
  10166. <dd><p>Silence Center Channel
  10167. </p></dd>
  10168. </dl>
  10169. </dd>
  10170. <dt><samp class="option">-ltrt_surmixlev <var class="var">level</var></samp></dt>
  10171. <dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  10172. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  10173. </p><dl class="table">
  10174. <dt><samp class="option">0.841</samp></dt>
  10175. <dd><p>Apply -1.5dB gain
  10176. </p></dd>
  10177. <dt><samp class="option">0.707</samp></dt>
  10178. <dd><p>Apply -3.0dB gain
  10179. </p></dd>
  10180. <dt><samp class="option">0.595</samp></dt>
  10181. <dd><p>Apply -4.5dB gain
  10182. </p></dd>
  10183. <dt><samp class="option">0.500</samp></dt>
  10184. <dd><p>Apply -6.0dB gain (default)
  10185. </p></dd>
  10186. <dt><samp class="option">0.000</samp></dt>
  10187. <dd><p>Silence Surround Channel(s)
  10188. </p></dd>
  10189. </dl>
  10190. </dd>
  10191. <dt><samp class="option">-loro_cmixlev <var class="var">level</var></samp></dt>
  10192. <dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  10193. center channel when downmixing to stereo in Lo/Ro mode.
  10194. </p><dl class="table">
  10195. <dt><samp class="option">1.414</samp></dt>
  10196. <dd><p>Apply +3dB gain
  10197. </p></dd>
  10198. <dt><samp class="option">1.189</samp></dt>
  10199. <dd><p>Apply +1.5dB gain
  10200. </p></dd>
  10201. <dt><samp class="option">1.000</samp></dt>
  10202. <dd><p>Apply 0dB gain
  10203. </p></dd>
  10204. <dt><samp class="option">0.841</samp></dt>
  10205. <dd><p>Apply -1.5dB gain
  10206. </p></dd>
  10207. <dt><samp class="option">0.707</samp></dt>
  10208. <dd><p>Apply -3.0dB gain
  10209. </p></dd>
  10210. <dt><samp class="option">0.595</samp></dt>
  10211. <dd><p>Apply -4.5dB gain (default)
  10212. </p></dd>
  10213. <dt><samp class="option">0.500</samp></dt>
  10214. <dd><p>Apply -6.0dB gain
  10215. </p></dd>
  10216. <dt><samp class="option">0.000</samp></dt>
  10217. <dd><p>Silence Center Channel
  10218. </p></dd>
  10219. </dl>
  10220. </dd>
  10221. <dt><samp class="option">-loro_surmixlev <var class="var">level</var></samp></dt>
  10222. <dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  10223. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  10224. </p><dl class="table">
  10225. <dt><samp class="option">0.841</samp></dt>
  10226. <dd><p>Apply -1.5dB gain
  10227. </p></dd>
  10228. <dt><samp class="option">0.707</samp></dt>
  10229. <dd><p>Apply -3.0dB gain
  10230. </p></dd>
  10231. <dt><samp class="option">0.595</samp></dt>
  10232. <dd><p>Apply -4.5dB gain
  10233. </p></dd>
  10234. <dt><samp class="option">0.500</samp></dt>
  10235. <dd><p>Apply -6.0dB gain (default)
  10236. </p></dd>
  10237. <dt><samp class="option">0.000</samp></dt>
  10238. <dd><p>Silence Surround Channel(s)
  10239. </p></dd>
  10240. </dl>
  10241. </dd>
  10242. </dl>
  10243. <a name="Extended-Bitstream-Information-_002d-Part-2"></a>
  10244. <h4 class="subsubsection">15.2.2.2 Extended Bitstream Information - Part 2<span class="pull-right"><a class="anchor hidden-xs" href="#Extended-Bitstream-Information-_002d-Part-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Extended-Bitstream-Information-_002d-Part-2" aria-hidden="true">TOC</a></span></h4>
  10245. <dl class="table">
  10246. <dt><samp class="option">-dsurex_mode <var class="var">mode</var></samp></dt>
  10247. <dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  10248. (7.1 matrixed to 5.1). Using this option does <b class="b">NOT</b> mean the encoder will actually
  10249. apply Dolby Surround EX processing.
  10250. </p><dl class="table">
  10251. <dt><samp class="option">0</samp></dt>
  10252. <dt><samp class="option">notindicated</samp></dt>
  10253. <dd><p>Not Indicated (default)
  10254. </p></dd>
  10255. <dt><samp class="option">1</samp></dt>
  10256. <dt><samp class="option">on</samp></dt>
  10257. <dd><p>Dolby Surround EX Off
  10258. </p></dd>
  10259. <dt><samp class="option">2</samp></dt>
  10260. <dt><samp class="option">off</samp></dt>
  10261. <dd><p>Dolby Surround EX On
  10262. </p></dd>
  10263. </dl>
  10264. </dd>
  10265. <dt><samp class="option">-dheadphone_mode <var class="var">mode</var></samp></dt>
  10266. <dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  10267. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  10268. option does <b class="b">NOT</b> mean the encoder will actually apply Dolby Headphone
  10269. processing.
  10270. </p><dl class="table">
  10271. <dt><samp class="option">0</samp></dt>
  10272. <dt><samp class="option">notindicated</samp></dt>
  10273. <dd><p>Not Indicated (default)
  10274. </p></dd>
  10275. <dt><samp class="option">1</samp></dt>
  10276. <dt><samp class="option">on</samp></dt>
  10277. <dd><p>Dolby Headphone Off
  10278. </p></dd>
  10279. <dt><samp class="option">2</samp></dt>
  10280. <dt><samp class="option">off</samp></dt>
  10281. <dd><p>Dolby Headphone On
  10282. </p></dd>
  10283. </dl>
  10284. </dd>
  10285. <dt><samp class="option">-ad_conv_type <var class="var">type</var></samp></dt>
  10286. <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  10287. conversion.
  10288. </p><dl class="table">
  10289. <dt><samp class="option">0</samp></dt>
  10290. <dt><samp class="option">standard</samp></dt>
  10291. <dd><p>Standard A/D Converter (default)
  10292. </p></dd>
  10293. <dt><samp class="option">1</samp></dt>
  10294. <dt><samp class="option">hdcd</samp></dt>
  10295. <dd><p>HDCD A/D Converter
  10296. </p></dd>
  10297. </dl>
  10298. </dd>
  10299. </dl>
  10300. <a name="Other-AC_002d3-Encoding-Options"></a>
  10301. <h4 class="subsection">15.2.3 Other AC-3 Encoding Options<span class="pull-right"><a class="anchor hidden-xs" href="#Other-AC_002d3-Encoding-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Other-AC_002d3-Encoding-Options" aria-hidden="true">TOC</a></span></h4>
  10302. <dl class="table">
  10303. <dt><samp class="option">-stereo_rematrixing <var class="var">boolean</var></samp></dt>
  10304. <dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  10305. is an optional AC-3 feature that increases quality by selectively encoding
  10306. the left/right channels as mid/side. This option is enabled by default, and it
  10307. is highly recommended that it be left as enabled except for testing purposes.
  10308. </p>
  10309. </dd>
  10310. <dt><samp class="option">cutoff <var class="var">frequency</var></samp></dt>
  10311. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder selects a default
  10312. determined by various other encoding parameters.
  10313. </p>
  10314. </dd>
  10315. </dl>
  10316. <a name="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"></a>
  10317. <h4 class="subsection">15.2.4 Floating-Point-Only AC-3 Encoding Options<span class="pull-right"><a class="anchor hidden-xs" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" aria-hidden="true">TOC</a></span></h4>
  10318. <p>These options are only valid for the floating-point encoder and do not exist
  10319. for the fixed-point encoder due to the corresponding features not being
  10320. implemented in fixed-point.
  10321. </p>
  10322. <dl class="table">
  10323. <dt><samp class="option">-channel_coupling <var class="var">boolean</var></samp></dt>
  10324. <dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
  10325. that increases quality by combining high frequency information from multiple
  10326. channels into a single channel. The per-channel high frequency information is
  10327. sent with less accuracy in both the frequency and time domains. This allows
  10328. more bits to be used for lower frequencies while preserving enough information
  10329. to reconstruct the high frequencies. This option is enabled by default for the
  10330. floating-point encoder and should generally be left as enabled except for
  10331. testing purposes or to increase encoding speed.
  10332. </p><dl class="table">
  10333. <dt><samp class="option">-1</samp></dt>
  10334. <dt><samp class="option">auto</samp></dt>
  10335. <dd><p>Selected by Encoder (default)
  10336. </p></dd>
  10337. <dt><samp class="option">0</samp></dt>
  10338. <dt><samp class="option">off</samp></dt>
  10339. <dd><p>Disable Channel Coupling
  10340. </p></dd>
  10341. <dt><samp class="option">1</samp></dt>
  10342. <dt><samp class="option">on</samp></dt>
  10343. <dd><p>Enable Channel Coupling
  10344. </p></dd>
  10345. </dl>
  10346. </dd>
  10347. <dt><samp class="option">-cpl_start_band <var class="var">number</var></samp></dt>
  10348. <dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  10349. value higher than the bandwidth is used, it will be reduced to 1 less than the
  10350. coupling end band. If <var class="var">auto</var> is used, the start band will be determined by
  10351. the encoder based on the bit rate, sample rate, and channel layout. This option
  10352. has no effect if channel coupling is disabled.
  10353. </p><dl class="table">
  10354. <dt><samp class="option">-1</samp></dt>
  10355. <dt><samp class="option">auto</samp></dt>
  10356. <dd><p>Selected by Encoder (default)
  10357. </p></dd>
  10358. </dl>
  10359. </dd>
  10360. </dl>
  10361. <a class="anchor" id="flac"></a><a name="flac-2"></a>
  10362. <h3 class="section">15.3 flac<span class="pull-right"><a class="anchor hidden-xs" href="#flac-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flac-2" aria-hidden="true">TOC</a></span></h3>
  10363. <p>FLAC (Free Lossless Audio Codec) Encoder
  10364. </p>
  10365. <a name="Options-13"></a>
  10366. <h4 class="subsection">15.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-13" aria-hidden="true">TOC</a></span></h4>
  10367. <p>The following options are supported by FFmpeg&rsquo;s flac encoder.
  10368. </p>
  10369. <dl class="table">
  10370. <dt><samp class="option">compression_level</samp></dt>
  10371. <dd><p>Sets the compression level, which chooses defaults for many other options
  10372. if they are not set explicitly. Valid values are from 0 to 12, 5 is the
  10373. default.
  10374. </p>
  10375. </dd>
  10376. <dt><samp class="option">frame_size</samp></dt>
  10377. <dd><p>Sets the size of the frames in samples per channel.
  10378. </p>
  10379. </dd>
  10380. <dt><samp class="option">lpc_coeff_precision</samp></dt>
  10381. <dd><p>Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  10382. default.
  10383. </p>
  10384. </dd>
  10385. <dt><samp class="option">lpc_type</samp></dt>
  10386. <dd><p>Sets the first stage LPC algorithm
  10387. </p><dl class="table">
  10388. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  10389. <dd><p>LPC is not used
  10390. </p>
  10391. </dd>
  10392. <dt>&lsquo;<samp class="samp">fixed</samp>&rsquo;</dt>
  10393. <dd><p>fixed LPC coefficients
  10394. </p>
  10395. </dd>
  10396. <dt>&lsquo;<samp class="samp">levinson</samp>&rsquo;</dt>
  10397. <dt>&lsquo;<samp class="samp">cholesky</samp>&rsquo;</dt>
  10398. </dl>
  10399. </dd>
  10400. <dt><samp class="option">lpc_passes</samp></dt>
  10401. <dd><p>Number of passes to use for Cholesky factorization during LPC analysis
  10402. </p>
  10403. </dd>
  10404. <dt><samp class="option">min_partition_order</samp></dt>
  10405. <dd><p>The minimum partition order
  10406. </p>
  10407. </dd>
  10408. <dt><samp class="option">max_partition_order</samp></dt>
  10409. <dd><p>The maximum partition order
  10410. </p>
  10411. </dd>
  10412. <dt><samp class="option">prediction_order_method</samp></dt>
  10413. <dd><dl class="table">
  10414. <dt>&lsquo;<samp class="samp">estimation</samp>&rsquo;</dt>
  10415. <dt>&lsquo;<samp class="samp">2level</samp>&rsquo;</dt>
  10416. <dt>&lsquo;<samp class="samp">4level</samp>&rsquo;</dt>
  10417. <dt>&lsquo;<samp class="samp">8level</samp>&rsquo;</dt>
  10418. <dt>&lsquo;<samp class="samp">search</samp>&rsquo;</dt>
  10419. <dd><p>Bruteforce search
  10420. </p></dd>
  10421. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  10422. </dl>
  10423. </dd>
  10424. <dt><samp class="option">ch_mode</samp></dt>
  10425. <dd><p>Channel mode
  10426. </p><dl class="table">
  10427. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  10428. <dd><p>The mode is chosen automatically for each frame
  10429. </p></dd>
  10430. <dt>&lsquo;<samp class="samp">indep</samp>&rsquo;</dt>
  10431. <dd><p>Channels are independently coded
  10432. </p></dd>
  10433. <dt>&lsquo;<samp class="samp">left_side</samp>&rsquo;</dt>
  10434. <dt>&lsquo;<samp class="samp">right_side</samp>&rsquo;</dt>
  10435. <dt>&lsquo;<samp class="samp">mid_side</samp>&rsquo;</dt>
  10436. </dl>
  10437. </dd>
  10438. <dt><samp class="option">exact_rice_parameters</samp></dt>
  10439. <dd><p>Chooses if rice parameters are calculated exactly or approximately.
  10440. if set to 1 then they are chosen exactly, which slows the code down slightly and
  10441. improves compression slightly.
  10442. </p>
  10443. </dd>
  10444. <dt><samp class="option">multi_dim_quant</samp></dt>
  10445. <dd><p>Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  10446. applied after the first stage to finetune the coefficients. This is quite slow
  10447. and slightly improves compression.
  10448. </p>
  10449. </dd>
  10450. </dl>
  10451. <a class="anchor" id="opusenc"></a><a name="opus"></a>
  10452. <h3 class="section">15.4 opus<span class="pull-right"><a class="anchor hidden-xs" href="#opus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-opus" aria-hidden="true">TOC</a></span></h3>
  10453. <p>Opus encoder.
  10454. </p>
  10455. <p>This is a native FFmpeg encoder for the Opus format. Currently, it&rsquo;s in development and
  10456. only implements the CELT part of the codec. Its quality is usually worse and at best
  10457. is equal to the libopus encoder.
  10458. </p>
  10459. <a name="Options-14"></a>
  10460. <h4 class="subsection">15.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-14" aria-hidden="true">TOC</a></span></h4>
  10461. <dl class="table">
  10462. <dt><samp class="option">b</samp></dt>
  10463. <dd><p>Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
  10464. to make a good guess.
  10465. </p>
  10466. </dd>
  10467. <dt><samp class="option">opus_delay</samp></dt>
  10468. <dd><p>Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
  10469. decrease quality.
  10470. </p></dd>
  10471. </dl>
  10472. <a class="anchor" id="libfdk_002daac_002denc"></a><a name="libfdk_005faac"></a>
  10473. <h3 class="section">15.5 libfdk_aac<span class="pull-right"><a class="anchor hidden-xs" href="#libfdk_005faac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libfdk_005faac" aria-hidden="true">TOC</a></span></h3>
  10474. <p>libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  10475. </p>
  10476. <p>The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  10477. the Android project.
  10478. </p>
  10479. <p>Requires the presence of the libfdk-aac headers and library during
  10480. configuration. You need to explicitly configure the build with
  10481. <code class="code">--enable-libfdk-aac</code>. The library is also incompatible with GPL,
  10482. so if you allow the use of GPL, you should configure with
  10483. <code class="code">--enable-gpl --enable-nonfree --enable-libfdk-aac</code>.
  10484. </p>
  10485. <p>This encoder has support for the AAC-HE profiles.
  10486. </p>
  10487. <p>VBR encoding, enabled through the <samp class="option">vbr</samp> or <samp class="option">flags
  10488. +qscale</samp> options, is experimental and only works with some
  10489. combinations of parameters.
  10490. </p>
  10491. <p>Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  10492. higher.
  10493. </p>
  10494. <p>For more information see the fdk-aac project at
  10495. <a class="url" href="http://sourceforge.net/p/opencore-amr/fdk-aac/">http://sourceforge.net/p/opencore-amr/fdk-aac/</a>.
  10496. </p>
  10497. <a name="Options-15"></a>
  10498. <h4 class="subsection">15.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-15" aria-hidden="true">TOC</a></span></h4>
  10499. <p>The following options are mapped on the shared FFmpeg codec options.
  10500. </p>
  10501. <dl class="table">
  10502. <dt><samp class="option">b</samp></dt>
  10503. <dd><p>Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  10504. is automatically set to a suitable value depending on the selected
  10505. profile.
  10506. </p>
  10507. <p>In case VBR mode is enabled the option is ignored.
  10508. </p>
  10509. </dd>
  10510. <dt><samp class="option">ar</samp></dt>
  10511. <dd><p>Set audio sampling rate (in Hz).
  10512. </p>
  10513. </dd>
  10514. <dt><samp class="option">channels</samp></dt>
  10515. <dd><p>Set the number of audio channels.
  10516. </p>
  10517. </dd>
  10518. <dt><samp class="option">flags +qscale</samp></dt>
  10519. <dd><p>Enable fixed quality, VBR (Variable Bit Rate) mode.
  10520. Note that VBR is implicitly enabled when the <samp class="option">vbr</samp> value is
  10521. positive.
  10522. </p>
  10523. </dd>
  10524. <dt><samp class="option">cutoff</samp></dt>
  10525. <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
  10526. will use a value automatically computed by the library. Default value
  10527. is 0.
  10528. </p>
  10529. </dd>
  10530. <dt><samp class="option">profile</samp></dt>
  10531. <dd><p>Set audio profile.
  10532. </p>
  10533. <p>The following profiles are recognized:
  10534. </p><dl class="table">
  10535. <dt>&lsquo;<samp class="samp">aac_low</samp>&rsquo;</dt>
  10536. <dd><p>Low Complexity AAC (LC)
  10537. </p>
  10538. </dd>
  10539. <dt>&lsquo;<samp class="samp">aac_he</samp>&rsquo;</dt>
  10540. <dd><p>High Efficiency AAC (HE-AAC)
  10541. </p>
  10542. </dd>
  10543. <dt>&lsquo;<samp class="samp">aac_he_v2</samp>&rsquo;</dt>
  10544. <dd><p>High Efficiency AAC version 2 (HE-AACv2)
  10545. </p>
  10546. </dd>
  10547. <dt>&lsquo;<samp class="samp">aac_ld</samp>&rsquo;</dt>
  10548. <dd><p>Low Delay AAC (LD)
  10549. </p>
  10550. </dd>
  10551. <dt>&lsquo;<samp class="samp">aac_eld</samp>&rsquo;</dt>
  10552. <dd><p>Enhanced Low Delay AAC (ELD)
  10553. </p></dd>
  10554. </dl>
  10555. <p>If not specified it is set to &lsquo;<samp class="samp">aac_low</samp>&rsquo;.
  10556. </p></dd>
  10557. </dl>
  10558. <p>The following are private options of the libfdk_aac encoder.
  10559. </p>
  10560. <dl class="table">
  10561. <dt><samp class="option">afterburner</samp></dt>
  10562. <dd><p>Enable afterburner feature if set to 1, disabled if set to 0. This
  10563. improves the quality but also the required processing power.
  10564. </p>
  10565. <p>Default value is 1.
  10566. </p>
  10567. </dd>
  10568. <dt><samp class="option">eld_sbr</samp></dt>
  10569. <dd><p>Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  10570. if set to 0.
  10571. </p>
  10572. <p>Default value is 0.
  10573. </p>
  10574. </dd>
  10575. <dt><samp class="option">eld_v2</samp></dt>
  10576. <dd><p>Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
  10577. disabled if set to 0.
  10578. </p>
  10579. <p>Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) &gt; (4.0.0).
  10580. </p>
  10581. <p>Default value is 0.
  10582. </p>
  10583. </dd>
  10584. <dt><samp class="option">signaling</samp></dt>
  10585. <dd><p>Set SBR/PS signaling style.
  10586. </p>
  10587. <p>It can assume one of the following values:
  10588. </p><dl class="table">
  10589. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  10590. <dd><p>choose signaling implicitly (explicit hierarchical by default,
  10591. implicit if global header is disabled)
  10592. </p>
  10593. </dd>
  10594. <dt>&lsquo;<samp class="samp">implicit</samp>&rsquo;</dt>
  10595. <dd><p>implicit backwards compatible signaling
  10596. </p>
  10597. </dd>
  10598. <dt>&lsquo;<samp class="samp">explicit_sbr</samp>&rsquo;</dt>
  10599. <dd><p>explicit SBR, implicit PS signaling
  10600. </p>
  10601. </dd>
  10602. <dt>&lsquo;<samp class="samp">explicit_hierarchical</samp>&rsquo;</dt>
  10603. <dd><p>explicit hierarchical signaling
  10604. </p></dd>
  10605. </dl>
  10606. <p>Default value is &lsquo;<samp class="samp">default</samp>&rsquo;.
  10607. </p>
  10608. </dd>
  10609. <dt><samp class="option">latm</samp></dt>
  10610. <dd><p>Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  10611. </p>
  10612. <p>Default value is 0.
  10613. </p>
  10614. </dd>
  10615. <dt><samp class="option">header_period</samp></dt>
  10616. <dd><p>Set StreamMuxConfig and PCE repetition period (in frames) for sending
  10617. in-band configuration buffers within LATM/LOAS transport layer.
  10618. </p>
  10619. <p>Must be a 16-bits non-negative integer.
  10620. </p>
  10621. <p>Default value is 0.
  10622. </p>
  10623. </dd>
  10624. <dt><samp class="option">vbr</samp></dt>
  10625. <dd><p>Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  10626. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  10627. (Constant Bit Rate) is enabled.
  10628. </p>
  10629. <p>Currently only the &lsquo;<samp class="samp">aac_low</samp>&rsquo; profile supports VBR encoding.
  10630. </p>
  10631. <p>VBR modes 1-5 correspond to roughly the following average bit rates:
  10632. </p>
  10633. <dl class="table">
  10634. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  10635. <dd><p>32 kbps/channel
  10636. </p></dd>
  10637. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  10638. <dd><p>40 kbps/channel
  10639. </p></dd>
  10640. <dt>&lsquo;<samp class="samp">3</samp>&rsquo;</dt>
  10641. <dd><p>48-56 kbps/channel
  10642. </p></dd>
  10643. <dt>&lsquo;<samp class="samp">4</samp>&rsquo;</dt>
  10644. <dd><p>64 kbps/channel
  10645. </p></dd>
  10646. <dt>&lsquo;<samp class="samp">5</samp>&rsquo;</dt>
  10647. <dd><p>about 80-96 kbps/channel
  10648. </p></dd>
  10649. </dl>
  10650. <p>Default value is 0.
  10651. </p>
  10652. </dd>
  10653. <dt><samp class="option">frame_length</samp></dt>
  10654. <dd><p>Set the audio frame length in samples. Default value is the internal
  10655. default of the library. Refer to the library&rsquo;s documentation for information
  10656. about supported values.
  10657. </p></dd>
  10658. </dl>
  10659. <a name="Examples-4"></a>
  10660. <h4 class="subsection">15.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-4" aria-hidden="true">TOC</a></span></h4>
  10661. <ul class="itemize mark-bullet">
  10662. <li>Use <code class="command">ffmpeg</code> to convert an audio file to VBR AAC in an M4A (MP4)
  10663. container:
  10664. <div class="example">
  10665. <pre class="example-preformatted">ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  10666. </pre></div>
  10667. </li><li>Use <code class="command">ffmpeg</code> to convert an audio file to CBR 64k kbps AAC, using the
  10668. High-Efficiency AAC profile:
  10669. <div class="example">
  10670. <pre class="example-preformatted">ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  10671. </pre></div>
  10672. </li></ul>
  10673. <a class="anchor" id="liblc3_002denc"></a><a name="liblc3"></a>
  10674. <h3 class="section">15.6 liblc3<span class="pull-right"><a class="anchor hidden-xs" href="#liblc3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-liblc3" aria-hidden="true">TOC</a></span></h3>
  10675. <p>liblc3 LC3 (Low Complexity Communication Codec) encoder wrapper.
  10676. </p>
  10677. <p>Requires the presence of the liblc3 headers and library during configuration.
  10678. You need to explicitly configure the build with <code class="code">--enable-liblc3</code>.
  10679. </p>
  10680. <p>This encoder has support for the Bluetooth SIG LC3 codec for the LE Audio
  10681. protocol, and the following features of LC3plus:
  10682. </p><ul class="itemize mark-bullet">
  10683. <li>Frame duration of 2.5 and 5ms.
  10684. </li><li>High-Resolution mode, 48 KHz, and 96 kHz sampling rates.
  10685. </li></ul>
  10686. <p>For more information see the liblc3 project at
  10687. <a class="url" href="https://github.com/google/liblc3">https://github.com/google/liblc3</a>.
  10688. </p>
  10689. <a name="Options-16"></a>
  10690. <h4 class="subsection">15.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-16" aria-hidden="true">TOC</a></span></h4>
  10691. <p>The following options are mapped on the shared FFmpeg codec options.
  10692. </p>
  10693. <dl class="table">
  10694. <dt><samp class="option">b <var class="var">bitrate</var></samp></dt>
  10695. <dd><p>Set the bit rate in bits/s. This will determine the fixed size of the encoded
  10696. frames, for a selected frame duration.
  10697. </p>
  10698. </dd>
  10699. <dt><samp class="option">ar <var class="var">frequency</var></samp></dt>
  10700. <dd><p>Set the audio sampling rate (in Hz).
  10701. </p>
  10702. </dd>
  10703. <dt><samp class="option">channels</samp></dt>
  10704. <dd><p>Set the number of audio channels.
  10705. </p>
  10706. </dd>
  10707. <dt><samp class="option">frame_duration</samp></dt>
  10708. <dd><p>Set the audio frame duration in milliseconds. Default value is 10ms.
  10709. Allowed frame durations are 2.5ms, 5ms, 7.5ms and 10ms.
  10710. LC3 (Bluetooth LE Audio), allows 7.5ms and 10ms; and LC3plus 2.5ms, 5ms
  10711. and 10ms.
  10712. </p>
  10713. <p>The 10ms frame duration is available in LC3 and LC3 plus standard.
  10714. In this mode, the produced bitstream can be referenced either as LC3 or LC3plus.
  10715. </p>
  10716. </dd>
  10717. <dt><samp class="option">high_resolution <var class="var">boolean</var></samp></dt>
  10718. <dd><p>Enable the high-resolution mode if set to 1. The high-resolution mode is
  10719. available with all LC3plus frame durations and for a sampling rate of 48 KHz,
  10720. and 96 KHz.
  10721. </p>
  10722. <p>The encoder automatically turns off this mode at lower sampling rates and
  10723. activates it at 96 KHz.
  10724. </p>
  10725. <p>This mode should be preferred at high bitrates. In this mode, the audio
  10726. bandwidth is always up to the Nyquist frequency, compared to LC3 at 48 KHz,
  10727. which limits the bandwidth to 20 KHz.
  10728. </p></dd>
  10729. </dl>
  10730. <a class="anchor" id="libmp3lame"></a><a name="libmp3lame-1"></a>
  10731. <h3 class="section">15.7 libmp3lame<span class="pull-right"><a class="anchor hidden-xs" href="#libmp3lame-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libmp3lame-1" aria-hidden="true">TOC</a></span></h3>
  10732. <p>LAME (Lame Ain&rsquo;t an MP3 Encoder) MP3 encoder wrapper.
  10733. </p>
  10734. <p>Requires the presence of the libmp3lame headers and library during
  10735. configuration. You need to explicitly configure the build with
  10736. <code class="code">--enable-libmp3lame</code>.
  10737. </p>
  10738. <p>See <a class="ref" href="#libshine">libshine</a> for a fixed-point MP3 encoder, although with a
  10739. lower quality.
  10740. </p>
  10741. <a name="Options-17"></a>
  10742. <h4 class="subsection">15.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-17" aria-hidden="true">TOC</a></span></h4>
  10743. <p>The following options are supported by the libmp3lame wrapper. The
  10744. <code class="command">lame</code>-equivalent of the options are listed in parentheses.
  10745. </p>
  10746. <dl class="table">
  10747. <dt><samp class="option">b (<em class="emph">-b</em>)</samp></dt>
  10748. <dd><p>Set bitrate expressed in bits/s for CBR or ABR. LAME <code class="code">bitrate</code> is
  10749. expressed in kilobits/s.
  10750. </p>
  10751. </dd>
  10752. <dt><samp class="option">q (<em class="emph">-V</em>)</samp></dt>
  10753. <dd><p>Set constant quality setting for VBR. This option is valid only
  10754. using the <code class="command">ffmpeg</code> command-line tool. For library interface
  10755. users, use <samp class="option">global_quality</samp>.
  10756. </p>
  10757. </dd>
  10758. <dt><samp class="option">compression_level (<em class="emph">-q</em>)</samp></dt>
  10759. <dd><p>Set algorithm quality. Valid arguments are integers in the 0-9 range,
  10760. with 0 meaning highest quality but slowest, and 9 meaning fastest
  10761. while producing the worst quality.
  10762. </p>
  10763. </dd>
  10764. <dt><samp class="option">cutoff (<em class="emph">--lowpass</em>)</samp></dt>
  10765. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder dynamically
  10766. adjusts the cutoff.
  10767. </p>
  10768. </dd>
  10769. <dt><samp class="option">reservoir</samp></dt>
  10770. <dd><p>Enable use of bit reservoir when set to 1. Default value is 1. LAME
  10771. has this enabled by default, but can be overridden by use
  10772. <samp class="option">--nores</samp> option.
  10773. </p>
  10774. </dd>
  10775. <dt><samp class="option">joint_stereo (<em class="emph">-m j</em>)</samp></dt>
  10776. <dd><p>Enable the encoder to use (on a frame by frame basis) either L/R
  10777. stereo or mid/side stereo. Default value is 1.
  10778. </p>
  10779. </dd>
  10780. <dt><samp class="option">abr (<em class="emph">--abr</em>)</samp></dt>
  10781. <dd><p>Enable the encoder to use ABR when set to 1. The <code class="command">lame</code>
  10782. <samp class="option">--abr</samp> sets the target bitrate, while this options only
  10783. tells FFmpeg to use ABR still relies on <samp class="option">b</samp> to set bitrate.
  10784. </p>
  10785. </dd>
  10786. <dt><samp class="option">copyright (<em class="emph">-c</em>)</samp></dt>
  10787. <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
  10788. (disabled).
  10789. </p>
  10790. </dd>
  10791. <dt><samp class="option">original (<em class="emph">-o</em>)</samp></dt>
  10792. <dd><p>Set MPEG audio original flag when set to 1. The default value is 1
  10793. (enabled).
  10794. </p></dd>
  10795. </dl>
  10796. <a name="libopencore_002damrnb-1"></a>
  10797. <h3 class="section">15.8 libopencore-amrnb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrnb-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrnb-1" aria-hidden="true">TOC</a></span></h3>
  10798. <p>OpenCORE Adaptive Multi-Rate Narrowband encoder.
  10799. </p>
  10800. <p>Requires the presence of the libopencore-amrnb headers and library during
  10801. configuration. You need to explicitly configure the build with
  10802. <code class="code">--enable-libopencore-amrnb --enable-version3</code>.
  10803. </p>
  10804. <p>This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  10805. but you can override it by setting <samp class="option">strict</samp> to &lsquo;<samp class="samp">unofficial</samp>&rsquo; or
  10806. lower.
  10807. </p>
  10808. <a name="Options-18"></a>
  10809. <h4 class="subsection">15.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-18" aria-hidden="true">TOC</a></span></h4>
  10810. <dl class="table">
  10811. <dt><samp class="option">b</samp></dt>
  10812. <dd><p>Set bitrate in bits per second. Only the following bitrates are supported,
  10813. otherwise libavcodec will round to the nearest valid bitrate.
  10814. </p>
  10815. <dl class="table">
  10816. <dt><samp class="option">4750</samp></dt>
  10817. <dt><samp class="option">5150</samp></dt>
  10818. <dt><samp class="option">5900</samp></dt>
  10819. <dt><samp class="option">6700</samp></dt>
  10820. <dt><samp class="option">7400</samp></dt>
  10821. <dt><samp class="option">7950</samp></dt>
  10822. <dt><samp class="option">10200</samp></dt>
  10823. <dt><samp class="option">12200</samp></dt>
  10824. </dl>
  10825. </dd>
  10826. <dt><samp class="option">dtx</samp></dt>
  10827. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  10828. default value is 0 (disabled).
  10829. </p>
  10830. </dd>
  10831. </dl>
  10832. <a name="libopus-1"></a>
  10833. <h3 class="section">15.9 libopus<span class="pull-right"><a class="anchor hidden-xs" href="#libopus-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopus-1" aria-hidden="true">TOC</a></span></h3>
  10834. <p>libopus Opus Interactive Audio Codec encoder wrapper.
  10835. </p>
  10836. <p>Requires the presence of the libopus headers and library during
  10837. configuration. You need to explicitly configure the build with
  10838. <code class="code">--enable-libopus</code>.
  10839. </p>
  10840. <a name="Option-Mapping"></a>
  10841. <h4 class="subsection">15.9.1 Option Mapping<span class="pull-right"><a class="anchor hidden-xs" href="#Option-Mapping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Option-Mapping" aria-hidden="true">TOC</a></span></h4>
  10842. <p>Most libopus options are modelled after the <code class="command">opusenc</code> utility from
  10843. opus-tools. The following is an option mapping chart describing options
  10844. supported by the libopus wrapper, and their <code class="command">opusenc</code>-equivalent
  10845. in parentheses.
  10846. </p>
  10847. <dl class="table">
  10848. <dt><samp class="option">b (<em class="emph">bitrate</em>)</samp></dt>
  10849. <dd><p>Set the bit rate in bits/s. FFmpeg&rsquo;s <samp class="option">b</samp> option is
  10850. expressed in bits/s, while <code class="command">opusenc</code>&rsquo;s <samp class="option">bitrate</samp> in
  10851. kilobits/s.
  10852. </p>
  10853. </dd>
  10854. <dt><samp class="option">vbr (<em class="emph">vbr</em>, <em class="emph">hard-cbr</em>, and <em class="emph">cvbr</em>)</samp></dt>
  10855. <dd><p>Set VBR mode. The FFmpeg <samp class="option">vbr</samp> option has the following
  10856. valid arguments, with the <code class="command">opusenc</code> equivalent options
  10857. in parentheses:
  10858. </p>
  10859. <dl class="table">
  10860. <dt>&lsquo;<samp class="samp">off (<em class="emph">hard-cbr</em>)</samp>&rsquo;</dt>
  10861. <dd><p>Use constant bit rate encoding.
  10862. </p>
  10863. </dd>
  10864. <dt>&lsquo;<samp class="samp">on (<em class="emph">vbr</em>)</samp>&rsquo;</dt>
  10865. <dd><p>Use variable bit rate encoding (the default).
  10866. </p>
  10867. </dd>
  10868. <dt>&lsquo;<samp class="samp">constrained (<em class="emph">cvbr</em>)</samp>&rsquo;</dt>
  10869. <dd><p>Use constrained variable bit rate encoding.
  10870. </p></dd>
  10871. </dl>
  10872. </dd>
  10873. <dt><samp class="option">compression_level (<em class="emph">comp</em>)</samp></dt>
  10874. <dd><p>Set encoding algorithm complexity. Valid options are integers in
  10875. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  10876. gives the highest quality but slowest encoding. The default is 10.
  10877. </p>
  10878. </dd>
  10879. <dt><samp class="option">frame_duration (<em class="emph">framesize</em>)</samp></dt>
  10880. <dd><p>Set maximum frame size, or duration of a frame in milliseconds. The
  10881. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  10882. frame sizes achieve lower latency but less quality at a given bitrate.
  10883. Sizes greater than 20ms are only interesting at fairly low bitrates.
  10884. The default is 20ms.
  10885. </p>
  10886. </dd>
  10887. <dt><samp class="option">packet_loss (<em class="emph">expect-loss</em>)</samp></dt>
  10888. <dd><p>Set expected packet loss percentage. The default is 0.
  10889. </p>
  10890. </dd>
  10891. <dt><samp class="option">fec (<em class="emph">n/a</em>)</samp></dt>
  10892. <dd><p>Enable inband forward error correction. <samp class="option">packet_loss</samp> must be non-zero
  10893. to take advantage - frequency of FEC &rsquo;side-data&rsquo; is proportional to expected packet loss.
  10894. Default is disabled.
  10895. </p>
  10896. </dd>
  10897. <dt><samp class="option">application (N.A.)</samp></dt>
  10898. <dd><p>Set intended application type. Valid options are listed below:
  10899. </p>
  10900. <dl class="table">
  10901. <dt>&lsquo;<samp class="samp">voip</samp>&rsquo;</dt>
  10902. <dd><p>Favor improved speech intelligibility.
  10903. </p></dd>
  10904. <dt>&lsquo;<samp class="samp">audio</samp>&rsquo;</dt>
  10905. <dd><p>Favor faithfulness to the input (the default).
  10906. </p></dd>
  10907. <dt>&lsquo;<samp class="samp">lowdelay</samp>&rsquo;</dt>
  10908. <dd><p>Restrict to only the lowest delay modes by disabling voice-optimized
  10909. modes.
  10910. </p></dd>
  10911. </dl>
  10912. </dd>
  10913. <dt><samp class="option">cutoff (N.A.)</samp></dt>
  10914. <dd><p>Set cutoff bandwidth in Hz. The argument must be exactly one of the
  10915. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  10916. narrowband, mediumband, wideband, super wideband, and fullband
  10917. respectively. The default is 0 (cutoff disabled). Note that libopus
  10918. forces a wideband cutoff for bitrates &lt; 15 kbps, unless CELT-only
  10919. (<samp class="option">application</samp> set to &lsquo;<samp class="samp">lowdelay</samp>&rsquo;) mode is used.
  10920. </p>
  10921. </dd>
  10922. <dt><samp class="option">mapping_family (<em class="emph">mapping_family</em>)</samp></dt>
  10923. <dd><p>Set channel mapping family to be used by the encoder. The default value of -1
  10924. uses mapping family 0 for mono and stereo inputs, and mapping family 1
  10925. otherwise. The default also disables the surround masking and LFE bandwidth
  10926. optimizations in libopus, and requires that the input contains 8 channels or
  10927. fewer.
  10928. </p>
  10929. <p>Other values include 0 for mono and stereo, 1 for surround sound with masking
  10930. and LFE bandwidth optimizations, and 255 for independent streams with an
  10931. unspecified channel layout.
  10932. </p>
  10933. </dd>
  10934. <dt><samp class="option">apply_phase_inv (N.A.) (requires libopus &gt;= 1.2)</samp></dt>
  10935. <dd><p>If set to 0, disables the use of phase inversion for intensity stereo,
  10936. improving the quality of mono downmixes, but slightly reducing normal stereo
  10937. quality. The default is 1 (phase inversion enabled).
  10938. </p>
  10939. </dd>
  10940. </dl>
  10941. <a class="anchor" id="libshine"></a><a name="libshine-1"></a>
  10942. <h3 class="section">15.10 libshine<span class="pull-right"><a class="anchor hidden-xs" href="#libshine-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libshine-1" aria-hidden="true">TOC</a></span></h3>
  10943. <p>Shine Fixed-Point MP3 encoder wrapper.
  10944. </p>
  10945. <p>Shine is a fixed-point MP3 encoder. It has a far better performance on
  10946. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  10947. However, as it is more targeted on performance than quality, it is not on par
  10948. with LAME and other production-grade encoders quality-wise. Also, according to
  10949. the project&rsquo;s homepage, this encoder may not be free of bugs as the code was
  10950. written a long time ago and the project was dead for at least 5 years.
  10951. </p>
  10952. <p>This encoder only supports stereo and mono input. This is also CBR-only.
  10953. </p>
  10954. <p>The original project (last updated in early 2007) is at
  10955. <a class="url" href="http://sourceforge.net/projects/libshine-fxp/">http://sourceforge.net/projects/libshine-fxp/</a>. We only support the
  10956. updated fork by the Savonet/Liquidsoap project at <a class="url" href="https://github.com/savonet/shine">https://github.com/savonet/shine</a>.
  10957. </p>
  10958. <p>Requires the presence of the libshine headers and library during
  10959. configuration. You need to explicitly configure the build with
  10960. <code class="code">--enable-libshine</code>.
  10961. </p>
  10962. <p>See also <a class="ref" href="#libmp3lame">libmp3lame</a>.
  10963. </p>
  10964. <a name="Options-19"></a>
  10965. <h4 class="subsection">15.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-19" aria-hidden="true">TOC</a></span></h4>
  10966. <p>The following options are supported by the libshine wrapper. The
  10967. <code class="command">shineenc</code>-equivalent of the options are listed in parentheses.
  10968. </p>
  10969. <dl class="table">
  10970. <dt><samp class="option">b (<em class="emph">-b</em>)</samp></dt>
  10971. <dd><p>Set bitrate expressed in bits/s for CBR. <code class="command">shineenc</code> <samp class="option">-b</samp> option
  10972. is expressed in kilobits/s.
  10973. </p>
  10974. </dd>
  10975. </dl>
  10976. <a name="libtwolame"></a>
  10977. <h3 class="section">15.11 libtwolame<span class="pull-right"><a class="anchor hidden-xs" href="#libtwolame" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libtwolame" aria-hidden="true">TOC</a></span></h3>
  10978. <p>TwoLAME MP2 encoder wrapper.
  10979. </p>
  10980. <p>Requires the presence of the libtwolame headers and library during
  10981. configuration. You need to explicitly configure the build with
  10982. <code class="code">--enable-libtwolame</code>.
  10983. </p>
  10984. <a name="Options-20"></a>
  10985. <h4 class="subsection">15.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-20" aria-hidden="true">TOC</a></span></h4>
  10986. <p>The following options are supported by the libtwolame wrapper. The
  10987. <code class="command">twolame</code>-equivalent options follow the FFmpeg ones and are in
  10988. parentheses.
  10989. </p>
  10990. <dl class="table">
  10991. <dt><samp class="option">b (<em class="emph">-b</em>)</samp></dt>
  10992. <dd><p>Set bitrate expressed in bits/s for CBR. <code class="command">twolame</code> <samp class="option">b</samp>
  10993. option is expressed in kilobits/s. Default value is 128k.
  10994. </p>
  10995. </dd>
  10996. <dt><samp class="option">q (<em class="emph">-V</em>)</samp></dt>
  10997. <dd><p>Set quality for experimental VBR support. Maximum value range is
  10998. from -50 to 50, useful range is from -10 to 10. The higher the
  10999. value, the better the quality. This option is valid only using the
  11000. <code class="command">ffmpeg</code> command-line tool. For library interface users,
  11001. use <samp class="option">global_quality</samp>.
  11002. </p>
  11003. </dd>
  11004. <dt><samp class="option">mode (<em class="emph">--mode</em>)</samp></dt>
  11005. <dd><p>Set the mode of the resulting audio. Possible values:
  11006. </p>
  11007. <dl class="table">
  11008. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  11009. <dd><p>Choose mode automatically based on the input. This is the default.
  11010. </p></dd>
  11011. <dt>&lsquo;<samp class="samp">stereo</samp>&rsquo;</dt>
  11012. <dd><p>Stereo
  11013. </p></dd>
  11014. <dt>&lsquo;<samp class="samp">joint_stereo</samp>&rsquo;</dt>
  11015. <dd><p>Joint stereo
  11016. </p></dd>
  11017. <dt>&lsquo;<samp class="samp">dual_channel</samp>&rsquo;</dt>
  11018. <dd><p>Dual channel
  11019. </p></dd>
  11020. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  11021. <dd><p>Mono
  11022. </p></dd>
  11023. </dl>
  11024. </dd>
  11025. <dt><samp class="option">psymodel (<em class="emph">--psyc-mode</em>)</samp></dt>
  11026. <dd><p>Set psychoacoustic model to use in encoding. The argument must be
  11027. an integer between -1 and 4, inclusive. The higher the value, the
  11028. better the quality. The default value is 3.
  11029. </p>
  11030. </dd>
  11031. <dt><samp class="option">energy_levels (<em class="emph">--energy</em>)</samp></dt>
  11032. <dd><p>Enable energy levels extensions when set to 1. The default value is
  11033. 0 (disabled).
  11034. </p>
  11035. </dd>
  11036. <dt><samp class="option">error_protection (<em class="emph">--protect</em>)</samp></dt>
  11037. <dd><p>Enable CRC error protection when set to 1. The default value is 0
  11038. (disabled).
  11039. </p>
  11040. </dd>
  11041. <dt><samp class="option">copyright (<em class="emph">--copyright</em>)</samp></dt>
  11042. <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
  11043. (disabled).
  11044. </p>
  11045. </dd>
  11046. <dt><samp class="option">original (<em class="emph">--original</em>)</samp></dt>
  11047. <dd><p>Set MPEG audio original flag when set to 1. The default value is 0
  11048. (disabled).
  11049. </p>
  11050. </dd>
  11051. </dl>
  11052. <a name="libvo_002damrwbenc"></a>
  11053. <h3 class="section">15.12 libvo-amrwbenc<span class="pull-right"><a class="anchor hidden-xs" href="#libvo_002damrwbenc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvo_002damrwbenc" aria-hidden="true">TOC</a></span></h3>
  11054. <p>VisualOn Adaptive Multi-Rate Wideband encoder.
  11055. </p>
  11056. <p>Requires the presence of the libvo-amrwbenc headers and library during
  11057. configuration. You need to explicitly configure the build with
  11058. <code class="code">--enable-libvo-amrwbenc --enable-version3</code>.
  11059. </p>
  11060. <p>This is a mono-only encoder. Officially it only supports 16000Hz sample
  11061. rate, but you can override it by setting <samp class="option">strict</samp> to
  11062. &lsquo;<samp class="samp">unofficial</samp>&rsquo; or lower.
  11063. </p>
  11064. <a name="Options-21"></a>
  11065. <h4 class="subsection">15.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-21" aria-hidden="true">TOC</a></span></h4>
  11066. <dl class="table">
  11067. <dt><samp class="option">b</samp></dt>
  11068. <dd><p>Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  11069. libavcodec will round to the nearest valid bitrate.
  11070. </p>
  11071. <dl class="table">
  11072. <dt>&lsquo;<samp class="samp">6600</samp>&rsquo;</dt>
  11073. <dt>&lsquo;<samp class="samp">8850</samp>&rsquo;</dt>
  11074. <dt>&lsquo;<samp class="samp">12650</samp>&rsquo;</dt>
  11075. <dt>&lsquo;<samp class="samp">14250</samp>&rsquo;</dt>
  11076. <dt>&lsquo;<samp class="samp">15850</samp>&rsquo;</dt>
  11077. <dt>&lsquo;<samp class="samp">18250</samp>&rsquo;</dt>
  11078. <dt>&lsquo;<samp class="samp">19850</samp>&rsquo;</dt>
  11079. <dt>&lsquo;<samp class="samp">23050</samp>&rsquo;</dt>
  11080. <dt>&lsquo;<samp class="samp">23850</samp>&rsquo;</dt>
  11081. </dl>
  11082. </dd>
  11083. <dt><samp class="option">dtx</samp></dt>
  11084. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  11085. default value is 0 (disabled).
  11086. </p>
  11087. </dd>
  11088. </dl>
  11089. <a name="libvorbis"></a>
  11090. <h3 class="section">15.13 libvorbis<span class="pull-right"><a class="anchor hidden-xs" href="#libvorbis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvorbis" aria-hidden="true">TOC</a></span></h3>
  11091. <p>libvorbis encoder wrapper.
  11092. </p>
  11093. <p>Requires the presence of the libvorbisenc headers and library during
  11094. configuration. You need to explicitly configure the build with
  11095. <code class="code">--enable-libvorbis</code>.
  11096. </p>
  11097. <a name="Options-22"></a>
  11098. <h4 class="subsection">15.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-22" aria-hidden="true">TOC</a></span></h4>
  11099. <p>The following options are supported by the libvorbis wrapper. The
  11100. <code class="command">oggenc</code>-equivalent of the options are listed in parentheses.
  11101. </p>
  11102. <p>To get a more accurate and extensive documentation of the libvorbis
  11103. options, consult the libvorbisenc&rsquo;s and <code class="command">oggenc</code>&rsquo;s documentations.
  11104. See <a class="url" href="http://xiph.org/vorbis/">http://xiph.org/vorbis/</a>,
  11105. <a class="url" href="http://wiki.xiph.org/Vorbis-tools">http://wiki.xiph.org/Vorbis-tools</a>, and oggenc(1).
  11106. </p>
  11107. <dl class="table">
  11108. <dt><samp class="option">b (<em class="emph">-b</em>)</samp></dt>
  11109. <dd><p>Set bitrate expressed in bits/s for ABR. <code class="command">oggenc</code> <samp class="option">-b</samp> is
  11110. expressed in kilobits/s.
  11111. </p>
  11112. </dd>
  11113. <dt><samp class="option">q (<em class="emph">-q</em>)</samp></dt>
  11114. <dd><p>Set constant quality setting for VBR. The value should be a float
  11115. number in the range of -1.0 to 10.0. The higher the value, the better
  11116. the quality. The default value is &lsquo;<samp class="samp">3.0</samp>&rsquo;.
  11117. </p>
  11118. <p>This option is valid only using the <code class="command">ffmpeg</code> command-line tool.
  11119. For library interface users, use <samp class="option">global_quality</samp>.
  11120. </p>
  11121. </dd>
  11122. <dt><samp class="option">cutoff (<em class="emph">--advanced-encode-option lowpass_frequency=N</em>)</samp></dt>
  11123. <dd><p>Set cutoff bandwidth in Hz, a value of 0 disables cutoff. <code class="command">oggenc</code>&rsquo;s
  11124. related option is expressed in kHz. The default value is &lsquo;<samp class="samp">0</samp>&rsquo; (cutoff
  11125. disabled).
  11126. </p>
  11127. </dd>
  11128. <dt><samp class="option">minrate (<em class="emph">-m</em>)</samp></dt>
  11129. <dd><p>Set minimum bitrate expressed in bits/s. <code class="command">oggenc</code> <samp class="option">-m</samp> is
  11130. expressed in kilobits/s.
  11131. </p>
  11132. </dd>
  11133. <dt><samp class="option">maxrate (<em class="emph">-M</em>)</samp></dt>
  11134. <dd><p>Set maximum bitrate expressed in bits/s. <code class="command">oggenc</code> <samp class="option">-M</samp> is
  11135. expressed in kilobits/s. This only has effect on ABR mode.
  11136. </p>
  11137. </dd>
  11138. <dt><samp class="option">iblock (<em class="emph">--advanced-encode-option impulse_noisetune=N</em>)</samp></dt>
  11139. <dd><p>Set noise floor bias for impulse blocks. The value is a float number from
  11140. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  11141. to the crispness of transients in the encoded audio. The tradeoff for better
  11142. transient response is a higher bitrate.
  11143. </p>
  11144. </dd>
  11145. </dl>
  11146. <a class="anchor" id="mjpegenc"></a><a name="mjpeg"></a>
  11147. <h3 class="section">15.14 mjpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mjpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpeg" aria-hidden="true">TOC</a></span></h3>
  11148. <p>Motion JPEG encoder.
  11149. </p>
  11150. <a name="Options-23"></a>
  11151. <h4 class="subsection">15.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-23" aria-hidden="true">TOC</a></span></h4>
  11152. <dl class="table">
  11153. <dt><samp class="option">huffman</samp></dt>
  11154. <dd><p>Set the huffman encoding strategy. Possible values:
  11155. </p>
  11156. <dl class="table">
  11157. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  11158. <dd><p>Use the default huffman tables. This is the default strategy.
  11159. </p>
  11160. </dd>
  11161. <dt>&lsquo;<samp class="samp">optimal</samp>&rsquo;</dt>
  11162. <dd><p>Compute and use optimal huffman tables.
  11163. </p>
  11164. </dd>
  11165. </dl>
  11166. </dd>
  11167. </dl>
  11168. <a class="anchor" id="wavpackenc"></a><a name="wavpack"></a>
  11169. <h3 class="section">15.15 wavpack<span class="pull-right"><a class="anchor hidden-xs" href="#wavpack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-wavpack" aria-hidden="true">TOC</a></span></h3>
  11170. <p>WavPack lossless audio encoder.
  11171. </p>
  11172. <a name="Options-24"></a>
  11173. <h4 class="subsection">15.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-24" aria-hidden="true">TOC</a></span></h4>
  11174. <p>The equivalent options for <code class="command">wavpack</code> command line utility are listed in
  11175. parentheses.
  11176. </p>
  11177. <a name="Shared-options"></a>
  11178. <h4 class="subsubsection">15.15.1.1 Shared options<span class="pull-right"><a class="anchor hidden-xs" href="#Shared-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Shared-options" aria-hidden="true">TOC</a></span></h4>
  11179. <p>The following shared options are effective for this encoder. Only special notes
  11180. about this particular encoder will be documented here. For the general meaning
  11181. of the options, see <a class="ref" href="#codec_002doptions">the Codec Options chapter</a>.
  11182. </p>
  11183. <dl class="table">
  11184. <dt><samp class="option">frame_size (<em class="emph">--blocksize</em>)</samp></dt>
  11185. <dd><p>For this encoder, the range for this option is between 128 and 131072. Default
  11186. is automatically decided based on sample rate and number of channel.
  11187. </p>
  11188. <p>For the complete formula of calculating default, see
  11189. <samp class="file">libavcodec/wavpackenc.c</samp>.
  11190. </p>
  11191. </dd>
  11192. <dt><samp class="option">compression_level (<em class="emph">-f</em>, <em class="emph">-h</em>, <em class="emph">-hh</em>, and <em class="emph">-x</em>)</samp></dt>
  11193. </dl>
  11194. <a name="Private-options"></a>
  11195. <h4 class="subsubsection">15.15.1.2 Private options<span class="pull-right"><a class="anchor hidden-xs" href="#Private-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Private-options" aria-hidden="true">TOC</a></span></h4>
  11196. <dl class="table">
  11197. <dt><samp class="option">joint_stereo (<em class="emph">-j</em>)</samp></dt>
  11198. <dd><p>Set whether to enable joint stereo. Valid values are:
  11199. </p>
  11200. <dl class="table">
  11201. <dt>&lsquo;<samp class="samp">on (<em class="emph">1</em>)</samp>&rsquo;</dt>
  11202. <dd><p>Force mid/side audio encoding.
  11203. </p></dd>
  11204. <dt>&lsquo;<samp class="samp">off (<em class="emph">0</em>)</samp>&rsquo;</dt>
  11205. <dd><p>Force left/right audio encoding.
  11206. </p></dd>
  11207. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  11208. <dd><p>Let the encoder decide automatically.
  11209. </p></dd>
  11210. </dl>
  11211. </dd>
  11212. <dt><samp class="option">optimize_mono</samp></dt>
  11213. <dd><p>Set whether to enable optimization for mono. This option is only effective for
  11214. non-mono streams. Available values:
  11215. </p>
  11216. <dl class="table">
  11217. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  11218. <dd><p>enabled
  11219. </p></dd>
  11220. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  11221. <dd><p>disabled
  11222. </p></dd>
  11223. </dl>
  11224. </dd>
  11225. </dl>
  11226. <a name="Video-Encoders"></a>
  11227. <h2 class="chapter">16 Video Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Encoders" aria-hidden="true">TOC</a></span></h2>
  11228. <p>A description of some of the currently available video encoders
  11229. follows.
  11230. </p>
  11231. <a name="a64_005fmulti_002c-a64_005fmulti5"></a>
  11232. <h3 class="section">16.1 a64_multi, a64_multi5<span class="pull-right"><a class="anchor hidden-xs" href="#a64_005fmulti_002c-a64_005fmulti5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-a64_005fmulti_002c-a64_005fmulti5" aria-hidden="true">TOC</a></span></h3>
  11233. <p>A64 / Commodore 64 multicolor charset encoder. <code class="code">a64_multi5</code> is extended with 5th color (colram).
  11234. </p>
  11235. <a name="Cinepak"></a>
  11236. <h3 class="section">16.2 Cinepak<span class="pull-right"><a class="anchor hidden-xs" href="#Cinepak" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Cinepak" aria-hidden="true">TOC</a></span></h3>
  11237. <p>Cinepak aka CVID encoder.
  11238. Compatible with Windows 3.1 and vintage MacOS.
  11239. </p>
  11240. <a name="Options-25"></a>
  11241. <h4 class="subsection">16.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-25" aria-hidden="true">TOC</a></span></h4>
  11242. <dl class="table">
  11243. <dt><samp class="option">g <var class="var">integer</var></samp></dt>
  11244. <dd><p>Keyframe interval.
  11245. A keyframe is inserted at least every <code class="code">-g</code> frames, sometimes sooner.
  11246. </p>
  11247. </dd>
  11248. <dt><samp class="option">q:v <var class="var">integer</var></samp></dt>
  11249. <dd><p>Quality factor. Lower is better. Higher gives lower bitrate.
  11250. The following table lists bitrates when encoding akiyo_cif.y4m for various values of <code class="code">-q:v</code> with <code class="code">-g 100</code>:
  11251. </p>
  11252. <dl class="table">
  11253. <dt><samp class="option"><code class="code">-q:v 1</code> 1918 kb/s</samp></dt>
  11254. <dt><samp class="option"><code class="code">-q:v 2</code> 1735 kb/s</samp></dt>
  11255. <dt><samp class="option"><code class="code">-q:v 4</code> 1500 kb/s</samp></dt>
  11256. <dt><samp class="option"><code class="code">-q:v 10</code> 1041 kb/s</samp></dt>
  11257. <dt><samp class="option"><code class="code">-q:v 20</code> 826 kb/s</samp></dt>
  11258. <dt><samp class="option"><code class="code">-q:v 40</code> 553 kb/s</samp></dt>
  11259. <dt><samp class="option"><code class="code">-q:v 100</code> 394 kb/s</samp></dt>
  11260. <dt><samp class="option"><code class="code">-q:v 200</code> 312 kb/s</samp></dt>
  11261. <dt><samp class="option"><code class="code">-q:v 400</code> 266 kb/s</samp></dt>
  11262. <dt><samp class="option"><code class="code">-q:v 1000</code> 237 kb/s</samp></dt>
  11263. </dl>
  11264. </dd>
  11265. <dt><samp class="option">max_extra_cb_iterations <var class="var">integer</var></samp></dt>
  11266. <dd><p>Max extra codebook recalculation passes, more is better and slower.
  11267. </p>
  11268. </dd>
  11269. <dt><samp class="option">skip_empty_cb <var class="var">boolean</var></samp></dt>
  11270. <dd><p>Avoid wasting bytes, ignore vintage MacOS decoder.
  11271. </p>
  11272. </dd>
  11273. <dt><samp class="option">max_strips <var class="var">integer</var></samp></dt>
  11274. <dt><samp class="option">min_strips <var class="var">integer</var></samp></dt>
  11275. <dd><p>The minimum and maximum number of strips to use.
  11276. Wider range sometimes improves quality.
  11277. More strips is generally better quality but costs more bits.
  11278. Fewer strips tend to yield more keyframes.
  11279. Vintage compatible is 1..3.
  11280. </p>
  11281. </dd>
  11282. <dt><samp class="option">strip_number_adaptivity <var class="var">integer</var></samp></dt>
  11283. <dd><p>How much number of strips is allowed to change between frames.
  11284. Higher is better but slower.
  11285. </p>
  11286. </dd>
  11287. </dl>
  11288. <a class="anchor" id="ffv1"></a><a name="ffv1-1"></a>
  11289. <h3 class="section">16.3 ffv1<span class="pull-right"><a class="anchor hidden-xs" href="#ffv1-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffv1-1" aria-hidden="true">TOC</a></span></h3>
  11290. <p>FFv1 Encoder
  11291. </p>
  11292. <a name="Options-26"></a>
  11293. <h4 class="subsection">16.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-26" aria-hidden="true">TOC</a></span></h4>
  11294. <p>The following options are supported by FFmpeg&rsquo;s FFv1 encoder.
  11295. </p>
  11296. <dl class="table">
  11297. <dt><samp class="option">context</samp></dt>
  11298. <dd><p>Sets the context size, 0 (default) is small, 1 is big.
  11299. </p>
  11300. </dd>
  11301. <dt><samp class="option">coder</samp></dt>
  11302. <dd><p>Set the coder,
  11303. </p><dl class="table">
  11304. <dt>&lsquo;<samp class="samp">rice</samp>&rsquo;</dt>
  11305. <dd><p>Golomb rice coder
  11306. </p></dd>
  11307. <dt>&lsquo;<samp class="samp">range_def</samp>&rsquo;</dt>
  11308. <dd><p>Range coder with default table
  11309. </p></dd>
  11310. <dt>&lsquo;<samp class="samp">range_tab</samp>&rsquo;</dt>
  11311. <dd><p>Range coder with custom table
  11312. </p></dd>
  11313. </dl>
  11314. </dd>
  11315. <dt><samp class="option">slicecrc</samp></dt>
  11316. <dd><p>-1 (default, automatic), 1 use crc with zero initial and final state, 2 use crc with non zero initial and final state
  11317. </p>
  11318. </dd>
  11319. <dt><samp class="option">qtable</samp></dt>
  11320. <dd><dl class="table">
  11321. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  11322. <dd><p>default, automatic
  11323. </p></dd>
  11324. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  11325. <dd><p>use 8bit default
  11326. </p></dd>
  11327. <dt>&lsquo;<samp class="samp">greater8bit</samp>&rsquo;</dt>
  11328. <dd><p>use &gt;8bit default
  11329. </p></dd>
  11330. </dl>
  11331. </dd>
  11332. <dt><samp class="option">remap_optimizer</samp></dt>
  11333. <dd><p>0 - 5, default 3, how much effort the encoder puts into optimizing the remap table.
  11334. </p>
  11335. </dd>
  11336. </dl>
  11337. <a name="GIF"></a>
  11338. <h3 class="section">16.4 GIF<span class="pull-right"><a class="anchor hidden-xs" href="#GIF" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-GIF" aria-hidden="true">TOC</a></span></h3>
  11339. <p>GIF image/animation encoder.
  11340. </p>
  11341. <a name="Options-27"></a>
  11342. <h4 class="subsection">16.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-27" aria-hidden="true">TOC</a></span></h4>
  11343. <dl class="table">
  11344. <dt><samp class="option">gifflags <var class="var">integer</var></samp></dt>
  11345. <dd><p>Sets the flags used for GIF encoding.
  11346. </p>
  11347. <dl class="table">
  11348. <dt><samp class="option">offsetting</samp></dt>
  11349. <dd><p>Enables picture offsetting.
  11350. </p>
  11351. <p>Default is enabled.
  11352. </p>
  11353. </dd>
  11354. <dt><samp class="option">transdiff</samp></dt>
  11355. <dd><p>Enables transparency detection between frames.
  11356. </p>
  11357. <p>Default is enabled.
  11358. </p>
  11359. </dd>
  11360. </dl>
  11361. </dd>
  11362. <dt><samp class="option">gifimage <var class="var">integer</var></samp></dt>
  11363. <dd><p>Enables encoding one full GIF image per frame, rather than an animated GIF.
  11364. </p>
  11365. <p>Default value is <samp class="option">0</samp>.
  11366. </p>
  11367. </dd>
  11368. <dt><samp class="option">global_palette <var class="var">integer</var></samp></dt>
  11369. <dd><p>Writes a palette to the global GIF header where feasible.
  11370. </p>
  11371. <p>If disabled, every frame will always have a palette written, even if there
  11372. is a global palette supplied.
  11373. </p>
  11374. <p>Default value is <samp class="option">1</samp>.
  11375. </p>
  11376. </dd>
  11377. </dl>
  11378. <a name="Hap"></a>
  11379. <h3 class="section">16.5 Hap<span class="pull-right"><a class="anchor hidden-xs" href="#Hap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hap" aria-hidden="true">TOC</a></span></h3>
  11380. <p>Vidvox Hap video encoder.
  11381. </p>
  11382. <a name="Options-28"></a>
  11383. <h4 class="subsection">16.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-28" aria-hidden="true">TOC</a></span></h4>
  11384. <dl class="table">
  11385. <dt><samp class="option">format <var class="var">integer</var></samp></dt>
  11386. <dd><p>Specifies the Hap format to encode.
  11387. </p>
  11388. <dl class="table">
  11389. <dt><samp class="option">hap</samp></dt>
  11390. <dt><samp class="option">hap_alpha</samp></dt>
  11391. <dt><samp class="option">hap_q</samp></dt>
  11392. </dl>
  11393. <p>Default value is <samp class="option">hap</samp>.
  11394. </p>
  11395. </dd>
  11396. <dt><samp class="option">chunks <var class="var">integer</var></samp></dt>
  11397. <dd><p>Specifies the number of chunks to split frames into, between 1 and 64. This
  11398. permits multithreaded decoding of large frames, potentially at the cost of
  11399. data-rate. The encoder may modify this value to divide frames evenly.
  11400. </p>
  11401. <p>Default value is <var class="var">1</var>.
  11402. </p>
  11403. </dd>
  11404. <dt><samp class="option">compressor <var class="var">integer</var></samp></dt>
  11405. <dd><p>Specifies the second-stage compressor to use. If set to <samp class="option">none</samp>,
  11406. <samp class="option">chunks</samp> will be limited to 1, as chunked uncompressed frames offer no
  11407. benefit.
  11408. </p>
  11409. <dl class="table">
  11410. <dt><samp class="option">none</samp></dt>
  11411. <dt><samp class="option">snappy</samp></dt>
  11412. </dl>
  11413. <p>Default value is <samp class="option">snappy</samp>.
  11414. </p>
  11415. </dd>
  11416. </dl>
  11417. <a name="jpeg2000"></a>
  11418. <h3 class="section">16.6 jpeg2000<span class="pull-right"><a class="anchor hidden-xs" href="#jpeg2000" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jpeg2000" aria-hidden="true">TOC</a></span></h3>
  11419. <p>The native jpeg 2000 encoder is lossy by default, the <code class="code">-q:v</code>
  11420. option can be used to set the encoding quality. Lossless encoding
  11421. can be selected with <code class="code">-pred 1</code>.
  11422. </p>
  11423. <a name="Options-29"></a>
  11424. <h4 class="subsection">16.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-29" aria-hidden="true">TOC</a></span></h4>
  11425. <dl class="table">
  11426. <dt><samp class="option">format <var class="var">integer</var></samp></dt>
  11427. <dd><p>Can be set to either <code class="code">j2k</code> or <code class="code">jp2</code> (the default) that
  11428. makes it possible to store non-rgb pix_fmts.
  11429. </p>
  11430. </dd>
  11431. <dt><samp class="option">tile_width <var class="var">integer</var></samp></dt>
  11432. <dd><p>Sets tile width. Range is 1 to 1073741824. Default is 256.
  11433. </p>
  11434. </dd>
  11435. <dt><samp class="option">tile_height <var class="var">integer</var></samp></dt>
  11436. <dd><p>Sets tile height. Range is 1 to 1073741824. Default is 256.
  11437. </p>
  11438. </dd>
  11439. <dt><samp class="option">pred <var class="var">integer</var></samp></dt>
  11440. <dd><p>Allows setting the discrete wavelet transform (DWT) type
  11441. </p><dl class="table">
  11442. <dt><samp class="option">dwt97int (Lossy)</samp></dt>
  11443. <dt><samp class="option">dwt53 (Lossless)</samp></dt>
  11444. </dl>
  11445. <p>Default is <code class="code">dwt97int</code>
  11446. </p>
  11447. </dd>
  11448. <dt><samp class="option">sop <var class="var">boolean</var></samp></dt>
  11449. <dd><p>Enable this to add SOP marker at the start of each packet. Disabled by default.
  11450. </p>
  11451. </dd>
  11452. <dt><samp class="option">eph <var class="var">boolean</var></samp></dt>
  11453. <dd><p>Enable this to add EPH marker at the end of each packet header. Disabled by default.
  11454. </p>
  11455. </dd>
  11456. <dt><samp class="option">prog <var class="var">integer</var></samp></dt>
  11457. <dd><p>Sets the progression order to be used by the encoder.
  11458. Possible values are:
  11459. </p><dl class="table">
  11460. <dt><samp class="option">lrcp</samp></dt>
  11461. <dt><samp class="option">rlcp</samp></dt>
  11462. <dt><samp class="option">rpcl</samp></dt>
  11463. <dt><samp class="option">pcrl</samp></dt>
  11464. <dt><samp class="option">cprl</samp></dt>
  11465. </dl>
  11466. <p>Set to <code class="code">lrcp</code> by default.
  11467. </p>
  11468. </dd>
  11469. <dt><samp class="option">layer_rates <var class="var">string</var></samp></dt>
  11470. <dd><p>By default, when this option is not used, compression is done using the quality metric.
  11471. This option allows for compression using compression ratio. The compression ratio for each
  11472. level could be specified. The compression ratio of a layer <code class="code">l</code> species the what ratio of
  11473. total file size is contained in the first <code class="code">l</code> layers.
  11474. </p>
  11475. <p>Example usage:
  11476. </p>
  11477. <div class="example">
  11478. <pre class="example-preformatted">ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates &quot;100,10,1&quot; output.j2k
  11479. </pre></div>
  11480. <p>This would compress the image to contain 3 layers, where the data contained in the
  11481. first layer would be compressed by 1000 times, compressed by 100 in the first two layers,
  11482. and shall contain all data while using all 3 layers.
  11483. </p>
  11484. </dd>
  11485. </dl>
  11486. <a name="librav1e"></a>
  11487. <h3 class="section">16.7 librav1e<span class="pull-right"><a class="anchor hidden-xs" href="#librav1e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-librav1e" aria-hidden="true">TOC</a></span></h3>
  11488. <p>rav1e AV1 encoder wrapper.
  11489. </p>
  11490. <p>Requires the presence of the rav1e headers and library during configuration.
  11491. You need to explicitly configure the build with <code class="code">--enable-librav1e</code>.
  11492. </p>
  11493. <a name="Options-30"></a>
  11494. <h4 class="subsection">16.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-30" aria-hidden="true">TOC</a></span></h4>
  11495. <dl class="table">
  11496. <dt><samp class="option">qmax</samp></dt>
  11497. <dd><p>Sets the maximum quantizer to use when using bitrate mode.
  11498. </p>
  11499. </dd>
  11500. <dt><samp class="option">qmin</samp></dt>
  11501. <dd><p>Sets the minimum quantizer to use when using bitrate mode.
  11502. </p>
  11503. </dd>
  11504. <dt><samp class="option">qp</samp></dt>
  11505. <dd><p>Uses quantizer mode to encode at the given quantizer (0-255).
  11506. </p>
  11507. </dd>
  11508. <dt><samp class="option">speed</samp></dt>
  11509. <dd><p>Selects the speed preset (0-10) to encode with.
  11510. </p>
  11511. </dd>
  11512. <dt><samp class="option">tiles</samp></dt>
  11513. <dd><p>Selects how many tiles to encode with.
  11514. </p>
  11515. </dd>
  11516. <dt><samp class="option">tile-rows</samp></dt>
  11517. <dd><p>Selects how many rows of tiles to encode with.
  11518. </p>
  11519. </dd>
  11520. <dt><samp class="option">tile-columns</samp></dt>
  11521. <dd><p>Selects how many columns of tiles to encode with.
  11522. </p>
  11523. </dd>
  11524. <dt><samp class="option">rav1e-params</samp></dt>
  11525. <dd><p>Set rav1e options using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated
  11526. by &quot;:&quot;. See <code class="command">rav1e --help</code> for a list of options.
  11527. </p>
  11528. <p>For example to specify librav1e encoding options with <samp class="option">-rav1e-params</samp>:
  11529. </p>
  11530. <div class="example">
  11531. <pre class="example-preformatted">ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
  11532. </pre></div>
  11533. </dd>
  11534. </dl>
  11535. <a name="libaom_002dav1"></a>
  11536. <h3 class="section">16.8 libaom-av1<span class="pull-right"><a class="anchor hidden-xs" href="#libaom_002dav1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaom_002dav1" aria-hidden="true">TOC</a></span></h3>
  11537. <p>libaom AV1 encoder wrapper.
  11538. </p>
  11539. <p>Requires the presence of the libaom headers and library during
  11540. configuration. You need to explicitly configure the build with
  11541. <code class="code">--enable-libaom</code>.
  11542. </p>
  11543. <a name="Options-31"></a>
  11544. <h4 class="subsection">16.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-31" aria-hidden="true">TOC</a></span></h4>
  11545. <p>The wrapper supports the following standard libavcodec options:
  11546. </p>
  11547. <dl class="table">
  11548. <dt><samp class="option">b</samp></dt>
  11549. <dd><p>Set bitrate target in bits/second. By default this will use
  11550. variable-bitrate mode. If <samp class="option">maxrate</samp> and <samp class="option">minrate</samp> are
  11551. also set to the same value then it will use constant-bitrate mode,
  11552. otherwise if <samp class="option">crf</samp> is set as well then it will use
  11553. constrained-quality mode.
  11554. </p>
  11555. </dd>
  11556. <dt><samp class="option">g keyint_min</samp></dt>
  11557. <dd><p>Set key frame placement. The GOP size sets the maximum distance between
  11558. key frames; if zero the output stream will be intra-only. The minimum
  11559. distance is ignored unless it is the same as the GOP size, in which case
  11560. key frames will always appear at a fixed interval. Not set by default,
  11561. so without this option the library has completely free choice about
  11562. where to place key frames.
  11563. </p>
  11564. </dd>
  11565. <dt><samp class="option">qmin qmax</samp></dt>
  11566. <dd><p>Set minimum/maximum quantisation values. Valid range is from 0 to 63
  11567. (warning: this does not match the quantiser values actually used by AV1
  11568. - divide by four to map real quantiser values to this range). Defaults
  11569. to min/max (no constraint).
  11570. </p>
  11571. </dd>
  11572. <dt><samp class="option">minrate maxrate bufsize rc_init_occupancy</samp></dt>
  11573. <dd><p>Set rate control buffering parameters. Not used if not set - defaults
  11574. to unconstrained variable bitrate.
  11575. </p>
  11576. </dd>
  11577. <dt><samp class="option">threads</samp></dt>
  11578. <dd><p>Set the number of threads to use while encoding. This may require the
  11579. <samp class="option">tiles</samp> or <samp class="option">row-mt</samp> options to also be set to actually
  11580. use the specified number of threads fully. Defaults to the number of
  11581. hardware threads supported by the host machine.
  11582. </p>
  11583. </dd>
  11584. <dt><samp class="option">profile</samp></dt>
  11585. <dd><p>Set the encoding profile. Defaults to using the profile which matches
  11586. the bit depth and chroma subsampling of the input.
  11587. </p>
  11588. </dd>
  11589. </dl>
  11590. <p>The wrapper also has some specific options:
  11591. </p>
  11592. <dl class="table">
  11593. <dt><samp class="option">cpu-used</samp></dt>
  11594. <dd><p>Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
  11595. higher numbers indicating greater speed and lower quality. The default
  11596. value is 1, which will be slow and high quality.
  11597. </p>
  11598. </dd>
  11599. <dt><samp class="option">auto-alt-ref</samp></dt>
  11600. <dd><p>Enable use of alternate reference frames. Defaults to the internal
  11601. default of the library.
  11602. </p>
  11603. </dd>
  11604. <dt><samp class="option">arnr-max-frames (<em class="emph">frames</em>)</samp></dt>
  11605. <dd><p>Set altref noise reduction max frame count. Default is -1.
  11606. </p>
  11607. </dd>
  11608. <dt><samp class="option">arnr-strength (<em class="emph">strength</em>)</samp></dt>
  11609. <dd><p>Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
  11610. </p>
  11611. </dd>
  11612. <dt><samp class="option">aq-mode (<em class="emph">aq-mode</em>)</samp></dt>
  11613. <dd><p>Set adaptive quantization mode. Possible values:
  11614. </p>
  11615. <dl class="table">
  11616. <dt>&lsquo;<samp class="samp">none (<em class="emph">0</em>)</samp>&rsquo;</dt>
  11617. <dd><p>Disabled.
  11618. </p>
  11619. </dd>
  11620. <dt>&lsquo;<samp class="samp">variance (<em class="emph">1</em>)</samp>&rsquo;</dt>
  11621. <dd><p>Variance-based.
  11622. </p>
  11623. </dd>
  11624. <dt>&lsquo;<samp class="samp">complexity (<em class="emph">2</em>)</samp>&rsquo;</dt>
  11625. <dd><p>Complexity-based.
  11626. </p>
  11627. </dd>
  11628. <dt>&lsquo;<samp class="samp">cyclic (<em class="emph">3</em>)</samp>&rsquo;</dt>
  11629. <dd><p>Cyclic refresh.
  11630. </p></dd>
  11631. </dl>
  11632. </dd>
  11633. <dt><samp class="option">tune (<em class="emph">tune</em>)</samp></dt>
  11634. <dd><p>Set the distortion metric the encoder is tuned with. Default is <code class="code">psnr</code>.
  11635. </p>
  11636. <dl class="table">
  11637. <dt>&lsquo;<samp class="samp">psnr (<em class="emph">0</em>)</samp>&rsquo;</dt>
  11638. <dt>&lsquo;<samp class="samp">ssim (<em class="emph">1</em>)</samp>&rsquo;</dt>
  11639. </dl>
  11640. </dd>
  11641. <dt><samp class="option">lag-in-frames</samp></dt>
  11642. <dd><p>Set the maximum number of frames which the encoder may keep in flight
  11643. at any one time for lookahead purposes. Defaults to the internal
  11644. default of the library.
  11645. </p>
  11646. </dd>
  11647. <dt><samp class="option">error-resilience</samp></dt>
  11648. <dd><p>Enable error resilience features:
  11649. </p><dl class="table">
  11650. <dt><samp class="option">default</samp></dt>
  11651. <dd><p>Improve resilience against losses of whole frames.
  11652. </p></dd>
  11653. </dl>
  11654. <p>Not enabled by default.
  11655. </p>
  11656. </dd>
  11657. <dt><samp class="option">crf</samp></dt>
  11658. <dd><p>Set the quality/size tradeoff for constant-quality (no bitrate target)
  11659. and constrained-quality (with maximum bitrate target) modes. Valid
  11660. range is 0 to 63, higher numbers indicating lower quality and smaller
  11661. output size. Only used if set; by default only the bitrate target is
  11662. used.
  11663. </p>
  11664. </dd>
  11665. <dt><samp class="option">static-thresh</samp></dt>
  11666. <dd><p>Set a change threshold on blocks below which they will be skipped by
  11667. the encoder. Defined in arbitrary units as a nonnegative integer,
  11668. defaulting to zero (no blocks are skipped).
  11669. </p>
  11670. </dd>
  11671. <dt><samp class="option">drop-threshold</samp></dt>
  11672. <dd><p>Set a threshold for dropping frames when close to rate control bounds.
  11673. Defined as a percentage of the target buffer - when the rate control
  11674. buffer falls below this percentage, frames will be dropped until it
  11675. has refilled above the threshold. Defaults to zero (no frames are
  11676. dropped).
  11677. </p>
  11678. </dd>
  11679. <dt><samp class="option">denoise-noise-level (<em class="emph">level</em>)</samp></dt>
  11680. <dd><p>Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
  11681. this option is not set or set to 0.
  11682. </p>
  11683. </dd>
  11684. <dt><samp class="option">denoise-block-size (<em class="emph">pixels</em>)</samp></dt>
  11685. <dd><p>Block size used for denoising for grain synthesis. If not set, AV1 codec
  11686. uses the default value of 32.
  11687. </p>
  11688. </dd>
  11689. <dt><samp class="option">undershoot-pct (<em class="emph">pct</em>)</samp></dt>
  11690. <dd><p>Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
  11691. Default is -1.
  11692. </p>
  11693. </dd>
  11694. <dt><samp class="option">overshoot-pct (<em class="emph">pct</em>)</samp></dt>
  11695. <dd><p>Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
  11696. Default is -1.
  11697. </p>
  11698. </dd>
  11699. <dt><samp class="option">minsection-pct (<em class="emph">pct</em>)</samp></dt>
  11700. <dd><p>Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
  11701. is not set, the libaomenc wrapper computes it as follows: <code class="code">(minrate * 100 / bitrate)</code>.
  11702. Range is -1 to 100. Default is -1 (unset).
  11703. </p>
  11704. </dd>
  11705. <dt><samp class="option">maxsection-pct (<em class="emph">pct</em>)</samp></dt>
  11706. <dd><p>Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
  11707. is not set, the libaomenc wrapper computes it as follows: <code class="code">(maxrate * 100 / bitrate)</code>.
  11708. Range is -1 to 5000. Default is -1 (unset).
  11709. </p>
  11710. </dd>
  11711. <dt><samp class="option">frame-parallel (<em class="emph">boolean</em>)</samp></dt>
  11712. <dd><p>Enable frame parallel decodability features. Default is true.
  11713. </p>
  11714. </dd>
  11715. <dt><samp class="option">tiles</samp></dt>
  11716. <dd><p>Set the number of tiles to encode the input video with, as columns x
  11717. rows. Larger numbers allow greater parallelism in both encoding and
  11718. decoding, but may decrease coding efficiency. Defaults to the minimum
  11719. number of tiles required by the size of the input video (this is 1x1
  11720. (that is, a single tile) for sizes up to and including 4K).
  11721. </p>
  11722. </dd>
  11723. <dt><samp class="option">tile-columns tile-rows</samp></dt>
  11724. <dd><p>Set the number of tiles as log2 of the number of tile rows and columns.
  11725. Provided for compatibility with libvpx/VP9.
  11726. </p>
  11727. </dd>
  11728. <dt><samp class="option">row-mt (Requires libaom &gt;= 1.0.0-759-g90a15f4f2)</samp></dt>
  11729. <dd><p>Enable row based multi-threading. Disabled by default.
  11730. </p>
  11731. </dd>
  11732. <dt><samp class="option">enable-cdef (<em class="emph">boolean</em>)</samp></dt>
  11733. <dd><p>Enable Constrained Directional Enhancement Filter. The libaom-av1
  11734. encoder enables CDEF by default.
  11735. </p>
  11736. </dd>
  11737. <dt><samp class="option">enable-restoration (<em class="emph">boolean</em>)</samp></dt>
  11738. <dd><p>Enable Loop Restoration Filter. Default is true for libaom-av1.
  11739. </p>
  11740. </dd>
  11741. <dt><samp class="option">enable-global-motion (<em class="emph">boolean</em>)</samp></dt>
  11742. <dd><p>Enable the use of global motion for block prediction. Default is true.
  11743. </p>
  11744. </dd>
  11745. <dt><samp class="option">enable-intrabc (<em class="emph">boolean</em>)</samp></dt>
  11746. <dd><p>Enable block copy mode for intra block prediction. This mode is
  11747. useful for screen content. Default is true.
  11748. </p>
  11749. </dd>
  11750. <dt><samp class="option">enable-rect-partitions (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11751. <dd><p>Enable rectangular partitions. Default is true.
  11752. </p>
  11753. </dd>
  11754. <dt><samp class="option">enable-1to4-partitions (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11755. <dd><p>Enable 1:4/4:1 partitions. Default is true.
  11756. </p>
  11757. </dd>
  11758. <dt><samp class="option">enable-ab-partitions (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11759. <dd><p>Enable AB shape partitions. Default is true.
  11760. </p>
  11761. </dd>
  11762. <dt><samp class="option">enable-angle-delta (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11763. <dd><p>Enable angle delta intra prediction. Default is true.
  11764. </p>
  11765. </dd>
  11766. <dt><samp class="option">enable-cfl-intra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11767. <dd><p>Enable chroma predicted from luma intra prediction. Default is true.
  11768. </p>
  11769. </dd>
  11770. <dt><samp class="option">enable-filter-intra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11771. <dd><p>Enable filter intra predictor. Default is true.
  11772. </p>
  11773. </dd>
  11774. <dt><samp class="option">enable-intra-edge-filter (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11775. <dd><p>Enable intra edge filter. Default is true.
  11776. </p>
  11777. </dd>
  11778. <dt><samp class="option">enable-smooth-intra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11779. <dd><p>Enable smooth intra prediction mode. Default is true.
  11780. </p>
  11781. </dd>
  11782. <dt><samp class="option">enable-paeth-intra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11783. <dd><p>Enable paeth predictor in intra prediction. Default is true.
  11784. </p>
  11785. </dd>
  11786. <dt><samp class="option">enable-palette (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11787. <dd><p>Enable palette prediction mode. Default is true.
  11788. </p>
  11789. </dd>
  11790. <dt><samp class="option">enable-flip-idtx (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11791. <dd><p>Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST,
  11792. FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT,
  11793. V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true.
  11794. </p>
  11795. </dd>
  11796. <dt><samp class="option">enable-tx64 (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11797. <dd><p>Enable 64-pt transform. Default is true.
  11798. </p>
  11799. </dd>
  11800. <dt><samp class="option">reduced-tx-type-set (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11801. <dd><p>Use reduced set of transform types. Default is false.
  11802. </p>
  11803. </dd>
  11804. <dt><samp class="option">use-intra-dct-only (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11805. <dd><p>Use DCT only for INTRA modes. Default is false.
  11806. </p>
  11807. </dd>
  11808. <dt><samp class="option">use-inter-dct-only (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11809. <dd><p>Use DCT only for INTER modes. Default is false.
  11810. </p>
  11811. </dd>
  11812. <dt><samp class="option">use-intra-default-tx-only (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11813. <dd><p>Use Default-transform only for INTRA modes. Default is false.
  11814. </p>
  11815. </dd>
  11816. <dt><samp class="option">enable-ref-frame-mvs (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11817. <dd><p>Enable temporal mv prediction. Default is true.
  11818. </p>
  11819. </dd>
  11820. <dt><samp class="option">enable-reduced-reference-set (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11821. <dd><p>Use reduced set of single and compound references. Default is false.
  11822. </p>
  11823. </dd>
  11824. <dt><samp class="option">enable-obmc (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11825. <dd><p>Enable obmc. Default is true.
  11826. </p>
  11827. </dd>
  11828. <dt><samp class="option">enable-dual-filter (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11829. <dd><p>Enable dual filter. Default is true.
  11830. </p>
  11831. </dd>
  11832. <dt><samp class="option">enable-diff-wtd-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11833. <dd><p>Enable difference-weighted compound. Default is true.
  11834. </p>
  11835. </dd>
  11836. <dt><samp class="option">enable-dist-wtd-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11837. <dd><p>Enable distance-weighted compound. Default is true.
  11838. </p>
  11839. </dd>
  11840. <dt><samp class="option">enable-onesided-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11841. <dd><p>Enable one sided compound. Default is true.
  11842. </p>
  11843. </dd>
  11844. <dt><samp class="option">enable-interinter-wedge (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11845. <dd><p>Enable interinter wedge compound. Default is true.
  11846. </p>
  11847. </dd>
  11848. <dt><samp class="option">enable-interintra-wedge (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11849. <dd><p>Enable interintra wedge compound. Default is true.
  11850. </p>
  11851. </dd>
  11852. <dt><samp class="option">enable-masked-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11853. <dd><p>Enable masked compound. Default is true.
  11854. </p>
  11855. </dd>
  11856. <dt><samp class="option">enable-interintra-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11857. <dd><p>Enable interintra compound. Default is true.
  11858. </p>
  11859. </dd>
  11860. <dt><samp class="option">enable-smooth-interintra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11861. <dd><p>Enable smooth interintra mode. Default is true.
  11862. </p>
  11863. </dd>
  11864. <dt><samp class="option">aom-params</samp></dt>
  11865. <dd><p>Set libaom options using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated
  11866. by &quot;:&quot;. For a list of supported options, see <code class="command">aomenc --help</code> under the
  11867. section &quot;AV1 Specific Options&quot;.
  11868. </p>
  11869. <p>For example to specify libaom encoding options with <samp class="option">-aom-params</samp>:
  11870. </p>
  11871. <div class="example">
  11872. <pre class="example-preformatted">ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
  11873. </pre></div>
  11874. </dd>
  11875. </dl>
  11876. <a name="liboapv"></a>
  11877. <h3 class="section">16.9 liboapv<span class="pull-right"><a class="anchor hidden-xs" href="#liboapv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-liboapv" aria-hidden="true">TOC</a></span></h3>
  11878. <p>Advanced Professional Video codec encoder wrapper.
  11879. </p>
  11880. <p>This encoder requires the presence of the liboapv headers and library
  11881. during configuration. You need to explicitly configure the build with
  11882. <samp class="option">--enable-liboapv</samp>.
  11883. </p>
  11884. <div class="info">
  11885. <p>Many liboapv encoder options are mapped to FFmpeg global codec options,
  11886. while unique encoder options are provided through private options.
  11887. </p></div>
  11888. <p>The apv project website is at <a class="url" href="https://github.com/AcademySoftwareFoundation/openapv">https://github.com/AcademySoftwareFoundation/openapv</a>.
  11889. </p>
  11890. <a name="Options-32"></a>
  11891. <h4 class="subsection">16.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-32" aria-hidden="true">TOC</a></span></h4>
  11892. <p>The following options are supported by the liboapv wrapper.
  11893. </p>
  11894. <div class="info">
  11895. <p>To get a more extensive documentation of the liboapv options, consult the
  11896. liboapv documentation.
  11897. </p></div>
  11898. <dl class="table">
  11899. <dt><samp class="option">preset</samp></dt>
  11900. <dd><p>Set the quality-speed tradeoff [fastest, fast, medium, slow, placebo, default]
  11901. </p>
  11902. </dd>
  11903. <dt><samp class="option">qp</samp></dt>
  11904. <dd><p>Set the quantization parameter value for CQP rate control mode.
  11905. </p>
  11906. </dd>
  11907. <dt><samp class="option">oapv-params (<em class="emph">parse_apv_params</em>)</samp></dt>
  11908. <dd><p>Set liboapvenc options using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated
  11909. by &quot;:&quot;. See the liboapv encoder user guide for a list of accepted parameters.
  11910. </p></dd>
  11911. </dl>
  11912. <a name="libsvtav1"></a>
  11913. <h3 class="section">16.10 libsvtav1<span class="pull-right"><a class="anchor hidden-xs" href="#libsvtav1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libsvtav1" aria-hidden="true">TOC</a></span></h3>
  11914. <p>SVT-AV1 encoder wrapper.
  11915. </p>
  11916. <p>Requires the presence of the SVT-AV1 headers and library during configuration.
  11917. You need to explicitly configure the build with <code class="code">--enable-libsvtav1</code>.
  11918. </p>
  11919. <a name="Options-33"></a>
  11920. <h4 class="subsection">16.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-33" aria-hidden="true">TOC</a></span></h4>
  11921. <dl class="table">
  11922. <dt><samp class="option">profile</samp></dt>
  11923. <dd><p>Set the encoding profile.
  11924. </p><dl class="table">
  11925. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  11926. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  11927. <dt>&lsquo;<samp class="samp">professional</samp>&rsquo;</dt>
  11928. </dl>
  11929. </dd>
  11930. <dt><samp class="option">level</samp></dt>
  11931. <dd><p>Set the operating point level. For example: &rsquo;4.0&rsquo;
  11932. </p>
  11933. </dd>
  11934. <dt><samp class="option">hielevel</samp></dt>
  11935. <dd><p>Set the Hierarchical prediction levels.
  11936. </p><dl class="table">
  11937. <dt>&lsquo;<samp class="samp">3level</samp>&rsquo;</dt>
  11938. <dt>&lsquo;<samp class="samp">4level</samp>&rsquo;</dt>
  11939. <dd><p>This is the default.
  11940. </p></dd>
  11941. </dl>
  11942. </dd>
  11943. <dt><samp class="option">tier</samp></dt>
  11944. <dd><p>Set the operating point tier.
  11945. </p><dl class="table">
  11946. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  11947. <dd><p>This is the default.
  11948. </p></dd>
  11949. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  11950. </dl>
  11951. </dd>
  11952. <dt><samp class="option">qmax</samp></dt>
  11953. <dd><p>Set the maximum quantizer to use when using a bitrate mode.
  11954. </p>
  11955. </dd>
  11956. <dt><samp class="option">qmin</samp></dt>
  11957. <dd><p>Set the minimum quantizer to use when using a bitrate mode.
  11958. </p>
  11959. </dd>
  11960. <dt><samp class="option">crf</samp></dt>
  11961. <dd><p>Constant rate factor value used in crf rate control mode (0-63).
  11962. </p>
  11963. </dd>
  11964. <dt><samp class="option">qp</samp></dt>
  11965. <dd><p>Set the quantizer used in cqp rate control mode (0-63).
  11966. </p>
  11967. </dd>
  11968. <dt><samp class="option">sc_detection</samp></dt>
  11969. <dd><p>Enable scene change detection.
  11970. </p>
  11971. </dd>
  11972. <dt><samp class="option">la_depth</samp></dt>
  11973. <dd><p>Set number of frames to look ahead (0-120).
  11974. </p>
  11975. </dd>
  11976. <dt><samp class="option">preset</samp></dt>
  11977. <dd><p>Set the quality-speed tradeoff, in the range 0 to 13. Higher values are
  11978. faster but lower quality.
  11979. </p>
  11980. </dd>
  11981. <dt><samp class="option">tile_rows</samp></dt>
  11982. <dd><p>Set log2 of the number of rows of tiles to use (0-6).
  11983. </p>
  11984. </dd>
  11985. <dt><samp class="option">tile_columns</samp></dt>
  11986. <dd><p>Set log2 of the number of columns of tiles to use (0-4).
  11987. </p>
  11988. </dd>
  11989. <dt><samp class="option">svtav1-params</samp></dt>
  11990. <dd><p>Set SVT-AV1 options using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated
  11991. by &quot;:&quot;. See the SVT-AV1 encoder user guide for a list of accepted parameters.
  11992. </p>
  11993. </dd>
  11994. </dl>
  11995. <a name="libsvtjpegxs"></a>
  11996. <h3 class="section">16.11 libsvtjpegxs<span class="pull-right"><a class="anchor hidden-xs" href="#libsvtjpegxs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libsvtjpegxs" aria-hidden="true">TOC</a></span></h3>
  11997. <p>SVT-JPEG-XS encoder wrapper.
  11998. </p>
  11999. <p>Requires the presence of the SVT-JPEG-XS headers and library during configuration.
  12000. You need to explicitly configure the build with <code class="code">--enable-libsvtjpegxs</code>.
  12001. </p>
  12002. <a name="Options-34"></a>
  12003. <h4 class="subsection">16.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-34" aria-hidden="true">TOC</a></span></h4>
  12004. <dl class="table">
  12005. <dt><samp class="option">decomp_v</samp></dt>
  12006. <dd><p>Set vertical decomposition level
  12007. </p></dd>
  12008. <dt><samp class="option">decomp_h</samp></dt>
  12009. <dd><p>Set horizontal decomposition level
  12010. </p>
  12011. </dd>
  12012. <dt><samp class="option">quantization</samp></dt>
  12013. <dd><p>Set the quantization algorithm.
  12014. </p><dl class="table">
  12015. <dt>&lsquo;<samp class="samp">deadzone</samp>&rsquo;</dt>
  12016. <dt>&lsquo;<samp class="samp">uniform</samp>&rsquo;</dt>
  12017. </dl>
  12018. </dd>
  12019. <dt><samp class="option">coding-signs</samp></dt>
  12020. <dd><p>Enable Signs handling strategy
  12021. </p><dl class="table">
  12022. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  12023. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  12024. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  12025. </dl>
  12026. </dd>
  12027. <dt><samp class="option">coding-sigf</samp></dt>
  12028. <dd><p>Enable Significance coding
  12029. </p>
  12030. </dd>
  12031. <dt><samp class="option">coding-vpred</samp></dt>
  12032. <dd><p>Enable Vertical Prediction coding
  12033. </p><dl class="table">
  12034. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  12035. <dt>&lsquo;<samp class="samp">no_residuals</samp>&rsquo;</dt>
  12036. <dt>&lsquo;<samp class="samp">no_coeffs</samp>&rsquo;</dt>
  12037. </dl>
  12038. </dd>
  12039. </dl>
  12040. <a name="libjxl"></a>
  12041. <h3 class="section">16.12 libjxl<span class="pull-right"><a class="anchor hidden-xs" href="#libjxl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libjxl" aria-hidden="true">TOC</a></span></h3>
  12042. <p>libjxl JPEG XL encoder wrapper.
  12043. </p>
  12044. <p>Requires the presence of the libjxl headers and library during
  12045. configuration. You need to explicitly configure the build with
  12046. <code class="code">--enable-libjxl</code>.
  12047. </p>
  12048. <a name="Options-35"></a>
  12049. <h4 class="subsection">16.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-35" aria-hidden="true">TOC</a></span></h4>
  12050. <p>The libjxl wrapper supports the following options:
  12051. </p>
  12052. <dl class="table">
  12053. <dt><samp class="option">distance</samp></dt>
  12054. <dd><p>Set the target Butteraugli distance. This is a quality setting: lower
  12055. distance yields higher quality, with distance=1.0 roughly comparable to
  12056. libjpeg Quality 90 for photographic content. Setting distance=0.0 yields
  12057. true lossless encoding. Valid values range between 0.0 and 15.0, and sane
  12058. values rarely exceed 5.0. Setting distance=0.1 usually attains
  12059. transparency for most input. The default is 1.0.
  12060. </p>
  12061. </dd>
  12062. <dt><samp class="option">effort</samp></dt>
  12063. <dd><p>Set the encoding effort used. Higher effort values produce more consistent
  12064. quality and usually produces a better quality/bpp curve, at the cost of
  12065. more CPU time required. Valid values range from 1 to 9, and the default is 7.
  12066. </p>
  12067. </dd>
  12068. <dt><samp class="option">modular</samp></dt>
  12069. <dd><p>Force the encoder to use Modular mode instead of choosing automatically. The
  12070. default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT
  12071. is generally superior to Modular for lossy encoding but does not support
  12072. lossless encoding.
  12073. </p>
  12074. </dd>
  12075. </dl>
  12076. <a name="libkvazaar"></a>
  12077. <h3 class="section">16.13 libkvazaar<span class="pull-right"><a class="anchor hidden-xs" href="#libkvazaar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libkvazaar" aria-hidden="true">TOC</a></span></h3>
  12078. <p>Kvazaar H.265/HEVC encoder.
  12079. </p>
  12080. <p>Requires the presence of the libkvazaar headers and library during
  12081. configuration. You need to explicitly configure the build with
  12082. <samp class="option">--enable-libkvazaar</samp>.
  12083. </p>
  12084. <a name="Options-36"></a>
  12085. <h4 class="subsection">16.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-36" aria-hidden="true">TOC</a></span></h4>
  12086. <dl class="table">
  12087. <dt><samp class="option">b</samp></dt>
  12088. <dd><p>Set target video bitrate in bit/s and enable rate control.
  12089. </p>
  12090. </dd>
  12091. <dt><samp class="option">kvazaar-params</samp></dt>
  12092. <dd><p>Set kvazaar parameters as a list of <var class="var">name</var>=<var class="var">value</var> pairs separated
  12093. by commas (,). See kvazaar documentation for a list of options.
  12094. </p>
  12095. </dd>
  12096. </dl>
  12097. <a name="libopenh264"></a>
  12098. <h3 class="section">16.14 libopenh264<span class="pull-right"><a class="anchor hidden-xs" href="#libopenh264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopenh264" aria-hidden="true">TOC</a></span></h3>
  12099. <p>Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  12100. </p>
  12101. <p>This encoder requires the presence of the libopenh264 headers and
  12102. library during configuration. You need to explicitly configure the
  12103. build with <code class="code">--enable-libopenh264</code>. The library is detected using
  12104. <code class="command">pkg-config</code>.
  12105. </p>
  12106. <p>For more information about the library see
  12107. <a class="url" href="http://www.openh264.org">http://www.openh264.org</a>.
  12108. </p>
  12109. <a name="Options-37"></a>
  12110. <h4 class="subsection">16.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-37" aria-hidden="true">TOC</a></span></h4>
  12111. <p>The following FFmpeg global options affect the configurations of the
  12112. libopenh264 encoder.
  12113. </p>
  12114. <dl class="table">
  12115. <dt><samp class="option">b</samp></dt>
  12116. <dd><p>Set the bitrate (as a number of bits per second).
  12117. </p>
  12118. </dd>
  12119. <dt><samp class="option">g</samp></dt>
  12120. <dd><p>Set the GOP size.
  12121. </p>
  12122. </dd>
  12123. <dt><samp class="option">maxrate</samp></dt>
  12124. <dd><p>Set the max bitrate (as a number of bits per second).
  12125. </p>
  12126. </dd>
  12127. <dt><samp class="option">flags +global_header</samp></dt>
  12128. <dd><p>Set global header in the bitstream.
  12129. </p>
  12130. </dd>
  12131. <dt><samp class="option">slices</samp></dt>
  12132. <dd><p>Set the number of slices, used in parallelized encoding. Default value
  12133. is 0. This is only used when <samp class="option">slice_mode</samp> is set to
  12134. &lsquo;<samp class="samp">fixed</samp>&rsquo;.
  12135. </p>
  12136. </dd>
  12137. <dt><samp class="option">loopfilter</samp></dt>
  12138. <dd><p>Enable loop filter, if set to 1 (automatically enabled). To disable
  12139. set a value of 0.
  12140. </p>
  12141. </dd>
  12142. <dt><samp class="option">profile</samp></dt>
  12143. <dd><p>Set profile restrictions. If set to the value of &lsquo;<samp class="samp">main</samp>&rsquo; enable
  12144. CABAC (set the <code class="code">SEncParamExt.iEntropyCodingModeFlag</code> flag to 1).
  12145. </p>
  12146. </dd>
  12147. <dt><samp class="option">max_nal_size</samp></dt>
  12148. <dd><p>Set maximum NAL size in bytes.
  12149. </p>
  12150. </dd>
  12151. <dt><samp class="option">allow_skip_frames</samp></dt>
  12152. <dd><p>Allow skipping frames to hit the target bitrate if set to 1.
  12153. </p></dd>
  12154. </dl>
  12155. <a name="libtheora"></a>
  12156. <h3 class="section">16.15 libtheora<span class="pull-right"><a class="anchor hidden-xs" href="#libtheora" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libtheora" aria-hidden="true">TOC</a></span></h3>
  12157. <p>libtheora Theora encoder wrapper.
  12158. </p>
  12159. <p>Requires the presence of the libtheora headers and library during
  12160. configuration. You need to explicitly configure the build with
  12161. <code class="code">--enable-libtheora</code>.
  12162. </p>
  12163. <p>For more information about the libtheora project see
  12164. <a class="url" href="http://www.theora.org/">http://www.theora.org/</a>.
  12165. </p>
  12166. <a name="Options-38"></a>
  12167. <h4 class="subsection">16.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-38" aria-hidden="true">TOC</a></span></h4>
  12168. <p>The following global options are mapped to internal libtheora options
  12169. which affect the quality and the bitrate of the encoded stream.
  12170. </p>
  12171. <dl class="table">
  12172. <dt><samp class="option">b</samp></dt>
  12173. <dd><p>Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  12174. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  12175. </p>
  12176. </dd>
  12177. <dt><samp class="option">flags</samp></dt>
  12178. <dd><p>Used to enable constant quality mode (VBR) encoding through the
  12179. <samp class="option">qscale</samp> flag, and to enable the <code class="code">pass1</code> and <code class="code">pass2</code>
  12180. modes.
  12181. </p>
  12182. </dd>
  12183. <dt><samp class="option">g</samp></dt>
  12184. <dd><p>Set the GOP size.
  12185. </p>
  12186. </dd>
  12187. <dt><samp class="option">global_quality</samp></dt>
  12188. <dd><p>Set the global quality as an integer in lambda units.
  12189. </p>
  12190. <p>Only relevant when VBR mode is enabled with <code class="code">flags +qscale</code>. The
  12191. value is converted to QP units by dividing it by <code class="code">FF_QP2LAMBDA</code>,
  12192. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  12193. value in the native libtheora range [0-63]. A higher value corresponds
  12194. to a higher quality.
  12195. </p>
  12196. </dd>
  12197. <dt><samp class="option">q</samp></dt>
  12198. <dd><p>Enable VBR mode when set to a non-negative value, and set constant
  12199. quality value as a double floating point value in QP units.
  12200. </p>
  12201. <p>The value is clipped in the [0-10] range, and then multiplied by 6.3
  12202. to get a value in the native libtheora range [0-63].
  12203. </p>
  12204. <p>This option is valid only using the <code class="command">ffmpeg</code> command-line
  12205. tool. For library interface users, use <samp class="option">global_quality</samp>.
  12206. </p></dd>
  12207. </dl>
  12208. <a name="Examples-5"></a>
  12209. <h4 class="subsection">16.15.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-5" aria-hidden="true">TOC</a></span></h4>
  12210. <ul class="itemize mark-bullet">
  12211. <li>Set maximum constant quality (VBR) encoding with <code class="command">ffmpeg</code>:
  12212. <div class="example">
  12213. <pre class="example-preformatted">ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  12214. </pre></div>
  12215. </li><li>Use <code class="command">ffmpeg</code> to convert a CBR 1000 kbps Theora video stream:
  12216. <div class="example">
  12217. <pre class="example-preformatted">ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  12218. </pre></div>
  12219. </li></ul>
  12220. <a name="libvpx"></a>
  12221. <h3 class="section">16.16 libvpx<span class="pull-right"><a class="anchor hidden-xs" href="#libvpx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvpx" aria-hidden="true">TOC</a></span></h3>
  12222. <p>VP8/VP9 format supported through libvpx.
  12223. </p>
  12224. <p>Requires the presence of the libvpx headers and library during configuration.
  12225. You need to explicitly configure the build with <code class="code">--enable-libvpx</code>.
  12226. </p>
  12227. <a name="Options-39"></a>
  12228. <h4 class="subsection">16.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-39" aria-hidden="true">TOC</a></span></h4>
  12229. <p>The following options are supported by the libvpx wrapper. The
  12230. <code class="command">vpxenc</code>-equivalent options or values are listed in parentheses
  12231. for easy migration.
  12232. </p>
  12233. <p>To reduce the duplication of documentation, only the private options
  12234. and some others requiring special attention are documented here. For
  12235. the documentation of the undocumented generic options, see
  12236. <a class="ref" href="#codec_002doptions">the Codec Options chapter</a>.
  12237. </p>
  12238. <p>To get more documentation of the libvpx options, invoke the command
  12239. <code class="command">ffmpeg -h encoder=libvpx</code>, <code class="command">ffmpeg -h encoder=libvpx-vp9</code> or
  12240. <code class="command">vpxenc --help</code>. Further information is available in the libvpx API
  12241. documentation.
  12242. </p>
  12243. <dl class="table">
  12244. <dt><samp class="option">b (<em class="emph">target-bitrate</em>)</samp></dt>
  12245. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s <samp class="option">b</samp> option is
  12246. expressed in bits/s, while <code class="command">vpxenc</code>&rsquo;s <samp class="option">target-bitrate</samp> is in
  12247. kilobits/s.
  12248. </p>
  12249. </dd>
  12250. <dt><samp class="option">g (<em class="emph">kf-max-dist</em>)</samp></dt>
  12251. <dt><samp class="option">keyint_min (<em class="emph">kf-min-dist</em>)</samp></dt>
  12252. <dt><samp class="option">qmin (<em class="emph">min-q</em>)</samp></dt>
  12253. <dd><p>Minimum (Best Quality) Quantizer.
  12254. </p>
  12255. </dd>
  12256. <dt><samp class="option">qmax (<em class="emph">max-q</em>)</samp></dt>
  12257. <dd><p>Maximum (Worst Quality) Quantizer.
  12258. Can be changed per-frame.
  12259. </p>
  12260. </dd>
  12261. <dt><samp class="option">bufsize (<em class="emph">buf-sz</em>, <em class="emph">buf-optimal-sz</em>)</samp></dt>
  12262. <dd><p>Set ratecontrol buffer size (in bits). Note <code class="command">vpxenc</code>&rsquo;s options are
  12263. specified in milliseconds, the libvpx wrapper converts this value as follows:
  12264. <code class="code">buf-sz = bufsize * 1000 / bitrate</code>,
  12265. <code class="code">buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6</code>.
  12266. </p>
  12267. </dd>
  12268. <dt><samp class="option">rc_init_occupancy (<em class="emph">buf-initial-sz</em>)</samp></dt>
  12269. <dd><p>Set number of bits which should be loaded into the rc buffer before decoding
  12270. starts. Note <code class="command">vpxenc</code>&rsquo;s option is specified in milliseconds, the libvpx
  12271. wrapper converts this value as follows:
  12272. <code class="code">rc_init_occupancy * 1000 / bitrate</code>.
  12273. </p>
  12274. </dd>
  12275. <dt><samp class="option">undershoot-pct</samp></dt>
  12276. <dd><p>Set datarate undershoot (min) percentage of the target bitrate.
  12277. </p>
  12278. </dd>
  12279. <dt><samp class="option">overshoot-pct</samp></dt>
  12280. <dd><p>Set datarate overshoot (max) percentage of the target bitrate.
  12281. </p>
  12282. </dd>
  12283. <dt><samp class="option">skip_threshold (<em class="emph">drop-frame</em>)</samp></dt>
  12284. <dt><samp class="option">qcomp (<em class="emph">bias-pct</em>)</samp></dt>
  12285. <dt><samp class="option">maxrate (<em class="emph">maxsection-pct</em>)</samp></dt>
  12286. <dd><p>Set GOP max bitrate in bits/s. Note <code class="command">vpxenc</code>&rsquo;s option is specified as a
  12287. percentage of the target bitrate, the libvpx wrapper converts this value as
  12288. follows: <code class="code">(maxrate * 100 / bitrate)</code>.
  12289. </p>
  12290. </dd>
  12291. <dt><samp class="option">minrate (<em class="emph">minsection-pct</em>)</samp></dt>
  12292. <dd><p>Set GOP min bitrate in bits/s. Note <code class="command">vpxenc</code>&rsquo;s option is specified as a
  12293. percentage of the target bitrate, the libvpx wrapper converts this value as
  12294. follows: <code class="code">(minrate * 100 / bitrate)</code>.
  12295. </p>
  12296. </dd>
  12297. <dt><samp class="option">minrate, maxrate, b <em class="emph">end-usage=cbr</em></samp></dt>
  12298. <dd><p><code class="code">(minrate == maxrate == bitrate)</code>.
  12299. </p>
  12300. </dd>
  12301. <dt><samp class="option">crf (<em class="emph">end-usage=cq</em>, <em class="emph">cq-level</em>)</samp></dt>
  12302. <dt><samp class="option">tune (<em class="emph">tune</em>)</samp></dt>
  12303. <dd><dl class="table">
  12304. <dt>&lsquo;<samp class="samp">psnr (<em class="emph">psnr</em>)</samp>&rsquo;</dt>
  12305. <dt>&lsquo;<samp class="samp">ssim (<em class="emph">ssim</em>)</samp>&rsquo;</dt>
  12306. </dl>
  12307. </dd>
  12308. <dt><samp class="option">quality, deadline (<em class="emph">deadline</em>)</samp></dt>
  12309. <dd><dl class="table">
  12310. <dt>&lsquo;<samp class="samp">best</samp>&rsquo;</dt>
  12311. <dd><p>Use best quality deadline. Poorly named and quite slow, this option should be
  12312. avoided as it may give worse quality output than good.
  12313. </p></dd>
  12314. <dt>&lsquo;<samp class="samp">good</samp>&rsquo;</dt>
  12315. <dd><p>Use good quality deadline. This is a good trade-off between speed and quality
  12316. when used with the <samp class="option">cpu-used</samp> option.
  12317. </p></dd>
  12318. <dt>&lsquo;<samp class="samp">realtime</samp>&rsquo;</dt>
  12319. <dd><p>Use realtime quality deadline.
  12320. </p></dd>
  12321. </dl>
  12322. </dd>
  12323. <dt><samp class="option">speed, cpu-used (<em class="emph">cpu-used</em>)</samp></dt>
  12324. <dd><p>Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  12325. of quality.
  12326. </p>
  12327. </dd>
  12328. <dt><samp class="option">nr (<em class="emph">noise-sensitivity</em>)</samp></dt>
  12329. <dt><samp class="option">static-thresh</samp></dt>
  12330. <dd><p>Set a change threshold on blocks below which they will be skipped by the
  12331. encoder.
  12332. </p>
  12333. </dd>
  12334. <dt><samp class="option">slices (<em class="emph">token-parts</em>)</samp></dt>
  12335. <dd><p>Note that FFmpeg&rsquo;s <samp class="option">slices</samp> option gives the total number of partitions,
  12336. while <code class="command">vpxenc</code>&rsquo;s <samp class="option">token-parts</samp> is given as
  12337. <code class="code">log2(partitions)</code>.
  12338. </p>
  12339. </dd>
  12340. <dt><samp class="option">max-intra-rate</samp></dt>
  12341. <dd><p>Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  12342. means unlimited.
  12343. </p>
  12344. </dd>
  12345. <dt><samp class="option">force_key_frames</samp></dt>
  12346. <dd><p><code class="code">VPX_EFLAG_FORCE_KF</code>
  12347. </p>
  12348. </dd>
  12349. <dt><samp class="option">Alternate reference frame related</samp></dt>
  12350. <dd><dl class="table">
  12351. <dt><samp class="option">auto-alt-ref</samp></dt>
  12352. <dd><p>Enable use of alternate reference frames (2-pass only).
  12353. Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
  12354. </p></dd>
  12355. <dt><samp class="option">arnr-maxframes</samp></dt>
  12356. <dd><p>Set altref noise reduction max frame count.
  12357. </p></dd>
  12358. <dt><samp class="option">arnr-type</samp></dt>
  12359. <dd><p>Set altref noise reduction filter type: backward, forward, centered.
  12360. </p></dd>
  12361. <dt><samp class="option">arnr-strength</samp></dt>
  12362. <dd><p>Set altref noise reduction filter strength.
  12363. </p></dd>
  12364. <dt><samp class="option">rc-lookahead, lag-in-frames (<em class="emph">lag-in-frames</em>)</samp></dt>
  12365. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  12366. </p></dd>
  12367. <dt><samp class="option">min-gf-interval</samp></dt>
  12368. <dd><p>Set minimum golden/alternate reference frame interval (VP9 only).
  12369. </p></dd>
  12370. </dl>
  12371. </dd>
  12372. <dt><samp class="option">error-resilient</samp></dt>
  12373. <dd><p>Enable error resiliency features.
  12374. </p>
  12375. </dd>
  12376. <dt><samp class="option">sharpness <var class="var">integer</var></samp></dt>
  12377. <dd><p>Increase sharpness at the expense of lower PSNR.
  12378. The valid range is [0, 7].
  12379. </p>
  12380. </dd>
  12381. <dt><samp class="option">ts-parameters</samp></dt>
  12382. <dd><p>Sets the temporal scalability configuration using a :-separated list of
  12383. key=value pairs. For example, to specify temporal scalability parameters
  12384. with <code class="code">ffmpeg</code>:
  12385. </p><div class="example">
  12386. <pre class="example-preformatted">ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
  12387. ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
  12388. ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
  12389. </pre></div>
  12390. <p>Below is a brief explanation of each of the parameters, please
  12391. refer to <code class="code">struct vpx_codec_enc_cfg</code> in <code class="code">vpx/vpx_encoder.h</code> for more
  12392. details.
  12393. </p><dl class="table">
  12394. <dt><samp class="option">ts_number_layers</samp></dt>
  12395. <dd><p>Number of temporal coding layers.
  12396. </p></dd>
  12397. <dt><samp class="option">ts_target_bitrate</samp></dt>
  12398. <dd><p>Target bitrate for each temporal layer (in kbps).
  12399. (bitrate should be inclusive of the lower temporal layer).
  12400. </p></dd>
  12401. <dt><samp class="option">ts_rate_decimator</samp></dt>
  12402. <dd><p>Frame rate decimation factor for each temporal layer.
  12403. </p></dd>
  12404. <dt><samp class="option">ts_periodicity</samp></dt>
  12405. <dd><p>Length of the sequence defining frame temporal layer membership.
  12406. </p></dd>
  12407. <dt><samp class="option">ts_layer_id</samp></dt>
  12408. <dd><p>Template defining the membership of frames to temporal layers.
  12409. </p></dd>
  12410. <dt><samp class="option">ts_layering_mode</samp></dt>
  12411. <dd><p>(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
  12412. Currently supports the following options.
  12413. </p><dl class="table">
  12414. <dt><samp class="option">0</samp></dt>
  12415. <dd><p>No temporal layering flags are provided internally,
  12416. relies on flags being passed in using <code class="code">metadata</code> field in <code class="code">AVFrame</code>
  12417. with following keys.
  12418. </p><dl class="table">
  12419. <dt><samp class="option">vp8-flags</samp></dt>
  12420. <dd><p>Sets the flags passed into the encoder to indicate the referencing scheme for
  12421. the current frame.
  12422. Refer to function <code class="code">vpx_codec_encode</code> in <code class="code">vpx/vpx_encoder.h</code> for more
  12423. details.
  12424. </p></dd>
  12425. <dt><samp class="option">temporal_id</samp></dt>
  12426. <dd><p>Explicitly sets the temporal id of the current frame to encode.
  12427. </p></dd>
  12428. </dl>
  12429. </dd>
  12430. <dt><samp class="option">2</samp></dt>
  12431. <dd><p>Two temporal layers. 0-1...
  12432. </p></dd>
  12433. <dt><samp class="option">3</samp></dt>
  12434. <dd><p>Three temporal layers. 0-2-1-2...; with single reference frame.
  12435. </p></dd>
  12436. <dt><samp class="option">4</samp></dt>
  12437. <dd><p>Same as option &quot;3&quot;, except there is a dependency between
  12438. the two temporal layer 2 frames within the temporal period.
  12439. </p></dd>
  12440. </dl>
  12441. </dd>
  12442. </dl>
  12443. </dd>
  12444. <dt><samp class="option">VP8-specific options</samp></dt>
  12445. <dd><dl class="table">
  12446. <dt><samp class="option">screen-content-mode</samp></dt>
  12447. <dd><p>Screen content mode, one of: 0 (off), 1 (screen), 2 (screen with more aggressive rate control).
  12448. </p></dd>
  12449. </dl>
  12450. </dd>
  12451. <dt><samp class="option">VP9-specific options</samp></dt>
  12452. <dd><dl class="table">
  12453. <dt><samp class="option">lossless</samp></dt>
  12454. <dd><p>Enable lossless mode.
  12455. </p></dd>
  12456. <dt><samp class="option">tile-columns</samp></dt>
  12457. <dd><p>Set number of tile columns to use. Note this is given as
  12458. <code class="code">log2(tile_columns)</code>. For example, 8 tile columns would be requested by
  12459. setting the <samp class="option">tile-columns</samp> option to 3.
  12460. </p></dd>
  12461. <dt><samp class="option">tile-rows</samp></dt>
  12462. <dd><p>Set number of tile rows to use. Note this is given as <code class="code">log2(tile_rows)</code>.
  12463. For example, 4 tile rows would be requested by setting the <samp class="option">tile-rows</samp>
  12464. option to 2.
  12465. </p></dd>
  12466. <dt><samp class="option">frame-parallel</samp></dt>
  12467. <dd><p>Enable frame parallel decodability features.
  12468. </p></dd>
  12469. <dt><samp class="option">aq-mode</samp></dt>
  12470. <dd><p>Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  12471. cyclic refresh, 4: equator360).
  12472. </p></dd>
  12473. <dt><samp class="option">colorspace <em class="emph">color-space</em></samp></dt>
  12474. <dd><p>Set input color space. The VP9 bitstream supports signaling the following
  12475. colorspaces:
  12476. </p><dl class="table">
  12477. <dt><samp class="option">&lsquo;<samp class="samp">rgb</samp>&rsquo; <em class="emph">sRGB</em></samp></dt>
  12478. <dt><samp class="option">&lsquo;<samp class="samp">bt709</samp>&rsquo; <em class="emph">bt709</em></samp></dt>
  12479. <dt><samp class="option">&lsquo;<samp class="samp">unspecified</samp>&rsquo; <em class="emph">unknown</em></samp></dt>
  12480. <dt><samp class="option">&lsquo;<samp class="samp">bt470bg</samp>&rsquo; <em class="emph">bt601</em></samp></dt>
  12481. <dt><samp class="option">&lsquo;<samp class="samp">smpte170m</samp>&rsquo; <em class="emph">smpte170</em></samp></dt>
  12482. <dt><samp class="option">&lsquo;<samp class="samp">smpte240m</samp>&rsquo; <em class="emph">smpte240</em></samp></dt>
  12483. <dt><samp class="option">&lsquo;<samp class="samp">bt2020_ncl</samp>&rsquo; <em class="emph">bt2020</em></samp></dt>
  12484. </dl>
  12485. </dd>
  12486. <dt><samp class="option">row-mt <var class="var">boolean</var></samp></dt>
  12487. <dd><p>Enable row based multi-threading.
  12488. </p></dd>
  12489. <dt><samp class="option">tune-content</samp></dt>
  12490. <dd><p>Set content type: default (0), screen (1), film (2).
  12491. </p></dd>
  12492. <dt><samp class="option">corpus-complexity</samp></dt>
  12493. <dd><p>Corpus VBR mode is a variant of standard VBR where the complexity distribution
  12494. midpoint is passed in rather than calculated for a specific clip or chunk.
  12495. </p>
  12496. <p>The valid range is [0, 10000]. 0 (default) uses standard VBR.
  12497. </p></dd>
  12498. <dt><samp class="option">enable-tpl <var class="var">boolean</var></samp></dt>
  12499. <dd><p>Enable temporal dependency model.
  12500. </p></dd>
  12501. <dt><samp class="option">ref-frame-config</samp></dt>
  12502. <dd><p>Using per-frame metadata, set members of the structure <code class="code">vpx_svc_ref_frame_config_t</code> in <code class="code">vpx/vp8cx.h</code> to fine-control referencing schemes and frame buffer management.
  12503. <br>Use a :-separated list of key=value pairs.
  12504. For example,
  12505. </p><div class="example">
  12506. <pre class="example-preformatted">av_dict_set(&amp;av_frame-&gt;metadata, &quot;ref-frame-config&quot;, \
  12507. &quot;rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0&quot;);
  12508. </pre></div>
  12509. <dl class="table">
  12510. <dt><samp class="option">rfc_update_buffer_slot</samp></dt>
  12511. <dd><p>Indicates the buffer slot number to update
  12512. </p></dd>
  12513. <dt><samp class="option">rfc_update_last</samp></dt>
  12514. <dd><p>Indicates whether to update the LAST frame
  12515. </p></dd>
  12516. <dt><samp class="option">rfc_update_golden</samp></dt>
  12517. <dd><p>Indicates whether to update GOLDEN frame
  12518. </p></dd>
  12519. <dt><samp class="option">rfc_update_alt_ref</samp></dt>
  12520. <dd><p>Indicates whether to update ALT_REF frame
  12521. </p></dd>
  12522. <dt><samp class="option">rfc_lst_fb_idx</samp></dt>
  12523. <dd><p>LAST frame buffer index
  12524. </p></dd>
  12525. <dt><samp class="option">rfc_gld_fb_idx</samp></dt>
  12526. <dd><p>GOLDEN frame buffer index
  12527. </p></dd>
  12528. <dt><samp class="option">rfc_alt_fb_idx</samp></dt>
  12529. <dd><p>ALT_REF frame buffer index
  12530. </p></dd>
  12531. <dt><samp class="option">rfc_reference_last</samp></dt>
  12532. <dd><p>Indicates whether to reference LAST frame
  12533. </p></dd>
  12534. <dt><samp class="option">rfc_reference_golden</samp></dt>
  12535. <dd><p>Indicates whether to reference GOLDEN frame
  12536. </p></dd>
  12537. <dt><samp class="option">rfc_reference_alt_ref</samp></dt>
  12538. <dd><p>Indicates whether to reference ALT_REF frame
  12539. </p></dd>
  12540. <dt><samp class="option">rfc_reference_duration</samp></dt>
  12541. <dd><p>Indicates frame duration
  12542. </p></dd>
  12543. </dl>
  12544. </dd>
  12545. </dl>
  12546. </dd>
  12547. </dl>
  12548. <p>For more information about libvpx see:
  12549. <a class="url" href="http://www.webmproject.org/">http://www.webmproject.org/</a>
  12550. </p>
  12551. <a name="libvvenc"></a>
  12552. <h3 class="section">16.17 libvvenc<span class="pull-right"><a class="anchor hidden-xs" href="#libvvenc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvvenc" aria-hidden="true">TOC</a></span></h3>
  12553. <p>VVenC H.266/VVC encoder wrapper.
  12554. </p>
  12555. <p>This encoder requires the presence of the libvvenc headers and library
  12556. during configuration. You need to explicitly configure the build with
  12557. <samp class="option">--enable-libvvenc</samp>.
  12558. </p>
  12559. <p>The VVenC project website is at
  12560. <a class="url" href="https://github.com/fraunhoferhhi/vvenc">https://github.com/fraunhoferhhi/vvenc</a>.
  12561. </p>
  12562. <a name="Supported-Pixel-Formats"></a>
  12563. <h4 class="subsection">16.17.1 Supported Pixel Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Supported-Pixel-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Supported-Pixel-Formats" aria-hidden="true">TOC</a></span></h4>
  12564. <p>VVenC supports only 10-bit color spaces as input. But the internal (encoded)
  12565. bit depth can be set to 8-bit or 10-bit at runtime.
  12566. </p>
  12567. <a name="Options-40"></a>
  12568. <h4 class="subsection">16.17.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-40" aria-hidden="true">TOC</a></span></h4>
  12569. <dl class="table">
  12570. <dt><samp class="option">b</samp></dt>
  12571. <dd><p>Sets target video bitrate.
  12572. </p>
  12573. </dd>
  12574. <dt><samp class="option">g</samp></dt>
  12575. <dd><p>Set the GOP size. Currently support for g=1 (Intra only) or default.
  12576. </p>
  12577. </dd>
  12578. <dt><samp class="option">preset</samp></dt>
  12579. <dd><p>Set the VVenC preset.
  12580. </p>
  12581. </dd>
  12582. <dt><samp class="option">levelidc</samp></dt>
  12583. <dd><p>Set level idc.
  12584. </p>
  12585. </dd>
  12586. <dt><samp class="option">tier</samp></dt>
  12587. <dd><p>Set vvc tier.
  12588. </p>
  12589. </dd>
  12590. <dt><samp class="option">qp</samp></dt>
  12591. <dd><p>Set constant quantization parameter.
  12592. </p>
  12593. </dd>
  12594. <dt><samp class="option">subopt <var class="var">boolean</var></samp></dt>
  12595. <dd><p>Set subjective (perceptually motivated) optimization. Default is 1 (on).
  12596. </p>
  12597. </dd>
  12598. <dt><samp class="option">bitdepth8 <var class="var">boolean</var></samp></dt>
  12599. <dd><p>Set 8bit coding mode instead of using 10bit. Default is 0 (off).
  12600. </p>
  12601. </dd>
  12602. <dt><samp class="option">period</samp></dt>
  12603. <dd><p>set (intra) refresh period in seconds.
  12604. </p>
  12605. </dd>
  12606. <dt><samp class="option">vvenc-params</samp></dt>
  12607. <dd><p>Set vvenc options using a list of <var class="var">key</var>=<var class="var">value</var> couples separated
  12608. by &quot;:&quot;. See <code class="command">vvencapp --fullhelp</code> or <code class="command">vvencFFapp --fullhelp</code> for a list of options.
  12609. </p>
  12610. <p>For example, the options might be provided as:
  12611. </p>
  12612. <div class="example">
  12613. <pre class="example-preformatted">intraperiod=64:decodingrefreshtype=idr:poc0idr=1:internalbitdepth=8
  12614. </pre></div>
  12615. <p>For example the encoding options might be provided with <samp class="option">-vvenc-params</samp>:
  12616. </p>
  12617. <div class="example">
  12618. <pre class="example-preformatted">ffmpeg -i input -c:v libvvenc -b 1M -vvenc-params intraperiod=64:decodingrefreshtype=idr:poc0idr=1:internalbitdepth=8 output.mp4
  12619. </pre></div>
  12620. </dd>
  12621. </dl>
  12622. <a name="libwebp"></a>
  12623. <h3 class="section">16.18 libwebp<span class="pull-right"><a class="anchor hidden-xs" href="#libwebp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libwebp" aria-hidden="true">TOC</a></span></h3>
  12624. <p>libwebp WebP Image encoder wrapper
  12625. </p>
  12626. <p>libwebp is Google&rsquo;s official encoder for WebP images. It can encode in either
  12627. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  12628. frame. Lossless images are a separate codec developed by Google.
  12629. </p>
  12630. <a name="Pixel-Format"></a>
  12631. <h4 class="subsection">16.18.1 Pixel Format<span class="pull-right"><a class="anchor hidden-xs" href="#Pixel-Format" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pixel-Format" aria-hidden="true">TOC</a></span></h4>
  12632. <p>Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  12633. to limitations of the format and libwebp. Alpha is supported for either mode.
  12634. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  12635. passed in for encoding lossless, the pixel format will automatically be
  12636. converted using functions from libwebp. This is not ideal and is done only for
  12637. convenience.
  12638. </p>
  12639. <a name="Options-41"></a>
  12640. <h4 class="subsection">16.18.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-41" aria-hidden="true">TOC</a></span></h4>
  12641. <dl class="table">
  12642. <dt><samp class="option">-lossless <var class="var">boolean</var></samp></dt>
  12643. <dd><p>Enables/Disables use of lossless mode. Default is 0.
  12644. </p>
  12645. </dd>
  12646. <dt><samp class="option">-compression_level <var class="var">integer</var></samp></dt>
  12647. <dd><p>For lossy, this is a quality/speed tradeoff. Higher values give better quality
  12648. for a given size at the cost of increased encoding time. For lossless, this is
  12649. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  12650. encoding time. More specifically, it controls the number of extra algorithms
  12651. and compression tools used, and varies the combination of these tools. This
  12652. maps to the <var class="var">method</var> option in libwebp. The valid range is 0 to 6.
  12653. Default is 4.
  12654. </p>
  12655. </dd>
  12656. <dt><samp class="option">-quality <var class="var">float</var></samp></dt>
  12657. <dd><p>For lossy encoding, this controls image quality. For lossless encoding, this
  12658. controls the effort and time spent in compression.
  12659. Range is 0 to 100. Default is 75.
  12660. </p>
  12661. </dd>
  12662. <dt><samp class="option">-preset <var class="var">type</var></samp></dt>
  12663. <dd><p>Configuration preset. This does some automatic settings based on the general
  12664. type of the image.
  12665. </p><dl class="table">
  12666. <dt><samp class="option">none</samp></dt>
  12667. <dd><p>Do not use a preset.
  12668. </p></dd>
  12669. <dt><samp class="option">default</samp></dt>
  12670. <dd><p>Use the encoder default.
  12671. </p></dd>
  12672. <dt><samp class="option">picture</samp></dt>
  12673. <dd><p>Digital picture, like portrait, inner shot
  12674. </p></dd>
  12675. <dt><samp class="option">photo</samp></dt>
  12676. <dd><p>Outdoor photograph, with natural lighting
  12677. </p></dd>
  12678. <dt><samp class="option">drawing</samp></dt>
  12679. <dd><p>Hand or line drawing, with high-contrast details
  12680. </p></dd>
  12681. <dt><samp class="option">icon</samp></dt>
  12682. <dd><p>Small-sized colorful images
  12683. </p></dd>
  12684. <dt><samp class="option">text</samp></dt>
  12685. <dd><p>Text-like
  12686. </p></dd>
  12687. </dl>
  12688. </dd>
  12689. </dl>
  12690. <a name="libx264_002c-libx264rgb"></a>
  12691. <h3 class="section">16.19 libx264, libx264rgb<span class="pull-right"><a class="anchor hidden-xs" href="#libx264_002c-libx264rgb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libx264_002c-libx264rgb" aria-hidden="true">TOC</a></span></h3>
  12692. <p>x264 H.264/MPEG-4 AVC encoder wrapper.
  12693. </p>
  12694. <p>This encoder requires the presence of the libx264 headers and library
  12695. during configuration. You need to explicitly configure the build with
  12696. <code class="code">--enable-libx264</code>.
  12697. </p>
  12698. <p>libx264 supports an impressive number of features, including 8x8 and
  12699. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  12700. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  12701. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  12702. </p>
  12703. <p>Many libx264 encoder options are mapped to FFmpeg global codec
  12704. options, while unique encoder options are provided through private
  12705. options. Additionally the <samp class="option">x264opts</samp> and <samp class="option">x264-params</samp>
  12706. private options allows one to pass a list of key=value tuples as accepted
  12707. by the libx264 <code class="code">x264_param_parse</code> function.
  12708. </p>
  12709. <p>The x264 project website is at
  12710. <a class="url" href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>.
  12711. </p>
  12712. <p>The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  12713. pixel formats as input instead of YUV.
  12714. </p>
  12715. <a name="Supported-Pixel-Formats-1"></a>
  12716. <h4 class="subsection">16.19.1 Supported Pixel Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Supported-Pixel-Formats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Supported-Pixel-Formats-1" aria-hidden="true">TOC</a></span></h4>
  12717. <p>x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  12718. x264&rsquo;s configure time.
  12719. </p>
  12720. <a name="Options-42"></a>
  12721. <h4 class="subsection">16.19.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-42" aria-hidden="true">TOC</a></span></h4>
  12722. <p>The following options are supported by the libx264 wrapper. The
  12723. <code class="command">x264</code>-equivalent options or values are listed in parentheses
  12724. for easy migration.
  12725. </p>
  12726. <p>To reduce the duplication of documentation, only the private options
  12727. and some others requiring special attention are documented here. For
  12728. the documentation of the undocumented generic options, see
  12729. <a class="ref" href="#codec_002doptions">the Codec Options chapter</a>.
  12730. </p>
  12731. <p>To get a more accurate and extensive documentation of the libx264
  12732. options, invoke the command <code class="command">x264 --fullhelp</code> or consult
  12733. the libx264 documentation.
  12734. </p>
  12735. <p>In the list below, note that the <code class="command">x264</code> option name is shown
  12736. in parentheses after the libavcodec corresponding name, in case there
  12737. is a direct mapping.
  12738. </p>
  12739. <dl class="table">
  12740. <dt><samp class="option">b (<em class="emph">bitrate</em>)</samp></dt>
  12741. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s <samp class="option">b</samp> option is
  12742. expressed in bits/s, while <code class="command">x264</code>&rsquo;s <samp class="option">bitrate</samp> is in
  12743. kilobits/s.
  12744. </p>
  12745. </dd>
  12746. <dt><samp class="option">bf (<em class="emph">bframes</em>)</samp></dt>
  12747. <dd><p>Number of B-frames between I and P-frames
  12748. </p>
  12749. </dd>
  12750. <dt><samp class="option">g (<em class="emph">keyint</em>)</samp></dt>
  12751. <dd><p>Maximum GOP size
  12752. </p>
  12753. </dd>
  12754. <dt><samp class="option">qmin (<em class="emph">qpmin</em>)</samp></dt>
  12755. <dd><p>Minimum quantizer scale
  12756. </p>
  12757. </dd>
  12758. <dt><samp class="option">qmax (<em class="emph">qpmax</em>)</samp></dt>
  12759. <dd><p>Maximum quantizer scale
  12760. </p>
  12761. </dd>
  12762. <dt><samp class="option">qdiff (<em class="emph">qpstep</em>)</samp></dt>
  12763. <dd><p>Maximum difference between quantizer scales
  12764. </p>
  12765. </dd>
  12766. <dt><samp class="option">qblur (<em class="emph">qblur</em>)</samp></dt>
  12767. <dd><p>Quantizer curve blur
  12768. </p>
  12769. </dd>
  12770. <dt><samp class="option">qcomp (<em class="emph">qcomp</em>)</samp></dt>
  12771. <dd><p>Quantizer curve compression factor
  12772. </p>
  12773. </dd>
  12774. <dt><samp class="option">refs (<em class="emph">ref</em>)</samp></dt>
  12775. <dd><p>Number of reference frames each P-frame can use. The range is <var class="var">0-16</var>.
  12776. </p>
  12777. </dd>
  12778. <dt><samp class="option">level (<em class="emph">level</em>)</samp></dt>
  12779. <dd><p>Set the <code class="code">x264_param_t.i_level_idc</code> value in case the value is
  12780. positive, it is ignored otherwise.
  12781. </p>
  12782. <p>This value can be set using the <code class="code">AVCodecContext</code> API (e.g. by
  12783. setting the <code class="code">AVCodecContext</code> value directly), and is specified as
  12784. an integer mapped on a corresponding level (e.g. the value 31 maps
  12785. to H.264 level IDC &quot;3.1&quot;, as defined in the <code class="code">x264_levels</code>
  12786. table). It is ignored when set to a non positive value.
  12787. </p>
  12788. <p>Alternatively it can be set as a private option, overriding the value
  12789. set in <code class="code">AVCodecContext</code>, and in this case must be specified as
  12790. the level IDC identifier (e.g. &quot;3.1&quot;), as defined by H.264 Annex A.
  12791. </p>
  12792. </dd>
  12793. <dt><samp class="option">sc_threshold (<em class="emph">scenecut</em>)</samp></dt>
  12794. <dd><p>Sets the threshold for the scene change detection.
  12795. </p>
  12796. </dd>
  12797. <dt><samp class="option">trellis (<em class="emph">trellis</em>)</samp></dt>
  12798. <dd><p>Performs Trellis quantization to increase efficiency. Enabled by default.
  12799. </p>
  12800. </dd>
  12801. <dt><samp class="option">nr (<em class="emph">nr</em>)</samp></dt>
  12802. <dd><p>Noise reduction
  12803. </p>
  12804. </dd>
  12805. <dt><samp class="option">me_range (<em class="emph">merange</em>)</samp></dt>
  12806. <dd><p>Maximum range of the motion search in pixels.
  12807. </p>
  12808. </dd>
  12809. <dt><samp class="option">me_method (<em class="emph">me</em>)</samp></dt>
  12810. <dd><p>Set motion estimation method. Possible values in the decreasing order
  12811. of speed:
  12812. </p>
  12813. <dl class="table">
  12814. <dt>&lsquo;<samp class="samp">dia (<em class="emph">dia</em>)</samp>&rsquo;</dt>
  12815. <dt>&lsquo;<samp class="samp">epzs (<em class="emph">dia</em>)</samp>&rsquo;</dt>
  12816. <dd><p>Diamond search with radius 1 (fastest). &lsquo;<samp class="samp">epzs</samp>&rsquo; is an alias for
  12817. &lsquo;<samp class="samp">dia</samp>&rsquo;.
  12818. </p></dd>
  12819. <dt>&lsquo;<samp class="samp">hex (<em class="emph">hex</em>)</samp>&rsquo;</dt>
  12820. <dd><p>Hexagonal search with radius 2.
  12821. </p></dd>
  12822. <dt>&lsquo;<samp class="samp">umh (<em class="emph">umh</em>)</samp>&rsquo;</dt>
  12823. <dd><p>Uneven multi-hexagon search.
  12824. </p></dd>
  12825. <dt>&lsquo;<samp class="samp">esa (<em class="emph">esa</em>)</samp>&rsquo;</dt>
  12826. <dd><p>Exhaustive search.
  12827. </p></dd>
  12828. <dt>&lsquo;<samp class="samp">tesa (<em class="emph">tesa</em>)</samp>&rsquo;</dt>
  12829. <dd><p>Hadamard exhaustive search (slowest).
  12830. </p></dd>
  12831. </dl>
  12832. </dd>
  12833. <dt><samp class="option">forced-idr</samp></dt>
  12834. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  12835. of I-frame. This option forces it to choose an IDR-frame.
  12836. </p>
  12837. </dd>
  12838. <dt><samp class="option">subq (<em class="emph">subme</em>)</samp></dt>
  12839. <dd><p>Sub-pixel motion estimation method.
  12840. </p>
  12841. </dd>
  12842. <dt><samp class="option">b_strategy (<em class="emph">b-adapt</em>)</samp></dt>
  12843. <dd><p>Adaptive B-frame placement decision algorithm. Use only on first-pass.
  12844. </p>
  12845. </dd>
  12846. <dt><samp class="option">keyint_min (<em class="emph">min-keyint</em>)</samp></dt>
  12847. <dd><p>Minimum GOP size.
  12848. </p>
  12849. </dd>
  12850. <dt><samp class="option">coder</samp></dt>
  12851. <dd><p>Set entropy encoder. Possible values:
  12852. </p>
  12853. <dl class="table">
  12854. <dt>&lsquo;<samp class="samp">ac</samp>&rsquo;</dt>
  12855. <dd><p>Enable CABAC.
  12856. </p>
  12857. </dd>
  12858. <dt>&lsquo;<samp class="samp">vlc</samp>&rsquo;</dt>
  12859. <dd><p>Enable CAVLC and disable CABAC. It generates the same effect as
  12860. <code class="command">x264</code>&rsquo;s <samp class="option">--no-cabac</samp> option.
  12861. </p></dd>
  12862. </dl>
  12863. </dd>
  12864. <dt><samp class="option">cmp</samp></dt>
  12865. <dd><p>Set full pixel motion estimation comparison algorithm. Possible values:
  12866. </p>
  12867. <dl class="table">
  12868. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  12869. <dd><p>Enable chroma in motion estimation.
  12870. </p>
  12871. </dd>
  12872. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  12873. <dd><p>Ignore chroma in motion estimation. It generates the same effect as
  12874. <code class="command">x264</code>&rsquo;s <samp class="option">--no-chroma-me</samp> option.
  12875. </p></dd>
  12876. </dl>
  12877. </dd>
  12878. <dt><samp class="option">threads (<em class="emph">threads</em>)</samp></dt>
  12879. <dd><p>Number of encoding threads.
  12880. </p>
  12881. </dd>
  12882. <dt><samp class="option">thread_type</samp></dt>
  12883. <dd><p>Set multithreading technique. Possible values:
  12884. </p>
  12885. <dl class="table">
  12886. <dt>&lsquo;<samp class="samp">slice</samp>&rsquo;</dt>
  12887. <dd><p>Slice-based multithreading. It generates the same effect as
  12888. <code class="command">x264</code>&rsquo;s <samp class="option">--sliced-threads</samp> option.
  12889. </p></dd>
  12890. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  12891. <dd><p>Frame-based multithreading.
  12892. </p></dd>
  12893. </dl>
  12894. </dd>
  12895. <dt><samp class="option">flags</samp></dt>
  12896. <dd><p>Set encoding flags. It can be used to disable closed GOP and enable
  12897. open GOP by setting it to <code class="code">-cgop</code>. The result is similar to
  12898. the behavior of <code class="command">x264</code>&rsquo;s <samp class="option">--open-gop</samp> option.
  12899. </p>
  12900. </dd>
  12901. <dt><samp class="option">rc_init_occupancy (<em class="emph">vbv-init</em>)</samp></dt>
  12902. <dd><p>Initial VBV buffer occupancy
  12903. </p>
  12904. </dd>
  12905. <dt><samp class="option">preset (<em class="emph">preset</em>)</samp></dt>
  12906. <dd><p>Set the encoding preset.
  12907. </p>
  12908. </dd>
  12909. <dt><samp class="option">tune (<em class="emph">tune</em>)</samp></dt>
  12910. <dd><p>Set tuning of the encoding params.
  12911. </p>
  12912. </dd>
  12913. <dt><samp class="option">profile (<em class="emph">profile</em>)</samp></dt>
  12914. <dd><p>Set profile restrictions.
  12915. </p>
  12916. </dd>
  12917. <dt><samp class="option">fastfirstpass</samp></dt>
  12918. <dd><p>Enable fast settings when encoding first pass, when set to 1. When set
  12919. to 0, it has the same effect of <code class="command">x264</code>&rsquo;s
  12920. <samp class="option">--slow-firstpass</samp> option.
  12921. </p>
  12922. </dd>
  12923. <dt><samp class="option">crf (<em class="emph">crf</em>)</samp></dt>
  12924. <dd><p>Set the quality for constant quality mode.
  12925. </p>
  12926. </dd>
  12927. <dt><samp class="option">crf_max (<em class="emph">crf-max</em>)</samp></dt>
  12928. <dd><p>In CRF mode, prevents VBV from lowering quality beyond this point.
  12929. </p>
  12930. </dd>
  12931. <dt><samp class="option">qp (<em class="emph">qp</em>)</samp></dt>
  12932. <dd><p>Set constant quantization rate control method parameter.
  12933. </p>
  12934. </dd>
  12935. <dt><samp class="option">aq-mode (<em class="emph">aq-mode</em>)</samp></dt>
  12936. <dd><p>Set AQ method. Possible values:
  12937. </p>
  12938. <dl class="table">
  12939. <dt>&lsquo;<samp class="samp">none (<em class="emph">0</em>)</samp>&rsquo;</dt>
  12940. <dd><p>Disabled.
  12941. </p>
  12942. </dd>
  12943. <dt>&lsquo;<samp class="samp">variance (<em class="emph">1</em>)</samp>&rsquo;</dt>
  12944. <dd><p>Variance AQ (complexity mask).
  12945. </p>
  12946. </dd>
  12947. <dt>&lsquo;<samp class="samp">autovariance (<em class="emph">2</em>)</samp>&rsquo;</dt>
  12948. <dd><p>Auto-variance AQ (experimental).
  12949. </p></dd>
  12950. </dl>
  12951. </dd>
  12952. <dt><samp class="option">aq-strength (<em class="emph">aq-strength</em>)</samp></dt>
  12953. <dd><p>Set AQ strength, reduce blocking and blurring in flat and textured areas.
  12954. </p>
  12955. </dd>
  12956. <dt><samp class="option">psy</samp></dt>
  12957. <dd><p>Use psychovisual optimizations when set to 1. When set to 0, it has the
  12958. same effect as <code class="command">x264</code>&rsquo;s <samp class="option">--no-psy</samp> option.
  12959. </p>
  12960. </dd>
  12961. <dt><samp class="option">psy-rd (<em class="emph">psy-rd</em>)</samp></dt>
  12962. <dd><p>Set strength of psychovisual optimization, in
  12963. <var class="var">psy-rd</var>:<var class="var">psy-trellis</var> format.
  12964. </p>
  12965. </dd>
  12966. <dt><samp class="option">rc-lookahead (<em class="emph">rc-lookahead</em>)</samp></dt>
  12967. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  12968. </p>
  12969. </dd>
  12970. <dt><samp class="option">weightb</samp></dt>
  12971. <dd><p>Enable weighted prediction for B-frames when set to 1. When set to 0,
  12972. it has the same effect as <code class="command">x264</code>&rsquo;s <samp class="option">--no-weightb</samp> option.
  12973. </p>
  12974. </dd>
  12975. <dt><samp class="option">weightp (<em class="emph">weightp</em>)</samp></dt>
  12976. <dd><p>Set weighted prediction method for P-frames. Possible values:
  12977. </p>
  12978. <dl class="table">
  12979. <dt>&lsquo;<samp class="samp">none (<em class="emph">0</em>)</samp>&rsquo;</dt>
  12980. <dd><p>Disabled
  12981. </p></dd>
  12982. <dt>&lsquo;<samp class="samp">simple (<em class="emph">1</em>)</samp>&rsquo;</dt>
  12983. <dd><p>Enable only weighted refs
  12984. </p></dd>
  12985. <dt>&lsquo;<samp class="samp">smart (<em class="emph">2</em>)</samp>&rsquo;</dt>
  12986. <dd><p>Enable both weighted refs and duplicates
  12987. </p></dd>
  12988. </dl>
  12989. </dd>
  12990. <dt><samp class="option">ssim (<em class="emph">ssim</em>)</samp></dt>
  12991. <dd><p>Enable calculation and printing SSIM stats after the encoding.
  12992. </p>
  12993. </dd>
  12994. <dt><samp class="option">intra-refresh (<em class="emph">intra-refresh</em>)</samp></dt>
  12995. <dd><p>Enable the use of Periodic Intra Refresh instead of IDR frames when set
  12996. to 1.
  12997. </p>
  12998. </dd>
  12999. <dt><samp class="option">avcintra-class (<em class="emph">class</em>)</samp></dt>
  13000. <dd><p>Configure the encoder to generate AVC-Intra.
  13001. Valid values are 50, 100 and 200
  13002. </p>
  13003. </dd>
  13004. <dt><samp class="option">bluray-compat (<em class="emph">bluray-compat</em>)</samp></dt>
  13005. <dd><p>Configure the encoder to be compatible with the bluray standard.
  13006. It is a shorthand for setting &quot;bluray-compat=1 force-cfr=1&quot;.
  13007. </p>
  13008. </dd>
  13009. <dt><samp class="option">b-bias (<em class="emph">b-bias</em>)</samp></dt>
  13010. <dd><p>Set the influence on how often B-frames are used.
  13011. </p>
  13012. </dd>
  13013. <dt><samp class="option">b-pyramid (<em class="emph">b-pyramid</em>)</samp></dt>
  13014. <dd><p>Set method for keeping of some B-frames as references. Possible values:
  13015. </p>
  13016. <dl class="table">
  13017. <dt>&lsquo;<samp class="samp">none (<em class="emph">none</em>)</samp>&rsquo;</dt>
  13018. <dd><p>Disabled.
  13019. </p></dd>
  13020. <dt>&lsquo;<samp class="samp">strict (<em class="emph">strict</em>)</samp>&rsquo;</dt>
  13021. <dd><p>Strictly hierarchical pyramid.
  13022. </p></dd>
  13023. <dt>&lsquo;<samp class="samp">normal (<em class="emph">normal</em>)</samp>&rsquo;</dt>
  13024. <dd><p>Non-strict (not Blu-ray compatible).
  13025. </p></dd>
  13026. </dl>
  13027. </dd>
  13028. <dt><samp class="option">mixed-refs</samp></dt>
  13029. <dd><p>Enable the use of one reference per partition, as opposed to one
  13030. reference per macroblock when set to 1. When set to 0, it has the
  13031. same effect as <code class="command">x264</code>&rsquo;s <samp class="option">--no-mixed-refs</samp> option.
  13032. </p>
  13033. </dd>
  13034. <dt><samp class="option">8x8dct</samp></dt>
  13035. <dd><p>Enable adaptive spatial transform (high profile 8x8 transform)
  13036. when set to 1. When set to 0, it has the same effect as
  13037. <code class="command">x264</code>&rsquo;s <samp class="option">--no-8x8dct</samp> option.
  13038. </p>
  13039. </dd>
  13040. <dt><samp class="option">fast-pskip</samp></dt>
  13041. <dd><p>Enable early SKIP detection on P-frames when set to 1. When set
  13042. to 0, it has the same effect as <code class="command">x264</code>&rsquo;s
  13043. <samp class="option">--no-fast-pskip</samp> option.
  13044. </p>
  13045. </dd>
  13046. <dt><samp class="option">aud (<em class="emph">aud</em>)</samp></dt>
  13047. <dd><p>Enable use of access unit delimiters when set to 1.
  13048. </p>
  13049. </dd>
  13050. <dt><samp class="option">mbtree</samp></dt>
  13051. <dd><p>Enable use macroblock tree ratecontrol when set to 1. When set
  13052. to 0, it has the same effect as <code class="command">x264</code>&rsquo;s
  13053. <samp class="option">--no-mbtree</samp> option.
  13054. </p>
  13055. </dd>
  13056. <dt><samp class="option">deblock (<em class="emph">deblock</em>)</samp></dt>
  13057. <dd><p>Set loop filter parameters, in <var class="var">alpha</var>:<var class="var">beta</var> form.
  13058. </p>
  13059. </dd>
  13060. <dt><samp class="option">cplxblur (<em class="emph">cplxblur</em>)</samp></dt>
  13061. <dd><p>Set fluctuations reduction in QP (before curve compression).
  13062. </p>
  13063. </dd>
  13064. <dt><samp class="option">partitions (<em class="emph">partitions</em>)</samp></dt>
  13065. <dd><p>Set partitions to consider as a comma-separated list of values.
  13066. Possible values in the list:
  13067. </p>
  13068. <dl class="table">
  13069. <dt>&lsquo;<samp class="samp">p8x8</samp>&rsquo;</dt>
  13070. <dd><p>8x8 P-frame partition.
  13071. </p></dd>
  13072. <dt>&lsquo;<samp class="samp">p4x4</samp>&rsquo;</dt>
  13073. <dd><p>4x4 P-frame partition.
  13074. </p></dd>
  13075. <dt>&lsquo;<samp class="samp">b8x8</samp>&rsquo;</dt>
  13076. <dd><p>4x4 B-frame partition.
  13077. </p></dd>
  13078. <dt>&lsquo;<samp class="samp">i8x8</samp>&rsquo;</dt>
  13079. <dd><p>8x8 I-frame partition.
  13080. </p></dd>
  13081. <dt>&lsquo;<samp class="samp">i4x4</samp>&rsquo;</dt>
  13082. <dd><p>4x4 I-frame partition.
  13083. (Enabling &lsquo;<samp class="samp">p4x4</samp>&rsquo; requires &lsquo;<samp class="samp">p8x8</samp>&rsquo; to be enabled. Enabling
  13084. &lsquo;<samp class="samp">i8x8</samp>&rsquo; requires adaptive spatial transform (<samp class="option">8x8dct</samp>
  13085. option) to be enabled.)
  13086. </p></dd>
  13087. <dt>&lsquo;<samp class="samp">none (<em class="emph">none</em>)</samp>&rsquo;</dt>
  13088. <dd><p>Do not consider any partitions.
  13089. </p></dd>
  13090. <dt>&lsquo;<samp class="samp">all (<em class="emph">all</em>)</samp>&rsquo;</dt>
  13091. <dd><p>Consider every partition.
  13092. </p></dd>
  13093. </dl>
  13094. </dd>
  13095. <dt><samp class="option">direct-pred (<em class="emph">direct</em>)</samp></dt>
  13096. <dd><p>Set direct MV prediction mode. Possible values:
  13097. </p>
  13098. <dl class="table">
  13099. <dt>&lsquo;<samp class="samp">none (<em class="emph">none</em>)</samp>&rsquo;</dt>
  13100. <dd><p>Disable MV prediction.
  13101. </p></dd>
  13102. <dt>&lsquo;<samp class="samp">spatial (<em class="emph">spatial</em>)</samp>&rsquo;</dt>
  13103. <dd><p>Enable spatial predicting.
  13104. </p></dd>
  13105. <dt>&lsquo;<samp class="samp">temporal (<em class="emph">temporal</em>)</samp>&rsquo;</dt>
  13106. <dd><p>Enable temporal predicting.
  13107. </p></dd>
  13108. <dt>&lsquo;<samp class="samp">auto (<em class="emph">auto</em>)</samp>&rsquo;</dt>
  13109. <dd><p>Automatically decided.
  13110. </p></dd>
  13111. </dl>
  13112. </dd>
  13113. <dt><samp class="option">slice-max-size (<em class="emph">slice-max-size</em>)</samp></dt>
  13114. <dd><p>Set the limit of the size of each slice in bytes. If not specified
  13115. but RTP payload size (<samp class="option">ps</samp>) is specified, that is used.
  13116. </p>
  13117. </dd>
  13118. <dt><samp class="option">stats (<em class="emph">stats</em>)</samp></dt>
  13119. <dd><p>Set the file name for multi-pass stats.
  13120. </p>
  13121. </dd>
  13122. <dt><samp class="option">nal-hrd (<em class="emph">nal-hrd</em>)</samp></dt>
  13123. <dd><p>Set signal HRD information (requires <samp class="option">vbv-bufsize</samp> to be set).
  13124. Possible values:
  13125. </p>
  13126. <dl class="table">
  13127. <dt>&lsquo;<samp class="samp">none (<em class="emph">none</em>)</samp>&rsquo;</dt>
  13128. <dd><p>Disable HRD information signaling.
  13129. </p></dd>
  13130. <dt>&lsquo;<samp class="samp">vbr (<em class="emph">vbr</em>)</samp>&rsquo;</dt>
  13131. <dd><p>Variable bit rate.
  13132. </p></dd>
  13133. <dt>&lsquo;<samp class="samp">cbr (<em class="emph">cbr</em>)</samp>&rsquo;</dt>
  13134. <dd><p>Constant bit rate (not allowed in MP4 container).
  13135. </p></dd>
  13136. </dl>
  13137. </dd>
  13138. <dt><samp class="option">x264opts <var class="var">opts</var></samp></dt>
  13139. <dt><samp class="option">x264-params <var class="var">opts</var></samp></dt>
  13140. <dd><p>Override the x264 configuration using a :-separated list of key=value
  13141. options.
  13142. </p>
  13143. <p>The argument for both options is a list of <var class="var">key</var>=<var class="var">value</var>
  13144. couples separated by &quot;:&quot;. With <samp class="option">x264opts</samp> the value can be
  13145. omitted, and the value <code class="code">1</code> is assumed in that case.
  13146. </p>
  13147. <p>For <var class="var">filter</var> and <var class="var">psy-rd</var> options values that use &quot;:&quot; as a
  13148. separator themselves, use &quot;,&quot; instead. They accept it as well since
  13149. long ago but this is kept undocumented for some reason.
  13150. </p>
  13151. <p>For example, the options might be provided as:
  13152. </p><div class="example">
  13153. <pre class="example-preformatted">level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0
  13154. </pre></div>
  13155. <p>For example to specify libx264 encoding options with <code class="command">ffmpeg</code>:
  13156. </p><div class="example">
  13157. <pre class="example-preformatted">ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  13158. </pre></div>
  13159. <p>To get the complete list of the libx264 options, invoke the command
  13160. <code class="command">x264 --fullhelp</code> or consult the libx264 documentation.
  13161. </p>
  13162. </dd>
  13163. <dt><samp class="option">a53cc <var class="var">boolean</var></samp></dt>
  13164. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  13165. Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
  13166. </p>
  13167. </dd>
  13168. <dt><samp class="option">udu_sei <var class="var">boolean</var></samp></dt>
  13169. <dd><p>Import user data unregistered SEI if available into output. Default is 0 (off).
  13170. </p>
  13171. </dd>
  13172. <dt><samp class="option">mb_info <var class="var">boolean</var></samp></dt>
  13173. <dd><p>Set mb_info data through AVFrameSideData, only useful when used from the
  13174. API. Default is 0 (off).
  13175. </p></dd>
  13176. </dl>
  13177. <p>Encoding ffpresets for common usages are provided so they can be used with the
  13178. general presets system (e.g. passing the <samp class="option">pre</samp> option).
  13179. </p>
  13180. <a name="libx265"></a>
  13181. <h3 class="section">16.20 libx265<span class="pull-right"><a class="anchor hidden-xs" href="#libx265" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libx265" aria-hidden="true">TOC</a></span></h3>
  13182. <p>x265 H.265/HEVC encoder wrapper.
  13183. </p>
  13184. <p>This encoder requires the presence of the libx265 headers and library
  13185. during configuration. You need to explicitly configure the build with
  13186. <samp class="option">--enable-libx265</samp>.
  13187. </p>
  13188. <a name="Options-43"></a>
  13189. <h4 class="subsection">16.20.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-43" aria-hidden="true">TOC</a></span></h4>
  13190. <dl class="table">
  13191. <dt><samp class="option">b</samp></dt>
  13192. <dd><p>Sets target video bitrate.
  13193. </p>
  13194. </dd>
  13195. <dt><samp class="option">bf</samp></dt>
  13196. <dt><samp class="option">g</samp></dt>
  13197. <dd><p>Set the GOP size.
  13198. </p>
  13199. </dd>
  13200. <dt><samp class="option">keyint_min</samp></dt>
  13201. <dd><p>Minimum GOP size.
  13202. </p>
  13203. </dd>
  13204. <dt><samp class="option">refs</samp></dt>
  13205. <dd><p>Number of reference frames each P-frame can use. The range is from <var class="var">1-16</var>.
  13206. </p>
  13207. </dd>
  13208. <dt><samp class="option">preset</samp></dt>
  13209. <dd><p>Set the x265 preset.
  13210. </p>
  13211. </dd>
  13212. <dt><samp class="option">tune</samp></dt>
  13213. <dd><p>Set the x265 tune parameter.
  13214. </p>
  13215. </dd>
  13216. <dt><samp class="option">profile</samp></dt>
  13217. <dd><p>Set profile restrictions.
  13218. </p>
  13219. </dd>
  13220. <dt><samp class="option">crf</samp></dt>
  13221. <dd><p>Set the quality for constant quality mode.
  13222. </p>
  13223. </dd>
  13224. <dt><samp class="option">qp</samp></dt>
  13225. <dd><p>Set constant quantization rate control method parameter.
  13226. </p>
  13227. </dd>
  13228. <dt><samp class="option">qmin</samp></dt>
  13229. <dd><p>Minimum quantizer scale.
  13230. </p>
  13231. </dd>
  13232. <dt><samp class="option">qmax</samp></dt>
  13233. <dd><p>Maximum quantizer scale.
  13234. </p>
  13235. </dd>
  13236. <dt><samp class="option">qdiff</samp></dt>
  13237. <dd><p>Maximum difference between quantizer scales.
  13238. </p>
  13239. </dd>
  13240. <dt><samp class="option">qblur</samp></dt>
  13241. <dd><p>Quantizer curve blur
  13242. </p>
  13243. </dd>
  13244. <dt><samp class="option">qcomp</samp></dt>
  13245. <dd><p>Quantizer curve compression factor
  13246. </p>
  13247. </dd>
  13248. <dt><samp class="option">i_qfactor</samp></dt>
  13249. <dt><samp class="option">b_qfactor</samp></dt>
  13250. <dt><samp class="option">forced-idr</samp></dt>
  13251. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  13252. of I-frame. This option forces it to choose an IDR-frame.
  13253. </p>
  13254. </dd>
  13255. <dt><samp class="option">x265-stats</samp></dt>
  13256. <dd><p>Specify the file name for 2-pass stats. This is set automatically when using
  13257. the <samp class="option">-passlogfile</samp> option.
  13258. </p>
  13259. </dd>
  13260. <dt><samp class="option">udu_sei <var class="var">boolean</var></samp></dt>
  13261. <dd><p>Import user data unregistered SEI if available into output. Default is 0 (off).
  13262. </p>
  13263. </dd>
  13264. <dt><samp class="option">x265-params</samp></dt>
  13265. <dd><p>Set x265 options using a list of <var class="var">key</var>=<var class="var">value</var> couples separated
  13266. by &quot;:&quot;. See <code class="command">x265 --help</code> for a list of options.
  13267. </p>
  13268. <p>For example to specify libx265 encoding options with <samp class="option">-x265-params</samp>:
  13269. </p>
  13270. <div class="example">
  13271. <pre class="example-preformatted">ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  13272. </pre></div>
  13273. </dd>
  13274. </dl>
  13275. <a name="libxavs2"></a>
  13276. <h3 class="section">16.21 libxavs2<span class="pull-right"><a class="anchor hidden-xs" href="#libxavs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libxavs2" aria-hidden="true">TOC</a></span></h3>
  13277. <p>xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
  13278. </p>
  13279. <p>This encoder requires the presence of the libxavs2 headers and library
  13280. during configuration. You need to explicitly configure the build with
  13281. <samp class="option">--enable-libxavs2</samp>.
  13282. </p>
  13283. <p>The following standard libavcodec options are used:
  13284. </p><ul class="itemize mark-bullet">
  13285. <li><samp class="option">b</samp> / <samp class="option">bit_rate</samp>
  13286. </li><li><samp class="option">g</samp> / <samp class="option">gop_size</samp>
  13287. </li><li><samp class="option">bf</samp> / <samp class="option">max_b_frames</samp>
  13288. </li></ul>
  13289. <p>The encoder also has its own specific options:
  13290. </p><a name="Options-44"></a>
  13291. <h4 class="subsection">16.21.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-44" aria-hidden="true">TOC</a></span></h4>
  13292. <dl class="table">
  13293. <dt><samp class="option">lcu_row_threads</samp></dt>
  13294. <dd><p>Set the number of parallel threads for rows from 1 to 8 (default 5).
  13295. </p>
  13296. </dd>
  13297. <dt><samp class="option">initial_qp</samp></dt>
  13298. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  13299. used to set the initial qp for the first frame.
  13300. </p>
  13301. </dd>
  13302. <dt><samp class="option">qp</samp></dt>
  13303. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  13304. used to set the qp value under constant-QP mode.
  13305. </p>
  13306. </dd>
  13307. <dt><samp class="option">max_qp</samp></dt>
  13308. <dd><p>Set the max qp for rate control from 1 to 63 (default 55).
  13309. </p>
  13310. </dd>
  13311. <dt><samp class="option">min_qp</samp></dt>
  13312. <dd><p>Set the min qp for rate control from 1 to 63 (default 20).
  13313. </p>
  13314. </dd>
  13315. <dt><samp class="option">speed_level</samp></dt>
  13316. <dd><p>Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
  13317. </p>
  13318. </dd>
  13319. <dt><samp class="option">log_level</samp></dt>
  13320. <dd><p>Set the log level from -1 to 3 (default 0). -1: none, 0: error,
  13321. 1: warning, 2: info, 3: debug.
  13322. </p>
  13323. </dd>
  13324. <dt><samp class="option">xavs2-params</samp></dt>
  13325. <dd><p>Set xavs2 options using a list of <var class="var">key</var>=<var class="var">value</var> couples separated
  13326. by &quot;:&quot;.
  13327. </p>
  13328. <p>For example to specify libxavs2 encoding options with <samp class="option">-xavs2-params</samp>:
  13329. </p>
  13330. <div class="example">
  13331. <pre class="example-preformatted">ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
  13332. </pre></div>
  13333. </dd>
  13334. </dl>
  13335. <a name="libxeve"></a>
  13336. <h3 class="section">16.22 libxeve<span class="pull-right"><a class="anchor hidden-xs" href="#libxeve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libxeve" aria-hidden="true">TOC</a></span></h3>
  13337. <p>eXtra-fast Essential Video Encoder (XEVE) MPEG-5 EVC encoder wrapper.
  13338. The xeve-equivalent options or values are listed in parentheses for easy migration.
  13339. </p>
  13340. <p>This encoder requires the presence of the libxeve headers and library
  13341. during configuration. You need to explicitly configure the build with
  13342. <samp class="option">--enable-libxeve</samp>.
  13343. </p>
  13344. <div class="info">
  13345. <p>Many libxeve encoder options are mapped to FFmpeg global codec options,
  13346. while unique encoder options are provided through private options.
  13347. Additionally the xeve-params private options allows one to pass a list
  13348. of key=value tuples as accepted by the libxeve <code class="code">parse_xeve_params</code> function.
  13349. </p></div>
  13350. <p>The xeve project website is at <a class="url" href="https://github.com/mpeg5/xeve">https://github.com/mpeg5/xeve</a>.
  13351. </p>
  13352. <a name="Options-45"></a>
  13353. <h4 class="subsection">16.22.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-45" aria-hidden="true">TOC</a></span></h4>
  13354. <p>The following options are supported by the libxeve wrapper.
  13355. The xeve-equivalent options or values are listed in parentheses for easy migration.
  13356. </p>
  13357. <div class="info">
  13358. <p>To reduce the duplication of documentation, only the private options
  13359. and some others requiring special attention are documented here. For
  13360. the documentation of the undocumented generic options, see
  13361. <a class="ref" href="#codec_002doptions">the Codec Options chapter</a>.
  13362. </p></div>
  13363. <div class="info">
  13364. <p>To get a more accurate and extensive documentation of the libxeve options,
  13365. invoke the command <code class="code">xeve_app --help</code> or consult the libxeve documentation.
  13366. </p></div>
  13367. <dl class="table">
  13368. <dt><samp class="option">b (<em class="emph">bitrate</em>)</samp></dt>
  13369. <dd><p>Set target video bitrate in bits/s.
  13370. Note that FFmpeg&rsquo;s b option is expressed in bits/s, while xeve&rsquo;s bitrate is in kilobits/s.
  13371. </p>
  13372. </dd>
  13373. <dt><samp class="option">bf (<em class="emph">bframes</em>)</samp></dt>
  13374. <dd><p>Set the maximum number of B frames (1,3,7,15).
  13375. </p>
  13376. </dd>
  13377. <dt><samp class="option">g (<em class="emph">keyint</em>)</samp></dt>
  13378. <dd><p>Set the GOP size (I-picture period).
  13379. </p>
  13380. </dd>
  13381. <dt><samp class="option">preset (<em class="emph">preset</em>)</samp></dt>
  13382. <dd><p>Set the xeve preset.
  13383. Set the encoder preset value to determine encoding speed [fast, medium, slow, placebo]
  13384. </p>
  13385. </dd>
  13386. <dt><samp class="option">tune (<em class="emph">tune</em>)</samp></dt>
  13387. <dd><p>Set the encoder tune parameter [psnr, zerolatency]
  13388. </p>
  13389. </dd>
  13390. <dt><samp class="option">profile (<em class="emph">profile</em>)</samp></dt>
  13391. <dd><p>Set the encoder profile [0: baseline; 1: main]
  13392. </p>
  13393. </dd>
  13394. <dt><samp class="option">crf (<em class="emph">crf</em>)</samp></dt>
  13395. <dd><p>Set the quality for constant quality mode.
  13396. Constant rate factor &lt;10..49&gt; [default: 32]
  13397. </p>
  13398. </dd>
  13399. <dt><samp class="option">qp (<em class="emph">qp</em>)</samp></dt>
  13400. <dd><p>Set constant quantization rate control method parameter.
  13401. Quantization parameter qp &lt;0..51&gt; [default: 32]
  13402. </p>
  13403. </dd>
  13404. <dt><samp class="option">threads (<em class="emph">threads</em>)</samp></dt>
  13405. <dd><p>Force to use a specific number of threads
  13406. </p>
  13407. </dd>
  13408. </dl>
  13409. <a name="libxvid"></a>
  13410. <h3 class="section">16.23 libxvid<span class="pull-right"><a class="anchor hidden-xs" href="#libxvid" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libxvid" aria-hidden="true">TOC</a></span></h3>
  13411. <p>Xvid MPEG-4 Part 2 encoder wrapper.
  13412. </p>
  13413. <p>This encoder requires the presence of the libxvidcore headers and library
  13414. during configuration. You need to explicitly configure the build with
  13415. <code class="code">--enable-libxvid --enable-gpl</code>.
  13416. </p>
  13417. <p>The native <code class="code">mpeg4</code> encoder supports the MPEG-4 Part 2 format, so
  13418. users can encode to this format without this library.
  13419. </p>
  13420. <a name="Options-46"></a>
  13421. <h4 class="subsection">16.23.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-46" aria-hidden="true">TOC</a></span></h4>
  13422. <p>The following options are supported by the libxvid wrapper. Some of
  13423. the following options are listed but are not documented, and
  13424. correspond to shared codec options. See <a class="ref" href="#codec_002doptions">the Codec
  13425. Options chapter</a> for their documentation. The other shared options
  13426. which are not listed have no effect for the libxvid encoder.
  13427. </p>
  13428. <dl class="table">
  13429. <dt><samp class="option">b</samp></dt>
  13430. <dt><samp class="option">g</samp></dt>
  13431. <dt><samp class="option">qmin</samp></dt>
  13432. <dt><samp class="option">qmax</samp></dt>
  13433. <dt><samp class="option">mpeg_quant</samp></dt>
  13434. <dt><samp class="option">threads</samp></dt>
  13435. <dt><samp class="option">bf</samp></dt>
  13436. <dt><samp class="option">b_qfactor</samp></dt>
  13437. <dt><samp class="option">b_qoffset</samp></dt>
  13438. <dt><samp class="option">flags</samp></dt>
  13439. <dd><p>Set specific encoding flags. Possible values:
  13440. </p>
  13441. <dl class="table">
  13442. <dt>&lsquo;<samp class="samp">mv4</samp>&rsquo;</dt>
  13443. <dd><p>Use four motion vector by macroblock.
  13444. </p>
  13445. </dd>
  13446. <dt>&lsquo;<samp class="samp">aic</samp>&rsquo;</dt>
  13447. <dd><p>Enable high quality AC prediction.
  13448. </p>
  13449. </dd>
  13450. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  13451. <dd><p>Only encode grayscale.
  13452. </p>
  13453. </dd>
  13454. <dt>&lsquo;<samp class="samp">qpel</samp>&rsquo;</dt>
  13455. <dd><p>Enable quarter-pixel motion compensation.
  13456. </p>
  13457. </dd>
  13458. <dt>&lsquo;<samp class="samp">cgop</samp>&rsquo;</dt>
  13459. <dd><p>Enable closed GOP.
  13460. </p>
  13461. </dd>
  13462. <dt>&lsquo;<samp class="samp">global_header</samp>&rsquo;</dt>
  13463. <dd><p>Place global headers in extradata instead of every keyframe.
  13464. </p>
  13465. </dd>
  13466. </dl>
  13467. </dd>
  13468. <dt><samp class="option">gmc</samp></dt>
  13469. <dd><p>Enable the use of global motion compensation (GMC). Default is 0
  13470. (disabled).
  13471. </p>
  13472. </dd>
  13473. <dt><samp class="option">me_quality</samp></dt>
  13474. <dd><p>Set motion estimation quality level. Possible values in decreasing order of
  13475. speed and increasing order of quality:
  13476. </p>
  13477. <dl class="table">
  13478. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  13479. <dd><p>Use no motion estimation (default).
  13480. </p>
  13481. </dd>
  13482. <dt>&lsquo;<samp class="samp">1, 2</samp>&rsquo;</dt>
  13483. <dd><p>Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  13484. refinement for 16x16 blocks.
  13485. </p>
  13486. </dd>
  13487. <dt>&lsquo;<samp class="samp">3, 4</samp>&rsquo;</dt>
  13488. <dd><p>Enable all of the things described above, plus advanced diamond zonal
  13489. search for 8x8 blocks and half-pixel refinement for 8x8 blocks, also
  13490. enable motion estimation on chroma planes for P and B-frames.
  13491. </p>
  13492. </dd>
  13493. <dt>&lsquo;<samp class="samp">5, 6</samp>&rsquo;</dt>
  13494. <dd><p>Enable all of the things described above, plus extended 16x16 and 8x8
  13495. blocks search.
  13496. </p></dd>
  13497. </dl>
  13498. </dd>
  13499. <dt><samp class="option">mbd</samp></dt>
  13500. <dd><p>Set macroblock decision algorithm. Possible values in the increasing
  13501. order of quality:
  13502. </p>
  13503. <dl class="table">
  13504. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  13505. <dd><p>Use macroblock comparing function algorithm (default).
  13506. </p>
  13507. </dd>
  13508. <dt>&lsquo;<samp class="samp">bits</samp>&rsquo;</dt>
  13509. <dd><p>Enable rate distortion-based half pixel and quarter pixel refinement for
  13510. 16x16 blocks.
  13511. </p>
  13512. </dd>
  13513. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  13514. <dd><p>Enable all of the things described above, plus rate distortion-based
  13515. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  13516. distortion-based search using square pattern.
  13517. </p></dd>
  13518. </dl>
  13519. </dd>
  13520. <dt><samp class="option">lumi_aq</samp></dt>
  13521. <dd><p>Enable lumi masking adaptive quantization when set to 1. Default is 0
  13522. (disabled).
  13523. </p>
  13524. </dd>
  13525. <dt><samp class="option">variance_aq</samp></dt>
  13526. <dd><p>Enable variance adaptive quantization when set to 1. Default is 0
  13527. (disabled).
  13528. </p>
  13529. <p>When combined with <samp class="option">lumi_aq</samp>, the resulting quality will not
  13530. be better than any of the two specified individually. In other
  13531. words, the resulting quality will be the worse one of the two
  13532. effects.
  13533. </p>
  13534. </dd>
  13535. <dt><samp class="option">trellis</samp></dt>
  13536. <dd><p>Set rate-distortion optimal quantization.
  13537. </p>
  13538. </dd>
  13539. <dt><samp class="option">ssim</samp></dt>
  13540. <dd><p>Set structural similarity (SSIM) displaying method. Possible values:
  13541. </p>
  13542. <dl class="table">
  13543. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  13544. <dd><p>Disable displaying of SSIM information.
  13545. </p>
  13546. </dd>
  13547. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  13548. <dd><p>Output average SSIM at the end of encoding to stdout. The format of
  13549. showing the average SSIM is:
  13550. </p>
  13551. <div class="example">
  13552. <pre class="example-preformatted">Average SSIM: %f
  13553. </pre></div>
  13554. <p>For users who are not familiar with C, %f means a float number, or
  13555. a decimal (e.g. 0.939232).
  13556. </p>
  13557. </dd>
  13558. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  13559. <dd><p>Output both per-frame SSIM data during encoding and average SSIM at
  13560. the end of encoding to stdout. The format of per-frame information
  13561. is:
  13562. </p>
  13563. <div class="example">
  13564. <pre class="example-preformatted"> SSIM: avg: %1.3f min: %1.3f max: %1.3f
  13565. </pre></div>
  13566. <p>For users who are not familiar with C, %1.3f means a float number
  13567. rounded to 3 digits after the dot (e.g. 0.932).
  13568. </p>
  13569. </dd>
  13570. </dl>
  13571. </dd>
  13572. <dt><samp class="option">ssim_acc</samp></dt>
  13573. <dd><p>Set SSIM accuracy. Valid options are integers within the range of
  13574. 0-4, while 0 gives the most accurate result and 4 computes the
  13575. fastest.
  13576. </p>
  13577. </dd>
  13578. </dl>
  13579. <a name="MediaCodec"></a>
  13580. <h3 class="section">16.24 MediaCodec<span class="pull-right"><a class="anchor hidden-xs" href="#MediaCodec" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-MediaCodec" aria-hidden="true">TOC</a></span></h3>
  13581. <p>MediaCodec encoder wrapper enables hardware-accelerated video encoding on
  13582. Android device. It supports H.264, H.265 (HEVC), VP8, VP9, MPEG-4, and AV1
  13583. encoding (whether works or not is device dependent).
  13584. </p>
  13585. <p>Android provides two sets of APIs: Java MediaCodec and NDK MediaCodec. The
  13586. MediaCodec encoder wrapper supports both. Note that the NDK MediaCodec API
  13587. operates without requiring JVM, but may fail to function outside the JVM
  13588. environment due to dependencies on system framework services, particularly
  13589. after Android 15.
  13590. </p>
  13591. <dl class="table">
  13592. <dt><samp class="option">ndk_codec <var class="var">boolean</var></samp></dt>
  13593. <dd><p>Use the NDK-based MediaCodec API instead of the Java API. Enabled by default
  13594. if <code class="code">av_jni_get_java_vm()</code> return NULL.
  13595. </p>
  13596. </dd>
  13597. <dt><samp class="option">ndk_async <var class="var">boolean</var></samp></dt>
  13598. <dd><p>Use NDK MediaCodec in async mode. Async mode has less overhead than poll in a
  13599. loop in sync mode. The drawback of async mode is AV_CODEC_FLAG_GLOBAL_HEADER
  13600. doesn&rsquo;t work (use extract_extradata bsf when necessary). It doesn&rsquo;t work and
  13601. will be disabled automatically on devices below Android 8.0.
  13602. </p>
  13603. </dd>
  13604. <dt><samp class="option">codec_name <var class="var">string</var></samp></dt>
  13605. <dd><p>A codec type can have multiple implementations on a single device, this option
  13606. specify which backend to use (via MediaCodec createCodecByName API). It&rsquo;s NULL
  13607. by default, and encoder is created by createEncoderByType.
  13608. </p>
  13609. </dd>
  13610. <dt><samp class="option">bitrate_mode <var class="var">integer</var></samp></dt>
  13611. <dd>
  13612. <p>Possible values:
  13613. </p><dl class="table">
  13614. <dt>&lsquo;<samp class="samp">cq</samp>&rsquo;</dt>
  13615. <dd><p>Constant quality mode
  13616. </p></dd>
  13617. <dt>&lsquo;<samp class="samp">vbr</samp>&rsquo;</dt>
  13618. <dd><p>Variable bitrate mode
  13619. </p></dd>
  13620. <dt>&lsquo;<samp class="samp">cbr</samp>&rsquo;</dt>
  13621. <dd><p>Constant bitrate mode
  13622. </p></dd>
  13623. <dt>&lsquo;<samp class="samp">cbr_fd</samp>&rsquo;</dt>
  13624. <dd><p>Constant bitrate mode with frame drops
  13625. </p></dd>
  13626. </dl>
  13627. </dd>
  13628. <dt><samp class="option">pts_as_dts <var class="var">boolean</var></samp></dt>
  13629. <dd><p>Use PTS as DTS. This is a workaround since MediaCodec API doesn&rsquo;t provide
  13630. decoding timestamp. It is enabled automatically if B frame is 0.
  13631. </p>
  13632. </dd>
  13633. <dt><samp class="option">operating_rate <var class="var">integer</var></samp></dt>
  13634. <dd><p>The desired operating rate that the codec will need to operate at, zero for
  13635. unspecified. This is used for cases like high-speed/slow-motion video capture,
  13636. where the video encoder format contains the target playback rate (e.g. 30fps),
  13637. but the component must be able to handle the high operating capture rate (e.g.
  13638. 240fps). This rate will be used by codec for resource planning and setting the
  13639. operating points.
  13640. </p>
  13641. </dd>
  13642. <dt><samp class="option">qp_i_min <var class="var">integer</var></samp></dt>
  13643. <dd><p>Minimum quantization parameter for I frame.
  13644. </p></dd>
  13645. <dt><samp class="option">qp_p_min <var class="var">integer</var></samp></dt>
  13646. <dd><p>Minimum quantization parameter for P frame.
  13647. </p></dd>
  13648. <dt><samp class="option">qp_b_min <var class="var">integer</var></samp></dt>
  13649. <dd><p>Minimum quantization parameter for B frame.
  13650. </p></dd>
  13651. <dt><samp class="option">qp_i_max <var class="var">integer</var></samp></dt>
  13652. <dd><p>Maximum quantization parameter for I frame.
  13653. </p></dd>
  13654. <dt><samp class="option">qp_p_max <var class="var">integer</var></samp></dt>
  13655. <dd><p>Maximum quantization parameter for P frame.
  13656. </p></dd>
  13657. <dt><samp class="option">qp_b_max <var class="var">integer</var></samp></dt>
  13658. <dd><p>Maximum quantization parameter for B frame.
  13659. </p>
  13660. </dd>
  13661. </dl>
  13662. <a name="MediaFoundation"></a>
  13663. <h3 class="section">16.25 MediaFoundation<span class="pull-right"><a class="anchor hidden-xs" href="#MediaFoundation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-MediaFoundation" aria-hidden="true">TOC</a></span></h3>
  13664. <p>The following wrappers for encoders in the MediaFoundation framework are
  13665. available:
  13666. </p>
  13667. <ul class="itemize mark-bullet">
  13668. <li>h264_mf
  13669. </li><li>hevc_mf
  13670. </li><li>av1_mf
  13671. </li></ul>
  13672. <p>These support both software and hardware encoding.
  13673. </p>
  13674. <p>Video encoders can take input in either of nv12 or yuv420p form
  13675. (some encoders support both, some support only either - in practice,
  13676. nv12 is the safer choice, especially among HW encoders).
  13677. </p>
  13678. <p>Hardware-accelerated encoding requires D3D11, including hardware
  13679. scaling capabilities through the scale_d3d11 filter.
  13680. </p>
  13681. <p>To list all available options for the MediaFoundation encoders, use:
  13682. <code class="command">ffmpeg -h encoder=&lt;encoder&gt;</code> e.g. <code class="command">ffmpeg -h encoder=h264_mf</code>
  13683. </p>
  13684. <a name="Options-47"></a>
  13685. <h4 class="subsection">16.25.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-47" aria-hidden="true">TOC</a></span></h4>
  13686. <dl class="table">
  13687. <dt><samp class="option">rate_control</samp></dt>
  13688. <dd><p>Select rate control mode. Available modes:
  13689. </p>
  13690. <dl class="table">
  13691. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  13692. <dd><p>Default mode
  13693. </p></dd>
  13694. <dt>&lsquo;<samp class="samp">cbr</samp>&rsquo;</dt>
  13695. <dd><p>CBR mode
  13696. </p></dd>
  13697. <dt>&lsquo;<samp class="samp">pc_vbr</samp>&rsquo;</dt>
  13698. <dd><p>Peak constrained VBR mode
  13699. </p></dd>
  13700. <dt>&lsquo;<samp class="samp">u_vbr</samp>&rsquo;</dt>
  13701. <dd><p>Unconstrained VBR mode
  13702. </p></dd>
  13703. <dt>&lsquo;<samp class="samp">quality</samp>&rsquo;</dt>
  13704. <dd><p>Quality mode
  13705. </p></dd>
  13706. <dt>&lsquo;<samp class="samp">ld_vbr</samp>&rsquo;</dt>
  13707. <dd><p>Low delay VBR mode (requires Windows 8+)
  13708. </p></dd>
  13709. <dt>&lsquo;<samp class="samp">g_vbr</samp>&rsquo;</dt>
  13710. <dd><p>Global VBR mode (requires Windows 8+)
  13711. </p></dd>
  13712. <dt>&lsquo;<samp class="samp">gld_vbr</samp>&rsquo;</dt>
  13713. <dd><p>Global low delay VBR mode (requires Windows 8+)
  13714. </p></dd>
  13715. </dl>
  13716. </dd>
  13717. <dt><samp class="option">scenario</samp></dt>
  13718. <dd><p>Select usage scenario. Available scenarios:
  13719. </p>
  13720. <dl class="table">
  13721. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  13722. <dd><p>Default scenario
  13723. </p></dd>
  13724. <dt>&lsquo;<samp class="samp">display_remoting</samp>&rsquo;</dt>
  13725. <dd><p>Display remoting scenario
  13726. </p></dd>
  13727. <dt>&lsquo;<samp class="samp">video_conference</samp>&rsquo;</dt>
  13728. <dd><p>Video conference scenario
  13729. </p></dd>
  13730. <dt>&lsquo;<samp class="samp">archive</samp>&rsquo;</dt>
  13731. <dd><p>Archive scenario
  13732. </p></dd>
  13733. <dt>&lsquo;<samp class="samp">live_streaming</samp>&rsquo;</dt>
  13734. <dd><p>Live streaming scenario
  13735. </p></dd>
  13736. <dt>&lsquo;<samp class="samp">camera_record</samp>&rsquo;</dt>
  13737. <dd><p>Camera record scenario
  13738. </p></dd>
  13739. <dt>&lsquo;<samp class="samp">display_remoting_with_feature_map</samp>&rsquo;</dt>
  13740. <dd><p>Display remoting with feature map scenario
  13741. </p></dd>
  13742. </dl>
  13743. </dd>
  13744. <dt><samp class="option">quality</samp></dt>
  13745. <dd><p>Set encoding quality (0-100). -1 means default quality.
  13746. </p>
  13747. </dd>
  13748. <dt><samp class="option">hw_encoding</samp></dt>
  13749. <dd><p>Force hardware encoding (0-1). Default is 0 (disabled).
  13750. </p>
  13751. </dd>
  13752. </dl>
  13753. <a name="Examples-6"></a>
  13754. <h4 class="subsection">16.25.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-6" aria-hidden="true">TOC</a></span></h4>
  13755. <p>Hardware encoding:
  13756. </p><div class="example">
  13757. <pre class="example-preformatted">ffmpeg -i input.mp4 -c:v h264_mf -hw_encoding 1 output.mp4
  13758. </pre></div>
  13759. <p>Hardware-accelerated decoding with hardware encoding:
  13760. </p><div class="example">
  13761. <pre class="example-preformatted">ffmpeg -hwaccel d3d11va -i input.mp4 -c:v h264_mf -hw_encoding 1 output.mp4
  13762. </pre></div>
  13763. <p>Hardware-accelerated decoding, HW scaling and encoding with quality setting:
  13764. </p><div class="example">
  13765. <pre class="example-preformatted">ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -i input.mp4 -vf scale_d3d11=1920:1080 -c:v hevc_mf -hw_encoding 1 -quality 80 output.mp4
  13766. </pre></div>
  13767. <a name="Microsoft-RLE"></a>
  13768. <h3 class="section">16.26 Microsoft RLE<span class="pull-right"><a class="anchor hidden-xs" href="#Microsoft-RLE" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Microsoft-RLE" aria-hidden="true">TOC</a></span></h3>
  13769. <p>Microsoft RLE aka MSRLE encoder.
  13770. Only 8-bit palette mode supported.
  13771. Compatible with Windows 3.1 and Windows 95.
  13772. </p>
  13773. <a name="Options-48"></a>
  13774. <h4 class="subsection">16.26.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-48" aria-hidden="true">TOC</a></span></h4>
  13775. <dl class="table">
  13776. <dt><samp class="option">g <var class="var">integer</var></samp></dt>
  13777. <dd><p>Keyframe interval.
  13778. A keyframe is inserted at least every <code class="code">-g</code> frames, sometimes sooner.
  13779. </p></dd>
  13780. </dl>
  13781. <a name="mpeg2"></a>
  13782. <h3 class="section">16.27 mpeg2<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg2" aria-hidden="true">TOC</a></span></h3>
  13783. <p>MPEG-2 video encoder.
  13784. </p>
  13785. <a name="Options-49"></a>
  13786. <h4 class="subsection">16.27.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-49" aria-hidden="true">TOC</a></span></h4>
  13787. <dl class="table">
  13788. <dt><samp class="option">profile</samp></dt>
  13789. <dd><p>Select the mpeg2 profile to encode:
  13790. </p>
  13791. <dl class="table">
  13792. <dt>&lsquo;<samp class="samp">422</samp>&rsquo;</dt>
  13793. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  13794. <dt>&lsquo;<samp class="samp">ss</samp>&rsquo;</dt>
  13795. <dd><p>Spatially Scalable
  13796. </p></dd>
  13797. <dt>&lsquo;<samp class="samp">snr</samp>&rsquo;</dt>
  13798. <dd><p>SNR Scalable
  13799. </p></dd>
  13800. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  13801. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  13802. </dl>
  13803. </dd>
  13804. <dt><samp class="option">level</samp></dt>
  13805. <dd><p>Select the mpeg2 level to encode:
  13806. </p>
  13807. <dl class="table">
  13808. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  13809. <dt>&lsquo;<samp class="samp">high1440</samp>&rsquo;</dt>
  13810. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  13811. <dt>&lsquo;<samp class="samp">low</samp>&rsquo;</dt>
  13812. </dl>
  13813. </dd>
  13814. <dt><samp class="option">seq_disp_ext <var class="var">integer</var></samp></dt>
  13815. <dd><p>Specifies if the encoder should write a sequence_display_extension to the
  13816. output.
  13817. </p><dl class="table">
  13818. <dt><samp class="option">-1</samp></dt>
  13819. <dt><samp class="option">auto</samp></dt>
  13820. <dd><p>Decide automatically to write it or not (this is the default) by checking if
  13821. the data to be written is different from the default or unspecified values.
  13822. </p></dd>
  13823. <dt><samp class="option">0</samp></dt>
  13824. <dt><samp class="option">never</samp></dt>
  13825. <dd><p>Never write it.
  13826. </p></dd>
  13827. <dt><samp class="option">1</samp></dt>
  13828. <dt><samp class="option">always</samp></dt>
  13829. <dd><p>Always write it.
  13830. </p></dd>
  13831. </dl>
  13832. </dd>
  13833. <dt><samp class="option">video_format <var class="var">integer</var></samp></dt>
  13834. <dd><p>Specifies the video_format written into the sequence display extension
  13835. indicating the source of the video pictures. The default is &lsquo;<samp class="samp">unspecified</samp>&rsquo;,
  13836. can be &lsquo;<samp class="samp">component</samp>&rsquo;, &lsquo;<samp class="samp">pal</samp>&rsquo;, &lsquo;<samp class="samp">ntsc</samp>&rsquo;, &lsquo;<samp class="samp">secam</samp>&rsquo; or &lsquo;<samp class="samp">mac</samp>&rsquo;.
  13837. For maximum compatibility, use &lsquo;<samp class="samp">component</samp>&rsquo;.
  13838. </p></dd>
  13839. <dt><samp class="option">a53cc <var class="var">boolean</var></samp></dt>
  13840. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  13841. Default is 1 (on).
  13842. </p></dd>
  13843. </dl>
  13844. <a name="png"></a>
  13845. <h3 class="section">16.28 png<span class="pull-right"><a class="anchor hidden-xs" href="#png" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-png" aria-hidden="true">TOC</a></span></h3>
  13846. <p>PNG image encoder.
  13847. </p>
  13848. <a name="Options-50"></a>
  13849. <h4 class="subsection">16.28.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-50" aria-hidden="true">TOC</a></span></h4>
  13850. <dl class="table">
  13851. <dt><samp class="option">compression_level</samp></dt>
  13852. <dd><p>Sets the compression level, from 0 to 9(default)
  13853. </p></dd>
  13854. </dl>
  13855. <a name="Private-options-1"></a>
  13856. <h4 class="subsection">16.28.2 Private options<span class="pull-right"><a class="anchor hidden-xs" href="#Private-options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Private-options-1" aria-hidden="true">TOC</a></span></h4>
  13857. <dl class="table">
  13858. <dt><samp class="option">dpi <var class="var">integer</var></samp></dt>
  13859. <dd><p>Set physical density of pixels, in dots per inch, unset by default
  13860. </p></dd>
  13861. <dt><samp class="option">dpm <var class="var">integer</var></samp></dt>
  13862. <dd><p>Set physical density of pixels, in dots per meter, unset by default
  13863. </p></dd>
  13864. <dt><samp class="option">pred <var class="var">method</var></samp></dt>
  13865. <dd><p>Set prediction method (none, sub, up, avg, paeth, mixed), default is paeth
  13866. </p></dd>
  13867. </dl>
  13868. <a name="ProRes"></a>
  13869. <h3 class="section">16.29 ProRes<span class="pull-right"><a class="anchor hidden-xs" href="#ProRes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ProRes" aria-hidden="true">TOC</a></span></h3>
  13870. <p>Apple ProRes encoder.
  13871. </p>
  13872. <p>FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  13873. The used encoder can be chosen with the <code class="code">-vcodec</code> option.
  13874. </p>
  13875. <a name="Private-Options-for-prores_002dks"></a>
  13876. <h4 class="subsection">16.29.1 Private Options for prores-ks<span class="pull-right"><a class="anchor hidden-xs" href="#Private-Options-for-prores_002dks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Private-Options-for-prores_002dks" aria-hidden="true">TOC</a></span></h4>
  13877. <dl class="table">
  13878. <dt><samp class="option">profile <var class="var">integer</var></samp></dt>
  13879. <dd><p>Select the ProRes profile to encode
  13880. </p><dl class="table">
  13881. <dt>&lsquo;<samp class="samp">proxy</samp>&rsquo;</dt>
  13882. <dt>&lsquo;<samp class="samp">lt</samp>&rsquo;</dt>
  13883. <dt>&lsquo;<samp class="samp">standard</samp>&rsquo;</dt>
  13884. <dt>&lsquo;<samp class="samp">hq</samp>&rsquo;</dt>
  13885. <dt>&lsquo;<samp class="samp">4444</samp>&rsquo;</dt>
  13886. <dt>&lsquo;<samp class="samp">4444xq</samp>&rsquo;</dt>
  13887. </dl>
  13888. </dd>
  13889. <dt><samp class="option">quant_mat <var class="var">integer</var></samp></dt>
  13890. <dd><p>Select quantization matrix.
  13891. </p><dl class="table">
  13892. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  13893. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  13894. <dt>&lsquo;<samp class="samp">proxy</samp>&rsquo;</dt>
  13895. <dt>&lsquo;<samp class="samp">lt</samp>&rsquo;</dt>
  13896. <dt>&lsquo;<samp class="samp">standard</samp>&rsquo;</dt>
  13897. <dt>&lsquo;<samp class="samp">hq</samp>&rsquo;</dt>
  13898. </dl>
  13899. <p>If set to <var class="var">auto</var>, the matrix matching the profile will be picked.
  13900. If not set, the matrix providing the highest quality, <var class="var">default</var>, will be
  13901. picked.
  13902. </p>
  13903. </dd>
  13904. <dt><samp class="option">bits_per_mb <var class="var">integer</var></samp></dt>
  13905. <dd><p>How many bits to allot for coding one macroblock. Different profiles use
  13906. between 200 and 2400 bits per macroblock, the maximum is 8000.
  13907. </p>
  13908. </dd>
  13909. <dt><samp class="option">mbs_per_slice <var class="var">integer</var></samp></dt>
  13910. <dd><p>Number of macroblocks in each slice (1-8); the default value (8)
  13911. should be good in almost all situations.
  13912. </p>
  13913. </dd>
  13914. <dt><samp class="option">vendor <var class="var">string</var></samp></dt>
  13915. <dd><p>Override the 4-byte vendor ID.
  13916. A custom vendor ID like <var class="var">apl0</var> would claim the stream was produced by
  13917. the Apple encoder.
  13918. </p>
  13919. </dd>
  13920. <dt><samp class="option">alpha_bits <var class="var">integer</var></samp></dt>
  13921. <dd><p>Specify number of bits for alpha component.
  13922. Possible values are <var class="var">0</var>, <var class="var">8</var> and <var class="var">16</var>.
  13923. Use <var class="var">0</var> to disable alpha plane coding.
  13924. </p>
  13925. </dd>
  13926. </dl>
  13927. <a name="Speed-considerations"></a>
  13928. <h4 class="subsection">16.29.2 Speed considerations<span class="pull-right"><a class="anchor hidden-xs" href="#Speed-considerations" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Speed-considerations" aria-hidden="true">TOC</a></span></h4>
  13929. <p>In the default mode of operation the encoder has to honor frame constraints
  13930. (i.e. not produce frames with size bigger than requested) while still making
  13931. output picture as good as possible.
  13932. A frame containing a lot of small details is harder to compress and the encoder
  13933. would spend more time searching for appropriate quantizers for each slice.
  13934. </p>
  13935. <p>Setting a higher <samp class="option">bits_per_mb</samp> limit will improve the speed.
  13936. </p>
  13937. <p>For the fastest encoding speed set the <samp class="option">qscale</samp> parameter (4 is the
  13938. recommended value) and do not set a size constraint.
  13939. </p>
  13940. <a name="QSV-Encoders"></a>
  13941. <h3 class="section">16.30 QSV Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#QSV-Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-QSV-Encoders" aria-hidden="true">TOC</a></span></h3>
  13942. <p>The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG,
  13943. VP9, AV1)
  13944. </p>
  13945. <a name="Ratecontrol-Method"></a>
  13946. <h4 class="subsection">16.30.1 Ratecontrol Method<span class="pull-right"><a class="anchor hidden-xs" href="#Ratecontrol-Method" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Ratecontrol-Method" aria-hidden="true">TOC</a></span></h4>
  13947. <p>The ratecontrol method is selected as follows:
  13948. </p><ul class="itemize mark-bullet">
  13949. <li>When <samp class="option">global_quality</samp> is specified, a quality-based mode is used.
  13950. Specifically this means either
  13951. <ul class="itemize mark-minus">
  13952. <li><var class="var">CQP</var> - constant quantizer scale, when the <samp class="option">qscale</samp> codec flag is
  13953. also set (the <samp class="option">-qscale</samp> ffmpeg option).
  13954. </li><li><var class="var">LA_ICQ</var> - intelligent constant quality with lookahead, when the
  13955. <samp class="option">look_ahead</samp> option is also set.
  13956. </li><li><var class="var">ICQ</var> &ndash; intelligent constant quality otherwise. For the ICQ modes, global
  13957. quality range is 1 to 51, with 1 being the best quality.
  13958. </li></ul>
  13959. </li><li>Otherwise when the desired average bitrate is specified with the <samp class="option">b</samp>
  13960. option, a bitrate-based mode is used.
  13961. <ul class="itemize mark-minus">
  13962. <li><var class="var">LA</var> - VBR with lookahead, when the <samp class="option">look_ahead</samp> option is specified.
  13963. </li><li><var class="var">VCM</var> - video conferencing mode, when the <samp class="option">vcm</samp> option is set.
  13964. </li><li><var class="var">CBR</var> - constant bitrate, when <samp class="option">maxrate</samp> is specified and equal to
  13965. the average bitrate.
  13966. </li><li><var class="var">VBR</var> - variable bitrate, when <samp class="option">maxrate</samp> is specified, but is higher
  13967. than the average bitrate.
  13968. </li><li><var class="var">AVBR</var> - average VBR mode, when <samp class="option">maxrate</samp> is not specified, both
  13969. <samp class="option">avbr_accuracy</samp> and <samp class="option">avbr_convergence</samp> are set to non-zero. This
  13970. mode is available for H264 and HEVC on Windows.
  13971. </li></ul>
  13972. </li><li>Otherwise the default ratecontrol method <var class="var">CQP</var> is used.
  13973. </li></ul>
  13974. <p>Note that depending on your system, a different mode than the one you specified
  13975. may be selected by the encoder. Set the verbosity level to <var class="var">verbose</var> or
  13976. higher to see the actual settings used by the QSV runtime.
  13977. </p>
  13978. <a name="Global-Options-_002d_003e-MSDK-Options"></a>
  13979. <h4 class="subsection">16.30.2 Global Options -&gt; MSDK Options<span class="pull-right"><a class="anchor hidden-xs" href="#Global-Options-_002d_003e-MSDK-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Global-Options-_002d_003e-MSDK-Options" aria-hidden="true">TOC</a></span></h4>
  13980. <p>Additional libavcodec global options are mapped to MSDK options as follows:
  13981. </p>
  13982. <ul class="itemize mark-bullet">
  13983. <li><samp class="option">g/gop_size</samp> -&gt; <samp class="option">GopPicSize</samp>
  13984. </li><li><samp class="option">bf/max_b_frames</samp>+1 -&gt; <samp class="option">GopRefDist</samp>
  13985. </li><li><samp class="option">rc_init_occupancy/rc_initial_buffer_occupancy</samp> -&gt;
  13986. <samp class="option">InitialDelayInKB</samp>
  13987. </li><li><samp class="option">slices</samp> -&gt; <samp class="option">NumSlice</samp>
  13988. </li><li><samp class="option">refs</samp> -&gt; <samp class="option">NumRefFrame</samp>
  13989. </li><li><samp class="option">b_strategy/b_frame_strategy</samp> -&gt; <samp class="option">BRefType</samp>
  13990. </li><li><samp class="option">cgop/CLOSED_GOP</samp> codec flag -&gt; <samp class="option">GopOptFlag</samp>
  13991. </li><li>For the <var class="var">CQP</var> mode, the <samp class="option">i_qfactor/i_qoffset</samp> and
  13992. <samp class="option">b_qfactor/b_qoffset</samp> set the difference between <var class="var">QPP</var> and <var class="var">QPI</var>,
  13993. and <var class="var">QPP</var> and <var class="var">QPB</var> respectively.
  13994. </li><li>Setting the <samp class="option">coder</samp> option to the value <var class="var">vlc</var> will make the H.264
  13995. encoder use CAVLC instead of CABAC.
  13996. </li></ul>
  13997. <a name="Common-Options-1"></a>
  13998. <h4 class="subsection">16.30.3 Common Options<span class="pull-right"><a class="anchor hidden-xs" href="#Common-Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Common-Options-1" aria-hidden="true">TOC</a></span></h4>
  13999. <p>Following options are used by all qsv encoders.
  14000. </p>
  14001. <dl class="table">
  14002. <dt><samp class="option"><var class="var">async_depth</var></samp></dt>
  14003. <dd><p>Specifies how many asynchronous operations an application performs
  14004. before the application explicitly synchronizes the result. If zero,
  14005. the value is not specified.
  14006. </p>
  14007. </dd>
  14008. <dt><samp class="option"><var class="var">preset</var></samp></dt>
  14009. <dd><p>This option itemizes a range of choices from veryfast (best speed) to veryslow
  14010. (best quality).
  14011. </p><dl class="table">
  14012. <dt>&lsquo;<samp class="samp">veryfast</samp>&rsquo;</dt>
  14013. <dt>&lsquo;<samp class="samp">faster</samp>&rsquo;</dt>
  14014. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  14015. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  14016. <dt>&lsquo;<samp class="samp">slow</samp>&rsquo;</dt>
  14017. <dt>&lsquo;<samp class="samp">slower</samp>&rsquo;</dt>
  14018. <dt>&lsquo;<samp class="samp">veryslow</samp>&rsquo;</dt>
  14019. </dl>
  14020. </dd>
  14021. <dt><samp class="option"><var class="var">forced_idr</var></samp></dt>
  14022. <dd><p>Forcing I frames as IDR frames.
  14023. </p>
  14024. </dd>
  14025. <dt><samp class="option"><var class="var">low_power</var></samp></dt>
  14026. <dd><p>For encoders set this flag to ON to reduce power consumption and GPU usage.
  14027. </p></dd>
  14028. </dl>
  14029. <a name="Runtime-Options"></a>
  14030. <h4 class="subsection">16.30.4 Runtime Options<span class="pull-right"><a class="anchor hidden-xs" href="#Runtime-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Runtime-Options" aria-hidden="true">TOC</a></span></h4>
  14031. <p>Following options can be used during qsv encoding.
  14032. </p>
  14033. <dl class="table">
  14034. <dt><samp class="option"><var class="var">global_quality</var></samp></dt>
  14035. <dt><samp class="option"><var class="var">i_quant_factor</var></samp></dt>
  14036. <dt><samp class="option"><var class="var">i_quant_offset</var></samp></dt>
  14037. <dt><samp class="option"><var class="var">b_quant_factor</var></samp></dt>
  14038. <dt><samp class="option"><var class="var">b_quant_offset</var></samp></dt>
  14039. <dd><p>Supported in h264_qsv and hevc_qsv.
  14040. Change these value to reset qsv codec&rsquo;s qp configuration.
  14041. </p>
  14042. </dd>
  14043. <dt><samp class="option"><var class="var">max_frame_size</var></samp></dt>
  14044. <dd><p>Supported in h264_qsv and hevc_qsv.
  14045. Change this value to reset qsv codec&rsquo;s MaxFrameSize configuration.
  14046. </p>
  14047. </dd>
  14048. <dt><samp class="option"><var class="var">gop_size</var></samp></dt>
  14049. <dd><p>Change this value to reset qsv codec&rsquo;s gop configuration.
  14050. </p>
  14051. </dd>
  14052. <dt><samp class="option"><var class="var">int_ref_type</var></samp></dt>
  14053. <dt><samp class="option"><var class="var">int_ref_cycle_size</var></samp></dt>
  14054. <dt><samp class="option"><var class="var">int_ref_qp_delta</var></samp></dt>
  14055. <dt><samp class="option"><var class="var">int_ref_cycle_dist</var></samp></dt>
  14056. <dd><p>Supported in h264_qsv and hevc_qsv.
  14057. Change these value to reset qsv codec&rsquo;s Intra Refresh configuration.
  14058. </p>
  14059. </dd>
  14060. <dt><samp class="option"><var class="var">qmax</var></samp></dt>
  14061. <dt><samp class="option"><var class="var">qmin</var></samp></dt>
  14062. <dt><samp class="option"><var class="var">max_qp_i</var></samp></dt>
  14063. <dt><samp class="option"><var class="var">min_qp_i</var></samp></dt>
  14064. <dt><samp class="option"><var class="var">max_qp_p</var></samp></dt>
  14065. <dt><samp class="option"><var class="var">min_qp_p</var></samp></dt>
  14066. <dt><samp class="option"><var class="var">max_qp_b</var></samp></dt>
  14067. <dt><samp class="option"><var class="var">min_qp_b</var></samp></dt>
  14068. <dd><p>Supported in h264_qsv.
  14069. Change these value to reset qsv codec&rsquo;s max/min qp configuration.
  14070. </p>
  14071. </dd>
  14072. <dt><samp class="option"><var class="var">low_delay_brc</var></samp></dt>
  14073. <dd><p>Supported in h264_qsv, hevc_qsv and av1_qsv.
  14074. Change this value to reset qsv codec&rsquo;s low_delay_brc configuration.
  14075. </p>
  14076. </dd>
  14077. <dt><samp class="option"><var class="var">framerate</var></samp></dt>
  14078. <dd><p>Change this value to reset qsv codec&rsquo;s framerate configuration.
  14079. </p>
  14080. </dd>
  14081. <dt><samp class="option"><var class="var">bit_rate</var></samp></dt>
  14082. <dt><samp class="option"><var class="var">rc_buffer_size</var></samp></dt>
  14083. <dt><samp class="option"><var class="var">rc_initial_buffer_occupancy</var></samp></dt>
  14084. <dt><samp class="option"><var class="var">rc_max_rate</var></samp></dt>
  14085. <dd><p>Change these value to reset qsv codec&rsquo;s bitrate control configuration.
  14086. </p>
  14087. </dd>
  14088. <dt><samp class="option"><var class="var">pic_timing_sei</var></samp></dt>
  14089. <dd><p>Supported in h264_qsv and hevc_qsv.
  14090. Change this value to reset qsv codec&rsquo;s pic_timing_sei configuration.
  14091. </p>
  14092. </dd>
  14093. <dt><samp class="option"><var class="var">qsv_params</var></samp></dt>
  14094. <dd><p>Set QSV encoder parameters as a colon-separated list of key-value pairs.
  14095. </p>
  14096. <p>The <samp class="option">qsv_params</samp> should be formatted as <code class="code">key1=value1:key2=value2:...</code>.
  14097. </p>
  14098. <p>These parameters are passed directly to the underlying Intel Quick Sync Video (QSV) encoder using the MFXSetParameter function.
  14099. </p>
  14100. <p>Example:
  14101. </p><div class="example">
  14102. <pre class="example-preformatted">ffmpeg -i input.mp4 -c:v h264_qsv -qsv_params &quot;CodingOption1=1:CodingOption2=2&quot; output.mp4
  14103. </pre></div>
  14104. <p>This option allows fine-grained control over various encoder-specific settings provided by the QSV encoder.
  14105. </p></dd>
  14106. </dl>
  14107. <a name="H264-options"></a>
  14108. <h4 class="subsection">16.30.5 H264 options<span class="pull-right"><a class="anchor hidden-xs" href="#H264-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-H264-options" aria-hidden="true">TOC</a></span></h4>
  14109. <p>These options are used by h264_qsv
  14110. </p>
  14111. <dl class="table">
  14112. <dt><samp class="option"><var class="var">extbrc</var></samp></dt>
  14113. <dd><p>Extended bitrate control.
  14114. </p>
  14115. </dd>
  14116. <dt><samp class="option"><var class="var">recovery_point_sei</var></samp></dt>
  14117. <dd><p>Set this flag to insert the recovery point SEI message at the beginning of every
  14118. intra refresh cycle.
  14119. </p>
  14120. </dd>
  14121. <dt><samp class="option"><var class="var">rdo</var></samp></dt>
  14122. <dd><p>Enable rate distortion optimization.
  14123. </p>
  14124. </dd>
  14125. <dt><samp class="option"><var class="var">max_frame_size</var></samp></dt>
  14126. <dd><p>Maximum encoded frame size in bytes.
  14127. </p>
  14128. </dd>
  14129. <dt><samp class="option"><var class="var">max_frame_size_i</var></samp></dt>
  14130. <dd><p>Maximum encoded frame size for I frames in bytes. If this value is set as larger
  14131. than zero, then for I frames the value set by max_frame_size is ignored.
  14132. </p>
  14133. </dd>
  14134. <dt><samp class="option"><var class="var">max_frame_size_p</var></samp></dt>
  14135. <dd><p>Maximum encoded frame size for P frames in bytes. If this value is set as larger
  14136. than zero, then for P frames the value set by max_frame_size is ignored.
  14137. </p>
  14138. </dd>
  14139. <dt><samp class="option"><var class="var">max_slice_size</var></samp></dt>
  14140. <dd><p>Maximum encoded slice size in bytes.
  14141. </p>
  14142. </dd>
  14143. <dt><samp class="option"><var class="var">bitrate_limit</var></samp></dt>
  14144. <dd><p>Toggle bitrate limitations.
  14145. Modifies bitrate to be in the range imposed by the QSV encoder. Setting this
  14146. flag off may lead to violation of HRD conformance. Mind that specifying bitrate
  14147. below the QSV encoder range might significantly affect quality. If on this
  14148. option takes effect in non CQP modes: if bitrate is not in the range imposed
  14149. by the QSV encoder, it will be changed to be in the range.
  14150. </p>
  14151. </dd>
  14152. <dt><samp class="option"><var class="var">mbbrc</var></samp></dt>
  14153. <dd><p>Setting this flag enables macroblock level bitrate control that generally
  14154. improves subjective visual quality. Enabling this flag may have negative impact
  14155. on performance and objective visual quality metric.
  14156. </p>
  14157. </dd>
  14158. <dt><samp class="option"><var class="var">low_delay_brc</var></samp></dt>
  14159. <dd><p>Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
  14160. more accurate bitrate control to minimize the variance of bitstream size frame
  14161. by frame. Value: -1-default 0-off 1-on
  14162. </p>
  14163. </dd>
  14164. <dt><samp class="option"><var class="var">adaptive_i</var></samp></dt>
  14165. <dd><p>This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  14166. to allow changing of frame type from P and B to I.
  14167. </p>
  14168. </dd>
  14169. <dt><samp class="option"><var class="var">adaptive_b</var></samp></dt>
  14170. <dd><p>This flag controls changing of frame type from B to P.
  14171. </p>
  14172. </dd>
  14173. <dt><samp class="option"><var class="var">p_strategy</var></samp></dt>
  14174. <dd><p>Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
  14175. </p>
  14176. </dd>
  14177. <dt><samp class="option"><var class="var">b_strategy</var></samp></dt>
  14178. <dd><p>This option controls usage of B frames as reference.
  14179. </p>
  14180. </dd>
  14181. <dt><samp class="option"><var class="var">dblk_idc</var></samp></dt>
  14182. <dd><p>This option disable deblocking. It has value in range 0~2.
  14183. </p>
  14184. </dd>
  14185. <dt><samp class="option"><var class="var">cavlc</var></samp></dt>
  14186. <dd><p>If set, CAVLC is used; if unset, CABAC is used for encoding.
  14187. </p>
  14188. </dd>
  14189. <dt><samp class="option"><var class="var">vcm</var></samp></dt>
  14190. <dd><p>Video conferencing mode, please see ratecontrol method.
  14191. </p>
  14192. </dd>
  14193. <dt><samp class="option"><var class="var">idr_interval</var></samp></dt>
  14194. <dd><p>Distance (in I-frames) between IDR frames.
  14195. </p>
  14196. </dd>
  14197. <dt><samp class="option"><var class="var">pic_timing_sei</var></samp></dt>
  14198. <dd><p>Insert picture timing SEI with pic_struct_syntax element.
  14199. </p>
  14200. </dd>
  14201. <dt><samp class="option"><var class="var">single_sei_nal_unit</var></samp></dt>
  14202. <dd><p>Put all the SEI messages into one NALU.
  14203. </p>
  14204. </dd>
  14205. <dt><samp class="option"><var class="var">max_dec_frame_buffering</var></samp></dt>
  14206. <dd><p>Maximum number of frames buffered in the DPB.
  14207. </p>
  14208. </dd>
  14209. <dt><samp class="option"><var class="var">look_ahead</var></samp></dt>
  14210. <dd><p>Use VBR algorithm with look ahead.
  14211. </p>
  14212. </dd>
  14213. <dt><samp class="option"><var class="var">look_ahead_depth</var></samp></dt>
  14214. <dd><p>Depth of look ahead in number frames.
  14215. </p>
  14216. </dd>
  14217. <dt><samp class="option"><var class="var">look_ahead_downsampling</var></samp></dt>
  14218. <dd><p>Downscaling factor for the frames saved for the lookahead analysis.
  14219. </p><dl class="table">
  14220. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14221. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  14222. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  14223. <dt>&lsquo;<samp class="samp">2x</samp>&rsquo;</dt>
  14224. <dt>&lsquo;<samp class="samp">4x</samp>&rsquo;</dt>
  14225. </dl>
  14226. </dd>
  14227. <dt><samp class="option"><var class="var">int_ref_type</var></samp></dt>
  14228. <dd><p>Specifies intra refresh type. The major goal of intra refresh is improvement of
  14229. error resilience without significant impact on encoded bitstream size caused by
  14230. I frames. The SDK encoder achieves this by encoding part of each frame in
  14231. refresh cycle using intra MBs. <var class="var">none</var> means no refresh. <var class="var">vertical</var> means
  14232. vertical refresh, by column of MBs. <var class="var">horizontal</var> means horizontal refresh,
  14233. by rows of MBs. <var class="var">slice</var> means horizontal refresh by slices without
  14234. overlapping. In case of <var class="var">slice</var>, in_ref_cycle_size is ignored. To enable
  14235. intra refresh, B frame should be set to 0.
  14236. </p>
  14237. </dd>
  14238. <dt><samp class="option"><var class="var">int_ref_cycle_size</var></samp></dt>
  14239. <dd><p>Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
  14240. invalid values.
  14241. </p>
  14242. </dd>
  14243. <dt><samp class="option"><var class="var">int_ref_qp_delta</var></samp></dt>
  14244. <dd><p>Specifies QP difference for inserted intra MBs. This is signed value in
  14245. [-51, 51] range if target encoding bit-depth for luma samples is 8 and this
  14246. range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
  14247. </p>
  14248. </dd>
  14249. <dt><samp class="option"><var class="var">int_ref_cycle_dist</var></samp></dt>
  14250. <dd><p>Distance between the beginnings of the intra-refresh cycles in frames.
  14251. </p>
  14252. </dd>
  14253. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  14254. <dd><dl class="table">
  14255. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14256. <dt>&lsquo;<samp class="samp">baseline</samp>&rsquo;</dt>
  14257. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  14258. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  14259. </dl>
  14260. </dd>
  14261. <dt><samp class="option"><var class="var">a53cc</var></samp></dt>
  14262. <dd><p>Use A53 Closed Captions (if available).
  14263. </p>
  14264. </dd>
  14265. <dt><samp class="option"><var class="var">aud</var></samp></dt>
  14266. <dd><p>Insert the Access Unit Delimiter NAL.
  14267. </p>
  14268. </dd>
  14269. <dt><samp class="option"><var class="var">mfmode</var></samp></dt>
  14270. <dd><p>Multi-Frame Mode.
  14271. </p><dl class="table">
  14272. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  14273. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  14274. </dl>
  14275. </dd>
  14276. <dt><samp class="option"><var class="var">repeat_pps</var></samp></dt>
  14277. <dd><p>Repeat pps for every frame.
  14278. </p>
  14279. </dd>
  14280. <dt><samp class="option"><var class="var">max_qp_i</var></samp></dt>
  14281. <dd><p>Maximum video quantizer scale for I frame.
  14282. </p>
  14283. </dd>
  14284. <dt><samp class="option"><var class="var">min_qp_i</var></samp></dt>
  14285. <dd><p>Minimum video quantizer scale for I frame.
  14286. </p>
  14287. </dd>
  14288. <dt><samp class="option"><var class="var">max_qp_p</var></samp></dt>
  14289. <dd><p>Maximum video quantizer scale for P frame.
  14290. </p>
  14291. </dd>
  14292. <dt><samp class="option"><var class="var">min_qp_p</var></samp></dt>
  14293. <dd><p>Minimum video quantizer scale for P frame.
  14294. </p>
  14295. </dd>
  14296. <dt><samp class="option"><var class="var">max_qp_b</var></samp></dt>
  14297. <dd><p>Maximum video quantizer scale for B frame.
  14298. </p>
  14299. </dd>
  14300. <dt><samp class="option"><var class="var">min_qp_b</var></samp></dt>
  14301. <dd><p>Minimum video quantizer scale for B frame.
  14302. </p>
  14303. </dd>
  14304. <dt><samp class="option"><var class="var">scenario</var></samp></dt>
  14305. <dd><p>Provides a hint to encoder about the scenario for the encoding session.
  14306. </p><dl class="table">
  14307. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14308. <dt>&lsquo;<samp class="samp">displayremoting</samp>&rsquo;</dt>
  14309. <dt>&lsquo;<samp class="samp">videoconference</samp>&rsquo;</dt>
  14310. <dt>&lsquo;<samp class="samp">archive</samp>&rsquo;</dt>
  14311. <dt>&lsquo;<samp class="samp">livestreaming</samp>&rsquo;</dt>
  14312. <dt>&lsquo;<samp class="samp">cameracapture</samp>&rsquo;</dt>
  14313. <dt>&lsquo;<samp class="samp">videosurveillance</samp>&rsquo;</dt>
  14314. <dt>&lsquo;<samp class="samp">gamestreaming</samp>&rsquo;</dt>
  14315. <dt>&lsquo;<samp class="samp">remotegaming</samp>&rsquo;</dt>
  14316. </dl>
  14317. </dd>
  14318. <dt><samp class="option"><var class="var">avbr_accuracy</var></samp></dt>
  14319. <dd><p>Accuracy of the AVBR ratecontrol (unit of tenth of percent).
  14320. </p>
  14321. </dd>
  14322. <dt><samp class="option"><var class="var">avbr_convergence</var></samp></dt>
  14323. <dd><p>Convergence of the AVBR ratecontrol (unit of 100 frames)
  14324. </p>
  14325. <p>The parameters <var class="var">avbr_accuracy</var> and <var class="var">avbr_convergence</var> are for the
  14326. average variable bitrate control (AVBR) algorithm.
  14327. The algorithm focuses on overall encoding quality while meeting the specified
  14328. bitrate, <var class="var">target_bitrate</var>, within the accuracy range <var class="var">avbr_accuracy</var>,
  14329. after a <var class="var">avbr_Convergence</var> period. This method does not follow HRD and the
  14330. instant bitrate is not capped or padded.
  14331. </p>
  14332. </dd>
  14333. <dt><samp class="option"><var class="var">skip_frame</var></samp></dt>
  14334. <dd><p>Use per-frame metadata &quot;qsv_skip_frame&quot; to skip frame when encoding. This option
  14335. defines the usage of this metadata.
  14336. </p><dl class="table">
  14337. <dt>&lsquo;<samp class="samp">no_skip</samp>&rsquo;</dt>
  14338. <dd><p>Frame skipping is disabled.
  14339. </p></dd>
  14340. <dt>&lsquo;<samp class="samp">insert_dummy</samp>&rsquo;</dt>
  14341. <dd><p>Encoder inserts into bitstream frame where all macroblocks are encoded as
  14342. skipped.
  14343. </p></dd>
  14344. <dt>&lsquo;<samp class="samp">insert_nothing</samp>&rsquo;</dt>
  14345. <dd><p>Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped
  14346. frames are still used in brc. For example, gop still include skipped frames, and
  14347. the frames after skipped frames will be larger in size.
  14348. </p></dd>
  14349. <dt>&lsquo;<samp class="samp">brc_only</samp>&rsquo;</dt>
  14350. <dd><p>skip_frame metadata indicates the number of missed frames before the current
  14351. frame.
  14352. </p></dd>
  14353. </dl>
  14354. </dd>
  14355. </dl>
  14356. <a name="HEVC-Options-1"></a>
  14357. <h4 class="subsection">16.30.6 HEVC Options<span class="pull-right"><a class="anchor hidden-xs" href="#HEVC-Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-HEVC-Options-1" aria-hidden="true">TOC</a></span></h4>
  14358. <p>These options are used by hevc_qsv
  14359. </p>
  14360. <dl class="table">
  14361. <dt><samp class="option"><var class="var">extbrc</var></samp></dt>
  14362. <dd><p>Extended bitrate control.
  14363. </p>
  14364. </dd>
  14365. <dt><samp class="option"><var class="var">recovery_point_sei</var></samp></dt>
  14366. <dd><p>Set this flag to insert the recovery point SEI message at the beginning of every
  14367. intra refresh cycle.
  14368. </p>
  14369. </dd>
  14370. <dt><samp class="option"><var class="var">rdo</var></samp></dt>
  14371. <dd><p>Enable rate distortion optimization.
  14372. </p>
  14373. </dd>
  14374. <dt><samp class="option"><var class="var">max_frame_size</var></samp></dt>
  14375. <dd><p>Maximum encoded frame size in bytes.
  14376. </p>
  14377. </dd>
  14378. <dt><samp class="option"><var class="var">max_frame_size_i</var></samp></dt>
  14379. <dd><p>Maximum encoded frame size for I frames in bytes. If this value is set as larger
  14380. than zero, then for I frames the value set by max_frame_size is ignored.
  14381. </p>
  14382. </dd>
  14383. <dt><samp class="option"><var class="var">max_frame_size_p</var></samp></dt>
  14384. <dd><p>Maximum encoded frame size for P frames in bytes. If this value is set as larger
  14385. than zero, then for P frames the value set by max_frame_size is ignored.
  14386. </p>
  14387. </dd>
  14388. <dt><samp class="option"><var class="var">max_slice_size</var></samp></dt>
  14389. <dd><p>Maximum encoded slice size in bytes.
  14390. </p>
  14391. </dd>
  14392. <dt><samp class="option"><var class="var">mbbrc</var></samp></dt>
  14393. <dd><p>Setting this flag enables macroblock level bitrate control that generally
  14394. improves subjective visual quality. Enabling this flag may have negative impact
  14395. on performance and objective visual quality metric.
  14396. </p>
  14397. </dd>
  14398. <dt><samp class="option"><var class="var">low_delay_brc</var></samp></dt>
  14399. <dd><p>Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
  14400. more accurate bitrate control to minimize the variance of bitstream size frame
  14401. by frame. Value: -1-default 0-off 1-on
  14402. </p>
  14403. </dd>
  14404. <dt><samp class="option"><var class="var">adaptive_i</var></samp></dt>
  14405. <dd><p>This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  14406. to allow changing of frame type from P and B to I.
  14407. </p>
  14408. </dd>
  14409. <dt><samp class="option"><var class="var">adaptive_b</var></samp></dt>
  14410. <dd><p>This flag controls changing of frame type from B to P.
  14411. </p>
  14412. </dd>
  14413. <dt><samp class="option"><var class="var">p_strategy</var></samp></dt>
  14414. <dd><p>Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
  14415. </p>
  14416. </dd>
  14417. <dt><samp class="option"><var class="var">b_strategy</var></samp></dt>
  14418. <dd><p>This option controls usage of B frames as reference.
  14419. </p>
  14420. </dd>
  14421. <dt><samp class="option"><var class="var">dblk_idc</var></samp></dt>
  14422. <dd><p>This option disable deblocking. It has value in range 0~2.
  14423. </p>
  14424. </dd>
  14425. <dt><samp class="option"><var class="var">idr_interval</var></samp></dt>
  14426. <dd><p>Distance (in I-frames) between IDR frames.
  14427. </p><dl class="table">
  14428. <dt>&lsquo;<samp class="samp">begin_only</samp>&rsquo;</dt>
  14429. <dd><p>Output an IDR-frame only at the beginning of the stream.
  14430. </p></dd>
  14431. </dl>
  14432. </dd>
  14433. <dt><samp class="option"><var class="var">load_plugin</var></samp></dt>
  14434. <dd><p>A user plugin to load in an internal session.
  14435. </p><dl class="table">
  14436. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  14437. <dt>&lsquo;<samp class="samp">hevc_sw</samp>&rsquo;</dt>
  14438. <dt>&lsquo;<samp class="samp">hevc_hw</samp>&rsquo;</dt>
  14439. </dl>
  14440. </dd>
  14441. <dt><samp class="option"><var class="var">load_plugins</var></samp></dt>
  14442. <dd><p>A :-separate list of hexadecimal plugin UIDs to load in
  14443. an internal session.
  14444. </p>
  14445. </dd>
  14446. <dt><samp class="option"><var class="var">look_ahead_depth</var></samp></dt>
  14447. <dd><p>Depth of look ahead in number frames, available when extbrc option is enabled.
  14448. </p>
  14449. </dd>
  14450. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  14451. <dd><p>Set the encoding profile (scc requires libmfx &gt;= 1.32).
  14452. </p>
  14453. <dl class="table">
  14454. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14455. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  14456. <dt>&lsquo;<samp class="samp">main10</samp>&rsquo;</dt>
  14457. <dt>&lsquo;<samp class="samp">mainsp</samp>&rsquo;</dt>
  14458. <dt>&lsquo;<samp class="samp">rext</samp>&rsquo;</dt>
  14459. <dt>&lsquo;<samp class="samp">scc</samp>&rsquo;</dt>
  14460. </dl>
  14461. </dd>
  14462. <dt><samp class="option"><var class="var">tier</var></samp></dt>
  14463. <dd><p>Set the encoding tier (only level &gt;= 4 can support high tier).
  14464. This option only takes effect when the level option is specified.
  14465. </p>
  14466. <dl class="table">
  14467. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  14468. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  14469. </dl>
  14470. </dd>
  14471. <dt><samp class="option"><var class="var">gpb</var></samp></dt>
  14472. <dd><p>1: GPB (generalized P/B frame)
  14473. </p>
  14474. <p>0: regular P frame.
  14475. </p>
  14476. </dd>
  14477. <dt><samp class="option"><var class="var">tile_cols</var></samp></dt>
  14478. <dd><p>Number of columns for tiled encoding.
  14479. </p>
  14480. </dd>
  14481. <dt><samp class="option"><var class="var">tile_rows</var></samp></dt>
  14482. <dd><p>Number of rows for tiled encoding.
  14483. </p>
  14484. </dd>
  14485. <dt><samp class="option"><var class="var">aud</var></samp></dt>
  14486. <dd><p>Insert the Access Unit Delimiter NAL.
  14487. </p>
  14488. </dd>
  14489. <dt><samp class="option"><var class="var">pic_timing_sei</var></samp></dt>
  14490. <dd><p>Insert picture timing SEI with pic_struct_syntax element.
  14491. </p>
  14492. </dd>
  14493. <dt><samp class="option"><var class="var">transform_skip</var></samp></dt>
  14494. <dd><p>Turn this option ON to enable transformskip. It is supported on platform equal
  14495. or newer than ICL.
  14496. </p>
  14497. </dd>
  14498. <dt><samp class="option"><var class="var">int_ref_type</var></samp></dt>
  14499. <dd><p>Specifies intra refresh type. The major goal of intra refresh is improvement of
  14500. error resilience without significant impact on encoded bitstream size caused by
  14501. I frames. The SDK encoder achieves this by encoding part of each frame in
  14502. refresh cycle using intra MBs. <var class="var">none</var> means no refresh. <var class="var">vertical</var> means
  14503. vertical refresh, by column of MBs. <var class="var">horizontal</var> means horizontal refresh,
  14504. by rows of MBs. <var class="var">slice</var> means horizontal refresh by slices without
  14505. overlapping. In case of <var class="var">slice</var>, in_ref_cycle_size is ignored. To enable
  14506. intra refresh, B frame should be set to 0.
  14507. </p>
  14508. </dd>
  14509. <dt><samp class="option"><var class="var">int_ref_cycle_size</var></samp></dt>
  14510. <dd><p>Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
  14511. invalid values.
  14512. </p>
  14513. </dd>
  14514. <dt><samp class="option"><var class="var">int_ref_qp_delta</var></samp></dt>
  14515. <dd><p>Specifies QP difference for inserted intra MBs. This is signed value in
  14516. [-51, 51] range if target encoding bit-depth for luma samples is 8 and this
  14517. range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
  14518. </p>
  14519. </dd>
  14520. <dt><samp class="option"><var class="var">int_ref_cycle_dist</var></samp></dt>
  14521. <dd><p>Distance between the beginnings of the intra-refresh cycles in frames.
  14522. </p>
  14523. </dd>
  14524. <dt><samp class="option"><var class="var">max_qp_i</var></samp></dt>
  14525. <dd><p>Maximum video quantizer scale for I frame.
  14526. </p>
  14527. </dd>
  14528. <dt><samp class="option"><var class="var">min_qp_i</var></samp></dt>
  14529. <dd><p>Minimum video quantizer scale for I frame.
  14530. </p>
  14531. </dd>
  14532. <dt><samp class="option"><var class="var">max_qp_p</var></samp></dt>
  14533. <dd><p>Maximum video quantizer scale for P frame.
  14534. </p>
  14535. </dd>
  14536. <dt><samp class="option"><var class="var">min_qp_p</var></samp></dt>
  14537. <dd><p>Minimum video quantizer scale for P frame.
  14538. </p>
  14539. </dd>
  14540. <dt><samp class="option"><var class="var">max_qp_b</var></samp></dt>
  14541. <dd><p>Maximum video quantizer scale for B frame.
  14542. </p>
  14543. </dd>
  14544. <dt><samp class="option"><var class="var">min_qp_b</var></samp></dt>
  14545. <dd><p>Minimum video quantizer scale for B frame.
  14546. </p>
  14547. </dd>
  14548. <dt><samp class="option"><var class="var">scenario</var></samp></dt>
  14549. <dd><p>Provides a hint to encoder about the scenario for the encoding session.
  14550. </p><dl class="table">
  14551. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14552. <dt>&lsquo;<samp class="samp">displayremoting</samp>&rsquo;</dt>
  14553. <dt>&lsquo;<samp class="samp">videoconference</samp>&rsquo;</dt>
  14554. <dt>&lsquo;<samp class="samp">archive</samp>&rsquo;</dt>
  14555. <dt>&lsquo;<samp class="samp">livestreaming</samp>&rsquo;</dt>
  14556. <dt>&lsquo;<samp class="samp">cameracapture</samp>&rsquo;</dt>
  14557. <dt>&lsquo;<samp class="samp">videosurveillance</samp>&rsquo;</dt>
  14558. <dt>&lsquo;<samp class="samp">gamestreaming</samp>&rsquo;</dt>
  14559. <dt>&lsquo;<samp class="samp">remotegaming</samp>&rsquo;</dt>
  14560. </dl>
  14561. </dd>
  14562. <dt><samp class="option"><var class="var">avbr_accuracy</var></samp></dt>
  14563. <dd><p>Accuracy of the AVBR ratecontrol (unit of tenth of percent).
  14564. </p>
  14565. </dd>
  14566. <dt><samp class="option"><var class="var">avbr_convergence</var></samp></dt>
  14567. <dd><p>Convergence of the AVBR ratecontrol (unit of 100 frames)
  14568. </p>
  14569. <p>The parameters <var class="var">avbr_accuracy</var> and <var class="var">avbr_convergence</var> are for the
  14570. average variable bitrate control (AVBR) algorithm.
  14571. The algorithm focuses on overall encoding quality while meeting the specified
  14572. bitrate, <var class="var">target_bitrate</var>, within the accuracy range <var class="var">avbr_accuracy</var>,
  14573. after a <var class="var">avbr_Convergence</var> period. This method does not follow HRD and the
  14574. instant bitrate is not capped or padded.
  14575. </p>
  14576. </dd>
  14577. <dt><samp class="option"><var class="var">skip_frame</var></samp></dt>
  14578. <dd><p>Use per-frame metadata &quot;qsv_skip_frame&quot; to skip frame when encoding. This option
  14579. defines the usage of this metadata.
  14580. </p><dl class="table">
  14581. <dt>&lsquo;<samp class="samp">no_skip</samp>&rsquo;</dt>
  14582. <dd><p>Frame skipping is disabled.
  14583. </p></dd>
  14584. <dt>&lsquo;<samp class="samp">insert_dummy</samp>&rsquo;</dt>
  14585. <dd><p>Encoder inserts into bitstream frame where all macroblocks are encoded as
  14586. skipped.
  14587. </p></dd>
  14588. <dt>&lsquo;<samp class="samp">insert_nothing</samp>&rsquo;</dt>
  14589. <dd><p>Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped
  14590. frames are still used in brc. For example, gop still include skipped frames, and
  14591. the frames after skipped frames will be larger in size.
  14592. </p></dd>
  14593. <dt>&lsquo;<samp class="samp">brc_only</samp>&rsquo;</dt>
  14594. <dd><p>skip_frame metadata indicates the number of missed frames before the current
  14595. frame.
  14596. </p></dd>
  14597. </dl>
  14598. </dd>
  14599. </dl>
  14600. <a name="MPEG2-Options"></a>
  14601. <h4 class="subsection">16.30.7 MPEG2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#MPEG2-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-MPEG2-Options" aria-hidden="true">TOC</a></span></h4>
  14602. <p>These options are used by mpeg2_qsv
  14603. </p><dl class="table">
  14604. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  14605. <dd><dl class="table">
  14606. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14607. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  14608. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  14609. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  14610. </dl>
  14611. </dd>
  14612. </dl>
  14613. <a name="VP9-Options"></a>
  14614. <h4 class="subsection">16.30.8 VP9 Options<span class="pull-right"><a class="anchor hidden-xs" href="#VP9-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VP9-Options" aria-hidden="true">TOC</a></span></h4>
  14615. <p>These options are used by vp9_qsv
  14616. </p><dl class="table">
  14617. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  14618. <dd><dl class="table">
  14619. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14620. <dt>&lsquo;<samp class="samp">profile0</samp>&rsquo;</dt>
  14621. <dt>&lsquo;<samp class="samp">profile1</samp>&rsquo;</dt>
  14622. <dt>&lsquo;<samp class="samp">profile2</samp>&rsquo;</dt>
  14623. <dt>&lsquo;<samp class="samp">profile3</samp>&rsquo;</dt>
  14624. </dl>
  14625. </dd>
  14626. <dt><samp class="option"><var class="var">tile_cols</var></samp></dt>
  14627. <dd><p>Number of columns for tiled encoding (requires libmfx &gt;= 1.29).
  14628. </p>
  14629. </dd>
  14630. <dt><samp class="option"><var class="var">tile_rows</var></samp></dt>
  14631. <dd><p>Number of rows for tiled encoding (requires libmfx &gt;= 1.29).
  14632. </p></dd>
  14633. </dl>
  14634. <a name="AV1-Options"></a>
  14635. <h4 class="subsection">16.30.9 AV1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#AV1-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AV1-Options" aria-hidden="true">TOC</a></span></h4>
  14636. <p>These options are used by av1_qsv (requires libvpl).
  14637. </p><dl class="table">
  14638. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  14639. <dd><dl class="table">
  14640. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14641. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  14642. </dl>
  14643. </dd>
  14644. <dt><samp class="option"><var class="var">tile_cols</var></samp></dt>
  14645. <dd><p>Number of columns for tiled encoding.
  14646. </p>
  14647. </dd>
  14648. <dt><samp class="option"><var class="var">tile_rows</var></samp></dt>
  14649. <dd><p>Number of rows for tiled encoding.
  14650. </p>
  14651. </dd>
  14652. <dt><samp class="option"><var class="var">adaptive_i</var></samp></dt>
  14653. <dd><p>This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  14654. to allow changing of frame type from P and B to I.
  14655. </p>
  14656. </dd>
  14657. <dt><samp class="option"><var class="var">adaptive_b</var></samp></dt>
  14658. <dd><p>This flag controls changing of frame type from B to P.
  14659. </p>
  14660. </dd>
  14661. <dt><samp class="option"><var class="var">b_strategy</var></samp></dt>
  14662. <dd><p>This option controls usage of B frames as reference.
  14663. </p>
  14664. </dd>
  14665. <dt><samp class="option"><var class="var">extbrc</var></samp></dt>
  14666. <dd><p>Extended bitrate control.
  14667. </p>
  14668. </dd>
  14669. <dt><samp class="option"><var class="var">look_ahead_depth</var></samp></dt>
  14670. <dd><p>Depth of look ahead in number frames, available when extbrc option is enabled.
  14671. </p>
  14672. </dd>
  14673. <dt><samp class="option"><var class="var">low_delay_brc</var></samp></dt>
  14674. <dd><p>Setting this flag turns on or off LowDelayBRC feature in qsv plugin, which provides
  14675. more accurate bitrate control to minimize the variance of bitstream size frame
  14676. by frame. Value: -1-default 0-off 1-on
  14677. </p>
  14678. </dd>
  14679. <dt><samp class="option"><var class="var">max_frame_size</var></samp></dt>
  14680. <dd><p>Set the allowed max size in bytes for each frame. If the frame size exceeds
  14681. the limitation, encoder will adjust the QP value to control the frame size.
  14682. Invalid in CQP rate control mode.
  14683. </p>
  14684. </dd>
  14685. <dt><samp class="option"><var class="var">max_frame_size_i</var></samp></dt>
  14686. <dd><p>Maximum encoded frame size for I frames in bytes. If this value is set as larger
  14687. than zero, then for I frames the value set by max_frame_size is ignored.
  14688. </p>
  14689. </dd>
  14690. <dt><samp class="option"><var class="var">max_frame_size_p</var></samp></dt>
  14691. <dd><p>Maximum encoded frame size for P frames in bytes. If this value is set as larger
  14692. than zero, then for P frames the value set by max_frame_size is ignored.
  14693. </p></dd>
  14694. </dl>
  14695. <a name="snow"></a>
  14696. <h3 class="section">16.31 snow<span class="pull-right"><a class="anchor hidden-xs" href="#snow" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-snow" aria-hidden="true">TOC</a></span></h3>
  14697. <a name="Options-51"></a>
  14698. <h4 class="subsection">16.31.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-51" aria-hidden="true">TOC</a></span></h4>
  14699. <dl class="table">
  14700. <dt><samp class="option">iterative_dia_size</samp></dt>
  14701. <dd><p>dia size for the iterative motion estimation
  14702. </p></dd>
  14703. </dl>
  14704. <a name="VAAPI-encoders"></a>
  14705. <h3 class="section">16.32 VAAPI encoders<span class="pull-right"><a class="anchor hidden-xs" href="#VAAPI-encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VAAPI-encoders" aria-hidden="true">TOC</a></span></h3>
  14706. <p>Wrappers for hardware encoders accessible via VAAPI.
  14707. </p>
  14708. <p>These encoders only accept input in VAAPI hardware surfaces. If you have input
  14709. in software frames, use the <samp class="option">hwupload</samp> filter to upload them to the GPU.
  14710. </p>
  14711. <p>The following standard libavcodec options are used:
  14712. </p><ul class="itemize mark-bullet">
  14713. <li><samp class="option">g</samp> / <samp class="option">gop_size</samp>
  14714. </li><li><samp class="option">bf</samp> / <samp class="option">max_b_frames</samp>
  14715. </li><li><samp class="option">profile</samp>
  14716. <p>If not set, this will be determined automatically from the format of the input
  14717. frames and the profiles supported by the driver.
  14718. </p></li><li><samp class="option">level</samp>
  14719. </li><li><samp class="option">b</samp> / <samp class="option">bit_rate</samp>
  14720. </li><li><samp class="option">maxrate</samp> / <samp class="option">rc_max_rate</samp>
  14721. </li><li><samp class="option">bufsize</samp> / <samp class="option">rc_buffer_size</samp>
  14722. </li><li><samp class="option">rc_init_occupancy</samp> / <samp class="option">rc_initial_buffer_occupancy</samp>
  14723. </li><li><samp class="option">compression_level</samp>
  14724. <p>Speed / quality tradeoff: higher values are faster / worse quality.
  14725. </p></li><li><samp class="option">q</samp> / <samp class="option">global_quality</samp>
  14726. <p>Size / quality tradeoff: higher values are smaller / worse quality.
  14727. </p></li><li><samp class="option">qmin</samp>
  14728. </li><li><samp class="option">qmax</samp>
  14729. </li><li><samp class="option">i_qfactor</samp> / <samp class="option">i_quant_factor</samp>
  14730. </li><li><samp class="option">i_qoffset</samp> / <samp class="option">i_quant_offset</samp>
  14731. </li><li><samp class="option">b_qfactor</samp> / <samp class="option">b_quant_factor</samp>
  14732. </li><li><samp class="option">b_qoffset</samp> / <samp class="option">b_quant_offset</samp>
  14733. </li><li><samp class="option">slices</samp>
  14734. </li></ul>
  14735. <p>All encoders support the following options:
  14736. </p><dl class="table">
  14737. <dt><samp class="option">low_power</samp></dt>
  14738. <dd><p>Some drivers/platforms offer a second encoder for some codecs intended to use
  14739. less power than the default encoder; setting this option will attempt to use
  14740. that encoder. Note that it may support a reduced feature set, so some other
  14741. options may not be available in this mode.
  14742. </p>
  14743. </dd>
  14744. <dt><samp class="option">idr_interval</samp></dt>
  14745. <dd><p>Set the number of normal intra frames between full-refresh (IDR) frames in
  14746. open-GOP mode. The intra frames are still IRAPs, but will not include global
  14747. headers and may have non-decodable leading pictures.
  14748. </p>
  14749. </dd>
  14750. <dt><samp class="option">b_depth</samp></dt>
  14751. <dd><p>Set the B-frame reference depth. When set to one (the default), all B-frames
  14752. will refer only to P- or I-frames. When set to greater values multiple layers
  14753. of B-frames will be present, frames in each layer only referring to frames in
  14754. higher layers.
  14755. </p>
  14756. </dd>
  14757. <dt><samp class="option">async_depth</samp></dt>
  14758. <dd><p>Maximum processing parallelism. Increase this to improve single channel
  14759. performance. This option doesn&rsquo;t work if driver doesn&rsquo;t implement vaSyncBuffer
  14760. function. Please make sure there are enough hw_frames allocated if a large
  14761. number of async_depth is used.
  14762. </p>
  14763. </dd>
  14764. <dt><samp class="option">max_frame_size</samp></dt>
  14765. <dd><p>Set the allowed max size in bytes for each frame. If the frame size exceeds
  14766. the limitation, encoder will adjust the QP value to control the frame size.
  14767. Invalid in CQP rate control mode.
  14768. </p>
  14769. </dd>
  14770. <dt><samp class="option">rc_mode</samp></dt>
  14771. <dd><p>Set the rate control mode to use. A given driver may only support a subset of
  14772. modes.
  14773. </p>
  14774. <p>Possible modes:
  14775. </p><dl class="table">
  14776. <dt><samp class="option">auto</samp></dt>
  14777. <dd><p>Choose the mode automatically based on driver support and the other options.
  14778. This is the default.
  14779. </p></dd>
  14780. <dt><samp class="option">CQP</samp></dt>
  14781. <dd><p>Constant-quality.
  14782. </p></dd>
  14783. <dt><samp class="option">CBR</samp></dt>
  14784. <dd><p>Constant-bitrate.
  14785. </p></dd>
  14786. <dt><samp class="option">VBR</samp></dt>
  14787. <dd><p>Variable-bitrate.
  14788. </p></dd>
  14789. <dt><samp class="option">ICQ</samp></dt>
  14790. <dd><p>Intelligent constant-quality.
  14791. </p></dd>
  14792. <dt><samp class="option">QVBR</samp></dt>
  14793. <dd><p>Quality-defined variable-bitrate.
  14794. </p></dd>
  14795. <dt><samp class="option">AVBR</samp></dt>
  14796. <dd><p>Average variable bitrate.
  14797. </p></dd>
  14798. </dl>
  14799. </dd>
  14800. <dt><samp class="option">blbrc</samp></dt>
  14801. <dd><p>Enable block level rate control, which assigns different bitrate block by block.
  14802. Invalid for CQP mode.
  14803. </p>
  14804. </dd>
  14805. </dl>
  14806. <p>Each encoder also has its own specific options:
  14807. </p><dl class="table">
  14808. <dt><samp class="option">av1_vaapi</samp></dt>
  14809. <dd><p><samp class="option">profile</samp> sets the value of <em class="emph">seq_profile</em>.
  14810. <samp class="option">tier</samp> sets the value of <em class="emph">seq_tier</em>.
  14811. <samp class="option">level</samp> sets the value of <em class="emph">seq_level_idx</em>.
  14812. </p>
  14813. <dl class="table">
  14814. <dt><samp class="option">tiles</samp></dt>
  14815. <dd><p>Set the number of tiles to encode the input video with, as columns x rows.
  14816. (default is auto, which means use minimal tile column/row number).
  14817. </p></dd>
  14818. <dt><samp class="option">tile_groups</samp></dt>
  14819. <dd><p>Set tile groups number. All the tiles will be distributed as evenly as possible to
  14820. each tile group. (default is 1).
  14821. </p></dd>
  14822. </dl>
  14823. </dd>
  14824. <dt><samp class="option">h264_vaapi</samp></dt>
  14825. <dd><p><samp class="option">profile</samp> sets the value of <em class="emph">profile_idc</em> and the <em class="emph">constraint_set*_flag</em>s.
  14826. <samp class="option">level</samp> sets the value of <em class="emph">level_idc</em>.
  14827. </p>
  14828. <dl class="table">
  14829. <dt><samp class="option">coder</samp></dt>
  14830. <dd><p>Set entropy encoder (default is <em class="emph">cabac</em>). Possible values:
  14831. </p>
  14832. <dl class="table">
  14833. <dt>&lsquo;<samp class="samp">ac</samp>&rsquo;</dt>
  14834. <dt>&lsquo;<samp class="samp">cabac</samp>&rsquo;</dt>
  14835. <dd><p>Use CABAC.
  14836. </p>
  14837. </dd>
  14838. <dt>&lsquo;<samp class="samp">vlc</samp>&rsquo;</dt>
  14839. <dt>&lsquo;<samp class="samp">cavlc</samp>&rsquo;</dt>
  14840. <dd><p>Use CAVLC.
  14841. </p></dd>
  14842. </dl>
  14843. </dd>
  14844. <dt><samp class="option">aud</samp></dt>
  14845. <dd><p>Include access unit delimiters in the stream (not included by default).
  14846. </p>
  14847. </dd>
  14848. <dt><samp class="option">sei</samp></dt>
  14849. <dd><p>Set SEI message types to include.
  14850. Some combination of the following values:
  14851. </p><dl class="table">
  14852. <dt>&lsquo;<samp class="samp">identifier</samp>&rsquo;</dt>
  14853. <dd><p>Include a <em class="emph">user_data_unregistered</em> message containing information about
  14854. the encoder.
  14855. </p></dd>
  14856. <dt>&lsquo;<samp class="samp">timing</samp>&rsquo;</dt>
  14857. <dd><p>Include picture timing parameters (<em class="emph">buffering_period</em> and
  14858. <em class="emph">pic_timing</em> messages).
  14859. </p></dd>
  14860. <dt>&lsquo;<samp class="samp">recovery_point</samp>&rsquo;</dt>
  14861. <dd><p>Include recovery points where appropriate (<em class="emph">recovery_point</em> messages).
  14862. </p></dd>
  14863. </dl>
  14864. </dd>
  14865. </dl>
  14866. </dd>
  14867. <dt><samp class="option">hevc_vaapi</samp></dt>
  14868. <dd><p><samp class="option">profile</samp> and <samp class="option">level</samp> set the values of
  14869. <em class="emph">general_profile_idc</em> and <em class="emph">general_level_idc</em> respectively.
  14870. </p>
  14871. <dl class="table">
  14872. <dt><samp class="option">aud</samp></dt>
  14873. <dd><p>Include access unit delimiters in the stream (not included by default).
  14874. </p>
  14875. </dd>
  14876. <dt><samp class="option">tier</samp></dt>
  14877. <dd><p>Set <em class="emph">general_tier_flag</em>. This may affect the level chosen for the stream
  14878. if it is not explicitly specified.
  14879. </p>
  14880. </dd>
  14881. <dt><samp class="option">sei</samp></dt>
  14882. <dd><p>Set SEI message types to include.
  14883. Some combination of the following values:
  14884. </p><dl class="table">
  14885. <dt>&lsquo;<samp class="samp">hdr</samp>&rsquo;</dt>
  14886. <dd><p>Include HDR metadata if the input frames have it
  14887. (<em class="emph">mastering_display_colour_volume</em> and <em class="emph">content_light_level</em>
  14888. messages).
  14889. </p></dd>
  14890. </dl>
  14891. </dd>
  14892. <dt><samp class="option">tiles</samp></dt>
  14893. <dd><p>Set the number of tiles to encode the input video with, as columns x rows.
  14894. Larger numbers allow greater parallelism in both encoding and decoding, but
  14895. may decrease coding efficiency.
  14896. </p>
  14897. </dd>
  14898. </dl>
  14899. </dd>
  14900. <dt><samp class="option">mjpeg_vaapi</samp></dt>
  14901. <dd><p>Only baseline DCT encoding is supported. The encoder always uses the standard
  14902. quantisation and huffman tables - <samp class="option">global_quality</samp> scales the standard
  14903. quantisation table (range 1-100).
  14904. </p>
  14905. <p>For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
  14906. supported, and will create an RGB JPEG.
  14907. </p>
  14908. <dl class="table">
  14909. <dt><samp class="option">jfif</samp></dt>
  14910. <dd><p>Include JFIF header in each frame (not included by default).
  14911. </p></dd>
  14912. <dt><samp class="option">huffman</samp></dt>
  14913. <dd><p>Include standard huffman tables (on by default). Turning this off will save
  14914. a few hundred bytes in each output frame, but may lose compatibility with some
  14915. JPEG decoders which don&rsquo;t fully handle MJPEG.
  14916. </p></dd>
  14917. </dl>
  14918. </dd>
  14919. <dt><samp class="option">mpeg2_vaapi</samp></dt>
  14920. <dd><p><samp class="option">profile</samp> and <samp class="option">level</samp> set the value of <em class="emph">profile_and_level_indication</em>.
  14921. </p>
  14922. </dd>
  14923. <dt><samp class="option">vp8_vaapi</samp></dt>
  14924. <dd><p>B-frames are not supported.
  14925. </p>
  14926. <p><samp class="option">global_quality</samp> sets the <em class="emph">q_idx</em> used for non-key frames (range 0-127).
  14927. </p>
  14928. <dl class="table">
  14929. <dt><samp class="option">loop_filter_level</samp></dt>
  14930. <dt><samp class="option">loop_filter_sharpness</samp></dt>
  14931. <dd><p>Manually set the loop filter parameters.
  14932. </p></dd>
  14933. </dl>
  14934. </dd>
  14935. <dt><samp class="option">vp9_vaapi</samp></dt>
  14936. <dd><p><samp class="option">global_quality</samp> sets the <em class="emph">q_idx</em> used for P-frames (range 0-255).
  14937. </p>
  14938. <dl class="table">
  14939. <dt><samp class="option">loop_filter_level</samp></dt>
  14940. <dt><samp class="option">loop_filter_sharpness</samp></dt>
  14941. <dd><p>Manually set the loop filter parameters.
  14942. </p></dd>
  14943. </dl>
  14944. <p>B-frames are supported, but the output stream is always in encode order rather than display
  14945. order. If B-frames are enabled, it may be necessary to use the <samp class="option">vp9_raw_reorder</samp>
  14946. bitstream filter to modify the output stream to display frames in the correct order.
  14947. </p>
  14948. <p>Only normal frames are produced - the <samp class="option">vp9_superframe</samp> bitstream filter may be
  14949. required to produce a stream usable with all decoders.
  14950. </p>
  14951. </dd>
  14952. </dl>
  14953. <a name="vbn"></a>
  14954. <h3 class="section">16.33 vbn<span class="pull-right"><a class="anchor hidden-xs" href="#vbn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vbn" aria-hidden="true">TOC</a></span></h3>
  14955. <p>Vizrt Binary Image encoder.
  14956. </p>
  14957. <p>This format is used by the broadcast vendor Vizrt for quick texture streaming.
  14958. Advanced features of the format such as LZW compression of texture data or
  14959. generation of mipmaps are not supported.
  14960. </p>
  14961. <a name="Options-52"></a>
  14962. <h4 class="subsection">16.33.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-52" aria-hidden="true">TOC</a></span></h4>
  14963. <dl class="table">
  14964. <dt><samp class="option">format <var class="var">string</var></samp></dt>
  14965. <dd><p>Sets the texture compression used by the VBN file. Can be <var class="var">dxt1</var>,
  14966. <var class="var">dxt5</var> or <var class="var">raw</var>. Default is <var class="var">dxt5</var>.
  14967. </p></dd>
  14968. </dl>
  14969. <a name="vc2"></a>
  14970. <h3 class="section">16.34 vc2<span class="pull-right"><a class="anchor hidden-xs" href="#vc2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vc2" aria-hidden="true">TOC</a></span></h3>
  14971. <p>SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  14972. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  14973. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  14974. other tasks which require low overhead and low compression (like screen
  14975. recording).
  14976. </p>
  14977. <a name="Options-53"></a>
  14978. <h4 class="subsection">16.34.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-53" aria-hidden="true">TOC</a></span></h4>
  14979. <dl class="table">
  14980. <dt><samp class="option">b</samp></dt>
  14981. <dd><p>Sets target video bitrate. Usually that&rsquo;s around 1:6 of the uncompressed
  14982. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that&rsquo;s around 400Mbps). Higher
  14983. values (close to the uncompressed bitrate) turn on lossless compression mode.
  14984. </p>
  14985. </dd>
  14986. <dt><samp class="option">field_order</samp></dt>
  14987. <dd><p>Enables field coding when set (e.g. to tt - top field first) for interlaced
  14988. inputs. Should increase compression with interlaced content as it splits the
  14989. fields and encodes each separately.
  14990. </p>
  14991. </dd>
  14992. <dt><samp class="option">wavelet_depth</samp></dt>
  14993. <dd><p>Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  14994. Lower values reduce compression and quality. Less capable decoders may not be
  14995. able to handle values of <samp class="option">wavelet_depth</samp> over 3.
  14996. </p>
  14997. </dd>
  14998. <dt><samp class="option">wavelet_type</samp></dt>
  14999. <dd><p>Sets the transform type. Currently only <var class="var">5_3</var> (LeGall) and <var class="var">9_7</var>
  15000. (Deslauriers-Dubuc)
  15001. are implemented, with 9_7 being the one with better compression and thus
  15002. is the default.
  15003. </p>
  15004. </dd>
  15005. <dt><samp class="option">slice_width</samp></dt>
  15006. <dt><samp class="option">slice_height</samp></dt>
  15007. <dd><p>Sets the slice size for each slice. Larger values result in better compression.
  15008. For compatibility with other more limited decoders use <samp class="option">slice_width</samp> of
  15009. 32 and <samp class="option">slice_height</samp> of 8.
  15010. </p>
  15011. </dd>
  15012. <dt><samp class="option">tolerance</samp></dt>
  15013. <dd><p>Sets the undershoot tolerance of the rate control system in percent. This is
  15014. to prevent an expensive search from being run.
  15015. </p>
  15016. </dd>
  15017. <dt><samp class="option">qm</samp></dt>
  15018. <dd><p>Sets the quantization matrix preset to use by default or when <samp class="option">wavelet_depth</samp>
  15019. is set to 5
  15020. </p><ul class="itemize mark-minus">
  15021. <li><var class="var">default</var>
  15022. Uses the default quantization matrix from the specifications, extended with
  15023. values for the fifth level. This provides a good balance between keeping detail
  15024. and omitting artifacts.
  15025. </li><li><var class="var">flat</var>
  15026. Use a completely zeroed out quantization matrix. This increases PSNR but might
  15027. reduce perception. Use in bogus benchmarks.
  15028. </li><li><var class="var">color</var>
  15029. Reduces detail but attempts to preserve color at extremely low bitrates.
  15030. </li></ul>
  15031. </dd>
  15032. </dl>
  15033. <a name="Subtitles-Encoders"></a>
  15034. <h2 class="chapter">17 Subtitles Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitles-Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitles-Encoders" aria-hidden="true">TOC</a></span></h2>
  15035. <a name="dvbsub-1"></a>
  15036. <h3 class="section">17.1 dvbsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvbsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvbsub-1" aria-hidden="true">TOC</a></span></h3>
  15037. <p>This codec encodes the bitmap subtitle format that is used in DVB
  15038. broadcasts and recordings. The bitmaps are typically embedded in a
  15039. container such as MPEG-TS as a separate stream.
  15040. </p>
  15041. <a name="Options-54"></a>
  15042. <h4 class="subsection">17.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-54" aria-hidden="true">TOC</a></span></h4>
  15043. <dl class="table">
  15044. <dt><samp class="option">min_bpp <var class="var">integer (2, 4, or 8)</var></samp></dt>
  15045. <dd><p>Set a minimum bits-per-pixel value for the subtitle color lookup tables.
  15046. </p>
  15047. <p>DVB supports 2, 4, and 8 bits-per-pixel color lookup tables. This
  15048. option enables forcing a particular bits-per-pixel value regardless of
  15049. the number of colors. Since not all players support or properly
  15050. support 2 bits-per-pixel, this value defaults to 4.
  15051. </p>
  15052. </dd>
  15053. </dl>
  15054. <a name="dvdsub-1"></a>
  15055. <h3 class="section">17.2 dvdsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvdsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvdsub-1" aria-hidden="true">TOC</a></span></h3>
  15056. <p>This codec encodes the bitmap subtitle format that is used in DVDs.
  15057. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  15058. and they can also be used in Matroska files.
  15059. </p>
  15060. <a name="Options-55"></a>
  15061. <h4 class="subsection">17.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-55" aria-hidden="true">TOC</a></span></h4>
  15062. <dl class="table">
  15063. <dt><samp class="option">palette</samp></dt>
  15064. <dd><p>Specify the global palette used by the bitmaps.
  15065. </p>
  15066. <p>The format for this option is a string containing 16 24-bits hexadecimal
  15067. numbers (without 0x prefix) separated by commas, for example <code class="code">0d00ee,
  15068. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  15069. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  15070. </p>
  15071. </dd>
  15072. <dt><samp class="option">even_rows_fix</samp></dt>
  15073. <dd><p>When set to 1, enable a work-around that makes the number of pixel rows
  15074. even in all subtitles. This fixes a problem with some players that
  15075. cut off the bottom row if the number is odd. The work-around just adds
  15076. a fully transparent row if needed. The overhead is low, typically
  15077. one byte per subtitle on average.
  15078. </p>
  15079. <p>By default, this work-around is disabled.
  15080. </p></dd>
  15081. </dl>
  15082. <a name="lrc"></a>
  15083. <h3 class="section">17.3 lrc<span class="pull-right"><a class="anchor hidden-xs" href="#lrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lrc" aria-hidden="true">TOC</a></span></h3>
  15084. <p>This codec encodes the LRC lyrics format.
  15085. </p>
  15086. <a name="Options-56"></a>
  15087. <h4 class="subsection">17.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-56" aria-hidden="true">TOC</a></span></h4>
  15088. <dl class="table">
  15089. <dt><samp class="option">precision</samp></dt>
  15090. <dd><p>Specify the precision of the fractional part of the timestamp. Time base is
  15091. determined based on this value.
  15092. </p>
  15093. <p>Defaults to 2 for centiseconds.
  15094. </p></dd>
  15095. </dl>
  15096. <a name="Bitstream-Filters"></a>
  15097. <h2 class="chapter">18 Bitstream Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Bitstream-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Bitstream-Filters" aria-hidden="true">TOC</a></span></h2>
  15098. <p>When you configure your FFmpeg build, all the supported bitstream
  15099. filters are enabled by default. You can list all available ones using
  15100. the configure option <code class="code">--list-bsfs</code>.
  15101. </p>
  15102. <p>You can disable all the bitstream filters using the configure option
  15103. <code class="code">--disable-bsfs</code>, and selectively enable any bitstream filter using
  15104. the option <code class="code">--enable-bsf=BSF</code>, or you can disable a particular
  15105. bitstream filter using the option <code class="code">--disable-bsf=BSF</code>.
  15106. </p>
  15107. <p>The option <code class="code">-bsfs</code> of the ff* tools will display the list of
  15108. all the supported bitstream filters included in your build.
  15109. </p>
  15110. <p>The ff* tools have a -bsf option applied per stream, taking a
  15111. comma-separated list of filters, whose parameters follow the filter
  15112. name after a &rsquo;=&rsquo;.
  15113. </p>
  15114. <div class="example">
  15115. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  15116. </pre></div>
  15117. <p>Below is a description of the currently available bitstream filters,
  15118. with their parameters, if any.
  15119. </p>
  15120. <a name="aac_005fadtstoasc"></a>
  15121. <h3 class="section">18.1 aac_adtstoasc<span class="pull-right"><a class="anchor hidden-xs" href="#aac_005fadtstoasc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac_005fadtstoasc" aria-hidden="true">TOC</a></span></h3>
  15122. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  15123. bitstream.
  15124. </p>
  15125. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  15126. ADTS header and removes the ADTS header.
  15127. </p>
  15128. <p>This filter is required for example when copying an AAC stream from a
  15129. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  15130. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  15131. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  15132. </p>
  15133. <a name="av1_005fmetadata"></a>
  15134. <h3 class="section">18.2 av1_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#av1_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-av1_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  15135. <p>Modify metadata embedded in an AV1 stream.
  15136. </p>
  15137. <dl class="table">
  15138. <dt><samp class="option">td</samp></dt>
  15139. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  15140. stream.
  15141. </p>
  15142. <dl class="table">
  15143. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  15144. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  15145. </p></dd>
  15146. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  15147. <dd><p>Remove the TD from the beginning of every TU which has one.
  15148. </p></dd>
  15149. </dl>
  15150. </dd>
  15151. <dt><samp class="option">color_primaries</samp></dt>
  15152. <dt><samp class="option">transfer_characteristics</samp></dt>
  15153. <dt><samp class="option">matrix_coefficients</samp></dt>
  15154. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  15155. </p>
  15156. </dd>
  15157. <dt><samp class="option">color_range</samp></dt>
  15158. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  15159. this cannot be set for streams using BT.709 primaries, sRGB transfer
  15160. characteristic and identity (RGB) matrix coefficients).
  15161. </p><dl class="table">
  15162. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  15163. <dd><p>Limited range.
  15164. </p></dd>
  15165. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  15166. <dd><p>Full range.
  15167. </p></dd>
  15168. </dl>
  15169. </dd>
  15170. <dt><samp class="option">chroma_sample_position</samp></dt>
  15171. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  15172. This can only be set for 4:2:0 streams.
  15173. </p>
  15174. <dl class="table">
  15175. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  15176. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  15177. </p></dd>
  15178. <dt>&lsquo;<samp class="samp">colocated</samp>&rsquo;</dt>
  15179. <dd><p>Top-left position.
  15180. </p></dd>
  15181. </dl>
  15182. </dd>
  15183. <dt><samp class="option">tick_rate</samp></dt>
  15184. <dd><p>Set the tick rate (<em class="emph">time_scale / num_units_in_display_tick</em>) in
  15185. the timing info in the sequence header.
  15186. </p></dd>
  15187. <dt><samp class="option">num_ticks_per_picture</samp></dt>
  15188. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  15189. has a fixed framerate. Ignored if <samp class="option">tick_rate</samp> is not also set.
  15190. </p>
  15191. </dd>
  15192. <dt><samp class="option">delete_padding</samp></dt>
  15193. <dd><p>Deletes Padding OBUs.
  15194. </p>
  15195. </dd>
  15196. </dl>
  15197. <a name="chomp"></a>
  15198. <h3 class="section">18.3 chomp<span class="pull-right"><a class="anchor hidden-xs" href="#chomp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chomp" aria-hidden="true">TOC</a></span></h3>
  15199. <p>Remove zero padding at the end of a packet.
  15200. </p>
  15201. <a name="dca_005fcore"></a>
  15202. <h3 class="section">18.4 dca_core<span class="pull-right"><a class="anchor hidden-xs" href="#dca_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dca_005fcore" aria-hidden="true">TOC</a></span></h3>
  15203. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  15204. DTS-HD.
  15205. </p>
  15206. <a name="dovi_005frpu"></a>
  15207. <h3 class="section">18.5 dovi_rpu<span class="pull-right"><a class="anchor hidden-xs" href="#dovi_005frpu" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dovi_005frpu" aria-hidden="true">TOC</a></span></h3>
  15208. <p>Manipulate Dolby Vision metadata in a HEVC/AV1 bitstream, optionally enabling
  15209. metadata compression.
  15210. </p>
  15211. <dl class="table">
  15212. <dt><samp class="option">strip</samp></dt>
  15213. <dd><p>If enabled, strip all Dolby Vision metadata (configuration record + RPU data
  15214. blocks) from the stream.
  15215. </p></dd>
  15216. <dt><samp class="option">compression</samp></dt>
  15217. <dd><p>Which compression level to enable.
  15218. </p><dl class="table">
  15219. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  15220. <dd><p>No metadata compression.
  15221. </p></dd>
  15222. <dt>&lsquo;<samp class="samp">limited</samp>&rsquo;</dt>
  15223. <dd><p>Limited metadata compression scheme. Should be compatible with most devices.
  15224. This is the default.
  15225. </p></dd>
  15226. <dt>&lsquo;<samp class="samp">extended</samp>&rsquo;</dt>
  15227. <dd><p>Extended metadata compression. Devices are not required to support this. Note
  15228. that this level currently behaves the same as &lsquo;<samp class="samp">limited</samp>&rsquo; in libavcodec.
  15229. </p></dd>
  15230. </dl>
  15231. </dd>
  15232. </dl>
  15233. <a name="dump_005fextra"></a>
  15234. <h3 class="section">18.6 dump_extra<span class="pull-right"><a class="anchor hidden-xs" href="#dump_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dump_005fextra" aria-hidden="true">TOC</a></span></h3>
  15235. <p>Add extradata to the beginning of the filtered packets except when
  15236. said packets already exactly begin with the extradata that is intended
  15237. to be added.
  15238. </p>
  15239. <dl class="table">
  15240. <dt><samp class="option">freq</samp></dt>
  15241. <dd><p>The additional argument specifies which packets should be filtered.
  15242. It accepts the values:
  15243. </p><dl class="table">
  15244. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  15245. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  15246. <dd><p>add extradata to all key packets
  15247. </p>
  15248. </dd>
  15249. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  15250. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  15251. <dd><p>add extradata to all packets
  15252. </p></dd>
  15253. </dl>
  15254. </dd>
  15255. </dl>
  15256. <p>If not specified it is assumed &lsquo;<samp class="samp">k</samp>&rsquo;.
  15257. </p>
  15258. <p>For example the following <code class="command">ffmpeg</code> command forces a global
  15259. header (thus disabling individual packet headers) in the H.264 packets
  15260. generated by the <code class="code">libx264</code> encoder, but corrects them by adding
  15261. the header stored in extradata to the key packets:
  15262. </p><div class="example">
  15263. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  15264. </pre></div>
  15265. <a name="dv_005ferror_005fmarker"></a>
  15266. <h3 class="section">18.7 dv_error_marker<span class="pull-right"><a class="anchor hidden-xs" href="#dv_005ferror_005fmarker" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dv_005ferror_005fmarker" aria-hidden="true">TOC</a></span></h3>
  15267. <p>Blocks in DV which are marked as damaged are replaced by blocks of the specified color.
  15268. </p>
  15269. <dl class="table">
  15270. <dt><samp class="option">color</samp></dt>
  15271. <dd><p>The color to replace damaged blocks by
  15272. </p></dd>
  15273. <dt><samp class="option">sta</samp></dt>
  15274. <dd><p>A 16 bit mask which specifies which of the 16 possible error status values are
  15275. to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0
  15276. error status values.
  15277. </p><dl class="table">
  15278. <dt>&lsquo;<samp class="samp">ok</samp>&rsquo;</dt>
  15279. <dd><p>No error, no concealment
  15280. </p></dd>
  15281. <dt>&lsquo;<samp class="samp">err</samp>&rsquo;</dt>
  15282. <dd><p>Error, No concealment
  15283. </p></dd>
  15284. <dt>&lsquo;<samp class="samp">res</samp>&rsquo;</dt>
  15285. <dd><p>Reserved
  15286. </p></dd>
  15287. <dt>&lsquo;<samp class="samp">notok</samp>&rsquo;</dt>
  15288. <dd><p>Error or concealment
  15289. </p></dd>
  15290. <dt>&lsquo;<samp class="samp">notres</samp>&rsquo;</dt>
  15291. <dd><p>Not reserved
  15292. </p></dd>
  15293. <dt>&lsquo;<samp class="samp">Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru</samp>&rsquo;</dt>
  15294. <dd><p>The specific error status code
  15295. </p></dd>
  15296. </dl>
  15297. <p>see page 44-46 or section 5.5 of
  15298. <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>
  15299. </p>
  15300. </dd>
  15301. </dl>
  15302. <a name="eac3_005fcore"></a>
  15303. <h3 class="section">18.8 eac3_core<span class="pull-right"><a class="anchor hidden-xs" href="#eac3_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eac3_005fcore" aria-hidden="true">TOC</a></span></h3>
  15304. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  15305. </p>
  15306. <a name="eia608_005fto_005fsmpte436m"></a>
  15307. <h3 class="section">18.9 eia608_to_smpte436m<span class="pull-right"><a class="anchor hidden-xs" href="#eia608_005fto_005fsmpte436m" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eia608_005fto_005fsmpte436m" aria-hidden="true">TOC</a></span></h3>
  15308. <p>Convert from a <code class="code">EIA_608</code> stream to a <code class="code">SMPTE_436M_ANC</code> data stream, wrapping the closed captions in CTA-708 CDP VANC packets.
  15309. </p>
  15310. <dl class="table">
  15311. <dt><samp class="option">line_number</samp></dt>
  15312. <dd><p>Choose which line number the generated VANC packets should go on. You generally want either line 9 (the default) or 11.
  15313. </p></dd>
  15314. <dt><samp class="option">wrapping_type</samp></dt>
  15315. <dd><p>Choose the SMPTE 436M wrapping type, defaults to &lsquo;<samp class="samp">vanc_frame</samp>&rsquo;.
  15316. It accepts the values:
  15317. </p><dl class="table">
  15318. <dt>&lsquo;<samp class="samp">vanc_frame</samp>&rsquo;</dt>
  15319. <dd><p>VANC frame (interlaced or segmented progressive frame)
  15320. </p></dd>
  15321. <dt>&lsquo;<samp class="samp">vanc_field_1</samp>&rsquo;</dt>
  15322. <dt>&lsquo;<samp class="samp">vanc_field_2</samp>&rsquo;</dt>
  15323. <dt>&lsquo;<samp class="samp">vanc_progressive_frame</samp>&rsquo;</dt>
  15324. </dl>
  15325. </dd>
  15326. <dt><samp class="option">sample_coding</samp></dt>
  15327. <dd><p>Choose the SMPTE 436M sample coding, defaults to &lsquo;<samp class="samp">8bit_luma</samp>&rsquo;.
  15328. It accepts the values:
  15329. </p><dl class="table">
  15330. <dt>&lsquo;<samp class="samp">8bit_luma</samp>&rsquo;</dt>
  15331. <dd><p>8-bit component luma samples
  15332. </p></dd>
  15333. <dt>&lsquo;<samp class="samp">8bit_color_diff</samp>&rsquo;</dt>
  15334. <dd><p>8-bit component color difference samples
  15335. </p></dd>
  15336. <dt>&lsquo;<samp class="samp">8bit_luma_and_color_diff</samp>&rsquo;</dt>
  15337. <dd><p>8-bit component luma and color difference samples
  15338. </p></dd>
  15339. <dt>&lsquo;<samp class="samp">10bit_luma</samp>&rsquo;</dt>
  15340. <dd><p>10-bit component luma samples
  15341. </p></dd>
  15342. <dt>&lsquo;<samp class="samp">10bit_color_diff</samp>&rsquo;</dt>
  15343. <dd><p>10-bit component color difference samples
  15344. </p></dd>
  15345. <dt>&lsquo;<samp class="samp">10bit_luma_and_color_diff</samp>&rsquo;</dt>
  15346. <dd><p>10-bit component luma and color difference samples
  15347. </p></dd>
  15348. <dt>&lsquo;<samp class="samp">8bit_luma_parity_error</samp>&rsquo;</dt>
  15349. <dd><p>8-bit component luma samples with parity error
  15350. </p></dd>
  15351. <dt>&lsquo;<samp class="samp">8bit_color_diff_parity_error</samp>&rsquo;</dt>
  15352. <dd><p>8-bit component color difference samples with parity error
  15353. </p></dd>
  15354. <dt>&lsquo;<samp class="samp">8bit_luma_and_color_diff_parity_error</samp>&rsquo;</dt>
  15355. <dd><p>8-bit component luma and color difference samples with parity error
  15356. </p></dd>
  15357. </dl>
  15358. </dd>
  15359. <dt><samp class="option">initial_cdp_sequence_cntr</samp></dt>
  15360. <dd><p>The initial value of the CDP&rsquo;s 16-bit unsigned integer <code class="code">cdp_hdr_sequence_cntr</code> and <code class="code">cdp_ftr_sequence_cntr</code> fields. Defaults to 0.
  15361. </p></dd>
  15362. <dt><samp class="option">cdp_frame_rate</samp></dt>
  15363. <dd><p>Set the CDP&rsquo;s <code class="code">cdp_frame_rate</code> field. This doesn&rsquo;t actually change the timing of the data stream, it just changes the values inserted in that field in the generated CDP packets. Defaults to &lsquo;<samp class="samp">30000/1001</samp>&rsquo;.
  15364. </p></dd>
  15365. </dl>
  15366. <a name="extract_005fextradata"></a>
  15367. <h3 class="section">18.10 extract_extradata<span class="pull-right"><a class="anchor hidden-xs" href="#extract_005fextradata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extract_005fextradata" aria-hidden="true">TOC</a></span></h3>
  15368. <p>Extract the in-band extradata.
  15369. </p>
  15370. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  15371. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  15372. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  15373. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  15374. </p>
  15375. <p>This bitstream filter detects the in-band headers and makes them available as
  15376. extradata.
  15377. </p>
  15378. <dl class="table">
  15379. <dt><samp class="option">remove</samp></dt>
  15380. <dd><p>When this option is enabled, the long-term headers are removed from the
  15381. bitstream after extraction.
  15382. </p></dd>
  15383. </dl>
  15384. <a name="filter_005funits"></a>
  15385. <h3 class="section">18.11 filter_units<span class="pull-right"><a class="anchor hidden-xs" href="#filter_005funits" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-filter_005funits" aria-hidden="true">TOC</a></span></h3>
  15386. <p>Remove units with types in or not in a given set from the stream.
  15387. </p>
  15388. <dl class="table">
  15389. <dt><samp class="option">pass_types</samp></dt>
  15390. <dd><p>List of unit types or ranges of unit types to pass through while removing
  15391. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  15392. or ranges of values with &rsquo;-&rsquo;.
  15393. </p>
  15394. </dd>
  15395. <dt><samp class="option">remove_types</samp></dt>
  15396. <dd><p>Identical to <samp class="option">pass_types</samp>, except the units in the given set
  15397. removed and all others passed through.
  15398. </p></dd>
  15399. </dl>
  15400. <p>The types used by pass_types and remove_types correspond to NAL unit types
  15401. (nal_unit_type) in H.264, HEVC and H.266 (see Table 7-1 in the H.264
  15402. and HEVC specifications or Table 5 in the H.266 specification), to
  15403. marker values for JPEG (without 0xFF prefix) and to start codes without
  15404. start code prefix (i.e. the byte following the 0x000001) for MPEG-2.
  15405. For VP8 and VP9, every unit has type zero.
  15406. </p>
  15407. <p>Extradata is unchanged by this transformation, but note that if the stream
  15408. contains inline parameter sets then the output may be unusable if they are
  15409. removed.
  15410. </p>
  15411. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  15412. </p><div class="example">
  15413. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  15414. </pre></div>
  15415. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  15416. </p><div class="example">
  15417. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  15418. </pre></div>
  15419. <p>To remove all user data from a MPEG-2 stream, including Closed Captions:
  15420. </p><div class="example">
  15421. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=178' OUTPUT
  15422. </pre></div>
  15423. <p>To remove all SEI from a H264 stream, including Closed Captions:
  15424. </p><div class="example">
  15425. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=6' OUTPUT
  15426. </pre></div>
  15427. <p>To remove all prefix and suffix SEI from a HEVC stream, including Closed Captions and dynamic HDR:
  15428. </p><div class="example">
  15429. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=39|40' OUTPUT
  15430. </pre></div>
  15431. <a name="hapqa_005fextract"></a>
  15432. <h3 class="section">18.12 hapqa_extract<span class="pull-right"><a class="anchor hidden-xs" href="#hapqa_005fextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hapqa_005fextract" aria-hidden="true">TOC</a></span></h3>
  15433. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  15434. </p>
  15435. <dl class="table">
  15436. <dt><samp class="option">texture</samp></dt>
  15437. <dd><p>Specifies the texture to keep.
  15438. </p>
  15439. <dl class="table">
  15440. <dt><samp class="option">color</samp></dt>
  15441. <dt><samp class="option">alpha</samp></dt>
  15442. </dl>
  15443. </dd>
  15444. </dl>
  15445. <p>Convert HAPQA to HAPQ
  15446. </p><div class="example">
  15447. <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
  15448. </pre></div>
  15449. <p>Convert HAPQA to HAPAlphaOnly
  15450. </p><div class="example">
  15451. <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
  15452. </pre></div>
  15453. <a name="h264_005fmetadata"></a>
  15454. <h3 class="section">18.13 h264_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  15455. <p>Modify metadata embedded in an H.264 stream.
  15456. </p>
  15457. <dl class="table">
  15458. <dt><samp class="option">aud</samp></dt>
  15459. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  15460. </p>
  15461. <dl class="table">
  15462. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  15463. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  15464. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  15465. </dl>
  15466. <p>Default is pass.
  15467. </p>
  15468. </dd>
  15469. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  15470. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  15471. See H.264 table E-1.
  15472. </p>
  15473. </dd>
  15474. <dt><samp class="option">overscan_appropriate_flag</samp></dt>
  15475. <dd><p>Set whether the stream is suitable for display using overscan
  15476. or not (see H.264 section E.2.1).
  15477. </p>
  15478. </dd>
  15479. <dt><samp class="option">video_format</samp></dt>
  15480. <dt><samp class="option">video_full_range_flag</samp></dt>
  15481. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  15482. table E-2).
  15483. </p>
  15484. </dd>
  15485. <dt><samp class="option">colour_primaries</samp></dt>
  15486. <dt><samp class="option">transfer_characteristics</samp></dt>
  15487. <dt><samp class="option">matrix_coefficients</samp></dt>
  15488. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  15489. and tables E-3, E-4 and E-5).
  15490. </p>
  15491. </dd>
  15492. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  15493. <dd><p>Set the chroma sample location in the stream (see H.264 section
  15494. E.2.1 and figure E-1).
  15495. </p>
  15496. </dd>
  15497. <dt><samp class="option">tick_rate</samp></dt>
  15498. <dd><p>Set the tick rate (time_scale / num_units_in_tick) in the VUI
  15499. parameters. This is the smallest time unit representable in the
  15500. stream, and in many cases represents the field rate of the stream
  15501. (double the frame rate).
  15502. </p></dd>
  15503. <dt><samp class="option">fixed_frame_rate_flag</samp></dt>
  15504. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  15505. that the framerate is exactly half the tick rate, but the exact
  15506. meaning is dependent on interlacing and the picture structure (see
  15507. H.264 section E.2.1 and table E-6).
  15508. </p></dd>
  15509. <dt><samp class="option">zero_new_constraint_set_flags</samp></dt>
  15510. <dd><p>Zero constraint_set4_flag and constraint_set5_flag in the SPS. These
  15511. bits were reserved in a previous version of the H.264 spec, and thus
  15512. some hardware decoders require these to be zero. The result of zeroing
  15513. this is still a valid bitstream.
  15514. </p>
  15515. </dd>
  15516. <dt><samp class="option">crop_left</samp></dt>
  15517. <dt><samp class="option">crop_right</samp></dt>
  15518. <dt><samp class="option">crop_top</samp></dt>
  15519. <dt><samp class="option">crop_bottom</samp></dt>
  15520. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  15521. the current ones if the stream is already cropped.
  15522. </p>
  15523. <p>These fields are set in pixels. Note that some sizes may not be
  15524. representable if the chroma is subsampled or the stream is interlaced
  15525. (see H.264 section 7.4.2.1.1).
  15526. </p>
  15527. </dd>
  15528. <dt><samp class="option">sei_user_data</samp></dt>
  15529. <dd><p>Insert a string as SEI unregistered user data. The argument must
  15530. be of the form <em class="emph">UUID+string</em>, where the UUID is as hex digits
  15531. possibly separated by hyphens, and the string can be anything.
  15532. </p>
  15533. <p>For example, &lsquo;<samp class="samp">086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  15534. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  15535. </p>
  15536. </dd>
  15537. <dt><samp class="option">delete_filler</samp></dt>
  15538. <dd><p>Deletes both filler NAL units and filler SEI messages.
  15539. </p>
  15540. </dd>
  15541. <dt><samp class="option">display_orientation</samp></dt>
  15542. <dd><p>Insert, extract or remove Display orientation SEI messages.
  15543. See H.264 section D.1.27 and D.2.27 for syntax and semantics.
  15544. </p>
  15545. <dl class="table">
  15546. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  15547. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  15548. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  15549. <dt>&lsquo;<samp class="samp">extract</samp>&rsquo;</dt>
  15550. </dl>
  15551. <p>Default is pass.
  15552. </p>
  15553. <p>Insert mode works in conjunction with <code class="code">rotate</code> and <code class="code">flip</code> options.
  15554. Any pre-existing Display orientation messages will be removed in insert or remove mode.
  15555. Extract mode attaches the display matrix to the packet as side data.
  15556. </p>
  15557. </dd>
  15558. <dt><samp class="option">rotate</samp></dt>
  15559. <dd><p>Set rotation in display orientation SEI (anticlockwise angle in degrees).
  15560. Range is -360 to +360. Default is NaN.
  15561. </p>
  15562. </dd>
  15563. <dt><samp class="option">flip</samp></dt>
  15564. <dd><p>Set flip in display orientation SEI.
  15565. </p>
  15566. <dl class="table">
  15567. <dt>&lsquo;<samp class="samp">horizontal</samp>&rsquo;</dt>
  15568. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  15569. </dl>
  15570. <p>Default is unset.
  15571. </p>
  15572. </dd>
  15573. <dt><samp class="option">level</samp></dt>
  15574. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  15575. to A-5.
  15576. </p>
  15577. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">4.2</samp>&rsquo;), a
  15578. level_idc value (for example, &lsquo;<samp class="samp">42</samp>&rsquo;), or the special name &lsquo;<samp class="samp">auto</samp>&rsquo;
  15579. indicating that the filter should attempt to guess the level from the
  15580. input stream properties.
  15581. </p>
  15582. </dd>
  15583. </dl>
  15584. <a name="h264_005fmp4toannexb"></a>
  15585. <h3 class="section">18.14 h264_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
  15586. <p>Convert an H.264 bitstream from length prefixed mode to start code
  15587. prefixed mode (as defined in the Annex B of the ITU-T H.264
  15588. specification).
  15589. </p>
  15590. <p>This is required by some streaming formats, typically the MPEG-2
  15591. transport stream format (muxer <code class="code">mpegts</code>).
  15592. </p>
  15593. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  15594. format with <code class="command">ffmpeg</code>, you can use the command:
  15595. </p>
  15596. <div class="example">
  15597. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  15598. </pre></div>
  15599. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  15600. <code class="code">mpegts</code>) and raw H.264 (muxer <code class="code">h264</code>) output formats.
  15601. </p>
  15602. <a name="h264_005fredundant_005fpps"></a>
  15603. <h3 class="section">18.15 h264_redundant_pps<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fredundant_005fpps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fredundant_005fpps" aria-hidden="true">TOC</a></span></h3>
  15604. <p>This applies a specific fixup to some Blu-ray BDMV H264 streams
  15605. which contain redundant PPSs. The PPSs modify irrelevant parameters
  15606. of the stream, confusing other transformations which require
  15607. the correct extradata.
  15608. </p>
  15609. <p>The encoder used on these impacted streams adds extra PPSs throughout
  15610. the stream, varying the initial QP and whether weighted prediction
  15611. was enabled. This causes issues after copying the stream into
  15612. a global header container, as the starting PPS is not suitable
  15613. for the rest of the stream. One side effect, for example,
  15614. is seeking will return garbled output until a new PPS appears.
  15615. </p>
  15616. <p>This BSF removes the extra PPSs and rewrites the slice headers
  15617. such that the stream uses a single leading PPS in the global header,
  15618. which resolves the issue.
  15619. </p>
  15620. <a name="hevc_005fmetadata"></a>
  15621. <h3 class="section">18.16 hevc_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#hevc_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  15622. <p>Modify metadata embedded in an HEVC stream.
  15623. </p>
  15624. <dl class="table">
  15625. <dt><samp class="option">aud</samp></dt>
  15626. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  15627. </p>
  15628. <dl class="table">
  15629. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  15630. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  15631. </dl>
  15632. </dd>
  15633. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  15634. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  15635. </p>
  15636. </dd>
  15637. <dt><samp class="option">video_format</samp></dt>
  15638. <dt><samp class="option">video_full_range_flag</samp></dt>
  15639. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  15640. table E.2).
  15641. </p>
  15642. </dd>
  15643. <dt><samp class="option">colour_primaries</samp></dt>
  15644. <dt><samp class="option">transfer_characteristics</samp></dt>
  15645. <dt><samp class="option">matrix_coefficients</samp></dt>
  15646. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  15647. and tables E.3, E.4 and E.5).
  15648. </p>
  15649. </dd>
  15650. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  15651. <dd><p>Set the chroma sample location in the stream (see H.265 section
  15652. E.3.1 and figure E.1).
  15653. </p>
  15654. </dd>
  15655. <dt><samp class="option">tick_rate</samp></dt>
  15656. <dd><p>Set the tick rate in the VPS and VUI parameters (time_scale /
  15657. num_units_in_tick). Combined with <samp class="option">num_ticks_poc_diff_one</samp>, this can
  15658. set a constant framerate in the stream. Note that it is likely to be
  15659. overridden by container parameters when the stream is in a container.
  15660. </p>
  15661. </dd>
  15662. <dt><samp class="option">num_ticks_poc_diff_one</samp></dt>
  15663. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  15664. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  15665. E.3.1). Ignored if <samp class="option">tick_rate</samp> is not also set.
  15666. </p>
  15667. </dd>
  15668. <dt><samp class="option">crop_left</samp></dt>
  15669. <dt><samp class="option">crop_right</samp></dt>
  15670. <dt><samp class="option">crop_top</samp></dt>
  15671. <dt><samp class="option">crop_bottom</samp></dt>
  15672. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  15673. will replace the current ones if the stream is already cropped.
  15674. </p>
  15675. <p>These fields are set in pixels. Note that some sizes may not be
  15676. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  15677. </p>
  15678. </dd>
  15679. <dt><samp class="option">width</samp></dt>
  15680. <dt><samp class="option">height</samp></dt>
  15681. <dd><p>Set width and height after crop.
  15682. </p>
  15683. </dd>
  15684. <dt><samp class="option">level</samp></dt>
  15685. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  15686. A.6 and A.7.
  15687. </p>
  15688. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">5.1</samp>&rsquo;), a
  15689. <em class="emph">general_level_idc</em> value (for example, &lsquo;<samp class="samp">153</samp>&rsquo; for level 5.1),
  15690. or the special name &lsquo;<samp class="samp">auto</samp>&rsquo; indicating that the filter should
  15691. attempt to guess the level from the input stream properties.
  15692. </p>
  15693. </dd>
  15694. </dl>
  15695. <a name="hevc_005fmp4toannexb"></a>
  15696. <h3 class="section">18.17 hevc_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#hevc_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
  15697. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  15698. prefixed mode (as defined in the Annex B of the ITU-T H.265
  15699. specification).
  15700. </p>
  15701. <p>This is required by some streaming formats, typically the MPEG-2
  15702. transport stream format (muxer <code class="code">mpegts</code>).
  15703. </p>
  15704. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  15705. format with <code class="command">ffmpeg</code>, you can use the command:
  15706. </p>
  15707. <div class="example">
  15708. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  15709. </pre></div>
  15710. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  15711. <code class="code">mpegts</code>) and raw HEVC/H.265 (muxer <code class="code">h265</code> or
  15712. <code class="code">hevc</code>) output formats.
  15713. </p>
  15714. <a name="imxdump"></a>
  15715. <h3 class="section">18.18 imxdump<span class="pull-right"><a class="anchor hidden-xs" href="#imxdump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-imxdump" aria-hidden="true">TOC</a></span></h3>
  15716. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  15717. Pro decoder. This filter only applies to the mpeg2video codec, and is
  15718. likely not needed for Final Cut Pro 7 and newer with the appropriate
  15719. <samp class="option">-tag:v</samp>.
  15720. </p>
  15721. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  15722. </p>
  15723. <div class="example">
  15724. <pre class="example-preformatted">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  15725. </pre></div>
  15726. <a name="mjpeg2jpeg"></a>
  15727. <h3 class="section">18.19 mjpeg2jpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mjpeg2jpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpeg2jpeg" aria-hidden="true">TOC</a></span></h3>
  15728. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  15729. </p>
  15730. <p>MJPEG is a video codec wherein each video frame is essentially a
  15731. JPEG image. The individual frames can be extracted without loss,
  15732. e.g. by
  15733. </p>
  15734. <div class="example">
  15735. <pre class="example-preformatted">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  15736. </pre></div>
  15737. <p>Unfortunately, these chunks are incomplete JPEG images, because
  15738. they lack the DHT segment required for decoding. Quoting from
  15739. <a class="url" href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  15740. </p>
  15741. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  15742. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  15743. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  15744. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  15745. and it must use basic Huffman encoding, not arithmetic or
  15746. progressive. . . . You can indeed extract the MJPEG frames and
  15747. decode them with a regular JPEG decoder, but you have to prepend
  15748. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  15749. how to decompress the data. The exact table necessary is given in
  15750. the OpenDML spec.&quot;
  15751. </p>
  15752. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  15753. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  15754. produce fully qualified JPEG images.
  15755. </p>
  15756. <div class="example">
  15757. <pre class="example-preformatted">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  15758. exiftran -i -9 frame*.jpg
  15759. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  15760. </pre></div>
  15761. <a name="mjpegadump"></a>
  15762. <h3 class="section">18.20 mjpegadump<span class="pull-right"><a class="anchor hidden-xs" href="#mjpegadump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpegadump" aria-hidden="true">TOC</a></span></h3>
  15763. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  15764. Quicktime.
  15765. </p>
  15766. <a class="anchor" id="mov2textsub"></a><a name="mov2textsub-1"></a>
  15767. <h3 class="section">18.21 mov2textsub<span class="pull-right"><a class="anchor hidden-xs" href="#mov2textsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov2textsub-1" aria-hidden="true">TOC</a></span></h3>
  15768. <p>Extract a representable text file from MOV subtitles, stripping the
  15769. metadata header from each subtitle packet.
  15770. </p>
  15771. <p>See also the <a class="ref" href="#text2movsub">text2movsub</a> filter.
  15772. </p>
  15773. <a name="mpeg2_005fmetadata"></a>
  15774. <h3 class="section">18.22 mpeg2_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg2_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg2_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  15775. <p>Modify metadata embedded in an MPEG-2 stream.
  15776. </p>
  15777. <dl class="table">
  15778. <dt><samp class="option">display_aspect_ratio</samp></dt>
  15779. <dd><p>Set the display aspect ratio in the stream.
  15780. </p>
  15781. <p>The following fixed values are supported:
  15782. </p><dl class="table">
  15783. <dt><samp class="option">4/3</samp></dt>
  15784. <dt><samp class="option">16/9</samp></dt>
  15785. <dt><samp class="option">221/100</samp></dt>
  15786. </dl>
  15787. <p>Any other value will result in square pixels being signalled instead
  15788. (see H.262 section 6.3.3 and table 6-3).
  15789. </p>
  15790. </dd>
  15791. <dt><samp class="option">frame_rate</samp></dt>
  15792. <dd><p>Set the frame rate in the stream. This is constructed from a table
  15793. of known values combined with a small multiplier and divisor - if
  15794. the supplied value is not exactly representable, the nearest
  15795. representable value will be used instead (see H.262 section 6.3.3
  15796. and table 6-4).
  15797. </p>
  15798. </dd>
  15799. <dt><samp class="option">video_format</samp></dt>
  15800. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  15801. table 6-6).
  15802. </p>
  15803. </dd>
  15804. <dt><samp class="option">colour_primaries</samp></dt>
  15805. <dt><samp class="option">transfer_characteristics</samp></dt>
  15806. <dt><samp class="option">matrix_coefficients</samp></dt>
  15807. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  15808. and tables 6-7, 6-8 and 6-9).
  15809. </p>
  15810. </dd>
  15811. </dl>
  15812. <a name="mpeg4_005funpack_005fbframes"></a>
  15813. <h3 class="section">18.23 mpeg4_unpack_bframes<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg4_005funpack_005fbframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg4_005funpack_005fbframes" aria-hidden="true">TOC</a></span></h3>
  15814. <p>Unpack DivX-style packed B-frames.
  15815. </p>
  15816. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  15817. workaround for the broken Video for Windows subsystem.
  15818. They use more space, can cause minor AV sync issues, require more
  15819. CPU power to decode (unless the player has some decoded picture queue
  15820. to compensate the 2,0,2,0 frame per packet style) and cause
  15821. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  15822. because MPEG-4 decoders may not be able to decode them, since they are
  15823. not valid MPEG-4.
  15824. </p>
  15825. <p>For example to fix an AVI file containing an MPEG-4 stream with
  15826. DivX-style packed B-frames using <code class="command">ffmpeg</code>, you can use the command:
  15827. </p>
  15828. <div class="example">
  15829. <pre class="example-preformatted">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  15830. </pre></div>
  15831. <a name="noise"></a>
  15832. <h3 class="section">18.24 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise" aria-hidden="true">TOC</a></span></h3>
  15833. <p>Damages the contents of packets or simply drops them without damaging the
  15834. container. Can be used for fuzzing or testing error resilience/concealment.
  15835. </p>
  15836. <p>Parameters:
  15837. </p><dl class="table">
  15838. <dt><samp class="option">amount</samp></dt>
  15839. <dd><p>Accepts an expression whose evaluation per-packet determines how often bytes in that
  15840. packet will be modified. A value below 0 will result in a variable frequency.
  15841. Default is 0 which results in no modification. However, if neither amount nor drop is specified,
  15842. amount will be set to <var class="var">-1</var>. See below for accepted variables.
  15843. </p></dd>
  15844. <dt><samp class="option">drop</samp></dt>
  15845. <dd><p>Accepts an expression evaluated per-packet whose value determines whether that packet is dropped.
  15846. Evaluation to a positive value results in the packet being dropped. Evaluation to a negative
  15847. value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude
  15848. of the value. Default is 0 which results in no drops. See below for accepted variables.
  15849. </p></dd>
  15850. <dt><samp class="option">dropamount</samp></dt>
  15851. <dd><p>Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse
  15852. in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards
  15853. compatibility and is equivalent to setting drop to a negative value with the same magnitude
  15854. i.e. <code class="code">dropamount=4</code> is the same as <code class="code">drop=-4</code>. Ignored if drop is also specified.
  15855. </p></dd>
  15856. </dl>
  15857. <p>Both <code class="code">amount</code> and <code class="code">drop</code> accept expressions containing the following variables:
  15858. </p>
  15859. <dl class="table">
  15860. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  15861. <dd><p>The index of the packet, starting from zero.
  15862. </p></dd>
  15863. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  15864. <dd><p>The timebase for packet timestamps.
  15865. </p></dd>
  15866. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  15867. <dd><p>Packet presentation timestamp.
  15868. </p></dd>
  15869. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  15870. <dd><p>Packet decoding timestamp.
  15871. </p></dd>
  15872. <dt>&lsquo;<samp class="samp">nopts</samp>&rsquo;</dt>
  15873. <dd><p>Constant representing AV_NOPTS_VALUE.
  15874. </p></dd>
  15875. <dt>&lsquo;<samp class="samp">startpts</samp>&rsquo;</dt>
  15876. <dd><p>First non-AV_NOPTS_VALUE PTS seen in the stream.
  15877. </p></dd>
  15878. <dt>&lsquo;<samp class="samp">startdts</samp>&rsquo;</dt>
  15879. <dd><p>First non-AV_NOPTS_VALUE DTS seen in the stream.
  15880. </p></dd>
  15881. <dt>&lsquo;<samp class="samp">duration</samp>&rsquo;</dt>
  15882. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  15883. <dd><p>Packet duration, in timebase units.
  15884. </p></dd>
  15885. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  15886. <dd><p>Packet position in input; may be -1 when unknown or not set.
  15887. </p></dd>
  15888. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  15889. <dd><p>Packet size, in bytes.
  15890. </p></dd>
  15891. <dt>&lsquo;<samp class="samp">key</samp>&rsquo;</dt>
  15892. <dd><p>Whether packet is marked as a keyframe.
  15893. </p></dd>
  15894. <dt>&lsquo;<samp class="samp">state</samp>&rsquo;</dt>
  15895. <dd><p>A pseudo random integer, primarily derived from the content of packet payload.
  15896. </p></dd>
  15897. </dl>
  15898. <a name="Examples-7"></a>
  15899. <h4 class="subsection">18.24.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-7" aria-hidden="true">TOC</a></span></h4>
  15900. <p>Apply modification to every byte but don&rsquo;t drop any packets.
  15901. </p><div class="example">
  15902. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
  15903. </pre></div>
  15904. <p>Drop every video packet not marked as a keyframe after timestamp 30s but do not
  15905. modify any of the remaining packets.
  15906. </p><div class="example">
  15907. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(pts*tb\,30)*not(key)' output.mkv
  15908. </pre></div>
  15909. <p>Drop one second of audio every 10 seconds and add some random noise to the rest.
  15910. </p><div class="example">
  15911. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(pts*tb\,10)\,9\,10)' output.mkv
  15912. </pre></div>
  15913. <a name="null"></a>
  15914. <h3 class="section">18.25 null<span class="pull-right"><a class="anchor hidden-xs" href="#null" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null" aria-hidden="true">TOC</a></span></h3>
  15915. <p>This bitstream filter passes the packets through unchanged.
  15916. </p>
  15917. <a name="pcm_005frechunk"></a>
  15918. <h3 class="section">18.26 pcm_rechunk<span class="pull-right"><a class="anchor hidden-xs" href="#pcm_005frechunk" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pcm_005frechunk" aria-hidden="true">TOC</a></span></h3>
  15919. <p>Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
  15920. rate per second. This is similar to the <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#asetnsamples">asetnsamples audio
  15921. filter</a> but works on audio packets instead of audio frames.
  15922. </p>
  15923. <dl class="table">
  15924. <dt><samp class="option">nb_out_samples, n</samp></dt>
  15925. <dd><p>Set the number of samples per each output audio packet. The number is intended
  15926. as the number of samples <em class="emph">per each channel</em>. Default value is 1024.
  15927. </p>
  15928. </dd>
  15929. <dt><samp class="option">pad, p</samp></dt>
  15930. <dd><p>If set to 1, the filter will pad the last audio packet with silence, so that it
  15931. will contain the same number of samples (or roughly the same number of samples,
  15932. see <samp class="option">frame_rate</samp>) as the previous ones. Default value is 1.
  15933. </p>
  15934. </dd>
  15935. <dt><samp class="option">frame_rate, r</samp></dt>
  15936. <dd><p>This option makes the filter output a fixed number of packets per second instead
  15937. of a fixed number of samples per packet. If the audio sample rate is not
  15938. divisible by the frame rate then the number of samples will not be constant but
  15939. will vary slightly so that each packet will start as close to the frame
  15940. boundary as possible. Using this option has precedence over <samp class="option">nb_out_samples</samp>.
  15941. </p></dd>
  15942. </dl>
  15943. <p>You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
  15944. for NTSC frame rate using the <samp class="option">frame_rate</samp> option.
  15945. </p><div class="example">
  15946. <pre class="example-preformatted">ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
  15947. </pre></div>
  15948. <a name="pgs_005fframe_005fmerge"></a>
  15949. <h3 class="section">18.27 pgs_frame_merge<span class="pull-right"><a class="anchor hidden-xs" href="#pgs_005fframe_005fmerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pgs_005fframe_005fmerge" aria-hidden="true">TOC</a></span></h3>
  15950. <p>Merge a sequence of PGS Subtitle segments ending with an &quot;end of display set&quot;
  15951. segment into a single packet.
  15952. </p>
  15953. <p>This is required by some containers that support PGS subtitles
  15954. (muxer <code class="code">matroska</code>).
  15955. </p>
  15956. <a name="prores_005fmetadata"></a>
  15957. <h3 class="section">18.28 prores_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#prores_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prores_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  15958. <p>Modify color property metadata embedded in prores stream.
  15959. </p>
  15960. <dl class="table">
  15961. <dt><samp class="option">color_primaries</samp></dt>
  15962. <dd><p>Set the color primaries.
  15963. Available values are:
  15964. </p>
  15965. <dl class="table">
  15966. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  15967. <dd><p>Keep the same color primaries property (default).
  15968. </p>
  15969. </dd>
  15970. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  15971. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  15972. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  15973. <dd><p>BT601 625
  15974. </p>
  15975. </dd>
  15976. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  15977. <dd><p>BT601 525
  15978. </p>
  15979. </dd>
  15980. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  15981. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  15982. <dd><p>DCI P3
  15983. </p>
  15984. </dd>
  15985. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  15986. <dd><p>P3 D65
  15987. </p>
  15988. </dd>
  15989. </dl>
  15990. </dd>
  15991. <dt><samp class="option">transfer_characteristics</samp></dt>
  15992. <dd><p>Set the color transfer.
  15993. Available values are:
  15994. </p>
  15995. <dl class="table">
  15996. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  15997. <dd><p>Keep the same transfer characteristics property (default).
  15998. </p>
  15999. </dd>
  16000. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  16001. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  16002. <dd><p>BT 601, BT 709, BT 2020
  16003. </p></dd>
  16004. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  16005. <dd><p>SMPTE ST 2084
  16006. </p></dd>
  16007. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  16008. <dd><p>ARIB STD-B67
  16009. </p></dd>
  16010. </dl>
  16011. </dd>
  16012. <dt><samp class="option">matrix_coefficients</samp></dt>
  16013. <dd><p>Set the matrix coefficient.
  16014. Available values are:
  16015. </p>
  16016. <dl class="table">
  16017. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  16018. <dd><p>Keep the same colorspace property (default).
  16019. </p>
  16020. </dd>
  16021. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  16022. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  16023. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  16024. <dd><p>BT 601
  16025. </p>
  16026. </dd>
  16027. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  16028. </dl>
  16029. </dd>
  16030. </dl>
  16031. <p>Set Rec709 colorspace for each frame of the file
  16032. </p><div class="example">
  16033. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  16034. </pre></div>
  16035. <p>Set Hybrid Log-Gamma parameters for each frame of the file
  16036. </p><div class="example">
  16037. <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
  16038. </pre></div>
  16039. <a name="remove_005fextra"></a>
  16040. <h3 class="section">18.29 remove_extra<span class="pull-right"><a class="anchor hidden-xs" href="#remove_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remove_005fextra" aria-hidden="true">TOC</a></span></h3>
  16041. <p>Remove extradata from packets.
  16042. </p>
  16043. <p>It accepts the following parameter:
  16044. </p><dl class="table">
  16045. <dt><samp class="option">freq</samp></dt>
  16046. <dd><p>Set which frame types to remove extradata from.
  16047. </p>
  16048. <dl class="table">
  16049. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  16050. <dd><p>Remove extradata from non-keyframes only.
  16051. </p>
  16052. </dd>
  16053. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  16054. <dd><p>Remove extradata from keyframes only.
  16055. </p>
  16056. </dd>
  16057. <dt>&lsquo;<samp class="samp">e, all</samp>&rsquo;</dt>
  16058. <dd><p>Remove extradata from all frames.
  16059. </p>
  16060. </dd>
  16061. </dl>
  16062. </dd>
  16063. </dl>
  16064. <a name="setts"></a>
  16065. <h3 class="section">18.30 setts<span class="pull-right"><a class="anchor hidden-xs" href="#setts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setts" aria-hidden="true">TOC</a></span></h3>
  16066. <p>Set PTS and DTS in packets.
  16067. </p>
  16068. <p>It accepts the following parameters:
  16069. </p><dl class="table">
  16070. <dt><samp class="option">ts</samp></dt>
  16071. <dt><samp class="option">pts</samp></dt>
  16072. <dt><samp class="option">dts</samp></dt>
  16073. <dd><p>Set expressions for PTS, DTS or both.
  16074. </p></dd>
  16075. <dt><samp class="option">duration</samp></dt>
  16076. <dd><p>Set expression for duration.
  16077. </p></dd>
  16078. <dt><samp class="option">time_base</samp></dt>
  16079. <dd><p>Set output time base.
  16080. </p></dd>
  16081. <dt><samp class="option">prescale</samp></dt>
  16082. <dd><p>Set whether to convert time fields to user-set output time base before evaluation of expressions. Defaults to 0.
  16083. </p></dd>
  16084. </dl>
  16085. <p>The expressions are evaluated through the eval API and can contain the following
  16086. constants:
  16087. </p>
  16088. <dl class="table">
  16089. <dt><samp class="option">N</samp></dt>
  16090. <dd><p>The count of the input packet. Starting from 0.
  16091. </p>
  16092. </dd>
  16093. <dt><samp class="option">TS</samp></dt>
  16094. <dd><p>The demux timestamp in input in case of <code class="code">ts</code> or <code class="code">dts</code> option or presentation
  16095. timestamp in case of <code class="code">pts</code> option.
  16096. </p>
  16097. </dd>
  16098. <dt><samp class="option">POS</samp></dt>
  16099. <dd><p>The original position in the file of the packet, or undefined if undefined
  16100. for the current packet
  16101. </p>
  16102. </dd>
  16103. <dt><samp class="option">DTS</samp></dt>
  16104. <dd><p>The demux timestamp in input.
  16105. </p>
  16106. </dd>
  16107. <dt><samp class="option">PTS</samp></dt>
  16108. <dd><p>The presentation timestamp in input.
  16109. </p>
  16110. </dd>
  16111. <dt><samp class="option">DURATION</samp></dt>
  16112. <dd><p>The duration in input.
  16113. </p>
  16114. </dd>
  16115. <dt><samp class="option">STARTDTS</samp></dt>
  16116. <dd><p>The DTS of the first packet.
  16117. </p>
  16118. </dd>
  16119. <dt><samp class="option">STARTPTS</samp></dt>
  16120. <dd><p>The PTS of the first packet.
  16121. </p>
  16122. </dd>
  16123. <dt><samp class="option">PREV_INDTS</samp></dt>
  16124. <dd><p>The previous input DTS.
  16125. </p>
  16126. </dd>
  16127. <dt><samp class="option">PREV_INPTS</samp></dt>
  16128. <dd><p>The previous input PTS.
  16129. </p>
  16130. </dd>
  16131. <dt><samp class="option">PREV_INDURATION</samp></dt>
  16132. <dd><p>The previous input duration.
  16133. </p>
  16134. </dd>
  16135. <dt><samp class="option">PREV_OUTDTS</samp></dt>
  16136. <dd><p>The previous output DTS.
  16137. </p>
  16138. </dd>
  16139. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  16140. <dd><p>The previous output PTS.
  16141. </p>
  16142. </dd>
  16143. <dt><samp class="option">PREV_OUTDURATION</samp></dt>
  16144. <dd><p>The previous output duration.
  16145. </p>
  16146. </dd>
  16147. <dt><samp class="option">NEXT_DTS</samp></dt>
  16148. <dd><p>The next input DTS.
  16149. </p>
  16150. </dd>
  16151. <dt><samp class="option">NEXT_PTS</samp></dt>
  16152. <dd><p>The next input PTS.
  16153. </p>
  16154. </dd>
  16155. <dt><samp class="option">NEXT_DURATION</samp></dt>
  16156. <dd><p>The next input duration.
  16157. </p>
  16158. </dd>
  16159. <dt><samp class="option">TB</samp></dt>
  16160. <dd><p>The timebase in which time fields are denominated. The user-set output timebase if prescale is enabled, else the input timebase.
  16161. </p>
  16162. </dd>
  16163. <dt><samp class="option">TB_OUT</samp></dt>
  16164. <dd><p>The output timebase.
  16165. </p>
  16166. </dd>
  16167. <dt><samp class="option">SR</samp></dt>
  16168. <dd><p>The sample rate of stream packet belongs.
  16169. </p>
  16170. </dd>
  16171. <dt><samp class="option">NOPTS</samp></dt>
  16172. <dd><p>The AV_NOPTS_VALUE constant.
  16173. </p></dd>
  16174. </dl>
  16175. <p>For example, to set PTS equal to DTS (not recommended if B-frames are involved):
  16176. </p><div class="example">
  16177. <pre class="example-preformatted">ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
  16178. </pre></div>
  16179. <a name="showinfo"></a>
  16180. <h3 class="section">18.31 showinfo<span class="pull-right"><a class="anchor hidden-xs" href="#showinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showinfo" aria-hidden="true">TOC</a></span></h3>
  16181. <p>Log basic packet information. Mainly useful for testing, debugging,
  16182. and development.
  16183. </p>
  16184. <a name="smpte436m_005fto_005feia608"></a>
  16185. <h3 class="section">18.32 smpte436m_to_eia608<span class="pull-right"><a class="anchor hidden-xs" href="#smpte436m_005fto_005feia608" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smpte436m_005fto_005feia608" aria-hidden="true">TOC</a></span></h3>
  16186. <p>Convert from a <code class="code">SMPTE_436M_ANC</code> data stream to a <code class="code">EIA_608</code> stream,
  16187. extracting the closed captions from CTA-708 CDP VANC packets, and ignoring all other data.
  16188. </p>
  16189. <a class="anchor" id="text2movsub"></a><a name="text2movsub-1"></a>
  16190. <h3 class="section">18.33 text2movsub<span class="pull-right"><a class="anchor hidden-xs" href="#text2movsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-text2movsub-1" aria-hidden="true">TOC</a></span></h3>
  16191. <p>Convert text subtitles to MOV subtitles (as used by the <code class="code">mov_text</code>
  16192. codec) with metadata headers.
  16193. </p>
  16194. <p>See also the <a class="ref" href="#mov2textsub">mov2textsub</a> filter.
  16195. </p>
  16196. <a name="trace_005fheaders"></a>
  16197. <h3 class="section">18.34 trace_headers<span class="pull-right"><a class="anchor hidden-xs" href="#trace_005fheaders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trace_005fheaders" aria-hidden="true">TOC</a></span></h3>
  16198. <p>Log trace output containing all syntax elements in the coded stream
  16199. headers (everything above the level of individual coded blocks).
  16200. This can be useful for debugging low-level stream issues.
  16201. </p>
  16202. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  16203. on the build only a subset of these may be available.
  16204. </p>
  16205. <a name="truehd_005fcore"></a>
  16206. <h3 class="section">18.35 truehd_core<span class="pull-right"><a class="anchor hidden-xs" href="#truehd_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-truehd_005fcore" aria-hidden="true">TOC</a></span></h3>
  16207. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  16208. </p>
  16209. <a name="vp9_005fmetadata"></a>
  16210. <h3 class="section">18.36 vp9_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  16211. <p>Modify metadata embedded in a VP9 stream.
  16212. </p>
  16213. <dl class="table">
  16214. <dt><samp class="option">color_space</samp></dt>
  16215. <dd><p>Set the color space value in the frame header. Note that any frame
  16216. set to RGB will be implicitly set to PC range and that RGB is
  16217. incompatible with profiles 0 and 2.
  16218. </p><dl class="table">
  16219. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  16220. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  16221. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  16222. <dt>&lsquo;<samp class="samp">smpte170</samp>&rsquo;</dt>
  16223. <dt>&lsquo;<samp class="samp">smpte240</samp>&rsquo;</dt>
  16224. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  16225. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  16226. </dl>
  16227. </dd>
  16228. <dt><samp class="option">color_range</samp></dt>
  16229. <dd><p>Set the color range value in the frame header. Note that any value
  16230. imposed by the color space will take precedence over this value.
  16231. </p><dl class="table">
  16232. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  16233. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  16234. </dl>
  16235. </dd>
  16236. </dl>
  16237. <a name="vp9_005fsuperframe"></a>
  16238. <h3 class="section">18.37 vp9_superframe<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fsuperframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fsuperframe" aria-hidden="true">TOC</a></span></h3>
  16239. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  16240. fixes merging of split/segmented VP9 streams where the alt-ref frame
  16241. was split from its visible counterpart.
  16242. </p>
  16243. <a name="vp9_005fsuperframe_005fsplit"></a>
  16244. <h3 class="section">18.38 vp9_superframe_split<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fsuperframe_005fsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fsuperframe_005fsplit" aria-hidden="true">TOC</a></span></h3>
  16245. <p>Split VP9 superframes into single frames.
  16246. </p>
  16247. <a name="vp9_005fraw_005freorder"></a>
  16248. <h3 class="section">18.39 vp9_raw_reorder<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fraw_005freorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fraw_005freorder" aria-hidden="true">TOC</a></span></h3>
  16249. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  16250. insert additional show-existing-frame packets to correct the ordering.
  16251. </p>
  16252. <a name="Format-Options"></a>
  16253. <h2 class="chapter">19 Format Options<span class="pull-right"><a class="anchor hidden-xs" href="#Format-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-Options" aria-hidden="true">TOC</a></span></h2>
  16254. <p>The libavformat library provides some generic global options, which
  16255. can be set on all the muxers and demuxers. In addition each muxer or
  16256. demuxer may support so-called private options, which are specific for
  16257. that component.
  16258. </p>
  16259. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  16260. FFmpeg tools, or by setting the value explicitly in the
  16261. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  16262. for programmatic use.
  16263. </p>
  16264. <p>The list of supported options follows:
  16265. </p>
  16266. <dl class="table">
  16267. <dt><samp class="option">avioflags <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  16268. <dd><p>Possible values:
  16269. </p><dl class="table">
  16270. <dt>&lsquo;<samp class="samp">direct</samp>&rsquo;</dt>
  16271. <dd><p>Reduce buffering.
  16272. </p></dd>
  16273. </dl>
  16274. </dd>
  16275. <dt><samp class="option">probesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16276. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  16277. stream information. A higher value will enable detecting more
  16278. information in case it is dispersed into the stream, but will increase
  16279. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  16280. </p>
  16281. </dd>
  16282. <dt><samp class="option">max_probe_packets <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16283. <dd><p>Set the maximum number of buffered packets when probing a codec.
  16284. Default is 2500 packets.
  16285. </p>
  16286. </dd>
  16287. <dt><samp class="option">packetsize <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  16288. <dd><p>Set packet size.
  16289. </p>
  16290. </dd>
  16291. <dt><samp class="option">fflags <var class="var">flags</var></samp></dt>
  16292. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  16293. </p>
  16294. <p>Possible values for input files:
  16295. </p><dl class="table">
  16296. <dt>&lsquo;<samp class="samp">discardcorrupt</samp>&rsquo;</dt>
  16297. <dd><p>Discard corrupted packets.
  16298. </p></dd>
  16299. <dt>&lsquo;<samp class="samp">fastseek</samp>&rsquo;</dt>
  16300. <dd><p>Enable fast, but inaccurate seeks for some formats.
  16301. </p></dd>
  16302. <dt>&lsquo;<samp class="samp">genpts</samp>&rsquo;</dt>
  16303. <dd><p>Generate missing PTS if DTS is present.
  16304. </p></dd>
  16305. <dt>&lsquo;<samp class="samp">igndts</samp>&rsquo;</dt>
  16306. <dd><p>Ignore DTS if PTS is also set. In case the PTS is set, the DTS value
  16307. is set to NOPTS. This is ignored when the <code class="code">nofillin</code> flag is set.
  16308. </p></dd>
  16309. <dt>&lsquo;<samp class="samp">ignidx</samp>&rsquo;</dt>
  16310. <dd><p>Ignore index.
  16311. </p></dd>
  16312. <dt>&lsquo;<samp class="samp">nobuffer</samp>&rsquo;</dt>
  16313. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  16314. </p></dd>
  16315. <dt>&lsquo;<samp class="samp">nofillin</samp>&rsquo;</dt>
  16316. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  16317. </p></dd>
  16318. <dt>&lsquo;<samp class="samp">noparse</samp>&rsquo;</dt>
  16319. <dd><p>Disable AVParsers, this needs <code class="code">+nofillin</code> too.
  16320. </p></dd>
  16321. <dt>&lsquo;<samp class="samp">sortdts</samp>&rsquo;</dt>
  16322. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  16323. </p></dd>
  16324. </dl>
  16325. <p>Possible values for output files:
  16326. </p><dl class="table">
  16327. <dt>&lsquo;<samp class="samp">autobsf</samp>&rsquo;</dt>
  16328. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  16329. </p></dd>
  16330. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  16331. <dd><p>Only write platform-, build- and time-independent data.
  16332. This ensures that file and data checksums are reproducible and match between
  16333. platforms. Its primary use is for regression testing.
  16334. </p></dd>
  16335. <dt>&lsquo;<samp class="samp">flush_packets</samp>&rsquo;</dt>
  16336. <dd><p>Write out packets immediately.
  16337. </p></dd>
  16338. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  16339. <dd><p>Stop muxing at the end of the shortest stream.
  16340. It may be needed to increase max_interleave_delta to avoid flushing the longer
  16341. streams before EOF.
  16342. </p></dd>
  16343. </dl>
  16344. </dd>
  16345. <dt><samp class="option">seek2any <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16346. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  16347. Default is 0.
  16348. </p>
  16349. </dd>
  16350. <dt><samp class="option">analyzeduration <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16351. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  16352. higher value will enable detecting more accurate information, but will
  16353. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  16354. </p>
  16355. </dd>
  16356. <dt><samp class="option">cryptokey <var class="var">hexadecimal string</var> (<em class="emph">input</em>)</samp></dt>
  16357. <dd><p>Set decryption key.
  16358. </p>
  16359. </dd>
  16360. <dt><samp class="option">indexmem <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16361. <dd><p>Set max memory used for timestamp index (per stream).
  16362. </p>
  16363. </dd>
  16364. <dt><samp class="option">rtbufsize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16365. <dd><p>Set max memory used for buffering real-time frames.
  16366. </p>
  16367. </dd>
  16368. <dt><samp class="option">fdebug <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  16369. <dd><p>Print specific debug info.
  16370. </p>
  16371. <p>Possible values:
  16372. </p><dl class="table">
  16373. <dt>&lsquo;<samp class="samp">ts</samp>&rsquo;</dt>
  16374. </dl>
  16375. </dd>
  16376. <dt><samp class="option">max_delay <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  16377. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  16378. </p>
  16379. </dd>
  16380. <dt><samp class="option">fpsprobesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16381. <dd><p>Set number of frames used to probe fps.
  16382. </p>
  16383. </dd>
  16384. <dt><samp class="option">audio_preload <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  16385. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  16386. </p>
  16387. </dd>
  16388. <dt><samp class="option">chunk_duration <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  16389. <dd><p>Set microseconds for each chunk.
  16390. </p>
  16391. </dd>
  16392. <dt><samp class="option">chunk_size <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  16393. <dd><p>Set size in bytes for each chunk.
  16394. </p>
  16395. </dd>
  16396. <dt><samp class="option">err_detect, f_err_detect <var class="var">flags</var> (<em class="emph">input</em>)</samp></dt>
  16397. <dd><p>Set error detection flags. <code class="code">f_err_detect</code> is deprecated and
  16398. should be used only via the <code class="command">ffmpeg</code> tool.
  16399. </p>
  16400. <p>Possible values:
  16401. </p><dl class="table">
  16402. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  16403. <dd><p>Verify embedded CRCs.
  16404. </p></dd>
  16405. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  16406. <dd><p>Detect bitstream specification deviations.
  16407. </p></dd>
  16408. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  16409. <dd><p>Detect improper bitstream length.
  16410. </p></dd>
  16411. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  16412. <dd><p>Abort decoding on minor error detection.
  16413. </p></dd>
  16414. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  16415. <dd><p>Consider things that violate the spec and have not been seen in the
  16416. wild as errors.
  16417. </p></dd>
  16418. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  16419. <dd><p>Consider all spec non compliancies as errors.
  16420. </p></dd>
  16421. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  16422. <dd><p>Consider things that a sane encoder should not do as an error.
  16423. </p></dd>
  16424. </dl>
  16425. </dd>
  16426. <dt><samp class="option">max_interleave_delta <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  16427. <dd><p>Set maximum buffering duration for interleaving. The duration is
  16428. expressed in microseconds, and defaults to 10000000 (10 seconds).
  16429. </p>
  16430. <p>To ensure all the streams are interleaved correctly, libavformat will
  16431. wait until it has at least one packet for each stream before actually
  16432. writing any packets to the output file. When some streams are
  16433. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  16434. can result in excessive buffering.
  16435. </p>
  16436. <p>This field specifies the maximum difference between the timestamps of the
  16437. first and the last packet in the muxing queue, above which libavformat
  16438. will output a packet regardless of whether it has queued a packet for all
  16439. the streams.
  16440. </p>
  16441. <p>If set to 0, libavformat will continue buffering packets until it has
  16442. a packet for each stream, regardless of the maximum timestamp
  16443. difference between the buffered packets.
  16444. </p>
  16445. </dd>
  16446. <dt><samp class="option">use_wallclock_as_timestamps <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16447. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  16448. </p>
  16449. </dd>
  16450. <dt><samp class="option">avoid_negative_ts <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  16451. <dd>
  16452. <p>Possible values:
  16453. </p><dl class="table">
  16454. <dt>&lsquo;<samp class="samp">make_non_negative</samp>&rsquo;</dt>
  16455. <dd><p>Shift timestamps to make them non-negative.
  16456. Also note that this affects only leading negative timestamps, and not
  16457. non-monotonic negative timestamps.
  16458. </p></dd>
  16459. <dt>&lsquo;<samp class="samp">make_zero</samp>&rsquo;</dt>
  16460. <dd><p>Shift timestamps so that the first timestamp is 0.
  16461. </p></dd>
  16462. <dt>&lsquo;<samp class="samp">auto (default)</samp>&rsquo;</dt>
  16463. <dd><p>Enables shifting when required by the target format.
  16464. </p></dd>
  16465. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  16466. <dd><p>Disables shifting of timestamp.
  16467. </p></dd>
  16468. </dl>
  16469. <p>When shifting is enabled, all output timestamps are shifted by the
  16470. same amount. Audio, video, and subtitles desynching and relative
  16471. timestamp differences are preserved compared to how they would have
  16472. been without shifting.
  16473. </p>
  16474. </dd>
  16475. <dt><samp class="option">skip_initial_bytes <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16476. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  16477. Default is 0.
  16478. </p>
  16479. </dd>
  16480. <dt><samp class="option">correct_ts_overflow <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16481. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  16482. </p>
  16483. </dd>
  16484. <dt><samp class="option">flush_packets <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  16485. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  16486. means that the underlying protocol will decide, 1 enables it, and has the
  16487. effect of reducing the latency, 0 disables it and may increase IO throughput in
  16488. some cases.
  16489. </p>
  16490. </dd>
  16491. <dt><samp class="option">output_ts_offset <var class="var">offset</var> (<em class="emph">output</em>)</samp></dt>
  16492. <dd><p>Set the output time offset.
  16493. </p>
  16494. <p><var class="var">offset</var> must be a time duration specification,
  16495. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  16496. </p>
  16497. <p>The offset is added by the muxer to the output timestamps.
  16498. </p>
  16499. <p>Specifying a positive offset means that the corresponding streams are
  16500. delayed bt the time duration specified in <var class="var">offset</var>. Default value
  16501. is <code class="code">0</code> (meaning that no offset is applied).
  16502. </p>
  16503. </dd>
  16504. <dt><samp class="option">format_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  16505. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  16506. </p>
  16507. </dd>
  16508. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  16509. <dd><p>Separator used to separate the fields printed on the command line about the
  16510. Stream parameters.
  16511. For example, to separate the fields with newlines and indentation:
  16512. </p><div class="example">
  16513. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  16514. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  16515. </pre></div>
  16516. </dd>
  16517. <dt><samp class="option">max_streams <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16518. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  16519. would require too many resources due to a large number of streams.
  16520. </p>
  16521. </dd>
  16522. <dt><samp class="option">skip_estimate_duration_from_pts <var class="var">bool</var> (<em class="emph">input</em>)</samp></dt>
  16523. <dd><p>Skip estimation of input duration if it requires an additional probing for PTS at end of file.
  16524. At present, applicable for MPEG-PS and MPEG-TS.
  16525. </p>
  16526. </dd>
  16527. <dt><samp class="option">duration_probesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  16528. <dd><p>Set probing size, in bytes, for input duration estimation when it actually requires
  16529. an additional probing for PTS at end of file (at present: MPEG-PS and MPEG-TS).
  16530. It is aimed at users interested in better durations probing for itself, or indirectly
  16531. because using the concat demuxer, for example.
  16532. The typical use case is an MPEG-TS CBR with a high bitrate, high video buffering and
  16533. ending cleaning with similar PTS for video and audio: in such a scenario, the large
  16534. physical gap between the last video packet and the last audio packet makes it necessary
  16535. to read many bytes in order to get the video stream duration.
  16536. Another use case is where the default probing behaviour only reaches a single video frame which is
  16537. not the last one of the stream due to frame reordering, so the duration is not accurate.
  16538. Setting this option has a performance impact even for small files because the probing
  16539. size is fixed.
  16540. Default behaviour is a general purpose trade-off, largely adaptive, but the probing size
  16541. will not be extended to get streams durations at all costs.
  16542. Must be an integer not lesser than 1, or 0 for default behaviour.
  16543. </p>
  16544. </dd>
  16545. <dt><samp class="option">strict, f_strict <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  16546. <dd><p>Specify how strictly to follow the standards. <code class="code">f_strict</code> is deprecated and
  16547. should be used only via the <code class="command">ffmpeg</code> tool.
  16548. </p>
  16549. <p>Possible values:
  16550. </p><dl class="table">
  16551. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  16552. <dd><p>strictly conform to an older more strict version of the spec or reference software
  16553. </p></dd>
  16554. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  16555. <dd><p>strictly conform to all the things in the spec no matter what consequences
  16556. </p></dd>
  16557. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  16558. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  16559. <dd><p>allow unofficial extensions
  16560. </p></dd>
  16561. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  16562. <dd><p>allow non standardized experimental things, experimental
  16563. (unfinished/work in progress/not well tested) decoders and encoders.
  16564. Note: experimental decoders can pose a security risk, do not use this for
  16565. decoding untrusted input.
  16566. </p></dd>
  16567. </dl>
  16568. </dd>
  16569. </dl>
  16570. <a class="anchor" id="Format-stream-specifiers"></a><a name="Format-stream-specifiers-1"></a>
  16571. <h3 class="section">19.1 Format stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Format-stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
  16572. <p>Format stream specifiers allow selection of one or more streams that
  16573. match specific properties.
  16574. </p>
  16575. <p>The exact semantics of stream specifiers is defined by the
  16576. <code class="code">avformat_match_stream_specifier()</code> function declared in the
  16577. <samp class="file">libavformat/avformat.h</samp> header and documented in the
  16578. <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">Stream specifiers section in the ffmpeg(1) manual</a>.
  16579. </p>
  16580. <a name="Demuxers"></a>
  16581. <h2 class="chapter">20 Demuxers<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxers" aria-hidden="true">TOC</a></span></h2>
  16582. <p>Demuxers are configured elements in FFmpeg that can read the
  16583. multimedia streams from a particular type of file.
  16584. </p>
  16585. <p>When you configure your FFmpeg build, all the supported demuxers
  16586. are enabled by default. You can list all available ones using the
  16587. configure option <code class="code">--list-demuxers</code>.
  16588. </p>
  16589. <p>You can disable all the demuxers using the configure option
  16590. <code class="code">--disable-demuxers</code>, and selectively enable a single demuxer with
  16591. the option <code class="code">--enable-demuxer=<var class="var">DEMUXER</var></code>, or disable it
  16592. with the option <code class="code">--disable-demuxer=<var class="var">DEMUXER</var></code>.
  16593. </p>
  16594. <p>The option <code class="code">-demuxers</code> of the ff* tools will display the list of
  16595. enabled demuxers. Use <code class="code">-formats</code> to view a combined list of
  16596. enabled demuxers and muxers.
  16597. </p>
  16598. <p>The description of some of the currently available demuxers follows.
  16599. </p>
  16600. <a name="aa"></a>
  16601. <h3 class="section">20.1 aa<span class="pull-right"><a class="anchor hidden-xs" href="#aa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aa" aria-hidden="true">TOC</a></span></h3>
  16602. <p>Audible Format 2, 3, and 4 demuxer.
  16603. </p>
  16604. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  16605. </p>
  16606. <a name="aac-1"></a>
  16607. <h3 class="section">20.2 aac<span class="pull-right"><a class="anchor hidden-xs" href="#aac-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac-1" aria-hidden="true">TOC</a></span></h3>
  16608. <p>Raw Audio Data Transport Stream AAC demuxer.
  16609. </p>
  16610. <p>This demuxer is used to demux an ADTS input containing a single AAC stream
  16611. alongwith any ID3v1/2 or APE tags in it.
  16612. </p>
  16613. <a name="apng"></a>
  16614. <h3 class="section">20.3 apng<span class="pull-right"><a class="anchor hidden-xs" href="#apng" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apng" aria-hidden="true">TOC</a></span></h3>
  16615. <p>Animated Portable Network Graphics demuxer.
  16616. </p>
  16617. <p>This demuxer is used to demux APNG files.
  16618. All headers, but the PNG signature, up to (but not including) the first
  16619. fcTL chunk are transmitted as extradata.
  16620. Frames are then split as being all the chunks between two fcTL ones, or
  16621. between the last fcTL and IEND chunks.
  16622. </p>
  16623. <dl class="table">
  16624. <dt><samp class="option">-ignore_loop <var class="var">bool</var></samp></dt>
  16625. <dd><p>Ignore the loop variable in the file if set. Default is enabled.
  16626. </p>
  16627. </dd>
  16628. <dt><samp class="option">-max_fps <var class="var">int</var></samp></dt>
  16629. <dd><p>Maximum framerate in frames per second. Default of 0 imposes no limit.
  16630. </p>
  16631. </dd>
  16632. <dt><samp class="option">-default_fps <var class="var">int</var></samp></dt>
  16633. <dd><p>Default framerate in frames per second when none is specified in the file
  16634. (0 meaning as fast as possible). Default is 15.
  16635. </p>
  16636. </dd>
  16637. </dl>
  16638. <a name="asf-1"></a>
  16639. <h3 class="section">20.4 asf<span class="pull-right"><a class="anchor hidden-xs" href="#asf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asf-1" aria-hidden="true">TOC</a></span></h3>
  16640. <p>Advanced Systems Format demuxer.
  16641. </p>
  16642. <p>This demuxer is used to demux ASF files and MMS network streams.
  16643. </p>
  16644. <dl class="table">
  16645. <dt><samp class="option">-no_resync_search <var class="var">bool</var></samp></dt>
  16646. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  16647. </p></dd>
  16648. </dl>
  16649. <a class="anchor" id="concat"></a><a name="concat-1"></a>
  16650. <h3 class="section">20.5 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-1" aria-hidden="true">TOC</a></span></h3>
  16651. <p>Virtual concatenation script demuxer.
  16652. </p>
  16653. <p>This demuxer reads a list of files and other directives from a text file and
  16654. demuxes them one after the other, as if all their packets had been muxed
  16655. together.
  16656. </p>
  16657. <p>The timestamps in the files are adjusted so that the first file starts at 0
  16658. and each next file starts where the previous one finishes. Note that it is
  16659. done globally and may cause gaps if all streams do not have exactly the same
  16660. length.
  16661. </p>
  16662. <p>All files must have the same streams (same codecs, same time base, etc.).
  16663. </p>
  16664. <p>The duration of each file is used to adjust the timestamps of the next file:
  16665. if the duration is incorrect (because it was computed using the bit-rate or
  16666. because the file is truncated, for example), it can cause artifacts. The
  16667. <code class="code">duration</code> directive can be used to override the duration stored in
  16668. each file.
  16669. </p>
  16670. <a name="Syntax-1"></a>
  16671. <h4 class="subsection">20.5.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax-1" aria-hidden="true">TOC</a></span></h4>
  16672. <p>The script is a text file in extended-ASCII, with one directive per line.
  16673. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  16674. following directive is recognized:
  16675. </p>
  16676. <dl class="table">
  16677. <dt><samp class="option"><code class="code">file <var class="var">path</var></code></samp></dt>
  16678. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  16679. backslash or single quotes.
  16680. </p>
  16681. <p>All subsequent file-related directives apply to that file.
  16682. </p>
  16683. </dd>
  16684. <dt><samp class="option"><code class="code">ffconcat version 1.0</code></samp></dt>
  16685. <dd><p>Identify the script type and version.
  16686. </p>
  16687. <p>To make FFmpeg recognize the format automatically, this directive must
  16688. appear exactly as is (no extra space or byte-order-mark) on the very first
  16689. line of the script.
  16690. </p>
  16691. </dd>
  16692. <dt><samp class="option"><code class="code">duration <var class="var">dur</var></code></samp></dt>
  16693. <dd><p>Duration of the file. This information can be specified from the file;
  16694. specifying it here may be more efficient or help if the information from the
  16695. file is not available or accurate.
  16696. </p>
  16697. <p>If the duration is set for all files, then it is possible to seek in the
  16698. whole concatenated video.
  16699. </p>
  16700. </dd>
  16701. <dt><samp class="option"><code class="code">inpoint <var class="var">timestamp</var></code></samp></dt>
  16702. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  16703. specified timestamp. Seeking is done so that all streams can be presented
  16704. successfully at In point.
  16705. </p>
  16706. <p>This directive works best with intra frame codecs, because for non-intra frame
  16707. ones you will usually get extra packets before the actual In point and the
  16708. decoded content will most likely contain frames before In point too.
  16709. </p>
  16710. <p>For each file, packets before the file In point will have timestamps less than
  16711. the calculated start timestamp of the file (negative in case of the first
  16712. file), and the duration of the files (if not specified by the <code class="code">duration</code>
  16713. directive) will be reduced based on their specified In point.
  16714. </p>
  16715. <p>Because of potential packets before the specified In point, packet timestamps
  16716. may overlap between two concatenated files.
  16717. </p>
  16718. </dd>
  16719. <dt><samp class="option"><code class="code">outpoint <var class="var">timestamp</var></code></samp></dt>
  16720. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  16721. timestamp in any of the streams, it handles it as an end of file condition and
  16722. skips the current and all the remaining packets from all streams.
  16723. </p>
  16724. <p>Out point is exclusive, which means that the demuxer will not output packets
  16725. with a decoding timestamp greater or equal to Out point.
  16726. </p>
  16727. <p>This directive works best with intra frame codecs and formats where all streams
  16728. are tightly interleaved. For non-intra frame codecs you will usually get
  16729. additional packets with presentation timestamp after Out point therefore the
  16730. decoded content will most likely contain frames after Out point too. If your
  16731. streams are not tightly interleaved you may not get all the packets from all
  16732. streams before Out point and you may only will be able to decode the earliest
  16733. stream until Out point.
  16734. </p>
  16735. <p>The duration of the files (if not specified by the <code class="code">duration</code>
  16736. directive) will be reduced based on their specified Out point.
  16737. </p>
  16738. </dd>
  16739. <dt><samp class="option"><code class="code">file_packet_metadata <var class="var">key=value</var></code></samp></dt>
  16740. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  16741. each file packet. You can specify this directive multiple times to add multiple
  16742. metadata entries.
  16743. This directive is deprecated, use <code class="code">file_packet_meta</code> instead.
  16744. </p>
  16745. </dd>
  16746. <dt><samp class="option"><code class="code">file_packet_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  16747. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  16748. each file packet. You can specify this directive multiple times to add multiple
  16749. metadata entries.
  16750. </p>
  16751. </dd>
  16752. <dt><samp class="option"><code class="code">option <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  16753. <dd><p>Option to access, open and probe the file.
  16754. Can be present multiple times.
  16755. </p>
  16756. </dd>
  16757. <dt><samp class="option"><code class="code">stream</code></samp></dt>
  16758. <dd><p>Introduce a stream in the virtual file.
  16759. All subsequent stream-related directives apply to the last introduced
  16760. stream.
  16761. Some streams properties must be set in order to allow identifying the
  16762. matching streams in the subfiles.
  16763. If no streams are defined in the script, the streams from the first file are
  16764. copied.
  16765. </p>
  16766. </dd>
  16767. <dt><samp class="option"><code class="code">exact_stream_id <var class="var">id</var></code></samp></dt>
  16768. <dd><p>Set the id of the stream.
  16769. If this directive is given, the string with the corresponding id in the
  16770. subfiles will be used.
  16771. This is especially useful for MPEG-PS (VOB) files, where the order of the
  16772. streams is not reliable.
  16773. </p>
  16774. </dd>
  16775. <dt><samp class="option"><code class="code">stream_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  16776. <dd><p>Metadata for the stream.
  16777. Can be present multiple times.
  16778. </p>
  16779. </dd>
  16780. <dt><samp class="option"><code class="code">stream_codec <var class="var">value</var></code></samp></dt>
  16781. <dd><p>Codec for the stream.
  16782. </p>
  16783. </dd>
  16784. <dt><samp class="option"><code class="code">stream_extradata <var class="var">hex_string</var></code></samp></dt>
  16785. <dd><p>Extradata for the string, encoded in hexadecimal.
  16786. </p>
  16787. </dd>
  16788. <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>
  16789. <dd><p>Add a chapter. <var class="var">id</var> is an unique identifier, possibly small and
  16790. consecutive.
  16791. </p>
  16792. </dd>
  16793. </dl>
  16794. <a name="Options-57"></a>
  16795. <h4 class="subsection">20.5.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-57" aria-hidden="true">TOC</a></span></h4>
  16796. <p>This demuxer accepts the following option:
  16797. </p>
  16798. <dl class="table">
  16799. <dt><samp class="option">safe</samp></dt>
  16800. <dd><p>If set to 1, reject unsafe file paths and directives.
  16801. A file path is considered safe if it
  16802. does not contain a protocol specification and is relative and all components
  16803. only contain characters from the portable character set (letters, digits,
  16804. period, underscore and hyphen) and have no period at the beginning of a
  16805. component.
  16806. </p>
  16807. <p>If set to 0, any file name is accepted.
  16808. </p>
  16809. <p>The default is 1.
  16810. </p>
  16811. </dd>
  16812. <dt><samp class="option">auto_convert</samp></dt>
  16813. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  16814. streams concatenable.
  16815. The default is 1.
  16816. </p>
  16817. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  16818. filter to H.264 streams in MP4 format. This is necessary in particular if
  16819. there are resolution changes.
  16820. </p>
  16821. </dd>
  16822. <dt><samp class="option">segment_time_metadata</samp></dt>
  16823. <dd><p>If set to 1, every packet will contain the <var class="var">lavf.concat.start_time</var> and the
  16824. <var class="var">lavf.concat.duration</var> packet metadata values which are the start_time and
  16825. the duration of the respective file segments in the concatenated output
  16826. expressed in microseconds. The duration metadata is only set if it is known
  16827. based on the concat file.
  16828. The default is 0.
  16829. </p>
  16830. </dd>
  16831. </dl>
  16832. <a name="Examples-8"></a>
  16833. <h4 class="subsection">20.5.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-8" aria-hidden="true">TOC</a></span></h4>
  16834. <ul class="itemize mark-bullet">
  16835. <li>Use absolute filenames and include some comments:
  16836. <div class="example">
  16837. <pre class="example-preformatted"># my first filename
  16838. file /mnt/share/file-1.wav
  16839. # my second filename including whitespace
  16840. file '/mnt/share/file 2.wav'
  16841. # my third filename including whitespace plus single quote
  16842. file '/mnt/share/file 3'\''.wav'
  16843. </pre></div>
  16844. </li><li>Allow for input format auto-probing, use safe filenames and set the duration of
  16845. the first file:
  16846. <div class="example">
  16847. <pre class="example-preformatted">ffconcat version 1.0
  16848. file file-1.wav
  16849. duration 20.0
  16850. file subdir/file-2.wav
  16851. </pre></div>
  16852. </li></ul>
  16853. <a name="dash-1"></a>
  16854. <h3 class="section">20.6 dash<span class="pull-right"><a class="anchor hidden-xs" href="#dash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dash-1" aria-hidden="true">TOC</a></span></h3>
  16855. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  16856. </p>
  16857. <p>This demuxer presents all AVStreams found in the manifest.
  16858. By setting the discard flags on AVStreams the caller can decide
  16859. which streams to actually receive.
  16860. Each stream mirrors the <code class="code">id</code> and <code class="code">bandwidth</code> properties from the
  16861. <code class="code">&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  16862. </p>
  16863. <a name="Options-58"></a>
  16864. <h4 class="subsection">20.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-58" aria-hidden="true">TOC</a></span></h4>
  16865. <p>This demuxer accepts the following option:
  16866. </p>
  16867. <dl class="table">
  16868. <dt><samp class="option">cenc_decryption_key</samp></dt>
  16869. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  16870. </p>
  16871. </dd>
  16872. </dl>
  16873. <a name="dvdvideo"></a>
  16874. <h3 class="section">20.7 dvdvideo<span class="pull-right"><a class="anchor hidden-xs" href="#dvdvideo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvdvideo" aria-hidden="true">TOC</a></span></h3>
  16875. <p>DVD-Video demuxer, powered by libdvdnav and libdvdread.
  16876. </p>
  16877. <p>Can directly ingest DVD titles, specifically sequential PGCs, into
  16878. a conversion pipeline. Menu assets, such as background video or audio,
  16879. can also be demuxed given the menu&rsquo;s coordinates (at best effort).
  16880. </p>
  16881. <p>Block devices (DVD drives), ISO files, and directory structures are accepted.
  16882. Activate with <code class="code">-f dvdvideo</code> in front of one of these inputs.
  16883. </p>
  16884. <p>This demuxer does NOT have decryption code of any kind. You are on your own
  16885. working with encrypted DVDs, and should not expect support on the matter.
  16886. </p>
  16887. <p>Underlying playback is handled by libdvdnav, and structure parsing by libdvdread.
  16888. FFmpeg must be built with GPL library support available as well as the
  16889. configure switches <code class="code">--enable-libdvdnav</code> and <code class="code">--enable-libdvdread</code>.
  16890. </p>
  16891. <p>You will need to provide either the desired &quot;title number&quot; or exact PGC/PG coordinates.
  16892. Many open-source DVD players and tools can aid in providing this information.
  16893. If not specified, the demuxer will default to title 1 which works for many discs.
  16894. However, due to the flexibility of the format, it is recommended to check manually.
  16895. There are many discs that are authored strangely or with invalid headers.
  16896. </p>
  16897. <p>If the input is a real DVD drive, please note that there are some drives which may
  16898. silently fail on reading bad sectors from the disc, returning random bits instead
  16899. which is effectively corrupt data. This is especially prominent on aging or rotting discs.
  16900. A second pass and integrity checks would be needed to detect the corruption.
  16901. This is not an FFmpeg issue.
  16902. </p>
  16903. <a name="Background"></a>
  16904. <h4 class="subsection">20.7.1 Background<span class="pull-right"><a class="anchor hidden-xs" href="#Background" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Background" aria-hidden="true">TOC</a></span></h4>
  16905. <p>DVD-Video is not a directly accessible, linear container format in the
  16906. traditional sense. Instead, it allows for complex and programmatic playback of
  16907. carefully muxed MPEG-PS streams that are stored in headerless VOB files.
  16908. To the end-user, these streams are known simply as &quot;titles&quot;, but the actual
  16909. logical playback sequence is defined by one or more &quot;PGCs&quot;, or Program Group Chains,
  16910. within the title. The PGC is in turn comprised of multiple &quot;PGs&quot;, or Programs&quot;,
  16911. which are the actual video segments (and for a typical video feature, sequentially
  16912. ordered). The PGC structure, along with stream layout and metadata, are stored in
  16913. IFO files that need to be parsed. PGCs can be thought of as playlists in easier terms.
  16914. </p>
  16915. <p>An actual DVD player relies on user GUI interaction via menus and an internal VM
  16916. to drive the direction of demuxing. Generally, the user would either navigate (via menus)
  16917. or automatically be redirected to the PGC of their choice. During this process and
  16918. the subsequent playback, the DVD player&rsquo;s internal VM also maintains a state and
  16919. executes instructions that can create jumps to different sectors during playback.
  16920. This is why libdvdnav is involved, as a linear read of the MPEG-PS blobs on the
  16921. disc (VOBs) is not enough to produce the right sequence in many cases.
  16922. </p>
  16923. <p>There are many other DVD structures (a long subject) that will not be discussed here.
  16924. NAV packets, in particular, are handled by this demuxer to build accurate timing
  16925. but not emitted as a stream. For a good high-level understanding, refer to:
  16926. <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>
  16927. </p>
  16928. <a name="Options-59"></a>
  16929. <h4 class="subsection">20.7.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-59" aria-hidden="true">TOC</a></span></h4>
  16930. <p>This demuxer accepts the following options:
  16931. </p>
  16932. <dl class="table">
  16933. <dt><samp class="option">title <var class="var">int</var></samp></dt>
  16934. <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.
  16935. Not applicable to menus.
  16936. Default is 0 (auto), which currently only selects the first available title (title 1)
  16937. and notifies the user about the implications.
  16938. </p>
  16939. </dd>
  16940. <dt><samp class="option">chapter_start <var class="var">int</var></samp></dt>
  16941. <dd><p>The chapter, or PTT (part-of-title), number to start at. Not applicable to menus.
  16942. Default is 1.
  16943. </p>
  16944. </dd>
  16945. <dt><samp class="option">chapter_end <var class="var">int</var></samp></dt>
  16946. <dd><p>The chapter, or PTT (part-of-title), number to end at. Not applicable to menus.
  16947. Default is 0, which is a special value to signal end at the last possible chapter.
  16948. </p>
  16949. </dd>
  16950. <dt><samp class="option">angle <var class="var">int</var></samp></dt>
  16951. <dd><p>The video angle number, referring to what is essentially an additional
  16952. video stream that is composed from alternate frames interleaved in the VOBs.
  16953. Not applicable to menus.
  16954. Default is 1.
  16955. </p>
  16956. </dd>
  16957. <dt><samp class="option">region <var class="var">int</var></samp></dt>
  16958. <dd><p>The region code to use for playback. Some discs may use this to default playback
  16959. at a particular angle in different regions. This option will not affect the region code
  16960. of a real DVD drive, if used as an input. Not applicable to menus.
  16961. Default is 0, &quot;world&quot;.
  16962. </p>
  16963. </dd>
  16964. <dt><samp class="option">menu <var class="var">bool</var></samp></dt>
  16965. <dd><p>Demux menu assets instead of navigating a title. Requires exact coordinates
  16966. 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>).
  16967. Default is false.
  16968. </p>
  16969. </dd>
  16970. <dt><samp class="option">menu_lu <var class="var">int</var></samp></dt>
  16971. <dd><p>The menu language to demux. In DVD, menus are grouped by language.
  16972. Default is 1, the first language unit.
  16973. </p>
  16974. </dd>
  16975. <dt><samp class="option">menu_vts <var class="var">int</var></samp></dt>
  16976. <dd><p>The VTS where the menu lives, or 0 if it is a VMG menu (root-level).
  16977. Default is 1, menu of the first VTS.
  16978. </p>
  16979. </dd>
  16980. <dt><samp class="option">pgc <var class="var">int</var></samp></dt>
  16981. <dd><p>The entry PGC to start playback, in conjunction with <samp class="option">pg</samp>.
  16982. Alternative to setting <samp class="option">title</samp>.
  16983. Chapter markers are not supported at this time.
  16984. Must be explicitly set for menus.
  16985. Default is 0, automatically resolve from value of <samp class="option">title</samp>.
  16986. </p>
  16987. </dd>
  16988. <dt><samp class="option">pg <var class="var">int</var></samp></dt>
  16989. <dd><p>The entry PG to start playback, in conjunction with <samp class="option">pgc</samp>.
  16990. Alternative to setting <samp class="option">title</samp>.
  16991. Chapter markers are not supported at this time.
  16992. Default is 1, the first PG of the PGC.
  16993. </p>
  16994. </dd>
  16995. <dt><samp class="option">preindex <var class="var">bool</var></samp></dt>
  16996. <dd><p>Enable this to have accurate chapter (PTT) markers and duration measurement,
  16997. which requires a slow second pass read in order to index the chapter marker
  16998. timestamps from NAV packets. This is non-ideal extra work for real optical drives.
  16999. It is recommended and faster to use this option with a backup of the DVD structure
  17000. stored on a hard drive. Not compatible with <samp class="option">pgc</samp> and <samp class="option">pg</samp>.
  17001. Default is 0, false.
  17002. </p>
  17003. </dd>
  17004. <dt><samp class="option">trim <var class="var">bool</var></samp></dt>
  17005. <dd><p>Skip padding cells (i.e. cells shorter than 1 second) from the beginning.
  17006. There exist many discs with filler segments at the beginning of the PGC,
  17007. often with junk data intended for controlling a real DVD player&rsquo;s
  17008. buffering speed and with no other material data value.
  17009. Not applicable to menus.
  17010. Default is 1, true.
  17011. </p>
  17012. </dd>
  17013. </dl>
  17014. <a name="Examples-9"></a>
  17015. <h4 class="subsection">20.7.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-9" aria-hidden="true">TOC</a></span></h4>
  17016. <ul class="itemize mark-bullet">
  17017. <li>Open title 3 from a given DVD structure:
  17018. <div class="example">
  17019. <pre class="example-preformatted">ffmpeg -f dvdvideo -title 3 -i &lt;path to DVD&gt; ...
  17020. </pre></div>
  17021. </li><li>Open chapters 3-6 from title 1 from a given DVD structure:
  17022. <div class="example">
  17023. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 3 -chapter_end 6 -title 1 -i &lt;path to DVD&gt; ...
  17024. </pre></div>
  17025. </li><li>Open only chapter 5 from title 1 from a given DVD structure:
  17026. <div class="example">
  17027. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 5 -chapter_end 5 -title 1 -i &lt;path to DVD&gt; ...
  17028. </pre></div>
  17029. </li><li>Demux menu with language 1 from VTS 1, PGC 1, starting at PG 1:
  17030. <div class="example">
  17031. <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; ...
  17032. </pre></div>
  17033. </li></ul>
  17034. <a name="ea"></a>
  17035. <h3 class="section">20.8 ea<span class="pull-right"><a class="anchor hidden-xs" href="#ea" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ea" aria-hidden="true">TOC</a></span></h3>
  17036. <p>Electronic Arts Multimedia format demuxer.
  17037. </p>
  17038. <p>This format is used by various Electronic Arts games.
  17039. </p>
  17040. <a name="Options-60"></a>
  17041. <h4 class="subsection">20.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-60" aria-hidden="true">TOC</a></span></h4>
  17042. <dl class="table">
  17043. <dt><samp class="option">merge_alpha <var class="var">bool</var></samp></dt>
  17044. <dd>
  17045. <p>Normally the VP6 alpha channel (if exists) is returned as a secondary video
  17046. stream, by setting this option you can make the demuxer return a single video
  17047. stream which contains the alpha channel in addition to the ordinary video.
  17048. </p>
  17049. </dd>
  17050. </dl>
  17051. <a name="imf"></a>
  17052. <h3 class="section">20.9 imf<span class="pull-right"><a class="anchor hidden-xs" href="#imf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-imf" aria-hidden="true">TOC</a></span></h3>
  17053. <p>Interoperable Master Format demuxer.
  17054. </p>
  17055. <p>This demuxer presents audio and video streams found in an IMF Composition, as
  17056. specified in <a class="url" href="https://doi.org/10.5594/SMPTE.ST2067-2.2020">SMPTE ST 2067-2</a>.
  17057. </p>
  17058. <div class="example">
  17059. <pre class="example-preformatted">ffmpeg [-assetmaps &lt;path of ASSETMAP1&gt;,&lt;path of ASSETMAP2&gt;,...] -i &lt;path of CPL&gt; ...
  17060. </pre></div>
  17061. <p>If <code class="code">-assetmaps</code> is not specified, the demuxer looks for a file called
  17062. <samp class="file">ASSETMAP.xml</samp> in the same directory as the CPL.
  17063. </p>
  17064. <a name="flv_002c-live_005fflv_002c-kux"></a>
  17065. <h3 class="section">20.10 flv, live_flv, kux<span class="pull-right"><a class="anchor hidden-xs" href="#flv_002c-live_005fflv_002c-kux" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flv_002c-live_005fflv_002c-kux" aria-hidden="true">TOC</a></span></h3>
  17066. <p>Adobe Flash Video Format demuxer.
  17067. </p>
  17068. <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.
  17069. KUX is a flv variant used on the Youku platform.
  17070. </p>
  17071. <div class="example">
  17072. <pre class="example-preformatted">ffmpeg -f flv -i myfile.flv ...
  17073. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  17074. </pre></div>
  17075. <dl class="table">
  17076. <dt><samp class="option">-flv_metadata <var class="var">bool</var></samp></dt>
  17077. <dd><p>Allocate the streams according to the onMetaData array content.
  17078. </p>
  17079. </dd>
  17080. <dt><samp class="option">-flv_ignore_prevtag <var class="var">bool</var></samp></dt>
  17081. <dd><p>Ignore the size of previous tag value.
  17082. </p>
  17083. </dd>
  17084. <dt><samp class="option">-flv_full_metadata <var class="var">bool</var></samp></dt>
  17085. <dd><p>Output all context of the onMetadata.
  17086. </p></dd>
  17087. </dl>
  17088. <a name="gif-1"></a>
  17089. <h3 class="section">20.11 gif<span class="pull-right"><a class="anchor hidden-xs" href="#gif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gif-1" aria-hidden="true">TOC</a></span></h3>
  17090. <p>Animated GIF demuxer.
  17091. </p>
  17092. <p>It accepts the following options:
  17093. </p>
  17094. <dl class="table">
  17095. <dt><samp class="option">min_delay</samp></dt>
  17096. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  17097. Range is 0 to 6000. Default value is 2.
  17098. </p>
  17099. </dd>
  17100. <dt><samp class="option">max_gif_delay</samp></dt>
  17101. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  17102. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  17103. the maximum value allowed by the specification.
  17104. </p>
  17105. </dd>
  17106. <dt><samp class="option">default_delay</samp></dt>
  17107. <dd><p>Set the default delay between frames in hundredths of seconds.
  17108. Range is 0 to 6000. Default value is 10.
  17109. </p>
  17110. </dd>
  17111. <dt><samp class="option">ignore_loop</samp></dt>
  17112. <dd><p>GIF files can contain information to loop a certain number of times (or
  17113. infinitely). If <samp class="option">ignore_loop</samp> is set to 1, then the loop setting
  17114. from the input will be ignored and looping will not occur. If set to 0,
  17115. then looping will occur and will cycle the number of times according to
  17116. the GIF. Default value is 1.
  17117. </p></dd>
  17118. </dl>
  17119. <p>For example, with the overlay filter, place an infinitely looping GIF
  17120. over another video:
  17121. </p><div class="example">
  17122. <pre class="example-preformatted">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  17123. </pre></div>
  17124. <p>Note that in the above example the shortest option for overlay filter is
  17125. used to end the output video at the length of the shortest input file,
  17126. which in this case is <samp class="file">input.mp4</samp> as the GIF in this example loops
  17127. infinitely.
  17128. </p>
  17129. <a name="hls-1"></a>
  17130. <h3 class="section">20.12 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-1" aria-hidden="true">TOC</a></span></h3>
  17131. <p>HLS demuxer
  17132. </p>
  17133. <p>Apple HTTP Live Streaming demuxer.
  17134. </p>
  17135. <p>This demuxer presents all AVStreams from all variant streams.
  17136. The id field is set to the bitrate variant index number. By setting
  17137. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  17138. the caller can decide which variant streams to actually receive.
  17139. The total bitrate of the variant that the stream belongs to is
  17140. available in a metadata key named &quot;variant_bitrate&quot;.
  17141. </p>
  17142. <p>It accepts the following options:
  17143. </p>
  17144. <dl class="table">
  17145. <dt><samp class="option">live_start_index</samp></dt>
  17146. <dd><p>segment index to start live streams at (negative values are from the end).
  17147. </p>
  17148. </dd>
  17149. <dt><samp class="option">prefer_x_start</samp></dt>
  17150. <dd><p>prefer to use #EXT-X-START if it&rsquo;s in playlist instead of live_start_index.
  17151. </p>
  17152. </dd>
  17153. <dt><samp class="option">allowed_extensions</samp></dt>
  17154. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  17155. </p>
  17156. </dd>
  17157. <dt><samp class="option">extension_picky</samp></dt>
  17158. <dd><p>This blocks disallowed extensions from probing
  17159. It also requires all available segments to have matching extensions to the format
  17160. except mpegts, which is always allowed.
  17161. It is recommended to set the whitelists correctly instead of depending on extensions
  17162. Enabled by default.
  17163. </p>
  17164. </dd>
  17165. <dt><samp class="option">max_reload</samp></dt>
  17166. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  17167. Default value is 1000.
  17168. </p>
  17169. </dd>
  17170. <dt><samp class="option">m3u8_hold_counters</samp></dt>
  17171. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  17172. Default value is 1000.
  17173. </p>
  17174. </dd>
  17175. <dt><samp class="option">http_persistent</samp></dt>
  17176. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  17177. Enabled by default.
  17178. </p>
  17179. </dd>
  17180. <dt><samp class="option">http_multiple</samp></dt>
  17181. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  17182. Enabled by default for HTTP/1.1 servers.
  17183. </p>
  17184. </dd>
  17185. <dt><samp class="option">http_seekable</samp></dt>
  17186. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  17187. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  17188. </p>
  17189. </dd>
  17190. <dt><samp class="option">seg_format_options</samp></dt>
  17191. <dd><p>Set options for the demuxer of media segments using a list of key=value pairs separated by <code class="code">:</code>.
  17192. </p>
  17193. </dd>
  17194. <dt><samp class="option">seg_max_retry</samp></dt>
  17195. <dd><p>Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired.
  17196. Default value is 0.
  17197. </p></dd>
  17198. </dl>
  17199. <a name="image2-1"></a>
  17200. <h3 class="section">20.13 image2<span class="pull-right"><a class="anchor hidden-xs" href="#image2-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-image2-1" aria-hidden="true">TOC</a></span></h3>
  17201. <p>Image file demuxer.
  17202. </p>
  17203. <p>This demuxer reads from a list of image files specified by a pattern.
  17204. The syntax and meaning of the pattern is specified by the
  17205. option <var class="var">pattern_type</var>.
  17206. </p>
  17207. <p>The pattern may contain a suffix which is used to automatically
  17208. determine the format of the images contained in the files.
  17209. </p>
  17210. <p>The size, the pixel format, and the format of each image must be the
  17211. same for all the files in the sequence.
  17212. </p>
  17213. <p>This demuxer accepts the following options:
  17214. </p><dl class="table">
  17215. <dt><samp class="option">framerate</samp></dt>
  17216. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  17217. </p></dd>
  17218. <dt><samp class="option">loop</samp></dt>
  17219. <dd><p>If set to 1, loop over the input. Default value is 0.
  17220. </p></dd>
  17221. <dt><samp class="option">pattern_type</samp></dt>
  17222. <dd><p>Select the pattern type used to interpret the provided filename.
  17223. </p>
  17224. <p><var class="var">pattern_type</var> accepts one of the following values.
  17225. </p><dl class="table">
  17226. <dt><samp class="option">none</samp></dt>
  17227. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  17228. image. You should use this option if you do not want to create sequences from
  17229. multiple images and your filenames may contain special pattern characters.
  17230. </p></dd>
  17231. <dt><samp class="option">sequence</samp></dt>
  17232. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  17233. indexed by sequential numbers.
  17234. </p>
  17235. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, which
  17236. specifies the position of the characters representing a sequential
  17237. number in each filename matched by the pattern. If the form
  17238. &quot;%d0<var class="var">N</var>d&quot; is used, the string representing the number in each
  17239. filename is 0-padded and <var class="var">N</var> is the total number of 0-padded
  17240. digits representing the number. The literal character &rsquo;%&rsquo; can be
  17241. specified in the pattern with the string &quot;%%&quot;.
  17242. </p>
  17243. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, the first filename of
  17244. the file list specified by the pattern must contain a number
  17245. inclusively contained between <var class="var">start_number</var> and
  17246. <var class="var">start_number</var>+<var class="var">start_number_range</var>-1, and all the following
  17247. numbers must be sequential.
  17248. </p>
  17249. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  17250. filenames of the form <samp class="file">img-001.bmp</samp>, <samp class="file">img-002.bmp</samp>, ...,
  17251. <samp class="file">img-010.bmp</samp>, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  17252. sequence of filenames of the form <samp class="file">i%m%g-1.jpg</samp>,
  17253. <samp class="file">i%m%g-2.jpg</samp>, ..., <samp class="file">i%m%g-10.jpg</samp>, etc.
  17254. </p>
  17255. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  17256. &quot;%0<var class="var">N</var>d&quot;, for example to convert a single image file
  17257. <samp class="file">img.jpeg</samp> you can employ the command:
  17258. </p><div class="example">
  17259. <pre class="example-preformatted">ffmpeg -i img.jpeg img.png
  17260. </pre></div>
  17261. </dd>
  17262. <dt><samp class="option">glob</samp></dt>
  17263. <dd><p>Select a glob wildcard pattern type.
  17264. </p>
  17265. <p>The pattern is interpreted like a <code class="code">glob()</code> pattern. This is only
  17266. selectable if libavformat was compiled with globbing support.
  17267. </p></dd>
  17268. </dl>
  17269. <p>Default value is <var class="var">sequence</var>.
  17270. </p></dd>
  17271. <dt><samp class="option">pixel_format</samp></dt>
  17272. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  17273. format is guessed from the first image file in the sequence.
  17274. </p></dd>
  17275. <dt><samp class="option">start_number</samp></dt>
  17276. <dd><p>Set the index of the file matched by the image file pattern to start
  17277. to read from. Default value is 0.
  17278. </p></dd>
  17279. <dt><samp class="option">start_number_range</samp></dt>
  17280. <dd><p>Set the index interval range to check when looking for the first image
  17281. file in the sequence, starting from <var class="var">start_number</var>. Default value
  17282. is 5.
  17283. </p></dd>
  17284. <dt><samp class="option">ts_from_file</samp></dt>
  17285. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  17286. that monotonity of timestamps is not provided: images go in the same order as
  17287. without this option. Default value is 0.
  17288. If set to 2, will set frame timestamp to the modification time of the image file in
  17289. nanosecond precision.
  17290. </p></dd>
  17291. <dt><samp class="option">video_size</samp></dt>
  17292. <dd><p>Set the video size of the images to read. If not specified the video
  17293. size is guessed from the first image file in the sequence.
  17294. </p></dd>
  17295. <dt><samp class="option">export_path_metadata</samp></dt>
  17296. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  17297. also available for other filters (see <var class="var">drawtext</var> filter for examples). Default
  17298. value is 0. The extra fields are described below:
  17299. </p><dl class="table">
  17300. <dt><samp class="option">lavf.image2dec.source_path</samp></dt>
  17301. <dd><p>Corresponds to the full path to the input file being read.
  17302. </p></dd>
  17303. <dt><samp class="option">lavf.image2dec.source_basename</samp></dt>
  17304. <dd><p>Corresponds to the name of the file being read.
  17305. </p></dd>
  17306. </dl>
  17307. </dd>
  17308. </dl>
  17309. <a name="Examples-10"></a>
  17310. <h4 class="subsection">20.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-10" aria-hidden="true">TOC</a></span></h4>
  17311. <ul class="itemize mark-bullet">
  17312. <li>Use <code class="command">ffmpeg</code> for creating a video from the images in the file
  17313. sequence <samp class="file">img-001.jpeg</samp>, <samp class="file">img-002.jpeg</samp>, ..., assuming an
  17314. input frame rate of 10 frames per second:
  17315. <div class="example">
  17316. <pre class="example-preformatted">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  17317. </pre></div>
  17318. </li><li>As above, but start by reading from a file with index 100 in the sequence:
  17319. <div class="example">
  17320. <pre class="example-preformatted">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  17321. </pre></div>
  17322. </li><li>Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  17323. terminating with the &quot;.png&quot; suffix:
  17324. <div class="example">
  17325. <pre class="example-preformatted">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  17326. </pre></div>
  17327. </li></ul>
  17328. <a name="libgme"></a>
  17329. <h3 class="section">20.14 libgme<span class="pull-right"><a class="anchor hidden-xs" href="#libgme" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgme" aria-hidden="true">TOC</a></span></h3>
  17330. <p>The Game Music Emu library is a collection of video game music file emulators.
  17331. </p>
  17332. <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.
  17333. </p>
  17334. <p>It accepts the following options:
  17335. </p>
  17336. <dl class="table">
  17337. <dt><samp class="option">track_index</samp></dt>
  17338. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  17339. Track indexes start at 0. Default is to pick the first track. Number of tracks
  17340. is exported as <var class="var">tracks</var> metadata entry.
  17341. </p>
  17342. </dd>
  17343. <dt><samp class="option">sample_rate</samp></dt>
  17344. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  17345. </p>
  17346. </dd>
  17347. <dt><samp class="option">max_size <em class="emph">(bytes)</em></samp></dt>
  17348. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  17349. which in turn, acts as a ceiling for the size of files that can be read.
  17350. Default is 50 MiB.
  17351. </p>
  17352. </dd>
  17353. </dl>
  17354. <a name="libmodplug"></a>
  17355. <h3 class="section">20.15 libmodplug<span class="pull-right"><a class="anchor hidden-xs" href="#libmodplug" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libmodplug" aria-hidden="true">TOC</a></span></h3>
  17356. <p>ModPlug based module demuxer
  17357. </p>
  17358. <p>See <a class="url" href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  17359. </p>
  17360. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  17361. Optionally, a <code class="code">pal8</code> 16-color video stream can be exported with or without printed metadata.
  17362. </p>
  17363. <p>It accepts the following options:
  17364. </p>
  17365. <dl class="table">
  17366. <dt><samp class="option">noise_reduction</samp></dt>
  17367. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  17368. </p>
  17369. </dd>
  17370. <dt><samp class="option">reverb_depth</samp></dt>
  17371. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  17372. </p>
  17373. </dd>
  17374. <dt><samp class="option">reverb_delay</samp></dt>
  17375. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  17376. </p>
  17377. </dd>
  17378. <dt><samp class="option">bass_amount</samp></dt>
  17379. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  17380. </p>
  17381. </dd>
  17382. <dt><samp class="option">bass_range</samp></dt>
  17383. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  17384. </p>
  17385. </dd>
  17386. <dt><samp class="option">surround_depth</samp></dt>
  17387. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  17388. </p>
  17389. </dd>
  17390. <dt><samp class="option">surround_delay</samp></dt>
  17391. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  17392. </p>
  17393. </dd>
  17394. <dt><samp class="option">max_size</samp></dt>
  17395. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  17396. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  17397. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  17398. </p>
  17399. </dd>
  17400. <dt><samp class="option">video_stream_expr</samp></dt>
  17401. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  17402. 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>,
  17403. <code class="code">tempo</code>, <code class="code">order</code>, <code class="code">pattern</code> and <code class="code">row</code>.
  17404. </p>
  17405. </dd>
  17406. <dt><samp class="option">video_stream</samp></dt>
  17407. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  17408. </p>
  17409. </dd>
  17410. <dt><samp class="option">video_stream_w</samp></dt>
  17411. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  17412. </p>
  17413. </dd>
  17414. <dt><samp class="option">video_stream_h</samp></dt>
  17415. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  17416. </p>
  17417. </dd>
  17418. <dt><samp class="option">video_stream_ptxt</samp></dt>
  17419. <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>,
  17420. <code class="code">row</code> and <code class="code">ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  17421. </p>
  17422. </dd>
  17423. </dl>
  17424. <a name="libopenmpt"></a>
  17425. <h3 class="section">20.16 libopenmpt<span class="pull-right"><a class="anchor hidden-xs" href="#libopenmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopenmpt" aria-hidden="true">TOC</a></span></h3>
  17426. <p>libopenmpt based module demuxer
  17427. </p>
  17428. <p>See <a class="url" href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  17429. </p>
  17430. <p>Some files have multiple subsongs (tracks) this can be set with the <samp class="option">subsong</samp>
  17431. option.
  17432. </p>
  17433. <p>It accepts the following options:
  17434. </p>
  17435. <dl class="table">
  17436. <dt><samp class="option">subsong</samp></dt>
  17437. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  17438. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  17439. </p>
  17440. <p>The default value is to let libopenmpt choose.
  17441. </p>
  17442. </dd>
  17443. <dt><samp class="option">layout</samp></dt>
  17444. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  17445. The default value is STEREO.
  17446. </p>
  17447. </dd>
  17448. <dt><samp class="option">sample_rate</samp></dt>
  17449. <dd><p>Set the sample rate for libopenmpt to output.
  17450. Range is from 1000 to INT_MAX. The value default is 48000.
  17451. </p></dd>
  17452. </dl>
  17453. <a class="anchor" id="mccdec"></a><a name="mcc"></a>
  17454. <h3 class="section">20.17 mcc<span class="pull-right"><a class="anchor hidden-xs" href="#mcc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcc" aria-hidden="true">TOC</a></span></h3>
  17455. <p>Demuxer for MacCaption MCC files, it supports MCC versions 1.0 and 2.0.
  17456. MCC files store VANC data, which can include closed captions (EIA-608 and CEA-708), ancillary time code, pan-scan data, etc.
  17457. By default, for backward compatibility, the MCC demuxer extracts just the EIA-608 and CEA-708 closed captions and returns a <code class="code">EIA_608</code> stream, ignoring all other VANC data.
  17458. You can change it to return all VANC data in a <code class="code">SMPTE_436M_ANC</code> data stream by setting <samp class="option">-eia608_extract 0</samp>
  17459. </p>
  17460. <a name="Examples-11"></a>
  17461. <h4 class="subsection">20.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-11" aria-hidden="true">TOC</a></span></h4>
  17462. <ul class="itemize mark-bullet">
  17463. <li>Convert a MCC file to Scenarist (SCC) format:
  17464. <div class="example">
  17465. <pre class="example-preformatted">ffmpeg -i CC.mcc -c:s copy CC.scc
  17466. </pre></div>
  17467. <p>Note that the SCC format only supports EIA-608, so this will discard all other data such as CEA-708 extensions.
  17468. </p>
  17469. </li><li>Merge a MCC file into a MXF file:
  17470. <div class="example">
  17471. <pre class="example-preformatted">ffmpeg -i video_and_audio.mxf -eia608_extract 0 -i CC.mcc -c copy -map 0 -map 1 out.mxf
  17472. </pre></div>
  17473. <p>This retains all VANC data and inserts it into the output MXF file as a <code class="code">SMPTE_436M_ANC</code> data stream.
  17474. </p></li></ul>
  17475. <a name="mov_002fmp4_002f3gp"></a>
  17476. <h3 class="section">20.18 mov/mp4/3gp<span class="pull-right"><a class="anchor hidden-xs" href="#mov_002fmp4_002f3gp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov_002fmp4_002f3gp" aria-hidden="true">TOC</a></span></h3>
  17477. <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).
  17478. </p>
  17479. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  17480. </p>
  17481. <a name="Options-61"></a>
  17482. <h4 class="subsection">20.18.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-61" aria-hidden="true">TOC</a></span></h4>
  17483. <p>This demuxer accepts the following options:
  17484. </p><dl class="table">
  17485. <dt><samp class="option">enable_drefs</samp></dt>
  17486. <dd><p>Enable loading of external tracks, disabled by default.
  17487. Enabling this can theoretically leak information in some use cases.
  17488. </p>
  17489. </dd>
  17490. <dt><samp class="option">use_absolute_path</samp></dt>
  17491. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  17492. Enabling this poses a security risk. It should only be enabled if the source
  17493. is known to be non-malicious.
  17494. </p>
  17495. </dd>
  17496. <dt><samp class="option">seek_streams_individually</samp></dt>
  17497. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  17498. that stream from identified point. This can lead to a different sequence of packets compared
  17499. to demuxing linearly from the beginning. Default is true.
  17500. </p>
  17501. </dd>
  17502. <dt><samp class="option">ignore_editlist</samp></dt>
  17503. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  17504. timeline described by the edit list. Default is false.
  17505. </p>
  17506. </dd>
  17507. <dt><samp class="option">advanced_editlist</samp></dt>
  17508. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code class="code">ignore_editlist</code>
  17509. must be set to false for this option to be effective.
  17510. If both <code class="code">ignore_editlist</code> and this option are set to false, then only the
  17511. start of the stream index is modified to reflect initial dwell time or starting timestamp
  17512. described by the edit list. Default is true.
  17513. </p>
  17514. </dd>
  17515. <dt><samp class="option">ignore_chapters</samp></dt>
  17516. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  17517. only parsed when input is seekable. Default is false.
  17518. </p>
  17519. </dd>
  17520. <dt><samp class="option">use_mfra_for</samp></dt>
  17521. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  17522. </p>
  17523. <p>Following options are available:
  17524. </p><dl class="table">
  17525. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  17526. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em class="emph">(default)</em>
  17527. </p>
  17528. </dd>
  17529. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  17530. <dd><p>Set mfra timestamps as DTS
  17531. </p>
  17532. </dd>
  17533. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  17534. <dd><p>Set mfra timestamps as PTS
  17535. </p>
  17536. </dd>
  17537. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  17538. <dd><p>Don&rsquo;t use mfra box to set timestamps
  17539. </p></dd>
  17540. </dl>
  17541. </dd>
  17542. <dt><samp class="option">use_tfdt</samp></dt>
  17543. <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.
  17544. 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.
  17545. 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
  17546. set to pts or dts.
  17547. </p>
  17548. </dd>
  17549. <dt><samp class="option">export_all</samp></dt>
  17550. <dd><p>Export unrecognized boxes within the <var class="var">udta</var> box as metadata entries. The first four
  17551. characters of the box type are set as the key. Default is false.
  17552. </p>
  17553. </dd>
  17554. <dt><samp class="option">export_xmp</samp></dt>
  17555. <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
  17556. 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
  17557. but with key <code class="code">XMP_</code>. Default is false.
  17558. </p>
  17559. </dd>
  17560. <dt><samp class="option">activation_bytes</samp></dt>
  17561. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  17562. </p>
  17563. </dd>
  17564. <dt><samp class="option">audible_fixed_key</samp></dt>
  17565. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  17566. specify.
  17567. </p>
  17568. </dd>
  17569. <dt><samp class="option">decryption_key</samp></dt>
  17570. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  17571. </p>
  17572. </dd>
  17573. <dt><samp class="option">max_stts_delta</samp></dt>
  17574. <dd><p>Very high sample deltas written in a trak&rsquo;s stts box may occasionally be intended but usually they are written in
  17575. error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets
  17576. the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when
  17577. cast to int32 are used to adjust onward dts.
  17578. </p>
  17579. <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
  17580. a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of <code class="code">uint32</code> range.
  17581. </p>
  17582. </dd>
  17583. <dt><samp class="option">interleaved_read</samp></dt>
  17584. <dd><p>Interleave packets from multiple tracks at demuxer level. For badly interleaved files, this prevents playback issues
  17585. caused by large gaps between packets in different tracks, as MOV/MP4 do not have packet placement requirements.
  17586. However, this can cause excessive seeking on very badly interleaved files, due to seeking between tracks, so disabling
  17587. it may prevent I/O issues, at the expense of playback.
  17588. </p>
  17589. </dd>
  17590. </dl>
  17591. <a name="Audible-AAX"></a>
  17592. <h4 class="subsection">20.18.2 Audible AAX<span class="pull-right"><a class="anchor hidden-xs" href="#Audible-AAX" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audible-AAX" aria-hidden="true">TOC</a></span></h4>
  17593. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  17594. </p><div class="example">
  17595. <pre class="example-preformatted">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  17596. </pre></div>
  17597. <a name="mpegts"></a>
  17598. <h3 class="section">20.19 mpegts<span class="pull-right"><a class="anchor hidden-xs" href="#mpegts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpegts" aria-hidden="true">TOC</a></span></h3>
  17599. <p>MPEG-2 transport stream demuxer.
  17600. </p>
  17601. <p>This demuxer accepts the following options:
  17602. </p><dl class="table">
  17603. <dt><samp class="option">resync_size</samp></dt>
  17604. <dd><p>Set size limit for looking up a new synchronization. Default value is
  17605. 65536.
  17606. </p>
  17607. </dd>
  17608. <dt><samp class="option">skip_unknown_pmt</samp></dt>
  17609. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  17610. </p>
  17611. </dd>
  17612. <dt><samp class="option">fix_teletext_pts</samp></dt>
  17613. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  17614. from the PCR of the first program which the teletext stream is part of and is
  17615. not discarded. Default value is 1, set this option to 0 if you want your
  17616. teletext packet PTS and DTS values untouched.
  17617. </p>
  17618. </dd>
  17619. <dt><samp class="option">ts_packetsize</samp></dt>
  17620. <dd><p>Output option carrying the raw packet size in bytes.
  17621. Show the detected raw packet size, cannot be set by the user.
  17622. </p>
  17623. </dd>
  17624. <dt><samp class="option">scan_all_pmts</samp></dt>
  17625. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  17626. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  17627. disabled). Default value is -1.
  17628. </p>
  17629. </dd>
  17630. <dt><samp class="option">merge_pmt_versions</samp></dt>
  17631. <dd><p>Reuse existing streams when a PMT&rsquo;s version is updated and elementary
  17632. streams move to different PIDs. Default value is 0.
  17633. </p>
  17634. </dd>
  17635. <dt><samp class="option">max_packet_size</samp></dt>
  17636. <dd><p>Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size
  17637. are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes.
  17638. </p></dd>
  17639. </dl>
  17640. <a name="mpjpeg"></a>
  17641. <h3 class="section">20.20 mpjpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mpjpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpjpeg" aria-hidden="true">TOC</a></span></h3>
  17642. <p>MJPEG encapsulated in multi-part MIME demuxer.
  17643. </p>
  17644. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  17645. multipart/x-mixed-replace stream.
  17646. </p><dl class="table">
  17647. <dt><samp class="option">strict_mime_boundary</samp></dt>
  17648. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  17649. to prevent regression with numerous existing endpoints not generating a proper MIME
  17650. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  17651. of the boundary value.
  17652. </p></dd>
  17653. </dl>
  17654. <a name="rawvideo-1"></a>
  17655. <h3 class="section">20.21 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo-1" aria-hidden="true">TOC</a></span></h3>
  17656. <p>Raw video demuxer.
  17657. </p>
  17658. <p>This demuxer allows one to read raw video data. Since there is no header
  17659. specifying the assumed video parameters, the user must specify them
  17660. in order to be able to decode the data correctly.
  17661. </p>
  17662. <p>This demuxer accepts the following options:
  17663. </p><dl class="table">
  17664. <dt><samp class="option">framerate</samp></dt>
  17665. <dd><p>Set input video frame rate. Default value is 25.
  17666. </p>
  17667. </dd>
  17668. <dt><samp class="option">pixel_format</samp></dt>
  17669. <dd><p>Set the input video pixel format. Default value is <code class="code">yuv420p</code>.
  17670. </p>
  17671. </dd>
  17672. <dt><samp class="option">stride</samp></dt>
  17673. <dd><p>Set frame line size in bytes, only required if there are extra padding.
  17674. For multiplane formats, <samp class="option">stride</samp> is a list of line size for each
  17675. plane.
  17676. </p>
  17677. </dd>
  17678. <dt><samp class="option">video_size</samp></dt>
  17679. <dd><p>Set the input video size. This value must be specified explicitly.
  17680. </p></dd>
  17681. </dl>
  17682. <p>For example to read a rawvideo file <samp class="file">input.raw</samp> with
  17683. <code class="command">ffplay</code>, assuming a pixel format of <code class="code">rgb24</code>, a video
  17684. size of <code class="code">320x240</code>, and a frame rate of 10 images per second, use
  17685. the command:
  17686. </p><div class="example">
  17687. <pre class="example-preformatted">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  17688. </pre></div>
  17689. <p>Read a rawvideo with <code class="command">ffplay</code>, assuming a pixel format of <code class="code">yuv420p</code>,
  17690. a video size of <code class="code">1080x1920</code>, has 8 bytes of padding in each line of Y plane,
  17691. and 4 bytes of padding with UV plane,
  17692. </p><div class="example">
  17693. <pre class="example-preformatted">ffplay -f rawvideo -pixel_format yuv420p -video_size 1080x1920 -stride 1088,544,544 input.raw
  17694. </pre></div>
  17695. <a class="anchor" id="rcwtdec"></a><a name="rcwt"></a>
  17696. <h3 class="section">20.22 rcwt<span class="pull-right"><a class="anchor hidden-xs" href="#rcwt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rcwt" aria-hidden="true">TOC</a></span></h3>
  17697. <p>RCWT (Raw Captions With Time) is a format native to ccextractor, a commonly
  17698. used open source tool for processing 608/708 Closed Captions (CC) sources.
  17699. For more information on the format, see <a data-manual="ffmpeg-formats" href="ffmpeg-formats.html#rcwtenc">(ffmpeg-formats)rcwtenc</a>.
  17700. </p>
  17701. <p>This demuxer implements the specification as of March 2024, which has
  17702. been stable and unchanged since April 2014.
  17703. </p>
  17704. <a name="Examples-12"></a>
  17705. <h4 class="subsection">20.22.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-12" aria-hidden="true">TOC</a></span></h4>
  17706. <ul class="itemize mark-bullet">
  17707. <li>Render CC to ASS using the built-in decoder:
  17708. <div class="example">
  17709. <pre class="example-preformatted">ffmpeg -i CC.rcwt.bin CC.ass
  17710. </pre></div>
  17711. <p>Note that if your output appears to be empty, you may have to manually
  17712. set the decoder&rsquo;s <samp class="option">data_field</samp> option to pick the desired CC substream.
  17713. </p>
  17714. </li><li>Convert an RCWT backup to Scenarist (SCC) format:
  17715. <div class="example">
  17716. <pre class="example-preformatted">ffmpeg -i CC.rcwt.bin -c:s copy CC.scc
  17717. </pre></div>
  17718. <p>Note that the SCC format does not support all of the possible CC extensions
  17719. that can be stored in RCWT (such as EIA-708).
  17720. </p></li></ul>
  17721. <a name="sbg"></a>
  17722. <h3 class="section">20.23 sbg<span class="pull-right"><a class="anchor hidden-xs" href="#sbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sbg" aria-hidden="true">TOC</a></span></h3>
  17723. <p>SBaGen script demuxer.
  17724. </p>
  17725. <p>This demuxer reads the script language used by SBaGen
  17726. <a class="url" href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  17727. script looks like that:
  17728. </p><div class="example">
  17729. <pre class="example-preformatted">-SE
  17730. a: 300-2.5/3 440+4.5/0
  17731. b: 300-2.5/0 440+4.5/3
  17732. off: -
  17733. NOW == a
  17734. +0:07:00 == b
  17735. +0:14:00 == a
  17736. +0:21:00 == b
  17737. +0:30:00 off
  17738. </pre></div>
  17739. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  17740. either only absolute timestamps (including the script start time) or only
  17741. relative ones, then its layout is fixed, and the conversion is
  17742. straightforward. On the other hand, if the script mixes both kind of
  17743. timestamps, then the <var class="var">NOW</var> reference for relative timestamps will be
  17744. taken from the current time of day at the time the script is read, and the
  17745. script layout will be frozen according to that reference. That means that if
  17746. the script is directly played, the actual times will match the absolute
  17747. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  17748. somehow pauses the playback or seeks, all times will be shifted accordingly.
  17749. </p>
  17750. <a name="tedcaptions"></a>
  17751. <h3 class="section">20.24 tedcaptions<span class="pull-right"><a class="anchor hidden-xs" href="#tedcaptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tedcaptions" aria-hidden="true">TOC</a></span></h3>
  17752. <p>JSON captions used for <a class="url" href="http://www.ted.com/">TED Talks</a>.
  17753. </p>
  17754. <p>TED does not provide links to the captions, but they can be guessed from the
  17755. page. The file <samp class="file">tools/bookmarklets.html</samp> from the FFmpeg source tree
  17756. contains a bookmarklet to expose them.
  17757. </p>
  17758. <p>This demuxer accepts the following option:
  17759. </p><dl class="table">
  17760. <dt><samp class="option">start_time</samp></dt>
  17761. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  17762. (15s). It is used to sync the captions with the downloadable videos, because
  17763. they include a 15s intro.
  17764. </p></dd>
  17765. </dl>
  17766. <p>Example: convert the captions to a format most players understand:
  17767. </p><div class="example">
  17768. <pre class="example-preformatted">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  17769. </pre></div>
  17770. <a name="vapoursynth"></a>
  17771. <h3 class="section">20.25 vapoursynth<span class="pull-right"><a class="anchor hidden-xs" href="#vapoursynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vapoursynth" aria-hidden="true">TOC</a></span></h3>
  17772. <p>Vapoursynth wrapper.
  17773. </p>
  17774. <p>Due to security concerns, Vapoursynth scripts will not
  17775. be autodetected so the input format has to be forced. For ff* CLI tools,
  17776. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  17777. </p>
  17778. <p>This demuxer accepts the following option:
  17779. </p><dl class="table">
  17780. <dt><samp class="option">max_script_size</samp></dt>
  17781. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  17782. which in turn, acts as a ceiling for the size of scripts that can be read.
  17783. Default is 1 MiB.
  17784. </p></dd>
  17785. </dl>
  17786. <a name="w64"></a>
  17787. <h3 class="section">20.26 w64<span class="pull-right"><a class="anchor hidden-xs" href="#w64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-w64" aria-hidden="true">TOC</a></span></h3>
  17788. <p>Sony Wave64 Audio demuxer.
  17789. </p>
  17790. <p>This demuxer accepts the following options:
  17791. </p><dl class="table">
  17792. <dt><samp class="option">max_size</samp></dt>
  17793. <dd><p>See the same option for the <a class="ref" href="#wav">wav</a> demuxer.
  17794. </p></dd>
  17795. </dl>
  17796. <a class="anchor" id="wav"></a><a name="wav-1"></a>
  17797. <h3 class="section">20.27 wav<span class="pull-right"><a class="anchor hidden-xs" href="#wav-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-wav-1" aria-hidden="true">TOC</a></span></h3>
  17798. <p>RIFF Wave Audio demuxer.
  17799. </p>
  17800. <p>This demuxer accepts the following options:
  17801. </p><dl class="table">
  17802. <dt><samp class="option">max_size</samp></dt>
  17803. <dd><p>Specify the maximum packet size in bytes for the demuxed packets. By default
  17804. this is set to 0, which means that a sensible value is chosen based on the
  17805. input format.
  17806. </p></dd>
  17807. </dl>
  17808. <a name="Muxers"></a>
  17809. <h2 class="chapter">21 Muxers<span class="pull-right"><a class="anchor hidden-xs" href="#Muxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxers" aria-hidden="true">TOC</a></span></h2>
  17810. <p>Muxers are configured elements in FFmpeg which allow writing
  17811. multimedia streams to a particular type of file.
  17812. </p>
  17813. <p>When you configure your FFmpeg build, all the supported muxers
  17814. are enabled by default. You can list all available muxers using the
  17815. configure option <code class="code">--list-muxers</code>.
  17816. </p>
  17817. <p>You can disable all the muxers with the configure option
  17818. <code class="code">--disable-muxers</code> and selectively enable / disable single muxers
  17819. with the options <code class="code">--enable-muxer=<var class="var">MUXER</var></code> /
  17820. <code class="code">--disable-muxer=<var class="var">MUXER</var></code>.
  17821. </p>
  17822. <p>The option <code class="code">-muxers</code> of the ff* tools will display the list of
  17823. enabled muxers. Use <code class="code">-formats</code> to view a combined list of
  17824. enabled demuxers and muxers.
  17825. </p>
  17826. <p>A description of some of the currently available muxers follows.
  17827. </p>
  17828. <a class="anchor" id="raw-muxers"></a><a name="Raw-muxers"></a>
  17829. <h3 class="section">21.1 Raw muxers<span class="pull-right"><a class="anchor hidden-xs" href="#Raw-muxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Raw-muxers" aria-hidden="true">TOC</a></span></h3>
  17830. <p>This section covers raw muxers. They accept a single stream matching
  17831. the designated codec. They do not store timestamps or metadata. The
  17832. recognized extension is the same as the muxer name unless indicated
  17833. otherwise.
  17834. </p>
  17835. <p>It comprises the following muxers. The media type and the eventual
  17836. extensions used to automatically selects the muxer from the output
  17837. extensions are also shown.
  17838. </p>
  17839. <dl class="table">
  17840. <dt>&lsquo;<samp class="samp">ac3 <em class="emph">audio</em></samp>&rsquo;</dt>
  17841. <dd><p>Dolby Digital, also known as AC-3.
  17842. </p>
  17843. </dd>
  17844. <dt>&lsquo;<samp class="samp">adx <em class="emph">audio</em></samp>&rsquo;</dt>
  17845. <dd><p>CRI Middleware ADX audio.
  17846. </p>
  17847. <p>This muxer will write out the total sample count near the start of the
  17848. first packet when the output is seekable and the count can be stored
  17849. in 32 bits.
  17850. </p>
  17851. </dd>
  17852. <dt>&lsquo;<samp class="samp">aptx <em class="emph">audio</em></samp>&rsquo;</dt>
  17853. <dd><p>aptX (Audio Processing Technology for Bluetooth)
  17854. </p>
  17855. </dd>
  17856. <dt>&lsquo;<samp class="samp">aptx_hd <em class="emph">audio</em> (aptxdh)</samp>&rsquo;</dt>
  17857. <dd><p>aptX HD (Audio Processing Technology for Bluetooth) audio
  17858. </p>
  17859. </dd>
  17860. <dt>&lsquo;<samp class="samp">avs2 <em class="emph">video</em> (avs, avs2)</samp>&rsquo;</dt>
  17861. <dd><p>AVS2-P2 (Audio Video Standard - Second generation - Part 2) /
  17862. IEEE 1857.4 video
  17863. </p>
  17864. </dd>
  17865. <dt>&lsquo;<samp class="samp">avs3 <em class="emph">video</em> (avs3)</samp>&rsquo;</dt>
  17866. <dd><p>AVS3-P2 (Audio Video Standard - Third generation - Part 2) /
  17867. IEEE 1857.10 video
  17868. </p>
  17869. </dd>
  17870. <dt>&lsquo;<samp class="samp">cavsvideo <em class="emph">video</em> (cavs)</samp>&rsquo;</dt>
  17871. <dd><p>Chinese AVS (Audio Video Standard - First generation)
  17872. </p>
  17873. </dd>
  17874. <dt>&lsquo;<samp class="samp">codec2raw <em class="emph">audio</em></samp>&rsquo;</dt>
  17875. <dd><p>Codec 2 audio.
  17876. </p>
  17877. <p>No extension is registered so format name has to be supplied e.g. with
  17878. the ffmpeg CLI tool <code class="code">-f codec2raw</code>.
  17879. </p>
  17880. </dd>
  17881. <dt>&lsquo;<samp class="samp">data <em class="emph">any</em></samp>&rsquo;</dt>
  17882. <dd><p>Generic data muxer.
  17883. </p>
  17884. <p>This muxer accepts a single stream with any codec of any type. The
  17885. input stream has to be selected using the <code class="code">-map</code> option with the
  17886. <code class="command">ffmpeg</code> CLI tool.
  17887. </p>
  17888. <p>No extension is registered so format name has to be supplied e.g. with
  17889. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f data</code>.
  17890. </p>
  17891. </dd>
  17892. <dt>&lsquo;<samp class="samp">dfpwm <em class="emph">audio</em> (dfpwm)</samp>&rsquo;</dt>
  17893. <dd><p>Raw DFPWM1a (Dynamic Filter Pulse With Modulation) audio muxer.
  17894. </p>
  17895. </dd>
  17896. <dt>&lsquo;<samp class="samp">dirac <em class="emph">video</em> (drc, vc2)</samp>&rsquo;</dt>
  17897. <dd><p>BBC Dirac video.
  17898. </p>
  17899. <p>The Dirac Pro codec is a subset and is standardized as SMPTE VC-2.
  17900. </p>
  17901. </dd>
  17902. <dt>&lsquo;<samp class="samp">dnxhd <em class="emph">video</em> (dnxhd, dnxhr)</samp>&rsquo;</dt>
  17903. <dd><p>Avid DNxHD video.
  17904. </p>
  17905. <p>It is standardized as SMPTE VC-3. Accepts DNxHR streams.
  17906. </p>
  17907. </dd>
  17908. <dt>&lsquo;<samp class="samp">dts <em class="emph">audio</em></samp>&rsquo;</dt>
  17909. <dd><p>DTS Coherent Acoustics (DCA) audio
  17910. </p>
  17911. </dd>
  17912. <dt>&lsquo;<samp class="samp">eac3 <em class="emph">audio</em></samp>&rsquo;</dt>
  17913. <dd><p>Dolby Digital Plus, also known as Enhanced AC-3
  17914. </p>
  17915. </dd>
  17916. <dt>&lsquo;<samp class="samp">evc <em class="emph">video</em> (evc)</samp>&rsquo;</dt>
  17917. <dd><p>MPEG-5 Essential Video Coding (EVC) / EVC / MPEG-5 Part 1 EVC video
  17918. </p>
  17919. </dd>
  17920. <dt>&lsquo;<samp class="samp">g722 <em class="emph">audio</em></samp>&rsquo;</dt>
  17921. <dd><p>ITU-T G.722 audio
  17922. </p>
  17923. </dd>
  17924. <dt>&lsquo;<samp class="samp">g723_1 <em class="emph">audio</em> (tco, rco)</samp>&rsquo;</dt>
  17925. <dd><p>ITU-T G.723.1 audio
  17926. </p>
  17927. </dd>
  17928. <dt>&lsquo;<samp class="samp">g726 <em class="emph">audio</em></samp>&rsquo;</dt>
  17929. <dd><p>ITU-T G.726 big-endian (&quot;left-justified&quot;) audio.
  17930. </p>
  17931. <p>No extension is registered so format name has to be supplied e.g. with
  17932. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f g726</code>.
  17933. </p>
  17934. </dd>
  17935. <dt>&lsquo;<samp class="samp">g726le <em class="emph">audio</em></samp>&rsquo;</dt>
  17936. <dd><p>ITU-T G.726 little-endian (&quot;right-justified&quot;) audio.
  17937. </p>
  17938. <p>No extension is registered so format name has to be supplied e.g. with
  17939. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f g726le</code>.
  17940. </p>
  17941. </dd>
  17942. <dt>&lsquo;<samp class="samp">gsm <em class="emph">audio</em></samp>&rsquo;</dt>
  17943. <dd><p>Global System for Mobile Communications audio
  17944. </p>
  17945. </dd>
  17946. <dt>&lsquo;<samp class="samp">h261 <em class="emph">video</em></samp>&rsquo;</dt>
  17947. <dd><p>ITU-T H.261 video
  17948. </p>
  17949. </dd>
  17950. <dt>&lsquo;<samp class="samp">h263 <em class="emph">video</em></samp>&rsquo;</dt>
  17951. <dd><p>ITU-T H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 video
  17952. </p>
  17953. </dd>
  17954. <dt>&lsquo;<samp class="samp">h264 <em class="emph">video</em> (h264, 264)</samp>&rsquo;</dt>
  17955. <dd><p>ITU-T H.264 / MPEG-4 Part 10 AVC video. Bitstream shall be converted
  17956. to Annex B syntax if it&rsquo;s in length-prefixed mode.
  17957. </p>
  17958. </dd>
  17959. <dt>&lsquo;<samp class="samp">hevc <em class="emph">video</em> (hevc, h265, 265)</samp>&rsquo;</dt>
  17960. <dd><p>ITU-T H.265 / MPEG-H Part 2 HEVC video. Bitstream shall be converted
  17961. to Annex B syntax if it&rsquo;s in length-prefixed mode.
  17962. </p>
  17963. </dd>
  17964. <dt>&lsquo;<samp class="samp">m4v <em class="emph">video</em></samp>&rsquo;</dt>
  17965. <dd><p>MPEG-4 Part 2 video
  17966. </p>
  17967. </dd>
  17968. <dt>&lsquo;<samp class="samp">mjpeg <em class="emph">video</em> (mjpg, mjpeg)</samp>&rsquo;</dt>
  17969. <dd><p>Motion JPEG video
  17970. </p>
  17971. </dd>
  17972. <dt>&lsquo;<samp class="samp">mlp <em class="emph">audio</em></samp>&rsquo;</dt>
  17973. <dd><p>Meridian Lossless Packing, also known as Packed PCM
  17974. </p>
  17975. </dd>
  17976. <dt>&lsquo;<samp class="samp">mp2 <em class="emph">audio</em> (mp2, m2a, mpa)</samp>&rsquo;</dt>
  17977. <dd><p>MPEG-1 Audio Layer II audio
  17978. </p>
  17979. </dd>
  17980. <dt>&lsquo;<samp class="samp">mpeg1video <em class="emph">video</em> (mpg, mpeg, m1v)</samp>&rsquo;</dt>
  17981. <dd><p>MPEG-1 Part 2 video.
  17982. </p>
  17983. </dd>
  17984. <dt>&lsquo;<samp class="samp">mpeg2video <em class="emph">video</em> (m2v)</samp>&rsquo;</dt>
  17985. <dd><p>ITU-T H.262 / MPEG-2 Part 2 video
  17986. </p>
  17987. </dd>
  17988. <dt>&lsquo;<samp class="samp">obu <em class="emph">video</em></samp>&rsquo;</dt>
  17989. <dd><p>AV1 low overhead Open Bitstream Units muxer.
  17990. </p>
  17991. <p>Temporal delimiter OBUs will be inserted in all temporal units of the
  17992. stream.
  17993. </p>
  17994. </dd>
  17995. <dt>&lsquo;<samp class="samp">rawvideo <em class="emph">video</em> (yuv, rgb)</samp>&rsquo;</dt>
  17996. <dd><p>Raw uncompressed video.
  17997. </p>
  17998. </dd>
  17999. <dt>&lsquo;<samp class="samp">sbc <em class="emph">audio</em> (sbc, msbc)</samp>&rsquo;</dt>
  18000. <dd><p>Bluetooth SIG low-complexity subband codec audio
  18001. </p>
  18002. </dd>
  18003. <dt>&lsquo;<samp class="samp">truehd <em class="emph">audio</em> (thd)</samp>&rsquo;</dt>
  18004. <dd><p>Dolby TrueHD audio
  18005. </p>
  18006. </dd>
  18007. <dt>&lsquo;<samp class="samp">vc1 <em class="emph">video</em></samp>&rsquo;</dt>
  18008. <dd><p>SMPTE 421M / VC-1 video
  18009. </p></dd>
  18010. </dl>
  18011. <a name="Examples-13"></a>
  18012. <h4 class="subsection">21.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-13" aria-hidden="true">TOC</a></span></h4>
  18013. <ul class="itemize mark-bullet">
  18014. <li>Store raw video frames with the &lsquo;<samp class="samp">rawvideo</samp>&rsquo; muxer using <code class="command">ffmpeg</code>:
  18015. <div class="example">
  18016. <pre class="example-preformatted">ffmpeg -f lavfi -i testsrc -t 10 -s hd1080p testsrc.yuv
  18017. </pre></div>
  18018. <p>Since the rawvideo muxer do not store the information related to size
  18019. and format, this information must be provided when demuxing the file:
  18020. </p><div class="example">
  18021. <pre class="example-preformatted">ffplay -video_size 1920x1080 -pixel_format rgb24 -f rawvideo testsrc.rgb
  18022. </pre></div>
  18023. </li></ul>
  18024. <a name="Raw-PCM-muxers"></a>
  18025. <h3 class="section">21.2 Raw PCM muxers<span class="pull-right"><a class="anchor hidden-xs" href="#Raw-PCM-muxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Raw-PCM-muxers" aria-hidden="true">TOC</a></span></h3>
  18026. <p>This section covers raw PCM (Pulse-Code Modulation) audio muxers.
  18027. </p>
  18028. <p>They accept a single stream matching the designated codec. They do not
  18029. store timestamps or metadata. The recognized extension is the same as
  18030. the muxer name.
  18031. </p>
  18032. <p>It comprises the following muxers. The optional additional extension
  18033. used to automatically select the muxer from the output extension is
  18034. also shown in parentheses.
  18035. </p>
  18036. <dl class="table">
  18037. <dt>&lsquo;<samp class="samp">alaw (al)</samp>&rsquo;</dt>
  18038. <dd><p>PCM A-law
  18039. </p>
  18040. </dd>
  18041. <dt>&lsquo;<samp class="samp">f32be</samp>&rsquo;</dt>
  18042. <dd><p>PCM 32-bit floating-point big-endian
  18043. </p>
  18044. </dd>
  18045. <dt>&lsquo;<samp class="samp">f32le</samp>&rsquo;</dt>
  18046. <dd><p>PCM 32-bit floating-point little-endian
  18047. </p>
  18048. </dd>
  18049. <dt>&lsquo;<samp class="samp">f64be</samp>&rsquo;</dt>
  18050. <dd><p>PCM 64-bit floating-point big-endian
  18051. </p>
  18052. </dd>
  18053. <dt>&lsquo;<samp class="samp">f64le</samp>&rsquo;</dt>
  18054. <dd><p>PCM 64-bit floating-point little-endian
  18055. </p>
  18056. </dd>
  18057. <dt>&lsquo;<samp class="samp">mulaw (ul)</samp>&rsquo;</dt>
  18058. <dd><p>PCM mu-law
  18059. </p>
  18060. </dd>
  18061. <dt>&lsquo;<samp class="samp">s16be</samp>&rsquo;</dt>
  18062. <dd><p>PCM signed 16-bit big-endian
  18063. </p>
  18064. </dd>
  18065. <dt>&lsquo;<samp class="samp">s16le</samp>&rsquo;</dt>
  18066. <dd><p>PCM signed 16-bit little-endian
  18067. </p>
  18068. </dd>
  18069. <dt>&lsquo;<samp class="samp">s24be</samp>&rsquo;</dt>
  18070. <dd><p>PCM signed 24-bit big-endian
  18071. </p>
  18072. </dd>
  18073. <dt>&lsquo;<samp class="samp">s24le</samp>&rsquo;</dt>
  18074. <dd><p>PCM signed 24-bit little-endian
  18075. </p>
  18076. </dd>
  18077. <dt>&lsquo;<samp class="samp">s32be</samp>&rsquo;</dt>
  18078. <dd><p>PCM signed 32-bit big-endian
  18079. </p>
  18080. </dd>
  18081. <dt>&lsquo;<samp class="samp">s32le</samp>&rsquo;</dt>
  18082. <dd><p>PCM signed 32-bit little-endian
  18083. </p>
  18084. </dd>
  18085. <dt>&lsquo;<samp class="samp">s8 (sb)</samp>&rsquo;</dt>
  18086. <dd><p>PCM signed 8-bit
  18087. </p>
  18088. </dd>
  18089. <dt>&lsquo;<samp class="samp">u16be</samp>&rsquo;</dt>
  18090. <dd><p>PCM unsigned 16-bit big-endian
  18091. </p>
  18092. </dd>
  18093. <dt>&lsquo;<samp class="samp">u16le</samp>&rsquo;</dt>
  18094. <dd><p>PCM unsigned 16-bit little-endian
  18095. </p>
  18096. </dd>
  18097. <dt>&lsquo;<samp class="samp">u24be</samp>&rsquo;</dt>
  18098. <dd><p>PCM unsigned 24-bit big-endian
  18099. </p>
  18100. </dd>
  18101. <dt>&lsquo;<samp class="samp">u24le</samp>&rsquo;</dt>
  18102. <dd><p>PCM unsigned 24-bit little-endian
  18103. </p>
  18104. </dd>
  18105. <dt>&lsquo;<samp class="samp">u32be</samp>&rsquo;</dt>
  18106. <dd><p>PCM unsigned 32-bit big-endian
  18107. </p>
  18108. </dd>
  18109. <dt>&lsquo;<samp class="samp">u32le</samp>&rsquo;</dt>
  18110. <dd><p>PCM unsigned 32-bit little-endian
  18111. </p>
  18112. </dd>
  18113. <dt>&lsquo;<samp class="samp">u8 (ub)</samp>&rsquo;</dt>
  18114. <dd><p>PCM unsigned 8-bit
  18115. </p>
  18116. </dd>
  18117. <dt>&lsquo;<samp class="samp">vidc</samp>&rsquo;</dt>
  18118. <dd><p>PCM Archimedes VIDC
  18119. </p></dd>
  18120. </dl>
  18121. <a name="MPEG_002d1_002fMPEG_002d2-program-stream-muxers"></a>
  18122. <h3 class="section">21.3 MPEG-1/MPEG-2 program stream muxers<span class="pull-right"><a class="anchor hidden-xs" href="#MPEG_002d1_002fMPEG_002d2-program-stream-muxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-MPEG_002d1_002fMPEG_002d2-program-stream-muxers" aria-hidden="true">TOC</a></span></h3>
  18123. <p>This section covers formats belonging to the MPEG-1 and MPEG-2 Systems
  18124. family.
  18125. </p>
  18126. <p>The MPEG-1 Systems format (also known as ISO/IEEC 11172-1 or MPEG-1
  18127. program stream) has been adopted for the format of media track stored
  18128. in VCD (Video Compact Disc).
  18129. </p>
  18130. <p>The MPEG-2 Systems standard (also known as ISO/IEEC 13818-1) covers
  18131. two containers formats, one known as transport stream and one known as
  18132. program stream; only the latter is covered here.
  18133. </p>
  18134. <p>The MPEG-2 program stream format (also known as VOB due to the
  18135. corresponding file extension) is an extension of MPEG-1 program
  18136. stream: in addition to support different codecs for the audio and
  18137. video streams, it also stores subtitles and navigation metadata.
  18138. MPEG-2 program stream has been adopted for storing media streams in
  18139. SVCD and DVD storage devices.
  18140. </p>
  18141. <p>This section comprises the following muxers.
  18142. </p>
  18143. <dl class="table">
  18144. <dt>&lsquo;<samp class="samp">mpeg (mpg,mpeg)</samp>&rsquo;</dt>
  18145. <dd><p>MPEG-1 Systems / MPEG-1 program stream muxer.
  18146. </p>
  18147. </dd>
  18148. <dt>&lsquo;<samp class="samp">vcd</samp>&rsquo;</dt>
  18149. <dd><p>MPEG-1 Systems / MPEG-1 program stream (VCD) muxer.
  18150. </p>
  18151. <p>This muxer can be used to generate tracks in the format accepted by
  18152. the VCD (Video Compact Disc) storage devices.
  18153. </p>
  18154. <p>It is the same as the &lsquo;<samp class="samp">mpeg</samp>&rsquo; muxer with a few differences.
  18155. </p>
  18156. </dd>
  18157. <dt>&lsquo;<samp class="samp">vob</samp>&rsquo;</dt>
  18158. <dd><p>MPEG-2 program stream (VOB) muxer.
  18159. </p>
  18160. </dd>
  18161. <dt>&lsquo;<samp class="samp">dvd</samp>&rsquo;</dt>
  18162. <dd><p>MPEG-2 program stream (DVD VOB) muxer.
  18163. </p>
  18164. <p>This muxer can be used to generate tracks in the format accepted by
  18165. the DVD (Digital Versatile Disc) storage devices.
  18166. </p>
  18167. <p>This is the same as the &lsquo;<samp class="samp">vob</samp>&rsquo; muxer with a few differences.
  18168. </p>
  18169. </dd>
  18170. <dt>&lsquo;<samp class="samp">svcd (vob)</samp>&rsquo;</dt>
  18171. <dd><p>MPEG-2 program stream (SVCD VOB) muxer.
  18172. </p>
  18173. <p>This muxer can be used to generate tracks in the format accepted by
  18174. the SVCD (Super Video Compact Disc) storage devices.
  18175. </p>
  18176. <p>This is the same as the &lsquo;<samp class="samp">vob</samp>&rsquo; muxer with a few differences.
  18177. </p></dd>
  18178. </dl>
  18179. <a name="Options-62"></a>
  18180. <h4 class="subsection">21.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-62" aria-hidden="true">TOC</a></span></h4>
  18181. <dl class="table">
  18182. <dt><samp class="option">muxrate <var class="var">rate</var></samp></dt>
  18183. <dd><p>Set user-defined mux rate expressed as a number of bits/s. If not
  18184. specified the automatically computed mux rate is employed. Default value
  18185. is <code class="code">0</code>.
  18186. </p>
  18187. </dd>
  18188. <dt><samp class="option">preload <var class="var">delay</var></samp></dt>
  18189. <dd><p>Set initial demux-decode delay in microseconds. Default value is
  18190. <code class="code">500000</code>.
  18191. </p></dd>
  18192. </dl>
  18193. <a name="MOV_002fMPEG_002d4_002fISOMBFF-muxers"></a>
  18194. <h3 class="section">21.4 MOV/MPEG-4/ISOMBFF muxers<span class="pull-right"><a class="anchor hidden-xs" href="#MOV_002fMPEG_002d4_002fISOMBFF-muxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-MOV_002fMPEG_002d4_002fISOMBFF-muxers" aria-hidden="true">TOC</a></span></h3>
  18195. <p>This section covers formats belonging to the QuickTime / MOV family,
  18196. including the MPEG-4 Part 14 format and ISO base media file format
  18197. (ISOBMFF). These formats share a common structure based on the ISO
  18198. base media file format (ISOBMFF).
  18199. </p>
  18200. <p>The MOV format was originally developed for use with Apple QuickTime.
  18201. It was later used as the basis for the MPEG-4 Part 1 (later Part 14)
  18202. format, also known as ISO/IEC 14496-1. That format was then
  18203. generalized into ISOBMFF, also named MPEG-4 Part 12 format, ISO/IEC
  18204. 14496-12, or ISO/IEC 15444-12.
  18205. </p>
  18206. <p>It comprises the following muxers.
  18207. </p>
  18208. <dl class="table">
  18209. <dt>&lsquo;<samp class="samp">3gp</samp>&rsquo;</dt>
  18210. <dd><p>Third Generation Partnership Project (3GPP) format for 3G UMTS
  18211. multimedia services
  18212. </p>
  18213. </dd>
  18214. <dt>&lsquo;<samp class="samp">3g2</samp>&rsquo;</dt>
  18215. <dd><p>Third Generation Partnership Project 2 (3GP2 or 3GPP2) format for 3G
  18216. CDMA2000 multimedia services, similar to &lsquo;<samp class="samp">3gp</samp>&rsquo; with extensions
  18217. and limitations
  18218. </p>
  18219. </dd>
  18220. <dt>&lsquo;<samp class="samp">f4v</samp>&rsquo;</dt>
  18221. <dd><p>Adobe Flash Video format
  18222. </p>
  18223. </dd>
  18224. <dt>&lsquo;<samp class="samp">ipod</samp>&rsquo;</dt>
  18225. <dd><p>MPEG-4 audio file format, as MOV/MP4 but limited to contain only audio
  18226. streams, typically played with the Apple ipod device
  18227. </p>
  18228. </dd>
  18229. <dt>&lsquo;<samp class="samp">ismv</samp>&rsquo;</dt>
  18230. <dd><p>Microsoft IIS (Internet Information Services) Smooth Streaming
  18231. Audio/Video (ISMV or ISMA) format. This is based on MPEG-4 Part 14
  18232. format with a few incompatible variants, used to stream media files
  18233. for the Microsoft IIS server.
  18234. </p>
  18235. </dd>
  18236. <dt>&lsquo;<samp class="samp">mov</samp>&rsquo;</dt>
  18237. <dd><p>QuickTime player format identified by the <code class="code">.mov</code> extension
  18238. </p>
  18239. </dd>
  18240. <dt>&lsquo;<samp class="samp">mp4</samp>&rsquo;</dt>
  18241. <dd><p>MP4 or MPEG-4 Part 14 format
  18242. </p>
  18243. </dd>
  18244. <dt>&lsquo;<samp class="samp">psp</samp>&rsquo;</dt>
  18245. <dd><p>PlayStation Portable MP4/MPEG-4 Part 14 format variant. This is based
  18246. on MPEG-4 Part 14 format with a few incompatible variants, used to
  18247. play files on PlayStation devices.
  18248. </p></dd>
  18249. </dl>
  18250. <a name="Fragmentation"></a>
  18251. <h4 class="subsection">21.4.1 Fragmentation<span class="pull-right"><a class="anchor hidden-xs" href="#Fragmentation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Fragmentation" aria-hidden="true">TOC</a></span></h4>
  18252. <p>The &lsquo;<samp class="samp">mov</samp>&rsquo;, &lsquo;<samp class="samp">mp4</samp>&rsquo;, and &lsquo;<samp class="samp">ismv</samp>&rsquo; muxers support
  18253. fragmentation. Normally, a MOV/MP4 file has all the metadata about all
  18254. packets stored in one location.
  18255. </p>
  18256. <p>This data is usually written at the end of the file, but it can be
  18257. moved to the start for better playback by adding <code class="code">+faststart</code> to
  18258. the <code class="code">-movflags</code>, or using the <code class="command">qt-faststart</code> tool).
  18259. </p>
  18260. <p>A fragmented file consists of a number of fragments, where packets and
  18261. metadata about these packets are stored together. Writing a fragmented
  18262. file has the advantage that the file is decodable even if the writing
  18263. is interrupted (while a normal MOV/MP4 is undecodable if it is not
  18264. properly finished), and it requires less memory when writing very long
  18265. files (since writing normal MOV/MP4 files stores info about every
  18266. single packet in memory until the file is closed). The downside is
  18267. that it is less compatible with other applications.
  18268. </p>
  18269. <p>Fragmentation is enabled by setting one of the options that define
  18270. how to cut the file into fragments:
  18271. </p><dl class="table">
  18272. <dt><samp class="option">frag_duration</samp></dt>
  18273. <dt><samp class="option">frag_size</samp></dt>
  18274. <dt><samp class="option">min_frag_duration</samp></dt>
  18275. <dt><samp class="option">movflags +frag_keyframe</samp></dt>
  18276. <dt><samp class="option">movflags +frag_custom</samp></dt>
  18277. </dl>
  18278. <p>If more than one condition is specified, fragments are cut when one of
  18279. the specified conditions is fulfilled. The exception to this is the
  18280. option <samp class="option">min_frag_duration</samp>, which has to be fulfilled for any
  18281. of the other conditions to apply.
  18282. </p>
  18283. <a name="Options-63"></a>
  18284. <h4 class="subsection">21.4.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-63" aria-hidden="true">TOC</a></span></h4>
  18285. <dl class="table">
  18286. <dt><samp class="option">brand <var class="var">brand_string</var></samp></dt>
  18287. <dd><p>Override major brand.
  18288. </p>
  18289. </dd>
  18290. <dt><samp class="option">empty_hdlr_name <var class="var">bool</var></samp></dt>
  18291. <dd><p>Enable to skip writing the name inside a <code class="code">hdlr</code> box.
  18292. Default is <code class="code">false</code>.
  18293. </p>
  18294. </dd>
  18295. <dt><samp class="option">encryption_key <var class="var">key</var></samp></dt>
  18296. <dd><p>set the media encryption key in hexadecimal format
  18297. </p>
  18298. </dd>
  18299. <dt><samp class="option">encryption_kid <var class="var">kid</var></samp></dt>
  18300. <dd><p>set the media encryption key identifier in hexadecimal format
  18301. </p>
  18302. </dd>
  18303. <dt><samp class="option">encryption_scheme <var class="var">scheme</var></samp></dt>
  18304. <dd><p>configure the encryption scheme, allowed values are &lsquo;<samp class="samp">none</samp>&rsquo;, and
  18305. &lsquo;<samp class="samp">cenc-aes-ctr</samp>&rsquo;
  18306. </p>
  18307. </dd>
  18308. <dt><samp class="option">frag_duration <var class="var">duration</var></samp></dt>
  18309. <dd><p>Create fragments that are <var class="var">duration</var> microseconds long.
  18310. </p>
  18311. </dd>
  18312. <dt><samp class="option">frag_interleave <var class="var">number</var></samp></dt>
  18313. <dd><p>Interleave samples within fragments (max number of consecutive
  18314. samples, lower is tighter interleaving, but with more overhead. It is
  18315. set to <code class="code">0</code> by default.
  18316. </p>
  18317. </dd>
  18318. <dt><samp class="option">frag_size <var class="var">size</var></samp></dt>
  18319. <dd><p>create fragments that contain up to <var class="var">size</var> bytes of payload data
  18320. </p>
  18321. </dd>
  18322. <dt><samp class="option">iods_audio_profile <var class="var">profile</var></samp></dt>
  18323. <dd><p>specify iods number for the audio profile atom (from -1 to 255),
  18324. default is <code class="code">-1</code>
  18325. </p>
  18326. </dd>
  18327. <dt><samp class="option">iods_video_profile <var class="var">profile</var></samp></dt>
  18328. <dd><p>specify iods number for the video profile atom (from -1 to 255),
  18329. default is <code class="code">-1</code>
  18330. </p>
  18331. </dd>
  18332. <dt><samp class="option">ism_lookahead <var class="var">num_entries</var></samp></dt>
  18333. <dd><p>specify number of lookahead entries for ISM files (from 0 to 255),
  18334. default is <code class="code">0</code>
  18335. </p>
  18336. </dd>
  18337. <dt><samp class="option">min_frag_duration <var class="var">duration</var></samp></dt>
  18338. <dd><p>do not create fragments that are shorter than <var class="var">duration</var> microseconds long
  18339. </p>
  18340. </dd>
  18341. <dt><samp class="option">moov_size <var class="var">bytes</var></samp></dt>
  18342. <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
  18343. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  18344. </p>
  18345. </dd>
  18346. <dt><samp class="option">mov_gamma <var class="var">gamma</var></samp></dt>
  18347. <dd><p>specify gamma value for gama atom (as a decimal number from 0 to 10),
  18348. default is <code class="code">0.0</code>, must be set together with <code class="code">+ movflags</code>
  18349. </p>
  18350. </dd>
  18351. <dt><samp class="option">movflags <var class="var">flags</var></samp></dt>
  18352. <dd><p>Set various muxing switches. The following flags can be used:
  18353. </p><dl class="table">
  18354. <dt>&lsquo;<samp class="samp">cmaf</samp>&rsquo;</dt>
  18355. <dd><p>write CMAF (Common Media Application Format) compatible fragmented
  18356. MP4 output
  18357. </p>
  18358. </dd>
  18359. <dt>&lsquo;<samp class="samp">dash</samp>&rsquo;</dt>
  18360. <dd><p>write DASH (Dynamic Adaptive Streaming over HTTP) compatible fragmented
  18361. MP4 output
  18362. </p>
  18363. </dd>
  18364. <dt>&lsquo;<samp class="samp">default_base_moof</samp>&rsquo;</dt>
  18365. <dd><p>Similarly to the &lsquo;<samp class="samp">omit_tfhd_offset</samp>&rsquo; flag, this flag avoids
  18366. writing the absolute base_data_offset field in tfhd atoms, but does so
  18367. by using the new default-base-is-moof flag instead. This flag is new
  18368. from 14496-12:2012. This may make the fragments easier to parse in
  18369. certain circumstances (avoiding basing track fragment location
  18370. calculations on the implicit end of the previous track fragment).
  18371. </p>
  18372. </dd>
  18373. <dt>&lsquo;<samp class="samp">delay_moov</samp>&rsquo;</dt>
  18374. <dd><p>delay writing the initial moov until the first fragment is cut, or
  18375. until the first fragment flush
  18376. </p>
  18377. </dd>
  18378. <dt>&lsquo;<samp class="samp">disable_chpl</samp>&rsquo;</dt>
  18379. <dd><p>Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  18380. and a QuickTime chapter track are written to the file. With this
  18381. option set, only the QuickTime chapter track will be written. Nero
  18382. chapters can cause failures when the file is reprocessed with certain
  18383. tagging programs, like mp3Tag 2.61a and iTunes 11.3, most likely other
  18384. versions are affected as well.
  18385. </p>
  18386. </dd>
  18387. <dt>&lsquo;<samp class="samp">faststart</samp>&rsquo;</dt>
  18388. <dd><p>Run a second pass moving the index (moov atom) to the beginning of the
  18389. file. This operation can take a while, and will not work in various
  18390. situations such as fragmented output, thus it is not enabled by
  18391. default.
  18392. </p>
  18393. </dd>
  18394. <dt>&lsquo;<samp class="samp">frag_custom</samp>&rsquo;</dt>
  18395. <dd><p>Allow the caller to manually choose when to cut fragments, by calling
  18396. <code class="code">av_write_frame(ctx, NULL)</code> to write a fragment with the packets
  18397. written so far. (This is only useful with other applications
  18398. integrating libavformat, not from <code class="command">ffmpeg</code>.)
  18399. </p>
  18400. </dd>
  18401. <dt>&lsquo;<samp class="samp">frag_discont</samp>&rsquo;</dt>
  18402. <dd><p>signal that the next fragment is discontinuous from earlier ones
  18403. </p>
  18404. </dd>
  18405. <dt>&lsquo;<samp class="samp">frag_every_frame</samp>&rsquo;</dt>
  18406. <dd><p>fragment at every frame
  18407. </p>
  18408. </dd>
  18409. <dt>&lsquo;<samp class="samp">frag_keyframe</samp>&rsquo;</dt>
  18410. <dd><p>start a new fragment at each video keyframe
  18411. </p>
  18412. </dd>
  18413. <dt>&lsquo;<samp class="samp">global_sidx</samp>&rsquo;</dt>
  18414. <dd><p>write a global sidx index at the start of the file
  18415. </p>
  18416. </dd>
  18417. <dt>&lsquo;<samp class="samp">isml</samp>&rsquo;</dt>
  18418. <dd><p>create a live smooth streaming feed (for pushing to a publishing point)
  18419. </p>
  18420. </dd>
  18421. <dt>&lsquo;<samp class="samp">negative_cts_offsets</samp>&rsquo;</dt>
  18422. <dd><p>Enables utilization of version 1 of the CTTS box, in which the CTS offsets can
  18423. be negative. This enables the initial sample to have DTS/CTS of zero, and
  18424. reduces the need for edit lists for some cases such as video tracks with
  18425. B-frames. Additionally, eases conformance with the DASH-IF interoperability
  18426. guidelines.
  18427. </p>
  18428. <p>This option is implicitly set when writing &lsquo;<samp class="samp">ismv</samp>&rsquo; (Smooth
  18429. Streaming) files.
  18430. </p>
  18431. </dd>
  18432. <dt>&lsquo;<samp class="samp">omit_tfhd_offset</samp>&rsquo;</dt>
  18433. <dd><p>Do not write any absolute base_data_offset in tfhd atoms. This avoids
  18434. tying fragments to absolute byte positions in the file/streams.
  18435. </p>
  18436. </dd>
  18437. <dt>&lsquo;<samp class="samp">prefer_icc</samp>&rsquo;</dt>
  18438. <dd><p>If writing colr atom prioritise usage of ICC profile if it exists in
  18439. stream packet side data.
  18440. </p>
  18441. </dd>
  18442. <dt>&lsquo;<samp class="samp">rtphint</samp>&rsquo;</dt>
  18443. <dd><p>add RTP hinting tracks to the output file
  18444. </p>
  18445. </dd>
  18446. <dt>&lsquo;<samp class="samp">separate_moof</samp>&rsquo;</dt>
  18447. <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
  18448. packets for all tracks are written in a moof atom (which is slightly
  18449. more efficient), but with this option set, the muxer writes one
  18450. moof/mdat pair for each track, making it easier to separate tracks.
  18451. </p>
  18452. </dd>
  18453. <dt>&lsquo;<samp class="samp">skip_sidx</samp>&rsquo;</dt>
  18454. <dd><p>Skip writing of sidx atom. When bitrate overhead due to sidx atom is
  18455. high, this option could be used for cases where sidx atom is not
  18456. mandatory. When the &lsquo;<samp class="samp">global_sidx</samp>&rsquo; flag is enabled, this option
  18457. is ignored.
  18458. </p>
  18459. </dd>
  18460. <dt>&lsquo;<samp class="samp">skip_trailer</samp>&rsquo;</dt>
  18461. <dd><p>skip writing the mfra/tfra/mfro trailer for fragmented files
  18462. </p>
  18463. </dd>
  18464. <dt>&lsquo;<samp class="samp">use_metadata_tags</samp>&rsquo;</dt>
  18465. <dd><p>use mdta atom for metadata
  18466. </p>
  18467. </dd>
  18468. <dt>&lsquo;<samp class="samp">write_colr</samp>&rsquo;</dt>
  18469. <dd><p>write colr atom even if the color info is unspecified. This flag is
  18470. experimental, may be renamed or changed, do not use from scripts.
  18471. </p>
  18472. </dd>
  18473. <dt>&lsquo;<samp class="samp">write_gama</samp>&rsquo;</dt>
  18474. <dd><p>write deprecated gama atom
  18475. </p>
  18476. </dd>
  18477. <dt>&lsquo;<samp class="samp">hybrid_fragmented</samp>&rsquo;</dt>
  18478. <dd><p>For recoverability - write the output file as a fragmented file.
  18479. This allows the intermediate file to be read while being written
  18480. (in particular, if the writing process is aborted uncleanly). When
  18481. writing is finished, the file is converted to a regular, non-fragmented
  18482. file, which is more compatible and allows easier and quicker seeking.
  18483. </p>
  18484. <p>If writing is aborted, the intermediate file can manually be
  18485. remuxed to get a regular, non-fragmented file of what had been
  18486. written into the unfinished file.
  18487. </p></dd>
  18488. </dl>
  18489. </dd>
  18490. <dt><samp class="option">movie_timescale <var class="var">scale</var></samp></dt>
  18491. <dd><p>Set the timescale written in the movie header box (<code class="code">mvhd</code>).
  18492. Range is 1 to INT_MAX. Default is <code class="code">1000</code>.
  18493. </p>
  18494. </dd>
  18495. <dt><samp class="option">rtpflags <var class="var">flags</var></samp></dt>
  18496. <dd><p>Add RTP hinting tracks to the output file.
  18497. </p>
  18498. <p>The following flags can be used:
  18499. </p><dl class="table">
  18500. <dt>&lsquo;<samp class="samp">h264_mode0</samp>&rsquo;</dt>
  18501. <dd><p>use mode 0 for H.264 in RTP
  18502. </p>
  18503. </dd>
  18504. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  18505. <dd><p>use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC
  18506. </p>
  18507. </dd>
  18508. <dt>&lsquo;<samp class="samp">rfc2190</samp>&rsquo;</dt>
  18509. <dd><p>use RFC 2190 packetization instead of RFC 4629 for H.263
  18510. </p>
  18511. </dd>
  18512. <dt>&lsquo;<samp class="samp">send_bye</samp>&rsquo;</dt>
  18513. <dd><p>send RTCP BYE packets when finishing
  18514. </p>
  18515. </dd>
  18516. <dt>&lsquo;<samp class="samp">skip_rtcp</samp>&rsquo;</dt>
  18517. <dd><p>do not send RTCP sender reports
  18518. </p></dd>
  18519. </dl>
  18520. </dd>
  18521. <dt><samp class="option">skip_iods <var class="var">bool</var></samp></dt>
  18522. <dd><p>skip writing iods atom (default value is <code class="code">true</code>)
  18523. </p>
  18524. </dd>
  18525. <dt><samp class="option">use_editlist <var class="var">bool</var></samp></dt>
  18526. <dd><p>use edit list (default value is <code class="code">auto</code>)
  18527. </p>
  18528. </dd>
  18529. <dt><samp class="option">use_stream_ids_as_track_ids <var class="var">bool</var></samp></dt>
  18530. <dd><p>use stream ids as track ids (default value is <code class="code">false</code>)
  18531. </p>
  18532. </dd>
  18533. <dt><samp class="option">video_track_timescale <var class="var">scale</var></samp></dt>
  18534. <dd><p>Set the timescale used for video tracks. Range is <code class="code">0</code> to INT_MAX. If
  18535. set to <code class="code">0</code>, the timescale is automatically set based on the
  18536. native stream time base. Default is <code class="code">0</code>.
  18537. </p>
  18538. </dd>
  18539. <dt><samp class="option">write_btrt <var class="var">bool</var></samp></dt>
  18540. <dd><p>Force or disable writing bitrate box inside stsd box of a track. The
  18541. box contains decoding buffer size (in bytes), maximum bitrate and
  18542. average bitrate for the track. The box will be skipped if none of
  18543. these values can be computed. Default is <code class="code">-1</code> or <code class="code">auto</code>,
  18544. which will write the box only in MP4 mode.
  18545. </p>
  18546. </dd>
  18547. <dt><samp class="option">write_prft <var class="var">option</var></samp></dt>
  18548. <dd><p>Write producer time reference box (PRFT) with a specified time source for the
  18549. NTP field in the PRFT box. Set value as &lsquo;<samp class="samp">wallclock</samp>&rsquo; to specify timesource
  18550. as wallclock time and &lsquo;<samp class="samp">pts</samp>&rsquo; to specify timesource as input packets&rsquo; PTS
  18551. values.
  18552. </p>
  18553. </dd>
  18554. <dt><samp class="option">write_tmcd <var class="var">bool</var></samp></dt>
  18555. <dd><p>Specify <code class="code">on</code> to force writing a timecode track, <code class="code">off</code> to disable it
  18556. and <code class="code">auto</code> to write a timecode track only for mov and mp4 output (default).
  18557. </p>
  18558. <p>Setting value to &lsquo;<samp class="samp">pts</samp>&rsquo; is applicable only for a live encoding use case,
  18559. where PTS values are set as as wallclock time at the source. For example, an
  18560. encoding use case with decklink capture source where <samp class="option">video_pts</samp> and
  18561. <samp class="option">audio_pts</samp> are set to &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  18562. </p></dd>
  18563. </dl>
  18564. <a name="Examples-14"></a>
  18565. <h4 class="subsection">21.4.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-14" aria-hidden="true">TOC</a></span></h4>
  18566. <ul class="itemize mark-bullet">
  18567. <li>Push Smooth Streaming content in real time to a publishing point on
  18568. IIS with the &lsquo;<samp class="samp">ismv</samp>&rsquo; muxer using <code class="command">ffmpeg</code>:
  18569. <div class="example">
  18570. <pre class="example-preformatted">ffmpeg -re <var class="var">&lt;normal input/transcoding options&gt;</var> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  18571. </pre></div>
  18572. </li></ul>
  18573. <a class="anchor" id="a64"></a><a name="a64-1"></a>
  18574. <h3 class="section">21.5 a64<span class="pull-right"><a class="anchor hidden-xs" href="#a64-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-a64-1" aria-hidden="true">TOC</a></span></h3>
  18575. <p>A64 Commodore 64 video muxer.
  18576. </p>
  18577. <p>This muxer accepts a single <code class="code">a64_multi</code> or <code class="code">a64_multi5</code>
  18578. codec video stream.
  18579. </p>
  18580. <a name="ac4"></a>
  18581. <h3 class="section">21.6 ac4<span class="pull-right"><a class="anchor hidden-xs" href="#ac4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ac4" aria-hidden="true">TOC</a></span></h3>
  18582. <p>Raw AC-4 audio muxer.
  18583. </p>
  18584. <p>This muxer accepts a single <code class="code">ac4</code> audio stream.
  18585. </p>
  18586. <a name="Options-64"></a>
  18587. <h4 class="subsection">21.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-64" aria-hidden="true">TOC</a></span></h4>
  18588. <dl class="table">
  18589. <dt><samp class="option">write_crc <var class="var">bool</var></samp></dt>
  18590. <dd><p>when enabled, write a CRC checksum for each packet to the output,
  18591. default is <code class="code">false</code>
  18592. </p></dd>
  18593. </dl>
  18594. <a class="anchor" id="adts"></a><a name="adts-1"></a>
  18595. <h3 class="section">21.7 adts<span class="pull-right"><a class="anchor hidden-xs" href="#adts-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adts-1" aria-hidden="true">TOC</a></span></h3>
  18596. <p>Audio Data Transport Stream muxer.
  18597. </p>
  18598. <p>It accepts a single AAC stream.
  18599. </p>
  18600. <a name="Options-65"></a>
  18601. <h4 class="subsection">21.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-65" aria-hidden="true">TOC</a></span></h4>
  18602. <dl class="table">
  18603. <dt><samp class="option">write_id3v2 <var class="var">bool</var></samp></dt>
  18604. <dd><p>Enable to write ID3v2.4 tags at the start of the stream. Default is
  18605. disabled.
  18606. </p>
  18607. </dd>
  18608. <dt><samp class="option">write_apetag <var class="var">bool</var></samp></dt>
  18609. <dd><p>Enable to write APE tags at the end of the stream. Default is
  18610. disabled.
  18611. </p>
  18612. </dd>
  18613. <dt><samp class="option">write_mpeg2 <var class="var">bool</var></samp></dt>
  18614. <dd><p>Enable to set MPEG version bit in the ADTS frame header to 1 which
  18615. indicates MPEG-2. Default is 0, which indicates MPEG-4.
  18616. </p></dd>
  18617. </dl>
  18618. <a class="anchor" id="aea"></a><a name="aea-1"></a>
  18619. <h3 class="section">21.8 aea<span class="pull-right"><a class="anchor hidden-xs" href="#aea-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aea-1" aria-hidden="true">TOC</a></span></h3>
  18620. <p>MD STUDIO audio muxer.
  18621. </p>
  18622. <p>This muxer accepts a single ATRAC1 audio stream with either one or two channels
  18623. and a sample rate of 44100Hz.
  18624. </p>
  18625. <p>As AEA supports storing the track title, this muxer will also write
  18626. the title from stream&rsquo;s metadata to the container.
  18627. </p>
  18628. <a class="anchor" id="aiff"></a><a name="aiff-1"></a>
  18629. <h3 class="section">21.9 aiff<span class="pull-right"><a class="anchor hidden-xs" href="#aiff-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aiff-1" aria-hidden="true">TOC</a></span></h3>
  18630. <p>Audio Interchange File Format muxer.
  18631. </p>
  18632. <a name="Options-66"></a>
  18633. <h4 class="subsection">21.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-66" aria-hidden="true">TOC</a></span></h4>
  18634. <dl class="table">
  18635. <dt><samp class="option">write_id3v2 <var class="var">bool</var></samp></dt>
  18636. <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  18637. </p>
  18638. </dd>
  18639. <dt><samp class="option">id3v2_version <var class="var">bool</var></samp></dt>
  18640. <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  18641. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  18642. </p></dd>
  18643. </dl>
  18644. <a class="anchor" id="alp"></a><a name="alp-1"></a>
  18645. <h3 class="section">21.10 alp<span class="pull-right"><a class="anchor hidden-xs" href="#alp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alp-1" aria-hidden="true">TOC</a></span></h3>
  18646. <p>High Voltage Software&rsquo;s Lego Racers game audio muxer.
  18647. </p>
  18648. <p>It accepts a single ADPCM_IMA_ALP stream with no more than 2 channels
  18649. and a sample rate not greater than 44100 Hz.
  18650. </p>
  18651. <p>Extensions: <code class="code">tun</code>, <code class="code">pcm</code>
  18652. </p>
  18653. <a name="Options-67"></a>
  18654. <h4 class="subsection">21.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-67" aria-hidden="true">TOC</a></span></h4>
  18655. <dl class="table">
  18656. <dt><samp class="option">type <var class="var">type</var></samp></dt>
  18657. <dd><p>Set file type.
  18658. </p>
  18659. <p><var class="var">type</var> accepts the following values:
  18660. </p><dl class="table">
  18661. <dt>&lsquo;<samp class="samp">tun</samp>&rsquo;</dt>
  18662. <dd><p>Set file type as music. Must have a sample rate of 22050 Hz.
  18663. </p>
  18664. </dd>
  18665. <dt>&lsquo;<samp class="samp">pcm</samp>&rsquo;</dt>
  18666. <dd><p>Set file type as sfx.
  18667. </p>
  18668. </dd>
  18669. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  18670. <dd><p>Set file type as per output file extension. <code class="code">.pcm</code> results in
  18671. type <code class="code">pcm</code> else type <code class="code">tun</code> is set. <var class="var">(default)</var>
  18672. </p></dd>
  18673. </dl>
  18674. </dd>
  18675. </dl>
  18676. <a name="amr"></a>
  18677. <h3 class="section">21.11 amr<span class="pull-right"><a class="anchor hidden-xs" href="#amr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amr" aria-hidden="true">TOC</a></span></h3>
  18678. <p>3GPP AMR (Adaptive Multi-Rate) audio muxer.
  18679. </p>
  18680. <p>It accepts a single audio stream containing an AMR NB stream.
  18681. </p>
  18682. <a name="amv"></a>
  18683. <h3 class="section">21.12 amv<span class="pull-right"><a class="anchor hidden-xs" href="#amv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amv" aria-hidden="true">TOC</a></span></h3>
  18684. <p>AMV (Actions Media Video) format muxer.
  18685. </p>
  18686. <a name="apm"></a>
  18687. <h3 class="section">21.13 apm<span class="pull-right"><a class="anchor hidden-xs" href="#apm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apm" aria-hidden="true">TOC</a></span></h3>
  18688. <p>Ubisoft Rayman 2 APM audio muxer.
  18689. </p>
  18690. <p>It accepts a single ADPCM IMA APM audio stream.
  18691. </p>
  18692. <a name="apng-1"></a>
  18693. <h3 class="section">21.14 apng<span class="pull-right"><a class="anchor hidden-xs" href="#apng-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apng-1" aria-hidden="true">TOC</a></span></h3>
  18694. <p>Animated Portable Network Graphics muxer.
  18695. </p>
  18696. <p>It accepts a single APNG video stream.
  18697. </p>
  18698. <a name="Options-68"></a>
  18699. <h4 class="subsection">21.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-68" aria-hidden="true">TOC</a></span></h4>
  18700. <dl class="table">
  18701. <dt><samp class="option">final_delay <var class="var">delay</var></samp></dt>
  18702. <dd><p>Force a delay expressed in seconds after the last frame of each
  18703. repetition. Default value is <code class="code">0.0</code>.
  18704. </p>
  18705. </dd>
  18706. <dt><samp class="option">plays <var class="var">repetitions</var></samp></dt>
  18707. <dd><p>specify how many times to play the content, <code class="code">0</code> causes an infinite
  18708. loop, with <code class="code">1</code> there is no loop
  18709. </p></dd>
  18710. </dl>
  18711. <a name="Examples-15"></a>
  18712. <h4 class="subsection">21.14.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-15" aria-hidden="true">TOC</a></span></h4>
  18713. <ul class="itemize mark-bullet">
  18714. <li>Use <code class="command">ffmpeg</code> to generate an APNG output with 2 repetitions,
  18715. and with a delay of half a second after the first repetition:
  18716. <div class="example">
  18717. <pre class="example-preformatted">ffmpeg -i INPUT -final_delay 0.5 -plays 2 out.apng
  18718. </pre></div>
  18719. </li></ul>
  18720. <a name="argo_005fasf"></a>
  18721. <h3 class="section">21.15 argo_asf<span class="pull-right"><a class="anchor hidden-xs" href="#argo_005fasf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-argo_005fasf" aria-hidden="true">TOC</a></span></h3>
  18722. <p>Argonaut Games ASF audio muxer.
  18723. </p>
  18724. <p>It accepts a single ADPCM audio stream.
  18725. </p>
  18726. <a name="Options-69"></a>
  18727. <h4 class="subsection">21.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-69" aria-hidden="true">TOC</a></span></h4>
  18728. <dl class="table">
  18729. <dt><samp class="option">version_major <var class="var">version</var></samp></dt>
  18730. <dd><p>override file major version, specified as an integer, default value is
  18731. <code class="code">2</code>
  18732. </p>
  18733. </dd>
  18734. <dt><samp class="option">version_minor <var class="var">version</var></samp></dt>
  18735. <dd><p>override file minor version, specified as an integer, default value is
  18736. <code class="code">1</code>
  18737. </p>
  18738. </dd>
  18739. <dt><samp class="option">name <var class="var">name</var></samp></dt>
  18740. <dd><p>Embed file name into file, if not specified use the output file
  18741. name. The name is truncated to 8 characters.
  18742. </p></dd>
  18743. </dl>
  18744. <a name="argo_005fcvg"></a>
  18745. <h3 class="section">21.16 argo_cvg<span class="pull-right"><a class="anchor hidden-xs" href="#argo_005fcvg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-argo_005fcvg" aria-hidden="true">TOC</a></span></h3>
  18746. <p>Argonaut Games CVG audio muxer.
  18747. </p>
  18748. <p>It accepts a single one-channel ADPCM 22050Hz audio stream.
  18749. </p>
  18750. <p>The <samp class="option">loop</samp> and <samp class="option">reverb</samp> options set the corresponding
  18751. flags in the header which can be later retrieved to process the audio
  18752. stream accordingly.
  18753. </p>
  18754. <a name="Options-70"></a>
  18755. <h4 class="subsection">21.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-70" aria-hidden="true">TOC</a></span></h4>
  18756. <dl class="table">
  18757. <dt><samp class="option">skip_rate_check <var class="var">bool</var></samp></dt>
  18758. <dd><p>skip sample rate check (default is <code class="code">false</code>)
  18759. </p>
  18760. </dd>
  18761. <dt><samp class="option">loop <var class="var">bool</var></samp></dt>
  18762. <dd><p>set loop flag (default is <code class="code">false</code>)
  18763. </p>
  18764. </dd>
  18765. <dt><samp class="option">reverb <var class="var">boolean</var></samp></dt>
  18766. <dd><p>set reverb flag (default is <code class="code">true</code>)
  18767. </p></dd>
  18768. </dl>
  18769. <a class="anchor" id="asf"></a><a name="asf_002c-asf_005fstream"></a>
  18770. <h3 class="section">21.17 asf, asf_stream<span class="pull-right"><a class="anchor hidden-xs" href="#asf_002c-asf_005fstream" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asf_002c-asf_005fstream" aria-hidden="true">TOC</a></span></h3>
  18771. <p>Advanced / Active Systems (or Streaming) Format audio muxer.
  18772. </p>
  18773. <p>The &lsquo;<samp class="samp">asf_stream</samp>&rsquo; variant should be selected for streaming.
  18774. </p>
  18775. <p>Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
  18776. muxer too.
  18777. </p>
  18778. <a name="Options-71"></a>
  18779. <h4 class="subsection">21.17.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-71" aria-hidden="true">TOC</a></span></h4>
  18780. <dl class="table">
  18781. <dt><samp class="option">packet_size <var class="var">size</var></samp></dt>
  18782. <dd><p>Set the muxer packet size as a number of bytes. By tuning this setting
  18783. you may reduce data fragmentation or muxer overhead depending on your
  18784. source. Default value is <code class="code">3200</code>, minimum is <code class="code">100</code>, maximum
  18785. is <code class="code">64Ki</code>.
  18786. </p></dd>
  18787. </dl>
  18788. <a name="ass"></a>
  18789. <h3 class="section">21.18 ass<span class="pull-right"><a class="anchor hidden-xs" href="#ass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ass" aria-hidden="true">TOC</a></span></h3>
  18790. <p>ASS/SSA (SubStation Alpha) subtitles muxer.
  18791. </p>
  18792. <p>It accepts a single ASS subtitles stream.
  18793. </p>
  18794. <a name="Options-72"></a>
  18795. <h4 class="subsection">21.18.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-72" aria-hidden="true">TOC</a></span></h4>
  18796. <dl class="table">
  18797. <dt><samp class="option">ignore_readorder <var class="var">bool</var></samp></dt>
  18798. <dd><p>Write dialogue events immediately, even if they are out-of-order,
  18799. default is <code class="code">false</code>, otherwise they are cached until the expected
  18800. time event is found.
  18801. </p></dd>
  18802. </dl>
  18803. <a name="ast"></a>
  18804. <h3 class="section">21.19 ast<span class="pull-right"><a class="anchor hidden-xs" href="#ast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ast" aria-hidden="true">TOC</a></span></h3>
  18805. <p>AST (Audio Stream) muxer.
  18806. </p>
  18807. <p>This format is used to play audio on some Nintendo Wii games.
  18808. </p>
  18809. <p>It accepts a single audio stream.
  18810. </p>
  18811. <p>The <samp class="option">loopstart</samp> and <samp class="option">loopend</samp> options can be used to
  18812. define a section of the file to loop for players honoring such
  18813. options.
  18814. </p>
  18815. <a name="Options-73"></a>
  18816. <h4 class="subsection">21.19.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-73" aria-hidden="true">TOC</a></span></h4>
  18817. <dl class="table">
  18818. <dt><samp class="option">loopstart <var class="var">start</var></samp></dt>
  18819. <dd><p>Specify loop start position expressesd in milliseconds, from <code class="code">-1</code>
  18820. to <code class="code">INT_MAX</code>, in case <code class="code">-1</code> is set then no loop is specified
  18821. (default -1) and the <samp class="option">loopend</samp> value is ignored.
  18822. </p>
  18823. </dd>
  18824. <dt><samp class="option">loopend <var class="var">end</var></samp></dt>
  18825. <dd><p>Specify loop end position expressed in milliseconds, from <code class="code">0</code> to
  18826. <code class="code">INT_MAX</code>, default is <code class="code">0</code>, in case <code class="code">0</code> is set it
  18827. assumes the total stream duration.
  18828. </p></dd>
  18829. </dl>
  18830. <a name="au"></a>
  18831. <h3 class="section">21.20 au<span class="pull-right"><a class="anchor hidden-xs" href="#au" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-au" aria-hidden="true">TOC</a></span></h3>
  18832. <p>SUN AU audio muxer.
  18833. </p>
  18834. <p>It accepts a single audio stream.
  18835. </p>
  18836. <a class="anchor" id="avi"></a><a name="avi-1"></a>
  18837. <h3 class="section">21.21 avi<span class="pull-right"><a class="anchor hidden-xs" href="#avi-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avi-1" aria-hidden="true">TOC</a></span></h3>
  18838. <p>Audio Video Interleaved muxer.
  18839. </p>
  18840. <p>AVI is a proprietary format developed by Microsoft, and later formally specified
  18841. through the Open DML specification.
  18842. </p>
  18843. <p>Because of differences in players implementations, it might be required to set
  18844. some options to make sure that the generated output can be correctly played by
  18845. the target player.
  18846. </p>
  18847. <a name="Options-74"></a>
  18848. <h4 class="subsection">21.21.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-74" aria-hidden="true">TOC</a></span></h4>
  18849. <dl class="table">
  18850. <dt><samp class="option">flipped_raw_rgb <var class="var">bool</var></samp></dt>
  18851. <dd><p>If set to <code class="code">true</code>, store positive height for raw RGB bitmaps, which
  18852. indicates bitmap is stored bottom-up. Note that this option does not flip the
  18853. bitmap which has to be done manually beforehand, e.g. by using the &lsquo;<samp class="samp">vflip</samp>&rsquo;
  18854. filter. Default is <code class="code">false</code> and indicates bitmap is stored top down.
  18855. </p>
  18856. </dd>
  18857. <dt><samp class="option">reserve_index_space <var class="var">size</var></samp></dt>
  18858. <dd><p>Reserve the specified amount of bytes for the OpenDML master index of each
  18859. stream within the file header. By default additional master indexes are
  18860. embedded within the data packets if there is no space left in the first master
  18861. index and are linked together as a chain of indexes. This index structure can
  18862. cause problems for some use cases, e.g. third-party software strictly relying
  18863. on the OpenDML index specification or when file seeking is slow. Reserving
  18864. enough index space in the file header avoids these problems.
  18865. </p>
  18866. <p>The required index space depends on the output file size and should be about 16
  18867. bytes per gigabyte. When this option is omitted or set to zero the necessary
  18868. index space is guessed.
  18869. </p>
  18870. <p>Default value is <code class="code">0</code>.
  18871. </p>
  18872. </dd>
  18873. <dt><samp class="option">write_channel_mask <var class="var">bool</var></samp></dt>
  18874. <dd><p>Write the channel layout mask into the audio stream header.
  18875. </p>
  18876. <p>This option is enabled by default. Disabling the channel mask can be useful in
  18877. specific scenarios, e.g. when merging multiple audio streams into one for
  18878. compatibility with software that only supports a single audio stream in AVI
  18879. (see <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#amerge">the &quot;amerge&quot; section in the ffmpeg-filters manual</a>).
  18880. </p></dd>
  18881. </dl>
  18882. <a name="avif"></a>
  18883. <h3 class="section">21.22 avif<span class="pull-right"><a class="anchor hidden-xs" href="#avif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avif" aria-hidden="true">TOC</a></span></h3>
  18884. <p>AV1 (Alliance for Open Media Video codec 1) image format muxer.
  18885. </p>
  18886. <p>This muxers stores images encoded using the AV1 codec.
  18887. </p>
  18888. <p>It accepts one or two video streams. In case two video streams are
  18889. provided, the second one shall contain a single plane storing the
  18890. alpha mask.
  18891. </p>
  18892. <p>In case more than one image is provided, the generated output is
  18893. considered an animated AVIF and the number of loops can be specified
  18894. with the <samp class="option">loop</samp> option.
  18895. </p>
  18896. <p>This is based on the specification by Alliance for Open Media at url
  18897. <a class="url" href="https://aomediacodec.github.io/av1-avif">https://aomediacodec.github.io/av1-avif</a>.
  18898. </p>
  18899. <a name="Options-75"></a>
  18900. <h4 class="subsection">21.22.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-75" aria-hidden="true">TOC</a></span></h4>
  18901. <dl class="table">
  18902. <dt><samp class="option">loop <var class="var">count</var></samp></dt>
  18903. <dd><p>number of times to loop an animated AVIF, <code class="code">0</code> specify an infinite
  18904. loop, default is <code class="code">0</code>
  18905. </p>
  18906. </dd>
  18907. <dt><samp class="option">movie_timescale <var class="var">timescale</var></samp></dt>
  18908. <dd><p>Set the timescale written in the movie header box (<code class="code">mvhd</code>).
  18909. Range is 1 to INT_MAX. Default is <code class="code">1000</code>.
  18910. </p></dd>
  18911. </dl>
  18912. <a name="avm2"></a>
  18913. <h3 class="section">21.23 avm2<span class="pull-right"><a class="anchor hidden-xs" href="#avm2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avm2" aria-hidden="true">TOC</a></span></h3>
  18914. <p>ShockWave Flash (SWF) / ActionScript Virtual Machine 2 (AVM2) format muxer.
  18915. </p>
  18916. <p>It accepts one audio stream, one video stream, or both.
  18917. </p>
  18918. <a name="bit"></a>
  18919. <h3 class="section">21.24 bit<span class="pull-right"><a class="anchor hidden-xs" href="#bit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bit" aria-hidden="true">TOC</a></span></h3>
  18920. <p>G.729 (.bit) file format muxer.
  18921. </p>
  18922. <p>It accepts a single G.729 audio stream.
  18923. </p>
  18924. <a name="caf"></a>
  18925. <h3 class="section">21.25 caf<span class="pull-right"><a class="anchor hidden-xs" href="#caf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-caf" aria-hidden="true">TOC</a></span></h3>
  18926. <p>Apple CAF (Core Audio Format) muxer.
  18927. </p>
  18928. <p>It accepts a single audio stream.
  18929. </p>
  18930. <a name="codec2"></a>
  18931. <h3 class="section">21.26 codec2<span class="pull-right"><a class="anchor hidden-xs" href="#codec2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codec2" aria-hidden="true">TOC</a></span></h3>
  18932. <p>Codec2 audio audio muxer.
  18933. </p>
  18934. <p>It accepts a single codec2 audio stream.
  18935. </p>
  18936. <a class="anchor" id="chromaprint"></a><a name="chromaprint-1"></a>
  18937. <h3 class="section">21.27 chromaprint<span class="pull-right"><a class="anchor hidden-xs" href="#chromaprint-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromaprint-1" aria-hidden="true">TOC</a></span></h3>
  18938. <p>Chromaprint fingerprinter muxers.
  18939. </p>
  18940. <p>To enable compilation of this filter you need to configure FFmpeg with
  18941. <code class="code">--enable-chromaprint</code>.
  18942. </p>
  18943. <p>This muxer feeds audio data to the Chromaprint library, which
  18944. generates a fingerprint for the provided audio data. See:
  18945. <a class="url" href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>
  18946. </p>
  18947. <p>It takes a single signed native-endian 16-bit raw audio stream of at
  18948. most 2 channels.
  18949. </p>
  18950. <a name="Options-76"></a>
  18951. <h4 class="subsection">21.27.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-76" aria-hidden="true">TOC</a></span></h4>
  18952. <dl class="table">
  18953. <dt><samp class="option">algorithm <var class="var">version</var></samp></dt>
  18954. <dd><p>Select version of algorithm to fingerprint with. Range is <code class="code">0</code> to
  18955. <code class="code">4</code>. Version <code class="code">3</code> enables silence detection. Default is <code class="code">1</code>.
  18956. </p>
  18957. </dd>
  18958. <dt><samp class="option">fp_format <var class="var">format</var></samp></dt>
  18959. <dd><p>Format to output the fingerprint as. Accepts the following options:
  18960. </p><dl class="table">
  18961. <dt>&lsquo;<samp class="samp">base64</samp>&rsquo;</dt>
  18962. <dd><p>Base64 compressed fingerprint <em class="emph">(default)</em>
  18963. </p>
  18964. </dd>
  18965. <dt>&lsquo;<samp class="samp">compressed</samp>&rsquo;</dt>
  18966. <dd><p>Binary compressed fingerprint
  18967. </p>
  18968. </dd>
  18969. <dt>&lsquo;<samp class="samp">raw</samp>&rsquo;</dt>
  18970. <dd><p>Binary raw fingerprint
  18971. </p></dd>
  18972. </dl>
  18973. </dd>
  18974. <dt><samp class="option">silence_threshold <var class="var">threshold</var></samp></dt>
  18975. <dd><p>Threshold for detecting silence. Range is from <code class="code">-1</code> to
  18976. <code class="code">32767</code>, where <code class="code">-1</code> disables silence detection. Silence
  18977. detection can only be used with version <code class="code">3</code> of the algorithm.
  18978. </p>
  18979. <p>Silence detection must be disabled for use with the AcoustID
  18980. service. Default is <code class="code">-1</code>.
  18981. </p></dd>
  18982. </dl>
  18983. <a class="anchor" id="crc"></a><a name="crc-1"></a>
  18984. <h3 class="section">21.28 crc<span class="pull-right"><a class="anchor hidden-xs" href="#crc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crc-1" aria-hidden="true">TOC</a></span></h3>
  18985. <p>CRC (Cyclic Redundancy Check) muxer.
  18986. </p>
  18987. <p>This muxer computes and prints the Adler-32 CRC of all the input audio
  18988. and video frames. By default audio frames are converted to signed
  18989. 16-bit raw audio and video frames to raw video before computing the
  18990. CRC.
  18991. </p>
  18992. <p>The output of the muxer consists of a single line of the form:
  18993. CRC=0x<var class="var">CRC</var>, where <var class="var">CRC</var> is a hexadecimal number 0-padded to
  18994. 8 digits containing the CRC for all the decoded input frames.
  18995. </p>
  18996. <p>See also the <a class="ref" href="#framecrc">framecrc</a> muxer.
  18997. </p>
  18998. <a name="Examples-16"></a>
  18999. <h4 class="subsection">21.28.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-16" aria-hidden="true">TOC</a></span></h4>
  19000. <ul class="itemize mark-bullet">
  19001. <li>Use <code class="command">ffmpeg</code> to compute the CRC of the input, and store it in
  19002. the file <samp class="file">out.crc</samp>:
  19003. <div class="example">
  19004. <pre class="example-preformatted">ffmpeg -i INPUT -f crc out.crc
  19005. </pre></div>
  19006. </li><li>Use <code class="command">ffmpeg</code> to print the CRC to stdout with the command:
  19007. <div class="example">
  19008. <pre class="example-preformatted">ffmpeg -i INPUT -f crc -
  19009. </pre></div>
  19010. </li><li>You can select the output format of each frame with <code class="command">ffmpeg</code> by
  19011. specifying the audio and video codec and format. For example, to
  19012. compute the CRC of the input audio converted to PCM unsigned 8-bit
  19013. and the input video converted to MPEG-2 video, use the command:
  19014. <div class="example">
  19015. <pre class="example-preformatted">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  19016. </pre></div>
  19017. </li></ul>
  19018. <a class="anchor" id="dash"></a><a name="dash-2"></a>
  19019. <h3 class="section">21.29 dash<span class="pull-right"><a class="anchor hidden-xs" href="#dash-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dash-2" aria-hidden="true">TOC</a></span></h3>
  19020. <p>Dynamic Adaptive Streaming over HTTP (DASH) muxer.
  19021. </p>
  19022. <p>This muxer creates segments and manifest files according to the
  19023. MPEG-DASH standard ISO/IEC 23009-1:2014 and following standard
  19024. updates.
  19025. </p>
  19026. <p>For more information see:
  19027. </p><ul class="itemize mark-bullet">
  19028. <li>ISO DASH Specification: <a class="url" href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip</a>
  19029. </li><li>WebM DASH Specification: <a class="url" href="https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification">https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification</a>
  19030. </li></ul>
  19031. <p>This muxer creates an MPD (Media Presentation Description) manifest
  19032. file and segment files for each stream. Segment files are placed in
  19033. the same directory of the MPD manifest file.
  19034. </p>
  19035. <p>The segment filename might contain pre-defined identifiers used in the
  19036. manifest <code class="code">SegmentTemplate</code> section as defined in section
  19037. 5.3.9.4.4 of the standard.
  19038. </p>
  19039. <p>Available identifiers are <code class="code">$RepresentationID$</code>, <code class="code">$Number$</code>,
  19040. <code class="code">$Bandwidth$</code>, and <code class="code">$Time$</code>. In addition to the standard
  19041. identifiers, an ffmpeg-specific <code class="code">$ext$</code> identifier is also
  19042. supported. When specified, <code class="command">ffmpeg</code> will replace <code class="code">$ext$</code>
  19043. in the file name with muxing format&rsquo;s extensions such as <code class="code">mp4</code>,
  19044. <code class="code">webm</code> etc.
  19045. </p>
  19046. <a name="Options-77"></a>
  19047. <h4 class="subsection">21.29.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-77" aria-hidden="true">TOC</a></span></h4>
  19048. <dl class="table">
  19049. <dt><samp class="option">adaptation_sets <var class="var">adaptation_sets</var></samp></dt>
  19050. <dd><p>Assign streams to adaptation sets, specified in the MPD manifest
  19051. <code class="code">AdaptationSets</code> section.
  19052. </p>
  19053. <p>An adaptation set contains a set of one or more streams accessed as a
  19054. single subset, e.g. corresponding streams encoded at different size
  19055. selectable by the user depending on the available bandwidth, or to
  19056. different audio streams with a different language.
  19057. </p>
  19058. <p>Each adaptation set is specified with the syntax:
  19059. </p><div class="example">
  19060. <pre class="example-preformatted">id=<var class="var">index</var>,streams=<var class="var">streams</var>
  19061. </pre></div>
  19062. <p>where <var class="var">index</var> must be a numerical index, and <var class="var">streams</var> is a
  19063. sequence of <code class="code">,</code>-separated stream indices. Multiple adaptation
  19064. sets can be specified, separated by spaces.
  19065. </p>
  19066. <p>To map all video (or audio) streams to an adaptation set, <code class="code">v</code> (or
  19067. <code class="code">a</code>) can be used as stream identifier instead of IDs.
  19068. </p>
  19069. <p>When no assignment is defined, this defaults to an adaptation set for
  19070. each stream.
  19071. </p>
  19072. <p>The following optional fields can also be specified:
  19073. </p>
  19074. <dl class="table">
  19075. <dt><samp class="option">descriptor</samp></dt>
  19076. <dd><p>Define the descriptor as defined by ISO/IEC 23009-1:2014/Amd.2:2015.
  19077. </p>
  19078. <p>For example:
  19079. </p><div class="example">
  19080. <pre class="example-preformatted">&lt;SupplementalProperty schemeIdUri=\&quot;urn:mpeg:dash:srd:2014\&quot; value=\&quot;0,0,0,1,1,2,2\&quot;/&gt;
  19081. </pre></div>
  19082. <p>The descriptor string should be a self-closing XML tag.
  19083. </p>
  19084. </dd>
  19085. <dt><samp class="option">frag_duration</samp></dt>
  19086. <dd><p>Override the global fragment duration specified with the
  19087. <samp class="option">frag_duration</samp> option.
  19088. </p>
  19089. </dd>
  19090. <dt><samp class="option">frag_type</samp></dt>
  19091. <dd><p>Override the global fragment type specified with the
  19092. <samp class="option">frag_type</samp> option.
  19093. </p>
  19094. </dd>
  19095. <dt><samp class="option">seg_duration</samp></dt>
  19096. <dd><p>Override the global segment duration specified with the
  19097. <samp class="option">seg_duration</samp> option.
  19098. </p>
  19099. </dd>
  19100. <dt><samp class="option">trick_id</samp></dt>
  19101. <dd><p>Mark an adaptation set as containing streams meant to be used for
  19102. Trick Mode for the referenced adaptation set.
  19103. </p></dd>
  19104. </dl>
  19105. <p>A few examples of possible values for the <samp class="option">adaptation_sets</samp>
  19106. option follow:
  19107. </p><div class="example">
  19108. <pre class="example-preformatted">id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a
  19109. </pre></div>
  19110. <div class="example">
  19111. <pre class="example-preformatted">id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1
  19112. </pre></div>
  19113. </dd>
  19114. <dt><samp class="option">dash_segment_type <var class="var">type</var></samp></dt>
  19115. <dd><p>Set DASH segment files type.
  19116. </p>
  19117. <p>Possible values:
  19118. </p><dl class="table">
  19119. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  19120. <dd><p>The dash segment files format will be selected based on the stream
  19121. codec. This is the default mode.
  19122. </p></dd>
  19123. <dt>&lsquo;<samp class="samp">mp4</samp>&rsquo;</dt>
  19124. <dd><p>the dash segment files will be in ISOBMFF/MP4 format
  19125. </p></dd>
  19126. <dt>&lsquo;<samp class="samp">webm</samp>&rsquo;</dt>
  19127. <dd><p>the dash segment files will be in WebM format
  19128. </p></dd>
  19129. </dl>
  19130. </dd>
  19131. <dt><samp class="option">extra_window_size <var class="var">size</var></samp></dt>
  19132. <dd><p>Set the maximum number of segments kept outside of the manifest before
  19133. removing from disk.
  19134. </p>
  19135. </dd>
  19136. <dt><samp class="option">format_options <var class="var">options_list</var></samp></dt>
  19137. <dd><p>Set container format (mp4/webm) options using a <code class="code">:</code>-separated list of
  19138. key=value parameters. Values containing <code class="code">:</code> special characters must be
  19139. escaped.
  19140. </p>
  19141. </dd>
  19142. <dt><samp class="option">frag_duration <var class="var">duration</var></samp></dt>
  19143. <dd><p>Set the length in seconds of fragments within segments, fractional
  19144. value can also be set.
  19145. </p>
  19146. </dd>
  19147. <dt><samp class="option">frag_type <var class="var">type</var></samp></dt>
  19148. <dd><p>Set the type of interval for fragmentation.
  19149. </p>
  19150. <p>Possible values:
  19151. </p><dl class="table">
  19152. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  19153. <dd><p>set one fragment per segment
  19154. </p>
  19155. </dd>
  19156. <dt>&lsquo;<samp class="samp">every_frame</samp>&rsquo;</dt>
  19157. <dd><p>fragment at every frame
  19158. </p>
  19159. </dd>
  19160. <dt>&lsquo;<samp class="samp">duration</samp>&rsquo;</dt>
  19161. <dd><p>fragment at specific time intervals
  19162. </p>
  19163. </dd>
  19164. <dt>&lsquo;<samp class="samp">pframes</samp>&rsquo;</dt>
  19165. <dd><p>fragment at keyframes and following P-Frame reordering (Video only,
  19166. experimental)
  19167. </p></dd>
  19168. </dl>
  19169. </dd>
  19170. <dt><samp class="option">global_sidx <var class="var">bool</var></samp></dt>
  19171. <dd><p>Write global <code class="code">SIDX</code> atom. Applicable only for single file, mp4
  19172. output, non-streaming mode.
  19173. </p>
  19174. </dd>
  19175. <dt><samp class="option">hls_master_name <var class="var">file_name</var></samp></dt>
  19176. <dd><p>HLS master playlist name. Default is <samp class="file">master.m3u8</samp>.
  19177. </p>
  19178. </dd>
  19179. <dt><samp class="option">hls_playlist <var class="var">bool</var></samp></dt>
  19180. <dd><p>Generate HLS playlist files. The master playlist is generated with
  19181. filename specified by the <samp class="option">hls_master_name</samp> option. One media
  19182. playlist file is generated for each stream with filenames
  19183. <samp class="file">media_0.m3u8</samp>, <samp class="file">media_1.m3u8</samp>, etc.
  19184. </p>
  19185. </dd>
  19186. <dt><samp class="option">http_opts <var class="var">http_opts</var></samp></dt>
  19187. <dd><p>Specify a list of <code class="code">:</code>-separated key=value options to pass to the
  19188. underlying HTTP protocol. Applicable only for HTTP output.
  19189. </p>
  19190. </dd>
  19191. <dt><samp class="option">http_persistent <var class="var">bool</var></samp></dt>
  19192. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  19193. </p>
  19194. </dd>
  19195. <dt><samp class="option">http_user_agent <var class="var">user_agent</var></samp></dt>
  19196. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP
  19197. output.
  19198. </p>
  19199. </dd>
  19200. <dt><samp class="option">ignore_io_errors <var class="var">bool</var></samp></dt>
  19201. <dd><p>Ignore IO errors during open and write. Useful for long-duration runs
  19202. with network output. This is disabled by default.
  19203. </p>
  19204. </dd>
  19205. <dt><samp class="option">index_correction <var class="var">bool</var></samp></dt>
  19206. <dd><p>Enable or disable segment index correction logic. Applicable only when
  19207. <samp class="option">use_template</samp> is enabled and <samp class="option">use_timeline</samp> is
  19208. disabled. This is disabled by default.
  19209. </p>
  19210. <p>When enabled, the logic monitors the flow of segment indexes. If a
  19211. streams&rsquo;s segment index value is not at the expected real time
  19212. position, then the logic corrects that index value.
  19213. </p>
  19214. <p>Typically this logic is needed in live streaming use cases. The
  19215. network bandwidth fluctuations are common during long run
  19216. streaming. Each fluctuation can cause the segment indexes fall behind
  19217. the expected real time position.
  19218. </p>
  19219. </dd>
  19220. <dt><samp class="option">init_seg_name <var class="var">init_name</var></samp></dt>
  19221. <dd><p>DASH-templated name to use for the initialization segment. Default is
  19222. <code class="code">init-stream$RepresentationID$.$ext$</code>. <code class="code">$ext$</code> is replaced
  19223. with the file name extension specific for the segment format.
  19224. </p>
  19225. </dd>
  19226. <dt><samp class="option">ldash <var class="var">bool</var></samp></dt>
  19227. <dd><p>Enable Low-latency Dash by constraining the presence and values of
  19228. some elements. This is disabled by default.
  19229. </p>
  19230. </dd>
  19231. <dt><samp class="option">lhls <var class="var">bool</var></samp></dt>
  19232. <dd><p>Enable Low-latency HLS (LHLS). Add <code class="code">#EXT-X-PREFETCH</code> tag with
  19233. current segment&rsquo;s URI. hls.js player folks are trying to standardize
  19234. an open LHLS spec. The draft spec is available at
  19235. <a class="url" href="https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md">https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md</a>.
  19236. </p>
  19237. <p>This option tries to comply with the above open spec. It enables
  19238. <samp class="option">streaming</samp> and <samp class="option">hls_playlist</samp> options automatically.
  19239. This is an experimental feature.
  19240. </p>
  19241. <p>Note: This is not Apple&rsquo;s version LHLS. See
  19242. <a class="url" href="https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis">https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis</a>
  19243. </p>
  19244. </dd>
  19245. <dt><samp class="option">master_m3u8_publish_rate <var class="var">segment_intervals_count</var></samp></dt>
  19246. <dd><p>Publish master playlist repeatedly every after specified number of
  19247. segment intervals.
  19248. </p>
  19249. </dd>
  19250. <dt><samp class="option">max_playback_rate <var class="var">rate</var></samp></dt>
  19251. <dd><p>Set the maximum playback rate indicated as appropriate for the
  19252. purposes of automatically adjusting playback latency and buffer
  19253. occupancy during normal playback by clients.
  19254. </p>
  19255. </dd>
  19256. <dt><samp class="option">media_seg_name <var class="var">segment_name</var></samp></dt>
  19257. <dd><p>DASH-templated name to use for the media segments. Default is
  19258. <code class="code">chunk-stream$RepresentationID$-$Number%05d$.$ext$</code>. <code class="code">$ext$</code>
  19259. is replaced with the file name extension specific for the segment
  19260. format.
  19261. </p>
  19262. </dd>
  19263. <dt><samp class="option">method <var class="var">method</var></samp></dt>
  19264. <dd><p>Use the given HTTP method to create output files. Generally set to <code class="code">PUT</code>
  19265. or <code class="code">POST</code>.
  19266. </p>
  19267. </dd>
  19268. <dt><samp class="option">min_playback_rate <var class="var">rate</var></samp></dt>
  19269. <dd><p>Set the minimum playback rate indicated as appropriate for the
  19270. purposes of automatically adjusting playback latency and buffer
  19271. occupancy during normal playback by clients.
  19272. </p>
  19273. </dd>
  19274. <dt><samp class="option">mpd_profile <var class="var">flags</var></samp></dt>
  19275. <dd><p>Set one or more MPD manifest profiles.
  19276. </p>
  19277. <p>Possible values:
  19278. </p><dl class="table">
  19279. <dt>&lsquo;<samp class="samp">dash</samp>&rsquo;</dt>
  19280. <dd><p>MPEG-DASH ISO Base media file format live profile
  19281. </p></dd>
  19282. <dt>&lsquo;<samp class="samp">dvb_dash</samp>&rsquo;</dt>
  19283. <dd><p>DVB-DASH profile
  19284. </p></dd>
  19285. </dl>
  19286. <p>Default value is <code class="code">dash</code>.
  19287. </p>
  19288. </dd>
  19289. <dt><samp class="option">remove_at_exit <var class="var">bool</var></samp></dt>
  19290. <dd><p>Enable or disable removal of all segments when finished. This is
  19291. disabled by default.
  19292. </p>
  19293. </dd>
  19294. <dt><samp class="option">seg_duration <var class="var">duration</var></samp></dt>
  19295. <dd><p>Set the segment length in seconds (fractional value can be set). The
  19296. value is treated as average segment duration when the
  19297. <samp class="option">use_template</samp> option is enabled and the <samp class="option">use_timeline</samp>
  19298. option is disabled and as minimum segment duration for all the other
  19299. use cases.
  19300. </p>
  19301. <p>Default value is <code class="code">5</code>.
  19302. </p>
  19303. </dd>
  19304. <dt><samp class="option">single_file <var class="var">bool</var></samp></dt>
  19305. <dd><p>Enable or disable storing all segments in one file, accessed using
  19306. byte ranges. This is disabled by default.
  19307. </p>
  19308. <p>The name of the single file can be specified with the
  19309. <samp class="option">single_file_name</samp> option, if not specified assume the basename
  19310. of the manifest file with the output format extension.
  19311. </p>
  19312. </dd>
  19313. <dt><samp class="option">single_file_name <var class="var">file_name</var></samp></dt>
  19314. <dd><p>DASH-templated name to use for the manifest <code class="code">baseURL</code>
  19315. element. Imply that the <samp class="option">single_file</samp> option is set to
  19316. <var class="var">true</var>. In the template, <code class="code">$ext$</code> is replaced with the file
  19317. name extension specific for the segment format.
  19318. </p>
  19319. </dd>
  19320. <dt><samp class="option">streaming <var class="var">bool</var></samp></dt>
  19321. <dd><p>Enable or disable chunk streaming mode of output. In chunk streaming
  19322. mode, each frame will be a <code class="code">moof</code> fragment which forms a
  19323. chunk. This is disabled by default.
  19324. </p>
  19325. </dd>
  19326. <dt><samp class="option">target_latency <var class="var">target_latency</var></samp></dt>
  19327. <dd><p>Set an intended target latency in seconds for serving (fractional
  19328. value can be set). Applicable only when the <samp class="option">streaming</samp> and
  19329. <samp class="option">write_prft</samp> options are enabled. This is an informative fields
  19330. clients can use to measure the latency of the service.
  19331. </p>
  19332. </dd>
  19333. <dt><samp class="option">timeout <var class="var">timeout</var></samp></dt>
  19334. <dd><p>Set timeout for socket I/O operations expressed in seconds (fractional
  19335. value can be set). Applicable only for HTTP output.
  19336. </p>
  19337. </dd>
  19338. <dt><samp class="option">update_period <var class="var">period</var></samp></dt>
  19339. <dd><p>Set the MPD update period, for dynamic content. The unit is
  19340. second. If set to <code class="code">0</code>, the period is automatically computed.
  19341. </p>
  19342. <p>Default value is <code class="code">0</code>.
  19343. </p>
  19344. </dd>
  19345. <dt><samp class="option">use_template <var class="var">bool</var></samp></dt>
  19346. <dd><p>Enable or disable use of <code class="code">SegmentTemplate</code> instead of
  19347. <code class="code">SegmentList</code> in the manifest. This is enabled by default.
  19348. </p>
  19349. </dd>
  19350. <dt><samp class="option">use_timeline <var class="var">bool</var></samp></dt>
  19351. <dd><p>Enable or disable use of <code class="code">SegmentTimeline</code> within the
  19352. <code class="code">SegmentTemplate</code> manifest section. This is enabled by default.
  19353. </p>
  19354. </dd>
  19355. <dt><samp class="option">utc_timing_url <var class="var">url</var></samp></dt>
  19356. <dd><p>URL of the page that will return the UTC timestamp in ISO
  19357. format, for example <code class="code">https://time.akamai.com/?iso</code>
  19358. </p>
  19359. </dd>
  19360. <dt><samp class="option">window_size <var class="var">size</var></samp></dt>
  19361. <dd><p>Set the maximum number of segments kept in the manifest, discard the
  19362. oldest one. This is useful for live streaming.
  19363. </p>
  19364. <p>If the value is <code class="code">0</code>, all segments are kept in the
  19365. manifest. Default value is <code class="code">0</code>.
  19366. </p>
  19367. </dd>
  19368. <dt><samp class="option">write_prft <var class="var">write_prft</var></samp></dt>
  19369. <dd><p>Write Producer Reference Time elements on supported streams. This also
  19370. enables writing prft boxes in the underlying muxer. Applicable only
  19371. when the <var class="var">utc_url</var> option is enabled. It is set to <var class="var">auto</var> by
  19372. default, in which case the muxer will attempt to enable it only in
  19373. modes that require it.
  19374. </p></dd>
  19375. </dl>
  19376. <a name="Example"></a>
  19377. <h4 class="subsection">21.29.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example" aria-hidden="true">TOC</a></span></h4>
  19378. <p>Generate a DASH output reading from an input source in realtime using
  19379. <code class="command">ffmpeg</code>.
  19380. </p>
  19381. <p>Two multimedia streams are generated from the input file, both
  19382. containing a video stream encoded through &lsquo;<samp class="samp">libx264</samp>&rsquo;, and an audio
  19383. stream encoded with &lsquo;<samp class="samp">libfdk_aac</samp>&rsquo;. The first multimedia stream
  19384. contains video with a bitrate of 800k and audio at the default rate,
  19385. the second with video scaled to 320x170 pixels at 300k and audio
  19386. resampled at 22005 Hz.
  19387. </p>
  19388. <p>The <samp class="option">window_size</samp> option keeps only the latest 5 segments with
  19389. the default duration of 5 seconds.
  19390. </p>
  19391. <div class="example">
  19392. <pre class="example-preformatted">ffmpeg -re -i &lt;input&gt; -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
  19393. -b:v:0 800k -profile:v:0 main \
  19394. -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -ar:a:1 22050 \
  19395. -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 \
  19396. -use_timeline 1 -use_template 1 -window_size 5 \
  19397. -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; \
  19398. -f dash /path/to/out.mpd
  19399. </pre></div>
  19400. <a name="daud"></a>
  19401. <h3 class="section">21.30 daud<span class="pull-right"><a class="anchor hidden-xs" href="#daud" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-daud" aria-hidden="true">TOC</a></span></h3>
  19402. <p>D-Cinema audio muxer.
  19403. </p>
  19404. <p>It accepts a single 6-channels audio stream resampled at 96000 Hz
  19405. encoded with the &lsquo;<samp class="samp">pcm_24daud</samp>&rsquo; codec.
  19406. </p>
  19407. <a name="Example-1"></a>
  19408. <h4 class="subsection">21.30.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-1" aria-hidden="true">TOC</a></span></h4>
  19409. <p>Use <code class="command">ffmpeg</code> to mux input audio to a &lsquo;<samp class="samp">5.1</samp>&rsquo; channel layout
  19410. resampled at 96000Hz:
  19411. </p><div class="example">
  19412. <pre class="example-preformatted">ffmpeg -i INPUT -af aresample=96000,pan=5.1 slow.302
  19413. </pre></div>
  19414. <p>For ffmpeg versions before 7.0 you might have to use the &lsquo;<samp class="samp">asetnsamples</samp>&rsquo;
  19415. filter to limit the muxed packet size, because this format does not support
  19416. muxing packets larger than 65535 bytes (3640 samples). For newer ffmpeg
  19417. versions audio is automatically packetized to 36000 byte (2000 sample) packets.
  19418. </p>
  19419. <a name="dv"></a>
  19420. <h3 class="section">21.31 dv<span class="pull-right"><a class="anchor hidden-xs" href="#dv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dv" aria-hidden="true">TOC</a></span></h3>
  19421. <p>DV (Digital Video) muxer.
  19422. </p>
  19423. <p>It accepts exactly one &lsquo;<samp class="samp">dvvideo</samp>&rsquo; video stream and at most two
  19424. &lsquo;<samp class="samp">pcm_s16</samp>&rsquo; audio streams. More constraints are defined by the
  19425. property of the video, which must correspond to a DV video supported
  19426. profile, and on the framerate.
  19427. </p>
  19428. <a name="Example-2"></a>
  19429. <h4 class="subsection">21.31.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-2" aria-hidden="true">TOC</a></span></h4>
  19430. <p>Use <code class="command">ffmpeg</code> to convert the input:
  19431. </p><div class="example">
  19432. <pre class="example-preformatted">ffmpeg -i INPUT -s:v 720x480 -pix_fmt yuv411p -r 29.97 -ac 2 -ar 48000 -y out.dv
  19433. </pre></div>
  19434. <a name="ffmetadata"></a>
  19435. <h3 class="section">21.32 ffmetadata<span class="pull-right"><a class="anchor hidden-xs" href="#ffmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffmetadata" aria-hidden="true">TOC</a></span></h3>
  19436. <p>FFmpeg metadata muxer.
  19437. </p>
  19438. <p>This muxer writes the streams metadata in the &lsquo;<samp class="samp">ffmetadata</samp>&rsquo;
  19439. format.
  19440. </p>
  19441. <p>See <a data-manual="ffmpeg-formats" href="ffmpeg-formats.html#metadata">the Metadata chapter</a> for
  19442. information about the format.
  19443. </p>
  19444. <a name="Example-3"></a>
  19445. <h4 class="subsection">21.32.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-3" aria-hidden="true">TOC</a></span></h4>
  19446. <p>Use <code class="command">ffmpeg</code> to extract metadata from an input file to a <samp class="file">metadata.ffmeta</samp>
  19447. file in &lsquo;<samp class="samp">ffmetadata</samp>&rsquo; format:
  19448. </p><div class="example">
  19449. <pre class="example-preformatted">ffmpeg -i INPUT -f ffmetadata metadata.ffmeta
  19450. </pre></div>
  19451. <a class="anchor" id="fifo"></a><a name="fifo-1"></a>
  19452. <h3 class="section">21.33 fifo<span class="pull-right"><a class="anchor hidden-xs" href="#fifo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fifo-1" aria-hidden="true">TOC</a></span></h3>
  19453. <p>FIFO (First-In First-Out) muxer.
  19454. </p>
  19455. <p>The &lsquo;<samp class="samp">fifo</samp>&rsquo; pseudo-muxer allows the separation of encoding and
  19456. muxing by using a first-in-first-out queue and running the actual muxer
  19457. in a separate thread.
  19458. </p>
  19459. <p>This is especially useful in combination with
  19460. the <a class="ref" href="#tee">tee</a> muxer and can be used to send data to several
  19461. destinations with different reliability/writing speed/latency.
  19462. </p>
  19463. <p>The target muxer is either selected from the output name or specified
  19464. through the <samp class="option">fifo_format</samp> option.
  19465. </p>
  19466. <p>The behavior of the &lsquo;<samp class="samp">fifo</samp>&rsquo; muxer if the queue fills up or if the
  19467. output fails (e.g. if a packet cannot be written to the output) is
  19468. selectable:
  19469. </p><ul class="itemize mark-bullet">
  19470. <li>Output can be transparently restarted with configurable delay between
  19471. retries based on real time or time of the processed stream.
  19472. </li><li>Encoding can be blocked during temporary failure, or continue transparently
  19473. dropping packets in case the FIFO queue fills up.
  19474. </li></ul>
  19475. <p>API users should be aware that callback functions
  19476. (<code class="code">interrupt_callback</code>, <code class="code">io_open</code> and <code class="code">io_close</code>) used
  19477. within its <code class="code">AVFormatContext</code> must be thread-safe.
  19478. </p>
  19479. <a name="Options-78"></a>
  19480. <h4 class="subsection">21.33.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-78" aria-hidden="true">TOC</a></span></h4>
  19481. <dl class="table">
  19482. <dt><samp class="option">attempt_recovery <var class="var">bool</var></samp></dt>
  19483. <dd><p>If failure occurs, attempt to recover the output. This is especially
  19484. useful when used with network output, since it makes it possible to
  19485. restart streaming transparently. By default this option is set to
  19486. <code class="code">false</code>.
  19487. </p>
  19488. </dd>
  19489. <dt><samp class="option">drop_pkts_on_overflow <var class="var">bool</var></samp></dt>
  19490. <dd><p>If set to <code class="code">true</code>, in case the fifo queue fills up, packets will
  19491. be dropped rather than blocking the encoder. This makes it possible to
  19492. continue streaming without delaying the input, at the cost of omitting
  19493. part of the stream. By default this option is set to <code class="code">false</code>, so in
  19494. such cases the encoder will be blocked until the muxer processes some
  19495. of the packets and none of them is lost.
  19496. </p>
  19497. </dd>
  19498. <dt><samp class="option">fifo_format <var class="var">format_name</var></samp></dt>
  19499. <dd><p>Specify the format name. Useful if it cannot be guessed from the
  19500. output name suffix.
  19501. </p>
  19502. </dd>
  19503. <dt><samp class="option">format_opts <var class="var">options</var></samp></dt>
  19504. <dd><p>Specify format options for the underlying muxer. Muxer options can be
  19505. specified as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;.
  19506. </p>
  19507. </dd>
  19508. <dt><samp class="option">max_recovery_attempts <var class="var">count</var></samp></dt>
  19509. <dd><p>Set maximum number of successive unsuccessful recovery attempts after
  19510. which the output fails permanently. By default this option is set to
  19511. <code class="code">0</code> (unlimited).
  19512. </p>
  19513. </dd>
  19514. <dt><samp class="option">queue_size <var class="var">size</var></samp></dt>
  19515. <dd><p>Specify size of the queue as a number of packets. Default value is
  19516. <code class="code">60</code>.
  19517. </p>
  19518. </dd>
  19519. <dt><samp class="option">recover_any_error <var class="var">bool</var></samp></dt>
  19520. <dd><p>If set to <code class="code">true</code>, recovery will be attempted regardless of type
  19521. of the error causing the failure. By default this option is set to
  19522. <code class="code">false</code> and in case of certain (usually permanent) errors the
  19523. recovery is not attempted even when the <samp class="option">attempt_recovery</samp>
  19524. option is set to <code class="code">true</code>.
  19525. </p>
  19526. </dd>
  19527. <dt><samp class="option">recovery_wait_streamtime <var class="var">bool</var></samp></dt>
  19528. <dd><p>If set to <code class="code">false</code>, the real time is used when waiting for the
  19529. recovery attempt (i.e. the recovery will be attempted after the time
  19530. specified by the <samp class="option">recovery_wait_time</samp> option).
  19531. </p>
  19532. <p>If set to <code class="code">true</code>, the time of the processed stream is taken into
  19533. account instead (i.e. the recovery will be attempted after discarding
  19534. the packets corresponding to the <samp class="option">recovery_wait_time</samp> option).
  19535. </p>
  19536. <p>By default this option is set to <code class="code">false</code>.
  19537. </p>
  19538. </dd>
  19539. <dt><samp class="option">recovery_wait_time <var class="var">duration</var></samp></dt>
  19540. <dd><p>Specify waiting time in seconds before the next recovery attempt after
  19541. previous unsuccessful recovery attempt. Default value is <code class="code">5</code>.
  19542. </p>
  19543. </dd>
  19544. <dt><samp class="option">restart_with_keyframe <var class="var">bool</var></samp></dt>
  19545. <dd><p>Specify whether to wait for the keyframe after recovering from
  19546. queue overflow or failure. This option is set to <code class="code">false</code> by default.
  19547. </p>
  19548. </dd>
  19549. <dt><samp class="option">timeshift <var class="var">duration</var></samp></dt>
  19550. <dd><p>Buffer the specified amount of packets and delay writing the
  19551. output. Note that the value of the <samp class="option">queue_size</samp> option must be
  19552. big enough to store the packets for timeshift. At the end of the input
  19553. the fifo buffer is flushed at realtime speed.
  19554. </p></dd>
  19555. </dl>
  19556. <a name="Example-4"></a>
  19557. <h4 class="subsection">21.33.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-4" aria-hidden="true">TOC</a></span></h4>
  19558. <p>Use <code class="command">ffmpeg</code> to stream to an RTMP server, continue processing
  19559. the stream at real-time rate even in case of temporary failure
  19560. (network outage) and attempt to recover streaming every second
  19561. indefinitely:
  19562. </p><div class="example">
  19563. <pre class="example-preformatted">ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv \
  19564. -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 \
  19565. -map 0:v -map 0:a rtmp://example.com/live/stream_name
  19566. </pre></div>
  19567. <a name="film_005fcpk"></a>
  19568. <h3 class="section">21.34 film_cpk<span class="pull-right"><a class="anchor hidden-xs" href="#film_005fcpk" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-film_005fcpk" aria-hidden="true">TOC</a></span></h3>
  19569. <p>Sega film (.cpk) muxer.
  19570. </p>
  19571. <p>This format was used as internal format for several Sega games.
  19572. </p>
  19573. <p>For more information regarding the Sega film file format, visit
  19574. <a class="url" href="http://wiki.multimedia.cx/index.php?title=Sega_FILM">http://wiki.multimedia.cx/index.php?title=Sega_FILM</a>.
  19575. </p>
  19576. <p>It accepts at maximum one &lsquo;<samp class="samp">cinepak</samp>&rsquo; or raw video stream, and at
  19577. maximum one audio stream.
  19578. </p>
  19579. <a name="filmstrip"></a>
  19580. <h3 class="section">21.35 filmstrip<span class="pull-right"><a class="anchor hidden-xs" href="#filmstrip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-filmstrip" aria-hidden="true">TOC</a></span></h3>
  19581. <p>Adobe Filmstrip muxer.
  19582. </p>
  19583. <p>This format is used by several Adobe tools to store a generated filmstrip export. It
  19584. accepts a single raw video stream.
  19585. </p>
  19586. <a name="fits"></a>
  19587. <h3 class="section">21.36 fits<span class="pull-right"><a class="anchor hidden-xs" href="#fits" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fits" aria-hidden="true">TOC</a></span></h3>
  19588. <p>Flexible Image Transport System (FITS) muxer.
  19589. </p>
  19590. <p>This image format is used to store astronomical data.
  19591. </p>
  19592. <p>For more information regarding the format, visit
  19593. <a class="url" href="https://fits.gsfc.nasa.gov">https://fits.gsfc.nasa.gov</a>.
  19594. </p>
  19595. <a name="flac-3"></a>
  19596. <h3 class="section">21.37 flac<span class="pull-right"><a class="anchor hidden-xs" href="#flac-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flac-3" aria-hidden="true">TOC</a></span></h3>
  19597. <p>Raw FLAC audio muxer.
  19598. </p>
  19599. <p>This muxer accepts exactly one FLAC audio stream. Additionally, it is possible to add
  19600. images with disposition &lsquo;<samp class="samp">attached_pic</samp>&rsquo;.
  19601. </p>
  19602. <a name="Options-79"></a>
  19603. <h4 class="subsection">21.37.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-79" aria-hidden="true">TOC</a></span></h4>
  19604. <dl class="table">
  19605. <dt><samp class="option">write_header <var class="var">bool</var></samp></dt>
  19606. <dd><p>write the file header if set to <code class="code">true</code>, default is <code class="code">true</code>
  19607. </p></dd>
  19608. </dl>
  19609. <a name="Example-5"></a>
  19610. <h4 class="subsection">21.37.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-5" aria-hidden="true">TOC</a></span></h4>
  19611. <p>Use <code class="command">ffmpeg</code> to store the audio stream from an input file,
  19612. together with several pictures used with &lsquo;<samp class="samp">attached_pic</samp>&rsquo;
  19613. disposition:
  19614. </p><div class="example">
  19615. <pre class="example-preformatted">ffmpeg -i INPUT -i pic1.png -i pic2.jpg -map 0:a -map 1 -map 2 -disposition:v attached_pic OUTPUT
  19616. </pre></div>
  19617. <a name="flv"></a>
  19618. <h3 class="section">21.38 flv<span class="pull-right"><a class="anchor hidden-xs" href="#flv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flv" aria-hidden="true">TOC</a></span></h3>
  19619. <p>Adobe Flash Video Format muxer.
  19620. </p>
  19621. <a name="Options-80"></a>
  19622. <h4 class="subsection">21.38.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-80" aria-hidden="true">TOC</a></span></h4>
  19623. <dl class="table">
  19624. <dt><samp class="option">flvflags <var class="var">flags</var></samp></dt>
  19625. <dd><p>Possible values:
  19626. </p>
  19627. <dl class="table">
  19628. <dt>&lsquo;<samp class="samp">aac_seq_header_detect</samp>&rsquo;</dt>
  19629. <dd><p>Place AAC sequence header based on audio stream data.
  19630. </p>
  19631. </dd>
  19632. <dt>&lsquo;<samp class="samp">no_sequence_end</samp>&rsquo;</dt>
  19633. <dd><p>Disable sequence end tag.
  19634. </p>
  19635. </dd>
  19636. <dt>&lsquo;<samp class="samp">no_metadata</samp>&rsquo;</dt>
  19637. <dd><p>Disable metadata tag.
  19638. </p>
  19639. </dd>
  19640. <dt>&lsquo;<samp class="samp">no_duration_filesize</samp>&rsquo;</dt>
  19641. <dd><p>Disable duration and filesize in metadata when they are equal to zero
  19642. at the end of stream. (Be used to non-seekable living stream).
  19643. </p>
  19644. </dd>
  19645. <dt>&lsquo;<samp class="samp">add_keyframe_index</samp>&rsquo;</dt>
  19646. <dd><p>Used to facilitate seeking; particularly for HTTP pseudo streaming.
  19647. </p></dd>
  19648. </dl>
  19649. </dd>
  19650. </dl>
  19651. <a class="anchor" id="framecrc"></a><a name="framecrc-1"></a>
  19652. <h3 class="section">21.39 framecrc<span class="pull-right"><a class="anchor hidden-xs" href="#framecrc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framecrc-1" aria-hidden="true">TOC</a></span></h3>
  19653. <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
  19654. </p>
  19655. <p>This muxer computes and prints the Adler-32 CRC for each audio
  19656. and video packet. By default audio frames are converted to signed
  19657. 16-bit raw audio and video frames to raw video before computing the
  19658. CRC.
  19659. </p>
  19660. <p>The output of the muxer consists of a line for each audio and video
  19661. packet of the form:
  19662. </p><div class="example">
  19663. <pre class="example-preformatted"><var class="var">stream_index</var>, <var class="var">packet_dts</var>, <var class="var">packet_pts</var>, <var class="var">packet_duration</var>, <var class="var">packet_size</var>, 0x<var class="var">CRC</var>
  19664. </pre></div>
  19665. <p><var class="var">CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
  19666. CRC of the packet.
  19667. </p>
  19668. <a name="Examples-17"></a>
  19669. <h4 class="subsection">21.39.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-17" aria-hidden="true">TOC</a></span></h4>
  19670. <p>For example to compute the CRC of the audio and video frames in
  19671. <samp class="file">INPUT</samp>, converted to raw audio and video packets, and store it
  19672. in the file <samp class="file">out.crc</samp>:
  19673. </p><div class="example">
  19674. <pre class="example-preformatted">ffmpeg -i INPUT -f framecrc out.crc
  19675. </pre></div>
  19676. <p>To print the information to stdout, use the command:
  19677. </p><div class="example">
  19678. <pre class="example-preformatted">ffmpeg -i INPUT -f framecrc -
  19679. </pre></div>
  19680. <p>With <code class="command">ffmpeg</code>, you can select the output format to which the
  19681. audio and video frames are encoded before computing the CRC for each
  19682. packet by specifying the audio and video codec. For example, to
  19683. compute the CRC of each decoded input audio frame converted to PCM
  19684. unsigned 8-bit and of each decoded input video frame converted to
  19685. MPEG-2 video, use the command:
  19686. </p><div class="example">
  19687. <pre class="example-preformatted">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  19688. </pre></div>
  19689. <p>See also the <a class="ref" href="#crc">crc</a> muxer.
  19690. </p>
  19691. <a class="anchor" id="framehash"></a><a name="framehash-1"></a>
  19692. <h3 class="section">21.40 framehash<span class="pull-right"><a class="anchor hidden-xs" href="#framehash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framehash-1" aria-hidden="true">TOC</a></span></h3>
  19693. <p>Per-packet hash testing format.
  19694. </p>
  19695. <p>This muxer computes and prints a cryptographic hash for each audio
  19696. and video packet. This can be used for packet-by-packet equality
  19697. checks without having to individually do a binary comparison on each.
  19698. </p>
  19699. <p>By default audio frames are converted to signed 16-bit raw audio and
  19700. video frames to raw video before computing the hash, but the output
  19701. of explicit conversions to other codecs can also be used. It uses the
  19702. SHA-256 cryptographic hash function by default, but supports several
  19703. other algorithms.
  19704. </p>
  19705. <p>The output of the muxer consists of a line for each audio and video
  19706. packet of the form:
  19707. </p><div class="example">
  19708. <pre class="example-preformatted"><var class="var">stream_index</var>, <var class="var">packet_dts</var>, <var class="var">packet_pts</var>, <var class="var">packet_duration</var>, <var class="var">packet_size</var>, <var class="var">hash</var>
  19709. </pre></div>
  19710. <p><var class="var">hash</var> is a hexadecimal number representing the computed hash
  19711. for the packet.
  19712. </p>
  19713. <dl class="table">
  19714. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  19715. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  19716. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  19717. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  19718. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  19719. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  19720. </p>
  19721. </dd>
  19722. </dl>
  19723. <a name="Examples-18"></a>
  19724. <h4 class="subsection">21.40.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-18" aria-hidden="true">TOC</a></span></h4>
  19725. <p>To compute the SHA-256 hash of the audio and video frames in <samp class="file">INPUT</samp>,
  19726. converted to raw audio and video packets, and store it in the file
  19727. <samp class="file">out.sha256</samp>:
  19728. </p><div class="example">
  19729. <pre class="example-preformatted">ffmpeg -i INPUT -f framehash out.sha256
  19730. </pre></div>
  19731. <p>To print the information to stdout, using the MD5 hash function, use
  19732. the command:
  19733. </p><div class="example">
  19734. <pre class="example-preformatted">ffmpeg -i INPUT -f framehash -hash md5 -
  19735. </pre></div>
  19736. <p>See also the <a class="ref" href="#hash">hash</a> muxer.
  19737. </p>
  19738. <a class="anchor" id="framemd5"></a><a name="framemd5-1"></a>
  19739. <h3 class="section">21.41 framemd5<span class="pull-right"><a class="anchor hidden-xs" href="#framemd5-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framemd5-1" aria-hidden="true">TOC</a></span></h3>
  19740. <p>Per-packet MD5 testing format.
  19741. </p>
  19742. <p>This is a variant of the <a class="ref" href="#framehash">framehash</a> muxer. Unlike that muxer,
  19743. it defaults to using the MD5 hash function.
  19744. </p>
  19745. <a name="Examples-19"></a>
  19746. <h4 class="subsection">21.41.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-19" aria-hidden="true">TOC</a></span></h4>
  19747. <p>To compute the MD5 hash of the audio and video frames in <samp class="file">INPUT</samp>,
  19748. converted to raw audio and video packets, and store it in the file
  19749. <samp class="file">out.md5</samp>:
  19750. </p><div class="example">
  19751. <pre class="example-preformatted">ffmpeg -i INPUT -f framemd5 out.md5
  19752. </pre></div>
  19753. <p>To print the information to stdout, use the command:
  19754. </p><div class="example">
  19755. <pre class="example-preformatted">ffmpeg -i INPUT -f framemd5 -
  19756. </pre></div>
  19757. <p>See also the <a class="ref" href="#framehash">framehash</a> and <a class="ref" href="#md5">md5</a> muxers.
  19758. </p>
  19759. <a class="anchor" id="gif"></a><a name="gif-2"></a>
  19760. <h3 class="section">21.42 gif<span class="pull-right"><a class="anchor hidden-xs" href="#gif-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gif-2" aria-hidden="true">TOC</a></span></h3>
  19761. <p>Animated GIF muxer.
  19762. </p>
  19763. <p>Note that the GIF format has a very large time base: the delay between two frames can
  19764. therefore not be smaller than one centi second.
  19765. </p>
  19766. <a name="Options-81"></a>
  19767. <h4 class="subsection">21.42.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-81" aria-hidden="true">TOC</a></span></h4>
  19768. <dl class="table">
  19769. <dt><samp class="option">loop <var class="var">bool</var></samp></dt>
  19770. <dd><p>Set the number of times to loop the output. Use <code class="code">-1</code> for no loop, <code class="code">0</code>
  19771. for looping indefinitely (default).
  19772. </p>
  19773. </dd>
  19774. <dt><samp class="option">final_delay <var class="var">delay</var></samp></dt>
  19775. <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
  19776. ends with a delay until the next frame. The default is <code class="code">-1</code>, which is a
  19777. special value to tell the muxer to reuse the previous delay. In case of a
  19778. loop, you might want to customize this value to mark a pause for instance.
  19779. </p></dd>
  19780. </dl>
  19781. <a name="Example-6"></a>
  19782. <h4 class="subsection">21.42.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-6" aria-hidden="true">TOC</a></span></h4>
  19783. <p>Encode a gif looping 10 times, with a 5 seconds delay between
  19784. the loops:
  19785. </p><div class="example">
  19786. <pre class="example-preformatted">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  19787. </pre></div>
  19788. <p>Note 1: if you wish to extract the frames into separate GIF files, you need to
  19789. force the <a class="ref" href="#image2">image2</a> muxer:
  19790. </p><div class="example">
  19791. <pre class="example-preformatted">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
  19792. </pre></div>
  19793. <a name="gxf"></a>
  19794. <h3 class="section">21.43 gxf<span class="pull-right"><a class="anchor hidden-xs" href="#gxf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gxf" aria-hidden="true">TOC</a></span></h3>
  19795. <p>General eXchange Format (GXF) muxer.
  19796. </p>
  19797. <p>GXF was developed by Grass Valley Group, then standardized by SMPTE as SMPTE
  19798. 360M and was extended in SMPTE RDD 14-2007 to include high-definition video
  19799. resolutions.
  19800. </p>
  19801. <p>It accepts at most one video stream with codec &lsquo;<samp class="samp">mjpeg</samp>&rsquo;, or
  19802. &lsquo;<samp class="samp">mpeg1video</samp>&rsquo;, or &lsquo;<samp class="samp">mpeg2video</samp>&rsquo;, or &lsquo;<samp class="samp">dvvideo</samp>&rsquo; with resolution
  19803. &lsquo;<samp class="samp">512x480</samp>&rsquo; or &lsquo;<samp class="samp">608x576</samp>&rsquo;, and several audio streams with rate 48000Hz
  19804. and codec &lsquo;<samp class="samp">pcm16_le</samp>&rsquo;.
  19805. </p>
  19806. <a class="anchor" id="hash"></a><a name="hash-1"></a>
  19807. <h3 class="section">21.44 hash<span class="pull-right"><a class="anchor hidden-xs" href="#hash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hash-1" aria-hidden="true">TOC</a></span></h3>
  19808. <p>Hash testing format.
  19809. </p>
  19810. <p>This muxer computes and prints a cryptographic hash of all the input
  19811. audio and video frames. This can be used for equality checks without
  19812. having to do a complete binary comparison.
  19813. </p>
  19814. <p>By default audio frames are converted to signed 16-bit raw audio and
  19815. video frames to raw video before computing the hash, but the output
  19816. of explicit conversions to other codecs can also be used. Timestamps
  19817. are ignored. It uses the SHA-256 cryptographic hash function by default,
  19818. but supports several other algorithms.
  19819. </p>
  19820. <p>The output of the muxer consists of a single line of the form:
  19821. <var class="var">algo</var>=<var class="var">hash</var>, where <var class="var">algo</var> is a short string representing
  19822. the hash function used, and <var class="var">hash</var> is a hexadecimal number
  19823. representing the computed hash.
  19824. </p>
  19825. <dl class="table">
  19826. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  19827. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  19828. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  19829. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  19830. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  19831. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  19832. </p>
  19833. </dd>
  19834. </dl>
  19835. <a name="Examples-20"></a>
  19836. <h4 class="subsection">21.44.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-20" aria-hidden="true">TOC</a></span></h4>
  19837. <p>To compute the SHA-256 hash of the input converted to raw audio and
  19838. video, and store it in the file <samp class="file">out.sha256</samp>:
  19839. </p><div class="example">
  19840. <pre class="example-preformatted">ffmpeg -i INPUT -f hash out.sha256
  19841. </pre></div>
  19842. <p>To print an MD5 hash to stdout use the command:
  19843. </p><div class="example">
  19844. <pre class="example-preformatted">ffmpeg -i INPUT -f hash -hash md5 -
  19845. </pre></div>
  19846. <p>See also the <a class="ref" href="#framehash">framehash</a> muxer.
  19847. </p>
  19848. <a class="anchor" id="hds"></a><a name="hds-1"></a>
  19849. <h3 class="section">21.45 hds<span class="pull-right"><a class="anchor hidden-xs" href="#hds-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hds-1" aria-hidden="true">TOC</a></span></h3>
  19850. <p>HTTP Dynamic Streaming (HDS) muxer.
  19851. </p>
  19852. <p>HTTP dynamic streaming, or HDS, is an adaptive bitrate streaming method
  19853. developed by Adobe. HDS delivers MP4 video content over HTTP connections. HDS
  19854. can be used for on-demand streaming or live streaming.
  19855. </p>
  19856. <p>This muxer creates an .f4m (Adobe Flash Media Manifest File) manifest, an .abst
  19857. (Adobe Bootstrap File) for each stream, and segment files in a directory
  19858. specified as the output.
  19859. </p>
  19860. <p>These needs to be accessed by an HDS player through HTTPS for it to be able to
  19861. perform playback on the generated stream.
  19862. </p>
  19863. <a name="Options-82"></a>
  19864. <h4 class="subsection">21.45.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-82" aria-hidden="true">TOC</a></span></h4>
  19865. <dl class="table">
  19866. <dt><samp class="option">extra_window_size <var class="var">int</var></samp></dt>
  19867. <dd><p>number of fragments kept outside of the manifest before removing from disk
  19868. </p>
  19869. </dd>
  19870. <dt><samp class="option">min_frag_duration <var class="var">microseconds</var></samp></dt>
  19871. <dd><p>minimum fragment duration (in microseconds), default value is 1 second
  19872. (<code class="code">10000000</code>)
  19873. </p>
  19874. </dd>
  19875. <dt><samp class="option">remove_at_exit <var class="var">bool</var></samp></dt>
  19876. <dd><p>remove all fragments when finished when set to <code class="code">true</code>
  19877. </p>
  19878. </dd>
  19879. <dt><samp class="option">window_size <var class="var">int</var></samp></dt>
  19880. <dd><p>number of fragments kept in the manifest, if set to a value different from
  19881. <code class="code">0</code>. By default all segments are kept in the output directory.
  19882. </p></dd>
  19883. </dl>
  19884. <a name="Example-7"></a>
  19885. <h4 class="subsection">21.45.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-7" aria-hidden="true">TOC</a></span></h4>
  19886. <p>Use <code class="command">ffmpeg</code> to generate HDS files to the <samp class="file">output.hds</samp> directory in
  19887. real-time rate:
  19888. </p><div class="example">
  19889. <pre class="example-preformatted">ffmpeg -re -i INPUT -f hds -b:v 200k output.hds
  19890. </pre></div>
  19891. <a class="anchor" id="hls"></a><a name="hls-2"></a>
  19892. <h3 class="section">21.46 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-2" aria-hidden="true">TOC</a></span></h3>
  19893. <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  19894. the HTTP Live Streaming (HLS) specification.
  19895. </p>
  19896. <p>It creates a playlist file, and one or more segment files. The output filename
  19897. specifies the playlist filename.
  19898. </p>
  19899. <p>By default, the muxer creates a file for each segment produced. These files
  19900. have the same name as the playlist, followed by a sequential number and a
  19901. .ts extension.
  19902. </p>
  19903. <p>Make sure to require a closed GOP when encoding and to set the GOP
  19904. size to fit your segment time constraint.
  19905. </p>
  19906. <p>For example, to convert an input file with <code class="command">ffmpeg</code>:
  19907. </p><div class="example">
  19908. <pre class="example-preformatted">ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  19909. </pre></div>
  19910. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  19911. <samp class="file">out0.ts</samp>, <samp class="file">out1.ts</samp>, <samp class="file">out2.ts</samp>, etc.
  19912. </p>
  19913. <p>See also the <a class="ref" href="#segment">segment</a> muxer, which provides a more generic and
  19914. flexible implementation of a segmenter, and can be used to perform HLS
  19915. segmentation.
  19916. </p>
  19917. <a name="Options-83"></a>
  19918. <h4 class="subsection">21.46.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-83" aria-hidden="true">TOC</a></span></h4>
  19919. <dl class="table">
  19920. <dt><samp class="option">hls_init_time <var class="var">duration</var></samp></dt>
  19921. <dd><p>Set the initial target segment length. Default value is <var class="var">0</var>.
  19922. </p>
  19923. <p><var class="var">duration</var> must be a time duration specification,
  19924. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  19925. </p>
  19926. <p>Segment will be cut on the next key frame after this time has passed on the
  19927. first m3u8 list. After the initial playlist is filled, <code class="command">ffmpeg</code> will cut
  19928. segments at duration equal to <samp class="option">hls_time</samp>.
  19929. </p>
  19930. </dd>
  19931. <dt><samp class="option">hls_time <var class="var">duration</var></samp></dt>
  19932. <dd><p>Set the target segment length. Default value is 2.
  19933. </p>
  19934. <p><var class="var">duration</var> must be a time duration specification,
  19935. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  19936. Segment will be cut on the next key frame after this time has passed.
  19937. </p>
  19938. </dd>
  19939. <dt><samp class="option">hls_list_size <var class="var">size</var></samp></dt>
  19940. <dd><p>Set the maximum number of playlist entries. If set to 0 the list file
  19941. will contain all the segments. Default value is 5.
  19942. </p>
  19943. </dd>
  19944. <dt><samp class="option">hls_delete_threshold <var class="var">size</var></samp></dt>
  19945. <dd><p>Set the number of unreferenced segments to keep on disk before <code class="code">hls_flags delete_segments</code>
  19946. deletes them. Increase this to allow continue clients to download segments which
  19947. were recently referenced in the playlist. Default value is 1, meaning segments older than
  19948. <samp class="option">hls_list_size+1</samp> will be deleted.
  19949. </p>
  19950. </dd>
  19951. <dt><samp class="option">hls_start_number_source <var class="var">source</var></samp></dt>
  19952. <dd><p>Start the playlist sequence number (<code class="code">#EXT-X-MEDIA-SEQUENCE</code>) according to the specified source.
  19953. Unless <samp class="option">hls_flags single_file</samp> is set, it also specifies source of starting sequence numbers of
  19954. segment and subtitle filenames. In any case, if <samp class="option">hls_flags append_list</samp>
  19955. is set and read playlist sequence number is greater than the specified start sequence number,
  19956. then that value will be used as start value.
  19957. </p>
  19958. <p>It accepts the following values:
  19959. </p>
  19960. <dl class="table">
  19961. <dt><samp class="option">generic (default)</samp></dt>
  19962. <dd><p>Set the start numbers according to the <samp class="option">start_number</samp> option value.
  19963. </p>
  19964. </dd>
  19965. <dt><samp class="option">epoch</samp></dt>
  19966. <dd><p>Set the start number as the seconds since epoch (1970-01-01 00:00:00).
  19967. </p>
  19968. </dd>
  19969. <dt><samp class="option">epoch_us</samp></dt>
  19970. <dd><p>Set the start number as the microseconds since epoch (1970-01-01 00:00:00).
  19971. </p>
  19972. </dd>
  19973. <dt><samp class="option">datetime</samp></dt>
  19974. <dd><p>Set the start number based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
  19975. </p></dd>
  19976. </dl>
  19977. </dd>
  19978. <dt><samp class="option">start_number <var class="var">number</var></samp></dt>
  19979. <dd><p>Start the playlist sequence number (<code class="code">#EXT-X-MEDIA-SEQUENCE</code>) from the specified <var class="var">number</var>
  19980. when <samp class="option">hls_start_number_source</samp> value is <var class="var">generic</var>. (This is the default case.)
  19981. Unless <samp class="option">hls_flags single_file</samp> is set, it also specifies starting sequence numbers of segment and subtitle filenames.
  19982. Default value is 0.
  19983. </p>
  19984. </dd>
  19985. <dt><samp class="option">hls_allow_cache <var class="var">bool</var></samp></dt>
  19986. <dd><p>Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  19987. </p>
  19988. </dd>
  19989. <dt><samp class="option">hls_base_url <var class="var">baseurl</var></samp></dt>
  19990. <dd><p>Append <var class="var">baseurl</var> to every entry in the playlist.
  19991. Useful to generate playlists with absolute paths.
  19992. </p>
  19993. <p>Note that the playlist sequence number must be unique for each segment
  19994. and it is not to be confused with the segment filename sequence number
  19995. which can be cyclic, for example if the <samp class="option">wrap</samp> option is
  19996. specified.
  19997. </p>
  19998. </dd>
  19999. <dt><samp class="option">hls_segment_filename <var class="var">filename</var></samp></dt>
  20000. <dd><p>Set the segment filename. Unless the <samp class="option">hls_flags</samp> option is set with
  20001. &lsquo;<samp class="samp">single_file</samp>&rsquo;, <var class="var">filename</var> is used as a string format with the
  20002. segment number appended.
  20003. </p>
  20004. <p>For example:
  20005. </p><div class="example">
  20006. <pre class="example-preformatted">ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  20007. </pre></div>
  20008. <p>will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  20009. <samp class="file">file000.ts</samp>, <samp class="file">file001.ts</samp>, <samp class="file">file002.ts</samp>, etc.
  20010. </p>
  20011. <p><var class="var">filename</var> may contain a full path or relative path specification,
  20012. but only the file name part without any path will be contained in the m3u8 segment list.
  20013. Should a relative path be specified, the path of the created segment
  20014. files will be relative to the current working directory.
  20015. When <samp class="option">strftime_mkdir</samp> is set, the whole expanded value of <var class="var">filename</var> will be written into the m3u8 segment list.
  20016. </p>
  20017. <p>When <samp class="option">var_stream_map</samp> is set with two or more variant streams, the
  20018. <var class="var">filename</var> pattern must contain the string &quot;%v&quot;, and this string will be
  20019. expanded to the position of variant stream index in the generated segment file
  20020. names.
  20021. </p>
  20022. <p>For example:
  20023. </p><div class="example">
  20024. <pre class="example-preformatted">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  20025. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  20026. -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
  20027. </pre></div>
  20028. <p>will produce the playlists segment file sets:
  20029. <samp class="file">file_0_000.ts</samp>, <samp class="file">file_0_001.ts</samp>, <samp class="file">file_0_002.ts</samp>, etc. and
  20030. <samp class="file">file_1_000.ts</samp>, <samp class="file">file_1_001.ts</samp>, <samp class="file">file_1_002.ts</samp>, etc.
  20031. </p>
  20032. <p>The string &quot;%v&quot; may be present in the filename or in the last directory name
  20033. containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
  20034. sub-directory or filename.) If the string %v is present in the directory name, then
  20035. sub-directories are created after expanding the directory name pattern. This
  20036. enables creation of segments corresponding to different variant streams in
  20037. subdirectories.
  20038. </p>
  20039. <p>For example:
  20040. </p><div class="example">
  20041. <pre class="example-preformatted">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  20042. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  20043. -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
  20044. </pre></div>
  20045. <p>will produce the playlists segment file sets:
  20046. <samp class="file">vs0/file_000.ts</samp>, <samp class="file">vs0/file_001.ts</samp>, <samp class="file">vs0/file_002.ts</samp>, etc. and
  20047. <samp class="file">vs1/file_000.ts</samp>, <samp class="file">vs1/file_001.ts</samp>, <samp class="file">vs1/file_002.ts</samp>, etc.
  20048. </p>
  20049. </dd>
  20050. <dt><samp class="option">strftime <var class="var">bool</var></samp></dt>
  20051. <dd><p>Use <code class="code">strftime()</code> on <var class="var">filename</var> to expand the segment filename with
  20052. localtime. The segment number is also available in this mode, but to use it,
  20053. you need to set &lsquo;<samp class="samp">second_level_segment_index</samp>&rsquo; in the <samp class="option">hls_flag</samp> and
  20054. %%d will be the specifier.
  20055. </p>
  20056. <p>For example:
  20057. </p><div class="example">
  20058. <pre class="example-preformatted">ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
  20059. </pre></div>
  20060. <p>will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  20061. <samp class="file">file-20160215-1455569023.ts</samp>, <samp class="file">file-20160215-1455569024.ts</samp>, etc.
  20062. Note: On some systems/environments, the <code class="code">%s</code> specifier is not
  20063. available. See <code class="code">strftime()</code> documentation.
  20064. </p>
  20065. <p>For example:
  20066. </p><div class="example">
  20067. <pre class="example-preformatted">ffmpeg -i in.nut -strftime 1 -hls_flags second_level_segment_index -hls_segment_filename 'file-%Y%m%d-%%04d.ts' out.m3u8
  20068. </pre></div>
  20069. <p>will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  20070. <samp class="file">file-20160215-0001.ts</samp>, <samp class="file">file-20160215-0002.ts</samp>, etc.
  20071. </p>
  20072. </dd>
  20073. <dt><samp class="option">strftime_mkdir <var class="var">bool</var></samp></dt>
  20074. <dd><p>Used together with <samp class="option">strftime</samp>, it will create all subdirectories which
  20075. are present in the expanded values of option <samp class="option">hls_segment_filename</samp>.
  20076. </p>
  20077. <p>For example:
  20078. </p><div class="example">
  20079. <pre class="example-preformatted">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
  20080. </pre></div>
  20081. <p>will create a directory <samp class="file">201560215</samp> (if it does not exist), and then
  20082. produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  20083. <samp class="file">20160215/file-20160215-1455569023.ts</samp>,
  20084. <samp class="file">20160215/file-20160215-1455569024.ts</samp>, etc.
  20085. </p>
  20086. <p>For example:
  20087. </p><div class="example">
  20088. <pre class="example-preformatted">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y/%m/%d/file-%Y%m%d-%s.ts' out.m3u8
  20089. </pre></div>
  20090. <p>will create a directory hierarchy <samp class="file">2016/02/15</samp> (if any of them do not
  20091. exist), and then produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  20092. <samp class="file">2016/02/15/file-20160215-1455569023.ts</samp>,
  20093. <samp class="file">2016/02/15/file-20160215-1455569024.ts</samp>, etc.
  20094. </p>
  20095. </dd>
  20096. <dt><samp class="option">hls_segment_options <var class="var">options_list</var></samp></dt>
  20097. <dd><p>Set output format options using a :-separated list of key=value
  20098. parameters. Values containing <code class="code">:</code> special characters must be
  20099. escaped.
  20100. </p>
  20101. </dd>
  20102. <dt><samp class="option">hls_key_info_file <var class="var">key_info_file</var></samp></dt>
  20103. <dd><p>Use the information in <var class="var">key_info_file</var> for segment encryption. The first
  20104. line of <var class="var">key_info_file</var> specifies the key URI written to the playlist. The
  20105. key URL is used to access the encryption key during playback. The second line
  20106. specifies the path to the key file used to obtain the key during the encryption
  20107. process. The key file is read as a single packed array of 16 octets in binary
  20108. format. The optional third line specifies the initialization vector (IV) as a
  20109. hexadecimal string to be used instead of the segment sequence number (default)
  20110. for encryption. Changes to <var class="var">key_info_file</var> will result in segment
  20111. encryption with the new key/IV and an entry in the playlist for the new key
  20112. URI/IV if <samp class="option">hls_flags periodic_rekey</samp> is enabled.
  20113. </p>
  20114. <p>Key info file format:
  20115. </p><div class="example">
  20116. <pre class="example-preformatted"><var class="var">key URI</var>
  20117. <var class="var">key file path</var>
  20118. <var class="var">IV</var> (optional)
  20119. </pre></div>
  20120. <p>Example key URIs:
  20121. </p><div class="example">
  20122. <pre class="example-preformatted">http://server/file.key
  20123. /path/to/file.key
  20124. file.key
  20125. </pre></div>
  20126. <p>Example key file paths:
  20127. </p><div class="example">
  20128. <pre class="example-preformatted">file.key
  20129. /path/to/file.key
  20130. </pre></div>
  20131. <p>Example IV:
  20132. </p><div class="example">
  20133. <pre class="example-preformatted">0123456789ABCDEF0123456789ABCDEF
  20134. </pre></div>
  20135. <p>Key info file example:
  20136. </p><div class="example">
  20137. <pre class="example-preformatted">http://server/file.key
  20138. /path/to/file.key
  20139. 0123456789ABCDEF0123456789ABCDEF
  20140. </pre></div>
  20141. <p>Example shell script:
  20142. </p><div class="example">
  20143. <pre class="example-preformatted">#!/bin/sh
  20144. BASE_URL=${1:-'.'}
  20145. openssl rand 16 &gt; file.key
  20146. echo $BASE_URL/file.key &gt; file.keyinfo
  20147. echo file.key &gt;&gt; file.keyinfo
  20148. echo $(openssl rand -hex 16) &gt;&gt; file.keyinfo
  20149. ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  20150. -hls_key_info_file file.keyinfo out.m3u8
  20151. </pre></div>
  20152. </dd>
  20153. <dt><samp class="option">hls_enc <var class="var">bool</var></samp></dt>
  20154. <dd><p>Enable (1) or disable (0) the AES128 encryption.
  20155. When enabled every segment generated is encrypted and the encryption key
  20156. is saved as <var class="var">playlist name</var>.key.
  20157. </p>
  20158. </dd>
  20159. <dt><samp class="option">hls_enc_key <var class="var">key</var></samp></dt>
  20160. <dd><p>Specify a 16-octet key to encrypt the segments, by default it is randomly
  20161. generated.
  20162. </p>
  20163. </dd>
  20164. <dt><samp class="option">hls_enc_key_url <var class="var">keyurl</var></samp></dt>
  20165. <dd><p>If set, <var class="var">keyurl</var> is prepended instead of <var class="var">baseurl</var> to the key filename
  20166. in the playlist.
  20167. </p>
  20168. </dd>
  20169. <dt><samp class="option">hls_enc_iv <var class="var">iv</var></samp></dt>
  20170. <dd><p>Specify the 16-octet initialization vector for every segment instead of the
  20171. autogenerated ones.
  20172. </p>
  20173. </dd>
  20174. <dt><samp class="option">hls_segment_type <var class="var">flags</var></samp></dt>
  20175. <dd><p>Possible values:
  20176. </p>
  20177. <dl class="table">
  20178. <dt>&lsquo;<samp class="samp">mpegts</samp>&rsquo;</dt>
  20179. <dd><p>Output segment files in MPEG-2 Transport Stream format. This is
  20180. compatible with all HLS versions.
  20181. </p>
  20182. </dd>
  20183. <dt>&lsquo;<samp class="samp">fmp4</samp>&rsquo;</dt>
  20184. <dd><p>Output segment files in fragmented MP4 format, similar to MPEG-DASH.
  20185. fmp4 files may be used in HLS version 7 and above.
  20186. </p></dd>
  20187. </dl>
  20188. </dd>
  20189. <dt><samp class="option">hls_fmp4_init_filename <var class="var">filename</var></samp></dt>
  20190. <dd><p>Set filename for the fragment files header file, default filename is <samp class="file">init.mp4</samp>.
  20191. </p>
  20192. <p>When <samp class="option">strftime</samp> is enabled, <var class="var">filename</var> is expanded to the segment filename with localtime.
  20193. </p>
  20194. <p>For example:
  20195. </p><div class="example">
  20196. <pre class="example-preformatted">ffmpeg -i in.nut -hls_segment_type fmp4 -strftime 1 -hls_fmp4_init_filename &quot;%s_init.mp4&quot; out.m3u8
  20197. </pre></div>
  20198. <p>will produce init like this <samp class="file">1602678741_init.mp4</samp>.
  20199. </p>
  20200. </dd>
  20201. <dt><samp class="option">hls_fmp4_init_resend <var class="var">bool</var></samp></dt>
  20202. <dd><p>Resend init file after m3u8 file refresh every time, default is <var class="var">0</var>.
  20203. </p>
  20204. <p>When <samp class="option">var_stream_map</samp> is set with two or more variant streams, the
  20205. <var class="var">filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  20206. the position of variant stream index in the generated init file names.
  20207. The string &quot;%v&quot; may be present in the filename or in the last directory name
  20208. containing the file. If the string is present in the directory name, then
  20209. sub-directories are created after expanding the directory name pattern. This
  20210. enables creation of init files corresponding to different variant streams in
  20211. subdirectories.
  20212. </p>
  20213. </dd>
  20214. <dt><samp class="option">hls_flags <var class="var">flags</var></samp></dt>
  20215. <dd><p>Possible values:
  20216. </p>
  20217. <dl class="table">
  20218. <dt>&lsquo;<samp class="samp">single_file</samp>&rsquo;</dt>
  20219. <dd><p>If this flag is set, the muxer will store all segments in a single MPEG-TS
  20220. file, and will use byte ranges in the playlist. HLS playlists generated with
  20221. this way will have the version number 4.
  20222. </p>
  20223. <p>For example:
  20224. </p><div class="example">
  20225. <pre class="example-preformatted">ffmpeg -i in.nut -hls_flags single_file out.m3u8
  20226. </pre></div>
  20227. <p>will produce the playlist, <samp class="file">out.m3u8</samp>, and a single segment file,
  20228. <samp class="file">out.ts</samp>.
  20229. </p>
  20230. </dd>
  20231. <dt>&lsquo;<samp class="samp">delete_segments</samp>&rsquo;</dt>
  20232. <dd><p>Segment files removed from the playlist are deleted after a period of time
  20233. equal to the duration of the segment plus the duration of the playlist.
  20234. </p>
  20235. </dd>
  20236. <dt>&lsquo;<samp class="samp">append_list</samp>&rsquo;</dt>
  20237. <dd><p>Append new segments into the end of old segment list,
  20238. and remove the <code class="code">#EXT-X-ENDLIST</code> from the old segment list.
  20239. </p>
  20240. </dd>
  20241. <dt>&lsquo;<samp class="samp">round_durations</samp>&rsquo;</dt>
  20242. <dd><p>Round the duration info in the playlist file segment info to integer
  20243. values, instead of using floating point.
  20244. If there are no other features requiring higher HLS versions be used,
  20245. then this will allow <code class="command">ffmpeg</code> to output a HLS version 2 m3u8.
  20246. </p>
  20247. </dd>
  20248. <dt>&lsquo;<samp class="samp">discont_start</samp>&rsquo;</dt>
  20249. <dd><p>Add the <code class="code">#EXT-X-DISCONTINUITY</code> tag to the playlist, before the
  20250. first segment&rsquo;s information.
  20251. </p>
  20252. </dd>
  20253. <dt>&lsquo;<samp class="samp">omit_endlist</samp>&rsquo;</dt>
  20254. <dd><p>Do not append the <code class="code">EXT-X-ENDLIST</code> tag at the end of the playlist.
  20255. </p>
  20256. </dd>
  20257. <dt>&lsquo;<samp class="samp">periodic_rekey</samp>&rsquo;</dt>
  20258. <dd><p>The file specified by <code class="code">hls_key_info_file</code> will be checked periodically and
  20259. detect updates to the encryption info. Be sure to replace this file atomically,
  20260. including the file containing the AES encryption key.
  20261. </p>
  20262. </dd>
  20263. <dt>&lsquo;<samp class="samp">independent_segments</samp>&rsquo;</dt>
  20264. <dd><p>Add the <code class="code">#EXT-X-INDEPENDENT-SEGMENTS</code> tag to playlists that has video segments
  20265. and when all the segments of that playlist are guaranteed to start with a key frame.
  20266. </p>
  20267. </dd>
  20268. <dt>&lsquo;<samp class="samp">iframes_only</samp>&rsquo;</dt>
  20269. <dd><p>Add the <code class="code">#EXT-X-I-FRAMES-ONLY</code> tag to playlists that has video segments
  20270. and can play only I-frames in the <code class="code">#EXT-X-BYTERANGE</code> mode.
  20271. </p>
  20272. </dd>
  20273. <dt>&lsquo;<samp class="samp">split_by_time</samp>&rsquo;</dt>
  20274. <dd><p>Allow segments to start on frames other than key frames. This improves
  20275. behavior on some players when the time between key frames is inconsistent,
  20276. but may make things worse on others, and can cause some oddities during
  20277. seeking. This flag should be used with the <samp class="option">hls_time</samp> option.
  20278. </p>
  20279. </dd>
  20280. <dt>&lsquo;<samp class="samp">program_date_time</samp>&rsquo;</dt>
  20281. <dd><p>Generate <code class="code">EXT-X-PROGRAM-DATE-TIME</code> tags.
  20282. </p>
  20283. </dd>
  20284. <dt>&lsquo;<samp class="samp">second_level_segment_index</samp>&rsquo;</dt>
  20285. <dd><p>Make it possible to use segment indexes as %%d in the
  20286. <samp class="option">hls_segment_filename</samp> option expression besides date/time values when
  20287. <samp class="option">strftime</samp> option is on. To get fixed width numbers with trailing zeroes, %%0xd format
  20288. is available where x is the required width.
  20289. </p>
  20290. </dd>
  20291. <dt>&lsquo;<samp class="samp">second_level_segment_size</samp>&rsquo;</dt>
  20292. <dd><p>Make it possible to use segment sizes (counted in bytes) as %%s in
  20293. <samp class="option">hls_segment_filename</samp> option expression besides date/time values when
  20294. strftime is on. To get fixed width numbers with trailing zeroes, %%0xs format
  20295. is available where x is the required width.
  20296. </p>
  20297. </dd>
  20298. <dt>&lsquo;<samp class="samp">second_level_segment_duration</samp>&rsquo;</dt>
  20299. <dd><p>Make it possible to use segment duration (calculated in microseconds) as %%t in
  20300. <samp class="option">hls_segment_filename</samp> option expression besides date/time values when
  20301. strftime is on. To get fixed width numbers with trailing zeroes, %%0xt format
  20302. is available where x is the required width.
  20303. </p>
  20304. <p>For example:
  20305. </p><div class="example">
  20306. <pre class="example-preformatted">ffmpeg -i sample.mpeg \
  20307. -f hls -hls_time 3 -hls_list_size 5 \
  20308. -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
  20309. -strftime 1 -strftime_mkdir 1 -hls_segment_filename &quot;segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts&quot; stream.m3u8
  20310. </pre></div>
  20311. <p>will produce segments like this:
  20312. <samp class="file">segment_20170102194334_0003_00122200_0000003000000.ts</samp>, <samp class="file">segment_20170102194334_0004_00120072_0000003000000.ts</samp> etc.
  20313. </p>
  20314. </dd>
  20315. <dt>&lsquo;<samp class="samp">temp_file</samp>&rsquo;</dt>
  20316. <dd><p>Write segment data to <samp class="file">filename.tmp</samp> and rename to filename only once the
  20317. segment is complete.
  20318. </p>
  20319. <p>A webserver serving up segments can be configured to reject requests to *.tmp to
  20320. prevent access to in-progress segments before they have been added to the m3u8
  20321. playlist.
  20322. </p>
  20323. <p>This flag also affects how m3u8 playlist files are created. If this flag is set,
  20324. all playlist files will be written into a temporary file and renamed after they
  20325. are complete, similarly as segments are handled. But playlists with <code class="code">file</code>
  20326. protocol and with <samp class="option">hls_playlist_type</samp> type other than &lsquo;<samp class="samp">vod</samp>&rsquo; are
  20327. always written into a temporary file regardless of this flag.
  20328. </p>
  20329. <p>Master playlist files specified with <samp class="option">master_pl_name</samp>, if any, with
  20330. <code class="code">file</code> protocol, are always written into temporary file regardless of this
  20331. flag if <samp class="option">master_pl_publish_rate</samp> value is other than zero.
  20332. </p></dd>
  20333. </dl>
  20334. </dd>
  20335. <dt><samp class="option">hls_playlist_type <var class="var">type</var></samp></dt>
  20336. <dd><p>If type is &lsquo;<samp class="samp">event</samp>&rsquo;, emit <code class="code">#EXT-X-PLAYLIST-TYPE:EVENT</code> in the m3u8
  20337. header. This forces <samp class="option">hls_list_size</samp> to 0; the playlist can only be
  20338. appended to.
  20339. </p>
  20340. <p>If type is &lsquo;<samp class="samp">vod</samp>&rsquo;, emit <code class="code">#EXT-X-PLAYLIST-TYPE:VOD</code> in the m3u8
  20341. header. This forces <samp class="option">hls_list_size</samp> to 0; the playlist must not change.
  20342. </p>
  20343. </dd>
  20344. <dt><samp class="option">method <var class="var">method</var></samp></dt>
  20345. <dd><p>Use the given HTTP method to create the hls files.
  20346. </p>
  20347. <p>For example:
  20348. </p><div class="example">
  20349. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
  20350. </pre></div>
  20351. <p>will upload all the mpegts segment files to the HTTP server using the HTTP PUT
  20352. method, and update the m3u8 files every <code class="code">refresh</code> times using the same
  20353. method. Note that the HTTP server must support the given method for uploading
  20354. files.
  20355. </p>
  20356. </dd>
  20357. <dt><samp class="option">http_user_agent <var class="var">agent</var></samp></dt>
  20358. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  20359. </p>
  20360. </dd>
  20361. <dt><samp class="option">var_stream_map <var class="var">stream_map</var></samp></dt>
  20362. <dd><p>Specify a map string defining how to group the audio, video and subtitle streams
  20363. into different variant streams. The variant stream groups are separated by
  20364. space.
  20365. </p>
  20366. <p>Expected string format is like this &quot;a:0,v:0 a:1,v:1 ....&quot;. Here a:, v:, s: are
  20367. the keys to specify audio, video and subtitle streams respectively.
  20368. Allowed values are 0 to 9 (limited just based on practical usage).
  20369. </p>
  20370. <p>When there are two or more variant streams, the output filename pattern must
  20371. contain the string &quot;%v&quot;: this string specifies the position of variant stream
  20372. index in the output media playlist filenames. The string &quot;%v&quot; may be present in
  20373. the filename or in the last directory name containing the file. If the string is
  20374. present in the directory name, then sub-directories are created after expanding
  20375. the directory name pattern. This enables creation of variant streams in
  20376. subdirectories.
  20377. </p>
  20378. <p>A few examples follow.
  20379. </p>
  20380. <ul class="itemize mark-bullet">
  20381. <li>Create two hls variant streams. The first variant stream will contain video
  20382. stream of bitrate 1000k and audio stream of bitrate 64k and the second variant
  20383. stream will contain video stream of bitrate 256k and audio stream of bitrate
  20384. 32k. Here, two media playlist with file names <samp class="file">out_0.m3u8</samp> and
  20385. <samp class="file">out_1.m3u8</samp> will be created.
  20386. <div class="example">
  20387. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  20388. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  20389. http://example.com/live/out_%v.m3u8
  20390. </pre></div>
  20391. </li><li>If you want something meaningful text instead of indexes in result names, you
  20392. may specify names for each or some of the variants. The following example will
  20393. create two hls variant streams as in the previous one. But here, the two media
  20394. playlist with file names <samp class="file">out_my_hd.m3u8</samp> and <samp class="file">out_my_sd.m3u8</samp> will be
  20395. created.
  20396. <div class="example">
  20397. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  20398. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0,name:my_hd v:1,a:1,name:my_sd&quot; \
  20399. http://example.com/live/out_%v.m3u8
  20400. </pre></div>
  20401. </li><li>Create three hls variant streams. The first variant stream will be a video only
  20402. stream with video bitrate 1000k, the second variant stream will be an audio only
  20403. stream with bitrate 64k and the third variant stream will be a video only stream
  20404. with bitrate 256k. Here, three media playlist with file names <samp class="file">out_0.m3u8</samp>,
  20405. <samp class="file">out_1.m3u8</samp> and <samp class="file">out_2.m3u8</samp> will be created.
  20406. <div class="example">
  20407. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
  20408. -map 0:v -map 0:a -map 0:v -f hls -var_stream_map &quot;v:0 a:0 v:1&quot; \
  20409. http://example.com/live/out_%v.m3u8
  20410. </pre></div>
  20411. </li><li>Create the variant streams in subdirectories. Here, the first media playlist is
  20412. created at <samp class="file">http://example.com/live/vs_0/out.m3u8</samp> and the second one at
  20413. <samp class="file">http://example.com/live/vs_1/out.m3u8</samp>.
  20414. <div class="example">
  20415. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  20416. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  20417. http://example.com/live/vs_%v/out.m3u8
  20418. </pre></div>
  20419. </li><li>Create two audio only and two video only variant streams. In addition to the
  20420. <code class="code">#EXT-X-STREAM-INF</code> tag for each variant stream in the master playlist, the
  20421. <code class="code">#EXT-X-MEDIA</code> tag is also added for the two audio only variant streams and
  20422. they are mapped to the two video only variant streams with audio group names
  20423. &rsquo;aud_low&rsquo; and &rsquo;aud_high&rsquo;.
  20424. By default, a single hls variant containing all the encoded streams is created.
  20425. <div class="example">
  20426. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \
  20427. -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
  20428. -var_stream_map &quot;a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high&quot; \
  20429. -master_pl_name master.m3u8 \
  20430. http://example.com/live/out_%v.m3u8
  20431. </pre></div>
  20432. </li><li>
  20433. Create two audio only and one video only variant streams. In addition to the
  20434. <code class="code">#EXT-X-STREAM-INF</code> tag for each variant stream in the master playlist, the
  20435. <code class="code">#EXT-X-MEDIA</code> tag is also added for the two audio only variant streams and
  20436. they are mapped to the one video only variant streams with audio group name
  20437. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES.
  20438. By default, a single hls variant containing all the encoded streams is created.
  20439. <div class="example">
  20440. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  20441. -map 0:a -map 0:a -map 0:v -f hls \
  20442. -var_stream_map &quot;a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low&quot; \
  20443. -master_pl_name master.m3u8 \
  20444. http://example.com/live/out_%v.m3u8
  20445. </pre></div>
  20446. </li><li>Create two audio only and one video only variant streams. In addition to the
  20447. <code class="code">#EXT-X-STREAM-INF</code> tag for each variant stream in the master playlist, the
  20448. <code class="code">#EXT-X-MEDIA</code> tag is also added for the two audio only variant streams and
  20449. they are mapped to the one video only variant streams with audio group name
  20450. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES, and one audio
  20451. have and language is named ENG, the other audio language is named CHN. By
  20452. default, a single hls variant containing all the encoded streams is created.
  20453. <div class="example">
  20454. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  20455. -map 0:a -map 0:a -map 0:v -f hls \
  20456. -var_stream_map &quot;a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low&quot; \
  20457. -master_pl_name master.m3u8 \
  20458. http://example.com/live/out_%v.m3u8
  20459. </pre></div>
  20460. </li><li>Create a single variant stream. Add the <code class="code">#EXT-X-MEDIA</code> tag with
  20461. <code class="code">TYPE=SUBTITLES</code> in the master playlist with webvtt subtitle group name
  20462. &rsquo;subtitle&rsquo; and optional subtitle name, e.g. &rsquo;English&rsquo;. Make sure the input
  20463. file has one text subtitle stream at least.
  20464. <div class="example">
  20465. <pre class="example-preformatted">ffmpeg -y -i input_with_subtitle.mkv \
  20466. -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
  20467. -b:a:0 256k \
  20468. -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
  20469. -f hls -var_stream_map &quot;v:0,a:0,s:0,sgroup:subtitle,sname:English&quot; \
  20470. -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
  20471. 10 -master_pl_publish_rate 10 -hls_flags \
  20472. delete_segments+discont_start+split_by_time ./tmp/video.m3u8
  20473. </pre></div>
  20474. </li></ul>
  20475. </dd>
  20476. <dt><samp class="option">cc_stream_map <var class="var">cc_stream_map</var></samp></dt>
  20477. <dd><p>Map string which specifies different closed captions groups and their
  20478. attributes. The closed captions stream groups are separated by space.
  20479. </p>
  20480. <p>Expected string format is like this
  20481. &quot;ccgroup:&lt;group name&gt;,instreamid:&lt;INSTREAM-ID&gt;,language:&lt;language code&gt; ....&quot;.
  20482. &rsquo;ccgroup&rsquo; and &rsquo;instreamid&rsquo; are mandatory attributes. &rsquo;language&rsquo; is an optional
  20483. attribute.
  20484. </p>
  20485. <p>The closed captions groups configured using this option are mapped to different
  20486. variant streams by providing the same &rsquo;ccgroup&rsquo; name in the
  20487. <samp class="option">var_stream_map</samp> string.
  20488. </p>
  20489. <p>For example:
  20490. </p><div class="example">
  20491. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  20492. -a53cc:0 1 -a53cc:1 1 \
  20493. -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
  20494. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp&quot; \
  20495. -var_stream_map &quot;v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc&quot; \
  20496. -master_pl_name master.m3u8 \
  20497. http://example.com/live/out_%v.m3u8
  20498. </pre></div>
  20499. <p>will add two <code class="code">#EXT-X-MEDIA</code> tags with <code class="code">TYPE=CLOSED-CAPTIONS</code> in the
  20500. master playlist for the INSTREAM-IDs &rsquo;CC1&rsquo; and &rsquo;CC2&rsquo;. Also, it will add
  20501. <code class="code">CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo; for the two output variant
  20502. streams.
  20503. </p>
  20504. <p>If <samp class="option">var_stream_map</samp> is not set, then the first available ccgroup in
  20505. <samp class="option">cc_stream_map</samp> is mapped to the output variant stream.
  20506. </p>
  20507. <p>For example:
  20508. </p><div class="example">
  20509. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
  20510. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en&quot; \
  20511. -master_pl_name master.m3u8 \
  20512. http://example.com/live/out.m3u8
  20513. </pre></div>
  20514. <p>this will add <code class="code">#EXT-X-MEDIA</code> tag with <code class="code">TYPE=CLOSED-CAPTIONS</code> in the
  20515. master playlist with group name &rsquo;cc&rsquo;, language &rsquo;en&rsquo; (english) and INSTREAM-ID
  20516. &rsquo;CC1&rsquo;. Also, it will add <code class="code">CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo;
  20517. for the output variant stream.
  20518. </p>
  20519. </dd>
  20520. <dt><samp class="option">master_pl_name <var class="var">name</var></samp></dt>
  20521. <dd><p>Create HLS master playlist with the given name.
  20522. </p>
  20523. <p>For example:
  20524. </p><div class="example">
  20525. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
  20526. </pre></div>
  20527. <p>creates an HLS master playlist with name <samp class="file">master.m3u8</samp> which is published
  20528. at <a class="url" href="http://example.com/live/">http://example.com/live/</a>.
  20529. </p>
  20530. </dd>
  20531. <dt><samp class="option">master_pl_publish_rate <var class="var">count</var></samp></dt>
  20532. <dd><p>Publish master play list repeatedly every after specified number of segment intervals.
  20533. </p>
  20534. <p>For example:
  20535. </p><div class="example">
  20536. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
  20537. -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
  20538. </pre></div>
  20539. <p>creates an HLS master playlist with name <samp class="file">master.m3u8</samp> and keeps
  20540. publishing it repeatedly every after 30 segments i.e. every after 60s.
  20541. </p>
  20542. </dd>
  20543. <dt><samp class="option">http_persistent <var class="var">bool</var></samp></dt>
  20544. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  20545. </p>
  20546. </dd>
  20547. <dt><samp class="option">timeout <var class="var">timeout</var></samp></dt>
  20548. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  20549. </p>
  20550. </dd>
  20551. <dt><samp class="option">ignore_io_errors <var class="var">bool</var></samp></dt>
  20552. <dd><p>Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
  20553. </p>
  20554. </dd>
  20555. <dt><samp class="option">headers <var class="var">headers</var></samp></dt>
  20556. <dd><p>Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
  20557. </p></dd>
  20558. </dl>
  20559. <a name="iamf"></a>
  20560. <h3 class="section">21.47 iamf<span class="pull-right"><a class="anchor hidden-xs" href="#iamf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iamf" aria-hidden="true">TOC</a></span></h3>
  20561. <p>Immersive Audio Model and Formats (IAMF) muxer.
  20562. </p>
  20563. <p>IAMF is used to provide immersive audio content for presentation on a wide range
  20564. of devices in both streaming and offline applications. These applications
  20565. include internet audio streaming, multicasting/broadcasting services, file
  20566. download, gaming, communication, virtual and augmented reality, and others. In
  20567. these applications, audio may be played back on a wide range of devices, e.g.,
  20568. headphones, mobile phones, tablets, TVs, sound bars, home theater systems, and
  20569. big screens.
  20570. </p>
  20571. <p>This format was promoted and designed by Alliance for Open Media.
  20572. </p>
  20573. <p>For more information about this format, see <a class="url" href="https://aomedia.org/iamf/">https://aomedia.org/iamf/</a>.
  20574. </p>
  20575. <a class="anchor" id="ico"></a><a name="ico-1"></a>
  20576. <h3 class="section">21.48 ico<span class="pull-right"><a class="anchor hidden-xs" href="#ico-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ico-1" aria-hidden="true">TOC</a></span></h3>
  20577. <p>ICO file muxer.
  20578. </p>
  20579. <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
  20580. </p>
  20581. <ul class="itemize mark-bullet">
  20582. <li>Size cannot exceed 256 pixels in any dimension
  20583. </li><li>Only BMP and PNG images can be stored
  20584. </li><li>If a BMP image is used, it must be one of the following pixel formats:
  20585. <div class="example">
  20586. <pre class="example-preformatted">BMP Bit Depth FFmpeg Pixel Format
  20587. 1bit pal8
  20588. 4bit pal8
  20589. 8bit pal8
  20590. 16bit rgb555le
  20591. 24bit bgr24
  20592. 32bit bgra
  20593. </pre></div>
  20594. </li><li>If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  20595. </li><li>If a PNG image is used, it must use the rgba pixel format
  20596. </li></ul>
  20597. <a name="ilbc"></a>
  20598. <h3 class="section">21.49 ilbc<span class="pull-right"><a class="anchor hidden-xs" href="#ilbc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ilbc" aria-hidden="true">TOC</a></span></h3>
  20599. <p>Internet Low Bitrate Codec (iLBC) raw muxer.
  20600. </p>
  20601. <p>It accepts a single &lsquo;<samp class="samp">ilbc</samp>&rsquo; audio stream.
  20602. </p>
  20603. <a class="anchor" id="image2"></a><a name="image2_002c-image2pipe"></a>
  20604. <h3 class="section">21.50 image2, image2pipe<span class="pull-right"><a class="anchor hidden-xs" href="#image2_002c-image2pipe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-image2_002c-image2pipe" aria-hidden="true">TOC</a></span></h3>
  20605. <p>Image file muxer.
  20606. </p>
  20607. <p>The &lsquo;<samp class="samp">image2</samp>&rsquo; muxer writes video frames to image files.
  20608. </p>
  20609. <p>The output filenames are specified by a pattern, which can be used to
  20610. produce sequentially numbered series of files.
  20611. The pattern may contain the string &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, this string
  20612. specifies the position of the characters representing a numbering in
  20613. the filenames. If the form &quot;%0<var class="var">N</var>d&quot; is used, the string
  20614. representing the number in each filename is 0-padded to <var class="var">N</var>
  20615. digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
  20616. the string &quot;%%&quot;.
  20617. </p>
  20618. <p>If the pattern contains &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, the first filename of
  20619. the file list specified will contain the number 1, all the following
  20620. numbers will be sequential.
  20621. </p>
  20622. <p>The pattern may contain a suffix which is used to automatically
  20623. determine the format of the image files to write.
  20624. </p>
  20625. <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
  20626. filenames of the form <samp class="file">img-001.bmp</samp>, <samp class="file">img-002.bmp</samp>, ...,
  20627. <samp class="file">img-010.bmp</samp>, etc.
  20628. The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
  20629. form <samp class="file">img%-1.jpg</samp>, <samp class="file">img%-2.jpg</samp>, ..., <samp class="file">img%-10.jpg</samp>,
  20630. etc.
  20631. </p>
  20632. <p>The image muxer supports the .Y.U.V image file format. This format is
  20633. special in that each image frame consists of three files, for
  20634. each of the YUV420P components. To read or write this image file format,
  20635. specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
  20636. &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
  20637. </p>
  20638. <p>The &lsquo;<samp class="samp">image2pipe</samp>&rsquo; muxer accepts the same options as the &lsquo;<samp class="samp">image2</samp>&rsquo; muxer,
  20639. but ignores the pattern verification and expansion, as it is supposed to write
  20640. to the command output rather than to an actual stored file.
  20641. </p>
  20642. <a name="Options-84"></a>
  20643. <h4 class="subsection">21.50.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-84" aria-hidden="true">TOC</a></span></h4>
  20644. <dl class="table">
  20645. <dt><samp class="option">frame_pts <var class="var">bool</var></samp></dt>
  20646. <dd><p>If set to 1, expand the filename with the packet PTS (presentation time stamp).
  20647. Default value is 0.
  20648. </p>
  20649. </dd>
  20650. <dt><samp class="option">start_number <var class="var">count</var></samp></dt>
  20651. <dd><p>Start the sequence from the specified number. Default value is 1.
  20652. </p>
  20653. </dd>
  20654. <dt><samp class="option">update <var class="var">bool</var></samp></dt>
  20655. <dd><p>If set to 1, the filename will always be interpreted as just a
  20656. filename, not a pattern, and the corresponding file will be continuously
  20657. overwritten with new images. Default value is 0.
  20658. </p>
  20659. </dd>
  20660. <dt><samp class="option">strftime <var class="var">bool</var></samp></dt>
  20661. <dd><p>If set to 1, expand the filename with date and time information from
  20662. <code class="code">strftime()</code>. Default value is 0.
  20663. </p>
  20664. </dd>
  20665. <dt><samp class="option">atomic_writing <var class="var">bool</var></samp></dt>
  20666. <dd><p>Write output to a temporary file, which is renamed to target filename once
  20667. writing is completed. Default is disabled.
  20668. </p>
  20669. </dd>
  20670. <dt><samp class="option">protocol_opts <var class="var">options_list</var></samp></dt>
  20671. <dd><p>Set protocol options as a :-separated list of key=value parameters. Values
  20672. containing the <code class="code">:</code> special character must be escaped.
  20673. </p></dd>
  20674. </dl>
  20675. <a name="Examples-21"></a>
  20676. <h4 class="subsection">21.50.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-21" aria-hidden="true">TOC</a></span></h4>
  20677. <ul class="itemize mark-bullet">
  20678. <li>Use <code class="command">ffmpeg</code> for creating a sequence of files <samp class="file">img-001.jpeg</samp>,
  20679. <samp class="file">img-002.jpeg</samp>, ..., taking one image every second from the input video:
  20680. <div class="example">
  20681. <pre class="example-preformatted">ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
  20682. </pre></div>
  20683. <p>Note that with <code class="command">ffmpeg</code>, if the format is not specified with the
  20684. <code class="code">-f</code> option and the output filename specifies an image file
  20685. format, the image2 muxer is automatically selected, so the previous
  20686. command can be written as:
  20687. </p><div class="example">
  20688. <pre class="example-preformatted">ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
  20689. </pre></div>
  20690. <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
  20691. &quot;%0<var class="var">N</var>d&quot;, for example to create a single image file
  20692. <samp class="file">img.jpeg</samp> from the start of the input video you can employ the command:
  20693. </p><div class="example">
  20694. <pre class="example-preformatted">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  20695. </pre></div>
  20696. </li><li>The <samp class="option">strftime</samp> option allows you to expand the filename with
  20697. date and time information. Check the documentation of
  20698. the <code class="code">strftime()</code> function for the syntax.
  20699. <p>To generate image files from the <code class="code">strftime()</code> &quot;%Y-%m-%d_%H-%M-%S&quot; pattern,
  20700. the following <code class="command">ffmpeg</code> command can be used:
  20701. </p><div class="example">
  20702. <pre class="example-preformatted">ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 &quot;%Y-%m-%d_%H-%M-%S.jpg&quot;
  20703. </pre></div>
  20704. </li><li>Set the file name with current frame&rsquo;s PTS:
  20705. <div class="example">
  20706. <pre class="example-preformatted">ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg
  20707. </pre></div>
  20708. </li><li>Publish contents of your desktop directly to a WebDAV server every second:
  20709. <div class="example">
  20710. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
  20711. </pre></div>
  20712. </li></ul>
  20713. <a name="ircam"></a>
  20714. <h3 class="section">21.51 ircam<span class="pull-right"><a class="anchor hidden-xs" href="#ircam" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ircam" aria-hidden="true">TOC</a></span></h3>
  20715. <p>Berkeley / IRCAM / CARL Sound Filesystem (BICSF) format muxer.
  20716. </p>
  20717. <p>The Berkeley/IRCAM/CARL Sound Format, developed in the 1980s, is a result of the
  20718. merging of several different earlier sound file formats and systems including
  20719. the csound system developed by Dr Gareth Loy at the Computer Audio Research Lab
  20720. (CARL) at UC San Diego, the IRCAM sound file system developed by Rob Gross and
  20721. Dan Timis at the Institut de Recherche et Coordination Acoustique / Musique in
  20722. Paris and the Berkeley Fast Filesystem.
  20723. </p>
  20724. <p>It was developed initially as part of the Berkeley/IRCAM/CARL Sound Filesystem,
  20725. a suite of programs designed to implement a filesystem for audio applications
  20726. running under Berkeley UNIX. It was particularly popular in academic music
  20727. research centres, and was used a number of times in the creation of early
  20728. computer-generated compositions.
  20729. </p>
  20730. <p>This muxer accepts a single audio stream containing PCM data.
  20731. </p>
  20732. <a name="ivf"></a>
  20733. <h3 class="section">21.52 ivf<span class="pull-right"><a class="anchor hidden-xs" href="#ivf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ivf" aria-hidden="true">TOC</a></span></h3>
  20734. <p>On2 IVF muxer.
  20735. </p>
  20736. <p>IVF was developed by On2 Technologies (formerly known as Duck
  20737. Corporation), to store internally developed codecs.
  20738. </p>
  20739. <p>This muxer accepts a single &lsquo;<samp class="samp">vp8</samp>&rsquo;, &lsquo;<samp class="samp">vp9</samp>&rsquo;, or &lsquo;<samp class="samp">av1</samp>&rsquo;
  20740. video stream.
  20741. </p>
  20742. <a name="jacosub"></a>
  20743. <h3 class="section">21.53 jacosub<span class="pull-right"><a class="anchor hidden-xs" href="#jacosub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jacosub" aria-hidden="true">TOC</a></span></h3>
  20744. <p>JACOsub subtitle format muxer.
  20745. </p>
  20746. <p>This muxer accepts a single &lsquo;<samp class="samp">jacosub</samp>&rsquo; subtitles stream.
  20747. </p>
  20748. <p>For more information about the format, see
  20749. <a class="url" href="http://unicorn.us.com/jacosub/jscripts.html">http://unicorn.us.com/jacosub/jscripts.html</a>.
  20750. </p>
  20751. <a name="kvag"></a>
  20752. <h3 class="section">21.54 kvag<span class="pull-right"><a class="anchor hidden-xs" href="#kvag" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kvag" aria-hidden="true">TOC</a></span></h3>
  20753. <p>Simon &amp; Schuster Interactive VAG muxer.
  20754. </p>
  20755. <p>This custom VAG container is used by some Simon &amp; Schuster Interactive
  20756. games such as &quot;Real War&quot;, and &quot;Real War: Rogue States&quot;.
  20757. </p>
  20758. <p>This muxer accepts a single &lsquo;<samp class="samp">adpcm_ima_ssi</samp>&rsquo; audio stream.
  20759. </p>
  20760. <a name="lc3"></a>
  20761. <h3 class="section">21.55 lc3<span class="pull-right"><a class="anchor hidden-xs" href="#lc3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lc3" aria-hidden="true">TOC</a></span></h3>
  20762. <p>Bluetooth SIG Low Complexity Communication Codec audio (LC3), or
  20763. ETSI TS 103 634 Low Complexity Communication Codec plus (LC3plus).
  20764. </p>
  20765. <p>This muxer accepts a single &lsquo;<samp class="samp">lc3</samp>&rsquo; audio stream.
  20766. </p>
  20767. <a name="lrc-1"></a>
  20768. <h3 class="section">21.56 lrc<span class="pull-right"><a class="anchor hidden-xs" href="#lrc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lrc-1" aria-hidden="true">TOC</a></span></h3>
  20769. <p>LRC lyrics file format muxer.
  20770. </p>
  20771. <p>LRC (short for LyRiCs) is a computer file format that synchronizes
  20772. song lyrics with an audio file, such as MP3, Vorbis, or MIDI.
  20773. </p>
  20774. <p>This muxer accepts a single &lsquo;<samp class="samp">subrip</samp>&rsquo; or &lsquo;<samp class="samp">text</samp>&rsquo; subtitles stream.
  20775. </p>
  20776. <a name="Metadata"></a>
  20777. <h4 class="subsection">21.56.1 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata" aria-hidden="true">TOC</a></span></h4>
  20778. <p>The following metadata tags are converted to the format corresponding
  20779. metadata:
  20780. </p>
  20781. <dl class="table">
  20782. <dt><samp class="option">title</samp></dt>
  20783. <dt><samp class="option">album</samp></dt>
  20784. <dt><samp class="option">artist</samp></dt>
  20785. <dt><samp class="option">author</samp></dt>
  20786. <dt><samp class="option">creator</samp></dt>
  20787. <dt><samp class="option">encoder</samp></dt>
  20788. <dt><samp class="option">encoder_version</samp></dt>
  20789. </dl>
  20790. <p>If &lsquo;<samp class="samp">encoder_version</samp>&rsquo; is not explicitly set, it is automatically
  20791. set to the libavformat version.
  20792. </p>
  20793. <a name="matroska"></a>
  20794. <h3 class="section">21.57 matroska<span class="pull-right"><a class="anchor hidden-xs" href="#matroska" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-matroska" aria-hidden="true">TOC</a></span></h3>
  20795. <p>Matroska container muxer.
  20796. </p>
  20797. <p>This muxer implements the matroska and webm container specs.
  20798. </p>
  20799. <a name="Metadata-1"></a>
  20800. <h4 class="subsection">21.57.1 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata-1" aria-hidden="true">TOC</a></span></h4>
  20801. <p>The recognized metadata settings in this muxer are:
  20802. </p>
  20803. <dl class="table">
  20804. <dt><samp class="option">title</samp></dt>
  20805. <dd><p>Set title name provided to a single track. This gets mapped to
  20806. the FileDescription element for a stream written as attachment.
  20807. </p>
  20808. </dd>
  20809. <dt><samp class="option">language</samp></dt>
  20810. <dd><p>Specify the language of the track in the Matroska languages form.
  20811. </p>
  20812. <p>The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  20813. 639-2/B) form (like &quot;fre&quot; for French), or a language code mixed with a
  20814. country code for specialities in languages (like &quot;fre-ca&quot; for Canadian
  20815. French).
  20816. </p>
  20817. </dd>
  20818. <dt><samp class="option">stereo_mode</samp></dt>
  20819. <dd><p>Set stereo 3D video layout of two views in a single video track.
  20820. </p>
  20821. <p>The following values are recognized:
  20822. </p><dl class="table">
  20823. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  20824. <dd><p>video is not stereo
  20825. </p></dd>
  20826. <dt>&lsquo;<samp class="samp">left_right</samp>&rsquo;</dt>
  20827. <dd><p>Both views are arranged side by side, Left-eye view is on the left
  20828. </p></dd>
  20829. <dt>&lsquo;<samp class="samp">bottom_top</samp>&rsquo;</dt>
  20830. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  20831. </p></dd>
  20832. <dt>&lsquo;<samp class="samp">top_bottom</samp>&rsquo;</dt>
  20833. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
  20834. </p></dd>
  20835. <dt>&lsquo;<samp class="samp">checkerboard_rl</samp>&rsquo;</dt>
  20836. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  20837. </p></dd>
  20838. <dt>&lsquo;<samp class="samp">checkerboard_lr</samp>&rsquo;</dt>
  20839. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  20840. </p></dd>
  20841. <dt>&lsquo;<samp class="samp">row_interleaved_rl</samp>&rsquo;</dt>
  20842. <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
  20843. </p></dd>
  20844. <dt>&lsquo;<samp class="samp">row_interleaved_lr</samp>&rsquo;</dt>
  20845. <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
  20846. </p></dd>
  20847. <dt>&lsquo;<samp class="samp">col_interleaved_rl</samp>&rsquo;</dt>
  20848. <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
  20849. </p></dd>
  20850. <dt>&lsquo;<samp class="samp">col_interleaved_lr</samp>&rsquo;</dt>
  20851. <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
  20852. </p></dd>
  20853. <dt>&lsquo;<samp class="samp">anaglyph_cyan_red</samp>&rsquo;</dt>
  20854. <dd><p>All frames are in anaglyph format viewable through red-cyan filters
  20855. </p></dd>
  20856. <dt>&lsquo;<samp class="samp">right_left</samp>&rsquo;</dt>
  20857. <dd><p>Both views are arranged side by side, Right-eye view is on the left
  20858. </p></dd>
  20859. <dt>&lsquo;<samp class="samp">anaglyph_green_magenta</samp>&rsquo;</dt>
  20860. <dd><p>All frames are in anaglyph format viewable through green-magenta filters
  20861. </p></dd>
  20862. <dt>&lsquo;<samp class="samp">block_lr</samp>&rsquo;</dt>
  20863. <dd><p>Both eyes laced in one Block, Left-eye view is first
  20864. </p></dd>
  20865. <dt>&lsquo;<samp class="samp">block_rl</samp>&rsquo;</dt>
  20866. <dd><p>Both eyes laced in one Block, Right-eye view is first
  20867. </p></dd>
  20868. </dl>
  20869. </dd>
  20870. </dl>
  20871. <p>For example a 3D WebM clip can be created using the following command line:
  20872. </p><div class="example">
  20873. <pre class="example-preformatted">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  20874. </pre></div>
  20875. <a name="Options-85"></a>
  20876. <h4 class="subsection">21.57.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-85" aria-hidden="true">TOC</a></span></h4>
  20877. <dl class="table">
  20878. <dt><samp class="option">reserve_index_space <var class="var">size</var></samp></dt>
  20879. <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
  20880. terms) at the end of the file, because it cannot know in advance how much space
  20881. to leave for the index at the beginning of the file. However for some use cases
  20882. &ndash; e.g. streaming where seeking is possible but slow &ndash; it is useful to put the
  20883. index at the beginning of the file.
  20884. </p>
  20885. <p>If this option is set to a non-zero value, the muxer will reserve <var class="var">size</var> bytes
  20886. of space in the file header and then try to write the cues there when the muxing
  20887. finishes. If the reserved space does not suffice, no Cues will be written, the
  20888. file will be finalized and writing the trailer will return an error.
  20889. A safe size for most use cases should be about 50kB per hour of video.
  20890. </p>
  20891. <p>Note that cues are only written if the output is seekable and this option will
  20892. have no effect if it is not.
  20893. </p>
  20894. </dd>
  20895. <dt><samp class="option">cues_to_front <var class="var">bool</var></samp></dt>
  20896. <dd><p>If set, the muxer will write the index at the beginning of the file
  20897. by shifting the main data if necessary. This can be combined with
  20898. reserve_index_space in which case the data is only shifted if
  20899. the initially reserved space turns out to be insufficient.
  20900. </p>
  20901. <p>This option is ignored if the output is unseekable.
  20902. </p>
  20903. </dd>
  20904. <dt><samp class="option">cluster_size_limit <var class="var">size</var></samp></dt>
  20905. <dd><p>Store at most the provided amount of bytes in a cluster.
  20906. </p>
  20907. <p>If not specified, the limit is set automatically to a sensible
  20908. hardcoded fixed value.
  20909. </p>
  20910. </dd>
  20911. <dt><samp class="option">cluster_time_limit <var class="var">duration</var></samp></dt>
  20912. <dd><p>Store at most the provided number of milliseconds in a cluster.
  20913. </p>
  20914. <p>If not specified, the limit is set automatically to a sensible
  20915. hardcoded fixed value.
  20916. </p>
  20917. </dd>
  20918. <dt><samp class="option">dash <var class="var">bool</var></samp></dt>
  20919. <dd><p>Create a WebM file conforming to WebM DASH specification. By default
  20920. it is set to <code class="code">false</code>.
  20921. </p>
  20922. </dd>
  20923. <dt><samp class="option">dash_track_number <var class="var">index</var></samp></dt>
  20924. <dd><p>Track number for the DASH stream. By default it is set to <code class="code">1</code>.
  20925. </p>
  20926. </dd>
  20927. <dt><samp class="option">live <var class="var">bool</var></samp></dt>
  20928. <dd><p>Write files assuming it is a live stream. By default it is set to
  20929. <code class="code">false</code>.
  20930. </p>
  20931. </dd>
  20932. <dt><samp class="option">allow_raw_vfw <var class="var">bool</var></samp></dt>
  20933. <dd><p>Allow raw VFW mode. By default it is set to <code class="code">false</code>.
  20934. </p>
  20935. </dd>
  20936. <dt><samp class="option">flipped_raw_rgb <var class="var">bool</var></samp></dt>
  20937. <dd><p>If set to <code class="code">true</code>, store positive height for raw RGB bitmaps, which indicates
  20938. bitmap is stored bottom-up. Note that this option does not flip the bitmap
  20939. which has to be done manually beforehand, e.g. by using the &lsquo;<samp class="samp">vflip</samp>&rsquo; filter.
  20940. Default is <code class="code">false</code> and indicates bitmap is stored top down.
  20941. </p>
  20942. </dd>
  20943. <dt><samp class="option">write_crc32 <var class="var">bool</var></samp></dt>
  20944. <dd><p>Write a CRC32 element inside every Level 1 element. By default it is
  20945. set to <code class="code">true</code>. This option is ignored for WebM.
  20946. </p>
  20947. </dd>
  20948. <dt><samp class="option">default_mode <var class="var">mode</var></samp></dt>
  20949. <dd><p>Control how the FlagDefault of the output tracks will be set.
  20950. It influences which tracks players should play by default. The default mode
  20951. is &lsquo;<samp class="samp">passthrough</samp>&rsquo;.
  20952. </p><dl class="table">
  20953. <dt>&lsquo;<samp class="samp">infer</samp>&rsquo;</dt>
  20954. <dd><p>Every track with disposition default will have the FlagDefault set.
  20955. Additionally, for each type of track (audio, video or subtitle), if no track
  20956. with disposition default of this type exists, then the first track of this type
  20957. will be marked as default (if existing). This ensures that the default flag
  20958. is set in a sensible way even if the input originated from containers that
  20959. lack the concept of default tracks.
  20960. </p></dd>
  20961. <dt>&lsquo;<samp class="samp">infer_no_subs</samp>&rsquo;</dt>
  20962. <dd><p>This mode is the same as infer except that if no subtitle track with
  20963. disposition default exists, no subtitle track will be marked as default.
  20964. </p></dd>
  20965. <dt>&lsquo;<samp class="samp">passthrough</samp>&rsquo;</dt>
  20966. <dd><p>In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT
  20967. flag is set in the disposition of the corresponding stream.
  20968. </p></dd>
  20969. </dl>
  20970. </dd>
  20971. </dl>
  20972. <a class="anchor" id="md5"></a><a name="md5-1"></a>
  20973. <h3 class="section">21.58 md5<span class="pull-right"><a class="anchor hidden-xs" href="#md5-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-md5-1" aria-hidden="true">TOC</a></span></h3>
  20974. <p>MD5 testing format.
  20975. </p>
  20976. <p>This is a variant of the <a class="ref" href="#hash">hash</a> muxer. Unlike that muxer, it
  20977. defaults to using the MD5 hash function.
  20978. </p>
  20979. <p>See also the <a class="ref" href="#hash">hash</a> and <a class="ref" href="#framemd5">framemd5</a> muxers.
  20980. </p>
  20981. <a name="Examples-22"></a>
  20982. <h4 class="subsection">21.58.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-22" aria-hidden="true">TOC</a></span></h4>
  20983. <ul class="itemize mark-bullet">
  20984. <li>To compute the MD5 hash of the input converted to raw
  20985. audio and video, and store it in the file <samp class="file">out.md5</samp>:
  20986. <div class="example">
  20987. <pre class="example-preformatted">ffmpeg -i INPUT -f md5 out.md5
  20988. </pre></div>
  20989. </li><li>To print the MD5 hash to stdout:
  20990. <div class="example">
  20991. <pre class="example-preformatted">ffmpeg -i INPUT -f md5 -
  20992. </pre></div>
  20993. </li></ul>
  20994. <a class="anchor" id="mccenc"></a><a name="mcc-1"></a>
  20995. <h3 class="section">21.59 mcc<span class="pull-right"><a class="anchor hidden-xs" href="#mcc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcc-1" aria-hidden="true">TOC</a></span></h3>
  20996. <p>Muxer for MacCaption MCC files, it supports MCC versions 1.0 and 2.0.
  20997. MCC files store VANC data, which can include closed captions (EIA-608 and CEA-708), ancillary time code, pan-scan data, etc.
  20998. </p>
  20999. <a name="Options-86"></a>
  21000. <h4 class="subsection">21.59.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-86" aria-hidden="true">TOC</a></span></h4>
  21001. <p>The muxer options are:
  21002. </p>
  21003. <dl class="table">
  21004. <dt><samp class="option">override_time_code_rate</samp></dt>
  21005. <dd><p>Override the <code class="code">Time Code Rate</code> value in the output. Defaults to trying to deduce from the stream&rsquo;s <code class="code">time_base</code>, which often doesn&rsquo;t work.
  21006. </p></dd>
  21007. <dt><samp class="option">use_u_alias</samp></dt>
  21008. <dd><p>Use the <code class="code">U</code> alias for the byte sequence <code class="code">E1h 00h 00h 00h</code>.
  21009. Disabled by default because some <samp class="file">.mcc</samp> files disagree on whether it has 2 or 3 zero bytes.
  21010. </p></dd>
  21011. <dt><samp class="option">mcc_version</samp></dt>
  21012. <dd><p>The MCC file format version. Must be either 1 or 2, defaults to 2.
  21013. </p></dd>
  21014. <dt><samp class="option">creation_program</samp></dt>
  21015. <dd><p>The creation program. Defaults to this version of FFmpeg.
  21016. </p></dd>
  21017. <dt><samp class="option">creation_time</samp></dt>
  21018. <dd><p>The creation time. Defaults to the current time.
  21019. </p></dd>
  21020. </dl>
  21021. <a name="Examples-23"></a>
  21022. <h4 class="subsection">21.59.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-23" aria-hidden="true">TOC</a></span></h4>
  21023. <ul class="itemize mark-bullet">
  21024. <li>Extract a MXF <code class="code">SMPTE_436M_ANC</code> stream from a MXF file and write it to a MCC file at 30 fps.
  21025. <div class="example">
  21026. <pre class="example-preformatted">ffmpeg -i input.mxf -c copy -map 0:d -override_time_code_rate 30 out.mcc
  21027. </pre></div>
  21028. </li><li>Extract EIA-608/CTA-708 closed captions from a <samp class="file">.mp4</samp> file and write them to a MCC file at 29.97 fps.
  21029. <div class="example">
  21030. <pre class="example-preformatted">ffmpeg -f lavfi -i &quot;movie=input.mp4[out+subcc]&quot; -c:s copy -map 0:s -override_time_code_rate 30000/1001 out.mcc
  21031. </pre></div>
  21032. </li></ul>
  21033. <a name="microdvd"></a>
  21034. <h3 class="section">21.60 microdvd<span class="pull-right"><a class="anchor hidden-xs" href="#microdvd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-microdvd" aria-hidden="true">TOC</a></span></h3>
  21035. <p>MicroDVD subtitle format muxer.
  21036. </p>
  21037. <p>This muxer accepts a single &lsquo;<samp class="samp">microdvd</samp>&rsquo; subtitles stream.
  21038. </p>
  21039. <a name="mmf"></a>
  21040. <h3 class="section">21.61 mmf<span class="pull-right"><a class="anchor hidden-xs" href="#mmf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmf" aria-hidden="true">TOC</a></span></h3>
  21041. <p>Synthetic music Mobile Application Format (SMAF) format muxer.
  21042. </p>
  21043. <p>SMAF is a music data format specified by Yamaha for portable
  21044. electronic devices, such as mobile phones and personal digital
  21045. assistants.
  21046. </p>
  21047. <p>This muxer accepts a single &lsquo;<samp class="samp">adpcm_yamaha</samp>&rsquo; audio stream.
  21048. </p>
  21049. <a name="mp3"></a>
  21050. <h3 class="section">21.62 mp3<span class="pull-right"><a class="anchor hidden-xs" href="#mp3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mp3" aria-hidden="true">TOC</a></span></h3>
  21051. <p>The MP3 muxer writes a raw MP3 stream with the following optional features:
  21052. </p><ul class="itemize mark-bullet">
  21053. <li>An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  21054. 2.4 are supported, the <code class="code">id3v2_version</code> private option controls which one is
  21055. used (3 or 4). Setting <code class="code">id3v2_version</code> to 0 disables the ID3v2 header
  21056. completely.
  21057. <p>The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  21058. The pictures are supplied to the muxer in form of a video stream with a single
  21059. packet. There can be any number of those streams, each will correspond to a
  21060. single APIC frame. The stream metadata tags <var class="var">title</var> and <var class="var">comment</var> map
  21061. to APIC <var class="var">description</var> and <var class="var">picture type</var> respectively. See
  21062. <a class="url" href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
  21063. </p>
  21064. <p>Note that the APIC frames must be written at the beginning, so the muxer will
  21065. buffer the audio frames until it gets all the pictures. It is therefore advised
  21066. to provide the pictures as soon as possible to avoid excessive buffering.
  21067. </p>
  21068. </li><li>A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  21069. default, but will be written only if the output is seekable. The
  21070. <code class="code">write_xing</code> private option can be used to disable it. The frame contains
  21071. various information that may be useful to the decoder, like the audio duration
  21072. or encoder delay.
  21073. </li><li>A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  21074. enabled with the <code class="code">write_id3v1</code> private option, but as its capabilities are
  21075. very limited, its usage is not recommended.
  21076. </li></ul>
  21077. <p>Examples:
  21078. </p>
  21079. <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  21080. </p><div class="example">
  21081. <pre class="example-preformatted">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  21082. </pre></div>
  21083. <p>To attach a picture to an mp3 file select both the audio and the picture stream
  21084. with <code class="code">map</code>:
  21085. </p><div class="example">
  21086. <pre class="example-preformatted">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  21087. -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
  21088. </pre></div>
  21089. <p>Write a &quot;clean&quot; MP3 without any extra features:
  21090. </p><div class="example">
  21091. <pre class="example-preformatted">ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  21092. </pre></div>
  21093. <a name="mpegts-1"></a>
  21094. <h3 class="section">21.63 mpegts<span class="pull-right"><a class="anchor hidden-xs" href="#mpegts-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpegts-1" aria-hidden="true">TOC</a></span></h3>
  21095. <p>MPEG transport stream muxer.
  21096. </p>
  21097. <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  21098. </p>
  21099. <p>The recognized metadata settings in mpegts muxer are <code class="code">service_provider</code>
  21100. and <code class="code">service_name</code>. If they are not set the default for
  21101. <code class="code">service_provider</code> is &lsquo;<samp class="samp">FFmpeg</samp>&rsquo; and the default for
  21102. <code class="code">service_name</code> is &lsquo;<samp class="samp">Service01</samp>&rsquo;.
  21103. </p>
  21104. <a name="Options-87"></a>
  21105. <h4 class="subsection">21.63.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-87" aria-hidden="true">TOC</a></span></h4>
  21106. <p>The muxer options are:
  21107. </p>
  21108. <dl class="table">
  21109. <dt><samp class="option">mpegts_transport_stream_id <var class="var">integer</var></samp></dt>
  21110. <dd><p>Set the &lsquo;<samp class="samp">transport_stream_id</samp>&rsquo;. This identifies a transponder in DVB.
  21111. Default is <code class="code">0x0001</code>.
  21112. </p>
  21113. </dd>
  21114. <dt><samp class="option">mpegts_original_network_id <var class="var">integer</var></samp></dt>
  21115. <dd><p>Set the &lsquo;<samp class="samp">original_network_id</samp>&rsquo;. This is unique identifier of a
  21116. network in DVB. Its main use is in the unique identification of a service
  21117. through the path &lsquo;<samp class="samp">Original_Network_ID, Transport_Stream_ID</samp>&rsquo;. Default
  21118. is <code class="code">0x0001</code>.
  21119. </p>
  21120. </dd>
  21121. <dt><samp class="option">mpegts_service_id <var class="var">integer</var></samp></dt>
  21122. <dd><p>Set the &lsquo;<samp class="samp">service_id</samp>&rsquo;, also known as program in DVB. Default is
  21123. <code class="code">0x0001</code>.
  21124. </p>
  21125. </dd>
  21126. <dt><samp class="option">mpegts_service_type <var class="var">integer</var></samp></dt>
  21127. <dd><p>Set the program &lsquo;<samp class="samp">service_type</samp>&rsquo;. Default is <code class="code">digital_tv</code>.
  21128. Accepts the following options:
  21129. </p><dl class="table">
  21130. <dt>&lsquo;<samp class="samp">hex_value</samp>&rsquo;</dt>
  21131. <dd><p>Any hexadecimal value between <code class="code">0x01</code> and <code class="code">0xff</code> as defined in
  21132. ETSI 300 468.
  21133. </p></dd>
  21134. <dt>&lsquo;<samp class="samp">digital_tv</samp>&rsquo;</dt>
  21135. <dd><p>Digital TV service.
  21136. </p></dd>
  21137. <dt>&lsquo;<samp class="samp">digital_radio</samp>&rsquo;</dt>
  21138. <dd><p>Digital Radio service.
  21139. </p></dd>
  21140. <dt>&lsquo;<samp class="samp">teletext</samp>&rsquo;</dt>
  21141. <dd><p>Teletext service.
  21142. </p></dd>
  21143. <dt>&lsquo;<samp class="samp">advanced_codec_digital_radio</samp>&rsquo;</dt>
  21144. <dd><p>Advanced Codec Digital Radio service.
  21145. </p></dd>
  21146. <dt>&lsquo;<samp class="samp">mpeg2_digital_hdtv</samp>&rsquo;</dt>
  21147. <dd><p>MPEG2 Digital HDTV service.
  21148. </p></dd>
  21149. <dt>&lsquo;<samp class="samp">advanced_codec_digital_sdtv</samp>&rsquo;</dt>
  21150. <dd><p>Advanced Codec Digital SDTV service.
  21151. </p></dd>
  21152. <dt>&lsquo;<samp class="samp">advanced_codec_digital_hdtv</samp>&rsquo;</dt>
  21153. <dd><p>Advanced Codec Digital HDTV service.
  21154. </p></dd>
  21155. </dl>
  21156. </dd>
  21157. <dt><samp class="option">mpegts_pmt_start_pid <var class="var">integer</var></samp></dt>
  21158. <dd><p>Set the first PID for PMTs. Default is <code class="code">0x1000</code>, minimum is <code class="code">0x0020</code>,
  21159. maximum is <code class="code">0x1ffa</code>. This option has no effect in m2ts mode where the PMT
  21160. PID is fixed <code class="code">0x0100</code>.
  21161. </p>
  21162. </dd>
  21163. <dt><samp class="option">mpegts_start_pid <var class="var">integer</var></samp></dt>
  21164. <dd><p>Set the first PID for elementary streams. Default is <code class="code">0x0100</code>, minimum is
  21165. <code class="code">0x0020</code>, maximum is <code class="code">0x1ffa</code>. This option has no effect in m2ts mode
  21166. where the elementary stream PIDs are fixed.
  21167. </p>
  21168. </dd>
  21169. <dt><samp class="option">mpegts_m2ts_mode <var class="var">boolean</var></samp></dt>
  21170. <dd><p>Enable m2ts mode if set to <code class="code">1</code>. Default value is <code class="code">-1</code> which
  21171. disables m2ts mode.
  21172. </p>
  21173. </dd>
  21174. <dt><samp class="option">muxrate <var class="var">integer</var></samp></dt>
  21175. <dd><p>Set a constant muxrate. Default is VBR.
  21176. </p>
  21177. </dd>
  21178. <dt><samp class="option">pes_payload_size <var class="var">integer</var></samp></dt>
  21179. <dd><p>Set minimum PES packet payload in bytes. Default is <code class="code">2930</code>.
  21180. </p>
  21181. </dd>
  21182. <dt><samp class="option">mpegts_flags <var class="var">flags</var></samp></dt>
  21183. <dd><p>Set mpegts flags. Accepts the following options:
  21184. </p><dl class="table">
  21185. <dt>&lsquo;<samp class="samp">resend_headers</samp>&rsquo;</dt>
  21186. <dd><p>Reemit PAT/PMT before writing the next packet.
  21187. </p></dd>
  21188. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  21189. <dd><p>Use LATM packetization for AAC.
  21190. </p></dd>
  21191. <dt>&lsquo;<samp class="samp">pat_pmt_at_frames</samp>&rsquo;</dt>
  21192. <dd><p>Reemit PAT and PMT at each video frame.
  21193. </p></dd>
  21194. <dt>&lsquo;<samp class="samp">system_b</samp>&rsquo;</dt>
  21195. <dd><p>Conform to System B (DVB) instead of System A (ATSC).
  21196. </p></dd>
  21197. <dt>&lsquo;<samp class="samp">initial_discontinuity</samp>&rsquo;</dt>
  21198. <dd><p>Mark the initial packet of each stream as discontinuity.
  21199. </p></dd>
  21200. <dt>&lsquo;<samp class="samp">nit</samp>&rsquo;</dt>
  21201. <dd><p>Emit NIT table.
  21202. </p></dd>
  21203. <dt>&lsquo;<samp class="samp">omit_rai</samp>&rsquo;</dt>
  21204. <dd><p>Disable writing of random access indicator.
  21205. </p></dd>
  21206. </dl>
  21207. </dd>
  21208. <dt><samp class="option">mpegts_copyts <var class="var">boolean</var></samp></dt>
  21209. <dd><p>Preserve original timestamps, if value is set to <code class="code">1</code>. Default value
  21210. is <code class="code">-1</code>, which results in shifting timestamps so that they start from 0.
  21211. </p>
  21212. </dd>
  21213. <dt><samp class="option">omit_video_pes_length <var class="var">boolean</var></samp></dt>
  21214. <dd><p>Omit the PES packet length for video packets. Default is <code class="code">1</code> (true).
  21215. </p>
  21216. </dd>
  21217. <dt><samp class="option">pcr_period <var class="var">integer</var></samp></dt>
  21218. <dd><p>Override the default PCR retransmission time in milliseconds. Default is
  21219. <code class="code">-1</code> which means that the PCR interval will be determined automatically:
  21220. 20 ms is used for CBR streams, the highest multiple of the frame duration which
  21221. is less than 100 ms is used for VBR streams.
  21222. </p>
  21223. </dd>
  21224. <dt><samp class="option">pat_period <var class="var">duration</var></samp></dt>
  21225. <dd><p>Maximum time in seconds between PAT/PMT tables. Default is <code class="code">0.1</code>.
  21226. </p>
  21227. </dd>
  21228. <dt><samp class="option">sdt_period <var class="var">duration</var></samp></dt>
  21229. <dd><p>Maximum time in seconds between SDT tables. Default is <code class="code">0.5</code>.
  21230. </p>
  21231. </dd>
  21232. <dt><samp class="option">nit_period <var class="var">duration</var></samp></dt>
  21233. <dd><p>Maximum time in seconds between NIT tables. Default is <code class="code">0.5</code>.
  21234. </p>
  21235. </dd>
  21236. <dt><samp class="option">tables_version <var class="var">integer</var></samp></dt>
  21237. <dd><p>Set PAT, PMT, SDT and NIT version (default <code class="code">0</code>, valid values are from 0 to 31, inclusively).
  21238. This option allows updating stream structure so that standard consumer may
  21239. detect the change. To do so, reopen output <code class="code">AVFormatContext</code> (in case of API
  21240. usage) or restart <code class="command">ffmpeg</code> instance, cyclically changing
  21241. <samp class="option">tables_version</samp> value:
  21242. </p>
  21243. <div class="example">
  21244. <pre class="example-preformatted">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  21245. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  21246. ...
  21247. ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  21248. ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  21249. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  21250. ...
  21251. </pre></div>
  21252. </dd>
  21253. </dl>
  21254. <a name="Example-8"></a>
  21255. <h4 class="subsection">21.63.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-8" aria-hidden="true">TOC</a></span></h4>
  21256. <div class="example">
  21257. <pre class="example-preformatted">ffmpeg -i file.mpg -c copy \
  21258. -mpegts_original_network_id 0x1122 \
  21259. -mpegts_transport_stream_id 0x3344 \
  21260. -mpegts_service_id 0x5566 \
  21261. -mpegts_pmt_start_pid 0x1500 \
  21262. -mpegts_start_pid 0x150 \
  21263. -metadata service_provider=&quot;Some provider&quot; \
  21264. -metadata service_name=&quot;Some Channel&quot; \
  21265. out.ts
  21266. </pre></div>
  21267. <a name="mxf_002c-mxf_005fd10_002c-mxf_005fopatom"></a>
  21268. <h3 class="section">21.64 mxf, mxf_d10, mxf_opatom<span class="pull-right"><a class="anchor hidden-xs" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" aria-hidden="true">TOC</a></span></h3>
  21269. <p>MXF muxer.
  21270. </p>
  21271. <a name="Options-88"></a>
  21272. <h4 class="subsection">21.64.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-88" aria-hidden="true">TOC</a></span></h4>
  21273. <p>The muxer options are:
  21274. </p>
  21275. <dl class="table">
  21276. <dt><samp class="option">store_user_comments <var class="var">bool</var></samp></dt>
  21277. <dd><p>Set if user comments should be stored if available or never.
  21278. IRT D-10 does not allow user comments. The default is thus to write them for
  21279. mxf and mxf_opatom but not for mxf_d10
  21280. </p></dd>
  21281. </dl>
  21282. <a name="null-1"></a>
  21283. <h3 class="section">21.65 null<span class="pull-right"><a class="anchor hidden-xs" href="#null-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null-1" aria-hidden="true">TOC</a></span></h3>
  21284. <p>Null muxer.
  21285. </p>
  21286. <p>This muxer does not generate any output file, it is mainly useful for
  21287. testing or benchmarking purposes.
  21288. </p>
  21289. <p>For example to benchmark decoding with <code class="command">ffmpeg</code> you can use the
  21290. command:
  21291. </p><div class="example">
  21292. <pre class="example-preformatted">ffmpeg -benchmark -i INPUT -f null out.null
  21293. </pre></div>
  21294. <p>Note that the above command does not read or write the <samp class="file">out.null</samp>
  21295. file, but specifying the output file is required by the <code class="command">ffmpeg</code>
  21296. syntax.
  21297. </p>
  21298. <p>Alternatively you can write the command as:
  21299. </p><div class="example">
  21300. <pre class="example-preformatted">ffmpeg -benchmark -i INPUT -f null -
  21301. </pre></div>
  21302. <a name="nut"></a>
  21303. <h3 class="section">21.66 nut<span class="pull-right"><a class="anchor hidden-xs" href="#nut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nut" aria-hidden="true">TOC</a></span></h3>
  21304. <dl class="table">
  21305. <dt><samp class="option">-syncpoints <var class="var">flags</var></samp></dt>
  21306. <dd><p>Change the syncpoint usage in nut:
  21307. </p><dl class="table">
  21308. <dt><samp class="option"><var class="var">default</var> use the normal low-overhead seeking aids.</samp></dt>
  21309. <dt><samp class="option"><var class="var">none</var> do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;</samp></dt>
  21310. <dd><p>Use of this option is not recommended, as the resulting files are very damage
  21311. sensitive and seeking is not possible. Also in general the overhead from
  21312. syncpoints is negligible. Note, -<code class="code">write_index</code> 0 can be used to disable
  21313. all growing data tables, allowing to mux endless streams with limited memory
  21314. and without these disadvantages.
  21315. </p></dd>
  21316. <dt><samp class="option"><var class="var">timestamped</var> extend the syncpoint with a wallclock field.</samp></dt>
  21317. </dl>
  21318. <p>The <var class="var">none</var> and <var class="var">timestamped</var> flags are experimental.
  21319. </p></dd>
  21320. <dt><samp class="option">-write_index <var class="var">bool</var></samp></dt>
  21321. <dd><p>Write index at the end, the default is to write an index.
  21322. </p></dd>
  21323. </dl>
  21324. <div class="example">
  21325. <pre class="example-preformatted">ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  21326. </pre></div>
  21327. <a name="ogg"></a>
  21328. <h3 class="section">21.67 ogg<span class="pull-right"><a class="anchor hidden-xs" href="#ogg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ogg" aria-hidden="true">TOC</a></span></h3>
  21329. <p>Ogg container muxer.
  21330. </p>
  21331. <dl class="table">
  21332. <dt><samp class="option">-page_duration <var class="var">duration</var></samp></dt>
  21333. <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
  21334. pages that are approximately <var class="var">duration</var> microseconds long. This allows the
  21335. user to compromise between seek granularity and container overhead. The default
  21336. is 1 second. A value of 0 will fill all segments, making pages as large as
  21337. possible. A value of 1 will effectively use 1 packet-per-page in most
  21338. situations, giving a small seek granularity at the cost of additional container
  21339. overhead.
  21340. </p></dd>
  21341. <dt><samp class="option">-serial_offset <var class="var">value</var></samp></dt>
  21342. <dd><p>Serial value from which to set the streams serial number.
  21343. Setting it to different and sufficiently large values ensures that the produced
  21344. ogg files can be safely chained.
  21345. </p>
  21346. </dd>
  21347. </dl>
  21348. <a class="anchor" id="rcwtenc"></a><a name="rcwt-1"></a>
  21349. <h3 class="section">21.68 rcwt<span class="pull-right"><a class="anchor hidden-xs" href="#rcwt-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rcwt-1" aria-hidden="true">TOC</a></span></h3>
  21350. <p>RCWT (Raw Captions With Time) is a format native to ccextractor, a commonly
  21351. used open source tool for processing 608/708 Closed Captions (CC) sources.
  21352. It can be used to archive the original extracted CC bitstream and to produce
  21353. a source file for later processing or conversion. The format allows
  21354. for interoperability between ccextractor and FFmpeg, is simple to parse,
  21355. and can be used to create a backup of the CC presentation.
  21356. </p>
  21357. <p>This muxer implements the specification as of March 2024, which has
  21358. been stable and unchanged since April 2014.
  21359. </p>
  21360. <p>This muxer will have some nuances from the way that ccextractor muxes RCWT.
  21361. No compatibility issues when processing the output with ccextractor
  21362. have been observed as a result of this so far, but mileage may vary
  21363. and outputs will not be a bit-exact match.
  21364. </p>
  21365. <p>A free specification of RCWT can be found here:
  21366. <a class="url" href="https://github.com/CCExtractor/ccextractor/blob/master/docs/BINARY_FILE_FORMAT.TXT">https://github.com/CCExtractor/ccextractor/blob/master/docs/BINARY_FILE_FORMAT.TXT</a>
  21367. </p>
  21368. <a name="Examples-24"></a>
  21369. <h4 class="subsection">21.68.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-24" aria-hidden="true">TOC</a></span></h4>
  21370. <ul class="itemize mark-bullet">
  21371. <li>Extract Closed Captions to RCWT using lavfi:
  21372. <div class="example">
  21373. <pre class="example-preformatted">ffmpeg -f lavfi -i &quot;movie=INPUT.mkv[out+subcc]&quot; -map 0:s:0 -c:s copy -f rcwt CC.rcwt.bin
  21374. </pre></div>
  21375. </li></ul>
  21376. <a class="anchor" id="segment"></a><a name="segment_002c-stream_005fsegment_002c-ssegment"></a>
  21377. <h3 class="section">21.69 segment, stream_segment, ssegment<span class="pull-right"><a class="anchor hidden-xs" href="#segment_002c-stream_005fsegment_002c-ssegment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-segment_002c-stream_005fsegment_002c-ssegment" aria-hidden="true">TOC</a></span></h3>
  21378. <p>Basic stream segmenter.
  21379. </p>
  21380. <p>This muxer outputs streams to a number of separate files of nearly
  21381. fixed duration. Output filename pattern can be set in a fashion
  21382. similar to <a class="ref" href="#image2">image2</a>, or by using a <code class="code">strftime</code> template if
  21383. the <samp class="option">strftime</samp> option is enabled.
  21384. </p>
  21385. <p><code class="code">stream_segment</code> is a variant of the muxer used to write to
  21386. streaming output formats, i.e. which do not require global headers,
  21387. and is recommended for outputting e.g. to MPEG transport stream segments.
  21388. <code class="code">ssegment</code> is a shorter alias for <code class="code">stream_segment</code>.
  21389. </p>
  21390. <p>Every segment starts with a keyframe of the selected reference stream,
  21391. which is set through the <samp class="option">reference_stream</samp> option.
  21392. </p>
  21393. <p>Note that if you want accurate splitting for a video file, you need to
  21394. make the input key frames correspond to the exact splitting times
  21395. expected by the segmenter, or the segment muxer will start the new
  21396. segment with the key frame found next after the specified start
  21397. time.
  21398. </p>
  21399. <p>The segment muxer works best with a single constant frame rate video.
  21400. </p>
  21401. <p>Optionally it can generate a list of the created segments, by setting
  21402. the option <var class="var">segment_list</var>. The list type is specified by the
  21403. <var class="var">segment_list_type</var> option. The entry filenames in the segment
  21404. list are set by default to the basename of the corresponding segment
  21405. files.
  21406. </p>
  21407. <p>See also the <a class="ref" href="#hls">hls</a> muxer, which provides a more specific
  21408. implementation for HLS segmentation.
  21409. </p>
  21410. <a name="Options-89"></a>
  21411. <h4 class="subsection">21.69.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-89" aria-hidden="true">TOC</a></span></h4>
  21412. <p>The segment muxer supports the following options:
  21413. </p>
  21414. <dl class="table">
  21415. <dt><samp class="option">increment_tc <var class="var">1|0</var></samp></dt>
  21416. <dd><p>if set to <code class="code">1</code>, increment timecode between each segment
  21417. If this is selected, the input need to have
  21418. a timecode in the first video stream. Default value is
  21419. <code class="code">0</code>.
  21420. </p>
  21421. </dd>
  21422. <dt><samp class="option">reference_stream <var class="var">specifier</var></samp></dt>
  21423. <dd><p>Set the reference stream, as specified by the string <var class="var">specifier</var>.
  21424. If <var class="var">specifier</var> is set to <code class="code">auto</code>, the reference is chosen
  21425. automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
  21426. specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
  21427. reference stream. The default value is <code class="code">auto</code>.
  21428. </p>
  21429. </dd>
  21430. <dt><samp class="option">segment_format <var class="var">format</var></samp></dt>
  21431. <dd><p>Override the inner container format, by default it is guessed by the filename
  21432. extension.
  21433. </p>
  21434. </dd>
  21435. <dt><samp class="option">segment_format_options <var class="var">options_list</var></samp></dt>
  21436. <dd><p>Set output format options using a :-separated list of key=value
  21437. parameters. Values containing the <code class="code">:</code> special character must be
  21438. escaped.
  21439. </p>
  21440. </dd>
  21441. <dt><samp class="option">segment_list <var class="var">name</var></samp></dt>
  21442. <dd><p>Generate also a listfile named <var class="var">name</var>. If not specified no
  21443. listfile is generated.
  21444. </p>
  21445. </dd>
  21446. <dt><samp class="option">segment_list_flags <var class="var">flags</var></samp></dt>
  21447. <dd><p>Set flags affecting the segment list generation.
  21448. </p>
  21449. <p>It currently supports the following flags:
  21450. </p><dl class="table">
  21451. <dt>&lsquo;<samp class="samp">cache</samp>&rsquo;</dt>
  21452. <dd><p>Allow caching (only affects M3U8 list files).
  21453. </p>
  21454. </dd>
  21455. <dt>&lsquo;<samp class="samp">live</samp>&rsquo;</dt>
  21456. <dd><p>Allow live-friendly file generation.
  21457. </p></dd>
  21458. </dl>
  21459. </dd>
  21460. <dt><samp class="option">segment_list_size <var class="var">size</var></samp></dt>
  21461. <dd><p>Update the list file so that it contains at most <var class="var">size</var>
  21462. segments. If 0 the list file will contain all the segments. Default
  21463. value is 0.
  21464. </p>
  21465. </dd>
  21466. <dt><samp class="option">segment_list_entry_prefix <var class="var">prefix</var></samp></dt>
  21467. <dd><p>Prepend <var class="var">prefix</var> to each entry. Useful to generate absolute paths.
  21468. By default no prefix is applied.
  21469. </p>
  21470. </dd>
  21471. <dt><samp class="option">segment_list_type <var class="var">type</var></samp></dt>
  21472. <dd><p>Select the listing format.
  21473. </p>
  21474. <p>The following values are recognized:
  21475. </p><dl class="table">
  21476. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  21477. <dd><p>Generate a flat list for the created segments, one segment per line.
  21478. </p>
  21479. </dd>
  21480. <dt>&lsquo;<samp class="samp">csv, ext</samp>&rsquo;</dt>
  21481. <dd><p>Generate a list for the created segments, one segment per line,
  21482. each line matching the format (comma-separated values):
  21483. </p><div class="example">
  21484. <pre class="example-preformatted"><var class="var">segment_filename</var>,<var class="var">segment_start_time</var>,<var class="var">segment_end_time</var>
  21485. </pre></div>
  21486. <p><var class="var">segment_filename</var> is the name of the output file generated by the
  21487. muxer according to the provided pattern. CSV escaping (according to
  21488. RFC4180) is applied if required.
  21489. </p>
  21490. <p><var class="var">segment_start_time</var> and <var class="var">segment_end_time</var> specify
  21491. the segment start and end time expressed in seconds.
  21492. </p>
  21493. <p>A list file with the suffix <code class="code">&quot;.csv&quot;</code> or <code class="code">&quot;.ext&quot;</code> will
  21494. auto-select this format.
  21495. </p>
  21496. <p>&lsquo;<samp class="samp">ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp class="samp">csv</samp>&rsquo;.
  21497. </p>
  21498. </dd>
  21499. <dt>&lsquo;<samp class="samp">ffconcat</samp>&rsquo;</dt>
  21500. <dd><p>Generate an ffconcat file for the created segments. The resulting file
  21501. can be read using the FFmpeg <a class="ref" href="#concat">concat</a> demuxer.
  21502. </p>
  21503. <p>A list file with the suffix <code class="code">&quot;.ffcat&quot;</code> or <code class="code">&quot;.ffconcat&quot;</code> will
  21504. auto-select this format.
  21505. </p>
  21506. </dd>
  21507. <dt>&lsquo;<samp class="samp">m3u8</samp>&rsquo;</dt>
  21508. <dd><p>Generate an extended M3U8 file, version 3, compliant with
  21509. <a class="url" href="http://tools.ietf.org/id/draft-pantos-http-live-streaming">http://tools.ietf.org/id/draft-pantos-http-live-streaming</a>.
  21510. </p>
  21511. <p>A list file with the suffix <code class="code">&quot;.m3u8&quot;</code> will auto-select this format.
  21512. </p></dd>
  21513. </dl>
  21514. <p>If not specified the type is guessed from the list file name suffix.
  21515. </p>
  21516. </dd>
  21517. <dt><samp class="option">segment_time <var class="var">time</var></samp></dt>
  21518. <dd><p>Set segment duration to <var class="var">time</var>, the value must be a duration
  21519. specification. Default value is &quot;2&quot;. See also the
  21520. <samp class="option">segment_times</samp> option.
  21521. </p>
  21522. <p>Note that splitting may not be accurate, unless you force the
  21523. reference stream key-frames at the given time. See the introductory
  21524. notice and the examples below.
  21525. </p>
  21526. </dd>
  21527. <dt><samp class="option">min_seg_duration <var class="var">time</var></samp></dt>
  21528. <dd><p>Set minimum segment duration to <var class="var">time</var>, the value must be a duration
  21529. specification. This prevents the muxer ending segments at a duration below
  21530. this value. Only effective with <code class="code">segment_time</code>. Default value is &quot;0&quot;.
  21531. </p>
  21532. </dd>
  21533. <dt><samp class="option">segment_atclocktime <var class="var">1|0</var></samp></dt>
  21534. <dd><p>If set to &quot;1&quot; split at regular clock time intervals starting from 00:00
  21535. o&rsquo;clock. The <var class="var">time</var> value specified in <samp class="option">segment_time</samp> is
  21536. used for setting the length of the splitting interval.
  21537. </p>
  21538. <p>For example with <samp class="option">segment_time</samp> set to &quot;900&quot; this makes it possible
  21539. to create files at 12:00 o&rsquo;clock, 12:15, 12:30, etc.
  21540. </p>
  21541. <p>Default value is &quot;0&quot;.
  21542. </p>
  21543. </dd>
  21544. <dt><samp class="option">segment_clocktime_offset <var class="var">duration</var></samp></dt>
  21545. <dd><p>Delay the segment splitting times with the specified duration when using
  21546. <samp class="option">segment_atclocktime</samp>.
  21547. </p>
  21548. <p>For example with <samp class="option">segment_time</samp> set to &quot;900&quot; and
  21549. <samp class="option">segment_clocktime_offset</samp> set to &quot;300&quot; this makes it possible to
  21550. create files at 12:05, 12:20, 12:35, etc.
  21551. </p>
  21552. <p>Default value is &quot;0&quot;.
  21553. </p>
  21554. </dd>
  21555. <dt><samp class="option">segment_clocktime_wrap_duration <var class="var">duration</var></samp></dt>
  21556. <dd><p>Force the segmenter to only start a new segment if a packet reaches the muxer
  21557. within the specified duration after the segmenting clock time. This way you
  21558. can make the segmenter more resilient to backward local time jumps, such as
  21559. leap seconds or transition to standard time from daylight savings time.
  21560. </p>
  21561. <p>Default is the maximum possible duration which means starting a new segment
  21562. regardless of the elapsed time since the last clock time.
  21563. </p>
  21564. </dd>
  21565. <dt><samp class="option">segment_time_delta <var class="var">delta</var></samp></dt>
  21566. <dd><p>Specify the accuracy time when selecting the start time for a
  21567. segment, expressed as a duration specification. Default value is &quot;0&quot;.
  21568. </p>
  21569. <p>When delta is specified a key-frame will start a new segment if its
  21570. PTS satisfies the relation:
  21571. </p><div class="example">
  21572. <pre class="example-preformatted">PTS &gt;= start_time - time_delta
  21573. </pre></div>
  21574. <p>This option is useful when splitting video content, which is always
  21575. split at GOP boundaries, in case a key frame is found just before the
  21576. specified split time.
  21577. </p>
  21578. <p>In particular may be used in combination with the <samp class="file">ffmpeg</samp> option
  21579. <var class="var">force_key_frames</var>. The key frame times specified by
  21580. <var class="var">force_key_frames</var> may not be set accurately because of rounding
  21581. issues, with the consequence that a key frame time may result set just
  21582. before the specified time. For constant frame rate videos a value of
  21583. 1/(2*<var class="var">frame_rate</var>) should address the worst case mismatch between
  21584. the specified time and the time set by <var class="var">force_key_frames</var>.
  21585. </p>
  21586. </dd>
  21587. <dt><samp class="option">segment_times <var class="var">times</var></samp></dt>
  21588. <dd><p>Specify a list of split points. <var class="var">times</var> contains a list of comma
  21589. separated duration specifications, in increasing order. See also
  21590. the <samp class="option">segment_time</samp> option.
  21591. </p>
  21592. </dd>
  21593. <dt><samp class="option">segment_frames <var class="var">frames</var></samp></dt>
  21594. <dd><p>Specify a list of split video frame numbers. <var class="var">frames</var> contains a
  21595. list of comma separated integer numbers, in increasing order.
  21596. </p>
  21597. <p>This option specifies to start a new segment whenever a reference
  21598. stream key frame is found and the sequential number (starting from 0)
  21599. of the frame is greater or equal to the next value in the list.
  21600. </p>
  21601. </dd>
  21602. <dt><samp class="option">segment_wrap <var class="var">limit</var></samp></dt>
  21603. <dd><p>Wrap around segment index once it reaches <var class="var">limit</var>.
  21604. </p>
  21605. </dd>
  21606. <dt><samp class="option">segment_start_number <var class="var">number</var></samp></dt>
  21607. <dd><p>Set the sequence number of the first segment. Defaults to <code class="code">0</code>.
  21608. </p>
  21609. </dd>
  21610. <dt><samp class="option">strftime <var class="var">1|0</var></samp></dt>
  21611. <dd><p>Use the <code class="code">strftime</code> function to define the name of the new
  21612. segments to write. If this is selected, the output segment name must
  21613. contain a <code class="code">strftime</code> function template. Default value is
  21614. <code class="code">0</code>.
  21615. </p>
  21616. </dd>
  21617. <dt><samp class="option">break_non_keyframes <var class="var">1|0</var></samp></dt>
  21618. <dd><p>If enabled, allow segments to start on frames other than keyframes. This
  21619. improves behavior on some players when the time between keyframes is
  21620. inconsistent, but may make things worse on others, and can cause some oddities
  21621. during seeking. Defaults to <code class="code">0</code>.
  21622. </p>
  21623. </dd>
  21624. <dt><samp class="option">reset_timestamps <var class="var">1|0</var></samp></dt>
  21625. <dd><p>Reset timestamps at the beginning of each segment, so that each segment
  21626. will start with near-zero timestamps. It is meant to ease the playback
  21627. of the generated segments. May not work with some combinations of
  21628. muxers/codecs. It is set to <code class="code">0</code> by default.
  21629. </p>
  21630. </dd>
  21631. <dt><samp class="option">initial_offset <var class="var">offset</var></samp></dt>
  21632. <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
  21633. argument must be a time duration specification, and defaults to 0.
  21634. </p>
  21635. </dd>
  21636. <dt><samp class="option">write_empty_segments <var class="var">1|0</var></samp></dt>
  21637. <dd><p>If enabled, write an empty segment if there are no packets during the period a
  21638. segment would usually span. Otherwise, the segment will be filled with the next
  21639. packet written. Defaults to <code class="code">0</code>.
  21640. </p></dd>
  21641. </dl>
  21642. <p>Make sure to require a closed GOP when encoding and to set the GOP
  21643. size to fit your segment time constraint.
  21644. </p>
  21645. <a name="Examples-25"></a>
  21646. <h4 class="subsection">21.69.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-25" aria-hidden="true">TOC</a></span></h4>
  21647. <ul class="itemize mark-bullet">
  21648. <li>Remux the content of file <samp class="file">in.mkv</samp> to a list of segments
  21649. <samp class="file">out-000.nut</samp>, <samp class="file">out-001.nut</samp>, etc., and write the list of
  21650. generated segments to <samp class="file">out.list</samp>:
  21651. <div class="example">
  21652. <pre class="example-preformatted">ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
  21653. </pre></div>
  21654. </li><li>Segment input and set output format options for the output segments:
  21655. <div class="example">
  21656. <pre class="example-preformatted">ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  21657. </pre></div>
  21658. </li><li>Segment the input file according to the split points specified by the
  21659. <var class="var">segment_times</var> option:
  21660. <div class="example">
  21661. <pre class="example-preformatted">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
  21662. </pre></div>
  21663. </li><li>Use the <code class="command">ffmpeg</code> <samp class="option">force_key_frames</samp>
  21664. option to force key frames in the input at the specified location, together
  21665. with the segment option <samp class="option">segment_time_delta</samp> to account for
  21666. possible roundings operated when setting key frame times.
  21667. <div class="example">
  21668. <pre class="example-preformatted">ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
  21669. -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  21670. </pre></div>
  21671. <p>In order to force key frames on the input file, transcoding is
  21672. required.
  21673. </p>
  21674. </li><li>Segment the input file by splitting the input file according to the
  21675. frame numbers sequence specified with the <samp class="option">segment_frames</samp> option:
  21676. <div class="example">
  21677. <pre class="example-preformatted">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
  21678. </pre></div>
  21679. </li><li>Convert the <samp class="file">in.mkv</samp> to TS segments using the <code class="code">libx264</code>
  21680. and <code class="code">aac</code> encoders:
  21681. <div class="example">
  21682. <pre class="example-preformatted">ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
  21683. </pre></div>
  21684. </li><li>Segment the input file, and create an M3U8 live playlist (can be used
  21685. as live HLS source):
  21686. <div class="example">
  21687. <pre class="example-preformatted">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  21688. -segment_list_flags +live -segment_time 10 out%03d.mkv
  21689. </pre></div>
  21690. </li></ul>
  21691. <a name="smoothstreaming"></a>
  21692. <h3 class="section">21.70 smoothstreaming<span class="pull-right"><a class="anchor hidden-xs" href="#smoothstreaming" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smoothstreaming" aria-hidden="true">TOC</a></span></h3>
  21693. <p>Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  21694. </p>
  21695. <dl class="table">
  21696. <dt><samp class="option">window_size</samp></dt>
  21697. <dd><p>Specify the number of fragments kept in the manifest. Default 0 (keep all).
  21698. </p>
  21699. </dd>
  21700. <dt><samp class="option">extra_window_size</samp></dt>
  21701. <dd><p>Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  21702. </p>
  21703. </dd>
  21704. <dt><samp class="option">lookahead_count</samp></dt>
  21705. <dd><p>Specify the number of lookahead fragments. Default 2.
  21706. </p>
  21707. </dd>
  21708. <dt><samp class="option">min_frag_duration</samp></dt>
  21709. <dd><p>Specify the minimum fragment duration (in microseconds). Default 5000000.
  21710. </p>
  21711. </dd>
  21712. <dt><samp class="option">remove_at_exit</samp></dt>
  21713. <dd><p>Specify whether to remove all fragments when finished. Default 0 (do not remove).
  21714. </p>
  21715. </dd>
  21716. </dl>
  21717. <a class="anchor" id="streamhash"></a><a name="streamhash-1"></a>
  21718. <h3 class="section">21.71 streamhash<span class="pull-right"><a class="anchor hidden-xs" href="#streamhash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-streamhash-1" aria-hidden="true">TOC</a></span></h3>
  21719. <p>Per stream hash testing format.
  21720. </p>
  21721. <p>This muxer computes and prints a cryptographic hash of all the input frames,
  21722. on a per-stream basis. This can be used for equality checks without having
  21723. to do a complete binary comparison.
  21724. </p>
  21725. <p>By default audio frames are converted to signed 16-bit raw audio and
  21726. video frames to raw video before computing the hash, but the output
  21727. of explicit conversions to other codecs can also be used. Timestamps
  21728. are ignored. It uses the SHA-256 cryptographic hash function by default,
  21729. but supports several other algorithms.
  21730. </p>
  21731. <p>The output of the muxer consists of one line per stream of the form:
  21732. <var class="var">streamindex</var>,<var class="var">streamtype</var>,<var class="var">algo</var>=<var class="var">hash</var>, where
  21733. <var class="var">streamindex</var> is the index of the mapped stream, <var class="var">streamtype</var> is a
  21734. single character indicating the type of stream, <var class="var">algo</var> is a short string
  21735. representing the hash function used, and <var class="var">hash</var> is a hexadecimal number
  21736. representing the computed hash.
  21737. </p>
  21738. <dl class="table">
  21739. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  21740. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  21741. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  21742. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  21743. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  21744. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  21745. </p>
  21746. </dd>
  21747. </dl>
  21748. <a name="Examples-26"></a>
  21749. <h4 class="subsection">21.71.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-26" aria-hidden="true">TOC</a></span></h4>
  21750. <p>To compute the SHA-256 hash of the input converted to raw audio and
  21751. video, and store it in the file <samp class="file">out.sha256</samp>:
  21752. </p><div class="example">
  21753. <pre class="example-preformatted">ffmpeg -i INPUT -f streamhash out.sha256
  21754. </pre></div>
  21755. <p>To print an MD5 hash to stdout use the command:
  21756. </p><div class="example">
  21757. <pre class="example-preformatted">ffmpeg -i INPUT -f streamhash -hash md5 -
  21758. </pre></div>
  21759. <p>See also the <a class="ref" href="#hash">hash</a> and <a class="ref" href="#framehash">framehash</a> muxers.
  21760. </p>
  21761. <a class="anchor" id="tee"></a><a name="tee-1"></a>
  21762. <h3 class="section">21.72 tee<span class="pull-right"><a class="anchor hidden-xs" href="#tee-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tee-1" aria-hidden="true">TOC</a></span></h3>
  21763. <p>The tee muxer can be used to write the same data to several outputs, such as files or streams.
  21764. It can be used, for example, to stream a video over a network and save it to disk at the same time.
  21765. </p>
  21766. <p>It is different from specifying several outputs to the <code class="command">ffmpeg</code>
  21767. command-line tool. With the tee muxer, the audio and video data will be encoded only once.
  21768. With conventional multiple outputs, multiple encoding operations in parallel are initiated,
  21769. which can be a very expensive process. The tee muxer is not useful when using the libavformat API
  21770. directly because it is then possible to feed the same packets to several muxers directly.
  21771. </p>
  21772. <p>Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select
  21773. output streams. So all streams intended for output must be specified using <code class="code">-map</code>. See
  21774. the examples below.
  21775. </p>
  21776. <p>Some encoders may need different options depending on the output format;
  21777. the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified.
  21778. The main example is the <samp class="option">global_header</samp> flag.
  21779. </p>
  21780. <p>The slave outputs are specified in the file name given to the muxer,
  21781. separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
  21782. leading or trailing spaces or any special character, those must be
  21783. escaped (see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  21784. section in the ffmpeg-utils(1) manual</a>).
  21785. </p>
  21786. <a name="Options-90"></a>
  21787. <h4 class="subsection">21.72.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-90" aria-hidden="true">TOC</a></span></h4>
  21788. <dl class="table">
  21789. <dt><samp class="option">use_fifo <var class="var">bool</var></samp></dt>
  21790. <dd><p>If set to 1, slave outputs will be processed in separate threads using the <a class="ref" href="#fifo">fifo</a>
  21791. muxer. This allows to compensate for different speed/latency/reliability of
  21792. outputs and setup transparent recovery. By default this feature is turned off.
  21793. </p>
  21794. </dd>
  21795. <dt><samp class="option">fifo_options</samp></dt>
  21796. <dd><p>Options to pass to fifo pseudo-muxer instances. See <a class="ref" href="#fifo">fifo</a>.
  21797. </p>
  21798. </dd>
  21799. </dl>
  21800. <p>Muxer options can be specified for each slave by prepending them as a list of
  21801. <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
  21802. the options values contain a special character or the &rsquo;:&rsquo; separator, they
  21803. must be escaped; note that this is a second level escaping.
  21804. </p>
  21805. <p>The following special options are also recognized:
  21806. </p><dl class="table">
  21807. <dt><samp class="option">f</samp></dt>
  21808. <dd><p>Specify the format name. Required if it cannot be guessed from the
  21809. output URL.
  21810. </p>
  21811. </dd>
  21812. <dt><samp class="option">bsfs[/<var class="var">spec</var>]</samp></dt>
  21813. <dd><p>Specify a list of bitstream filters to apply to the specified
  21814. output.
  21815. </p>
  21816. <p>It is possible to specify to which streams a given bitstream filter
  21817. applies, by appending a stream specifier to the option separated by
  21818. <code class="code">/</code>. <var class="var">spec</var> must be a stream specifier (see <a class="ref" href="#Format-stream-specifiers">Format stream specifiers</a>).
  21819. </p>
  21820. <p>If the stream specifier is not specified, the bitstream filters will be
  21821. applied to all streams in the output. This will cause that output operation
  21822. to fail if the output contains streams to which the bitstream filter cannot
  21823. be applied e.g. <code class="code">h264_mp4toannexb</code> being applied to an output containing an audio stream.
  21824. </p>
  21825. <p>Options for a bitstream filter must be specified in the form of <code class="code">opt=value</code>.
  21826. </p>
  21827. <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
  21828. </p>
  21829. </dd>
  21830. <dt><samp class="option">use_fifo <var class="var">bool</var></samp></dt>
  21831. <dd><p>This allows to override tee muxer use_fifo option for individual slave muxer.
  21832. </p>
  21833. </dd>
  21834. <dt><samp class="option">fifo_options</samp></dt>
  21835. <dd><p>This allows to override tee muxer fifo_options for individual slave muxer.
  21836. See <a class="ref" href="#fifo">fifo</a>.
  21837. </p>
  21838. </dd>
  21839. <dt><samp class="option">select</samp></dt>
  21840. <dd><p>Select the streams that should be mapped to the slave output,
  21841. specified by a stream specifier. If not specified, this defaults to
  21842. all the mapped streams. This will cause that output operation to fail
  21843. if the output format does not accept all mapped streams.
  21844. </p>
  21845. <p>You may use multiple stream specifiers separated by commas (<code class="code">,</code>) e.g.: <code class="code">a:0,v</code>
  21846. </p>
  21847. </dd>
  21848. <dt><samp class="option">onfail</samp></dt>
  21849. <dd><p>Specify behaviour on output failure. This can be set to either <code class="code">abort</code> (which is
  21850. default) or <code class="code">ignore</code>. <code class="code">abort</code> will cause whole process to fail in case of failure
  21851. on this slave output. <code class="code">ignore</code> will ignore failure on this output, so other outputs
  21852. will continue without being affected.
  21853. </p></dd>
  21854. </dl>
  21855. <a name="Examples-27"></a>
  21856. <h4 class="subsection">21.72.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-27" aria-hidden="true">TOC</a></span></h4>
  21857. <ul class="itemize mark-bullet">
  21858. <li>Encode something and both archive it in a WebM file and stream it
  21859. as MPEG-TS over UDP:
  21860. <div class="example">
  21861. <pre class="example-preformatted">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  21862. &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  21863. </pre></div>
  21864. </li><li>As above, but continue streaming even if output to local file fails
  21865. (for example local drive fills up):
  21866. <div class="example">
  21867. <pre class="example-preformatted">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  21868. &quot;[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  21869. </pre></div>
  21870. </li><li>Use <code class="command">ffmpeg</code> to encode the input, and send the output
  21871. to three different destinations. The <code class="code">dump_extra</code> bitstream
  21872. filter is used to add extradata information to all the output video
  21873. keyframes packets, as requested by the MPEG-TS format. The select
  21874. option is applied to <samp class="file">out.aac</samp> in order to make it contain only
  21875. audio packets.
  21876. <div class="example">
  21877. <pre class="example-preformatted">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  21878. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
  21879. </pre></div>
  21880. </li><li>As above, but select only stream <code class="code">a:1</code> for the audio output. Note
  21881. that a second level escaping must be performed, as &quot;:&quot; is a special
  21882. character used to separate options.
  21883. <div class="example">
  21884. <pre class="example-preformatted">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  21885. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac&quot;
  21886. </pre></div>
  21887. </li></ul>
  21888. <a name="webm_005fchunk"></a>
  21889. <h3 class="section">21.73 webm_chunk<span class="pull-right"><a class="anchor hidden-xs" href="#webm_005fchunk" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-webm_005fchunk" aria-hidden="true">TOC</a></span></h3>
  21890. <p>WebM Live Chunk Muxer.
  21891. </p>
  21892. <p>This muxer writes out WebM headers and chunks as separate files which can be
  21893. consumed by clients that support WebM Live streams via DASH.
  21894. </p>
  21895. <a name="Options-91"></a>
  21896. <h4 class="subsection">21.73.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-91" aria-hidden="true">TOC</a></span></h4>
  21897. <p>This muxer supports the following options:
  21898. </p>
  21899. <dl class="table">
  21900. <dt><samp class="option">chunk_start_index</samp></dt>
  21901. <dd><p>Index of the first chunk (defaults to 0).
  21902. </p>
  21903. </dd>
  21904. <dt><samp class="option">header</samp></dt>
  21905. <dd><p>Filename of the header where the initialization data will be written.
  21906. </p>
  21907. </dd>
  21908. <dt><samp class="option">audio_chunk_duration</samp></dt>
  21909. <dd><p>Duration of each audio chunk in milliseconds (defaults to 5000).
  21910. </p></dd>
  21911. </dl>
  21912. <a name="Example-9"></a>
  21913. <h4 class="subsection">21.73.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-9" aria-hidden="true">TOC</a></span></h4>
  21914. <div class="example">
  21915. <pre class="example-preformatted">ffmpeg -f v4l2 -i /dev/video0 \
  21916. -f alsa -i hw:0 \
  21917. -map 0:0 \
  21918. -c:v libvpx-vp9 \
  21919. -s 640x360 -keyint_min 30 -g 30 \
  21920. -f webm_chunk \
  21921. -header webm_live_video_360.hdr \
  21922. -chunk_start_index 1 \
  21923. webm_live_video_360_%d.chk \
  21924. -map 1:0 \
  21925. -c:a libvorbis \
  21926. -b:a 128k \
  21927. -f webm_chunk \
  21928. -header webm_live_audio_128.hdr \
  21929. -chunk_start_index 1 \
  21930. -audio_chunk_duration 1000 \
  21931. webm_live_audio_128_%d.chk
  21932. </pre></div>
  21933. <a name="webm_005fdash_005fmanifest"></a>
  21934. <h3 class="section">21.74 webm_dash_manifest<span class="pull-right"><a class="anchor hidden-xs" href="#webm_005fdash_005fmanifest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-webm_005fdash_005fmanifest" aria-hidden="true">TOC</a></span></h3>
  21935. <p>WebM DASH Manifest muxer.
  21936. </p>
  21937. <p>This muxer implements the WebM DASH Manifest specification to generate the DASH
  21938. manifest XML. It also supports manifest generation for DASH live streams.
  21939. </p>
  21940. <p>For more information see:
  21941. </p>
  21942. <ul class="itemize mark-bullet">
  21943. <li>WebM DASH Specification: <a class="url" href="https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification">https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification</a>
  21944. </li><li>ISO DASH Specification: <a class="url" href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip</a>
  21945. </li></ul>
  21946. <a name="Options-92"></a>
  21947. <h4 class="subsection">21.74.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-92" aria-hidden="true">TOC</a></span></h4>
  21948. <p>This muxer supports the following options:
  21949. </p>
  21950. <dl class="table">
  21951. <dt><samp class="option">adaptation_sets</samp></dt>
  21952. <dd><p>This option has the following syntax: &quot;id=x,streams=a,b,c id=y,streams=d,e&quot; where x and y are the
  21953. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  21954. audio and video streams. Any number of adaptation sets can be added using this option.
  21955. </p>
  21956. </dd>
  21957. <dt><samp class="option">live</samp></dt>
  21958. <dd><p>Set this to 1 to create a live stream DASH Manifest. Default: 0.
  21959. </p>
  21960. </dd>
  21961. <dt><samp class="option">chunk_start_index</samp></dt>
  21962. <dd><p>Start index of the first chunk. This will go in the &lsquo;<samp class="samp">startNumber</samp>&rsquo; attribute
  21963. of the &lsquo;<samp class="samp">SegmentTemplate</samp>&rsquo; element in the manifest. Default: 0.
  21964. </p>
  21965. </dd>
  21966. <dt><samp class="option">chunk_duration_ms</samp></dt>
  21967. <dd><p>Duration of each chunk in milliseconds. This will go in the &lsquo;<samp class="samp">duration</samp>&rsquo;
  21968. attribute of the &lsquo;<samp class="samp">SegmentTemplate</samp>&rsquo; element in the manifest. Default: 1000.
  21969. </p>
  21970. </dd>
  21971. <dt><samp class="option">utc_timing_url</samp></dt>
  21972. <dd><p>URL of the page that will return the UTC timestamp in ISO format. This will go
  21973. in the &lsquo;<samp class="samp">value</samp>&rsquo; attribute of the &lsquo;<samp class="samp">UTCTiming</samp>&rsquo; element in the manifest.
  21974. Default: None.
  21975. </p>
  21976. </dd>
  21977. <dt><samp class="option">time_shift_buffer_depth</samp></dt>
  21978. <dd><p>Smallest time (in seconds) shifting buffer for which any Representation is
  21979. guaranteed to be available. This will go in the &lsquo;<samp class="samp">timeShiftBufferDepth</samp>&rsquo;
  21980. attribute of the &lsquo;<samp class="samp">MPD</samp>&rsquo; element. Default: 60.
  21981. </p>
  21982. </dd>
  21983. <dt><samp class="option">minimum_update_period</samp></dt>
  21984. <dd><p>Minimum update period (in seconds) of the manifest. This will go in the
  21985. &lsquo;<samp class="samp">minimumUpdatePeriod</samp>&rsquo; attribute of the &lsquo;<samp class="samp">MPD</samp>&rsquo; element. Default: 0.
  21986. </p>
  21987. </dd>
  21988. </dl>
  21989. <a name="Example-10"></a>
  21990. <h4 class="subsection">21.74.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-10" aria-hidden="true">TOC</a></span></h4>
  21991. <div class="example">
  21992. <pre class="example-preformatted">ffmpeg -f webm_dash_manifest -i video1.webm \
  21993. -f webm_dash_manifest -i video2.webm \
  21994. -f webm_dash_manifest -i audio1.webm \
  21995. -f webm_dash_manifest -i audio2.webm \
  21996. -map 0 -map 1 -map 2 -map 3 \
  21997. -c copy \
  21998. -f webm_dash_manifest \
  21999. -adaptation_sets &quot;id=0,streams=0,1 id=1,streams=2,3&quot; \
  22000. manifest.xml
  22001. </pre></div>
  22002. <a class="anchor" id="whip"></a><a name="whip-1"></a>
  22003. <h3 class="section">21.75 whip<span class="pull-right"><a class="anchor hidden-xs" href="#whip-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-whip-1" aria-hidden="true">TOC</a></span></h3>
  22004. <p>WebRTC (Real-Time Communication) muxer that supports sub-second latency streaming according to
  22005. the WHIP (WebRTC-HTTP ingestion protocol) specification.
  22006. </p>
  22007. <p>This is an experimental feature.
  22008. </p>
  22009. <p>It uses HTTP as a signaling protocol to exchange SDP capabilities and ICE lite candidates. Then,
  22010. it uses STUN binding requests and responses to establish a session over UDP. Subsequently, it
  22011. initiates a DTLS handshake to exchange the SRTP encryption keys. Lastly, it splits video and
  22012. audio frames into RTP packets and encrypts them using SRTP.
  22013. </p>
  22014. <p>Ensure that you use H.264 without B frames and Opus for the audio codec. For example, to convert
  22015. an input file with <code class="command">ffmpeg</code> to WebRTC:
  22016. </p><div class="example">
  22017. <pre class="example-preformatted">ffmpeg -re -i input.mp4 -acodec libopus -ar 48000 -ac 2 \
  22018. -vcodec libx264 -profile:v baseline -tune zerolatency -threads 1 -bf 0 \
  22019. -f whip &quot;http://localhost:1985/rtc/v1/whip/?app=live&amp;stream=livestream&quot;
  22020. </pre></div>
  22021. <p>For this example, we have employed low latency options, resulting in an end-to-end latency of
  22022. approximately 150ms.
  22023. </p>
  22024. <a name="Options-93"></a>
  22025. <h4 class="subsection">21.75.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-93" aria-hidden="true">TOC</a></span></h4>
  22026. <p>This muxer supports the following options:
  22027. </p>
  22028. <dl class="table">
  22029. <dt><samp class="option">handshake_timeout <var class="var">integer</var></samp></dt>
  22030. <dd><p>Set the timeout in milliseconds for ICE and DTLS handshake.
  22031. Default value is 5000.
  22032. </p>
  22033. </dd>
  22034. <dt><samp class="option">pkt_size <var class="var">integer</var></samp></dt>
  22035. <dd><p>Set the maximum size, in bytes, of RTP packets that send out.
  22036. Default value is 1200.
  22037. </p>
  22038. </dd>
  22039. <dt><samp class="option">ts_buffer_size <var class="var">integer</var></samp></dt>
  22040. <dd><p>Set the buffer size, in bytes, of underlying protocol.
  22041. Default value is -1(auto). The UDP auto selects a reasonable value.
  22042. </p>
  22043. </dd>
  22044. <dt><samp class="option">whip_flags <var class="var">flags</var></samp></dt>
  22045. <dd><p>Possible values:
  22046. </p>
  22047. <dl class="table">
  22048. <dt>&lsquo;<samp class="samp">dtls_active</samp>&rsquo;</dt>
  22049. <dd><p>The muxer will try to set dtls active role and send the first client hello.
  22050. </p></dd>
  22051. </dl>
  22052. </dd>
  22053. <dt><samp class="option">authorization <var class="var">string</var></samp></dt>
  22054. <dd><p>The optional Bearer token for WHIP Authorization.
  22055. </p>
  22056. </dd>
  22057. <dt><samp class="option">cert_file <var class="var">string</var></samp></dt>
  22058. <dd><p>The optional certificate file path for DTLS.
  22059. </p>
  22060. </dd>
  22061. <dt><samp class="option">key_file <var class="var">string</var></samp></dt>
  22062. <dd><p>The optional private key file path for DTLS.
  22063. </p>
  22064. </dd>
  22065. </dl>
  22066. <a class="anchor" id="metadata"></a><a name="Metadata-2"></a>
  22067. <h2 class="chapter">22 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata-2" aria-hidden="true">TOC</a></span></h2>
  22068. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  22069. INI-like text file and then load it back using the metadata muxer/demuxer.
  22070. </p>
  22071. <p>The file format is as follows:
  22072. </p><ol class="enumerate">
  22073. <li> A file consists of a header and a number of metadata tags divided into sections,
  22074. each on its own line.
  22075. </li><li> The header is a &lsquo;<samp class="samp">;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  22076. </li><li> Metadata tags are of the form &lsquo;<samp class="samp">key=value</samp>&rsquo;
  22077. </li><li> Immediately after header follows global metadata
  22078. </li><li> After global metadata there may be sections with per-stream/per-chapter
  22079. metadata.
  22080. </li><li> A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  22081. brackets (&lsquo;<samp class="samp">[</samp>&rsquo;, &lsquo;<samp class="samp">]</samp>&rsquo;) and ends with next section or end of file.
  22082. </li><li> At the beginning of a chapter section there may be an optional timebase to be
  22083. used for start/end values. It must be in form
  22084. &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
  22085. integers. If the timebase is missing then start/end times are assumed to
  22086. be in nanoseconds.
  22087. <p>Next a chapter section must contain chapter start and end times in form
  22088. &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
  22089. integer.
  22090. </p>
  22091. </li><li> Empty lines and lines starting with &lsquo;<samp class="samp">;</samp>&rsquo; or &lsquo;<samp class="samp">#</samp>&rsquo; are ignored.
  22092. </li><li> Metadata keys or values containing special characters (&lsquo;<samp class="samp">=</samp>&rsquo;, &lsquo;<samp class="samp">;</samp>&rsquo;,
  22093. &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;.
  22094. </li><li> Note that whitespace in metadata (e.g. &lsquo;<samp class="samp">foo = bar</samp>&rsquo;) is considered to be
  22095. a part of the tag (in the example above key is &lsquo;<samp class="samp">foo </samp>&rsquo;, value is
  22096. &lsquo;<samp class="samp"> bar</samp>&rsquo;).
  22097. </li></ol>
  22098. <p>A ffmetadata file might look like this:
  22099. </p><div class="example">
  22100. <pre class="example-preformatted">;FFMETADATA1
  22101. title=bike\\shed
  22102. ;this is a comment
  22103. artist=FFmpeg troll team
  22104. [CHAPTER]
  22105. TIMEBASE=1/1000
  22106. START=0
  22107. #chapter ends at 0:01:00
  22108. END=60000
  22109. title=chapter \#1
  22110. [STREAM]
  22111. title=multi\
  22112. line
  22113. </pre></div>
  22114. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  22115. metadata from an input file to an ffmetadata file, and then transcode
  22116. the file into an output file with the edited ffmetadata file.
  22117. </p>
  22118. <p>Extracting an ffmetadata file with <samp class="file">ffmpeg</samp> goes as follows:
  22119. </p><div class="example">
  22120. <pre class="example-preformatted">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  22121. </pre></div>
  22122. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  22123. be done as:
  22124. </p><div class="example">
  22125. <pre class="example-preformatted">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  22126. </pre></div>
  22127. <a name="Protocol-Options"></a>
  22128. <h2 class="chapter">23 Protocol Options<span class="pull-right"><a class="anchor hidden-xs" href="#Protocol-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocol-Options" aria-hidden="true">TOC</a></span></h2>
  22129. <p>The libavformat library provides some generic global options, which
  22130. can be set on all the protocols. In addition each protocol may support
  22131. so-called private options, which are specific for that component.
  22132. </p>
  22133. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  22134. FFmpeg tools, or by setting the value explicitly in the
  22135. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  22136. for programmatic use.
  22137. </p>
  22138. <p>The list of supported options follows:
  22139. </p>
  22140. <dl class="table">
  22141. <dt><samp class="option">protocol_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  22142. <dd><p>Set a &quot;,&quot;-separated list of allowed protocols. &quot;ALL&quot; matches all protocols. Protocols
  22143. prefixed by &quot;-&quot; are disabled.
  22144. All protocols are allowed by default but protocols used by an another
  22145. protocol (nested protocols) are restricted to a per protocol subset.
  22146. </p></dd>
  22147. </dl>
  22148. <a name="Protocols"></a>
  22149. <h2 class="chapter">24 Protocols<span class="pull-right"><a class="anchor hidden-xs" href="#Protocols" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocols" aria-hidden="true">TOC</a></span></h2>
  22150. <p>Protocols are configured elements in FFmpeg that enable access to
  22151. resources that require specific protocols.
  22152. </p>
  22153. <p>When you configure your FFmpeg build, all the supported protocols are
  22154. enabled by default. You can list all available ones using the
  22155. configure option &quot;&ndash;list-protocols&quot;.
  22156. </p>
  22157. <p>You can disable all the protocols using the configure option
  22158. &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
  22159. option &quot;&ndash;enable-protocol=<var class="var">PROTOCOL</var>&quot;, or you can disable a
  22160. particular protocol using the option
  22161. &quot;&ndash;disable-protocol=<var class="var">PROTOCOL</var>&quot;.
  22162. </p>
  22163. <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
  22164. supported protocols.
  22165. </p>
  22166. <p>All protocols accept the following options:
  22167. </p>
  22168. <dl class="table">
  22169. <dt><samp class="option">rw_timeout</samp></dt>
  22170. <dd><p>Maximum time to wait for (network) read/write operations to complete,
  22171. in microseconds.
  22172. </p></dd>
  22173. </dl>
  22174. <p>A description of the currently available protocols follows.
  22175. </p>
  22176. <a name="amqp"></a>
  22177. <h3 class="section">24.1 amqp<span class="pull-right"><a class="anchor hidden-xs" href="#amqp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amqp" aria-hidden="true">TOC</a></span></h3>
  22178. <p>Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based
  22179. publish-subscribe communication protocol.
  22180. </p>
  22181. <p>FFmpeg must be compiled with &ndash;enable-librabbitmq to support AMQP. A separate
  22182. AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ.
  22183. </p>
  22184. <p>After starting the broker, an FFmpeg client may stream data to the broker using
  22185. the command:
  22186. </p>
  22187. <div class="example">
  22188. <pre class="example-preformatted">ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
  22189. </pre></div>
  22190. <p>Where hostname and port (default is 5672) is the address of the broker. The
  22191. client may also set a user/password for authentication. The default for both
  22192. fields is &quot;guest&quot;. Name of virtual host on broker can be set with vhost. The
  22193. default value is &quot;/&quot;.
  22194. </p>
  22195. <p>Multiple subscribers may stream from the broker using the command:
  22196. </p><div class="example">
  22197. <pre class="example-preformatted">ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
  22198. </pre></div>
  22199. <p>In RabbitMQ all data published to the broker flows through a specific exchange,
  22200. and each subscribing client has an assigned queue/buffer. When a packet arrives
  22201. at an exchange, it may be copied to a client&rsquo;s queue depending on the exchange
  22202. and routing_key fields.
  22203. </p>
  22204. <p>The following options are supported:
  22205. </p>
  22206. <dl class="table">
  22207. <dt><samp class="option">exchange</samp></dt>
  22208. <dd><p>Sets the exchange to use on the broker. RabbitMQ has several predefined
  22209. exchanges: &quot;amq.direct&quot; is the default exchange, where the publisher and
  22210. subscriber must have a matching routing_key; &quot;amq.fanout&quot; is the same as a
  22211. broadcast operation (i.e. the data is forwarded to all queues on the fanout
  22212. exchange independent of the routing_key); and &quot;amq.topic&quot; is similar to
  22213. &quot;amq.direct&quot;, but allows for more complex pattern matching (refer to the RabbitMQ
  22214. documentation).
  22215. </p>
  22216. </dd>
  22217. <dt><samp class="option">routing_key</samp></dt>
  22218. <dd><p>Sets the routing key. The default value is &quot;amqp&quot;. The routing key is used on
  22219. the &quot;amq.direct&quot; and &quot;amq.topic&quot; exchanges to decide whether packets are written
  22220. to the queue of a subscriber.
  22221. </p>
  22222. </dd>
  22223. <dt><samp class="option">pkt_size</samp></dt>
  22224. <dd><p>Maximum size of each packet sent/received to the broker. Default is 131072.
  22225. Minimum is 4096 and max is any large value (representable by an int). When
  22226. receiving packets, this sets an internal buffer size in FFmpeg. It should be
  22227. equal to or greater than the size of the published packets to the broker. Otherwise
  22228. the received message may be truncated causing decoding errors.
  22229. </p>
  22230. </dd>
  22231. <dt><samp class="option">connection_timeout</samp></dt>
  22232. <dd><p>The timeout in seconds during the initial connection to the broker. The
  22233. default value is rw_timeout, or 5 seconds if rw_timeout is not set.
  22234. </p>
  22235. </dd>
  22236. <dt><samp class="option">delivery_mode <var class="var">mode</var></samp></dt>
  22237. <dd><p>Sets the delivery mode of each message sent to broker.
  22238. The following values are accepted:
  22239. </p><dl class="table">
  22240. <dt>&lsquo;<samp class="samp">persistent</samp>&rsquo;</dt>
  22241. <dd><p>Delivery mode set to &quot;persistent&quot; (2). This is the default value.
  22242. Messages may be written to the broker&rsquo;s disk depending on its setup.
  22243. </p>
  22244. </dd>
  22245. <dt>&lsquo;<samp class="samp">non-persistent</samp>&rsquo;</dt>
  22246. <dd><p>Delivery mode set to &quot;non-persistent&quot; (1).
  22247. Messages will stay in broker&rsquo;s memory unless the broker is under memory
  22248. pressure.
  22249. </p>
  22250. </dd>
  22251. </dl>
  22252. </dd>
  22253. </dl>
  22254. <a name="async"></a>
  22255. <h3 class="section">24.2 async<span class="pull-right"><a class="anchor hidden-xs" href="#async" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-async" aria-hidden="true">TOC</a></span></h3>
  22256. <p>Asynchronous data filling wrapper for input stream.
  22257. </p>
  22258. <p>Fill data in a background thread, to decouple I/O operation from demux thread.
  22259. </p>
  22260. <div class="example">
  22261. <pre class="example-preformatted">async:<var class="var">URL</var>
  22262. async:http://host/resource
  22263. async:cache:http://host/resource
  22264. </pre></div>
  22265. <a name="bluray"></a>
  22266. <h3 class="section">24.3 bluray<span class="pull-right"><a class="anchor hidden-xs" href="#bluray" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bluray" aria-hidden="true">TOC</a></span></h3>
  22267. <p>Read BluRay playlist.
  22268. </p>
  22269. <p>The accepted options are:
  22270. </p><dl class="table">
  22271. <dt><samp class="option">angle</samp></dt>
  22272. <dd><p>BluRay angle
  22273. </p>
  22274. </dd>
  22275. <dt><samp class="option">chapter</samp></dt>
  22276. <dd><p>Start chapter (1...N)
  22277. </p>
  22278. </dd>
  22279. <dt><samp class="option">playlist</samp></dt>
  22280. <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
  22281. </p>
  22282. </dd>
  22283. </dl>
  22284. <p>Examples:
  22285. </p>
  22286. <p>Read longest playlist from BluRay mounted to /mnt/bluray:
  22287. </p><div class="example">
  22288. <pre class="example-preformatted">bluray:/mnt/bluray
  22289. </pre></div>
  22290. <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  22291. </p><div class="example">
  22292. <pre class="example-preformatted">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  22293. </pre></div>
  22294. <a name="cache"></a>
  22295. <h3 class="section">24.4 cache<span class="pull-right"><a class="anchor hidden-xs" href="#cache" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cache" aria-hidden="true">TOC</a></span></h3>
  22296. <p>Caching wrapper for input stream.
  22297. </p>
  22298. <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
  22299. </p>
  22300. <p>The accepted options are:
  22301. </p><dl class="table">
  22302. <dt><samp class="option">read_ahead_limit</samp></dt>
  22303. <dd><p>Amount in bytes that may be read ahead when seeking isn&rsquo;t supported. Range is -1 to INT_MAX.
  22304. -1 for unlimited. Default is 65536.
  22305. </p>
  22306. </dd>
  22307. </dl>
  22308. <p>URL Syntax is
  22309. </p><div class="example">
  22310. <pre class="example-preformatted">cache:<var class="var">URL</var>
  22311. </pre></div>
  22312. <a name="concat-2"></a>
  22313. <h3 class="section">24.5 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-2" aria-hidden="true">TOC</a></span></h3>
  22314. <p>Physical concatenation protocol.
  22315. </p>
  22316. <p>Read and seek from many resources in sequence as if they were
  22317. a unique resource.
  22318. </p>
  22319. <p>A URL accepted by this protocol has the syntax:
  22320. </p><div class="example">
  22321. <pre class="example-preformatted">concat:<var class="var">URL1</var>|<var class="var">URL2</var>|...|<var class="var">URLN</var>
  22322. </pre></div>
  22323. <p>where <var class="var">URL1</var>, <var class="var">URL2</var>, ..., <var class="var">URLN</var> are the urls of the
  22324. resource to be concatenated, each one possibly specifying a distinct
  22325. protocol.
  22326. </p>
  22327. <p>For example to read a sequence of files <samp class="file">split1.mpeg</samp>,
  22328. <samp class="file">split2.mpeg</samp>, <samp class="file">split3.mpeg</samp> with <code class="command">ffplay</code> use the
  22329. command:
  22330. </p><div class="example">
  22331. <pre class="example-preformatted">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  22332. </pre></div>
  22333. <p>Note that you may need to escape the character &quot;|&quot; which is special for
  22334. many shells.
  22335. </p>
  22336. <a name="concatf"></a>
  22337. <h3 class="section">24.6 concatf<span class="pull-right"><a class="anchor hidden-xs" href="#concatf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concatf" aria-hidden="true">TOC</a></span></h3>
  22338. <p>Physical concatenation protocol using a line break delimited list of
  22339. resources.
  22340. </p>
  22341. <p>Read and seek from many resources in sequence as if they were
  22342. a unique resource.
  22343. </p>
  22344. <p>A URL accepted by this protocol has the syntax:
  22345. </p><div class="example">
  22346. <pre class="example-preformatted">concatf:<var class="var">URL</var>
  22347. </pre></div>
  22348. <p>where <var class="var">URL</var> is the url containing a line break delimited list of
  22349. resources to be concatenated, each one possibly specifying a distinct
  22350. protocol. Special characters must be escaped with backslash or single
  22351. quotes. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  22352. section in the ffmpeg-utils(1) manual</a>.
  22353. </p>
  22354. <p>For example to read a sequence of files <samp class="file">split1.mpeg</samp>,
  22355. <samp class="file">split2.mpeg</samp>, <samp class="file">split3.mpeg</samp> listed in separate lines within
  22356. a file <samp class="file">split.txt</samp> with <code class="command">ffplay</code> use the command:
  22357. </p><div class="example">
  22358. <pre class="example-preformatted">ffplay concatf:split.txt
  22359. </pre></div>
  22360. <p>Where <samp class="file">split.txt</samp> contains the lines:
  22361. </p><div class="example">
  22362. <pre class="example-preformatted">split1.mpeg
  22363. split2.mpeg
  22364. split3.mpeg
  22365. </pre></div>
  22366. <a name="crypto"></a>
  22367. <h3 class="section">24.7 crypto<span class="pull-right"><a class="anchor hidden-xs" href="#crypto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crypto" aria-hidden="true">TOC</a></span></h3>
  22368. <p>AES-encrypted stream reading protocol.
  22369. </p>
  22370. <p>The accepted options are:
  22371. </p><dl class="table">
  22372. <dt><samp class="option">key</samp></dt>
  22373. <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
  22374. </p>
  22375. </dd>
  22376. <dt><samp class="option">iv</samp></dt>
  22377. <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
  22378. </p></dd>
  22379. </dl>
  22380. <p>Accepted URL formats:
  22381. </p><div class="example">
  22382. <pre class="example-preformatted">crypto:<var class="var">URL</var>
  22383. crypto+<var class="var">URL</var>
  22384. </pre></div>
  22385. <a name="data"></a>
  22386. <h3 class="section">24.8 data<span class="pull-right"><a class="anchor hidden-xs" href="#data" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-data" aria-hidden="true">TOC</a></span></h3>
  22387. <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>.
  22388. </p>
  22389. <p>For example, to convert a GIF file given inline with <code class="command">ffmpeg</code>:
  22390. </p><div class="example">
  22391. <pre class="example-preformatted">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
  22392. </pre></div>
  22393. <a name="fd"></a>
  22394. <h3 class="section">24.9 fd<span class="pull-right"><a class="anchor hidden-xs" href="#fd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fd" aria-hidden="true">TOC</a></span></h3>
  22395. <p>File descriptor access protocol.
  22396. </p>
  22397. <p>The accepted syntax is:
  22398. </p><div class="example">
  22399. <pre class="example-preformatted">fd: -fd <var class="var">file_descriptor</var>
  22400. </pre></div>
  22401. <p>If <samp class="option">fd</samp> is not specified, by default the stdout file descriptor will be
  22402. used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has
  22403. seek support if it corresponding to a regular file. fd protocol doesn&rsquo;t support
  22404. pass file descriptor via URL for security.
  22405. </p>
  22406. <p>This protocol accepts the following options:
  22407. </p>
  22408. <dl class="table">
  22409. <dt><samp class="option">blocksize</samp></dt>
  22410. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  22411. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  22412. Setting this value reasonably low improves user termination request reaction
  22413. time, which is valuable if data transmission is slow.
  22414. </p>
  22415. </dd>
  22416. <dt><samp class="option">fd</samp></dt>
  22417. <dd><p>Set file descriptor.
  22418. </p></dd>
  22419. </dl>
  22420. <a name="file"></a>
  22421. <h3 class="section">24.10 file<span class="pull-right"><a class="anchor hidden-xs" href="#file" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-file" aria-hidden="true">TOC</a></span></h3>
  22422. <p>File access protocol.
  22423. </p>
  22424. <p>Read from or write to a file.
  22425. </p>
  22426. <p>A file URL can have the form:
  22427. </p><div class="example">
  22428. <pre class="example-preformatted">file:<var class="var">filename</var>
  22429. </pre></div>
  22430. <p>where <var class="var">filename</var> is the path of the file to read.
  22431. </p>
  22432. <p>An URL that does not have a protocol prefix will be assumed to be a
  22433. file URL. Depending on the build, an URL that looks like a Windows
  22434. path with the drive letter at the beginning will also be assumed to be
  22435. a file URL (usually not the case in builds for unix-like systems).
  22436. </p>
  22437. <p>For example to read from a file <samp class="file">input.mpeg</samp> with <code class="command">ffmpeg</code>
  22438. use the command:
  22439. </p><div class="example">
  22440. <pre class="example-preformatted">ffmpeg -i file:input.mpeg output.mpeg
  22441. </pre></div>
  22442. <p>This protocol accepts the following options:
  22443. </p>
  22444. <dl class="table">
  22445. <dt><samp class="option">truncate</samp></dt>
  22446. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  22447. truncating. Default value is 1.
  22448. </p>
  22449. </dd>
  22450. <dt><samp class="option">blocksize</samp></dt>
  22451. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  22452. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  22453. Setting this value reasonably low improves user termination request reaction
  22454. time, which is valuable for files on slow medium.
  22455. </p>
  22456. </dd>
  22457. <dt><samp class="option">follow</samp></dt>
  22458. <dd><p>If set to 1, the protocol will retry reading at the end of the file, allowing
  22459. reading files that still are being written. In order for this to terminate,
  22460. you either need to use the rw_timeout option, or use the interrupt callback
  22461. (for API users).
  22462. </p>
  22463. </dd>
  22464. <dt><samp class="option">seekable</samp></dt>
  22465. <dd><p>Controls if seekability is advertised on the file. 0 means non-seekable, -1
  22466. means auto (seekable for normal files, non-seekable for named pipes).
  22467. </p>
  22468. <p>Many demuxers handle seekable and non-seekable resources differently,
  22469. overriding this might speed up opening certain files at the cost of losing some
  22470. features (e.g. accurate seeking).
  22471. </p>
  22472. </dd>
  22473. <dt><samp class="option">pkt_size</samp></dt>
  22474. <dd><p>Set the maximum packet size used for file I/O. A smaller value may reduce
  22475. memory usage. A higher value may increase throughput especially with networked
  22476. filesystems.
  22477. </p>
  22478. <p>For reading, if explicitly set, it overrides the default internal buffer size
  22479. (32 KB) and limits the maximum amount of data read per operation.
  22480. </p>
  22481. <p>For writing, this sets the size of each write operation. The default is 256 KB
  22482. for regular files, 32 KB otherwise.
  22483. </p></dd>
  22484. </dl>
  22485. <a name="ftp"></a>
  22486. <h3 class="section">24.11 ftp<span class="pull-right"><a class="anchor hidden-xs" href="#ftp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ftp" aria-hidden="true">TOC</a></span></h3>
  22487. <p>FTP (File Transfer Protocol).
  22488. </p>
  22489. <p>Read from or write to remote resources using FTP protocol.
  22490. </p>
  22491. <p>Following syntax is required.
  22492. </p><div class="example">
  22493. <pre class="example-preformatted">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  22494. </pre></div>
  22495. <p>This protocol accepts the following options.
  22496. </p>
  22497. <dl class="table">
  22498. <dt><samp class="option">timeout</samp></dt>
  22499. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  22500. operation. By default it is set to -1, which means that the timeout is
  22501. not specified.
  22502. </p>
  22503. </dd>
  22504. <dt><samp class="option">ftp-user</samp></dt>
  22505. <dd><p>Set a user to be used for authenticating to the FTP server. This is overridden by the
  22506. user in the FTP URL.
  22507. </p>
  22508. </dd>
  22509. <dt><samp class="option">ftp-password</samp></dt>
  22510. <dd><p>Set a password to be used for authenticating to the FTP server. This is overridden by
  22511. the password in the FTP URL, or by <samp class="option">ftp-anonymous-password</samp> if no user is set.
  22512. </p>
  22513. </dd>
  22514. <dt><samp class="option">ftp-anonymous-password</samp></dt>
  22515. <dd><p>Password used when login as anonymous user. Typically an e-mail address
  22516. should be used.
  22517. </p>
  22518. </dd>
  22519. <dt><samp class="option">ftp-write-seekable</samp></dt>
  22520. <dd><p>Control seekability of connection during encoding. If set to 1 the
  22521. resource is supposed to be seekable, if set to 0 it is assumed not
  22522. to be seekable. Default value is 0.
  22523. </p></dd>
  22524. </dl>
  22525. <p>NOTE: Protocol can be used as output, but it is recommended to not do
  22526. it, unless special care is taken (tests, customized server configuration
  22527. etc.). Different FTP servers behave in different way during seek
  22528. operation. ff* tools may produce incomplete content due to server limitations.
  22529. </p>
  22530. <a name="gopher"></a>
  22531. <h3 class="section">24.12 gopher<span class="pull-right"><a class="anchor hidden-xs" href="#gopher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gopher" aria-hidden="true">TOC</a></span></h3>
  22532. <p>Gopher protocol.
  22533. </p>
  22534. <a name="gophers"></a>
  22535. <h3 class="section">24.13 gophers<span class="pull-right"><a class="anchor hidden-xs" href="#gophers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gophers" aria-hidden="true">TOC</a></span></h3>
  22536. <p>Gophers protocol.
  22537. </p>
  22538. <p>The Gopher protocol with TLS encapsulation.
  22539. </p>
  22540. <a name="hls-3"></a>
  22541. <h3 class="section">24.14 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-3" aria-hidden="true">TOC</a></span></h3>
  22542. <p>Read Apple HTTP Live Streaming compliant segmented stream as
  22543. a uniform one. The M3U8 playlists describing the segments can be
  22544. remote HTTP resources or local files, accessed using the standard
  22545. file protocol.
  22546. The nested protocol is declared by specifying
  22547. &quot;+<var class="var">proto</var>&quot; after the hls URI scheme name, where <var class="var">proto</var>
  22548. is either &quot;file&quot; or &quot;http&quot;.
  22549. </p>
  22550. <div class="example">
  22551. <pre class="example-preformatted">hls+http://host/path/to/remote/resource.m3u8
  22552. hls+file://path/to/local/resource.m3u8
  22553. </pre></div>
  22554. <p>Using this protocol is discouraged - the hls demuxer should work
  22555. just as well (if not, please report the issues) and is more complete.
  22556. To use the hls demuxer instead, simply use the direct URLs to the
  22557. m3u8 files.
  22558. </p>
  22559. <a name="http"></a>
  22560. <h3 class="section">24.15 http<span class="pull-right"><a class="anchor hidden-xs" href="#http" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-http" aria-hidden="true">TOC</a></span></h3>
  22561. <p>HTTP (Hyper Text Transfer Protocol).
  22562. </p>
  22563. <p>This protocol accepts the following options:
  22564. </p>
  22565. <dl class="table">
  22566. <dt><samp class="option">seekable</samp></dt>
  22567. <dd><p>Control seekability of connection. If set to 1 the resource is
  22568. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  22569. if set to -1 it will try to autodetect if it is seekable. Default
  22570. value is -1.
  22571. </p>
  22572. </dd>
  22573. <dt><samp class="option">chunked_post</samp></dt>
  22574. <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  22575. </p>
  22576. </dd>
  22577. <dt><samp class="option">http_proxy</samp></dt>
  22578. <dd><p>set HTTP proxy to tunnel through e.g. http://example.com:1234
  22579. </p>
  22580. </dd>
  22581. <dt><samp class="option">headers</samp></dt>
  22582. <dd><p>Set custom HTTP headers, can override built in default headers. The
  22583. value must be a string encoding the headers.
  22584. </p>
  22585. </dd>
  22586. <dt><samp class="option">content_type</samp></dt>
  22587. <dd><p>Set a specific content type for the POST messages or for listen mode.
  22588. </p>
  22589. </dd>
  22590. <dt><samp class="option">user_agent</samp></dt>
  22591. <dd><p>Override the User-Agent header. If not specified the protocol will use a
  22592. string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
  22593. </p>
  22594. </dd>
  22595. <dt><samp class="option">referer</samp></dt>
  22596. <dd><p>Set the Referer header. Include &rsquo;Referer: URL&rsquo; header in HTTP request.
  22597. </p>
  22598. </dd>
  22599. <dt><samp class="option">multiple_requests</samp></dt>
  22600. <dd><p>Use persistent connections if set to 1, default is 0.
  22601. </p>
  22602. </dd>
  22603. <dt><samp class="option">post_data</samp></dt>
  22604. <dd><p>Set custom HTTP post data.
  22605. </p>
  22606. </dd>
  22607. <dt><samp class="option">mime_type</samp></dt>
  22608. <dd><p>Export the MIME type.
  22609. </p>
  22610. </dd>
  22611. <dt><samp class="option">http_version</samp></dt>
  22612. <dd><p>Exports the HTTP response version number. Usually &quot;1.0&quot; or &quot;1.1&quot;.
  22613. </p>
  22614. </dd>
  22615. <dt><samp class="option">cookies</samp></dt>
  22616. <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
  22617. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  22618. delimited by a newline character.
  22619. </p>
  22620. </dd>
  22621. <dt><samp class="option">icy</samp></dt>
  22622. <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  22623. supports this, the metadata has to be retrieved by the application by reading
  22624. the <samp class="option">icy_metadata_headers</samp> and <samp class="option">icy_metadata_packet</samp> options.
  22625. The default is 1.
  22626. </p>
  22627. </dd>
  22628. <dt><samp class="option">icy_metadata_headers</samp></dt>
  22629. <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  22630. headers, separated by newline characters.
  22631. </p>
  22632. </dd>
  22633. <dt><samp class="option">icy_metadata_packet</samp></dt>
  22634. <dd><p>If the server supports ICY metadata, and <samp class="option">icy</samp> was set to 1, this
  22635. contains the last non-empty metadata packet sent by the server. It should be
  22636. polled in regular intervals by applications interested in mid-stream metadata
  22637. updates.
  22638. </p>
  22639. </dd>
  22640. <dt><samp class="option">metadata</samp></dt>
  22641. <dd><p>Set an exported dictionary containing Icecast metadata from the bitstream, if present.
  22642. Only useful with the C API.
  22643. </p>
  22644. </dd>
  22645. <dt><samp class="option">auth_type</samp></dt>
  22646. <dd>
  22647. <p>Set HTTP authentication type. No option for Digest, since this method requires
  22648. getting nonce parameters from the server first and can&rsquo;t be used straight away like
  22649. Basic.
  22650. </p>
  22651. <dl class="table">
  22652. <dt><samp class="option">none</samp></dt>
  22653. <dd><p>Choose the HTTP authentication type automatically. This is the default.
  22654. </p></dd>
  22655. <dt><samp class="option">basic</samp></dt>
  22656. <dd>
  22657. <p>Choose the HTTP basic authentication.
  22658. </p>
  22659. <p>Basic authentication sends a Base64-encoded string that contains a user name and password
  22660. for the client. Base64 is not a form of encryption and should be considered the same as
  22661. sending the user name and password in clear text (Base64 is a reversible encoding).
  22662. If a resource needs to be protected, strongly consider using an authentication scheme
  22663. other than basic authentication. HTTPS/TLS should be used with basic authentication.
  22664. Without these additional security enhancements, basic authentication should not be used
  22665. to protect sensitive or valuable information.
  22666. </p></dd>
  22667. </dl>
  22668. </dd>
  22669. <dt><samp class="option">send_expect_100</samp></dt>
  22670. <dd><p>Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
  22671. to 0 it won&rsquo;t, if set to -1 it will try to send if it is applicable. Default
  22672. value is -1.
  22673. </p>
  22674. </dd>
  22675. <dt><samp class="option">location</samp></dt>
  22676. <dd><p>An exported dictionary containing the content location. Only useful with the C
  22677. API.
  22678. </p>
  22679. </dd>
  22680. <dt><samp class="option">offset</samp></dt>
  22681. <dd><p>Set initial byte offset.
  22682. </p>
  22683. </dd>
  22684. <dt><samp class="option">end_offset</samp></dt>
  22685. <dd><p>Try to limit the request to bytes preceding this offset.
  22686. </p>
  22687. </dd>
  22688. <dt><samp class="option">method</samp></dt>
  22689. <dd><p>When used as a client option it sets the HTTP method for the request.
  22690. </p>
  22691. <p>When used as a server option it sets the HTTP method that is going to be
  22692. expected from the client(s).
  22693. If the expected and the received HTTP method do not match the client will
  22694. be given a Bad Request response.
  22695. When unset the HTTP method is not checked for now. This will be replaced by
  22696. autodetection in the future.
  22697. </p>
  22698. </dd>
  22699. <dt><samp class="option">reconnect</samp></dt>
  22700. <dd><p>Reconnect automatically when disconnected before EOF is hit.
  22701. </p>
  22702. </dd>
  22703. <dt><samp class="option">reconnect_at_eof</samp></dt>
  22704. <dd><p>If set then eof is treated like an error and causes reconnection, this is useful
  22705. for live / endless streams.
  22706. </p>
  22707. </dd>
  22708. <dt><samp class="option">reconnect_on_network_error</samp></dt>
  22709. <dd><p>Reconnect automatically in case of TCP/TLS errors during connect.
  22710. </p>
  22711. </dd>
  22712. <dt><samp class="option">reconnect_on_http_error</samp></dt>
  22713. <dd><p>A comma separated list of HTTP status codes to reconnect on. The list can
  22714. include specific status codes (e.g. &rsquo;503&rsquo;) or the strings &rsquo;4xx&rsquo; / &rsquo;5xx&rsquo;.
  22715. </p>
  22716. </dd>
  22717. <dt><samp class="option">reconnect_streamed</samp></dt>
  22718. <dd><p>If set then even streamed/non seekable streams will be reconnected on errors.
  22719. </p>
  22720. </dd>
  22721. <dt><samp class="option">reconnect_delay_max</samp></dt>
  22722. <dd><p>Set the maximum delay in seconds after which to give up reconnecting.
  22723. </p>
  22724. </dd>
  22725. <dt><samp class="option">reconnect_max_retries</samp></dt>
  22726. <dd><p>Set the maximum number of times to retry a connection. Default unset.
  22727. </p>
  22728. </dd>
  22729. <dt><samp class="option">reconnect_delay_total_max</samp></dt>
  22730. <dd><p>Set the maximum total delay in seconds after which to give up reconnecting.
  22731. </p>
  22732. </dd>
  22733. <dt><samp class="option">respect_retry_after</samp></dt>
  22734. <dd><p>If enabled, and a Retry-After header is encountered, its requested reconnection
  22735. delay will be honored, rather than using exponential backoff. Useful for 429 and
  22736. 503 errors. Default enabled.
  22737. </p>
  22738. </dd>
  22739. <dt><samp class="option">listen</samp></dt>
  22740. <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
  22741. used as an output option, or read data from a client with HTTP POST when used as
  22742. an input option.
  22743. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented
  22744. in ffmpeg.c and thus must not be used as a command line option.
  22745. </p><div class="example">
  22746. <pre class="example-preformatted"># Server side (sending):
  22747. ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var class="var">server</var>:<var class="var">port</var>
  22748. # Client side (receiving):
  22749. ffmpeg -i http://<var class="var">server</var>:<var class="var">port</var> -c copy somefile.ogg
  22750. # Client can also be done with wget:
  22751. wget http://<var class="var">server</var>:<var class="var">port</var> -O somefile.ogg
  22752. # Server side (receiving):
  22753. ffmpeg -listen 1 -i http://<var class="var">server</var>:<var class="var">port</var> -c copy somefile.ogg
  22754. # Client side (sending):
  22755. ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var class="var">server</var>:<var class="var">port</var>
  22756. # Client can also be done with wget:
  22757. wget --post-file=somefile.ogg http://<var class="var">server</var>:<var class="var">port</var>
  22758. </pre></div>
  22759. </dd>
  22760. <dt><samp class="option">resource</samp></dt>
  22761. <dd><p>The resource requested by a client, when the experimental HTTP server is in use.
  22762. </p>
  22763. </dd>
  22764. <dt><samp class="option">reply_code</samp></dt>
  22765. <dd><p>The HTTP code returned to the client, when the experimental HTTP server is in use.
  22766. </p>
  22767. </dd>
  22768. <dt><samp class="option">short_seek_size</samp></dt>
  22769. <dd><p>Set the threshold, in bytes, for when a readahead should be preferred over a seek and
  22770. new HTTP request. This is useful, for example, to make sure the same connection
  22771. is used for reading large video packets with small audio packets in between.
  22772. </p>
  22773. </dd>
  22774. </dl>
  22775. <a name="HTTP-Cookies"></a>
  22776. <h4 class="subsection">24.15.1 HTTP Cookies<span class="pull-right"><a class="anchor hidden-xs" href="#HTTP-Cookies" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-HTTP-Cookies" aria-hidden="true">TOC</a></span></h4>
  22777. <p>Some HTTP requests will be denied unless cookie values are passed in with the
  22778. request. The <samp class="option">cookies</samp> option allows these cookies to be specified. At
  22779. the very least, each cookie must specify a value along with a path and domain.
  22780. HTTP requests that match both the domain and path will automatically include the
  22781. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  22782. by a newline.
  22783. </p>
  22784. <p>The required syntax to play a stream specifying a cookie is:
  22785. </p><div class="example">
  22786. <pre class="example-preformatted">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
  22787. </pre></div>
  22788. <a name="Icecast"></a>
  22789. <h3 class="section">24.16 Icecast<span class="pull-right"><a class="anchor hidden-xs" href="#Icecast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Icecast" aria-hidden="true">TOC</a></span></h3>
  22790. <p>Icecast protocol (stream to Icecast servers)
  22791. </p>
  22792. <p>This protocol accepts the following options:
  22793. </p>
  22794. <dl class="table">
  22795. <dt><samp class="option">ice_genre</samp></dt>
  22796. <dd><p>Set the stream genre.
  22797. </p>
  22798. </dd>
  22799. <dt><samp class="option">ice_name</samp></dt>
  22800. <dd><p>Set the stream name.
  22801. </p>
  22802. </dd>
  22803. <dt><samp class="option">ice_description</samp></dt>
  22804. <dd><p>Set the stream description.
  22805. </p>
  22806. </dd>
  22807. <dt><samp class="option">ice_url</samp></dt>
  22808. <dd><p>Set the stream website URL.
  22809. </p>
  22810. </dd>
  22811. <dt><samp class="option">ice_public</samp></dt>
  22812. <dd><p>Set if the stream should be public.
  22813. The default is 0 (not public).
  22814. </p>
  22815. </dd>
  22816. <dt><samp class="option">user_agent</samp></dt>
  22817. <dd><p>Override the User-Agent header. If not specified a string of the form
  22818. &quot;Lavf/&lt;version&gt;&quot; will be used.
  22819. </p>
  22820. </dd>
  22821. <dt><samp class="option">password</samp></dt>
  22822. <dd><p>Set the Icecast mountpoint password.
  22823. </p>
  22824. </dd>
  22825. <dt><samp class="option">content_type</samp></dt>
  22826. <dd><p>Set the stream content type. This must be set if it is different from
  22827. audio/mpeg.
  22828. </p>
  22829. </dd>
  22830. <dt><samp class="option">legacy_icecast</samp></dt>
  22831. <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
  22832. HTTP PUT method but the SOURCE method.
  22833. </p>
  22834. </dd>
  22835. <dt><samp class="option">tls</samp></dt>
  22836. <dd><p>Establish a TLS (HTTPS) connection to Icecast.
  22837. </p>
  22838. </dd>
  22839. </dl>
  22840. <div class="example">
  22841. <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>
  22842. </pre></div>
  22843. <a name="ipfs"></a>
  22844. <h3 class="section">24.17 ipfs<span class="pull-right"><a class="anchor hidden-xs" href="#ipfs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ipfs" aria-hidden="true">TOC</a></span></h3>
  22845. <p>InterPlanetary File System (IPFS) protocol support. One can access files stored
  22846. on the IPFS network through so-called gateways. These are http(s) endpoints.
  22847. This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent
  22848. to such a gateway. Users can (and should) host their own node which means this
  22849. protocol will use one&rsquo;s local gateway to access files on the IPFS network.
  22850. </p>
  22851. <p>This protocol accepts the following options:
  22852. </p>
  22853. <dl class="table">
  22854. <dt><samp class="option">gateway</samp></dt>
  22855. <dd><p>Defines the gateway to use. When not set, the protocol will first try
  22856. locating the local gateway by looking at <code class="code">$IPFS_GATEWAY</code>, <code class="code">$IPFS_PATH</code>
  22857. and <code class="code">$HOME/.ipfs/</code>, in that order.
  22858. </p>
  22859. </dd>
  22860. </dl>
  22861. <p>One can use this protocol in 2 ways. Using IPFS:
  22862. </p><div class="example">
  22863. <pre class="example-preformatted">ffplay ipfs://&lt;hash&gt;
  22864. </pre></div>
  22865. <p>Or the IPNS protocol (IPNS is mutable IPFS):
  22866. </p><div class="example">
  22867. <pre class="example-preformatted">ffplay ipns://&lt;hash&gt;
  22868. </pre></div>
  22869. <a name="mmst"></a>
  22870. <h3 class="section">24.18 mmst<span class="pull-right"><a class="anchor hidden-xs" href="#mmst" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmst" aria-hidden="true">TOC</a></span></h3>
  22871. <p>MMS (Microsoft Media Server) protocol over TCP.
  22872. </p>
  22873. <a name="mmsh"></a>
  22874. <h3 class="section">24.19 mmsh<span class="pull-right"><a class="anchor hidden-xs" href="#mmsh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmsh" aria-hidden="true">TOC</a></span></h3>
  22875. <p>MMS (Microsoft Media Server) protocol over HTTP.
  22876. </p>
  22877. <p>The required syntax is:
  22878. </p><div class="example">
  22879. <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>]
  22880. </pre></div>
  22881. <a name="md5-2"></a>
  22882. <h3 class="section">24.20 md5<span class="pull-right"><a class="anchor hidden-xs" href="#md5-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-md5-2" aria-hidden="true">TOC</a></span></h3>
  22883. <p>MD5 output protocol.
  22884. </p>
  22885. <p>Computes the MD5 hash of the data to be written, and on close writes
  22886. this to the designated output or stdout if none is specified. It can
  22887. be used to test muxers without writing an actual file.
  22888. </p>
  22889. <p>Some examples follow.
  22890. </p><div class="example">
  22891. <pre class="example-preformatted"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  22892. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  22893. # Write the MD5 hash of the encoded AVI file to stdout.
  22894. ffmpeg -i input.flv -f avi -y md5:
  22895. </pre></div>
  22896. <p>Note that some formats (typically MOV) require the output protocol to
  22897. be seekable, so they will fail with the MD5 output protocol.
  22898. </p>
  22899. <a name="pipe"></a>
  22900. <h3 class="section">24.21 pipe<span class="pull-right"><a class="anchor hidden-xs" href="#pipe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pipe" aria-hidden="true">TOC</a></span></h3>
  22901. <p>UNIX pipe access protocol.
  22902. </p>
  22903. <p>Read and write from UNIX pipes.
  22904. </p>
  22905. <p>The accepted syntax is:
  22906. </p><div class="example">
  22907. <pre class="example-preformatted">pipe:[<var class="var">number</var>]
  22908. </pre></div>
  22909. <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
  22910. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var class="var">number</var>
  22911. is not specified, by default the stdout file descriptor will be used
  22912. for writing, stdin for reading.
  22913. </p>
  22914. <p>For example to read from stdin with <code class="command">ffmpeg</code>:
  22915. </p><div class="example">
  22916. <pre class="example-preformatted">cat test.wav | ffmpeg -i pipe:0
  22917. # ...this is the same as...
  22918. cat test.wav | ffmpeg -i pipe:
  22919. </pre></div>
  22920. <p>For writing to stdout with <code class="command">ffmpeg</code>:
  22921. </p><div class="example">
  22922. <pre class="example-preformatted">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
  22923. # ...this is the same as...
  22924. ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
  22925. </pre></div>
  22926. <p>This protocol accepts the following options:
  22927. </p>
  22928. <dl class="table">
  22929. <dt><samp class="option">blocksize</samp></dt>
  22930. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  22931. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  22932. Setting this value reasonably low improves user termination request reaction
  22933. time, which is valuable if data transmission is slow.
  22934. </p></dd>
  22935. <dt><samp class="option">fd</samp></dt>
  22936. <dd><p>Set file descriptor.
  22937. </p></dd>
  22938. </dl>
  22939. <p>Note that some formats (typically MOV), require the output protocol to
  22940. be seekable, so they will fail with the pipe output protocol.
  22941. </p>
  22942. <a name="prompeg"></a>
  22943. <h3 class="section">24.22 prompeg<span class="pull-right"><a class="anchor hidden-xs" href="#prompeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prompeg" aria-hidden="true">TOC</a></span></h3>
  22944. <p>Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
  22945. </p>
  22946. <p>The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
  22947. for MPEG-2 Transport Streams sent over RTP.
  22948. </p>
  22949. <p>This protocol must be used in conjunction with the <code class="code">rtp_mpegts</code> muxer and
  22950. the <code class="code">rtp</code> protocol.
  22951. </p>
  22952. <p>The required syntax is:
  22953. </p><div class="example">
  22954. <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>
  22955. </pre></div>
  22956. <p>The destination UDP ports are <code class="code">port + 2</code> for the column FEC stream
  22957. and <code class="code">port + 4</code> for the row FEC stream.
  22958. </p>
  22959. <p>This protocol accepts the following options:
  22960. </p><dl class="table">
  22961. <dt><samp class="option">l=<var class="var">n</var></samp></dt>
  22962. <dd><p>The number of columns (4-20, LxD &lt;= 100)
  22963. </p>
  22964. </dd>
  22965. <dt><samp class="option">d=<var class="var">n</var></samp></dt>
  22966. <dd><p>The number of rows (4-20, LxD &lt;= 100)
  22967. </p>
  22968. </dd>
  22969. </dl>
  22970. <p>Example usage:
  22971. </p>
  22972. <div class="example">
  22973. <pre class="example-preformatted">-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<var class="var">hostname</var>:<var class="var">port</var>
  22974. </pre></div>
  22975. <a name="rist"></a>
  22976. <h3 class="section">24.23 rist<span class="pull-right"><a class="anchor hidden-xs" href="#rist" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rist" aria-hidden="true">TOC</a></span></h3>
  22977. <p>Reliable Internet Streaming Transport protocol
  22978. </p>
  22979. <p>The accepted options are:
  22980. </p><dl class="table">
  22981. <dt><samp class="option">rist_profile</samp></dt>
  22982. <dd><p>Supported values:
  22983. </p><dl class="table">
  22984. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  22985. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  22986. <dd><p>This one is default.
  22987. </p></dd>
  22988. <dt>&lsquo;<samp class="samp">advanced</samp>&rsquo;</dt>
  22989. </dl>
  22990. </dd>
  22991. <dt><samp class="option">buffer_size</samp></dt>
  22992. <dd><p>Set internal RIST buffer size in milliseconds for retransmission of data.
  22993. Default value is 0 which means the librist default (1 sec). Maximum value is 30
  22994. seconds.
  22995. </p>
  22996. </dd>
  22997. <dt><samp class="option">fifo_size</samp></dt>
  22998. <dd><p>Size of the librist receiver output fifo in number of packets. This must be a
  22999. power of 2.
  23000. Defaults to 8192 (vs the librist default of 1024).
  23001. </p>
  23002. </dd>
  23003. <dt><samp class="option">overrun_nonfatal=<var class="var">1|0</var></samp></dt>
  23004. <dd><p>Survive in case of librist fifo buffer overrun. Default value is 0.
  23005. </p>
  23006. </dd>
  23007. <dt><samp class="option">pkt_size</samp></dt>
  23008. <dd><p>Set maximum packet size for sending data. 1316 by default.
  23009. </p>
  23010. </dd>
  23011. <dt><samp class="option">log_level</samp></dt>
  23012. <dd><p>Set loglevel for RIST logging messages. You only need to set this if you
  23013. explicitly want to enable debug level messages or packet loss simulation,
  23014. otherwise the regular loglevel is respected.
  23015. </p>
  23016. </dd>
  23017. <dt><samp class="option">secret</samp></dt>
  23018. <dd><p>Set override of encryption secret, by default is unset.
  23019. </p>
  23020. </dd>
  23021. <dt><samp class="option">encryption</samp></dt>
  23022. <dd><p>Set encryption type, by default is disabled.
  23023. Acceptable values are 128 and 256.
  23024. </p></dd>
  23025. </dl>
  23026. <a name="rtmp"></a>
  23027. <h3 class="section">24.24 rtmp<span class="pull-right"><a class="anchor hidden-xs" href="#rtmp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmp" aria-hidden="true">TOC</a></span></h3>
  23028. <p>Real-Time Messaging Protocol.
  23029. </p>
  23030. <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  23031. content across a TCP/IP network.
  23032. </p>
  23033. <p>The required syntax is:
  23034. </p><div class="example">
  23035. <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>]
  23036. </pre></div>
  23037. <p>The accepted parameters are:
  23038. </p><dl class="table">
  23039. <dt><samp class="option">username</samp></dt>
  23040. <dd><p>An optional username (mostly for publishing).
  23041. </p>
  23042. </dd>
  23043. <dt><samp class="option">password</samp></dt>
  23044. <dd><p>An optional password (mostly for publishing).
  23045. </p>
  23046. </dd>
  23047. <dt><samp class="option">server</samp></dt>
  23048. <dd><p>The address of the RTMP server.
  23049. </p>
  23050. </dd>
  23051. <dt><samp class="option">port</samp></dt>
  23052. <dd><p>The number of the TCP port to use (by default is 1935).
  23053. </p>
  23054. </dd>
  23055. <dt><samp class="option">app</samp></dt>
  23056. <dd><p>It is the name of the application to access. It usually corresponds to
  23057. the path where the application is installed on the RTMP server
  23058. (e.g. <samp class="file">/ondemand/</samp>, <samp class="file">/flash/live/</samp>, etc.). You can override
  23059. the value parsed from the URI through the <code class="code">rtmp_app</code> option, too.
  23060. </p>
  23061. </dd>
  23062. <dt><samp class="option">playpath</samp></dt>
  23063. <dd><p>It is the path or name of the resource to play with reference to the
  23064. application specified in <var class="var">app</var>, may be prefixed by &quot;mp4:&quot;. You
  23065. can override the value parsed from the URI through the <code class="code">rtmp_playpath</code>
  23066. option, too.
  23067. </p>
  23068. </dd>
  23069. <dt><samp class="option">listen</samp></dt>
  23070. <dd><p>Act as a server, listening for an incoming connection.
  23071. </p>
  23072. </dd>
  23073. <dt><samp class="option">timeout</samp></dt>
  23074. <dd><p>Maximum time to wait for the incoming connection. Implies listen.
  23075. </p></dd>
  23076. </dl>
  23077. <p>Additionally, the following parameters can be set via command line options
  23078. (or in code via <code class="code">AVOption</code>s):
  23079. </p><dl class="table">
  23080. <dt><samp class="option">rtmp_app</samp></dt>
  23081. <dd><p>Name of application to connect on the RTMP server. This option
  23082. overrides the parameter specified in the URI.
  23083. </p>
  23084. </dd>
  23085. <dt><samp class="option">rtmp_buffer</samp></dt>
  23086. <dd><p>Set the client buffer time in milliseconds. The default is 3000.
  23087. </p>
  23088. </dd>
  23089. <dt><samp class="option">rtmp_conn</samp></dt>
  23090. <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
  23091. e.g. like <code class="code">B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
  23092. Each value is prefixed by a single character denoting the type,
  23093. B for Boolean, N for number, S for string, O for object, or Z for null,
  23094. followed by a colon. For Booleans the data must be either 0 or 1 for
  23095. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  23096. 1 to end or begin an object, respectively. Data items in subobjects may
  23097. be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
  23098. the value (i.e. <code class="code">NB:myFlag:1</code>). This option may be used multiple
  23099. times to construct arbitrary AMF sequences.
  23100. </p>
  23101. </dd>
  23102. <dt><samp class="option">rtmp_enhanced_codecs</samp></dt>
  23103. <dd><p>Specify the list of codecs the client advertises to support in an
  23104. enhanced RTMP stream. This option should be set to a comma separated
  23105. list of fourcc values, like <code class="code">hvc1,av01,vp09</code> for multiple codecs
  23106. or <code class="code">hvc1</code> for only one codec. The specified list will be presented
  23107. in the &quot;fourCcLive&quot; property of the Connect Command Message.
  23108. </p>
  23109. </dd>
  23110. <dt><samp class="option">rtmp_flashver</samp></dt>
  23111. <dd><p>Version of the Flash plugin used to run the SWF player. The default
  23112. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  23113. &lt;libavformat version&gt;).)
  23114. </p>
  23115. </dd>
  23116. <dt><samp class="option">rtmp_flush_interval</samp></dt>
  23117. <dd><p>Number of packets flushed in the same request (RTMPT only). The default
  23118. is 10.
  23119. </p>
  23120. </dd>
  23121. <dt><samp class="option">rtmp_live</samp></dt>
  23122. <dd><p>Specify that the media is a live stream. No resuming or seeking in
  23123. live streams is possible. The default value is <code class="code">any</code>, which means the
  23124. subscriber first tries to play the live stream specified in the
  23125. playpath. If a live stream of that name is not found, it plays the
  23126. recorded stream. The other possible values are <code class="code">live</code> and
  23127. <code class="code">recorded</code>.
  23128. </p>
  23129. </dd>
  23130. <dt><samp class="option">rtmp_pageurl</samp></dt>
  23131. <dd><p>URL of the web page in which the media was embedded. By default no
  23132. value will be sent.
  23133. </p>
  23134. </dd>
  23135. <dt><samp class="option">rtmp_playpath</samp></dt>
  23136. <dd><p>Stream identifier to play or to publish. This option overrides the
  23137. parameter specified in the URI.
  23138. </p>
  23139. </dd>
  23140. <dt><samp class="option">rtmp_subscribe</samp></dt>
  23141. <dd><p>Name of live stream to subscribe to. By default no value will be sent.
  23142. It is only sent if the option is specified or if rtmp_live
  23143. is set to live.
  23144. </p>
  23145. </dd>
  23146. <dt><samp class="option">rtmp_swfhash</samp></dt>
  23147. <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
  23148. </p>
  23149. </dd>
  23150. <dt><samp class="option">rtmp_swfsize</samp></dt>
  23151. <dd><p>Size of the decompressed SWF file, required for SWFVerification.
  23152. </p>
  23153. </dd>
  23154. <dt><samp class="option">rtmp_swfurl</samp></dt>
  23155. <dd><p>URL of the SWF player for the media. By default no value will be sent.
  23156. </p>
  23157. </dd>
  23158. <dt><samp class="option">rtmp_swfverify</samp></dt>
  23159. <dd><p>URL to player swf file, compute hash/size automatically.
  23160. </p>
  23161. </dd>
  23162. <dt><samp class="option">rtmp_tcurl</samp></dt>
  23163. <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
  23164. </p>
  23165. </dd>
  23166. <dt><samp class="option">tcp_nodelay=<var class="var">1|0</var></samp></dt>
  23167. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  23168. </p>
  23169. <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>
  23170. </p>
  23171. </dd>
  23172. <dt><samp class="option">tcp_keepalive=<var class="var">1|0</var></samp></dt>
  23173. <dd><p>Enable the TCP keepalive mechanism to detect dead peers and help maintain long-lived idle connections. Default value is 0.
  23174. </p>
  23175. <p>Only the basic keepalive option (SO_KEEPALIVE) can be enabled or disabled. Platform-specific tuning parameters such as TCP_KEEPIDLE, TCP_KEEPINTVL, or TCP_KEEPCNT are not configurable and will use the operating system&rsquo;s default values.
  23176. </p>
  23177. </dd>
  23178. </dl>
  23179. <p>For example to read with <code class="command">ffplay</code> a multimedia resource named
  23180. &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
  23181. </p><div class="example">
  23182. <pre class="example-preformatted">ffplay rtmp://myserver/vod/sample
  23183. </pre></div>
  23184. <p>To publish to a password protected server, passing the playpath and
  23185. app names separately:
  23186. </p><div class="example">
  23187. <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/
  23188. </pre></div>
  23189. <a name="rtmpe"></a>
  23190. <h3 class="section">24.25 rtmpe<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpe" aria-hidden="true">TOC</a></span></h3>
  23191. <p>Encrypted Real-Time Messaging Protocol.
  23192. </p>
  23193. <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  23194. streaming multimedia content within standard cryptographic primitives,
  23195. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  23196. a pair of RC4 keys.
  23197. </p>
  23198. <a name="rtmps"></a>
  23199. <h3 class="section">24.26 rtmps<span class="pull-right"><a class="anchor hidden-xs" href="#rtmps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmps" aria-hidden="true">TOC</a></span></h3>
  23200. <p>Real-Time Messaging Protocol over a secure SSL connection.
  23201. </p>
  23202. <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
  23203. multimedia content across an encrypted connection.
  23204. </p>
  23205. <a name="rtmpt"></a>
  23206. <h3 class="section">24.27 rtmpt<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpt" aria-hidden="true">TOC</a></span></h3>
  23207. <p>Real-Time Messaging Protocol tunneled through HTTP.
  23208. </p>
  23209. <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  23210. for streaming multimedia content within HTTP requests to traverse
  23211. firewalls.
  23212. </p>
  23213. <a name="rtmpte"></a>
  23214. <h3 class="section">24.28 rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpte" aria-hidden="true">TOC</a></span></h3>
  23215. <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  23216. </p>
  23217. <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  23218. is used for streaming multimedia content within HTTP requests to traverse
  23219. firewalls.
  23220. </p>
  23221. <a name="rtmpts"></a>
  23222. <h3 class="section">24.29 rtmpts<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpts" aria-hidden="true">TOC</a></span></h3>
  23223. <p>Real-Time Messaging Protocol tunneled through HTTPS.
  23224. </p>
  23225. <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  23226. for streaming multimedia content within HTTPS requests to traverse
  23227. firewalls.
  23228. </p>
  23229. <a name="libsmbclient"></a>
  23230. <h3 class="section">24.30 libsmbclient<span class="pull-right"><a class="anchor hidden-xs" href="#libsmbclient" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libsmbclient" aria-hidden="true">TOC</a></span></h3>
  23231. <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
  23232. </p>
  23233. <p>Following syntax is required.
  23234. </p>
  23235. <div class="example">
  23236. <pre class="example-preformatted">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  23237. </pre></div>
  23238. <p>This protocol accepts the following options.
  23239. </p>
  23240. <dl class="table">
  23241. <dt><samp class="option">timeout</samp></dt>
  23242. <dd><p>Set timeout in milliseconds of socket I/O operations used by the underlying
  23243. low level operation. By default it is set to -1, which means that the timeout
  23244. is not specified.
  23245. </p>
  23246. </dd>
  23247. <dt><samp class="option">truncate</samp></dt>
  23248. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  23249. truncating. Default value is 1.
  23250. </p>
  23251. </dd>
  23252. <dt><samp class="option">workgroup</samp></dt>
  23253. <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
  23254. </p>
  23255. </dd>
  23256. </dl>
  23257. <p>For more information see: <a class="url" href="http://www.samba.org/">http://www.samba.org/</a>.
  23258. </p>
  23259. <a name="libssh"></a>
  23260. <h3 class="section">24.31 libssh<span class="pull-right"><a class="anchor hidden-xs" href="#libssh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libssh" aria-hidden="true">TOC</a></span></h3>
  23261. <p>Secure File Transfer Protocol via libssh
  23262. </p>
  23263. <p>Read from or write to remote resources using SFTP protocol.
  23264. </p>
  23265. <p>Following syntax is required.
  23266. </p>
  23267. <div class="example">
  23268. <pre class="example-preformatted">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  23269. </pre></div>
  23270. <p>This protocol accepts the following options.
  23271. </p>
  23272. <dl class="table">
  23273. <dt><samp class="option">timeout</samp></dt>
  23274. <dd><p>Set timeout of socket I/O operations used by the underlying low level
  23275. operation. By default it is set to -1, which means that the timeout
  23276. is not specified.
  23277. </p>
  23278. </dd>
  23279. <dt><samp class="option">truncate</samp></dt>
  23280. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  23281. truncating. Default value is 1.
  23282. </p>
  23283. </dd>
  23284. <dt><samp class="option">private_key</samp></dt>
  23285. <dd><p>Specify the path of the file containing private key to use during authorization.
  23286. By default libssh searches for keys in the <samp class="file">~/.ssh/</samp> directory.
  23287. </p>
  23288. </dd>
  23289. </dl>
  23290. <p>Example: Play a file stored on remote server.
  23291. </p>
  23292. <div class="example">
  23293. <pre class="example-preformatted">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  23294. </pre></div>
  23295. <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
  23296. <h3 class="section">24.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">TOC</a></span></h3>
  23297. <p>Real-Time Messaging Protocol and its variants supported through
  23298. librtmp.
  23299. </p>
  23300. <p>Requires the presence of the librtmp headers and library during
  23301. configuration. You need to explicitly configure the build with
  23302. &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
  23303. protocol.
  23304. </p>
  23305. <p>This protocol provides most client functions and a few server
  23306. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  23307. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  23308. variants of these encrypted types (RTMPTE, RTMPTS).
  23309. </p>
  23310. <p>The required syntax is:
  23311. </p><div class="example">
  23312. <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>
  23313. </pre></div>
  23314. <p>where <var class="var">rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
  23315. &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
  23316. <var class="var">server</var>, <var class="var">port</var>, <var class="var">app</var> and <var class="var">playpath</var> have the same
  23317. meaning as specified for the RTMP native protocol.
  23318. <var class="var">options</var> contains a list of space-separated options of the form
  23319. <var class="var">key</var>=<var class="var">val</var>.
  23320. </p>
  23321. <p>See the librtmp manual page (man 3 librtmp) for more information.
  23322. </p>
  23323. <p>For example, to stream a file in real-time to an RTMP server using
  23324. <code class="command">ffmpeg</code>:
  23325. </p><div class="example">
  23326. <pre class="example-preformatted">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  23327. </pre></div>
  23328. <p>To play the same stream using <code class="command">ffplay</code>:
  23329. </p><div class="example">
  23330. <pre class="example-preformatted">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
  23331. </pre></div>
  23332. <a name="rtp"></a>
  23333. <h3 class="section">24.33 rtp<span class="pull-right"><a class="anchor hidden-xs" href="#rtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtp" aria-hidden="true">TOC</a></span></h3>
  23334. <p>Real-time Transport Protocol.
  23335. </p>
  23336. <p>The required syntax for an RTP URL is:
  23337. </p><div class="example">
  23338. <pre class="example-preformatted">rtp://<var class="var">hostname</var>[:<var class="var">port</var>][?<var class="var">options</var>]
  23339. </pre></div>
  23340. <p><var class="var">port</var> specifies the RTP port to use.
  23341. </p>
  23342. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  23343. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  23344. space) can be used to escape keys and values.
  23345. </p>
  23346. <p>Options can also can be specified via command line options (or in code via
  23347. <code class="code">AVOption</code>s).
  23348. </p>
  23349. <p>The list of supported options follows.
  23350. </p>
  23351. <dl class="table">
  23352. <dt><samp class="option">ttl=<var class="var">n</var></samp></dt>
  23353. <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
  23354. </p>
  23355. </dd>
  23356. <dt><samp class="option">rtcpport=<var class="var">n</var></samp></dt>
  23357. <dd><p>Set the remote RTCP port to <var class="var">n</var>.
  23358. </p>
  23359. </dd>
  23360. <dt><samp class="option">localport, local_rtpport, localrtpport=<var class="var">n</var></samp></dt>
  23361. <dd><p>Set the local RTP port to <var class="var">n</var>.
  23362. </p>
  23363. <p>Using the localport option name is deprecated and should not be used.
  23364. </p>
  23365. </dd>
  23366. <dt><samp class="option">local_rtcpport, localrtcpport=<var class="var">n</var>'</samp></dt>
  23367. <dd><p>Set the local RTCP port to <var class="var">n</var>.
  23368. </p>
  23369. </dd>
  23370. <dt><samp class="option">pkt_size=<var class="var">n</var></samp></dt>
  23371. <dd><p>Set max packet size (in bytes) to <var class="var">n</var>.
  23372. </p>
  23373. </dd>
  23374. <dt><samp class="option">buffer_size=<var class="var">size</var></samp></dt>
  23375. <dd><p>Set the maximum UDP socket buffer size in bytes.
  23376. </p>
  23377. </dd>
  23378. <dt><samp class="option">connect=0|1</samp></dt>
  23379. <dd><p>Do a <code class="code">connect()</code> on the UDP socket (if set to 1) or not (if set
  23380. to 0).
  23381. </p>
  23382. </dd>
  23383. <dt><samp class="option">sources=<var class="var">ip</var>[,<var class="var">ip</var>]</samp></dt>
  23384. <dd><p>List allowed source IP addresses.
  23385. </p>
  23386. </dd>
  23387. <dt><samp class="option">block=<var class="var">ip</var>[,<var class="var">ip</var>]</samp></dt>
  23388. <dd><p>List disallowed (blocked) source IP addresses.
  23389. </p>
  23390. </dd>
  23391. <dt><samp class="option">write_to_source=0|1</samp></dt>
  23392. <dd><p>Send packets to the source address of the latest received packet (if
  23393. set to 1) or to a default remote address (if set to 0).
  23394. </p>
  23395. </dd>
  23396. <dt><samp class="option">localaddr=<var class="var">addr</var></samp></dt>
  23397. <dd><p>Local IP address of a network interface used for sending packets or joining
  23398. multicast groups.
  23399. </p>
  23400. </dd>
  23401. <dt><samp class="option">timeout=<var class="var">n</var></samp></dt>
  23402. <dd><p>Set timeout (in microseconds) of socket I/O operations to <var class="var">n</var>.
  23403. </p></dd>
  23404. </dl>
  23405. <p>Important notes:
  23406. </p>
  23407. <ol class="enumerate">
  23408. <li> If <samp class="option">rtcpport</samp> is not set the RTCP port will be set to the RTP
  23409. port value plus 1.
  23410. </li><li> If <samp class="option">localrtpport</samp> (the local RTP port) is not set any available
  23411. port will be used for the local RTP and RTCP ports.
  23412. </li><li> If <samp class="option">localrtcpport</samp> (the local RTCP port) is not set it will be
  23413. set to the local RTP port value plus 1.
  23414. </li></ol>
  23415. <a name="rtsp"></a>
  23416. <h3 class="section">24.34 rtsp<span class="pull-right"><a class="anchor hidden-xs" href="#rtsp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtsp" aria-hidden="true">TOC</a></span></h3>
  23417. <p>Real-Time Streaming Protocol.
  23418. </p>
  23419. <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
  23420. and muxer. The demuxer supports both normal RTSP (with data transferred
  23421. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  23422. data transferred over RDT).
  23423. </p>
  23424. <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  23425. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
  23426. <a class="uref" href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
  23427. </p>
  23428. <p>The required syntax for a RTSP url is:
  23429. </p><div class="example">
  23430. <pre class="example-preformatted">rtsp://<var class="var">hostname</var>[:<var class="var">port</var>]/<var class="var">path</var>
  23431. </pre></div>
  23432. <p>Options can be set on the <code class="command">ffmpeg</code>/<code class="command">ffplay</code> command
  23433. line, or set in code via <code class="code">AVOption</code>s or in
  23434. <code class="code">avformat_open_input</code>.
  23435. </p>
  23436. <a name="Muxer"></a>
  23437. <h4 class="subsection">24.34.1 Muxer<span class="pull-right"><a class="anchor hidden-xs" href="#Muxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxer" aria-hidden="true">TOC</a></span></h4>
  23438. <p>The following options are supported.
  23439. </p>
  23440. <dl class="table">
  23441. <dt><samp class="option">rtsp_transport</samp></dt>
  23442. <dd><p>Set RTSP transport protocols.
  23443. </p>
  23444. <p>It accepts the following values:
  23445. </p><dl class="table">
  23446. <dt>&lsquo;<samp class="samp">udp</samp>&rsquo;</dt>
  23447. <dd><p>Use UDP as lower transport protocol.
  23448. </p>
  23449. </dd>
  23450. <dt>&lsquo;<samp class="samp">tcp</samp>&rsquo;</dt>
  23451. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  23452. transport protocol.
  23453. </p></dd>
  23454. </dl>
  23455. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  23456. </p>
  23457. </dd>
  23458. <dt><samp class="option">rtsp_flags</samp></dt>
  23459. <dd><p>Set RTSP flags.
  23460. </p>
  23461. <p>The following values are accepted:
  23462. </p><dl class="table">
  23463. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  23464. <dd><p>Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC.
  23465. </p></dd>
  23466. <dt>&lsquo;<samp class="samp">rfc2190</samp>&rsquo;</dt>
  23467. <dd><p>Use RFC 2190 packetization instead of RFC 4629 for H.263.
  23468. </p></dd>
  23469. <dt>&lsquo;<samp class="samp">skip_rtcp</samp>&rsquo;</dt>
  23470. <dd><p>Don&rsquo;t send RTCP sender reports.
  23471. </p></dd>
  23472. <dt>&lsquo;<samp class="samp">h264_mode0</samp>&rsquo;</dt>
  23473. <dd><p>Use mode 0 for H.264 in RTP.
  23474. </p></dd>
  23475. <dt>&lsquo;<samp class="samp">send_bye</samp>&rsquo;</dt>
  23476. <dd><p>Send RTCP BYE packets when finishing.
  23477. </p></dd>
  23478. </dl>
  23479. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  23480. </p>
  23481. </dd>
  23482. <dt><samp class="option">min_port</samp></dt>
  23483. <dd><p>Set minimum local UDP port. Default value is 5000.
  23484. </p>
  23485. </dd>
  23486. <dt><samp class="option">max_port</samp></dt>
  23487. <dd><p>Set maximum local UDP port. Default value is 65000.
  23488. </p>
  23489. </dd>
  23490. <dt><samp class="option">buffer_size</samp></dt>
  23491. <dd><p>Set the maximum socket buffer size in bytes.
  23492. </p>
  23493. </dd>
  23494. <dt><samp class="option">pkt_size</samp></dt>
  23495. <dd><p>Set max send packet size (in bytes). Default value is 1472.
  23496. </p></dd>
  23497. </dl>
  23498. <a name="Demuxer"></a>
  23499. <h4 class="subsection">24.34.2 Demuxer<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxer" aria-hidden="true">TOC</a></span></h4>
  23500. <p>The following options are supported.
  23501. </p>
  23502. <dl class="table">
  23503. <dt><samp class="option">initial_pause</samp></dt>
  23504. <dd><p>Do not start playing the stream immediately if set to 1. Default value
  23505. is 0.
  23506. </p>
  23507. </dd>
  23508. <dt><samp class="option">rtsp_transport</samp></dt>
  23509. <dd><p>Set RTSP transport protocols.
  23510. </p>
  23511. <p>It accepts the following values:
  23512. </p><dl class="table">
  23513. <dt>&lsquo;<samp class="samp">udp</samp>&rsquo;</dt>
  23514. <dd><p>Use UDP as lower transport protocol.
  23515. </p>
  23516. </dd>
  23517. <dt>&lsquo;<samp class="samp">tcp</samp>&rsquo;</dt>
  23518. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  23519. transport protocol.
  23520. </p>
  23521. </dd>
  23522. <dt>&lsquo;<samp class="samp">udp_multicast</samp>&rsquo;</dt>
  23523. <dd><p>Use UDP multicast as lower transport protocol.
  23524. </p>
  23525. </dd>
  23526. <dt>&lsquo;<samp class="samp">http</samp>&rsquo;</dt>
  23527. <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
  23528. passing proxies.
  23529. </p>
  23530. </dd>
  23531. <dt>&lsquo;<samp class="samp">https</samp>&rsquo;</dt>
  23532. <dd><p>Use HTTPs tunneling as lower transport protocol, which is useful for
  23533. passing proxies and widely used for security consideration.
  23534. </p></dd>
  23535. </dl>
  23536. <p>Multiple lower transport protocols may be specified, in that case they are
  23537. tried one at a time (if the setup of one fails, the next one is tried).
  23538. For the muxer, only the &lsquo;<samp class="samp">tcp</samp>&rsquo; and &lsquo;<samp class="samp">udp</samp>&rsquo; options are supported.
  23539. </p>
  23540. </dd>
  23541. <dt><samp class="option">rtsp_flags</samp></dt>
  23542. <dd><p>Set RTSP flags.
  23543. </p>
  23544. <p>The following values are accepted:
  23545. </p><dl class="table">
  23546. <dt>&lsquo;<samp class="samp">filter_src</samp>&rsquo;</dt>
  23547. <dd><p>Accept packets only from negotiated peer address and port.
  23548. </p></dd>
  23549. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  23550. <dd><p>Act as a server, listening for an incoming connection.
  23551. </p></dd>
  23552. <dt>&lsquo;<samp class="samp">prefer_tcp</samp>&rsquo;</dt>
  23553. <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  23554. </p></dd>
  23555. <dt>&lsquo;<samp class="samp">satip_raw</samp>&rsquo;</dt>
  23556. <dd><p>Export raw MPEG-TS stream instead of demuxing. The flag will simply write out
  23557. the raw stream, with the original PAT/PMT/PIDs intact.
  23558. </p></dd>
  23559. </dl>
  23560. <p>Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  23561. </p>
  23562. </dd>
  23563. <dt><samp class="option">allowed_media_types</samp></dt>
  23564. <dd><p>Set media types to accept from the server.
  23565. </p>
  23566. <p>The following flags are accepted:
  23567. </p><dl class="table">
  23568. <dt>&lsquo;<samp class="samp">video</samp>&rsquo;</dt>
  23569. <dt>&lsquo;<samp class="samp">audio</samp>&rsquo;</dt>
  23570. <dt>&lsquo;<samp class="samp">data</samp>&rsquo;</dt>
  23571. <dt>&lsquo;<samp class="samp">subtitle</samp>&rsquo;</dt>
  23572. </dl>
  23573. <p>By default it accepts all media types.
  23574. </p>
  23575. </dd>
  23576. <dt><samp class="option">min_port</samp></dt>
  23577. <dd><p>Set minimum local UDP port. Default value is 5000.
  23578. </p>
  23579. </dd>
  23580. <dt><samp class="option">max_port</samp></dt>
  23581. <dd><p>Set maximum local UDP port. Default value is 65000.
  23582. </p>
  23583. </dd>
  23584. <dt><samp class="option">listen_timeout</samp></dt>
  23585. <dd><p>Set maximum timeout (in seconds) to establish an initial connection. Setting
  23586. <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
  23587. which means an infinite timeout when &lsquo;<samp class="samp">listen</samp>&rsquo; mode is set.
  23588. </p>
  23589. </dd>
  23590. <dt><samp class="option">reorder_queue_size</samp></dt>
  23591. <dd><p>Set number of packets to buffer for handling of reordered packets.
  23592. </p>
  23593. </dd>
  23594. <dt><samp class="option">timeout</samp></dt>
  23595. <dd><p>Set socket TCP I/O timeout in microseconds.
  23596. </p>
  23597. </dd>
  23598. <dt><samp class="option">user_agent</samp></dt>
  23599. <dd><p>Override User-Agent header. If not specified, it defaults to the
  23600. libavformat identifier string.
  23601. </p>
  23602. </dd>
  23603. <dt><samp class="option">buffer_size</samp></dt>
  23604. <dd><p>Set the maximum socket buffer size in bytes.
  23605. </p></dd>
  23606. </dl>
  23607. <p>When receiving data over UDP, the demuxer tries to reorder received packets
  23608. (since they may arrive out of order, or packets may get lost totally). This
  23609. can be disabled by setting the maximum demuxing delay to zero (via
  23610. the <code class="code">max_delay</code> field of AVFormatContext).
  23611. </p>
  23612. <p>When watching multi-bitrate Real-RTSP streams with <code class="command">ffplay</code>, the
  23613. streams to display can be chosen with <code class="code">-vst</code> <var class="var">n</var> and
  23614. <code class="code">-ast</code> <var class="var">n</var> for video and audio respectively, and can be switched
  23615. on the fly by pressing <code class="code">v</code> and <code class="code">a</code>.
  23616. </p>
  23617. <a name="Examples-28"></a>
  23618. <h4 class="subsection">24.34.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-28" aria-hidden="true">TOC</a></span></h4>
  23619. <p>The following examples all make use of the <code class="command">ffplay</code> and
  23620. <code class="command">ffmpeg</code> tools.
  23621. </p>
  23622. <ul class="itemize mark-bullet">
  23623. <li>Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  23624. <div class="example">
  23625. <pre class="example-preformatted">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  23626. </pre></div>
  23627. </li><li>Watch a stream tunneled over HTTP:
  23628. <div class="example">
  23629. <pre class="example-preformatted">ffplay -rtsp_transport http rtsp://server/video.mp4
  23630. </pre></div>
  23631. </li><li>Send a stream in realtime to a RTSP server, for others to watch:
  23632. <div class="example">
  23633. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  23634. </pre></div>
  23635. </li><li>Receive a stream in realtime:
  23636. <div class="example">
  23637. <pre class="example-preformatted">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var class="var">output</var>
  23638. </pre></div>
  23639. </li></ul>
  23640. <a name="sap"></a>
  23641. <h3 class="section">24.35 sap<span class="pull-right"><a class="anchor hidden-xs" href="#sap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sap" aria-hidden="true">TOC</a></span></h3>
  23642. <p>Session Announcement Protocol (RFC 2974). This is not technically a
  23643. protocol handler in libavformat, it is a muxer and demuxer.
  23644. It is used for signalling of RTP streams, by announcing the SDP for the
  23645. streams regularly on a separate port.
  23646. </p>
  23647. <a name="Muxer-1"></a>
  23648. <h4 class="subsection">24.35.1 Muxer<span class="pull-right"><a class="anchor hidden-xs" href="#Muxer-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxer-1" aria-hidden="true">TOC</a></span></h4>
  23649. <p>The syntax for a SAP url given to the muxer is:
  23650. </p><div class="example">
  23651. <pre class="example-preformatted">sap://<var class="var">destination</var>[:<var class="var">port</var>][?<var class="var">options</var>]
  23652. </pre></div>
  23653. <p>The RTP packets are sent to <var class="var">destination</var> on port <var class="var">port</var>,
  23654. or to port 5004 if no port is specified.
  23655. <var class="var">options</var> is a <code class="code">&amp;</code>-separated list. The following options
  23656. are supported:
  23657. </p>
  23658. <dl class="table">
  23659. <dt><samp class="option">announce_addr=<var class="var">address</var></samp></dt>
  23660. <dd><p>Specify the destination IP address for sending the announcements to.
  23661. If omitted, the announcements are sent to the commonly used SAP
  23662. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  23663. ff0e::2:7ffe if <var class="var">destination</var> is an IPv6 address.
  23664. </p>
  23665. </dd>
  23666. <dt><samp class="option">announce_port=<var class="var">port</var></samp></dt>
  23667. <dd><p>Specify the port to send the announcements on, defaults to
  23668. 9875 if not specified.
  23669. </p>
  23670. </dd>
  23671. <dt><samp class="option">ttl=<var class="var">ttl</var></samp></dt>
  23672. <dd><p>Specify the time to live value for the announcements and RTP packets,
  23673. defaults to 255.
  23674. </p>
  23675. </dd>
  23676. <dt><samp class="option">same_port=<var class="var">0|1</var></samp></dt>
  23677. <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
  23678. default), all streams are sent on unique ports, with each stream on a
  23679. port 2 numbers higher than the previous.
  23680. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  23681. The RTP stack in libavformat for receiving requires all streams to be sent
  23682. on unique ports.
  23683. </p></dd>
  23684. </dl>
  23685. <p>Example command lines follow.
  23686. </p>
  23687. <p>To broadcast a stream on the local subnet, for watching in VLC:
  23688. </p>
  23689. <div class="example">
  23690. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://224.0.0.255?same_port=1
  23691. </pre></div>
  23692. <p>Similarly, for watching in <code class="command">ffplay</code>:
  23693. </p>
  23694. <div class="example">
  23695. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://224.0.0.255
  23696. </pre></div>
  23697. <p>And for watching in <code class="command">ffplay</code>, over IPv6:
  23698. </p>
  23699. <div class="example">
  23700. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://[ff0e::1:2:3:4]
  23701. </pre></div>
  23702. <a name="Demuxer-1"></a>
  23703. <h4 class="subsection">24.35.2 Demuxer<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxer-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxer-1" aria-hidden="true">TOC</a></span></h4>
  23704. <p>The syntax for a SAP url given to the demuxer is:
  23705. </p><div class="example">
  23706. <pre class="example-preformatted">sap://[<var class="var">address</var>][:<var class="var">port</var>]
  23707. </pre></div>
  23708. <p><var class="var">address</var> is the multicast address to listen for announcements on,
  23709. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var class="var">port</var>
  23710. is the port that is listened on, 9875 if omitted.
  23711. </p>
  23712. <p>The demuxers listens for announcements on the given address and port.
  23713. Once an announcement is received, it tries to receive that particular stream.
  23714. </p>
  23715. <p>Example command lines follow.
  23716. </p>
  23717. <p>To play back the first stream announced on the normal SAP multicast address:
  23718. </p>
  23719. <div class="example">
  23720. <pre class="example-preformatted">ffplay sap://
  23721. </pre></div>
  23722. <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
  23723. </p>
  23724. <div class="example">
  23725. <pre class="example-preformatted">ffplay sap://[ff0e::2:7ffe]
  23726. </pre></div>
  23727. <a name="sctp"></a>
  23728. <h3 class="section">24.36 sctp<span class="pull-right"><a class="anchor hidden-xs" href="#sctp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sctp" aria-hidden="true">TOC</a></span></h3>
  23729. <p>Stream Control Transmission Protocol.
  23730. </p>
  23731. <p>The accepted URL syntax is:
  23732. </p><div class="example">
  23733. <pre class="example-preformatted">sctp://<var class="var">host</var>:<var class="var">port</var>[?<var class="var">options</var>]
  23734. </pre></div>
  23735. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  23736. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  23737. space) can be used to escape keys and values.
  23738. </p>
  23739. <p>Options can also can be specified via command line options (or in code via
  23740. <code class="code">AVOption</code>s).
  23741. </p>
  23742. <p>The list of supported options follows.
  23743. </p>
  23744. <dl class="table">
  23745. <dt><samp class="option">listen</samp></dt>
  23746. <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  23747. </p>
  23748. </dd>
  23749. <dt><samp class="option">max_streams</samp></dt>
  23750. <dd><p>Set the maximum number of streams. By default no limit is set.
  23751. </p></dd>
  23752. </dl>
  23753. <a name="srt"></a>
  23754. <h3 class="section">24.37 srt<span class="pull-right"><a class="anchor hidden-xs" href="#srt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srt" aria-hidden="true">TOC</a></span></h3>
  23755. <p>Haivision Secure Reliable Transport Protocol via libsrt.
  23756. </p>
  23757. <p>The supported syntax for a SRT URL is:
  23758. </p><div class="example">
  23759. <pre class="example-preformatted">srt://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  23760. </pre></div>
  23761. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  23762. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  23763. space) can be used to escape keys and values.
  23764. </p>
  23765. <p>Options can also can be specified via command line options (or in code via
  23766. <code class="code">AVOption</code>s).
  23767. </p>
  23768. <p>The list of supported options follows.
  23769. </p>
  23770. <dl class="table">
  23771. <dt><samp class="option">connect_timeout=<var class="var">milliseconds</var></samp></dt>
  23772. <dd><p>Connection timeout; SRT cannot connect for RTT &gt; 1500 msec
  23773. (2 handshake exchanges) with the default connect timeout of
  23774. 3 seconds. This option applies to the caller and rendezvous
  23775. connection modes. The connect timeout is 10 times the value
  23776. set for the rendezvous mode (which can be used as a
  23777. workaround for this connection problem with earlier versions).
  23778. </p>
  23779. </dd>
  23780. <dt><samp class="option">ffs=<var class="var">bytes</var></samp></dt>
  23781. <dd><p>Flight Flag Size (Window Size), in bytes. FFS is actually an
  23782. internal parameter and you should set it to not less than
  23783. <samp class="option">recv_buffer_size</samp> and <samp class="option">mss</samp>. The default value
  23784. is relatively large, therefore unless you set a very large receiver buffer,
  23785. you do not need to change this option. Default value is 25600.
  23786. </p>
  23787. </dd>
  23788. <dt><samp class="option">inputbw=<var class="var">bytes/seconds</var></samp></dt>
  23789. <dd><p>Sender nominal input rate, in bytes per seconds. Used along with
  23790. <samp class="option">oheadbw</samp>, when <samp class="option">maxbw</samp> is set to relative (0), to
  23791. calculate maximum sending rate when recovery packets are sent
  23792. along with the main media stream:
  23793. <samp class="option">inputbw</samp> * (100 + <samp class="option">oheadbw</samp>) / 100
  23794. if <samp class="option">inputbw</samp> is not set while <samp class="option">maxbw</samp> is set to
  23795. relative (0), the actual input rate is evaluated inside
  23796. the library. Default value is 0.
  23797. </p>
  23798. </dd>
  23799. <dt><samp class="option">iptos=<var class="var">tos</var></samp></dt>
  23800. <dd><p>IP Type of Service. Applies to sender only. Default value is 0xB8.
  23801. </p>
  23802. </dd>
  23803. <dt><samp class="option">ipttl=<var class="var">ttl</var></samp></dt>
  23804. <dd><p>IP Time To Live. Applies to sender only. Default value is 64.
  23805. </p>
  23806. </dd>
  23807. <dt><samp class="option">latency=<var class="var">microseconds</var></samp></dt>
  23808. <dd><p>Timestamp-based Packet Delivery Delay.
  23809. Used to absorb bursts of missed packet retransmissions.
  23810. This flag sets both <samp class="option">rcvlatency</samp> and <samp class="option">peerlatency</samp>
  23811. to the same value. Note that prior to version 1.3.0
  23812. this is the only flag to set the latency, however
  23813. this is effectively equivalent to setting <samp class="option">peerlatency</samp>,
  23814. when side is sender and <samp class="option">rcvlatency</samp>
  23815. when side is receiver, and the bidirectional stream
  23816. sending is not supported.
  23817. </p>
  23818. </dd>
  23819. <dt><samp class="option">listen_timeout=<var class="var">microseconds</var></samp></dt>
  23820. <dd><p>Set socket listen timeout.
  23821. </p>
  23822. </dd>
  23823. <dt><samp class="option">maxbw=<var class="var">bytes/seconds</var></samp></dt>
  23824. <dd><p>Maximum sending bandwidth, in bytes per seconds.
  23825. -1 infinite (CSRTCC limit is 30mbps)
  23826. 0 relative to input rate (see <samp class="option">inputbw</samp>)
  23827. &gt;0 absolute limit value
  23828. Default value is 0 (relative)
  23829. </p>
  23830. </dd>
  23831. <dt><samp class="option">mode=<var class="var">caller|listener|rendezvous</var></samp></dt>
  23832. <dd><p>Connection mode.
  23833. <samp class="option">caller</samp> opens client connection.
  23834. <samp class="option">listener</samp> starts server to listen for incoming connections.
  23835. <samp class="option">rendezvous</samp> use Rendez-Vous connection mode.
  23836. Default value is caller.
  23837. </p>
  23838. </dd>
  23839. <dt><samp class="option">mss=<var class="var">bytes</var></samp></dt>
  23840. <dd><p>Maximum Segment Size, in bytes. Used for buffer allocation
  23841. and rate calculation using a packet counter assuming fully
  23842. filled packets. The smallest MSS between the peers is
  23843. used. This is 1500 by default in the overall internet.
  23844. This is the maximum size of the UDP packet and can be
  23845. only decreased, unless you have some unusual dedicated
  23846. network settings. Default value is 1500.
  23847. </p>
  23848. </dd>
  23849. <dt><samp class="option">nakreport=<var class="var">1|0</var></samp></dt>
  23850. <dd><p>If set to 1, Receiver will send &lsquo;UMSG_LOSSREPORT&lsquo; messages
  23851. periodically until a lost packet is retransmitted or
  23852. intentionally dropped. Default value is 1.
  23853. </p>
  23854. </dd>
  23855. <dt><samp class="option">oheadbw=<var class="var">percents</var></samp></dt>
  23856. <dd><p>Recovery bandwidth overhead above input rate, in percents.
  23857. See <samp class="option">inputbw</samp>. Default value is 25%.
  23858. </p>
  23859. </dd>
  23860. <dt><samp class="option">passphrase=<var class="var">string</var></samp></dt>
  23861. <dd><p>HaiCrypt Encryption/Decryption Passphrase string, length
  23862. from 10 to 79 characters. The passphrase is the shared
  23863. secret between the sender and the receiver. It is used
  23864. to generate the Key Encrypting Key using PBKDF2
  23865. (Password-Based Key Derivation Function). It is used
  23866. only if <samp class="option">pbkeylen</samp> is non-zero. It is used on
  23867. the receiver only if the received data is encrypted.
  23868. The configured passphrase cannot be recovered (write-only).
  23869. </p>
  23870. </dd>
  23871. <dt><samp class="option">enforced_encryption=<var class="var">1|0</var></samp></dt>
  23872. <dd><p>If true, both connection parties must have the same password
  23873. set (including empty, that is, with no encryption). If the
  23874. password doesn&rsquo;t match or only one side is unencrypted,
  23875. the connection is rejected. Default is true.
  23876. </p>
  23877. </dd>
  23878. <dt><samp class="option">kmrefreshrate=<var class="var">packets</var></samp></dt>
  23879. <dd><p>The number of packets to be transmitted after which the
  23880. encryption key is switched to a new key. Default is -1.
  23881. -1 means auto (0x1000000 in srt library). The range for
  23882. this option is integers in the 0 - <code class="code">INT_MAX</code>.
  23883. </p>
  23884. </dd>
  23885. <dt><samp class="option">kmpreannounce=<var class="var">packets</var></samp></dt>
  23886. <dd><p>The interval between when a new encryption key is sent and
  23887. when switchover occurs. This value also applies to the
  23888. subsequent interval between when switchover occurs and
  23889. when the old encryption key is decommissioned. Default is -1.
  23890. -1 means auto (0x1000 in srt library). The range for
  23891. this option is integers in the 0 - <code class="code">INT_MAX</code>.
  23892. </p>
  23893. </dd>
  23894. <dt><samp class="option">snddropdelay=<var class="var">microseconds</var></samp></dt>
  23895. <dd><p>The sender&rsquo;s extra delay before dropping packets. This delay is
  23896. added to the default drop delay time interval value.
  23897. </p>
  23898. <p>Special value -1: Do not drop packets on the sender at all.
  23899. </p>
  23900. </dd>
  23901. <dt><samp class="option">payload_size=<var class="var">bytes</var></samp></dt>
  23902. <dd><p>Sets the maximum declared size of a packet transferred
  23903. during the single call to the sending function in Live
  23904. mode. Use 0 if this value isn&rsquo;t used (which is default in
  23905. file mode).
  23906. Default is -1 (automatic), which typically means MPEG-TS;
  23907. if you are going to use SRT
  23908. to send any different kind of payload, such as, for example,
  23909. wrapping a live stream in very small frames, then you can
  23910. use a bigger maximum frame size, though not greater than
  23911. 1456 bytes.
  23912. </p>
  23913. </dd>
  23914. <dt><samp class="option">pkt_size=<var class="var">bytes</var></samp></dt>
  23915. <dd><p>Alias for &lsquo;<samp class="samp">payload_size</samp>&rsquo;.
  23916. </p>
  23917. </dd>
  23918. <dt><samp class="option">peerlatency=<var class="var">microseconds</var></samp></dt>
  23919. <dd><p>The latency value (as described in <samp class="option">rcvlatency</samp>) that is
  23920. set by the sender side as a minimum value for the receiver.
  23921. </p>
  23922. </dd>
  23923. <dt><samp class="option">pbkeylen=<var class="var">bytes</var></samp></dt>
  23924. <dd><p>Sender encryption key length, in bytes.
  23925. Only can be set to 0, 16, 24 and 32.
  23926. Enable sender encryption if not 0.
  23927. Not required on receiver (set to 0),
  23928. key size obtained from sender in HaiCrypt handshake.
  23929. Default value is 0.
  23930. </p>
  23931. </dd>
  23932. <dt><samp class="option">rcvlatency=<var class="var">microseconds</var></samp></dt>
  23933. <dd><p>The time that should elapse since the moment when the
  23934. packet was sent and the moment when it&rsquo;s delivered to
  23935. the receiver application in the receiving function.
  23936. This time should be a buffer time large enough to cover
  23937. the time spent for sending, unexpectedly extended RTT
  23938. time, and the time needed to retransmit the lost UDP
  23939. packet. The effective latency value will be the maximum
  23940. of this options&rsquo; value and the value of <samp class="option">peerlatency</samp>
  23941. set by the peer side. Before version 1.3.0 this option
  23942. is only available as <samp class="option">latency</samp>.
  23943. </p>
  23944. </dd>
  23945. <dt><samp class="option">recv_buffer_size=<var class="var">bytes</var></samp></dt>
  23946. <dd><p>Set UDP receive buffer size, expressed in bytes.
  23947. </p>
  23948. </dd>
  23949. <dt><samp class="option">send_buffer_size=<var class="var">bytes</var></samp></dt>
  23950. <dd><p>Set UDP send buffer size, expressed in bytes.
  23951. </p>
  23952. </dd>
  23953. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  23954. <dd><p>Set raise error timeouts for read, write and connect operations. Note that the
  23955. SRT library has internal timeouts which can be controlled separately, the
  23956. value set here is only a cap on those.
  23957. </p>
  23958. </dd>
  23959. <dt><samp class="option">tlpktdrop=<var class="var">1|0</var></samp></dt>
  23960. <dd><p>Too-late Packet Drop. When enabled on receiver, it skips
  23961. missing packets that have not been delivered in time and
  23962. delivers the following packets to the application when
  23963. their time-to-play has come. It also sends a fake ACK to
  23964. the sender. When enabled on sender and enabled on the
  23965. receiving peer, the sender drops the older packets that
  23966. have no chance of being delivered in time. It was
  23967. automatically enabled in the sender if the receiver
  23968. supports it.
  23969. </p>
  23970. </dd>
  23971. <dt><samp class="option">sndbuf=<var class="var">bytes</var></samp></dt>
  23972. <dd><p>Set send buffer size, expressed in bytes.
  23973. </p>
  23974. </dd>
  23975. <dt><samp class="option">rcvbuf=<var class="var">bytes</var></samp></dt>
  23976. <dd><p>Set receive buffer size, expressed in bytes.
  23977. </p>
  23978. <p>Receive buffer must not be greater than <samp class="option">ffs</samp>.
  23979. </p>
  23980. </dd>
  23981. <dt><samp class="option">lossmaxttl=<var class="var">packets</var></samp></dt>
  23982. <dd><p>The value up to which the Reorder Tolerance may grow. When
  23983. Reorder Tolerance is &gt; 0, then packet loss report is delayed
  23984. until that number of packets come in. Reorder Tolerance
  23985. increases every time a &quot;belated&quot; packet has come, but it
  23986. wasn&rsquo;t due to retransmission (that is, when UDP packets tend
  23987. to come out of order), with the difference between the latest
  23988. sequence and this packet&rsquo;s sequence, and not more than the
  23989. value of this option. By default it&rsquo;s 0, which means that this
  23990. mechanism is turned off, and the loss report is always sent
  23991. immediately upon experiencing a &quot;gap&quot; in sequences.
  23992. </p>
  23993. </dd>
  23994. <dt><samp class="option">minversion</samp></dt>
  23995. <dd><p>The minimum SRT version that is required from the peer. A connection
  23996. to a peer that does not satisfy the minimum version requirement
  23997. will be rejected.
  23998. </p>
  23999. <p>The version format in hex is 0xXXYYZZ for x.y.z in human readable
  24000. form.
  24001. </p>
  24002. </dd>
  24003. <dt><samp class="option">streamid=<var class="var">string</var></samp></dt>
  24004. <dd><p>A string limited to 512 characters that can be set on the socket prior
  24005. to connecting. This stream ID will be able to be retrieved by the
  24006. listener side from the socket that is returned from srt_accept and
  24007. was connected by a socket with that set stream ID. SRT does not enforce
  24008. any special interpretation of the contents of this string.
  24009. This option doesn’t make sense in Rendezvous connection; the result
  24010. might be that simply one side will override the value from the other
  24011. side and it’s the matter of luck which one would win
  24012. </p>
  24013. </dd>
  24014. <dt><samp class="option">srt_streamid=<var class="var">string</var></samp></dt>
  24015. <dd><p>Alias for &lsquo;<samp class="samp">streamid</samp>&rsquo; to avoid conflict with ffmpeg command line option.
  24016. </p>
  24017. </dd>
  24018. <dt><samp class="option">smoother=<var class="var">live|file</var></samp></dt>
  24019. <dd><p>The type of Smoother used for the transmission for that socket, which
  24020. is responsible for the transmission and congestion control. The Smoother
  24021. type must be exactly the same on both connecting parties, otherwise
  24022. the connection is rejected.
  24023. </p>
  24024. </dd>
  24025. <dt><samp class="option">messageapi=<var class="var">1|0</var></samp></dt>
  24026. <dd><p>When set, this socket uses the Message API, otherwise it uses Buffer
  24027. API. Note that in live mode (see <samp class="option">transtype</samp>) there’s only
  24028. message API available. In File mode you can chose to use one of two modes:
  24029. </p>
  24030. <p>Stream API (default, when this option is false). In this mode you may
  24031. send as many data as you wish with one sending instruction, or even use
  24032. dedicated functions that read directly from a file. The internal facility
  24033. will take care of any speed and congestion control. When receiving, you
  24034. can also receive as many data as desired, the data not extracted will be
  24035. waiting for the next call. There is no boundary between data portions in
  24036. the Stream mode.
  24037. </p>
  24038. <p>Message API. In this mode your single sending instruction passes exactly
  24039. one piece of data that has boundaries (a message). Contrary to Live mode,
  24040. this message may span across multiple UDP packets and the only size
  24041. limitation is that it shall fit as a whole in the sending buffer. The
  24042. receiver shall use as large buffer as necessary to receive the message,
  24043. otherwise the message will not be given up. When the message is not
  24044. complete (not all packets received or there was a packet loss) it will
  24045. not be given up.
  24046. </p>
  24047. </dd>
  24048. <dt><samp class="option">transtype=<var class="var">live|file</var></samp></dt>
  24049. <dd><p>Sets the transmission type for the socket, in particular, setting this
  24050. option sets multiple other parameters to their default values as required
  24051. for a particular transmission type.
  24052. </p>
  24053. <p>live: Set options as for live transmission. In this mode, you should
  24054. send by one sending instruction only so many data that fit in one UDP packet,
  24055. and limited to the value defined first in <samp class="option">payload_size</samp> (1316 is
  24056. default in this mode). There is no speed control in this mode, only the
  24057. bandwidth control, if configured, in order to not exceed the bandwidth with
  24058. the overhead transmission (retransmitted and control packets).
  24059. </p>
  24060. <p>file: Set options as for non-live transmission. See <samp class="option">messageapi</samp>
  24061. for further explanations
  24062. </p>
  24063. </dd>
  24064. <dt><samp class="option">linger=<var class="var">seconds</var></samp></dt>
  24065. <dd><p>The number of seconds that the socket waits for unsent data when closing.
  24066. Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
  24067. seconds in file mode). The range for this option is integers in the
  24068. 0 - <code class="code">INT_MAX</code>.
  24069. </p>
  24070. </dd>
  24071. <dt><samp class="option">tsbpd=<var class="var">1|0</var></samp></dt>
  24072. <dd><p>When true, use Timestamp-based Packet Delivery mode. The default behavior
  24073. depends on the transmission type: enabled in live mode, disabled in file
  24074. mode.
  24075. </p>
  24076. </dd>
  24077. </dl>
  24078. <p>For more information see: <a class="url" href="https://github.com/Haivision/srt">https://github.com/Haivision/srt</a>.
  24079. </p>
  24080. <a name="srtp"></a>
  24081. <h3 class="section">24.38 srtp<span class="pull-right"><a class="anchor hidden-xs" href="#srtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srtp" aria-hidden="true">TOC</a></span></h3>
  24082. <p>Secure Real-time Transport Protocol.
  24083. </p>
  24084. <p>The accepted options are:
  24085. </p><dl class="table">
  24086. <dt><samp class="option">srtp_in_suite</samp></dt>
  24087. <dt><samp class="option">srtp_out_suite</samp></dt>
  24088. <dd><p>Select input and output encoding suites.
  24089. </p>
  24090. <p>Supported values:
  24091. </p><dl class="table">
  24092. <dt>&lsquo;<samp class="samp">AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
  24093. <dt>&lsquo;<samp class="samp">SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
  24094. <dt>&lsquo;<samp class="samp">AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
  24095. <dt>&lsquo;<samp class="samp">SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
  24096. </dl>
  24097. </dd>
  24098. <dt><samp class="option">srtp_in_params</samp></dt>
  24099. <dt><samp class="option">srtp_out_params</samp></dt>
  24100. <dd><p>Set input and output encoding parameters, which are expressed by a
  24101. base64-encoded representation of a binary block. The first 16 bytes of
  24102. this binary block are used as master key, the following 14 bytes are
  24103. used as master salt.
  24104. </p></dd>
  24105. </dl>
  24106. <a name="subfile"></a>
  24107. <h3 class="section">24.39 subfile<span class="pull-right"><a class="anchor hidden-xs" href="#subfile" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subfile" aria-hidden="true">TOC</a></span></h3>
  24108. <p>Virtually extract a segment of a file or another stream.
  24109. The underlying stream must be seekable.
  24110. </p>
  24111. <p>Accepted options:
  24112. </p><dl class="table">
  24113. <dt><samp class="option">start</samp></dt>
  24114. <dd><p>Start offset of the extracted segment, in bytes.
  24115. </p></dd>
  24116. <dt><samp class="option">end</samp></dt>
  24117. <dd><p>End offset of the extracted segment, in bytes.
  24118. If set to 0, extract till end of file.
  24119. </p></dd>
  24120. </dl>
  24121. <p>Examples:
  24122. </p>
  24123. <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
  24124. externally and multiplied by 2048):
  24125. </p><div class="example">
  24126. <pre class="example-preformatted">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  24127. </pre></div>
  24128. <p>Play an AVI file directly from a TAR archive:
  24129. </p><div class="example">
  24130. <pre class="example-preformatted">subfile,,start,183241728,end,366490624,,:archive.tar
  24131. </pre></div>
  24132. <p>Play a MPEG-TS file from start offset till end:
  24133. </p><div class="example">
  24134. <pre class="example-preformatted">subfile,,start,32815239,end,0,,:video.ts
  24135. </pre></div>
  24136. <a name="tee-2"></a>
  24137. <h3 class="section">24.40 tee<span class="pull-right"><a class="anchor hidden-xs" href="#tee-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tee-2" aria-hidden="true">TOC</a></span></h3>
  24138. <p>Writes the output to multiple protocols. The individual outputs are separated
  24139. by |
  24140. </p>
  24141. <div class="example">
  24142. <pre class="example-preformatted">tee:file://path/to/local/this.avi|file://path/to/local/that.avi
  24143. </pre></div>
  24144. <a name="tcp"></a>
  24145. <h3 class="section">24.41 tcp<span class="pull-right"><a class="anchor hidden-xs" href="#tcp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tcp" aria-hidden="true">TOC</a></span></h3>
  24146. <p>Transmission Control Protocol.
  24147. </p>
  24148. <p>The required syntax for a TCP url is:
  24149. </p><div class="example">
  24150. <pre class="example-preformatted">tcp://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  24151. </pre></div>
  24152. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  24153. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  24154. space) can be used to escape keys and values.
  24155. </p>
  24156. <p>Options can also can be specified via command line options (or in code via
  24157. <code class="code">AVOption</code>s).
  24158. </p>
  24159. <p>The list of supported options follows.
  24160. </p>
  24161. <dl class="table">
  24162. <dt><samp class="option">listen=<var class="var">2|1|0</var></samp></dt>
  24163. <dd><p>Listen for an incoming connection. 0 disables listen, 1 enables listen in
  24164. single client mode, 2 enables listen in multi-client mode. Default value is 0.
  24165. </p>
  24166. </dd>
  24167. <dt><samp class="option">local_addr=<var class="var">addr</var></samp></dt>
  24168. <dd><p>Local IP address of a network interface used for tcp socket connect.
  24169. </p>
  24170. </dd>
  24171. <dt><samp class="option">local_port=<var class="var">port</var></samp></dt>
  24172. <dd><p>Local port used for tcp socket connect.
  24173. </p>
  24174. </dd>
  24175. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  24176. <dd><p>Set raise error timeout, expressed in microseconds.
  24177. </p>
  24178. <p>This option is only relevant in read mode: if no data arrived in more
  24179. than this time interval, raise error.
  24180. </p>
  24181. </dd>
  24182. <dt><samp class="option">listen_timeout=<var class="var">milliseconds</var></samp></dt>
  24183. <dd><p>Set listen timeout, expressed in milliseconds.
  24184. </p>
  24185. </dd>
  24186. <dt><samp class="option">recv_buffer_size=<var class="var">bytes</var></samp></dt>
  24187. <dd><p>Set receive buffer size, expressed bytes.
  24188. </p>
  24189. </dd>
  24190. <dt><samp class="option">send_buffer_size=<var class="var">bytes</var></samp></dt>
  24191. <dd><p>Set send buffer size, expressed bytes.
  24192. </p>
  24193. </dd>
  24194. <dt><samp class="option">tcp_nodelay=<var class="var">1|0</var></samp></dt>
  24195. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  24196. </p>
  24197. <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>
  24198. </p>
  24199. </dd>
  24200. <dt><samp class="option">tcp_mss=<var class="var">bytes</var></samp></dt>
  24201. <dd><p>Set maximum segment size for outgoing TCP packets, expressed in bytes.
  24202. </p></dd>
  24203. </dl>
  24204. <p>The following example shows how to setup a listening TCP connection
  24205. with <code class="command">ffmpeg</code>, which is then accessed with <code class="command">ffplay</code>:
  24206. </p><div class="example">
  24207. <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
  24208. ffplay tcp://<var class="var">hostname</var>:<var class="var">port</var>
  24209. </pre></div>
  24210. <a name="tls"></a>
  24211. <h3 class="section">24.42 tls<span class="pull-right"><a class="anchor hidden-xs" href="#tls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tls" aria-hidden="true">TOC</a></span></h3>
  24212. <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  24213. </p>
  24214. <p>The required syntax for a TLS/SSL url is:
  24215. </p><div class="example">
  24216. <pre class="example-preformatted">tls://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  24217. </pre></div>
  24218. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  24219. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  24220. space) can be used to escape keys and values.
  24221. </p>
  24222. <p>Options can also can be specified via command line options (or in code via
  24223. <code class="code">AVOption</code>s).
  24224. </p>
  24225. <p>The list of supported options follows.
  24226. </p>
  24227. <dl class="table">
  24228. <dt><samp class="option">ca_file, cafile=<var class="var">filename</var></samp></dt>
  24229. <dd><p>A file containing certificate authority (CA) root certificates to treat
  24230. as trusted. If the linked TLS library contains a default this might not
  24231. need to be specified for verification to work, but not all libraries and
  24232. setups have defaults built in.
  24233. The file must be in OpenSSL PEM format.
  24234. </p>
  24235. </dd>
  24236. <dt><samp class="option">tls_verify, verify=<var class="var">1|0</var></samp></dt>
  24237. <dd><p>If enabled, try to verify the peer that we are communicating with.
  24238. Note, if using OpenSSL, this currently only makes sure that the
  24239. peer certificate is signed by one of the root certificates in the CA
  24240. database, but it does not validate that the certificate actually
  24241. matches the host name we are trying to connect to. (With other backends,
  24242. the host name is validated as well.)
  24243. </p>
  24244. <p>This is disabled by default since it requires a CA database to be
  24245. provided by the caller in many cases.
  24246. </p>
  24247. </dd>
  24248. <dt><samp class="option">cert_file, cert=<var class="var">filename</var></samp></dt>
  24249. <dd><p>A file containing a certificate to use in the handshake with the peer.
  24250. (When operating as server, in listen mode, this is more often required
  24251. by the peer, while client certificates only are mandated in certain
  24252. setups.)
  24253. </p>
  24254. </dd>
  24255. <dt><samp class="option">key_file, key=<var class="var">filename</var></samp></dt>
  24256. <dd><p>A file containing the private key for the certificate.
  24257. </p>
  24258. </dd>
  24259. <dt><samp class="option">listen=<var class="var">1|0</var></samp></dt>
  24260. <dd><p>If enabled, listen for connections on the provided port, and assume
  24261. the server role in the handshake instead of the client role.
  24262. </p>
  24263. </dd>
  24264. <dt><samp class="option">http_proxy</samp></dt>
  24265. <dd><p>The HTTP proxy to tunnel through, e.g. <code class="code">http://example.com:1234</code>.
  24266. The proxy must support the CONNECT method.
  24267. </p>
  24268. </dd>
  24269. </dl>
  24270. <p>Example command lines:
  24271. </p>
  24272. <p>To create a TLS/SSL server that serves an input stream.
  24273. </p>
  24274. <div class="example">
  24275. <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>
  24276. </pre></div>
  24277. <p>To play back a stream from the TLS/SSL server using <code class="command">ffplay</code>:
  24278. </p>
  24279. <div class="example">
  24280. <pre class="example-preformatted">ffplay tls://<var class="var">hostname</var>:<var class="var">port</var>
  24281. </pre></div>
  24282. <a name="dtls"></a>
  24283. <h3 class="section">24.43 dtls<span class="pull-right"><a class="anchor hidden-xs" href="#dtls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dtls" aria-hidden="true">TOC</a></span></h3>
  24284. <p>Datagram Transport Layer Security (DTLS)
  24285. </p>
  24286. <p>The required syntax for a DTLS URL is:
  24287. </p><div class="example">
  24288. <pre class="example-preformatted">dtls://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  24289. </pre></div>
  24290. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  24291. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  24292. space) can be used to escape keys and values.
  24293. </p>
  24294. <p>Options can also can be specified via command line options (or in code via
  24295. <code class="code">AVOption</code>s).
  24296. </p>
  24297. <p>DTLS shares most options with TLS, but operates over UDP instead of TCP.
  24298. </p>
  24299. <p>The list of supported options follows.
  24300. </p>
  24301. <dl class="table">
  24302. <dt><samp class="option">ca_file, cafile=<var class="var">filename</var></samp></dt>
  24303. <dd><p>A file containing certificate authority (CA) root certificates to treat
  24304. as trusted. If the linked TLS library contains a default this might not
  24305. need to be specified for verification to work, but not all libraries and
  24306. setups have defaults built in.
  24307. The file must be in OpenSSL PEM format.
  24308. </p>
  24309. </dd>
  24310. <dt><samp class="option">tls_verify, verify=<var class="var">1|0</var></samp></dt>
  24311. <dd><p>If enabled, try to verify the peer that we are communicating with.
  24312. Note, if using OpenSSL, this currently only makes sure that the
  24313. peer certificate is signed by one of the root certificates in the CA
  24314. database, but it does not validate that the certificate actually
  24315. matches the host name we are trying to connect to.
  24316. </p>
  24317. <p>This is disabled by default since it requires a CA database to be
  24318. provided by the caller in many cases.
  24319. </p>
  24320. </dd>
  24321. <dt><samp class="option">cert_file, cert=<var class="var">filename</var></samp></dt>
  24322. <dd><p>A file containing a certificate to use in the handshake with the peer.
  24323. (When operating as server, in listen mode, this is more often required
  24324. by the peer, while client certificates only are mandated in certain
  24325. setups.)
  24326. </p>
  24327. </dd>
  24328. <dt><samp class="option">key_file, key=<var class="var">filename</var></samp></dt>
  24329. <dd><p>A file containing the private key for the certificate.
  24330. </p>
  24331. </dd>
  24332. <dt><samp class="option">cert_pem=<var class="var">string</var></samp></dt>
  24333. <dd><p>Certificate PEM string
  24334. </p>
  24335. </dd>
  24336. <dt><samp class="option">key_pem=<var class="var">string</var></samp></dt>
  24337. <dd><p>Private key PEM string
  24338. </p>
  24339. </dd>
  24340. <dt><samp class="option">listen=<var class="var">1|0</var></samp></dt>
  24341. <dd><p>If enabled, listen for connections on the provided port, and assume
  24342. the server role in the handshake instead of the client role.
  24343. </p>
  24344. </dd>
  24345. <dt><samp class="option">mtu=<var class="var">size</var></samp></dt>
  24346. <dd><p>Set the Maximum Transmission Unit (MTU) for DTLS packets.
  24347. </p>
  24348. </dd>
  24349. <dt><samp class="option">use_srtp=<var class="var">1|0</var></samp></dt>
  24350. <dd><p>Enable the use_srtp DTLS extension.
  24351. This is used in WebRTC applications to establish SRTP encryption keys
  24352. through the DTLS handshake. Default is disabled.
  24353. </p>
  24354. </dd>
  24355. <dt><samp class="option">external_sock=<var class="var">1|0</var></samp></dt>
  24356. <dd><p>Use an external socket instead of creating a new one.
  24357. This option only makes sense to pass when interacting with the code via
  24358. API, enabling this from CLI will cause immediate failure.
  24359. Default is disabled.
  24360. </p>
  24361. </dd>
  24362. </dl>
  24363. <p>Example command lines:
  24364. </p>
  24365. <p>To create a DTLS server:
  24366. </p>
  24367. <div class="example">
  24368. <pre class="example-preformatted">ffmpeg -listen 1 -i dtls://<var class="var">hostname</var>:<var class="var">port</var> <var class="var">output</var>
  24369. </pre></div>
  24370. <p>To create a DTLS client and send data to server:
  24371. </p>
  24372. <div class="example">
  24373. <pre class="example-preformatted">ffmpeg -i <var class="var">input</var> -f <var class="var">format</var> dtls://<var class="var">hostname</var>:<var class="var">port</var>
  24374. </pre></div>
  24375. <a name="udp"></a>
  24376. <h3 class="section">24.44 udp<span class="pull-right"><a class="anchor hidden-xs" href="#udp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-udp" aria-hidden="true">TOC</a></span></h3>
  24377. <p>User Datagram Protocol.
  24378. </p>
  24379. <p>The required syntax for an UDP URL is:
  24380. </p><div class="example">
  24381. <pre class="example-preformatted">udp://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  24382. </pre></div>
  24383. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  24384. <var class="var">key</var>=<var class="var">val</var>. Standard percent-encoding (and using the plus sign for
  24385. space) can be used to escape keys and values.
  24386. </p>
  24387. <p>Options can also can be specified via command line options (or in code via
  24388. <code class="code">AVOption</code>s).
  24389. </p>
  24390. <p>In case threading is enabled on the system, a circular buffer is used
  24391. to store the incoming data, which allows one to reduce loss of data due to
  24392. UDP socket buffer overruns. The <var class="var">fifo_size</var> and
  24393. <var class="var">overrun_nonfatal</var> options are related to this buffer.
  24394. </p>
  24395. <p>The list of supported options follows.
  24396. </p>
  24397. <dl class="table">
  24398. <dt><samp class="option">buffer_size=<var class="var">size</var></samp></dt>
  24399. <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
  24400. the receive or send buffer size, depending on what the socket is used for.
  24401. Default is 32 KB for output, 384 KB for input. See also <var class="var">fifo_size</var>.
  24402. </p>
  24403. </dd>
  24404. <dt><samp class="option">bitrate=<var class="var">bitrate</var></samp></dt>
  24405. <dd><p>If set to nonzero, the output will have the specified constant bitrate if the
  24406. input has enough packets to sustain it.
  24407. </p>
  24408. </dd>
  24409. <dt><samp class="option">burst_bits=<var class="var">bits</var></samp></dt>
  24410. <dd><p>When using <var class="var">bitrate</var> this specifies the maximum number of bits in
  24411. packet bursts.
  24412. </p>
  24413. </dd>
  24414. <dt><samp class="option">localport=<var class="var">port</var></samp></dt>
  24415. <dd><p>Override the local UDP port to bind with.
  24416. </p>
  24417. </dd>
  24418. <dt><samp class="option">localaddr=<var class="var">addr</var></samp></dt>
  24419. <dd><p>Local IP address of a network interface used for sending packets or joining
  24420. multicast groups.
  24421. </p>
  24422. </dd>
  24423. <dt><samp class="option">pkt_size=<var class="var">size</var></samp></dt>
  24424. <dd><p>Set the size in bytes of UDP packets.
  24425. </p>
  24426. </dd>
  24427. <dt><samp class="option">reuse=<var class="var">1|0</var></samp></dt>
  24428. <dd><p>Explicitly allow or disallow reusing UDP sockets.
  24429. </p>
  24430. </dd>
  24431. <dt><samp class="option">ttl=<var class="var">ttl</var></samp></dt>
  24432. <dd><p>Set the time to live value (for multicast only).
  24433. </p>
  24434. </dd>
  24435. <dt><samp class="option">dscp=<var class="var">dscp</var></samp></dt>
  24436. <dd><p>Set the 6-bit DSCP field for outgoing packets.
  24437. </p>
  24438. </dd>
  24439. <dt><samp class="option">connect=<var class="var">1|0</var></samp></dt>
  24440. <dd><p>Initialize the UDP socket with <code class="code">connect()</code>. In this case, the
  24441. destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
  24442. If the destination address isn&rsquo;t known at the start, this option can
  24443. be specified in ff_udp_set_remote_url, too.
  24444. This allows finding out the source address for the packets with getsockname,
  24445. and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
  24446. unreachable&quot; is received.
  24447. For receiving, this gives the benefit of only receiving packets from
  24448. the specified peer address/port.
  24449. </p>
  24450. </dd>
  24451. <dt><samp class="option">sources=<var class="var">address</var>[,<var class="var">address</var>]</samp></dt>
  24452. <dd><p>Only receive packets sent from the specified addresses. In case of multicast,
  24453. also subscribe to multicast traffic coming from these addresses only.
  24454. </p>
  24455. </dd>
  24456. <dt><samp class="option">block=<var class="var">address</var>[,<var class="var">address</var>]</samp></dt>
  24457. <dd><p>Ignore packets sent from the specified addresses. In case of multicast, also
  24458. exclude the source addresses in the multicast subscription.
  24459. </p>
  24460. </dd>
  24461. <dt><samp class="option">fifo_size=<var class="var">units</var></samp></dt>
  24462. <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
  24463. packets with size of 188 bytes. If not specified defaults to 7*4096.
  24464. </p>
  24465. </dd>
  24466. <dt><samp class="option">overrun_nonfatal=<var class="var">1|0</var></samp></dt>
  24467. <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
  24468. value is 0.
  24469. </p>
  24470. </dd>
  24471. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  24472. <dd><p>Set raise error timeout, expressed in microseconds.
  24473. </p>
  24474. <p>This option is only relevant in read mode: if no data arrived in more
  24475. than this time interval, raise error.
  24476. </p>
  24477. </dd>
  24478. <dt><samp class="option">broadcast=<var class="var">1|0</var></samp></dt>
  24479. <dd><p>Explicitly allow or disallow UDP broadcasting.
  24480. </p>
  24481. <p>Note that broadcasting may not work properly on networks having
  24482. a broadcast storm protection.
  24483. </p></dd>
  24484. </dl>
  24485. <a name="Examples-29"></a>
  24486. <h4 class="subsection">24.44.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-29" aria-hidden="true">TOC</a></span></h4>
  24487. <ul class="itemize mark-bullet">
  24488. <li>Use <code class="command">ffmpeg</code> to stream over UDP to a remote endpoint:
  24489. <div class="example">
  24490. <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>
  24491. </pre></div>
  24492. </li><li>Use <code class="command">ffmpeg</code> to stream in mpegts format over UDP using 188
  24493. sized UDP packets, using a large input buffer:
  24494. <div class="example">
  24495. <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
  24496. </pre></div>
  24497. </li><li>Use <code class="command">ffmpeg</code> to receive over UDP from a remote endpoint:
  24498. <div class="example">
  24499. <pre class="example-preformatted">ffmpeg -i udp://[<var class="var">multicast-address</var>]:<var class="var">port</var> ...
  24500. </pre></div>
  24501. </li></ul>
  24502. <a name="unix"></a>
  24503. <h3 class="section">24.45 unix<span class="pull-right"><a class="anchor hidden-xs" href="#unix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unix" aria-hidden="true">TOC</a></span></h3>
  24504. <p>Unix local socket
  24505. </p>
  24506. <p>The required syntax for a Unix socket URL is:
  24507. </p>
  24508. <div class="example">
  24509. <pre class="example-preformatted">unix://<var class="var">filepath</var>
  24510. </pre></div>
  24511. <p>The following parameters can be set via command line options
  24512. (or in code via <code class="code">AVOption</code>s):
  24513. </p>
  24514. <dl class="table">
  24515. <dt><samp class="option">timeout</samp></dt>
  24516. <dd><p>Timeout in ms.
  24517. </p></dd>
  24518. <dt><samp class="option">listen</samp></dt>
  24519. <dd><p>Create the Unix socket in listening mode.
  24520. </p></dd>
  24521. <dt><samp class="option">pkt_size</samp></dt>
  24522. <dd><p>Maximum packet size for packet-oriented sockets (SOCK_DGRAM and
  24523. SOCK_SEQPACKET). If greater than zero, this value is used as
  24524. <code class="code">max_packet_size</code>. Ignored for SOCK_STREAM. Default is <code class="code">0</code>.
  24525. </p></dd>
  24526. </dl>
  24527. <a name="zmq"></a>
  24528. <h3 class="section">24.46 zmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq" aria-hidden="true">TOC</a></span></h3>
  24529. <p>ZeroMQ asynchronous messaging using the libzmq library.
  24530. </p>
  24531. <p>This library supports unicast streaming to multiple clients without relying on
  24532. an external server.
  24533. </p>
  24534. <p>The required syntax for streaming or connecting to a stream is:
  24535. </p><div class="example">
  24536. <pre class="example-preformatted">zmq:tcp://ip-address:port
  24537. </pre></div>
  24538. <p>Example:
  24539. Create a localhost stream on port 5555:
  24540. </p><div class="example">
  24541. <pre class="example-preformatted">ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
  24542. </pre></div>
  24543. <p>Multiple clients may connect to the stream using:
  24544. </p><div class="example">
  24545. <pre class="example-preformatted">ffplay zmq:tcp://127.0.0.1:5555
  24546. </pre></div>
  24547. <p>Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
  24548. The server side binds to a port and publishes data. Clients connect to the
  24549. server (via IP address/port) and subscribe to the stream. The order in which
  24550. the server and client start generally does not matter.
  24551. </p>
  24552. <p>ffmpeg must be compiled with the &ndash;enable-libzmq option to support
  24553. this protocol.
  24554. </p>
  24555. <p>Options can be set on the <code class="command">ffmpeg</code>/<code class="command">ffplay</code> command
  24556. line. The following options are supported:
  24557. </p>
  24558. <dl class="table">
  24559. <dt><samp class="option">pkt_size</samp></dt>
  24560. <dd><p>Forces the maximum packet size for sending/receiving data. The default value is
  24561. 131,072 bytes. On the server side, this sets the maximum size of sent packets
  24562. via ZeroMQ. On the clients, it sets an internal buffer size for receiving
  24563. packets. Note that pkt_size on the clients should be equal to or greater than
  24564. pkt_size on the server. Otherwise the received message may be truncated causing
  24565. decoding errors.
  24566. </p>
  24567. </dd>
  24568. </dl>
  24569. <a name="Device-Options"></a>
  24570. <h2 class="chapter">25 Device Options<span class="pull-right"><a class="anchor hidden-xs" href="#Device-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Device-Options" aria-hidden="true">TOC</a></span></h2>
  24571. <p>The libavdevice library provides the same interface as
  24572. libavformat. Namely, an input device is considered like a demuxer, and
  24573. an output device like a muxer, and the interface and generic device
  24574. options are the same provided by libavformat (see the ffmpeg-formats
  24575. manual).
  24576. </p>
  24577. <p>In addition each input or output device may support so-called private
  24578. options, which are specific for that component.
  24579. </p>
  24580. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  24581. FFmpeg tools, or by setting the value explicitly in the device
  24582. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  24583. for programmatic use.
  24584. </p>
  24585. <a name="Input-Devices"></a>
  24586. <h2 class="chapter">26 Input Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input-Devices" aria-hidden="true">TOC</a></span></h2>
  24587. <p>Input devices are configured elements in FFmpeg which enable accessing
  24588. the data coming from a multimedia device attached to your system.
  24589. </p>
  24590. <p>When you configure your FFmpeg build, all the supported input devices
  24591. are enabled by default. You can list all available ones using the
  24592. configure option &quot;&ndash;list-indevs&quot;.
  24593. </p>
  24594. <p>You can disable all the input devices using the configure option
  24595. &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
  24596. option &quot;&ndash;enable-indev=<var class="var">INDEV</var>&quot;, or you can disable a particular
  24597. input device using the option &quot;&ndash;disable-indev=<var class="var">INDEV</var>&quot;.
  24598. </p>
  24599. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  24600. supported input devices.
  24601. </p>
  24602. <p>A description of the currently available input devices follows.
  24603. </p>
  24604. <a name="alsa"></a>
  24605. <h3 class="section">26.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa" aria-hidden="true">TOC</a></span></h3>
  24606. <p>ALSA (Advanced Linux Sound Architecture) input device.
  24607. </p>
  24608. <p>To enable this input device during configuration you need libasound
  24609. installed on your system.
  24610. </p>
  24611. <p>This device allows capturing from an ALSA device. The name of the
  24612. device to capture has to be an ALSA card identifier.
  24613. </p>
  24614. <p>An ALSA identifier has the syntax:
  24615. </p><div class="example">
  24616. <pre class="example-preformatted">hw:<var class="var">CARD</var>[,<var class="var">DEV</var>[,<var class="var">SUBDEV</var>]]
  24617. </pre></div>
  24618. <p>where the <var class="var">DEV</var> and <var class="var">SUBDEV</var> components are optional.
  24619. </p>
  24620. <p>The three arguments (in order: <var class="var">CARD</var>,<var class="var">DEV</var>,<var class="var">SUBDEV</var>)
  24621. specify card number or identifier, device number and subdevice number
  24622. (-1 means any).
  24623. </p>
  24624. <p>To see the list of cards currently recognized by your system check the
  24625. files <samp class="file">/proc/asound/cards</samp> and <samp class="file">/proc/asound/devices</samp>.
  24626. </p>
  24627. <p>For example to capture with <code class="command">ffmpeg</code> from an ALSA device with
  24628. card id 0, you may run the command:
  24629. </p><div class="example">
  24630. <pre class="example-preformatted">ffmpeg -f alsa -i hw:0 alsaout.wav
  24631. </pre></div>
  24632. <p>For more information see:
  24633. <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>
  24634. </p>
  24635. <a name="Options-94"></a>
  24636. <h4 class="subsection">26.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-94" aria-hidden="true">TOC</a></span></h4>
  24637. <dl class="table">
  24638. <dt><samp class="option">sample_rate</samp></dt>
  24639. <dd><p>Set the sample rate in Hz. Default is 48000.
  24640. </p>
  24641. </dd>
  24642. <dt><samp class="option">channels</samp></dt>
  24643. <dd><p>Set the number of channels. Default is 2.
  24644. </p>
  24645. </dd>
  24646. </dl>
  24647. <a name="android_005fcamera"></a>
  24648. <h3 class="section">26.2 android_camera<span class="pull-right"><a class="anchor hidden-xs" href="#android_005fcamera" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-android_005fcamera" aria-hidden="true">TOC</a></span></h3>
  24649. <p>Android camera input device.
  24650. </p>
  24651. <p>This input devices uses the Android Camera2 NDK API which is
  24652. available on devices with API level 24+. The availability of
  24653. android_camera is autodetected during configuration.
  24654. </p>
  24655. <p>This device allows capturing from all cameras on an Android device,
  24656. which are integrated into the Camera2 NDK API.
  24657. </p>
  24658. <p>The available cameras are enumerated internally and can be selected
  24659. with the <var class="var">camera_index</var> parameter. The input file string is
  24660. discarded.
  24661. </p>
  24662. <p>Generally the back facing camera has index 0 while the front facing
  24663. camera has index 1.
  24664. </p>
  24665. <a name="Options-95"></a>
  24666. <h4 class="subsection">26.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-95" aria-hidden="true">TOC</a></span></h4>
  24667. <dl class="table">
  24668. <dt><samp class="option">video_size</samp></dt>
  24669. <dd><p>Set the video size given as a string such as 640x480 or hd720.
  24670. Falls back to the first available configuration reported by
  24671. Android if requested video size is not available or by default.
  24672. </p>
  24673. </dd>
  24674. <dt><samp class="option">framerate</samp></dt>
  24675. <dd><p>Set the video framerate.
  24676. Falls back to the first available configuration reported by
  24677. Android if requested framerate is not available or by default (-1).
  24678. </p>
  24679. </dd>
  24680. <dt><samp class="option">camera_index</samp></dt>
  24681. <dd><p>Set the index of the camera to use. Default is 0.
  24682. </p>
  24683. </dd>
  24684. <dt><samp class="option">input_queue_size</samp></dt>
  24685. <dd><p>Set the maximum number of frames to buffer. Default is 5.
  24686. </p>
  24687. </dd>
  24688. </dl>
  24689. <a name="avfoundation"></a>
  24690. <h3 class="section">26.3 avfoundation<span class="pull-right"><a class="anchor hidden-xs" href="#avfoundation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avfoundation" aria-hidden="true">TOC</a></span></h3>
  24691. <p>AVFoundation input device.
  24692. </p>
  24693. <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
  24694. </p>
  24695. <p>The input filename has to be given in the following syntax:
  24696. </p><div class="example">
  24697. <pre class="example-preformatted">-i &quot;[[VIDEO]:[AUDIO]]&quot;
  24698. </pre></div>
  24699. <p>The first entry selects the video input while the latter selects the audio input.
  24700. The stream has to be specified by the device name or the device index as shown by the device list.
  24701. Alternatively, the video and/or audio input device can be chosen by index using the
  24702. <samp class="option">
  24703. -video_device_index &lt;INDEX&gt;
  24704. </samp>
  24705. and/or
  24706. <samp class="option">
  24707. -audio_device_index &lt;INDEX&gt;
  24708. </samp>
  24709. , overriding any
  24710. device name or index given in the input filename.
  24711. </p>
  24712. <p>All available devices can be enumerated by using <samp class="option">-list_devices true</samp>, listing
  24713. all device names and corresponding indices.
  24714. </p>
  24715. <p>There are two device name aliases:
  24716. </p><dl class="table">
  24717. <dt><code class="code">default</code></dt>
  24718. <dd><p>Select the AVFoundation default device of the corresponding type.
  24719. </p>
  24720. </dd>
  24721. <dt><code class="code">none</code></dt>
  24722. <dd><p>Do not record the corresponding media type.
  24723. This is equivalent to specifying an empty device name or index.
  24724. </p>
  24725. </dd>
  24726. </dl>
  24727. <a name="Options-96"></a>
  24728. <h4 class="subsection">26.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-96" aria-hidden="true">TOC</a></span></h4>
  24729. <p>AVFoundation supports the following options:
  24730. </p>
  24731. <dl class="table">
  24732. <dt><samp class="option">-list_devices &lt;TRUE|FALSE&gt;</samp></dt>
  24733. <dd><p>If set to true, a list of all available input devices is given showing all
  24734. device names and indices.
  24735. </p>
  24736. </dd>
  24737. <dt><samp class="option">-video_device_index &lt;INDEX&gt;</samp></dt>
  24738. <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
  24739. </p>
  24740. </dd>
  24741. <dt><samp class="option">-audio_device_index &lt;INDEX&gt;</samp></dt>
  24742. <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
  24743. </p>
  24744. </dd>
  24745. <dt><samp class="option">-pixel_format &lt;FORMAT&gt;</samp></dt>
  24746. <dd><p>Request the video device to use a specific pixel format.
  24747. If the specified format is not supported, a list of available formats is given
  24748. and the first one in this list is used instead. Available pixel formats are:
  24749. <code class="code">monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
  24750. bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
  24751. yuv420p, nv12, yuyv422, gray</code>
  24752. </p>
  24753. </dd>
  24754. <dt><samp class="option">-framerate</samp></dt>
  24755. <dd><p>Set the grabbing frame rate. Default is <code class="code">ntsc</code>, corresponding to a
  24756. frame rate of <code class="code">30000/1001</code>.
  24757. </p>
  24758. </dd>
  24759. <dt><samp class="option">-video_size</samp></dt>
  24760. <dd><p>Set the video frame size.
  24761. </p>
  24762. </dd>
  24763. <dt><samp class="option">-capture_cursor</samp></dt>
  24764. <dd><p>Capture the mouse pointer. Default is 0.
  24765. </p>
  24766. </dd>
  24767. <dt><samp class="option">-capture_mouse_clicks</samp></dt>
  24768. <dd><p>Capture the screen mouse clicks. Default is 0.
  24769. </p>
  24770. </dd>
  24771. <dt><samp class="option">-capture_raw_data</samp></dt>
  24772. <dd><p>Capture the raw device data. Default is 0.
  24773. 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.
  24774. </p></dd>
  24775. </dl>
  24776. <a name="Examples-30"></a>
  24777. <h4 class="subsection">26.3.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-30" aria-hidden="true">TOC</a></span></h4>
  24778. <ul class="itemize mark-bullet">
  24779. <li>Print the list of AVFoundation supported devices and exit:
  24780. <div class="example">
  24781. <pre class="example-preformatted">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
  24782. </pre></div>
  24783. </li><li>Record video from video device 0 and audio from audio device 0 into out.avi:
  24784. <div class="example">
  24785. <pre class="example-preformatted">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
  24786. </pre></div>
  24787. </li><li>Record video from video device 2 and audio from audio device 1 into out.avi:
  24788. <div class="example">
  24789. <pre class="example-preformatted">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
  24790. </pre></div>
  24791. </li><li>Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
  24792. <div class="example">
  24793. <pre class="example-preformatted">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
  24794. </pre></div>
  24795. </li><li>Record raw DV data from a suitable input device and write the output into out.dv:
  24796. <div class="example">
  24797. <pre class="example-preformatted">$ ffmpeg -f avfoundation -capture_raw_data true -i &quot;zr100:none&quot; out.dv
  24798. </pre></div>
  24799. </li></ul>
  24800. <a name="decklink"></a>
  24801. <h3 class="section">26.4 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink" aria-hidden="true">TOC</a></span></h3>
  24802. <p>The decklink input device provides capture capabilities for Blackmagic
  24803. DeckLink devices.
  24804. </p>
  24805. <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
  24806. need to configure with the appropriate <code class="code">--extra-cflags</code>
  24807. and <code class="code">--extra-ldflags</code>.
  24808. On Windows, you need to run the IDL files through <code class="command">widl</code>.
  24809. </p>
  24810. <p>DeckLink is very picky about the formats it supports. Pixel format of the
  24811. input can be set with <samp class="option">raw_format</samp>.
  24812. Framerate and video size must be determined for your device with
  24813. <code class="command">-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
  24814. of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
  24815. audio track.
  24816. </p>
  24817. <a name="Options-97"></a>
  24818. <h4 class="subsection">26.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-97" aria-hidden="true">TOC</a></span></h4>
  24819. <dl class="table">
  24820. <dt><samp class="option">list_devices</samp></dt>
  24821. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  24822. Defaults to <samp class="option">false</samp>. This option is deprecated, please use the
  24823. <code class="code">-sources</code> option of ffmpeg to list the available input devices.
  24824. </p>
  24825. </dd>
  24826. <dt><samp class="option">list_formats</samp></dt>
  24827. <dd><p>If set to <samp class="option">true</samp>, print a list of supported formats and exit.
  24828. Defaults to <samp class="option">false</samp>.
  24829. </p>
  24830. </dd>
  24831. <dt><samp class="option">format_code &lt;FourCC&gt;</samp></dt>
  24832. <dd><p>This sets the input video format to the format given by the FourCC. To see
  24833. the supported values of your device(s) use <samp class="option">list_formats</samp>.
  24834. Note that there is a FourCC <samp class="option">'pal '</samp> that can also be used
  24835. as <samp class="option">pal</samp> (3 letters).
  24836. Default behavior is autodetection of the input video format, if the hardware
  24837. supports it.
  24838. </p>
  24839. </dd>
  24840. <dt><samp class="option">raw_format</samp></dt>
  24841. <dd><p>Set the pixel format of the captured video.
  24842. Available values are:
  24843. </p><dl class="table">
  24844. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24845. <dd>
  24846. <p>This is the default which means 8-bit YUV 422 or 8-bit ARGB if format
  24847. autodetection is used, 8-bit YUV 422 otherwise.
  24848. </p>
  24849. </dd>
  24850. <dt>&lsquo;<samp class="samp">uyvy422</samp>&rsquo;</dt>
  24851. <dd>
  24852. <p>8-bit YUV 422.
  24853. </p>
  24854. </dd>
  24855. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  24856. <dd>
  24857. <p>10-bit YUV 422.
  24858. </p>
  24859. </dd>
  24860. <dt>&lsquo;<samp class="samp">argb</samp>&rsquo;</dt>
  24861. <dd>
  24862. <p>8-bit RGB.
  24863. </p>
  24864. </dd>
  24865. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  24866. <dd>
  24867. <p>8-bit RGB.
  24868. </p>
  24869. </dd>
  24870. <dt>&lsquo;<samp class="samp">rgb10</samp>&rsquo;</dt>
  24871. <dd>
  24872. <p>10-bit RGB.
  24873. </p>
  24874. </dd>
  24875. </dl>
  24876. </dd>
  24877. <dt><samp class="option">teletext_lines</samp></dt>
  24878. <dd><p>If set to nonzero, an additional teletext stream will be captured from the
  24879. vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p)
  24880. sources are supported. In case of HD sources, OP47 packets are decoded.
  24881. </p>
  24882. <p>This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6
  24883. to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines
  24884. which do not contain teletext information will be ignored. You can use the
  24885. special <samp class="option">all</samp> constant to select all possible lines, or
  24886. <samp class="option">standard</samp> to skip lines 6, 318 and 319, which are not compatible with
  24887. all receivers.
  24888. </p>
  24889. <p>For SD sources, ffmpeg needs to be compiled with <code class="code">--enable-libzvbi</code>. For
  24890. HD sources, on older (pre-4K) DeckLink card models you have to capture in 10
  24891. bit mode.
  24892. </p>
  24893. </dd>
  24894. <dt><samp class="option">channels</samp></dt>
  24895. <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;.
  24896. Defaults to &lsquo;<samp class="samp">2</samp>&rsquo;.
  24897. </p>
  24898. </dd>
  24899. <dt><samp class="option">duplex_mode</samp></dt>
  24900. <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;,
  24901. &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;,
  24902. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  24903. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  24904. </p>
  24905. <p>Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
  24906. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
  24907. sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
  24908. is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
  24909. </p>
  24910. <p>Valid profile modes for DeckLink 8K Pro(with DeckLink SDK &gt;= 11.0):
  24911. &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;,
  24912. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  24913. </p>
  24914. <p>Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
  24915. &lsquo;<samp class="samp">half</samp>&rsquo;, &lsquo;<samp class="samp">full</samp>&rsquo;
  24916. </p>
  24917. </dd>
  24918. <dt><samp class="option">timecode_format</samp></dt>
  24919. <dd><p>Timecode type to include in the frame and video stream metadata. Must be
  24920. &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;,
  24921. &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;.
  24922. Defaults to &lsquo;<samp class="samp">none</samp>&rsquo; (not included).
  24923. </p>
  24924. <p>In order to properly support 50/60 fps timecodes, the ordering of the queried
  24925. timecode types for &lsquo;<samp class="samp">rp188any</samp>&rsquo; is HFR, VITC1, VITC2 and LTC for &gt;30 fps
  24926. content. Note that this is slightly different to the ordering used by the
  24927. DeckLink API, which is HFR, VITC1, LTC, VITC2.
  24928. </p>
  24929. </dd>
  24930. <dt><samp class="option">video_input</samp></dt>
  24931. <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;,
  24932. &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;.
  24933. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  24934. </p>
  24935. </dd>
  24936. <dt><samp class="option">audio_input</samp></dt>
  24937. <dd><p>Sets the audio input source. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">embedded</samp>&rsquo;,
  24938. &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
  24939. &lsquo;<samp class="samp">microphone</samp>&rsquo;. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  24940. </p>
  24941. </dd>
  24942. <dt><samp class="option">video_pts</samp></dt>
  24943. <dd><p>Sets the video packet timestamp source. Must be &lsquo;<samp class="samp">video</samp>&rsquo;, &lsquo;<samp class="samp">audio</samp>&rsquo;,
  24944. &lsquo;<samp class="samp">reference</samp>&rsquo;, &lsquo;<samp class="samp">wallclock</samp>&rsquo; or &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  24945. Defaults to &lsquo;<samp class="samp">video</samp>&rsquo;.
  24946. </p>
  24947. </dd>
  24948. <dt><samp class="option">audio_pts</samp></dt>
  24949. <dd><p>Sets the audio packet timestamp source. Must be &lsquo;<samp class="samp">video</samp>&rsquo;, &lsquo;<samp class="samp">audio</samp>&rsquo;,
  24950. &lsquo;<samp class="samp">reference</samp>&rsquo;, &lsquo;<samp class="samp">wallclock</samp>&rsquo; or &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  24951. Defaults to &lsquo;<samp class="samp">audio</samp>&rsquo;.
  24952. </p>
  24953. </dd>
  24954. <dt><samp class="option">draw_bars</samp></dt>
  24955. <dd><p>If set to &lsquo;<samp class="samp">true</samp>&rsquo;, color bars are drawn in the event of a signal loss.
  24956. Defaults to &lsquo;<samp class="samp">true</samp>&rsquo;.
  24957. This option is deprecated, please use the <code class="code">signal_loss_action</code> option.
  24958. </p>
  24959. </dd>
  24960. <dt><samp class="option">signal_loss_action</samp></dt>
  24961. <dd><p>Sets the action to take in the event of a signal loss. Accepts one of the
  24962. following values:
  24963. </p>
  24964. <dl class="table">
  24965. <dt><samp class="option">1, none</samp></dt>
  24966. <dd><p>Do nothing on signal loss. This usually results in black frames.
  24967. </p></dd>
  24968. <dt><samp class="option">2, bars</samp></dt>
  24969. <dd><p>Draw color bars on signal loss. Only supported for 8-bit input signals.
  24970. </p></dd>
  24971. <dt><samp class="option">3, repeat</samp></dt>
  24972. <dd><p>Repeat the last video frame on signal loss.
  24973. </p></dd>
  24974. </dl>
  24975. <p>Defaults to &lsquo;<samp class="samp">bars</samp>&rsquo;.
  24976. </p>
  24977. </dd>
  24978. <dt><samp class="option">queue_size</samp></dt>
  24979. <dd><p>Sets maximum input buffer size in bytes. If the buffering reaches this value,
  24980. incoming frames will be dropped.
  24981. Defaults to &lsquo;<samp class="samp">1073741824</samp>&rsquo;.
  24982. </p>
  24983. </dd>
  24984. <dt><samp class="option">audio_depth</samp></dt>
  24985. <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;.
  24986. Defaults to &lsquo;<samp class="samp">16</samp>&rsquo;.
  24987. </p>
  24988. </dd>
  24989. <dt><samp class="option">decklink_copyts</samp></dt>
  24990. <dd><p>If set to <samp class="option">true</samp>, timestamps are forwarded as they are without removing
  24991. the initial offset.
  24992. Defaults to <samp class="option">false</samp>.
  24993. </p>
  24994. </dd>
  24995. <dt><samp class="option">timestamp_align</samp></dt>
  24996. <dd><p>Capture start time alignment in seconds. If set to nonzero, input frames are
  24997. dropped till the system timestamp aligns with configured value.
  24998. Alignment difference of up to one frame duration is tolerated.
  24999. This is useful for maintaining input synchronization across N different
  25000. hardware devices deployed for &rsquo;N-way&rsquo; redundancy. The system time of different
  25001. hardware devices should be synchronized with protocols such as NTP or PTP,
  25002. before using this option.
  25003. Note that this method is not foolproof. In some border cases input
  25004. synchronization may not happen due to thread scheduling jitters in the OS.
  25005. Either sync could go wrong by 1 frame or in a rarer case
  25006. <samp class="option">timestamp_align</samp> seconds.
  25007. Defaults to &lsquo;<samp class="samp">0</samp>&rsquo;.
  25008. </p>
  25009. </dd>
  25010. <dt><samp class="option">wait_for_tc (<em class="emph">bool</em>)</samp></dt>
  25011. <dd><p>Drop frames till a frame with timecode is received. Sometimes serial timecode
  25012. isn&rsquo;t received with the first input frame. If that happens, the stored stream
  25013. timecode will be inaccurate. If this option is set to <samp class="option">true</samp>, input frames
  25014. are dropped till a frame with timecode is received.
  25015. Option <var class="var">timecode_format</var> must be specified.
  25016. Defaults to <samp class="option">false</samp>.
  25017. </p>
  25018. </dd>
  25019. <dt><samp class="option">enable_klv(<em class="emph">bool</em>)</samp></dt>
  25020. <dd><p>If set to <samp class="option">true</samp>, extracts KLV data from VANC and outputs KLV packets.
  25021. KLV VANC packets are joined based on MID and PSC fields and aggregated into
  25022. one KLV packet.
  25023. Defaults to <samp class="option">false</samp>.
  25024. </p>
  25025. </dd>
  25026. </dl>
  25027. <a name="Examples-31"></a>
  25028. <h4 class="subsection">26.4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-31" aria-hidden="true">TOC</a></span></h4>
  25029. <ul class="itemize mark-bullet">
  25030. <li>List input devices:
  25031. <div class="example">
  25032. <pre class="example-preformatted">ffmpeg -sources decklink
  25033. </pre></div>
  25034. </li><li>List supported formats:
  25035. <div class="example">
  25036. <pre class="example-preformatted">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
  25037. </pre></div>
  25038. </li><li>Capture video clip at 1080i50:
  25039. <div class="example">
  25040. <pre class="example-preformatted">ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
  25041. </pre></div>
  25042. </li><li>Capture video clip at 1080i50 10 bit:
  25043. <div class="example">
  25044. <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
  25045. </pre></div>
  25046. </li><li>Capture video clip at 1080i50 with 16 audio channels:
  25047. <div class="example">
  25048. <pre class="example-preformatted">ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  25049. </pre></div>
  25050. </li></ul>
  25051. <a name="dshow"></a>
  25052. <h3 class="section">26.5 dshow<span class="pull-right"><a class="anchor hidden-xs" href="#dshow" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dshow" aria-hidden="true">TOC</a></span></h3>
  25053. <p>Windows DirectShow input device.
  25054. </p>
  25055. <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  25056. Currently only audio and video devices are supported.
  25057. </p>
  25058. <p>Multiple devices may be opened as separate inputs, but they may also be
  25059. opened on the same input, which should improve synchronism between them.
  25060. </p>
  25061. <p>The input name should be in the format:
  25062. </p>
  25063. <div class="example">
  25064. <pre class="example-preformatted"><var class="var">TYPE</var>=<var class="var">NAME</var>[:<var class="var">TYPE</var>=<var class="var">NAME</var>]
  25065. </pre></div>
  25066. <p>where <var class="var">TYPE</var> can be either <var class="var">audio</var> or <var class="var">video</var>,
  25067. and <var class="var">NAME</var> is the device&rsquo;s name or alternative name..
  25068. </p>
  25069. <a name="Options-98"></a>
  25070. <h4 class="subsection">26.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-98" aria-hidden="true">TOC</a></span></h4>
  25071. <p>If no options are specified, the device&rsquo;s defaults are used.
  25072. If the device does not support the requested options, it will
  25073. fail to open.
  25074. </p>
  25075. <dl class="table">
  25076. <dt><samp class="option">video_size</samp></dt>
  25077. <dd><p>Set the video size in the captured video.
  25078. </p>
  25079. </dd>
  25080. <dt><samp class="option">framerate</samp></dt>
  25081. <dd><p>Set the frame rate in the captured video.
  25082. </p>
  25083. </dd>
  25084. <dt><samp class="option">sample_rate</samp></dt>
  25085. <dd><p>Set the sample rate (in Hz) of the captured audio.
  25086. </p>
  25087. </dd>
  25088. <dt><samp class="option">sample_size</samp></dt>
  25089. <dd><p>Set the sample size (in bits) of the captured audio.
  25090. </p>
  25091. </dd>
  25092. <dt><samp class="option">channels</samp></dt>
  25093. <dd><p>Set the number of channels in the captured audio.
  25094. </p>
  25095. </dd>
  25096. <dt><samp class="option">list_devices</samp></dt>
  25097. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  25098. </p>
  25099. </dd>
  25100. <dt><samp class="option">list_options</samp></dt>
  25101. <dd><p>If set to <samp class="option">true</samp>, print a list of selected device&rsquo;s options
  25102. and exit.
  25103. </p>
  25104. </dd>
  25105. <dt><samp class="option">video_device_number</samp></dt>
  25106. <dd><p>Set video device number for devices with the same name (starts at 0,
  25107. defaults to 0).
  25108. </p>
  25109. </dd>
  25110. <dt><samp class="option">audio_device_number</samp></dt>
  25111. <dd><p>Set audio device number for devices with the same name (starts at 0,
  25112. defaults to 0).
  25113. </p>
  25114. </dd>
  25115. <dt><samp class="option">pixel_format</samp></dt>
  25116. <dd><p>Select pixel format to be used by DirectShow. This may only be set when
  25117. the video codec is not set or set to rawvideo.
  25118. </p>
  25119. </dd>
  25120. <dt><samp class="option">audio_buffer_size</samp></dt>
  25121. <dd><p>Set audio device buffer size in milliseconds (which can directly
  25122. impact latency, depending on the device).
  25123. Defaults to using the audio device&rsquo;s
  25124. default buffer size (typically some multiple of 500ms).
  25125. Setting this value too low can degrade performance.
  25126. See also
  25127. <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>
  25128. </p>
  25129. </dd>
  25130. <dt><samp class="option">video_pin_name</samp></dt>
  25131. <dd><p>Select video capture pin to use by name or alternative name.
  25132. </p>
  25133. </dd>
  25134. <dt><samp class="option">audio_pin_name</samp></dt>
  25135. <dd><p>Select audio capture pin to use by name or alternative name.
  25136. </p>
  25137. </dd>
  25138. <dt><samp class="option">crossbar_video_input_pin_number</samp></dt>
  25139. <dd><p>Select video input pin number for crossbar device. This will be
  25140. routed to the crossbar device&rsquo;s Video Decoder output pin.
  25141. Note that changing this value can affect future invocations
  25142. (sets a new default) until system reboot occurs.
  25143. </p>
  25144. </dd>
  25145. <dt><samp class="option">crossbar_audio_input_pin_number</samp></dt>
  25146. <dd><p>Select audio input pin number for crossbar device. This will be
  25147. routed to the crossbar device&rsquo;s Audio Decoder output pin.
  25148. Note that changing this value can affect future invocations
  25149. (sets a new default) until system reboot occurs.
  25150. </p>
  25151. </dd>
  25152. <dt><samp class="option">show_video_device_dialog</samp></dt>
  25153. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display dialog
  25154. to the end user, allowing them to change video filter properties
  25155. and configurations manually.
  25156. Note that for crossbar devices, adjusting values in this dialog
  25157. may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
  25158. input frame rates, sizes, interlacing, etc. Changing these values can
  25159. enable different scan rates/frame rates and avoiding green bars at
  25160. the bottom, flickering scan lines, etc.
  25161. Note that with some devices, changing these properties can also affect future
  25162. invocations (sets new defaults) until system reboot occurs.
  25163. </p>
  25164. </dd>
  25165. <dt><samp class="option">show_audio_device_dialog</samp></dt>
  25166. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display dialog
  25167. to the end user, allowing them to change audio filter properties
  25168. and configurations manually.
  25169. </p>
  25170. </dd>
  25171. <dt><samp class="option">show_video_crossbar_connection_dialog</samp></dt>
  25172. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  25173. dialog to the end user, allowing them to manually
  25174. modify crossbar pin routings, when it opens a video device.
  25175. </p>
  25176. </dd>
  25177. <dt><samp class="option">show_audio_crossbar_connection_dialog</samp></dt>
  25178. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  25179. dialog to the end user, allowing them to manually
  25180. modify crossbar pin routings, when it opens an audio device.
  25181. </p>
  25182. </dd>
  25183. <dt><samp class="option">show_analog_tv_tuner_dialog</samp></dt>
  25184. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  25185. dialog to the end user, allowing them to manually
  25186. modify TV channels and frequencies.
  25187. </p>
  25188. </dd>
  25189. <dt><samp class="option">show_analog_tv_tuner_audio_dialog</samp></dt>
  25190. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  25191. dialog to the end user, allowing them to manually
  25192. modify TV audio (like mono vs. stereo, Language A,B or C).
  25193. </p>
  25194. </dd>
  25195. <dt><samp class="option">audio_device_load</samp></dt>
  25196. <dd><p>Load an audio capture filter device from file instead of searching
  25197. it by name. It may load additional parameters too, if the filter
  25198. supports the serialization of its properties to.
  25199. To use this an audio capture source has to be specified, but it can
  25200. be anything even fake one.
  25201. </p>
  25202. </dd>
  25203. <dt><samp class="option">audio_device_save</samp></dt>
  25204. <dd><p>Save the currently used audio capture filter device and its
  25205. parameters (if the filter supports it) to a file.
  25206. If a file with the same name exists it will be overwritten.
  25207. </p>
  25208. </dd>
  25209. <dt><samp class="option">video_device_load</samp></dt>
  25210. <dd><p>Load a video capture filter device from file instead of searching
  25211. it by name. It may load additional parameters too, if the filter
  25212. supports the serialization of its properties to.
  25213. To use this a video capture source has to be specified, but it can
  25214. be anything even fake one.
  25215. </p>
  25216. </dd>
  25217. <dt><samp class="option">video_device_save</samp></dt>
  25218. <dd><p>Save the currently used video capture filter device and its
  25219. parameters (if the filter supports it) to a file.
  25220. If a file with the same name exists it will be overwritten.
  25221. </p>
  25222. </dd>
  25223. <dt><samp class="option">use_video_device_timestamps</samp></dt>
  25224. <dd><p>If set to <samp class="option">false</samp>, the timestamp for video frames will be
  25225. derived from the wallclock instead of the timestamp provided by
  25226. the capture device. This allows working around devices that
  25227. provide unreliable timestamps.
  25228. </p>
  25229. </dd>
  25230. </dl>
  25231. <a name="Examples-32"></a>
  25232. <h4 class="subsection">26.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-32" aria-hidden="true">TOC</a></span></h4>
  25233. <ul class="itemize mark-bullet">
  25234. <li>Print the list of DirectShow supported devices and exit:
  25235. <div class="example">
  25236. <pre class="example-preformatted">$ ffmpeg -list_devices true -f dshow -i dummy
  25237. </pre></div>
  25238. </li><li>Open video device <var class="var">Camera</var>:
  25239. <div class="example">
  25240. <pre class="example-preformatted">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
  25241. </pre></div>
  25242. </li><li>Open second video device with name <var class="var">Camera</var>:
  25243. <div class="example">
  25244. <pre class="example-preformatted">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
  25245. </pre></div>
  25246. </li><li>Open video device <var class="var">Camera</var> and audio device <var class="var">Microphone</var>:
  25247. <div class="example">
  25248. <pre class="example-preformatted">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
  25249. </pre></div>
  25250. </li><li>Print the list of supported options in selected device and exit:
  25251. <div class="example">
  25252. <pre class="example-preformatted">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
  25253. </pre></div>
  25254. </li><li>Specify pin names to capture by name or alternative name, specify alternative device name:
  25255. <div class="example">
  25256. <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;
  25257. </pre></div>
  25258. </li><li>Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
  25259. <div class="example">
  25260. <pre class="example-preformatted">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
  25261. -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
  25262. </pre></div>
  25263. </li></ul>
  25264. <a name="fbdev"></a>
  25265. <h3 class="section">26.6 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev" aria-hidden="true">TOC</a></span></h3>
  25266. <p>Linux framebuffer input device.
  25267. </p>
  25268. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  25269. layer to show graphics on a computer monitor, typically on the
  25270. console. It is accessed through a file device node, usually
  25271. <samp class="file">/dev/fb0</samp>.
  25272. </p>
  25273. <p>For more detailed information read the file
  25274. Documentation/fb/framebuffer.txt included in the Linux source tree.
  25275. </p>
  25276. <p>See also <a class="url" href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  25277. </p>
  25278. <p>To record from the framebuffer device <samp class="file">/dev/fb0</samp> with
  25279. <code class="command">ffmpeg</code>:
  25280. </p><div class="example">
  25281. <pre class="example-preformatted">ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
  25282. </pre></div>
  25283. <p>You can take a single screenshot image with the command:
  25284. </p><div class="example">
  25285. <pre class="example-preformatted">ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
  25286. </pre></div>
  25287. <a name="Options-99"></a>
  25288. <h4 class="subsection">26.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-99" aria-hidden="true">TOC</a></span></h4>
  25289. <dl class="table">
  25290. <dt><samp class="option">framerate</samp></dt>
  25291. <dd><p>Set the frame rate. Default is 25.
  25292. </p>
  25293. </dd>
  25294. </dl>
  25295. <a name="gdigrab"></a>
  25296. <h3 class="section">26.7 gdigrab<span class="pull-right"><a class="anchor hidden-xs" href="#gdigrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gdigrab" aria-hidden="true">TOC</a></span></h3>
  25297. <p>Win32 GDI-based screen capture device.
  25298. </p>
  25299. <p>This device allows you to capture a region of the display on Windows.
  25300. </p>
  25301. <p>Amongst options for the input filenames are such elements as:
  25302. </p><div class="example">
  25303. <pre class="example-preformatted">desktop
  25304. </pre></div>
  25305. <p>or
  25306. </p><div class="example">
  25307. <pre class="example-preformatted">title=<var class="var">window_title</var>
  25308. </pre></div>
  25309. <p>or
  25310. </p><div class="example">
  25311. <pre class="example-preformatted">hwnd=<var class="var">window_hwnd</var>
  25312. </pre></div>
  25313. <p>The first option will capture the entire desktop, or a fixed region of the
  25314. desktop. The second and third options will instead capture the contents of a single
  25315. window, regardless of its position on the screen.
  25316. </p>
  25317. <p>For example, to grab the entire desktop using <code class="command">ffmpeg</code>:
  25318. </p><div class="example">
  25319. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
  25320. </pre></div>
  25321. <p>Grab a 640x480 region at position <code class="code">10,20</code>:
  25322. </p><div class="example">
  25323. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
  25324. </pre></div>
  25325. <p>Grab the contents of the window named &quot;Calculator&quot;
  25326. </p><div class="example">
  25327. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
  25328. </pre></div>
  25329. <a name="Options-100"></a>
  25330. <h4 class="subsection">26.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-100" aria-hidden="true">TOC</a></span></h4>
  25331. <dl class="table">
  25332. <dt><samp class="option">draw_mouse</samp></dt>
  25333. <dd><p>Specify whether to draw the mouse pointer. Use the value <code class="code">0</code> to
  25334. not draw the pointer. Default value is <code class="code">1</code>.
  25335. </p>
  25336. </dd>
  25337. <dt><samp class="option">framerate</samp></dt>
  25338. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  25339. corresponding to a frame rate of <code class="code">30000/1001</code>.
  25340. </p>
  25341. </dd>
  25342. <dt><samp class="option">show_region</samp></dt>
  25343. <dd><p>Show grabbed region on screen.
  25344. </p>
  25345. <p>If <var class="var">show_region</var> is specified with <code class="code">1</code>, then the grabbing
  25346. region will be indicated on screen. With this option, it is easy to
  25347. know what is being grabbed if only a portion of the screen is grabbed.
  25348. </p>
  25349. <p>Note that <var class="var">show_region</var> is incompatible with grabbing the contents
  25350. of a single window.
  25351. </p>
  25352. <p>For example:
  25353. </p><div class="example">
  25354. <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
  25355. </pre></div>
  25356. </dd>
  25357. <dt><samp class="option">video_size</samp></dt>
  25358. <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.
  25359. </p>
  25360. </dd>
  25361. <dt><samp class="option">offset_x</samp></dt>
  25362. <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.
  25363. </p>
  25364. <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.
  25365. </p>
  25366. </dd>
  25367. <dt><samp class="option">offset_y</samp></dt>
  25368. <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.
  25369. </p>
  25370. <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.
  25371. </p>
  25372. </dd>
  25373. </dl>
  25374. <a name="iec61883"></a>
  25375. <h3 class="section">26.8 iec61883<span class="pull-right"><a class="anchor hidden-xs" href="#iec61883" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iec61883" aria-hidden="true">TOC</a></span></h3>
  25376. <p>FireWire DV/HDV input device using libiec61883.
  25377. </p>
  25378. <p>To enable this input device, you need libiec61883, libraw1394 and
  25379. libavc1394 installed on your system. Use the configure option
  25380. <code class="code">--enable-libiec61883</code> to compile with the device enabled.
  25381. </p>
  25382. <p>The iec61883 capture device supports capturing from a video device
  25383. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  25384. FireWire stack (juju). This is the default DV/HDV input method in Linux
  25385. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  25386. </p>
  25387. <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
  25388. to choose the first port connected.
  25389. </p>
  25390. <a name="Options-101"></a>
  25391. <h4 class="subsection">26.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-101" aria-hidden="true">TOC</a></span></h4>
  25392. <dl class="table">
  25393. <dt><samp class="option">dvtype</samp></dt>
  25394. <dd><p>Override autodetection of DV/HDV. This should only be used if auto
  25395. detection does not work, or if usage of a different device type
  25396. should be prohibited. Treating a DV device as HDV (or vice versa) will
  25397. not work and result in undefined behavior.
  25398. The values <samp class="option">auto</samp>, <samp class="option">dv</samp> and <samp class="option">hdv</samp> are supported.
  25399. </p>
  25400. </dd>
  25401. <dt><samp class="option">dvbuffer</samp></dt>
  25402. <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
  25403. is an exact value. For HDV, it is not frame exact, since HDV does
  25404. not have a fixed frame size.
  25405. </p>
  25406. </dd>
  25407. <dt><samp class="option">dvguid</samp></dt>
  25408. <dd><p>Select the capture device by specifying its GUID. Capturing will only
  25409. be performed from the specified device and fails if no device with the
  25410. given GUID is found. This is useful to select the input if multiple
  25411. devices are connected at the same time.
  25412. Look at /sys/bus/firewire/devices to find out the GUIDs.
  25413. </p>
  25414. </dd>
  25415. </dl>
  25416. <a name="Examples-33"></a>
  25417. <h4 class="subsection">26.8.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-33" aria-hidden="true">TOC</a></span></h4>
  25418. <ul class="itemize mark-bullet">
  25419. <li>Grab and show the input of a FireWire DV/HDV device.
  25420. <div class="example">
  25421. <pre class="example-preformatted">ffplay -f iec61883 -i auto
  25422. </pre></div>
  25423. </li><li>Grab and record the input of a FireWire DV/HDV device,
  25424. using a packet buffer of 100000 packets if the source is HDV.
  25425. <div class="example">
  25426. <pre class="example-preformatted">ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
  25427. </pre></div>
  25428. </li></ul>
  25429. <a name="jack"></a>
  25430. <h3 class="section">26.9 jack<span class="pull-right"><a class="anchor hidden-xs" href="#jack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jack" aria-hidden="true">TOC</a></span></h3>
  25431. <p>JACK input device.
  25432. </p>
  25433. <p>To enable this input device during configuration you need libjack
  25434. installed on your system.
  25435. </p>
  25436. <p>A JACK input device creates one or more JACK writable clients, one for
  25437. each audio channel, with name <var class="var">client_name</var>:input_<var class="var">N</var>, where
  25438. <var class="var">client_name</var> is the name provided by the application, and <var class="var">N</var>
  25439. is a number which identifies the channel.
  25440. Each writable client will send the acquired data to the FFmpeg input
  25441. device.
  25442. </p>
  25443. <p>Once you have created one or more JACK readable clients, you need to
  25444. connect them to one or more JACK writable clients.
  25445. </p>
  25446. <p>To connect or disconnect JACK clients you can use the <code class="command">jack_connect</code>
  25447. and <code class="command">jack_disconnect</code> programs, or do it through a graphical interface,
  25448. for example with <code class="command">qjackctl</code>.
  25449. </p>
  25450. <p>To list the JACK clients and their properties you can invoke the command
  25451. <code class="command">jack_lsp</code>.
  25452. </p>
  25453. <p>Follows an example which shows how to capture a JACK readable client
  25454. with <code class="command">ffmpeg</code>.
  25455. </p><div class="example">
  25456. <pre class="example-preformatted"># Create a JACK writable client with name &quot;ffmpeg&quot;.
  25457. $ ffmpeg -f jack -i ffmpeg -y out.wav
  25458. # Start the sample jack_metro readable client.
  25459. $ jack_metro -b 120 -d 0.2 -f 4000
  25460. # List the current JACK clients.
  25461. $ jack_lsp -c
  25462. system:capture_1
  25463. system:capture_2
  25464. system:playback_1
  25465. system:playback_2
  25466. ffmpeg:input_1
  25467. metro:120_bpm
  25468. # Connect metro to the ffmpeg writable client.
  25469. $ jack_connect metro:120_bpm ffmpeg:input_1
  25470. </pre></div>
  25471. <p>For more information read:
  25472. <a class="url" href="http://jackaudio.org/">http://jackaudio.org/</a>
  25473. </p>
  25474. <a name="Options-102"></a>
  25475. <h4 class="subsection">26.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-102" aria-hidden="true">TOC</a></span></h4>
  25476. <dl class="table">
  25477. <dt><samp class="option">channels</samp></dt>
  25478. <dd><p>Set the number of channels. Default is 2.
  25479. </p>
  25480. </dd>
  25481. </dl>
  25482. <a name="kmsgrab"></a>
  25483. <h3 class="section">26.10 kmsgrab<span class="pull-right"><a class="anchor hidden-xs" href="#kmsgrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kmsgrab" aria-hidden="true">TOC</a></span></h3>
  25484. <p>KMS video input device.
  25485. </p>
  25486. <p>Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a
  25487. DRM object that can be passed to other hardware functions.
  25488. </p>
  25489. <p>Requires either DRM master or CAP_SYS_ADMIN to run.
  25490. </p>
  25491. <p>If you don&rsquo;t understand what all of that means, you probably don&rsquo;t want this. Look at
  25492. <samp class="option">x11grab</samp> instead.
  25493. </p>
  25494. <a name="Options-103"></a>
  25495. <h4 class="subsection">26.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-103" aria-hidden="true">TOC</a></span></h4>
  25496. <dl class="table">
  25497. <dt><samp class="option">device</samp></dt>
  25498. <dd><p>DRM device to capture on. Defaults to <samp class="option">/dev/dri/card0</samp>.
  25499. </p>
  25500. </dd>
  25501. <dt><samp class="option">format</samp></dt>
  25502. <dd><p>Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7
  25503. or later, but needs to be provided for earlier versions. Defaults to <samp class="option">bgr0</samp>,
  25504. which is the most common format used by the Linux console and Xorg X server.
  25505. </p>
  25506. </dd>
  25507. <dt><samp class="option">format_modifier</samp></dt>
  25508. <dd><p>Format modifier to signal on output frames. This is necessary to import correctly into
  25509. some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need
  25510. to be provided explicitly when needed in earlier versions. See the libdrm documentation
  25511. for possible values.
  25512. </p>
  25513. </dd>
  25514. <dt><samp class="option">crtc_id</samp></dt>
  25515. <dd><p>KMS CRTC ID to define the capture source. The first active plane on the given CRTC
  25516. will be used.
  25517. </p>
  25518. </dd>
  25519. <dt><samp class="option">plane_id</samp></dt>
  25520. <dd><p>KMS plane ID to define the capture source. Defaults to the first active plane found if
  25521. neither <samp class="option">crtc_id</samp> nor <samp class="option">plane_id</samp> are specified.
  25522. </p>
  25523. </dd>
  25524. <dt><samp class="option">framerate</samp></dt>
  25525. <dd><p>Framerate to capture at. This is not synchronised to any page flipping or framebuffer
  25526. changes - it just defines the interval at which the framebuffer is sampled. Sampling
  25527. faster than the framebuffer update rate will generate independent frames with the same
  25528. content. Defaults to <code class="code">30</code>.
  25529. </p>
  25530. </dd>
  25531. </dl>
  25532. <a name="Examples-34"></a>
  25533. <h4 class="subsection">26.10.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-34" aria-hidden="true">TOC</a></span></h4>
  25534. <ul class="itemize mark-bullet">
  25535. <li>Capture from the first active plane, download the result to normal frames and encode.
  25536. This will only work if the framebuffer is both linear and mappable - if not, the result
  25537. may be scrambled or fail to download.
  25538. <div class="example">
  25539. <pre class="example-preformatted">ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
  25540. </pre></div>
  25541. </li><li>Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264.
  25542. <div class="example">
  25543. <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
  25544. </pre></div>
  25545. </li><li>To capture only part of a plane the output can be cropped - this can be used to capture
  25546. a single window, as long as it has a known absolute position and size. For example, to
  25547. capture and encode the middle quarter of a 1920x1080 plane:
  25548. <div class="example">
  25549. <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
  25550. </pre></div>
  25551. </li></ul>
  25552. <a name="lavfi"></a>
  25553. <h3 class="section">26.11 lavfi<span class="pull-right"><a class="anchor hidden-xs" href="#lavfi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lavfi" aria-hidden="true">TOC</a></span></h3>
  25554. <p>Libavfilter input virtual device.
  25555. </p>
  25556. <p>This input device reads data from the open output pads of a libavfilter
  25557. filtergraph.
  25558. </p>
  25559. <p>For each filtergraph open output, the input device will create a
  25560. corresponding stream which is mapped to the generated output.
  25561. The filtergraph is specified through the option <samp class="option">graph</samp>.
  25562. </p>
  25563. <a name="Options-104"></a>
  25564. <h4 class="subsection">26.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-104" aria-hidden="true">TOC</a></span></h4>
  25565. <dl class="table">
  25566. <dt><samp class="option">graph</samp></dt>
  25567. <dd><p>Specify the filtergraph to use as input. Each video open output must be
  25568. labelled by a unique string of the form &quot;out<var class="var">N</var>&quot;, where <var class="var">N</var> is a
  25569. number starting from 0 corresponding to the mapped input stream
  25570. generated by the device.
  25571. The first unlabelled output is automatically assigned to the &quot;out0&quot;
  25572. label, but all the others need to be specified explicitly.
  25573. </p>
  25574. <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
  25575. stream with the closed captions packets attached to that output
  25576. (experimental; only for EIA-608 / CEA-708 for now).
  25577. The subcc streams are created after all the normal streams, in the order of
  25578. the corresponding stream.
  25579. For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
  25580. stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
  25581. </p>
  25582. <p>If not specified defaults to the filename specified for the input
  25583. device.
  25584. </p>
  25585. </dd>
  25586. <dt><samp class="option">graph_file</samp></dt>
  25587. <dd><p>Set the filename of the filtergraph to be read and sent to the other
  25588. filters. Syntax of the filtergraph is the same as the one specified by
  25589. the option <var class="var">graph</var>.
  25590. </p>
  25591. </dd>
  25592. <dt><samp class="option">dumpgraph</samp></dt>
  25593. <dd><p>Dump graph to stderr.
  25594. </p>
  25595. </dd>
  25596. </dl>
  25597. <a name="Examples-35"></a>
  25598. <h4 class="subsection">26.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-35" aria-hidden="true">TOC</a></span></h4>
  25599. <ul class="itemize mark-bullet">
  25600. <li>Create a color video stream and play it back with <code class="command">ffplay</code>:
  25601. <div class="example">
  25602. <pre class="example-preformatted">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
  25603. </pre></div>
  25604. </li><li>As the previous example, but use filename for specifying the graph
  25605. description, and omit the &quot;out0&quot; label:
  25606. <div class="example">
  25607. <pre class="example-preformatted">ffplay -f lavfi color=c=pink
  25608. </pre></div>
  25609. </li><li>Create three different video test filtered sources and play them:
  25610. <div class="example">
  25611. <pre class="example-preformatted">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
  25612. </pre></div>
  25613. </li><li>Read an audio stream from a file using the amovie source and play it
  25614. back with <code class="command">ffplay</code>:
  25615. <div class="example">
  25616. <pre class="example-preformatted">ffplay -f lavfi &quot;amovie=test.wav&quot;
  25617. </pre></div>
  25618. </li><li>Read an audio stream and a video stream and play it back with
  25619. <code class="command">ffplay</code>:
  25620. <div class="example">
  25621. <pre class="example-preformatted">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
  25622. </pre></div>
  25623. </li><li>Dump decoded frames to images and Closed Captions to an RCWT backup:
  25624. <div class="example">
  25625. <pre class="example-preformatted">ffmpeg -f lavfi -i &quot;movie=test.ts[out0+subcc]&quot; -map v frame%08d.png -map s -c copy -f rcwt subcc.bin
  25626. </pre></div>
  25627. </li></ul>
  25628. <a name="libcdio"></a>
  25629. <h3 class="section">26.12 libcdio<span class="pull-right"><a class="anchor hidden-xs" href="#libcdio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcdio" aria-hidden="true">TOC</a></span></h3>
  25630. <p>Audio-CD input device based on libcdio.
  25631. </p>
  25632. <p>To enable this input device during configuration you need libcdio
  25633. installed on your system. It requires the configure option
  25634. <code class="code">--enable-libcdio</code>.
  25635. </p>
  25636. <p>This device allows playing and grabbing from an Audio-CD.
  25637. </p>
  25638. <p>For example to copy with <code class="command">ffmpeg</code> the entire Audio-CD in <samp class="file">/dev/sr0</samp>,
  25639. you may run the command:
  25640. </p><div class="example">
  25641. <pre class="example-preformatted">ffmpeg -f libcdio -i /dev/sr0 cd.wav
  25642. </pre></div>
  25643. <a name="Options-105"></a>
  25644. <h4 class="subsection">26.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-105" aria-hidden="true">TOC</a></span></h4>
  25645. <dl class="table">
  25646. <dt><samp class="option">speed</samp></dt>
  25647. <dd><p>Set drive reading speed. Default value is 0.
  25648. </p>
  25649. <p>The speed is specified CD-ROM speed units. The speed is set through
  25650. the libcdio <code class="code">cdio_cddap_speed_set</code> function. On many CD-ROM
  25651. drives, specifying a value too large will result in using the fastest
  25652. speed.
  25653. </p>
  25654. </dd>
  25655. <dt><samp class="option">paranoia_mode</samp></dt>
  25656. <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
  25657. </p>
  25658. <dl class="table">
  25659. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  25660. <dt>&lsquo;<samp class="samp">verify</samp>&rsquo;</dt>
  25661. <dt>&lsquo;<samp class="samp">overlap</samp>&rsquo;</dt>
  25662. <dt>&lsquo;<samp class="samp">neverskip</samp>&rsquo;</dt>
  25663. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  25664. </dl>
  25665. <p>Default value is &lsquo;<samp class="samp">disable</samp>&rsquo;.
  25666. </p>
  25667. <p>For more information about the available recovery modes, consult the
  25668. paranoia project documentation.
  25669. </p></dd>
  25670. </dl>
  25671. <a name="libdc1394"></a>
  25672. <h3 class="section">26.13 libdc1394<span class="pull-right"><a class="anchor hidden-xs" href="#libdc1394" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdc1394" aria-hidden="true">TOC</a></span></h3>
  25673. <p>IIDC1394 input device, based on libdc1394 and libraw1394.
  25674. </p>
  25675. <p>Requires the configure option <code class="code">--enable-libdc1394</code>.
  25676. </p>
  25677. <a name="Options-106"></a>
  25678. <h4 class="subsection">26.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-106" aria-hidden="true">TOC</a></span></h4>
  25679. <dl class="table">
  25680. <dt><samp class="option">framerate</samp></dt>
  25681. <dd><p>Set the frame rate. Default is <code class="code">ntsc</code>, corresponding to a frame
  25682. rate of <code class="code">30000/1001</code>.
  25683. </p>
  25684. </dd>
  25685. <dt><samp class="option">pixel_format</samp></dt>
  25686. <dd><p>Select the pixel format. Default is <code class="code">uyvy422</code>.
  25687. </p>
  25688. </dd>
  25689. <dt><samp class="option">video_size</samp></dt>
  25690. <dd><p>Set the video size given as a string such as <code class="code">640x480</code> or <code class="code">hd720</code>.
  25691. Default is <code class="code">qvga</code>.
  25692. </p></dd>
  25693. </dl>
  25694. <a name="openal"></a>
  25695. <h3 class="section">26.14 openal<span class="pull-right"><a class="anchor hidden-xs" href="#openal" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openal" aria-hidden="true">TOC</a></span></h3>
  25696. <p>The OpenAL input device provides audio capture on all systems with a
  25697. working OpenAL 1.1 implementation.
  25698. </p>
  25699. <p>To enable this input device during configuration, you need OpenAL
  25700. headers and libraries installed on your system, and need to configure
  25701. FFmpeg with <code class="code">--enable-openal</code>.
  25702. </p>
  25703. <p>OpenAL headers and libraries should be provided as part of your OpenAL
  25704. implementation, or as an additional download (an SDK). Depending on your
  25705. installation you may need to specify additional flags via the
  25706. <code class="code">--extra-cflags</code> and <code class="code">--extra-ldflags</code> for allowing the build
  25707. system to locate the OpenAL headers and libraries.
  25708. </p>
  25709. <p>An incomplete list of OpenAL implementations follows:
  25710. </p>
  25711. <dl class="table">
  25712. <dt><strong class="strong">Creative</strong></dt>
  25713. <dd><p>The official Windows implementation, providing hardware acceleration
  25714. with supported devices and software fallback.
  25715. See <a class="url" href="http://openal.org/">http://openal.org/</a>.
  25716. </p></dd>
  25717. <dt><strong class="strong">OpenAL Soft</strong></dt>
  25718. <dd><p>Portable, open source (LGPL) software implementation. Includes
  25719. backends for the most common sound APIs on the Windows, Linux,
  25720. Solaris, and BSD operating systems.
  25721. See <a class="url" href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
  25722. </p></dd>
  25723. <dt><strong class="strong">Apple</strong></dt>
  25724. <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  25725. 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>
  25726. </p></dd>
  25727. </dl>
  25728. <p>This device allows one to capture from an audio input device handled
  25729. through OpenAL.
  25730. </p>
  25731. <p>You need to specify the name of the device to capture in the provided
  25732. filename. If the empty string is provided, the device will
  25733. automatically select the default device. You can get the list of the
  25734. supported devices by using the option <var class="var">list_devices</var>.
  25735. </p>
  25736. <a name="Options-107"></a>
  25737. <h4 class="subsection">26.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-107" aria-hidden="true">TOC</a></span></h4>
  25738. <dl class="table">
  25739. <dt><samp class="option">channels</samp></dt>
  25740. <dd><p>Set the number of channels in the captured audio. Only the values
  25741. <samp class="option">1</samp> (monaural) and <samp class="option">2</samp> (stereo) are currently supported.
  25742. Defaults to <samp class="option">2</samp>.
  25743. </p>
  25744. </dd>
  25745. <dt><samp class="option">sample_size</samp></dt>
  25746. <dd><p>Set the sample size (in bits) of the captured audio. Only the values
  25747. <samp class="option">8</samp> and <samp class="option">16</samp> are currently supported. Defaults to
  25748. <samp class="option">16</samp>.
  25749. </p>
  25750. </dd>
  25751. <dt><samp class="option">sample_rate</samp></dt>
  25752. <dd><p>Set the sample rate (in Hz) of the captured audio.
  25753. Defaults to <samp class="option">44.1k</samp>.
  25754. </p>
  25755. </dd>
  25756. <dt><samp class="option">list_devices</samp></dt>
  25757. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  25758. Defaults to <samp class="option">false</samp>.
  25759. </p>
  25760. </dd>
  25761. </dl>
  25762. <a name="Examples-36"></a>
  25763. <h4 class="subsection">26.14.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-36" aria-hidden="true">TOC</a></span></h4>
  25764. <p>Print the list of OpenAL supported devices and exit:
  25765. </p><div class="example">
  25766. <pre class="example-preformatted">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
  25767. </pre></div>
  25768. <p>Capture from the OpenAL device <samp class="file">DR-BT101 via PulseAudio</samp>:
  25769. </p><div class="example">
  25770. <pre class="example-preformatted">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  25771. </pre></div>
  25772. <p>Capture from the default device (note the empty string &rdquo; as filename):
  25773. </p><div class="example">
  25774. <pre class="example-preformatted">$ ffmpeg -f openal -i '' out.ogg
  25775. </pre></div>
  25776. <p>Capture from two devices simultaneously, writing to two different files,
  25777. within the same <code class="command">ffmpeg</code> command:
  25778. </p><div class="example">
  25779. <pre class="example-preformatted">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  25780. </pre></div>
  25781. <p>Note: not all OpenAL implementations support multiple simultaneous capture -
  25782. try the latest OpenAL Soft if the above does not work.
  25783. </p>
  25784. <a name="oss"></a>
  25785. <h3 class="section">26.15 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss" aria-hidden="true">TOC</a></span></h3>
  25786. <p>Open Sound System input device.
  25787. </p>
  25788. <p>The filename to provide to the input device is the device node
  25789. representing the OSS input device, and is usually set to
  25790. <samp class="file">/dev/dsp</samp>.
  25791. </p>
  25792. <p>For example to grab from <samp class="file">/dev/dsp</samp> using <code class="command">ffmpeg</code> use the
  25793. command:
  25794. </p><div class="example">
  25795. <pre class="example-preformatted">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  25796. </pre></div>
  25797. <p>For more information about OSS see:
  25798. <a class="url" href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
  25799. </p>
  25800. <a name="Options-108"></a>
  25801. <h4 class="subsection">26.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-108" aria-hidden="true">TOC</a></span></h4>
  25802. <dl class="table">
  25803. <dt><samp class="option">sample_rate</samp></dt>
  25804. <dd><p>Set the sample rate in Hz. Default is 48000.
  25805. </p>
  25806. </dd>
  25807. <dt><samp class="option">channels</samp></dt>
  25808. <dd><p>Set the number of channels. Default is 2.
  25809. </p>
  25810. </dd>
  25811. </dl>
  25812. <a name="pulse"></a>
  25813. <h3 class="section">26.16 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse" aria-hidden="true">TOC</a></span></h3>
  25814. <p>PulseAudio input device.
  25815. </p>
  25816. <p>To enable this output device you need to configure FFmpeg with <code class="code">--enable-libpulse</code>.
  25817. </p>
  25818. <p>The filename to provide to the input device is a source device or the
  25819. string &quot;default&quot;
  25820. </p>
  25821. <p>To list the PulseAudio source devices and their properties you can invoke
  25822. the command <code class="command">pactl list sources</code>.
  25823. </p>
  25824. <p>More information about PulseAudio can be found on <a class="url" href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
  25825. </p>
  25826. <a name="Options-109"></a>
  25827. <h4 class="subsection">26.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-109" aria-hidden="true">TOC</a></span></h4>
  25828. <dl class="table">
  25829. <dt><samp class="option">server</samp></dt>
  25830. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  25831. Default server is used when not provided.
  25832. </p>
  25833. </dd>
  25834. <dt><samp class="option">name</samp></dt>
  25835. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  25836. by default it is the <code class="code">LIBAVFORMAT_IDENT</code> string.
  25837. </p>
  25838. </dd>
  25839. <dt><samp class="option">stream_name</samp></dt>
  25840. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  25841. by default it is &quot;record&quot;.
  25842. </p>
  25843. </dd>
  25844. <dt><samp class="option">sample_rate</samp></dt>
  25845. <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
  25846. </p>
  25847. </dd>
  25848. <dt><samp class="option">channels</samp></dt>
  25849. <dd><p>Specify the channels in use, by default 2 (stereo) is set.
  25850. </p>
  25851. </dd>
  25852. <dt><samp class="option">frame_size</samp></dt>
  25853. <dd><p>This option does nothing and is deprecated.
  25854. </p>
  25855. </dd>
  25856. <dt><samp class="option">fragment_size</samp></dt>
  25857. <dd><p>Specify the size in bytes of the minimal buffering fragment in PulseAudio, it
  25858. will affect the audio latency. By default it is set to 50 ms amount of data.
  25859. </p>
  25860. </dd>
  25861. <dt><samp class="option">wallclock</samp></dt>
  25862. <dd><p>Set the initial PTS using the current time. Default is 1.
  25863. </p>
  25864. </dd>
  25865. </dl>
  25866. <a name="Examples-37"></a>
  25867. <h4 class="subsection">26.16.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-37" aria-hidden="true">TOC</a></span></h4>
  25868. <p>Record a stream from default device:
  25869. </p><div class="example">
  25870. <pre class="example-preformatted">ffmpeg -f pulse -i default /tmp/pulse.wav
  25871. </pre></div>
  25872. <a name="sndio"></a>
  25873. <h3 class="section">26.17 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio" aria-hidden="true">TOC</a></span></h3>
  25874. <p>sndio input device.
  25875. </p>
  25876. <p>To enable this input device during configuration you need libsndio
  25877. installed on your system.
  25878. </p>
  25879. <p>The filename to provide to the input device is the device node
  25880. representing the sndio input device, and is usually set to
  25881. <samp class="file">/dev/audio0</samp>.
  25882. </p>
  25883. <p>For example to grab from <samp class="file">/dev/audio0</samp> using <code class="command">ffmpeg</code> use the
  25884. command:
  25885. </p><div class="example">
  25886. <pre class="example-preformatted">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  25887. </pre></div>
  25888. <a name="Options-110"></a>
  25889. <h4 class="subsection">26.17.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-110" aria-hidden="true">TOC</a></span></h4>
  25890. <dl class="table">
  25891. <dt><samp class="option">sample_rate</samp></dt>
  25892. <dd><p>Set the sample rate in Hz. Default is 48000.
  25893. </p>
  25894. </dd>
  25895. <dt><samp class="option">channels</samp></dt>
  25896. <dd><p>Set the number of channels. Default is 2.
  25897. </p>
  25898. </dd>
  25899. </dl>
  25900. <a name="video4linux2_002c-v4l2"></a>
  25901. <h3 class="section">26.18 video4linux2, v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#video4linux2_002c-v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-video4linux2_002c-v4l2" aria-hidden="true">TOC</a></span></h3>
  25902. <p>Video4Linux2 input video device.
  25903. </p>
  25904. <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
  25905. </p>
  25906. <p>If FFmpeg is built with v4l-utils support (by using the
  25907. <code class="code">--enable-libv4l2</code> configure option), it is possible to use it with the
  25908. <code class="code">-use_libv4l2</code> input device option.
  25909. </p>
  25910. <p>The name of the device to grab is a file device node, usually Linux
  25911. systems tend to automatically create such nodes when the device
  25912. (e.g. an USB webcam) is plugged into the system, and has a name of the
  25913. kind <samp class="file">/dev/video<var class="var">N</var></samp>, where <var class="var">N</var> is a number associated to
  25914. the device.
  25915. </p>
  25916. <p>Video4Linux2 devices usually support a limited set of
  25917. <var class="var">width</var>x<var class="var">height</var> sizes and frame rates. You can check which are
  25918. supported using <code class="command">-list_formats all</code> for Video4Linux2 devices.
  25919. Some devices, like TV cards, support one or more standards. It is possible
  25920. to list all the supported standards using <code class="command">-list_standards all</code>.
  25921. </p>
  25922. <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
  25923. version and configuration, the timestamps may be derived from the real time
  25924. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  25925. boot time, unaffected by NTP or manual changes to the clock). The
  25926. <samp class="option">-timestamps abs</samp> or <samp class="option">-ts abs</samp> option can be used to force
  25927. conversion into the real time clock.
  25928. </p>
  25929. <p>Some usage examples of the video4linux2 device with <code class="command">ffmpeg</code>
  25930. and <code class="command">ffplay</code>:
  25931. </p><ul class="itemize mark-bullet">
  25932. <li>List supported formats for a video4linux2 device:
  25933. <div class="example">
  25934. <pre class="example-preformatted">ffplay -f video4linux2 -list_formats all /dev/video0
  25935. </pre></div>
  25936. </li><li>Grab and show the input of a video4linux2 device:
  25937. <div class="example">
  25938. <pre class="example-preformatted">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  25939. </pre></div>
  25940. </li><li>Grab and record the input of a video4linux2 device, leave the
  25941. frame rate and size as previously set:
  25942. <div class="example">
  25943. <pre class="example-preformatted">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  25944. </pre></div>
  25945. </li></ul>
  25946. <p>For more information about Video4Linux, check <a class="url" href="http://linuxtv.org/">http://linuxtv.org/</a>.
  25947. </p>
  25948. <a name="Options-111"></a>
  25949. <h4 class="subsection">26.18.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-111" aria-hidden="true">TOC</a></span></h4>
  25950. <dl class="table">
  25951. <dt><samp class="option">standard</samp></dt>
  25952. <dd><p>Set the standard. Must be the name of a supported standard. To get a
  25953. list of the supported standards, use the <samp class="option">list_standards</samp>
  25954. option.
  25955. </p>
  25956. </dd>
  25957. <dt><samp class="option">channel</samp></dt>
  25958. <dd><p>Set the input channel number. Default to -1, which means using the
  25959. previously selected channel.
  25960. </p>
  25961. </dd>
  25962. <dt><samp class="option">video_size</samp></dt>
  25963. <dd><p>Set the video frame size. The argument must be a string in the form
  25964. <var class="var">WIDTH</var>x<var class="var">HEIGHT</var> or a valid size abbreviation.
  25965. </p>
  25966. </dd>
  25967. <dt><samp class="option">pixel_format</samp></dt>
  25968. <dd><p>Select the pixel format (only valid for raw video input).
  25969. </p>
  25970. </dd>
  25971. <dt><samp class="option">input_format</samp></dt>
  25972. <dd><p>Set the preferred pixel format (for raw video) or a codec name.
  25973. This option allows one to select the input format, when several are
  25974. available.
  25975. </p>
  25976. </dd>
  25977. <dt><samp class="option">framerate</samp></dt>
  25978. <dd><p>Set the preferred video frame rate.
  25979. </p>
  25980. </dd>
  25981. <dt><samp class="option">list_formats</samp></dt>
  25982. <dd><p>List available formats (supported pixel formats, codecs, and frame
  25983. sizes) and exit.
  25984. </p>
  25985. <p>Available values are:
  25986. </p><dl class="table">
  25987. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  25988. <dd><p>Show all available (compressed and non-compressed) formats.
  25989. </p>
  25990. </dd>
  25991. <dt>&lsquo;<samp class="samp">raw</samp>&rsquo;</dt>
  25992. <dd><p>Show only raw video (non-compressed) formats.
  25993. </p>
  25994. </dd>
  25995. <dt>&lsquo;<samp class="samp">compressed</samp>&rsquo;</dt>
  25996. <dd><p>Show only compressed formats.
  25997. </p></dd>
  25998. </dl>
  25999. </dd>
  26000. <dt><samp class="option">list_standards</samp></dt>
  26001. <dd><p>List supported standards and exit.
  26002. </p>
  26003. <p>Available values are:
  26004. </p><dl class="table">
  26005. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  26006. <dd><p>Show all supported standards.
  26007. </p></dd>
  26008. </dl>
  26009. </dd>
  26010. <dt><samp class="option">timestamps, ts</samp></dt>
  26011. <dd><p>Set type of timestamps for grabbed frames.
  26012. </p>
  26013. <p>Available values are:
  26014. </p><dl class="table">
  26015. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  26016. <dd><p>Use timestamps from the kernel.
  26017. </p>
  26018. </dd>
  26019. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  26020. <dd><p>Use absolute timestamps (wall clock).
  26021. </p>
  26022. </dd>
  26023. <dt>&lsquo;<samp class="samp">mono2abs</samp>&rsquo;</dt>
  26024. <dd><p>Force conversion from monotonic to absolute timestamps.
  26025. </p></dd>
  26026. </dl>
  26027. <p>Default value is <code class="code">default</code>.
  26028. </p>
  26029. </dd>
  26030. <dt><samp class="option">use_libv4l2</samp></dt>
  26031. <dd><p>Use libv4l2 (v4l-utils) conversion functions. Default is 0.
  26032. </p>
  26033. </dd>
  26034. </dl>
  26035. <a name="vfwcap"></a>
  26036. <h3 class="section">26.19 vfwcap<span class="pull-right"><a class="anchor hidden-xs" href="#vfwcap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfwcap" aria-hidden="true">TOC</a></span></h3>
  26037. <p>VfW (Video for Windows) capture input device.
  26038. </p>
  26039. <p>The filename passed as input is the capture driver number, ranging from
  26040. 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
  26041. other filename will be interpreted as device number 0.
  26042. </p>
  26043. <a name="Options-112"></a>
  26044. <h4 class="subsection">26.19.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-112" aria-hidden="true">TOC</a></span></h4>
  26045. <dl class="table">
  26046. <dt><samp class="option">video_size</samp></dt>
  26047. <dd><p>Set the video frame size.
  26048. </p>
  26049. </dd>
  26050. <dt><samp class="option">framerate</samp></dt>
  26051. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  26052. corresponding to a frame rate of <code class="code">30000/1001</code>.
  26053. </p>
  26054. </dd>
  26055. </dl>
  26056. <a name="x11grab"></a>
  26057. <h3 class="section">26.20 x11grab<span class="pull-right"><a class="anchor hidden-xs" href="#x11grab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x11grab" aria-hidden="true">TOC</a></span></h3>
  26058. <p>X11 video input device.
  26059. </p>
  26060. <p>To enable this input device during configuration you need libxcb
  26061. installed on your system. It will be automatically detected during
  26062. configuration.
  26063. </p>
  26064. <p>This device allows one to capture a region of an X11 display.
  26065. </p>
  26066. <p>The filename passed as input has the syntax:
  26067. </p><div class="example">
  26068. <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>]
  26069. </pre></div>
  26070. <p><var class="var">hostname</var>:<var class="var">display_number</var>.<var class="var">screen_number</var> specifies the
  26071. X11 display name of the screen to grab from. <var class="var">hostname</var> can be
  26072. omitted, and defaults to &quot;localhost&quot;. The environment variable
  26073. <code class="env">DISPLAY</code> contains the default display name.
  26074. </p>
  26075. <p><var class="var">x_offset</var> and <var class="var">y_offset</var> specify the offsets of the grabbed
  26076. area with respect to the top-left border of the X11 screen. They
  26077. default to 0.
  26078. </p>
  26079. <p>Check the X11 documentation (e.g. <code class="command">man X</code>) for more detailed
  26080. information.
  26081. </p>
  26082. <p>Use the <code class="command">xdpyinfo</code> program for getting basic information about
  26083. the properties of your X11 display (e.g. grep for &quot;name&quot; or
  26084. &quot;dimensions&quot;).
  26085. </p>
  26086. <p>For example to grab from <samp class="file">:0.0</samp> using <code class="command">ffmpeg</code>:
  26087. </p><div class="example">
  26088. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  26089. </pre></div>
  26090. <p>Grab at position <code class="code">10,20</code>:
  26091. </p><div class="example">
  26092. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  26093. </pre></div>
  26094. <a name="Options-113"></a>
  26095. <h4 class="subsection">26.20.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-113" aria-hidden="true">TOC</a></span></h4>
  26096. <dl class="table">
  26097. <dt><samp class="option">select_region</samp></dt>
  26098. <dd><p>Specify whether to select the grabbing area graphically using the pointer.
  26099. A value of <code class="code">1</code> prompts the user to select the grabbing area graphically
  26100. by clicking and dragging. A single click with no dragging will select the
  26101. whole screen. A region with zero width or height will also select the whole
  26102. screen. This option overwrites the <var class="var">video_size</var>, <var class="var">grab_x</var>, and
  26103. <var class="var">grab_y</var> options. Default value is <code class="code">0</code>.
  26104. </p>
  26105. </dd>
  26106. <dt><samp class="option">draw_mouse</samp></dt>
  26107. <dd><p>Specify whether to draw the mouse pointer. A value of <code class="code">0</code> specifies
  26108. not to draw the pointer. Default value is <code class="code">1</code>.
  26109. </p>
  26110. </dd>
  26111. <dt><samp class="option">follow_mouse</samp></dt>
  26112. <dd><p>Make the grabbed area follow the mouse. The argument can be
  26113. <code class="code">centered</code> or a number of pixels <var class="var">PIXELS</var>.
  26114. </p>
  26115. <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
  26116. pointer and keeps the pointer at the center of region; otherwise, the region
  26117. follows only when the mouse pointer reaches within <var class="var">PIXELS</var> (greater than
  26118. zero) to the edge of region.
  26119. </p>
  26120. <p>For example:
  26121. </p><div class="example">
  26122. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  26123. </pre></div>
  26124. <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
  26125. </p><div class="example">
  26126. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  26127. </pre></div>
  26128. </dd>
  26129. <dt><samp class="option">framerate</samp></dt>
  26130. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  26131. corresponding to a frame rate of <code class="code">30000/1001</code>.
  26132. </p>
  26133. </dd>
  26134. <dt><samp class="option">show_region</samp></dt>
  26135. <dd><p>Show grabbed region on screen.
  26136. </p>
  26137. <p>If <var class="var">show_region</var> is specified with <code class="code">1</code>, then the grabbing
  26138. region will be indicated on screen. With this option, it is easy to
  26139. know what is being grabbed if only a portion of the screen is grabbed.
  26140. </p>
  26141. </dd>
  26142. <dt><samp class="option">region_border</samp></dt>
  26143. <dd><p>Set the region border thickness if <samp class="option">-show_region 1</samp> is used.
  26144. Range is 1 to 128 and default is 3 (XCB-based x11grab only).
  26145. </p>
  26146. <p>For example:
  26147. </p><div class="example">
  26148. <pre class="example-preformatted">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  26149. </pre></div>
  26150. <p>With <var class="var">follow_mouse</var>:
  26151. </p><div class="example">
  26152. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  26153. </pre></div>
  26154. </dd>
  26155. <dt><samp class="option">window_id</samp></dt>
  26156. <dd><p>Grab this window, instead of the whole screen. Default value is 0, which maps to
  26157. the whole screen (root window).
  26158. </p>
  26159. <p>The id of a window can be found using the <code class="command">xwininfo</code> program, possibly with options -tree and
  26160. -root.
  26161. </p>
  26162. <p>If the window is later enlarged, the new area is not recorded. Video ends when
  26163. the window is closed, unmapped (i.e., iconified) or shrunk beyond the video
  26164. size (which defaults to the initial window size).
  26165. </p>
  26166. <p>This option disables options <samp class="option">follow_mouse</samp> and <samp class="option">select_region</samp>.
  26167. </p>
  26168. </dd>
  26169. <dt><samp class="option">video_size</samp></dt>
  26170. <dd><p>Set the video frame size. Default is the full desktop or window.
  26171. </p>
  26172. </dd>
  26173. <dt><samp class="option">grab_x</samp></dt>
  26174. <dt><samp class="option">grab_y</samp></dt>
  26175. <dd><p>Set the grabbing region coordinates. They are expressed as offset from
  26176. the top left corner of the X11 window and correspond to the
  26177. <var class="var">x_offset</var> and <var class="var">y_offset</var> parameters in the device name. The
  26178. default value for both options is 0.
  26179. </p></dd>
  26180. </dl>
  26181. <a name="Output-Devices"></a>
  26182. <h2 class="chapter">27 Output Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Output-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Output-Devices" aria-hidden="true">TOC</a></span></h2>
  26183. <p>Output devices are configured elements in FFmpeg that can write
  26184. multimedia data to an output device attached to your system.
  26185. </p>
  26186. <p>When you configure your FFmpeg build, all the supported output devices
  26187. are enabled by default. You can list all available ones using the
  26188. configure option &quot;&ndash;list-outdevs&quot;.
  26189. </p>
  26190. <p>You can disable all the output devices using the configure option
  26191. &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
  26192. option &quot;&ndash;enable-outdev=<var class="var">OUTDEV</var>&quot;, or you can disable a particular
  26193. input device using the option &quot;&ndash;disable-outdev=<var class="var">OUTDEV</var>&quot;.
  26194. </p>
  26195. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  26196. enabled output devices.
  26197. </p>
  26198. <p>A description of the currently available output devices follows.
  26199. </p>
  26200. <a name="alsa-1"></a>
  26201. <h3 class="section">27.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa-1" aria-hidden="true">TOC</a></span></h3>
  26202. <p>ALSA (Advanced Linux Sound Architecture) output device.
  26203. </p>
  26204. <a name="Examples-38"></a>
  26205. <h4 class="subsection">27.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-38" aria-hidden="true">TOC</a></span></h4>
  26206. <ul class="itemize mark-bullet">
  26207. <li>Play a file on default ALSA device:
  26208. <div class="example">
  26209. <pre class="example-preformatted">ffmpeg -i INPUT -f alsa default
  26210. </pre></div>
  26211. </li><li>Play a file on soundcard 1, audio device 7:
  26212. <div class="example">
  26213. <pre class="example-preformatted">ffmpeg -i INPUT -f alsa hw:1,7
  26214. </pre></div>
  26215. </li></ul>
  26216. <a name="AudioToolbox"></a>
  26217. <h3 class="section">27.2 AudioToolbox<span class="pull-right"><a class="anchor hidden-xs" href="#AudioToolbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AudioToolbox" aria-hidden="true">TOC</a></span></h3>
  26218. <p>AudioToolbox output device.
  26219. </p>
  26220. <p>Allows native output to CoreAudio devices on OSX.
  26221. </p>
  26222. <p>The output filename can be empty (or <code class="code">-</code>) to refer to the default system output device or a number that refers to the device index as shown using: <code class="code">-list_devices true</code>.
  26223. </p>
  26224. <p>Alternatively, the audio input device can be chosen by index using the
  26225. <samp class="option">
  26226. -audio_device_index &lt;INDEX&gt;
  26227. </samp>
  26228. , overriding any device name or index given in the input filename.
  26229. </p>
  26230. <p>All available devices can be enumerated by using <samp class="option">-list_devices true</samp>, listing
  26231. all device names, UIDs and corresponding indices.
  26232. </p>
  26233. <a name="Options-114"></a>
  26234. <h4 class="subsection">27.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-114" aria-hidden="true">TOC</a></span></h4>
  26235. <p>AudioToolbox supports the following options:
  26236. </p>
  26237. <dl class="table">
  26238. <dt><samp class="option">-audio_device_index &lt;INDEX&gt;</samp></dt>
  26239. <dd><p>Specify the audio device by its index. Overrides anything given in the output filename.
  26240. </p>
  26241. </dd>
  26242. </dl>
  26243. <a name="Examples-39"></a>
  26244. <h4 class="subsection">27.2.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-39" aria-hidden="true">TOC</a></span></h4>
  26245. <ul class="itemize mark-bullet">
  26246. <li>Print the list of supported devices and output a sine wave to the default device:
  26247. <div class="example">
  26248. <pre class="example-preformatted">$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
  26249. </pre></div>
  26250. </li><li>Output a sine wave to the device with the index 2, overriding any output filename:
  26251. <div class="example">
  26252. <pre class="example-preformatted">$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
  26253. </pre></div>
  26254. </li></ul>
  26255. <a name="caca"></a>
  26256. <h3 class="section">27.3 caca<span class="pull-right"><a class="anchor hidden-xs" href="#caca" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-caca" aria-hidden="true">TOC</a></span></h3>
  26257. <p>CACA output device.
  26258. </p>
  26259. <p>This output device allows one to show a video stream in CACA window.
  26260. Only one CACA window is allowed per application, so you can
  26261. have only one instance of this output device in an application.
  26262. </p>
  26263. <p>To enable this output device you need to configure FFmpeg with
  26264. <code class="code">--enable-libcaca</code>.
  26265. libcaca is a graphics library that outputs text instead of pixels.
  26266. </p>
  26267. <p>For more information about libcaca, check:
  26268. <a class="url" href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
  26269. </p>
  26270. <a name="Options-115"></a>
  26271. <h4 class="subsection">27.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-115" aria-hidden="true">TOC</a></span></h4>
  26272. <dl class="table">
  26273. <dt><samp class="option">window_title</samp></dt>
  26274. <dd><p>Set the CACA window title, if not specified default to the filename
  26275. specified for the output device.
  26276. </p>
  26277. </dd>
  26278. <dt><samp class="option">window_size</samp></dt>
  26279. <dd><p>Set the CACA window size, can be a string of the form
  26280. <var class="var">width</var>x<var class="var">height</var> or a video size abbreviation.
  26281. If not specified it defaults to the size of the input video.
  26282. </p>
  26283. </dd>
  26284. <dt><samp class="option">driver</samp></dt>
  26285. <dd><p>Set display driver.
  26286. </p>
  26287. </dd>
  26288. <dt><samp class="option">algorithm</samp></dt>
  26289. <dd><p>Set dithering algorithm. Dithering is necessary
  26290. because the picture being rendered has usually far more colours than
  26291. the available palette.
  26292. The accepted values are listed with <code class="code">-list_dither algorithms</code>.
  26293. </p>
  26294. </dd>
  26295. <dt><samp class="option">antialias</samp></dt>
  26296. <dd><p>Set antialias method. Antialiasing smoothens the rendered
  26297. image and avoids the commonly seen staircase effect.
  26298. The accepted values are listed with <code class="code">-list_dither antialiases</code>.
  26299. </p>
  26300. </dd>
  26301. <dt><samp class="option">charset</samp></dt>
  26302. <dd><p>Set which characters are going to be used when rendering text.
  26303. The accepted values are listed with <code class="code">-list_dither charsets</code>.
  26304. </p>
  26305. </dd>
  26306. <dt><samp class="option">color</samp></dt>
  26307. <dd><p>Set color to be used when rendering text.
  26308. The accepted values are listed with <code class="code">-list_dither colors</code>.
  26309. </p>
  26310. </dd>
  26311. <dt><samp class="option">list_drivers</samp></dt>
  26312. <dd><p>If set to <samp class="option">true</samp>, print a list of available drivers and exit.
  26313. </p>
  26314. </dd>
  26315. <dt><samp class="option">list_dither</samp></dt>
  26316. <dd><p>List available dither options related to the argument.
  26317. The argument must be one of <code class="code">algorithms</code>, <code class="code">antialiases</code>,
  26318. <code class="code">charsets</code>, <code class="code">colors</code>.
  26319. </p></dd>
  26320. </dl>
  26321. <a name="Examples-40"></a>
  26322. <h4 class="subsection">27.3.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-40" aria-hidden="true">TOC</a></span></h4>
  26323. <ul class="itemize mark-bullet">
  26324. <li>The following command shows the <code class="command">ffmpeg</code> output is an
  26325. CACA window, forcing its size to 80x25:
  26326. <div class="example">
  26327. <pre class="example-preformatted">ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
  26328. </pre></div>
  26329. </li><li>Show the list of available drivers and exit:
  26330. <div class="example">
  26331. <pre class="example-preformatted">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
  26332. </pre></div>
  26333. </li><li>Show the list of available dither colors and exit:
  26334. <div class="example">
  26335. <pre class="example-preformatted">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
  26336. </pre></div>
  26337. </li></ul>
  26338. <a name="decklink-1"></a>
  26339. <h3 class="section">27.4 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink-1" aria-hidden="true">TOC</a></span></h3>
  26340. <p>The decklink output device provides playback capabilities for Blackmagic
  26341. DeckLink devices.
  26342. </p>
  26343. <p>To enable this output device, you need the Blackmagic DeckLink SDK and you
  26344. need to configure with the appropriate <code class="code">--extra-cflags</code>
  26345. and <code class="code">--extra-ldflags</code>.
  26346. On Windows, you need to run the IDL files through <code class="command">widl</code>.
  26347. </p>
  26348. <p>DeckLink is very picky about the formats it supports. Pixel format is always
  26349. uyvy422, framerate, field order and video size must be determined for your
  26350. device with <code class="command">-list_formats 1</code>. Audio sample rate is always 48 kHz.
  26351. </p>
  26352. <a name="Options-116"></a>
  26353. <h4 class="subsection">27.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-116" aria-hidden="true">TOC</a></span></h4>
  26354. <dl class="table">
  26355. <dt><samp class="option">list_devices</samp></dt>
  26356. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  26357. Defaults to <samp class="option">false</samp>. This option is deprecated, please use the
  26358. <code class="code">-sinks</code> option of ffmpeg to list the available output devices.
  26359. </p>
  26360. </dd>
  26361. <dt><samp class="option">list_formats</samp></dt>
  26362. <dd><p>If set to <samp class="option">true</samp>, print a list of supported formats and exit.
  26363. Defaults to <samp class="option">false</samp>.
  26364. </p>
  26365. </dd>
  26366. <dt><samp class="option">preroll</samp></dt>
  26367. <dd><p>Amount of time to preroll video in seconds.
  26368. Defaults to <samp class="option">0.5</samp>.
  26369. </p>
  26370. </dd>
  26371. <dt><samp class="option">duplex_mode</samp></dt>
  26372. <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;,
  26373. &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;,
  26374. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  26375. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  26376. </p>
  26377. <p>Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
  26378. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
  26379. sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
  26380. is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
  26381. </p>
  26382. <p>Valid profile modes for DeckLink 8K Pro(with DeckLink SDK &gt;= 11.0):
  26383. &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;,
  26384. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  26385. </p>
  26386. <p>Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
  26387. &lsquo;<samp class="samp">half</samp>&rsquo;, &lsquo;<samp class="samp">full</samp>&rsquo;
  26388. </p>
  26389. </dd>
  26390. <dt><samp class="option">timing_offset</samp></dt>
  26391. <dd><p>Sets the genlock timing pixel offset on the used output.
  26392. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  26393. </p>
  26394. </dd>
  26395. <dt><samp class="option">link</samp></dt>
  26396. <dd><p>Sets the SDI video link configuration on the used output. Must be
  26397. &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">single</samp>&rsquo; link SDI, &lsquo;<samp class="samp">dual</samp>&rsquo; link SDI or &lsquo;<samp class="samp">quad</samp>&rsquo; link
  26398. SDI.
  26399. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  26400. </p>
  26401. </dd>
  26402. <dt><samp class="option">sqd</samp></dt>
  26403. <dd><p>Enable Square Division Quad Split mode for Quad-link SDI output.
  26404. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">true</samp>&rsquo; or &lsquo;<samp class="samp">false</samp>&rsquo;.
  26405. Defaults to <samp class="option">unset</samp>.
  26406. </p>
  26407. </dd>
  26408. <dt><samp class="option">level_a</samp></dt>
  26409. <dd><p>Enable SMPTE Level A mode on the used output.
  26410. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">true</samp>&rsquo; or &lsquo;<samp class="samp">false</samp>&rsquo;.
  26411. Defaults to <samp class="option">unset</samp>.
  26412. </p>
  26413. </dd>
  26414. <dt><samp class="option">vanc_queue_size</samp></dt>
  26415. <dd><p>Sets maximum output buffer size in bytes for VANC data. If the buffering reaches this value,
  26416. outgoing VANC data will be dropped.
  26417. Defaults to &lsquo;<samp class="samp">1048576</samp>&rsquo;.
  26418. </p>
  26419. </dd>
  26420. </dl>
  26421. <a name="Examples-41"></a>
  26422. <h4 class="subsection">27.4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-41" aria-hidden="true">TOC</a></span></h4>
  26423. <ul class="itemize mark-bullet">
  26424. <li>List output devices:
  26425. <div class="example">
  26426. <pre class="example-preformatted">ffmpeg -sinks decklink
  26427. </pre></div>
  26428. </li><li>List supported formats:
  26429. <div class="example">
  26430. <pre class="example-preformatted">ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
  26431. </pre></div>
  26432. </li><li>Play video clip:
  26433. <div class="example">
  26434. <pre class="example-preformatted">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
  26435. </pre></div>
  26436. </li><li>Play video clip with non-standard framerate or video size:
  26437. <div class="example">
  26438. <pre class="example-preformatted">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
  26439. </pre></div>
  26440. </li></ul>
  26441. <a name="fbdev-1"></a>
  26442. <h3 class="section">27.5 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev-1" aria-hidden="true">TOC</a></span></h3>
  26443. <p>Linux framebuffer output device.
  26444. </p>
  26445. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  26446. layer to show graphics on a computer monitor, typically on the
  26447. console. It is accessed through a file device node, usually
  26448. <samp class="file">/dev/fb0</samp>.
  26449. </p>
  26450. <p>For more detailed information read the file
  26451. <samp class="file">Documentation/fb/framebuffer.txt</samp> included in the Linux source tree.
  26452. </p>
  26453. <a name="Options-117"></a>
  26454. <h4 class="subsection">27.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-117" aria-hidden="true">TOC</a></span></h4>
  26455. <dl class="table">
  26456. <dt><samp class="option">xoffset</samp></dt>
  26457. <dt><samp class="option">yoffset</samp></dt>
  26458. <dd><p>Set x/y coordinate of top left corner. Default is 0.
  26459. </p></dd>
  26460. </dl>
  26461. <a name="Examples-42"></a>
  26462. <h4 class="subsection">27.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-42" aria-hidden="true">TOC</a></span></h4>
  26463. <p>Play a file on framebuffer device <samp class="file">/dev/fb0</samp>.
  26464. Required pixel format depends on current framebuffer settings.
  26465. </p><div class="example">
  26466. <pre class="example-preformatted">ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  26467. </pre></div>
  26468. <p>See also <a class="url" href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  26469. </p>
  26470. <a name="oss-1"></a>
  26471. <h3 class="section">27.6 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss-1" aria-hidden="true">TOC</a></span></h3>
  26472. <p>OSS (Open Sound System) output device.
  26473. </p>
  26474. <a name="pulse-1"></a>
  26475. <h3 class="section">27.7 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse-1" aria-hidden="true">TOC</a></span></h3>
  26476. <p>PulseAudio output device.
  26477. </p>
  26478. <p>To enable this output device you need to configure FFmpeg with <code class="code">--enable-libpulse</code>.
  26479. </p>
  26480. <p>More information about PulseAudio can be found on <a class="url" href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
  26481. </p>
  26482. <a name="Options-118"></a>
  26483. <h4 class="subsection">27.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-118" aria-hidden="true">TOC</a></span></h4>
  26484. <dl class="table">
  26485. <dt><samp class="option">server</samp></dt>
  26486. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  26487. Default server is used when not provided.
  26488. </p>
  26489. </dd>
  26490. <dt><samp class="option">name</samp></dt>
  26491. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  26492. by default it is the <code class="code">LIBAVFORMAT_IDENT</code> string.
  26493. </p>
  26494. </dd>
  26495. <dt><samp class="option">stream_name</samp></dt>
  26496. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  26497. by default it is set to the specified output name.
  26498. </p>
  26499. </dd>
  26500. <dt><samp class="option">device</samp></dt>
  26501. <dd><p>Specify the device to use. Default device is used when not provided.
  26502. List of output devices can be obtained with command <code class="command">pactl list sinks</code>.
  26503. </p>
  26504. </dd>
  26505. <dt><samp class="option">buffer_size</samp></dt>
  26506. <dt><samp class="option">buffer_duration</samp></dt>
  26507. <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
  26508. gives more control, but requires more frequent updates.
  26509. </p>
  26510. <p><samp class="option">buffer_size</samp> specifies size in bytes while
  26511. <samp class="option">buffer_duration</samp> specifies duration in milliseconds.
  26512. </p>
  26513. <p>When both options are provided then the highest value is used
  26514. (duration is recalculated to bytes using stream parameters). If they
  26515. are set to 0 (which is default), the device will use the default
  26516. PulseAudio duration value. By default PulseAudio set buffer duration
  26517. to around 2 seconds.
  26518. </p>
  26519. </dd>
  26520. <dt><samp class="option">prebuf</samp></dt>
  26521. <dd><p>Specify pre-buffering size in bytes. The server does not start with
  26522. playback before at least <samp class="option">prebuf</samp> bytes are available in the
  26523. buffer. By default this option is initialized to the same value as
  26524. <samp class="option">buffer_size</samp> or <samp class="option">buffer_duration</samp> (whichever is bigger).
  26525. </p>
  26526. </dd>
  26527. <dt><samp class="option">minreq</samp></dt>
  26528. <dd><p>Specify minimum request size in bytes. The server does not request less
  26529. than <samp class="option">minreq</samp> bytes from the client, instead waits until the buffer
  26530. is free enough to request more bytes at once. It is recommended to not set
  26531. this option, which will initialize this to a value that is deemed sensible
  26532. by the server.
  26533. </p>
  26534. </dd>
  26535. </dl>
  26536. <a name="Examples-43"></a>
  26537. <h4 class="subsection">27.7.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-43" aria-hidden="true">TOC</a></span></h4>
  26538. <p>Play a file on default device on default server:
  26539. </p><div class="example">
  26540. <pre class="example-preformatted">ffmpeg -i INPUT -f pulse &quot;stream name&quot;
  26541. </pre></div>
  26542. <a name="sndio-1"></a>
  26543. <h3 class="section">27.8 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio-1" aria-hidden="true">TOC</a></span></h3>
  26544. <p>sndio audio output device.
  26545. </p>
  26546. <a name="v4l2"></a>
  26547. <h3 class="section">27.9 v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v4l2" aria-hidden="true">TOC</a></span></h3>
  26548. <p>Video4Linux2 output device.
  26549. </p>
  26550. <a name="xv"></a>
  26551. <h3 class="section">27.10 xv<span class="pull-right"><a class="anchor hidden-xs" href="#xv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xv" aria-hidden="true">TOC</a></span></h3>
  26552. <p>XV (XVideo) output device.
  26553. </p>
  26554. <p>This output device allows one to show a video stream in a X Window System
  26555. window.
  26556. </p>
  26557. <a name="Options-119"></a>
  26558. <h4 class="subsection">27.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-119" aria-hidden="true">TOC</a></span></h4>
  26559. <dl class="table">
  26560. <dt><samp class="option">display_name</samp></dt>
  26561. <dd><p>Specify the hardware display name, which determines the display and
  26562. communications domain to be used.
  26563. </p>
  26564. <p>The display name or DISPLAY environment variable can be a string in
  26565. the format <var class="var">hostname</var>[:<var class="var">number</var>[.<var class="var">screen_number</var>]].
  26566. </p>
  26567. <p><var class="var">hostname</var> specifies the name of the host machine on which the
  26568. display is physically attached. <var class="var">number</var> specifies the number of
  26569. the display server on that host machine. <var class="var">screen_number</var> specifies
  26570. the screen to be used on that server.
  26571. </p>
  26572. <p>If unspecified, it defaults to the value of the DISPLAY environment
  26573. variable.
  26574. </p>
  26575. <p>For example, <code class="code">dual-headed:0.1</code> would specify screen 1 of display
  26576. 0 on the machine named &ldquo;dual-headed&rdquo;.
  26577. </p>
  26578. <p>Check the X11 specification for more detailed information about the
  26579. display name format.
  26580. </p>
  26581. </dd>
  26582. <dt><samp class="option">window_id</samp></dt>
  26583. <dd><p>When set to non-zero value then device doesn&rsquo;t create new window,
  26584. but uses existing one with provided <var class="var">window_id</var>. By default
  26585. this options is set to zero and device creates its own window.
  26586. </p>
  26587. </dd>
  26588. <dt><samp class="option">window_size</samp></dt>
  26589. <dd><p>Set the created window size, can be a string of the form
  26590. <var class="var">width</var>x<var class="var">height</var> or a video size abbreviation. If not
  26591. specified it defaults to the size of the input video.
  26592. Ignored when <var class="var">window_id</var> is set.
  26593. </p>
  26594. </dd>
  26595. <dt><samp class="option">window_x</samp></dt>
  26596. <dt><samp class="option">window_y</samp></dt>
  26597. <dd><p>Set the X and Y window offsets for the created window. They are both
  26598. set to 0 by default. The values may be ignored by the window manager.
  26599. Ignored when <var class="var">window_id</var> is set.
  26600. </p>
  26601. </dd>
  26602. <dt><samp class="option">window_title</samp></dt>
  26603. <dd><p>Set the window title, if not specified default to the filename
  26604. specified for the output device. Ignored when <var class="var">window_id</var> is set.
  26605. </p></dd>
  26606. </dl>
  26607. <p>For more information about XVideo see <a class="url" href="http://www.x.org/">http://www.x.org/</a>.
  26608. </p>
  26609. <a name="Examples-44"></a>
  26610. <h4 class="subsection">27.10.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-44" aria-hidden="true">TOC</a></span></h4>
  26611. <ul class="itemize mark-bullet">
  26612. <li>Decode, display and encode video input with <code class="command">ffmpeg</code> at the
  26613. same time:
  26614. <div class="example">
  26615. <pre class="example-preformatted">ffmpeg -i INPUT OUTPUT -f xv display
  26616. </pre></div>
  26617. </li><li>Decode and display the input video to multiple X11 windows:
  26618. <div class="example">
  26619. <pre class="example-preformatted">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  26620. </pre></div>
  26621. </li></ul>
  26622. <a name="Resampler-Options"></a>
  26623. <h2 class="chapter">28 Resampler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Resampler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Resampler-Options" aria-hidden="true">TOC</a></span></h2>
  26624. <p>The audio resampler supports the following named options.
  26625. </p>
  26626. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  26627. FFmpeg tools, <var class="var">option</var>=<var class="var">value</var> for the aresample filter,
  26628. by setting the value explicitly in the
  26629. <code class="code">SwrContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API for
  26630. programmatic use.
  26631. </p>
  26632. <dl class="table">
  26633. <dt><samp class="option">uchl, used_chlayout</samp></dt>
  26634. <dd><p>Set used input channel layout. Default is unset. This option is
  26635. only used for special remapping.
  26636. </p>
  26637. </dd>
  26638. <dt><samp class="option">isr, in_sample_rate</samp></dt>
  26639. <dd><p>Set the input sample rate. Default value is 0.
  26640. </p>
  26641. </dd>
  26642. <dt><samp class="option">osr, out_sample_rate</samp></dt>
  26643. <dd><p>Set the output sample rate. Default value is 0.
  26644. </p>
  26645. </dd>
  26646. <dt><samp class="option">isf, in_sample_fmt</samp></dt>
  26647. <dd><p>Specify the input sample format. It is set by default to <code class="code">none</code>.
  26648. </p>
  26649. </dd>
  26650. <dt><samp class="option">osf, out_sample_fmt</samp></dt>
  26651. <dd><p>Specify the output sample format. It is set by default to <code class="code">none</code>.
  26652. </p>
  26653. </dd>
  26654. <dt><samp class="option">tsf, internal_sample_fmt</samp></dt>
  26655. <dd><p>Set the internal sample format. Default value is <code class="code">none</code>.
  26656. This will automatically be chosen when it is not explicitly set.
  26657. </p>
  26658. </dd>
  26659. <dt><samp class="option">ichl, in_chlayout</samp></dt>
  26660. <dt><samp class="option">ochl, out_chlayout</samp></dt>
  26661. <dd><p>Set the input/output channel layout.
  26662. </p>
  26663. <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>
  26664. for the required syntax.
  26665. </p>
  26666. </dd>
  26667. <dt><samp class="option">clev, center_mix_level</samp></dt>
  26668. <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
  26669. in the interval [-32,32].
  26670. </p>
  26671. </dd>
  26672. <dt><samp class="option">slev, surround_mix_level</samp></dt>
  26673. <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
  26674. be in the interval [-32,32].
  26675. </p>
  26676. </dd>
  26677. <dt><samp class="option">lfe_mix_level</samp></dt>
  26678. <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
  26679. LFE output. It is a value expressed in deciBel, and must
  26680. be in the interval [-32,32].
  26681. </p>
  26682. </dd>
  26683. <dt><samp class="option">rmvol, rematrix_volume</samp></dt>
  26684. <dd><p>Set rematrix volume. Default value is 1.0.
  26685. </p>
  26686. </dd>
  26687. <dt><samp class="option">rematrix_maxval</samp></dt>
  26688. <dd><p>Set maximum output value for rematrixing.
  26689. This can be used to prevent clipping vs. preventing volume reduction.
  26690. A value of 1.0 prevents clipping.
  26691. </p>
  26692. </dd>
  26693. <dt><samp class="option">flags, swr_flags</samp></dt>
  26694. <dd><p>Set flags used by the converter. Default value is 0.
  26695. </p>
  26696. <p>It supports the following individual flags:
  26697. </p><dl class="table">
  26698. <dt><samp class="option">res</samp></dt>
  26699. <dd><p>force resampling, this flag forces resampling to be used even when the
  26700. input and output sample rates match.
  26701. </p></dd>
  26702. </dl>
  26703. </dd>
  26704. <dt><samp class="option">dither_scale</samp></dt>
  26705. <dd><p>Set the dither scale. Default value is 1.
  26706. </p>
  26707. </dd>
  26708. <dt><samp class="option">dither_method</samp></dt>
  26709. <dd><p>Set dither method. Default value is 0.
  26710. </p>
  26711. <p>Supported values:
  26712. </p><dl class="table">
  26713. <dt>&lsquo;<samp class="samp">rectangular</samp>&rsquo;</dt>
  26714. <dd><p>select rectangular dither
  26715. </p></dd>
  26716. <dt>&lsquo;<samp class="samp">triangular</samp>&rsquo;</dt>
  26717. <dd><p>select triangular dither
  26718. </p></dd>
  26719. <dt>&lsquo;<samp class="samp">triangular_hp</samp>&rsquo;</dt>
  26720. <dd><p>select triangular dither with high pass
  26721. </p></dd>
  26722. <dt>&lsquo;<samp class="samp">lipshitz</samp>&rsquo;</dt>
  26723. <dd><p>select Lipshitz noise shaping dither.
  26724. </p></dd>
  26725. <dt>&lsquo;<samp class="samp">shibata</samp>&rsquo;</dt>
  26726. <dd><p>select Shibata noise shaping dither.
  26727. </p></dd>
  26728. <dt>&lsquo;<samp class="samp">low_shibata</samp>&rsquo;</dt>
  26729. <dd><p>select low Shibata noise shaping dither.
  26730. </p></dd>
  26731. <dt>&lsquo;<samp class="samp">high_shibata</samp>&rsquo;</dt>
  26732. <dd><p>select high Shibata noise shaping dither.
  26733. </p></dd>
  26734. <dt>&lsquo;<samp class="samp">f_weighted</samp>&rsquo;</dt>
  26735. <dd><p>select f-weighted noise shaping dither
  26736. </p></dd>
  26737. <dt>&lsquo;<samp class="samp">modified_e_weighted</samp>&rsquo;</dt>
  26738. <dd><p>select modified-e-weighted noise shaping dither
  26739. </p></dd>
  26740. <dt>&lsquo;<samp class="samp">improved_e_weighted</samp>&rsquo;</dt>
  26741. <dd><p>select improved-e-weighted noise shaping dither
  26742. </p>
  26743. </dd>
  26744. </dl>
  26745. </dd>
  26746. <dt><samp class="option">resampler</samp></dt>
  26747. <dd><p>Set resampling engine. Default value is swr.
  26748. </p>
  26749. <p>Supported values:
  26750. </p><dl class="table">
  26751. <dt>&lsquo;<samp class="samp">swr</samp>&rsquo;</dt>
  26752. <dd><p>select the native SW Resampler; filter options precision and cheby are not
  26753. applicable in this case.
  26754. </p></dd>
  26755. <dt>&lsquo;<samp class="samp">soxr</samp>&rsquo;</dt>
  26756. <dd><p>select the SoX Resampler (where available); compensation, and filter options
  26757. filter_size, phase_shift, exact_rational, filter_type &amp; kaiser_beta, are not
  26758. applicable in this case.
  26759. </p></dd>
  26760. </dl>
  26761. </dd>
  26762. <dt><samp class="option">filter_size</samp></dt>
  26763. <dd><p>For swr only, set resampling filter size, default value is 32.
  26764. </p>
  26765. </dd>
  26766. <dt><samp class="option">phase_shift</samp></dt>
  26767. <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
  26768. the interval [0,30].
  26769. </p>
  26770. </dd>
  26771. <dt><samp class="option">linear_interp</samp></dt>
  26772. <dd><p>Use linear interpolation when enabled (the default). Disable it if you want
  26773. to preserve speed instead of quality when exact_rational fails.
  26774. </p>
  26775. </dd>
  26776. <dt><samp class="option">exact_rational</samp></dt>
  26777. <dd><p>For swr only, when enabled, try to use exact phase_count based on input and
  26778. output sample rate. However, if it is larger than <code class="code">1 &lt;&lt; phase_shift</code>,
  26779. the phase_count will be <code class="code">1 &lt;&lt; phase_shift</code> as fallback. Default is enabled.
  26780. </p>
  26781. </dd>
  26782. <dt><samp class="option">cutoff</samp></dt>
  26783. <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  26784. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  26785. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  26786. </p>
  26787. </dd>
  26788. <dt><samp class="option">precision</samp></dt>
  26789. <dd><p>For soxr only, the precision in bits to which the resampled signal will be
  26790. calculated. The default value of 20 (which, with suitable dithering, is
  26791. appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
  26792. value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
  26793. </p>
  26794. </dd>
  26795. <dt><samp class="option">cheby</samp></dt>
  26796. <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
  26797. approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
  26798. </p>
  26799. </dd>
  26800. <dt><samp class="option">async</samp></dt>
  26801. <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
  26802. squeezing, filling and trimming. Setting this to 1 will enable filling and
  26803. trimming, larger values represent the maximum amount in samples that the data
  26804. may be stretched or squeezed for each second.
  26805. Default value is 0, thus no compensation is applied to make the samples match
  26806. the audio timestamps.
  26807. </p>
  26808. </dd>
  26809. <dt><samp class="option">first_pts</samp></dt>
  26810. <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  26811. This allows for padding/trimming at the start of stream. By default, no
  26812. assumption is made about the first frame&rsquo;s expected pts, so no padding or
  26813. trimming is done. For example, this could be set to 0 to pad the beginning with
  26814. silence if an audio stream starts after the video stream or to trim any samples
  26815. with a negative pts due to encoder delay.
  26816. </p>
  26817. </dd>
  26818. <dt><samp class="option">min_comp</samp></dt>
  26819. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  26820. seconds) to trigger stretching/squeezing/filling or trimming of the
  26821. data to make it match the timestamps. The default is that
  26822. stretching/squeezing/filling and trimming is disabled
  26823. (<samp class="option">min_comp</samp> = <code class="code">FLT_MAX</code>).
  26824. </p>
  26825. </dd>
  26826. <dt><samp class="option">min_hard_comp</samp></dt>
  26827. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  26828. seconds) to trigger adding/dropping samples to make it match the
  26829. timestamps. This option effectively is a threshold to select between
  26830. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  26831. all compensation is by default disabled through <samp class="option">min_comp</samp>.
  26832. The default is 0.1.
  26833. </p>
  26834. </dd>
  26835. <dt><samp class="option">comp_duration</samp></dt>
  26836. <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
  26837. to make it match the timestamps. Must be a non-negative double float value,
  26838. default value is 1.0.
  26839. </p>
  26840. </dd>
  26841. <dt><samp class="option">max_soft_comp</samp></dt>
  26842. <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
  26843. match the timestamps. Must be a non-negative double float value, default value
  26844. is 0.
  26845. </p>
  26846. </dd>
  26847. <dt><samp class="option">matrix_encoding</samp></dt>
  26848. <dd><p>Select matrixed stereo encoding.
  26849. </p>
  26850. <p>It accepts the following values:
  26851. </p><dl class="table">
  26852. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  26853. <dd><p>select none
  26854. </p></dd>
  26855. <dt>&lsquo;<samp class="samp">dolby</samp>&rsquo;</dt>
  26856. <dd><p>select Dolby
  26857. </p></dd>
  26858. <dt>&lsquo;<samp class="samp">dplii</samp>&rsquo;</dt>
  26859. <dd><p>select Dolby Pro Logic II
  26860. </p></dd>
  26861. </dl>
  26862. <p>Default value is <code class="code">none</code>.
  26863. </p>
  26864. </dd>
  26865. <dt><samp class="option">filter_type</samp></dt>
  26866. <dd><p>For swr only, select resampling filter type. This only affects resampling
  26867. operations.
  26868. </p>
  26869. <p>It accepts the following values:
  26870. </p><dl class="table">
  26871. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  26872. <dd><p>select cubic
  26873. </p></dd>
  26874. <dt>&lsquo;<samp class="samp">blackman_nuttall</samp>&rsquo;</dt>
  26875. <dd><p>select Blackman Nuttall windowed sinc
  26876. </p></dd>
  26877. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  26878. <dd><p>select Kaiser windowed sinc
  26879. </p></dd>
  26880. </dl>
  26881. </dd>
  26882. <dt><samp class="option">kaiser_beta</samp></dt>
  26883. <dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
  26884. interval [2,16], default value is 9.
  26885. </p>
  26886. </dd>
  26887. <dt><samp class="option">output_sample_bits</samp></dt>
  26888. <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
  26889. interval [0,64], default value is 0, which means it&rsquo;s not used.
  26890. </p>
  26891. </dd>
  26892. </dl>
  26893. <a class="anchor" id="scaler_005foptions"></a><a name="Scaler-Options"></a>
  26894. <h2 class="chapter">29 Scaler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Scaler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaler-Options" aria-hidden="true">TOC</a></span></h2>
  26895. <p>The video scaler supports the following named options.
  26896. </p>
  26897. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  26898. FFmpeg tools, with a few API-only exceptions noted below.
  26899. For programmatic use, they can be set explicitly in the
  26900. <code class="code">SwsContext</code> options or through the <samp class="file">libavutil/opt.h</samp> API.
  26901. </p>
  26902. <dl class="table">
  26903. <dd>
  26904. <a class="anchor" id="sws_005fflags"></a></dd>
  26905. <dt><samp class="option">sws_flags</samp></dt>
  26906. <dd><p>Set the scaler flags. This is also used to set the scaling
  26907. algorithm. Only a single algorithm should be selected. Default
  26908. value is &lsquo;<samp class="samp">bicubic</samp>&rsquo;.
  26909. </p>
  26910. <p>It accepts the following values:
  26911. </p><dl class="table">
  26912. <dt>&lsquo;<samp class="samp">fast_bilinear</samp>&rsquo;</dt>
  26913. <dd><p>Select fast bilinear scaling algorithm.
  26914. </p>
  26915. </dd>
  26916. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  26917. <dd><p>Select bilinear scaling algorithm.
  26918. </p>
  26919. </dd>
  26920. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  26921. <dd><p>Select bicubic scaling algorithm.
  26922. </p>
  26923. </dd>
  26924. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  26925. <dd><p>Select experimental scaling algorithm.
  26926. </p>
  26927. </dd>
  26928. <dt>&lsquo;<samp class="samp">neighbor</samp>&rsquo;</dt>
  26929. <dd><p>Select nearest neighbor rescaling algorithm.
  26930. </p>
  26931. </dd>
  26932. <dt>&lsquo;<samp class="samp">area</samp>&rsquo;</dt>
  26933. <dd><p>Select averaging area rescaling algorithm.
  26934. </p>
  26935. </dd>
  26936. <dt>&lsquo;<samp class="samp">bicublin</samp>&rsquo;</dt>
  26937. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  26938. chroma components.
  26939. </p>
  26940. </dd>
  26941. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  26942. <dd><p>Select Gaussian rescaling algorithm.
  26943. </p>
  26944. </dd>
  26945. <dt>&lsquo;<samp class="samp">sinc</samp>&rsquo;</dt>
  26946. <dd><p>Select sinc rescaling algorithm.
  26947. </p>
  26948. </dd>
  26949. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  26950. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  26951. changed by setting <code class="code">param0</code>.
  26952. </p>
  26953. </dd>
  26954. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  26955. <dd><p>Select natural bicubic spline rescaling algorithm.
  26956. </p>
  26957. </dd>
  26958. <dt>&lsquo;<samp class="samp">print_info</samp>&rsquo;</dt>
  26959. <dd><p>Enable printing/debug logging.
  26960. </p>
  26961. </dd>
  26962. <dt>&lsquo;<samp class="samp">accurate_rnd</samp>&rsquo;</dt>
  26963. <dd><p>Enable accurate rounding.
  26964. </p>
  26965. </dd>
  26966. <dt>&lsquo;<samp class="samp">full_chroma_int</samp>&rsquo;</dt>
  26967. <dd><p>Enable full chroma interpolation.
  26968. </p>
  26969. </dd>
  26970. <dt>&lsquo;<samp class="samp">full_chroma_inp</samp>&rsquo;</dt>
  26971. <dd><p>Select full chroma input.
  26972. </p>
  26973. </dd>
  26974. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  26975. <dd><p>Enable bitexact output.
  26976. </p>
  26977. </dd>
  26978. <dt>&lsquo;<samp class="samp">unstable</samp>&rsquo;</dt>
  26979. <dd><p>Allow the use of experimental new code. May subtly affect the output or even
  26980. produce wrong results. For testing only.
  26981. </p></dd>
  26982. </dl>
  26983. </dd>
  26984. <dt><samp class="option">srcw <var class="var">(API only)</var></samp></dt>
  26985. <dd><p>Set source width.
  26986. </p>
  26987. </dd>
  26988. <dt><samp class="option">srch <var class="var">(API only)</var></samp></dt>
  26989. <dd><p>Set source height.
  26990. </p>
  26991. </dd>
  26992. <dt><samp class="option">dstw <var class="var">(API only)</var></samp></dt>
  26993. <dd><p>Set destination width.
  26994. </p>
  26995. </dd>
  26996. <dt><samp class="option">dsth <var class="var">(API only)</var></samp></dt>
  26997. <dd><p>Set destination height.
  26998. </p>
  26999. </dd>
  27000. <dt><samp class="option">src_format <var class="var">(API only)</var></samp></dt>
  27001. <dd><p>Set source pixel format (must be expressed as an integer).
  27002. </p>
  27003. </dd>
  27004. <dt><samp class="option">dst_format <var class="var">(API only)</var></samp></dt>
  27005. <dd><p>Set destination pixel format (must be expressed as an integer).
  27006. </p>
  27007. </dd>
  27008. <dt><samp class="option">src_range <var class="var">(boolean)</var></samp></dt>
  27009. <dd><p>If value is set to <code class="code">1</code>, indicates source is full range. Default value is
  27010. <code class="code">0</code>, which indicates source is limited range.
  27011. </p>
  27012. </dd>
  27013. <dt><samp class="option">dst_range <var class="var">(boolean)</var></samp></dt>
  27014. <dd><p>If value is set to <code class="code">1</code>, enable full range for destination. Default value
  27015. is <code class="code">0</code>, which enables limited range.
  27016. </p>
  27017. </dd>
  27018. <dt><samp class="option">gamma <var class="var">(boolean)</var></samp></dt>
  27019. <dd><p>If value is set to <code class="code">1</code>, enable gamma correct scaling. Default value is <code class="code">0</code>.
  27020. </p>
  27021. <a class="anchor" id="sws_005fparams"></a></dd>
  27022. <dt><samp class="option">param0, param1</samp></dt>
  27023. <dd><p>Set scaling algorithm parameters. The specified values are specific of
  27024. some scaling algorithms and ignored by others. The specified values
  27025. are floating point number values.
  27026. </p>
  27027. </dd>
  27028. <dt><samp class="option">sws_dither</samp></dt>
  27029. <dd><p>Set the dithering algorithm. Accepts one of the following
  27030. values. Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  27031. </p>
  27032. <dl class="table">
  27033. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  27034. <dd><p>automatic choice
  27035. </p>
  27036. </dd>
  27037. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  27038. <dd><p>no dithering
  27039. </p>
  27040. </dd>
  27041. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  27042. <dd><p>bayer dither
  27043. </p>
  27044. </dd>
  27045. <dt>&lsquo;<samp class="samp">ed</samp>&rsquo;</dt>
  27046. <dd><p>error diffusion dither
  27047. </p>
  27048. </dd>
  27049. <dt>&lsquo;<samp class="samp">a_dither</samp>&rsquo;</dt>
  27050. <dd><p>arithmetic dither, based using addition
  27051. </p>
  27052. </dd>
  27053. <dt>&lsquo;<samp class="samp">x_dither</samp>&rsquo;</dt>
  27054. <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
  27055. a_dither).
  27056. </p>
  27057. </dd>
  27058. </dl>
  27059. </dd>
  27060. <dt><samp class="option">alphablend</samp></dt>
  27061. <dd><p>Set the alpha blending to use when the input has alpha but the output does not.
  27062. Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  27063. </p>
  27064. <dl class="table">
  27065. <dt>&lsquo;<samp class="samp">uniform_color</samp>&rsquo;</dt>
  27066. <dd><p>Blend onto a uniform background color
  27067. </p>
  27068. </dd>
  27069. <dt>&lsquo;<samp class="samp">checkerboard</samp>&rsquo;</dt>
  27070. <dd><p>Blend onto a checkerboard
  27071. </p>
  27072. </dd>
  27073. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  27074. <dd><p>No blending
  27075. </p>
  27076. </dd>
  27077. </dl>
  27078. </dd>
  27079. </dl>
  27080. <a name="Filtering-Introduction"></a>
  27081. <h2 class="chapter">30 Filtering Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Filtering-Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtering-Introduction" aria-hidden="true">TOC</a></span></h2>
  27082. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  27083. </p>
  27084. <p>In libavfilter, a filter can have multiple inputs and multiple
  27085. outputs.
  27086. To illustrate the sorts of things that are possible, we consider the
  27087. following filtergraph.
  27088. </p>
  27089. <pre class="verbatim"> [main]
  27090. input --&gt; split ---------------------&gt; overlay --&gt; output
  27091. | ^
  27092. |[tmp] [flip]|
  27093. +-----&gt; crop --&gt; vflip -------+
  27094. </pre>
  27095. <p>This filtergraph splits the input stream in two streams, then sends one
  27096. stream through the crop filter and the vflip filter, before merging it
  27097. back with the other stream by overlaying it on top. You can use the
  27098. following command to achieve this:
  27099. </p>
  27100. <div class="example">
  27101. <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
  27102. </pre></div>
  27103. <p>The result will be that the top half of the video is mirrored
  27104. onto the bottom half of the output video.
  27105. </p>
  27106. <p>Filters in the same linear chain are separated by commas, and distinct
  27107. linear chains of filters are separated by semicolons. In our example,
  27108. <var class="var">crop,vflip</var> are in one linear chain, <var class="var">split</var> and
  27109. <var class="var">overlay</var> are separately in another. The points where the linear
  27110. chains join are labelled by names enclosed in square brackets. In the
  27111. example, the split filter generates two outputs that are associated to
  27112. the labels <var class="var">[main]</var> and <var class="var">[tmp]</var>.
  27113. </p>
  27114. <p>The stream sent to the second output of <var class="var">split</var>, labelled as
  27115. <var class="var">[tmp]</var>, is processed through the <var class="var">crop</var> filter, which crops
  27116. away the lower half part of the video, and then vertically flipped. The
  27117. <var class="var">overlay</var> filter takes in input the first unchanged output of the
  27118. split filter (which was labelled as <var class="var">[main]</var>), and overlay on its
  27119. lower half the output generated by the <var class="var">crop,vflip</var> filterchain.
  27120. </p>
  27121. <p>Some filters take in input a list of parameters: they are specified
  27122. after the filter name and an equal sign, and are separated from each other
  27123. by a colon.
  27124. </p>
  27125. <p>There exist so-called <var class="var">source filters</var> that do not have an
  27126. audio/video input, and <var class="var">sink filters</var> that will not have audio/video
  27127. output.
  27128. </p>
  27129. <a name="graph2dot"></a>
  27130. <h2 class="chapter">31 graph2dot<span class="pull-right"><a class="anchor hidden-xs" href="#graph2dot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graph2dot" aria-hidden="true">TOC</a></span></h2>
  27131. <p>The <samp class="file">graph2dot</samp> program included in the FFmpeg <samp class="file">tools</samp>
  27132. directory can be used to parse a filtergraph description and issue a
  27133. corresponding textual representation in the dot language.
  27134. </p>
  27135. <p>Invoke the command:
  27136. </p><div class="example">
  27137. <pre class="example-preformatted">graph2dot -h
  27138. </pre></div>
  27139. <p>to see how to use <samp class="file">graph2dot</samp>.
  27140. </p>
  27141. <p>You can then pass the dot description to the <samp class="file">dot</samp> program (from
  27142. the graphviz suite of programs) and obtain a graphical representation
  27143. of the filtergraph.
  27144. </p>
  27145. <p>For example the sequence of commands:
  27146. </p><div class="example">
  27147. <pre class="example-preformatted">echo <var class="var">GRAPH_DESCRIPTION</var> | \
  27148. tools/graph2dot -o graph.tmp &amp;&amp; \
  27149. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  27150. display graph.png
  27151. </pre></div>
  27152. <p>can be used to create and display an image representing the graph
  27153. described by the <var class="var">GRAPH_DESCRIPTION</var> string. Note that this string must be
  27154. a complete self-contained graph, with its inputs and outputs explicitly defined.
  27155. For example if your command line is of the form:
  27156. </p><div class="example">
  27157. <pre class="example-preformatted">ffmpeg -i infile -vf scale=640:360 outfile
  27158. </pre></div>
  27159. <p>your <var class="var">GRAPH_DESCRIPTION</var> string will need to be of the form:
  27160. </p><div class="example">
  27161. <pre class="example-preformatted">nullsrc,scale=640:360,nullsink
  27162. </pre></div>
  27163. <p>you may also need to set the <var class="var">nullsrc</var> parameters and add a <var class="var">format</var>
  27164. filter in order to simulate a specific input file.
  27165. </p>
  27166. <a name="Filtergraph-description"></a>
  27167. <h2 class="chapter">32 Filtergraph description<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-description" aria-hidden="true">TOC</a></span></h2>
  27168. <p>A filtergraph is a directed graph of connected filters. It can contain
  27169. cycles, and there can be multiple links between a pair of
  27170. filters. Each link has one input pad on one side connecting it to one
  27171. filter from which it takes its input, and one output pad on the other
  27172. side connecting it to one filter accepting its output.
  27173. </p>
  27174. <p>Each filter in a filtergraph is an instance of a filter class
  27175. registered in the application, which defines the features and the
  27176. number of input and output pads of the filter.
  27177. </p>
  27178. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  27179. output pads is called a &quot;sink&quot;.
  27180. </p>
  27181. <a class="anchor" id="Filtergraph-syntax"></a><a name="Filtergraph-syntax-1"></a>
  27182. <h3 class="section">32.1 Filtergraph syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-syntax-1" aria-hidden="true">TOC</a></span></h3>
  27183. <p>A filtergraph has a textual representation, which is recognized by the
  27184. <samp class="option">-filter</samp>/<samp class="option">-vf</samp>/<samp class="option">-af</samp> and
  27185. <samp class="option">-filter_complex</samp> options in <code class="command">ffmpeg</code> and
  27186. <samp class="option">-vf</samp>/<samp class="option">-af</samp> in <code class="command">ffplay</code>, and by the
  27187. <code class="code">avfilter_graph_parse_ptr()</code> function defined in
  27188. <samp class="file">libavfilter/avfilter.h</samp>.
  27189. </p>
  27190. <p>A filterchain consists of a sequence of connected filters, each one
  27191. connected to the previous one in the sequence. A filterchain is
  27192. represented by a list of &quot;,&quot;-separated filter descriptions.
  27193. </p>
  27194. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  27195. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  27196. descriptions.
  27197. </p>
  27198. <p>A filter is represented by a string of the form:
  27199. [<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>]
  27200. </p>
  27201. <p><var class="var">filter_name</var> is the name of the filter class of which the
  27202. described filter is an instance of, and has to be the name of one of
  27203. the filter classes registered in the program optionally followed by &quot;@<var class="var">id</var>&quot;.
  27204. The name of the filter class is optionally followed by a string
  27205. &quot;=<var class="var">arguments</var>&quot;.
  27206. </p>
  27207. <p><var class="var">arguments</var> is a string which contains the parameters used to
  27208. initialize the filter instance. It may have one of two forms:
  27209. </p><ul class="itemize mark-bullet">
  27210. <li>A &rsquo;:&rsquo;-separated list of <var class="var">key=value</var> pairs.
  27211. </li><li>A &rsquo;:&rsquo;-separated list of <var class="var">value</var>. In this case, the keys are assumed to be
  27212. the option names in the order they are declared. E.g. the <code class="code">fade</code> filter
  27213. declares three options in this order &ndash; <samp class="option">type</samp>, <samp class="option">start_frame</samp> and
  27214. <samp class="option">nb_frames</samp>. Then the parameter list <var class="var">in:0:30</var> means that the value
  27215. <var class="var">in</var> is assigned to the option <samp class="option">type</samp>, <var class="var">0</var> to
  27216. <samp class="option">start_frame</samp> and <var class="var">30</var> to <samp class="option">nb_frames</samp>.
  27217. </li><li>A &rsquo;:&rsquo;-separated list of mixed direct <var class="var">value</var> and long <var class="var">key=value</var>
  27218. pairs. The direct <var class="var">value</var> must precede the <var class="var">key=value</var> pairs, and
  27219. follow the same constraints order of the previous point. The following
  27220. <var class="var">key=value</var> pairs can be set in any preferred order.
  27221. </li></ul>
  27222. <p>If the option value itself is a list of items (e.g. the <code class="code">format</code> filter
  27223. takes a list of pixel formats), the items in the list are usually separated by
  27224. &lsquo;<samp class="samp">|</samp>&rsquo;.
  27225. </p>
  27226. <p>The list of arguments can be quoted using the character &lsquo;<samp class="samp">'</samp>&rsquo; as initial
  27227. and ending mark, and the character &lsquo;<samp class="samp">\</samp>&rsquo; for escaping the characters
  27228. within the quoted text; otherwise the argument string is considered
  27229. terminated when the next special character (belonging to the set
  27230. &lsquo;<samp class="samp">[]=;,</samp>&rsquo;) is encountered.
  27231. </p>
  27232. <p>A special syntax implemented in the <code class="command">ffmpeg</code> CLI tool allows loading
  27233. option values from files. This is done be prepending a slash &rsquo;/&rsquo; to the option
  27234. name, then the supplied value is interpreted as a path from which the actual
  27235. value is loaded. E.g.
  27236. </p><div class="example">
  27237. <pre class="example-preformatted">ffmpeg -i &lt;INPUT&gt; -vf drawtext=/text=/tmp/some_text &lt;OUTPUT&gt;
  27238. </pre></div>
  27239. <p>will load the text to be drawn from <samp class="file">/tmp/some_text</samp>. API users wishing to
  27240. implement a similar feature should use the <code class="code">avfilter_graph_segment_*()</code>
  27241. functions together with custom IO code.
  27242. </p>
  27243. <p>The name and arguments of the filter are optionally preceded and
  27244. followed by a list of link labels.
  27245. A link label allows one to name a link and associate it to a filter output
  27246. or input pad. The preceding labels <var class="var">in_link_1</var>
  27247. ... <var class="var">in_link_N</var>, are associated to the filter input pads,
  27248. the following labels <var class="var">out_link_1</var> ... <var class="var">out_link_M</var>, are
  27249. associated to the output pads.
  27250. </p>
  27251. <p>When two link labels with the same name are found in the
  27252. filtergraph, a link between the corresponding input and output pad is
  27253. created.
  27254. </p>
  27255. <p>If an output pad is not labelled, it is linked by default to the first
  27256. unlabelled input pad of the next filter in the filterchain.
  27257. For example in the filterchain
  27258. </p><div class="example">
  27259. <pre class="example-preformatted">nullsrc, split[L1], [L2]overlay, nullsink
  27260. </pre></div>
  27261. <p>the split filter instance has two output pads, and the overlay filter
  27262. instance two input pads. The first output pad of split is labelled
  27263. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  27264. output pad of split is linked to the second input pad of overlay,
  27265. which are both unlabelled.
  27266. </p>
  27267. <p>In a filter description, if the input label of the first filter is not
  27268. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  27269. specified, &quot;out&quot; is assumed.
  27270. </p>
  27271. <p>In a complete filterchain all the unlabelled filter input and output
  27272. pads must be connected. A filtergraph is considered valid if all the
  27273. filter input and output pads of all the filterchains are connected.
  27274. </p>
  27275. <p>Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens
  27276. in the filtergraph specification are ignored. This means that the filtergraph
  27277. can be expressed using empty lines and spaces to improve readability.
  27278. </p>
  27279. <p>For example, the filtergraph:
  27280. </p><div class="example">
  27281. <pre class="example-preformatted">testsrc,split[L1],hflip[L2];[L1][L2] hstack
  27282. </pre></div>
  27283. <p>can be represented as:
  27284. </p><div class="example">
  27285. <pre class="example-preformatted">testsrc,
  27286. split [L1], hflip [L2];
  27287. [L1][L2] hstack
  27288. </pre></div>
  27289. <p>Libavfilter will automatically insert <a class="ref" href="#scale">scale</a> filters where format
  27290. conversion is required. It is possible to specify swscale flags
  27291. for those automatically inserted scalers by prepending
  27292. <code class="code">sws_flags=<var class="var">flags</var>;</code>
  27293. to the filtergraph description.
  27294. </p>
  27295. <p>Here is a BNF description of the filtergraph syntax:
  27296. </p><div class="example">
  27297. <pre class="example-preformatted"><var class="var">NAME</var> ::= sequence of alphanumeric characters and '_'
  27298. <var class="var">FILTER_NAME</var> ::= <var class="var">NAME</var>[&quot;@&quot;<var class="var">NAME</var>]
  27299. <var class="var">LINKLABEL</var> ::= &quot;[&quot; <var class="var">NAME</var> &quot;]&quot;
  27300. <var class="var">LINKLABELS</var> ::= <var class="var">LINKLABEL</var> [<var class="var">LINKLABELS</var>]
  27301. <var class="var">FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  27302. <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>]
  27303. <var class="var">FILTERCHAIN</var> ::= <var class="var">FILTER</var> [,<var class="var">FILTERCHAIN</var>]
  27304. <var class="var">FILTERGRAPH</var> ::= [sws_flags=<var class="var">flags</var>;] <var class="var">FILTERCHAIN</var> [;<var class="var">FILTERGRAPH</var>]
  27305. </pre></div>
  27306. <a class="anchor" id="filtergraph-escaping"></a><a name="Notes-on-filtergraph-escaping"></a>
  27307. <h3 class="section">32.2 Notes on filtergraph escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Notes-on-filtergraph-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Notes-on-filtergraph-escaping" aria-hidden="true">TOC</a></span></h3>
  27308. <p>Filtergraph description composition entails several levels of
  27309. escaping. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  27310. section in the ffmpeg-utils(1) manual</a> for more
  27311. information about the employed escaping procedure.
  27312. </p>
  27313. <p>A first level escaping affects the content of each filter option
  27314. value, which may contain the special character <code class="code">:</code> used to
  27315. separate values, or one of the escaping characters <code class="code">\'</code>.
  27316. </p>
  27317. <p>A second level escaping affects the whole filter description, which
  27318. may contain the escaping characters <code class="code">\'</code> or the special
  27319. characters <code class="code">[],;</code> used by the filtergraph description.
  27320. </p>
  27321. <p>Finally, when you specify a filtergraph on a shell commandline, you
  27322. need to perform a third level escaping for the shell special
  27323. characters contained within it.
  27324. </p>
  27325. <p>For example, consider the following string to be embedded in
  27326. the <a class="ref" href="#drawtext">drawtext</a> filter description <samp class="option">text</samp> value:
  27327. </p><div class="example">
  27328. <pre class="example-preformatted">this is a 'string': may contain one, or more, special characters
  27329. </pre></div>
  27330. <p>This string contains the <code class="code">'</code> special escaping character, and the
  27331. <code class="code">:</code> special character, so it needs to be escaped in this way:
  27332. </p><div class="example">
  27333. <pre class="example-preformatted">text=this is a \'string\'\: may contain one, or more, special characters
  27334. </pre></div>
  27335. <p>A second level of escaping is required when embedding the filter
  27336. description in a filtergraph description, in order to escape all the
  27337. filtergraph special characters. Thus the example above becomes:
  27338. </p><div class="example">
  27339. <pre class="example-preformatted">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  27340. </pre></div>
  27341. <p>(note that in addition to the <code class="code">\'</code> escaping special characters,
  27342. also <code class="code">,</code> needs to be escaped).
  27343. </p>
  27344. <p>Finally an additional level of escaping is needed when writing the
  27345. filtergraph description in a shell command, which depends on the
  27346. escaping rules of the adopted shell. For example, assuming that
  27347. <code class="code">\</code> is special and needs to be escaped with another <code class="code">\</code>, the
  27348. previous string will finally result in:
  27349. </p><div class="example">
  27350. <pre class="example-preformatted">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  27351. </pre></div>
  27352. <p>In order to avoid cumbersome escaping when using a commandline tool accepting a
  27353. filter specification as input, it is advisable to avoid direct inclusion of the
  27354. filter or options specification in the shell.
  27355. </p>
  27356. <p>For example, in case of the <a class="ref" href="#drawtext">drawtext filter</a>, you might prefer to
  27357. use the <samp class="option">textfile</samp> option in place of <samp class="option">text</samp> to specify the text
  27358. to render.
  27359. </p>
  27360. <a name="Timeline-editing"></a>
  27361. <h2 class="chapter">33 Timeline editing<span class="pull-right"><a class="anchor hidden-xs" href="#Timeline-editing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timeline-editing" aria-hidden="true">TOC</a></span></h2>
  27362. <p>Some filters support a generic <samp class="option">enable</samp> option. For the filters
  27363. supporting timeline editing, this option can be set to an expression which is
  27364. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  27365. the filter will be enabled, otherwise the frame will be sent unchanged to the
  27366. next filter in the filtergraph.
  27367. </p>
  27368. <p>The expression accepts the following values:
  27369. </p><dl class="table">
  27370. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  27371. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  27372. </p>
  27373. </dd>
  27374. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  27375. <dd><p>sequential number of the input frame, starting from 0
  27376. </p>
  27377. </dd>
  27378. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  27379. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated, do
  27380. not use
  27381. </p>
  27382. </dd>
  27383. <dt>&lsquo;<samp class="samp">w</samp>&rsquo;</dt>
  27384. <dt>&lsquo;<samp class="samp">h</samp>&rsquo;</dt>
  27385. <dd><p>width and height of the input frame if video
  27386. </p></dd>
  27387. </dl>
  27388. <p>Additionally, these filters support an <samp class="option">enable</samp> command that can be used
  27389. to re-define the expression.
  27390. </p>
  27391. <p>Like any other filtering option, the <samp class="option">enable</samp> option follows the same
  27392. rules.
  27393. </p>
  27394. <p>For example, to enable a blur filter (<a class="ref" href="#smartblur">smartblur</a>) from 10 seconds to 3
  27395. minutes, and a <a class="ref" href="#curves">curves</a> filter starting at 3 seconds:
  27396. </p><div class="example">
  27397. <pre class="example-preformatted">smartblur = enable='between(t,10,3*60)',
  27398. curves = enable='gte(t,3)' : preset=cross_process
  27399. </pre></div>
  27400. <p>See <code class="code">ffmpeg -filters</code> to view which filters have timeline support.
  27401. </p>
  27402. <a class="anchor" id="commands"></a><a name="Changing-options-at-runtime-with-a-command"></a>
  27403. <h2 class="chapter">34 Changing options at runtime with a command<span class="pull-right"><a class="anchor hidden-xs" href="#Changing-options-at-runtime-with-a-command" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Changing-options-at-runtime-with-a-command" aria-hidden="true">TOC</a></span></h2>
  27404. <p>Some options can be changed during the operation of the filter using
  27405. a command. These options are marked &rsquo;T&rsquo; on the output of
  27406. <code class="command">ffmpeg</code> <samp class="option">-h filter=&lt;name of filter&gt;</samp>.
  27407. The name of the command is the name of the option and the argument is
  27408. the new value.
  27409. </p>
  27410. <a class="anchor" id="framesync"></a><a name="Options-for-filters-with-several-inputs-_0028framesync_0029"></a>
  27411. <h2 class="chapter">35 Options for filters with several inputs (framesync)<span class="pull-right"><a class="anchor hidden-xs" href="#Options-for-filters-with-several-inputs-_0028framesync_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-for-filters-with-several-inputs-_0028framesync_0029" aria-hidden="true">TOC</a></span></h2>
  27412. <p>Some filters with several inputs support a common set of options.
  27413. These options can only be set by name, not with the short notation.
  27414. </p>
  27415. <dl class="table">
  27416. <dt><samp class="option">eof_action</samp></dt>
  27417. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  27418. one of the following values:
  27419. </p>
  27420. <dl class="table">
  27421. <dt><samp class="option">repeat</samp></dt>
  27422. <dd><p>Repeat the last frame (the default).
  27423. </p></dd>
  27424. <dt><samp class="option">endall</samp></dt>
  27425. <dd><p>End both streams.
  27426. </p></dd>
  27427. <dt><samp class="option">pass</samp></dt>
  27428. <dd><p>Pass the main input through.
  27429. </p></dd>
  27430. </dl>
  27431. </dd>
  27432. <dt><samp class="option">shortest</samp></dt>
  27433. <dd><p>If set to 1, force the output to terminate when the shortest input
  27434. terminates. Default value is 0.
  27435. </p>
  27436. </dd>
  27437. <dt><samp class="option">repeatlast</samp></dt>
  27438. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  27439. until the end of the primary stream. A value of 0 disables this behavior.
  27440. Default value is 1.
  27441. </p>
  27442. </dd>
  27443. <dt><samp class="option">ts_sync_mode</samp></dt>
  27444. <dd><p>How strictly to sync streams based on secondary input timestamps; it accepts
  27445. one of the following values:
  27446. </p>
  27447. <dl class="table">
  27448. <dt><samp class="option">default</samp></dt>
  27449. <dd><p>Frame from secondary input with the nearest lower or equal timestamp to the
  27450. primary input frame.
  27451. </p></dd>
  27452. <dt><samp class="option">nearest</samp></dt>
  27453. <dd><p>Frame from secondary input with the absolute nearest timestamp to the primary
  27454. input frame.
  27455. </p></dd>
  27456. </dl>
  27457. </dd>
  27458. </dl>
  27459. <a name="Audio-Filters"></a>
  27460. <h2 class="chapter">36 Audio Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Filters" aria-hidden="true">TOC</a></span></h2>
  27461. <p>When you configure your FFmpeg build, you can disable any of the
  27462. existing filters using <code class="code">--disable-filters</code>.
  27463. The configure output will show the audio filters included in your
  27464. build.
  27465. </p>
  27466. <p>Below is a description of the currently available audio filters.
  27467. </p>
  27468. <a name="aap"></a>
  27469. <h3 class="section">36.1 aap<span class="pull-right"><a class="anchor hidden-xs" href="#aap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aap" aria-hidden="true">TOC</a></span></h3>
  27470. <p>Apply Affine Projection algorithm to the first audio stream using the second audio stream.
  27471. </p>
  27472. <p>This adaptive filter is used to estimate unknown audio based on multiple input audio samples.
  27473. Affine projection algorithm can make trade-offs between computation complexity with convergence speed.
  27474. </p>
  27475. <p>A description of the accepted options follows.
  27476. </p>
  27477. <dl class="table">
  27478. <dt><samp class="option">order</samp></dt>
  27479. <dd><p>Set the filter order.
  27480. </p>
  27481. </dd>
  27482. <dt><samp class="option">projection</samp></dt>
  27483. <dd><p>Set the projection order.
  27484. </p>
  27485. </dd>
  27486. <dt><samp class="option">mu</samp></dt>
  27487. <dd><p>Set the filter mu.
  27488. </p>
  27489. </dd>
  27490. <dt><samp class="option">delta</samp></dt>
  27491. <dd><p>Set the coefficient to initialize internal covariance matrix.
  27492. </p>
  27493. </dd>
  27494. <dt><samp class="option">out_mode</samp></dt>
  27495. <dd><p>Set the filter output samples. It accepts the following values:
  27496. </p><dl class="table">
  27497. <dt><samp class="option">i</samp></dt>
  27498. <dd><p>Pass the 1st input.
  27499. </p>
  27500. </dd>
  27501. <dt><samp class="option">d</samp></dt>
  27502. <dd><p>Pass the 2nd input.
  27503. </p>
  27504. </dd>
  27505. <dt><samp class="option">o</samp></dt>
  27506. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  27507. </p>
  27508. </dd>
  27509. <dt><samp class="option">n</samp></dt>
  27510. <dd><p>Pass difference between input, 1st input and error signal estimate.
  27511. </p>
  27512. </dd>
  27513. <dt><samp class="option">e</samp></dt>
  27514. <dd><p>Pass error signal estimated samples.
  27515. </p>
  27516. <p>Default value is <var class="var">o</var>.
  27517. </p></dd>
  27518. </dl>
  27519. </dd>
  27520. <dt><samp class="option">precision</samp></dt>
  27521. <dd><p>Set which precision to use when processing samples.
  27522. </p>
  27523. <dl class="table">
  27524. <dt><samp class="option">auto</samp></dt>
  27525. <dd><p>Auto pick internal sample format depending on other filters.
  27526. </p>
  27527. </dd>
  27528. <dt><samp class="option">float</samp></dt>
  27529. <dd><p>Always use single-floating point precision sample format.
  27530. </p>
  27531. </dd>
  27532. <dt><samp class="option">double</samp></dt>
  27533. <dd><p>Always use double-floating point precision sample format.
  27534. </p></dd>
  27535. </dl>
  27536. </dd>
  27537. </dl>
  27538. <a name="acompressor"></a>
  27539. <h3 class="section">36.2 acompressor<span class="pull-right"><a class="anchor hidden-xs" href="#acompressor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acompressor" aria-hidden="true">TOC</a></span></h3>
  27540. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  27541. Especially modern music is mostly compressed at a high ratio to
  27542. improve the overall loudness. It&rsquo;s done to get the highest attention
  27543. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  27544. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  27545. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  27546. but can also destroy a track completely).
  27547. The right compression is the key to reach a professional sound and is
  27548. the high art of mixing and mastering. Because of its complex settings
  27549. it may take a long time to get the right feeling for this kind of effect.
  27550. </p>
  27551. <p>Compression is done by detecting the volume above a chosen level
  27552. <code class="code">threshold</code> and dividing it by the factor set with <code class="code">ratio</code>.
  27553. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  27554. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  27555. the signal would cause distortion of the waveform the reduction can be
  27556. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  27557. <code class="code">attack</code> determines how long the signal has to rise above the threshold
  27558. before any reduction will occur and <code class="code">release</code> sets the time the signal
  27559. has to fall below the threshold to reduce the reduction again. Shorter signals
  27560. than the chosen attack time will be left untouched.
  27561. The overall reduction of the signal can be made up afterwards with the
  27562. <code class="code">makeup</code> setting. So compressing the peaks of a signal about 6dB and
  27563. raising the makeup to this level results in a signal twice as loud than the
  27564. source. To gain a softer entry in the compression the <code class="code">knee</code> flattens the
  27565. hard edge at the threshold in the range of the chosen decibels.
  27566. </p>
  27567. <p>The filter accepts the following options:
  27568. </p>
  27569. <dl class="table">
  27570. <dt><samp class="option">level_in</samp></dt>
  27571. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  27572. </p>
  27573. </dd>
  27574. <dt><samp class="option">mode</samp></dt>
  27575. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  27576. Default is <code class="code">downward</code>.
  27577. </p>
  27578. </dd>
  27579. <dt><samp class="option">threshold</samp></dt>
  27580. <dd><p>If a signal of stream rises above this level it will affect the gain
  27581. reduction.
  27582. By default it is 0.125. Range is between 0.00097563 and 1.
  27583. </p>
  27584. </dd>
  27585. <dt><samp class="option">ratio</samp></dt>
  27586. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  27587. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  27588. Default is 2. Range is between 1 and 20.
  27589. </p>
  27590. </dd>
  27591. <dt><samp class="option">attack</samp></dt>
  27592. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  27593. reduction starts. Default is 20. Range is between 0.01 and 2000.
  27594. </p>
  27595. </dd>
  27596. <dt><samp class="option">release</samp></dt>
  27597. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  27598. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  27599. </p>
  27600. </dd>
  27601. <dt><samp class="option">makeup</samp></dt>
  27602. <dd><p>Set the amount by how much signal will be amplified after processing.
  27603. Default is 1. Range is from 1 to 64.
  27604. </p>
  27605. </dd>
  27606. <dt><samp class="option">knee</samp></dt>
  27607. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  27608. Default is 2.82843. Range is between 1 and 8.
  27609. </p>
  27610. </dd>
  27611. <dt><samp class="option">link</samp></dt>
  27612. <dd><p>Choose if the <code class="code">average</code> level between all channels of input stream
  27613. or the louder(<code class="code">maximum</code>) channel of input stream affects the
  27614. reduction. Default is <code class="code">average</code>.
  27615. </p>
  27616. </dd>
  27617. <dt><samp class="option">detection</samp></dt>
  27618. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  27619. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mostly smoother.
  27620. </p>
  27621. </dd>
  27622. <dt><samp class="option">mix</samp></dt>
  27623. <dd><p>How much to use compressed signal in output. Default is 1.
  27624. Range is between 0 and 1.
  27625. </p></dd>
  27626. </dl>
  27627. <a name="Commands"></a>
  27628. <h4 class="subsection">36.2.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands" aria-hidden="true">TOC</a></span></h4>
  27629. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27630. </p>
  27631. <a name="acontrast"></a>
  27632. <h3 class="section">36.3 acontrast<span class="pull-right"><a class="anchor hidden-xs" href="#acontrast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acontrast" aria-hidden="true">TOC</a></span></h3>
  27633. <p>Simple audio dynamic range compression/expansion filter.
  27634. </p>
  27635. <p>The filter accepts the following options:
  27636. </p>
  27637. <dl class="table">
  27638. <dt><samp class="option">contrast</samp></dt>
  27639. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  27640. </p></dd>
  27641. </dl>
  27642. <a name="acopy"></a>
  27643. <h3 class="section">36.4 acopy<span class="pull-right"><a class="anchor hidden-xs" href="#acopy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acopy" aria-hidden="true">TOC</a></span></h3>
  27644. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  27645. testing purposes.
  27646. </p>
  27647. <a name="acrossfade"></a>
  27648. <h3 class="section">36.5 acrossfade<span class="pull-right"><a class="anchor hidden-xs" href="#acrossfade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrossfade" aria-hidden="true">TOC</a></span></h3>
  27649. <p>Apply cross fade from one input audio stream to another input audio stream.
  27650. The cross fade is applied for specified duration near the end of first stream.
  27651. </p>
  27652. <p>The filter accepts the following options:
  27653. </p>
  27654. <dl class="table">
  27655. <dt><samp class="option">inputs, n</samp></dt>
  27656. <dd><p>Specify the number of inputs to crossfade. When crossfading multiple inputs,
  27657. each input will be concatenated and crossfaded in sequence, similar to the
  27658. <a class="ref" href="#concat-filter">concat filter</a>. Default is 2.
  27659. </p>
  27660. </dd>
  27661. <dt><samp class="option">nb_samples, ns</samp></dt>
  27662. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  27663. At the end of the cross fade effect the first input audio will be completely
  27664. silent. Default is 44100.
  27665. </p>
  27666. </dd>
  27667. <dt><samp class="option">duration, d</samp></dt>
  27668. <dd><p>Specify the duration of the cross fade effect. See
  27669. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  27670. for the accepted syntax.
  27671. By default the duration is determined by <var class="var">nb_samples</var>.
  27672. If set this option is used instead of <var class="var">nb_samples</var>.
  27673. </p>
  27674. </dd>
  27675. <dt><samp class="option">overlap, o</samp></dt>
  27676. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  27677. </p>
  27678. </dd>
  27679. <dt><samp class="option">curve1</samp></dt>
  27680. <dd><p>Set curve for cross fade transition for first stream.
  27681. </p>
  27682. </dd>
  27683. <dt><samp class="option">curve2</samp></dt>
  27684. <dd><p>Set curve for cross fade transition for second stream.
  27685. </p>
  27686. <p>For description of available curve types see <a class="ref" href="#afade">afade</a> filter description.
  27687. </p></dd>
  27688. </dl>
  27689. <a name="Examples-45"></a>
  27690. <h4 class="subsection">36.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-45" aria-hidden="true">TOC</a></span></h4>
  27691. <ul class="itemize mark-bullet">
  27692. <li>Cross fade from one input to another:
  27693. <div class="example">
  27694. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  27695. </pre></div>
  27696. </li><li>Cross fade from one input to another but without overlapping:
  27697. <div class="example">
  27698. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  27699. </pre></div>
  27700. <p>Concatenate multiple inputs with cross fade between each:
  27701. </p><div class="example">
  27702. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -i third.flac -filter_complex acrossfade=n=3 output.flac
  27703. </pre></div>
  27704. </li></ul>
  27705. <a name="acrossover"></a>
  27706. <h3 class="section">36.6 acrossover<span class="pull-right"><a class="anchor hidden-xs" href="#acrossover" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrossover" aria-hidden="true">TOC</a></span></h3>
  27707. <p>Split audio stream into several bands.
  27708. </p>
  27709. <p>This filter splits audio stream into two or more frequency ranges.
  27710. Summing all streams back will give flat output.
  27711. </p>
  27712. <p>The filter accepts the following options:
  27713. </p>
  27714. <dl class="table">
  27715. <dt><samp class="option">split</samp></dt>
  27716. <dd><p>Set split frequencies. Those must be positive and increasing.
  27717. </p>
  27718. </dd>
  27719. <dt><samp class="option">order</samp></dt>
  27720. <dd><p>Set filter order for each band split. This controls filter roll-off or steepness
  27721. of filter transfer function.
  27722. Available values are:
  27723. </p>
  27724. <dl class="table">
  27725. <dt>&lsquo;<samp class="samp">2nd</samp>&rsquo;</dt>
  27726. <dd><p>12 dB per octave.
  27727. </p></dd>
  27728. <dt>&lsquo;<samp class="samp">4th</samp>&rsquo;</dt>
  27729. <dd><p>24 dB per octave.
  27730. </p></dd>
  27731. <dt>&lsquo;<samp class="samp">6th</samp>&rsquo;</dt>
  27732. <dd><p>36 dB per octave.
  27733. </p></dd>
  27734. <dt>&lsquo;<samp class="samp">8th</samp>&rsquo;</dt>
  27735. <dd><p>48 dB per octave.
  27736. </p></dd>
  27737. <dt>&lsquo;<samp class="samp">10th</samp>&rsquo;</dt>
  27738. <dd><p>60 dB per octave.
  27739. </p></dd>
  27740. <dt>&lsquo;<samp class="samp">12th</samp>&rsquo;</dt>
  27741. <dd><p>72 dB per octave.
  27742. </p></dd>
  27743. <dt>&lsquo;<samp class="samp">14th</samp>&rsquo;</dt>
  27744. <dd><p>84 dB per octave.
  27745. </p></dd>
  27746. <dt>&lsquo;<samp class="samp">16th</samp>&rsquo;</dt>
  27747. <dd><p>96 dB per octave.
  27748. </p></dd>
  27749. <dt>&lsquo;<samp class="samp">18th</samp>&rsquo;</dt>
  27750. <dd><p>108 dB per octave.
  27751. </p></dd>
  27752. <dt>&lsquo;<samp class="samp">20th</samp>&rsquo;</dt>
  27753. <dd><p>120 dB per octave.
  27754. </p></dd>
  27755. </dl>
  27756. <p>Default is <var class="var">4th</var>.
  27757. </p>
  27758. </dd>
  27759. <dt><samp class="option">level</samp></dt>
  27760. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  27761. </p>
  27762. </dd>
  27763. <dt><samp class="option">gains</samp></dt>
  27764. <dd><p>Set output gain for each band. Default value is 1 for all bands.
  27765. </p>
  27766. </dd>
  27767. <dt><samp class="option">precision</samp></dt>
  27768. <dd><p>Set which precision to use when processing samples.
  27769. </p>
  27770. <dl class="table">
  27771. <dt><samp class="option">auto</samp></dt>
  27772. <dd><p>Auto pick internal sample format depending on other filters.
  27773. </p>
  27774. </dd>
  27775. <dt><samp class="option">float</samp></dt>
  27776. <dd><p>Always use single-floating point precision sample format.
  27777. </p>
  27778. </dd>
  27779. <dt><samp class="option">double</samp></dt>
  27780. <dd><p>Always use double-floating point precision sample format.
  27781. </p></dd>
  27782. </dl>
  27783. <p>Default value is <code class="code">auto</code>.
  27784. </p></dd>
  27785. </dl>
  27786. <a name="Examples-46"></a>
  27787. <h4 class="subsection">36.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-46" aria-hidden="true">TOC</a></span></h4>
  27788. <ul class="itemize mark-bullet">
  27789. <li>Split input audio stream into two bands (low and high) with split frequency of 1500 Hz,
  27790. each band will be in separate stream:
  27791. <div class="example">
  27792. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  27793. </pre></div>
  27794. </li><li>Same as above, but with higher filter order:
  27795. <div class="example">
  27796. <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
  27797. </pre></div>
  27798. </li><li>Same as above, but also with additional middle band (frequencies between 1500 and 8000):
  27799. <div class="example">
  27800. <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
  27801. </pre></div>
  27802. </li></ul>
  27803. <a name="acrusher"></a>
  27804. <h3 class="section">36.7 acrusher<span class="pull-right"><a class="anchor hidden-xs" href="#acrusher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrusher" aria-hidden="true">TOC</a></span></h3>
  27805. <p>Reduce audio bit resolution.
  27806. </p>
  27807. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  27808. is used to audibly reduce number of bits an audio signal is sampled
  27809. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  27810. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  27811. This filter is able to even round to continuous values instead of discrete
  27812. bit depths.
  27813. Additionally it has a D/C offset which results in different crushing of
  27814. the lower and the upper half of the signal.
  27815. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  27816. </p>
  27817. <p>Another feature of this filter is the logarithmic mode.
  27818. This setting switches from linear distances between bits to logarithmic ones.
  27819. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  27820. signals for example. The human ear has a logarithmic perception,
  27821. so this kind of crushing is much more pleasant.
  27822. Logarithmic crushing is also able to get anti-aliased.
  27823. </p>
  27824. <p>The filter accepts the following options:
  27825. </p>
  27826. <dl class="table">
  27827. <dt><samp class="option">level_in</samp></dt>
  27828. <dd><p>Set level in.
  27829. </p>
  27830. </dd>
  27831. <dt><samp class="option">level_out</samp></dt>
  27832. <dd><p>Set level out.
  27833. </p>
  27834. </dd>
  27835. <dt><samp class="option">bits</samp></dt>
  27836. <dd><p>Set bit reduction.
  27837. </p>
  27838. </dd>
  27839. <dt><samp class="option">mix</samp></dt>
  27840. <dd><p>Set mixing amount.
  27841. </p>
  27842. </dd>
  27843. <dt><samp class="option">mode</samp></dt>
  27844. <dd><p>Can be linear: <code class="code">lin</code> or logarithmic: <code class="code">log</code>.
  27845. </p>
  27846. </dd>
  27847. <dt><samp class="option">dc</samp></dt>
  27848. <dd><p>Set DC.
  27849. </p>
  27850. </dd>
  27851. <dt><samp class="option">aa</samp></dt>
  27852. <dd><p>Set anti-aliasing.
  27853. </p>
  27854. </dd>
  27855. <dt><samp class="option">samples</samp></dt>
  27856. <dd><p>Set sample reduction.
  27857. </p>
  27858. </dd>
  27859. <dt><samp class="option">lfo</samp></dt>
  27860. <dd><p>Enable LFO. By default disabled.
  27861. </p>
  27862. </dd>
  27863. <dt><samp class="option">lforange</samp></dt>
  27864. <dd><p>Set LFO range.
  27865. </p>
  27866. </dd>
  27867. <dt><samp class="option">lforate</samp></dt>
  27868. <dd><p>Set LFO rate.
  27869. </p></dd>
  27870. </dl>
  27871. <a name="Commands-1"></a>
  27872. <h4 class="subsection">36.7.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-1" aria-hidden="true">TOC</a></span></h4>
  27873. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27874. </p>
  27875. <a name="acue"></a>
  27876. <h3 class="section">36.8 acue<span class="pull-right"><a class="anchor hidden-xs" href="#acue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acue" aria-hidden="true">TOC</a></span></h3>
  27877. <p>Delay audio filtering until a given wallclock timestamp. See the <a class="ref" href="#cue">cue</a>
  27878. filter.
  27879. </p>
  27880. <a name="adeclick"></a>
  27881. <h3 class="section">36.9 adeclick<span class="pull-right"><a class="anchor hidden-xs" href="#adeclick" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adeclick" aria-hidden="true">TOC</a></span></h3>
  27882. <p>Remove impulsive noise from input audio.
  27883. </p>
  27884. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  27885. autoregressive modelling.
  27886. </p>
  27887. <dl class="table">
  27888. <dt><samp class="option">window, w</samp></dt>
  27889. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to
  27890. <code class="code">100</code>. Default value is <code class="code">55</code> milliseconds.
  27891. This sets size of window which will be processed at once.
  27892. </p>
  27893. </dd>
  27894. <dt><samp class="option">overlap, o</samp></dt>
  27895. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  27896. <code class="code">50</code> to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  27897. Setting this to a very high value increases impulsive noise removal but makes
  27898. whole process much slower.
  27899. </p>
  27900. </dd>
  27901. <dt><samp class="option">arorder, a</samp></dt>
  27902. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  27903. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">2</code> percent. This option also
  27904. controls quality of interpolated samples using neighbour good samples.
  27905. </p>
  27906. </dd>
  27907. <dt><samp class="option">threshold, t</samp></dt>
  27908. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  27909. Default value is <code class="code">2</code>.
  27910. This controls the strength of impulsive noise which is going to be removed.
  27911. The lower value, the more samples will be detected as impulsive noise.
  27912. </p>
  27913. </dd>
  27914. <dt><samp class="option">burst, b</samp></dt>
  27915. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code class="code">0</code> to
  27916. <code class="code">10</code>. Default value is <code class="code">2</code>.
  27917. If any two samples detected as noise are spaced less than this value then any
  27918. sample between those two samples will be also detected as noise.
  27919. </p>
  27920. </dd>
  27921. <dt><samp class="option">method, m</samp></dt>
  27922. <dd><p>Set overlap method.
  27923. </p>
  27924. <p>It accepts the following values:
  27925. </p><dl class="table">
  27926. <dt><samp class="option">add, a</samp></dt>
  27927. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  27928. changed with this method.
  27929. </p>
  27930. </dd>
  27931. <dt><samp class="option">save, s</samp></dt>
  27932. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  27933. </p></dd>
  27934. </dl>
  27935. <p>Default value is <code class="code">a</code>.
  27936. </p></dd>
  27937. </dl>
  27938. <a name="adeclip"></a>
  27939. <h3 class="section">36.10 adeclip<span class="pull-right"><a class="anchor hidden-xs" href="#adeclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adeclip" aria-hidden="true">TOC</a></span></h3>
  27940. <p>Remove clipped samples from input audio.
  27941. </p>
  27942. <p>Samples detected as clipped are replaced by interpolated samples using
  27943. autoregressive modelling.
  27944. </p>
  27945. <dl class="table">
  27946. <dt><samp class="option">window, w</samp></dt>
  27947. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to <code class="code">100</code>.
  27948. Default value is <code class="code">55</code> milliseconds.
  27949. This sets size of window which will be processed at once.
  27950. </p>
  27951. </dd>
  27952. <dt><samp class="option">overlap, o</samp></dt>
  27953. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code class="code">50</code>
  27954. to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  27955. </p>
  27956. </dd>
  27957. <dt><samp class="option">arorder, a</samp></dt>
  27958. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  27959. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">8</code> percent. This option also controls
  27960. quality of interpolated samples using neighbour good samples.
  27961. </p>
  27962. </dd>
  27963. <dt><samp class="option">threshold, t</samp></dt>
  27964. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  27965. Default value is <code class="code">10</code>. Higher values make clip detection less aggressive.
  27966. </p>
  27967. </dd>
  27968. <dt><samp class="option">hsize, n</samp></dt>
  27969. <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>.
  27970. Default value is <code class="code">1000</code>. Higher values make clip detection less aggressive.
  27971. </p>
  27972. </dd>
  27973. <dt><samp class="option">method, m</samp></dt>
  27974. <dd><p>Set overlap method.
  27975. </p>
  27976. <p>It accepts the following values:
  27977. </p><dl class="table">
  27978. <dt><samp class="option">add, a</samp></dt>
  27979. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  27980. with this method.
  27981. </p>
  27982. </dd>
  27983. <dt><samp class="option">save, s</samp></dt>
  27984. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  27985. </p></dd>
  27986. </dl>
  27987. <p>Default value is <code class="code">a</code>.
  27988. </p></dd>
  27989. </dl>
  27990. <a name="adecorrelate"></a>
  27991. <h3 class="section">36.11 adecorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#adecorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adecorrelate" aria-hidden="true">TOC</a></span></h3>
  27992. <p>Apply decorrelation to input audio stream.
  27993. </p>
  27994. <p>The filter accepts the following options:
  27995. </p>
  27996. <dl class="table">
  27997. <dt><samp class="option">stages</samp></dt>
  27998. <dd><p>Set decorrelation stages of filtering. Allowed
  27999. range is from 1 to 16. Default value is 6.
  28000. </p>
  28001. </dd>
  28002. <dt><samp class="option">seed</samp></dt>
  28003. <dd><p>Set random seed used for setting delay in samples across channels.
  28004. </p></dd>
  28005. </dl>
  28006. <a name="adelay"></a>
  28007. <h3 class="section">36.12 adelay<span class="pull-right"><a class="anchor hidden-xs" href="#adelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adelay" aria-hidden="true">TOC</a></span></h3>
  28008. <p>Delay one or more audio channels.
  28009. </p>
  28010. <p>Samples in delayed channel are filled with silence.
  28011. </p>
  28012. <p>The filter accepts the following option:
  28013. </p>
  28014. <dl class="table">
  28015. <dt><samp class="option">delays</samp></dt>
  28016. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  28017. Unused delays will be silently ignored. If number of given delays is
  28018. smaller than number of channels all remaining channels will not be delayed.
  28019. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  28020. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  28021. </p>
  28022. </dd>
  28023. <dt><samp class="option">all</samp></dt>
  28024. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  28025. This option if enabled changes how option <code class="code">delays</code> is interpreted.
  28026. </p></dd>
  28027. </dl>
  28028. <a name="Examples-47"></a>
  28029. <h4 class="subsection">36.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-47" aria-hidden="true">TOC</a></span></h4>
  28030. <ul class="itemize mark-bullet">
  28031. <li>Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  28032. the second channel (and any other channels that may be present) unchanged.
  28033. <div class="example">
  28034. <pre class="example-preformatted">adelay=1500|0|500
  28035. </pre></div>
  28036. </li><li>Delay second channel by 500 samples, the third channel by 700 samples and leave
  28037. the first channel (and any other channels that may be present) unchanged.
  28038. <div class="example">
  28039. <pre class="example-preformatted">adelay=0|500S|700S
  28040. </pre></div>
  28041. </li><li>Delay all channels by same number of samples:
  28042. <div class="example">
  28043. <pre class="example-preformatted">adelay=delays=64S:all=1
  28044. </pre></div>
  28045. </li></ul>
  28046. <a name="adenorm"></a>
  28047. <h3 class="section">36.13 adenorm<span class="pull-right"><a class="anchor hidden-xs" href="#adenorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adenorm" aria-hidden="true">TOC</a></span></h3>
  28048. <p>Remedy denormals in audio by adding extremely low-level noise.
  28049. </p>
  28050. <p>This filter shall be placed before any filter that can produce denormals.
  28051. </p>
  28052. <p>A description of the accepted parameters follows.
  28053. </p>
  28054. <dl class="table">
  28055. <dt><samp class="option">level</samp></dt>
  28056. <dd><p>Set level of added noise in dB. Default is <code class="code">-351</code>.
  28057. Allowed range is from -451 to -90.
  28058. </p>
  28059. </dd>
  28060. <dt><samp class="option">type</samp></dt>
  28061. <dd><p>Set type of added noise.
  28062. </p>
  28063. <dl class="table">
  28064. <dt><samp class="option">dc</samp></dt>
  28065. <dd><p>Add DC signal.
  28066. </p></dd>
  28067. <dt><samp class="option">ac</samp></dt>
  28068. <dd><p>Add AC signal.
  28069. </p></dd>
  28070. <dt><samp class="option">square</samp></dt>
  28071. <dd><p>Add square signal.
  28072. </p></dd>
  28073. <dt><samp class="option">pulse</samp></dt>
  28074. <dd><p>Add pulse signal.
  28075. </p></dd>
  28076. </dl>
  28077. <p>Default is <code class="code">dc</code>.
  28078. </p></dd>
  28079. </dl>
  28080. <a name="Commands-2"></a>
  28081. <h4 class="subsection">36.13.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-2" aria-hidden="true">TOC</a></span></h4>
  28082. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28083. </p>
  28084. <a name="aderivative_002c-aintegral"></a>
  28085. <h3 class="section">36.14 aderivative, aintegral<span class="pull-right"><a class="anchor hidden-xs" href="#aderivative_002c-aintegral" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aderivative_002c-aintegral" aria-hidden="true">TOC</a></span></h3>
  28086. <p>Compute derivative/integral of audio stream.
  28087. </p>
  28088. <p>Applying both filters one after another produces original audio.
  28089. </p>
  28090. <a name="adrc"></a>
  28091. <h3 class="section">36.15 adrc<span class="pull-right"><a class="anchor hidden-xs" href="#adrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adrc" aria-hidden="true">TOC</a></span></h3>
  28092. <p>Apply spectral dynamic range controller filter to input audio stream.
  28093. </p>
  28094. <p>A description of the accepted options follows.
  28095. </p>
  28096. <dl class="table">
  28097. <dt><samp class="option">transfer</samp></dt>
  28098. <dd><p>Set the transfer expression.
  28099. </p>
  28100. <p>The expression can contain the following constants:
  28101. </p>
  28102. <dl class="table">
  28103. <dt><samp class="option">ch</samp></dt>
  28104. <dd><p>current channel number
  28105. </p>
  28106. </dd>
  28107. <dt><samp class="option">sn</samp></dt>
  28108. <dd><p>current sample number
  28109. </p>
  28110. </dd>
  28111. <dt><samp class="option">nb_channels</samp></dt>
  28112. <dd><p>number of channels
  28113. </p>
  28114. </dd>
  28115. <dt><samp class="option">t</samp></dt>
  28116. <dd><p>timestamp expressed in seconds
  28117. </p>
  28118. </dd>
  28119. <dt><samp class="option">sr</samp></dt>
  28120. <dd><p>sample rate
  28121. </p>
  28122. </dd>
  28123. <dt><samp class="option">p</samp></dt>
  28124. <dd><p>current frequency power value, in dB
  28125. </p>
  28126. </dd>
  28127. <dt><samp class="option">f</samp></dt>
  28128. <dd><p>current frequency in Hz
  28129. </p></dd>
  28130. </dl>
  28131. <p>Default value is <code class="code">p</code>.
  28132. </p>
  28133. </dd>
  28134. <dt><samp class="option">attack</samp></dt>
  28135. <dd><p>Set the attack in milliseconds. Default is <code class="code">50</code> milliseconds.
  28136. Allowed range is from 1 to 1000 milliseconds.
  28137. </p></dd>
  28138. <dt><samp class="option">release</samp></dt>
  28139. <dd><p>Set the release in milliseconds. Default is <code class="code">100</code> milliseconds.
  28140. Allowed range is from 5 to 2000 milliseconds.
  28141. </p></dd>
  28142. <dt><samp class="option">channels</samp></dt>
  28143. <dd><p>Set which channels to filter, by default <code class="code">all</code> channels in audio stream are filtered.
  28144. </p></dd>
  28145. </dl>
  28146. <a name="Commands-3"></a>
  28147. <h4 class="subsection">36.15.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-3" aria-hidden="true">TOC</a></span></h4>
  28148. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28149. </p>
  28150. <a name="Examples-48"></a>
  28151. <h4 class="subsection">36.15.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-48" aria-hidden="true">TOC</a></span></h4>
  28152. <ul class="itemize mark-bullet">
  28153. <li>Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio:
  28154. <div class="example">
  28155. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
  28156. </pre></div>
  28157. </li><li>Similar to above but with 1:2 ratio and filtering only front center channel:
  28158. <div class="example">
  28159. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
  28160. </pre></div>
  28161. </li><li>Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time:
  28162. <div class="example">
  28163. <pre class="example-preformatted">adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
  28164. </pre></div>
  28165. </li><li>Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio:
  28166. <div class="example">
  28167. <pre class="example-preformatted">adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
  28168. </pre></div>
  28169. </li><li>Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms:
  28170. <div class="example">
  28171. <pre class="example-preformatted">adrc=transfer='min(p,-60)':attack=2:release=10
  28172. </pre></div>
  28173. </li></ul>
  28174. <a name="adynamicequalizer"></a>
  28175. <h3 class="section">36.16 adynamicequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#adynamicequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adynamicequalizer" aria-hidden="true">TOC</a></span></h3>
  28176. <p>Apply dynamic equalization to input audio stream.
  28177. </p>
  28178. <p>A description of the accepted options follows.
  28179. </p>
  28180. <dl class="table">
  28181. <dt><samp class="option">threshold</samp></dt>
  28182. <dd><p>Set the detection threshold used to trigger equalization.
  28183. Threshold detection is using detection filter.
  28184. Default value is 0. Allowed range is from 0 to 100.
  28185. </p>
  28186. </dd>
  28187. <dt><samp class="option">dfrequency</samp></dt>
  28188. <dd><p>Set the detection frequency in Hz used for detection filter used to trigger equalization.
  28189. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  28190. </p>
  28191. </dd>
  28192. <dt><samp class="option">dqfactor</samp></dt>
  28193. <dd><p>Set the detection resonance factor for detection filter used to trigger equalization.
  28194. Default value is 1. Allowed range is from 0.001 to 1000.
  28195. </p>
  28196. </dd>
  28197. <dt><samp class="option">tfrequency</samp></dt>
  28198. <dd><p>Set the target frequency of equalization filter.
  28199. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  28200. </p>
  28201. </dd>
  28202. <dt><samp class="option">tqfactor</samp></dt>
  28203. <dd><p>Set the target resonance factor for target equalization filter.
  28204. Default value is 1. Allowed range is from 0.001 to 1000.
  28205. </p>
  28206. </dd>
  28207. <dt><samp class="option">attack</samp></dt>
  28208. <dd><p>Set the amount of milliseconds the signal from detection has to rise above
  28209. the detection threshold before equalization starts.
  28210. Default is 20. Allowed range is between 1 and 2000.
  28211. </p>
  28212. </dd>
  28213. <dt><samp class="option">release</samp></dt>
  28214. <dd><p>Set the amount of milliseconds the signal from detection has to fall below the
  28215. detection threshold before equalization ends.
  28216. Default is 200. Allowed range is between 1 and 2000.
  28217. </p>
  28218. </dd>
  28219. <dt><samp class="option">ratio</samp></dt>
  28220. <dd><p>Set the ratio by which the equalization gain is raised.
  28221. Default is 1. Allowed range is between 0 and 30.
  28222. </p>
  28223. </dd>
  28224. <dt><samp class="option">makeup</samp></dt>
  28225. <dd><p>Set the makeup offset by which the equalization gain is raised.
  28226. Default is 0. Allowed range is between 0 and 100.
  28227. </p>
  28228. </dd>
  28229. <dt><samp class="option">range</samp></dt>
  28230. <dd><p>Set the max allowed cut/boost amount. Default is 50.
  28231. Allowed range is from 1 to 200.
  28232. </p>
  28233. </dd>
  28234. <dt><samp class="option">mode</samp></dt>
  28235. <dd><p>Set the mode of filter operation, can be one of the following:
  28236. </p>
  28237. <dl class="table">
  28238. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  28239. <dd><p>Output only isolated detection signal.
  28240. </p></dd>
  28241. <dt>&lsquo;<samp class="samp">cutbelow</samp>&rsquo;</dt>
  28242. <dd><p>Cut frequencies below detection threshold.
  28243. </p></dd>
  28244. <dt>&lsquo;<samp class="samp">cutabove</samp>&rsquo;</dt>
  28245. <dd><p>Cut frequencies above detection threshold.
  28246. </p></dd>
  28247. <dt>&lsquo;<samp class="samp">boostbelow</samp>&rsquo;</dt>
  28248. <dd><p>Boost frequencies below detection threshold.
  28249. </p></dd>
  28250. <dt>&lsquo;<samp class="samp">boostabove</samp>&rsquo;</dt>
  28251. <dd><p>Boost frequencies above detection threshold.
  28252. </p></dd>
  28253. </dl>
  28254. <p>Default mode is &lsquo;<samp class="samp">cutbelow</samp>&rsquo;.
  28255. </p>
  28256. </dd>
  28257. <dt><samp class="option">dftype</samp></dt>
  28258. <dd><p>Set the type of detection filter, can be one of the following:
  28259. </p>
  28260. <dl class="table">
  28261. <dt>&lsquo;<samp class="samp">bandpass</samp>&rsquo;</dt>
  28262. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  28263. <dt>&lsquo;<samp class="samp">highpass</samp>&rsquo;</dt>
  28264. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  28265. </dl>
  28266. <p>Default type is &lsquo;<samp class="samp">bandpass</samp>&rsquo;.
  28267. </p>
  28268. </dd>
  28269. <dt><samp class="option">tftype</samp></dt>
  28270. <dd><p>Set the type of target filter, can be one of the following:
  28271. </p>
  28272. <dl class="table">
  28273. <dt>&lsquo;<samp class="samp">bell</samp>&rsquo;</dt>
  28274. <dt>&lsquo;<samp class="samp">lowshelf</samp>&rsquo;</dt>
  28275. <dt>&lsquo;<samp class="samp">highshelf</samp>&rsquo;</dt>
  28276. </dl>
  28277. <p>Default type is &lsquo;<samp class="samp">bell</samp>&rsquo;.
  28278. </p>
  28279. </dd>
  28280. <dt><samp class="option">auto</samp></dt>
  28281. <dd><p>Automatically gather threshold from detection filter. By default
  28282. is &lsquo;<samp class="samp">disabled</samp>&rsquo;.
  28283. This option is useful to detect threshold in certain time frame of
  28284. input audio stream, in such case option value is changed at runtime.
  28285. </p>
  28286. <p>Available values are:
  28287. </p><dl class="table">
  28288. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  28289. <dd><p>Disable using automatically gathered threshold value.
  28290. </p></dd>
  28291. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  28292. <dd><p>Stop picking threshold value.
  28293. </p></dd>
  28294. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  28295. <dd><p>Start picking threshold value.
  28296. </p></dd>
  28297. <dt>&lsquo;<samp class="samp">adaptive</samp>&rsquo;</dt>
  28298. <dd><p>Adaptively pick threshold value, by calculating sliding window entropy.
  28299. </p></dd>
  28300. </dl>
  28301. </dd>
  28302. <dt><samp class="option">precision</samp></dt>
  28303. <dd><p>Set which precision to use when processing samples.
  28304. </p>
  28305. <dl class="table">
  28306. <dt><samp class="option">auto</samp></dt>
  28307. <dd><p>Auto pick internal sample format depending on other filters.
  28308. </p>
  28309. </dd>
  28310. <dt><samp class="option">float</samp></dt>
  28311. <dd><p>Always use single-floating point precision sample format.
  28312. </p>
  28313. </dd>
  28314. <dt><samp class="option">double</samp></dt>
  28315. <dd><p>Always use double-floating point precision sample format.
  28316. </p></dd>
  28317. </dl>
  28318. </dd>
  28319. </dl>
  28320. <a name="Commands-4"></a>
  28321. <h4 class="subsection">36.16.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-4" aria-hidden="true">TOC</a></span></h4>
  28322. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28323. </p>
  28324. <a name="adynamicsmooth"></a>
  28325. <h3 class="section">36.17 adynamicsmooth<span class="pull-right"><a class="anchor hidden-xs" href="#adynamicsmooth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adynamicsmooth" aria-hidden="true">TOC</a></span></h3>
  28326. <p>Apply dynamic smoothing to input audio stream.
  28327. </p>
  28328. <p>A description of the accepted options follows.
  28329. </p>
  28330. <dl class="table">
  28331. <dt><samp class="option">sensitivity</samp></dt>
  28332. <dd><p>Set an amount of sensitivity to frequency fluctations. Default is 2.
  28333. Allowed range is from 0 to 1e+06.
  28334. </p>
  28335. </dd>
  28336. <dt><samp class="option">basefreq</samp></dt>
  28337. <dd><p>Set a base frequency for smoothing. Default value is 22050.
  28338. Allowed range is from 2 to 1e+06.
  28339. </p></dd>
  28340. </dl>
  28341. <a name="Commands-5"></a>
  28342. <h4 class="subsection">36.17.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-5" aria-hidden="true">TOC</a></span></h4>
  28343. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28344. </p>
  28345. <a name="aecho"></a>
  28346. <h3 class="section">36.18 aecho<span class="pull-right"><a class="anchor hidden-xs" href="#aecho" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aecho" aria-hidden="true">TOC</a></span></h3>
  28347. <p>Apply echoing to the input audio.
  28348. </p>
  28349. <p>Echoes are reflected sound and can occur naturally amongst mountains
  28350. (and sometimes large buildings) when talking or shouting; digital echo
  28351. effects emulate this behaviour and are often used to help fill out the
  28352. sound of a single instrument or vocal. The time difference between the
  28353. original signal and the reflection is the <code class="code">delay</code>, and the
  28354. loudness of the reflected signal is the <code class="code">decay</code>.
  28355. Multiple echoes can have different delays and decays.
  28356. </p>
  28357. <p>A description of the accepted parameters follows.
  28358. </p>
  28359. <dl class="table">
  28360. <dt><samp class="option">in_gain</samp></dt>
  28361. <dd><p>Set input gain of reflected signal. Default is <code class="code">0.6</code>.
  28362. </p>
  28363. </dd>
  28364. <dt><samp class="option">out_gain</samp></dt>
  28365. <dd><p>Set output gain of reflected signal. Default is <code class="code">0.3</code>.
  28366. </p>
  28367. </dd>
  28368. <dt><samp class="option">delays</samp></dt>
  28369. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  28370. separated by &rsquo;|&rsquo;. Allowed range for each <code class="code">delay</code> is <code class="code">(0 - 90000.0]</code>.
  28371. Default is <code class="code">1000</code>.
  28372. </p>
  28373. </dd>
  28374. <dt><samp class="option">decays</samp></dt>
  28375. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  28376. Allowed range for each <code class="code">decay</code> is <code class="code">(0 - 1.0]</code>.
  28377. Default is <code class="code">0.5</code>.
  28378. </p></dd>
  28379. </dl>
  28380. <a name="Examples-49"></a>
  28381. <h4 class="subsection">36.18.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-49" aria-hidden="true">TOC</a></span></h4>
  28382. <ul class="itemize mark-bullet">
  28383. <li>Make it sound as if there are twice as many instruments as are actually playing:
  28384. <div class="example">
  28385. <pre class="example-preformatted">aecho=0.8:0.88:60:0.4
  28386. </pre></div>
  28387. </li><li>If delay is very short, then it sounds like a (metallic) robot playing music:
  28388. <div class="example">
  28389. <pre class="example-preformatted">aecho=0.8:0.88:6:0.4
  28390. </pre></div>
  28391. </li><li>A longer delay will sound like an open air concert in the mountains:
  28392. <div class="example">
  28393. <pre class="example-preformatted">aecho=0.8:0.9:1000:0.3
  28394. </pre></div>
  28395. </li><li>Same as above but with one more mountain:
  28396. <div class="example">
  28397. <pre class="example-preformatted">aecho=0.8:0.9:1000|1800:0.3|0.25
  28398. </pre></div>
  28399. </li></ul>
  28400. <a name="aemphasis"></a>
  28401. <h3 class="section">36.19 aemphasis<span class="pull-right"><a class="anchor hidden-xs" href="#aemphasis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aemphasis" aria-hidden="true">TOC</a></span></h3>
  28402. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  28403. emphased CDs with different filter curves. E.g. to store music on vinyl the
  28404. signal has to be altered by a filter first to even out the disadvantages of
  28405. this recording medium.
  28406. Once the material is played back the inverse filter has to be applied to
  28407. restore the distortion of the frequency response.
  28408. </p>
  28409. <p>The filter accepts the following options:
  28410. </p>
  28411. <dl class="table">
  28412. <dt><samp class="option">level_in</samp></dt>
  28413. <dd><p>Set input gain.
  28414. </p>
  28415. </dd>
  28416. <dt><samp class="option">level_out</samp></dt>
  28417. <dd><p>Set output gain.
  28418. </p>
  28419. </dd>
  28420. <dt><samp class="option">mode</samp></dt>
  28421. <dd><p>Set filter mode. For restoring material use <code class="code">reproduction</code> mode, otherwise
  28422. use <code class="code">production</code> mode. Default is <code class="code">reproduction</code> mode.
  28423. </p>
  28424. </dd>
  28425. <dt><samp class="option">type</samp></dt>
  28426. <dd><p>Set filter type. Selects medium. Can be one of the following:
  28427. </p>
  28428. <dl class="table">
  28429. <dt><samp class="option">col</samp></dt>
  28430. <dd><p>select Columbia.
  28431. </p></dd>
  28432. <dt><samp class="option">emi</samp></dt>
  28433. <dd><p>select EMI.
  28434. </p></dd>
  28435. <dt><samp class="option">bsi</samp></dt>
  28436. <dd><p>select BSI (78RPM).
  28437. </p></dd>
  28438. <dt><samp class="option">riaa</samp></dt>
  28439. <dd><p>select RIAA.
  28440. </p></dd>
  28441. <dt><samp class="option">cd</samp></dt>
  28442. <dd><p>select Compact Disc (CD).
  28443. </p></dd>
  28444. <dt><samp class="option">50fm</samp></dt>
  28445. <dd><p>select 50µs (FM).
  28446. </p></dd>
  28447. <dt><samp class="option">75fm</samp></dt>
  28448. <dd><p>select 75µs (FM).
  28449. </p></dd>
  28450. <dt><samp class="option">50kf</samp></dt>
  28451. <dd><p>select 50µs (FM-KF).
  28452. </p></dd>
  28453. <dt><samp class="option">75kf</samp></dt>
  28454. <dd><p>select 75µs (FM-KF).
  28455. </p></dd>
  28456. </dl>
  28457. </dd>
  28458. </dl>
  28459. <a name="Commands-6"></a>
  28460. <h4 class="subsection">36.19.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-6" aria-hidden="true">TOC</a></span></h4>
  28461. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28462. </p>
  28463. <a name="aeval"></a>
  28464. <h3 class="section">36.20 aeval<span class="pull-right"><a class="anchor hidden-xs" href="#aeval" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aeval" aria-hidden="true">TOC</a></span></h3>
  28465. <p>Modify an audio signal according to the specified expressions.
  28466. </p>
  28467. <p>This filter accepts one or more expressions (one for each channel),
  28468. which are evaluated and used to modify a corresponding audio signal.
  28469. </p>
  28470. <p>It accepts the following parameters:
  28471. </p>
  28472. <dl class="table">
  28473. <dt><samp class="option">exprs</samp></dt>
  28474. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  28475. the number of input channels is greater than the number of
  28476. expressions, the last specified expression is used for the remaining
  28477. output channels.
  28478. </p>
  28479. </dd>
  28480. <dt><samp class="option">channel_layout, c</samp></dt>
  28481. <dd><p>Set output channel layout. If not specified, the channel layout is
  28482. specified by the number of expressions. If set to &lsquo;<samp class="samp">same</samp>&rsquo;, it will
  28483. use by default the same input channel layout.
  28484. </p></dd>
  28485. </dl>
  28486. <p>Each expression in <var class="var">exprs</var> can contain the following constants and functions:
  28487. </p>
  28488. <dl class="table">
  28489. <dt><samp class="option">ch</samp></dt>
  28490. <dd><p>channel number of the current expression
  28491. </p>
  28492. </dd>
  28493. <dt><samp class="option">n</samp></dt>
  28494. <dd><p>number of the evaluated sample, starting from 0
  28495. </p>
  28496. </dd>
  28497. <dt><samp class="option">s</samp></dt>
  28498. <dd><p>sample rate
  28499. </p>
  28500. </dd>
  28501. <dt><samp class="option">t</samp></dt>
  28502. <dd><p>time of the evaluated sample expressed in seconds
  28503. </p>
  28504. </dd>
  28505. <dt><samp class="option">nb_in_channels</samp></dt>
  28506. <dt><samp class="option">nb_out_channels</samp></dt>
  28507. <dd><p>input and output number of channels
  28508. </p>
  28509. </dd>
  28510. <dt><samp class="option">val(CH)</samp></dt>
  28511. <dd><p>the value of input channel with number <var class="var">CH</var>
  28512. </p></dd>
  28513. </dl>
  28514. <p>Note: this filter is slow. For faster processing you should use a
  28515. dedicated filter.
  28516. </p>
  28517. <a name="Examples-50"></a>
  28518. <h4 class="subsection">36.20.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-50" aria-hidden="true">TOC</a></span></h4>
  28519. <ul class="itemize mark-bullet">
  28520. <li>Half volume:
  28521. <div class="example">
  28522. <pre class="example-preformatted">aeval=val(ch)/2:c=same
  28523. </pre></div>
  28524. </li><li>Invert phase of the second channel:
  28525. <div class="example">
  28526. <pre class="example-preformatted">aeval=val(0)|-val(1)
  28527. </pre></div>
  28528. </li></ul>
  28529. <a name="aexciter"></a>
  28530. <h3 class="section">36.21 aexciter<span class="pull-right"><a class="anchor hidden-xs" href="#aexciter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aexciter" aria-hidden="true">TOC</a></span></h3>
  28531. <p>An exciter is used to produce high sound that is not present in the
  28532. original signal. This is done by creating harmonic distortions of the
  28533. signal which are restricted in range and added to the original signal.
  28534. An Exciter raises the upper end of an audio signal without simply raising
  28535. the higher frequencies like an equalizer would do to create a more
  28536. &quot;crisp&quot; or &quot;brilliant&quot; sound.
  28537. </p>
  28538. <p>The filter accepts the following options:
  28539. </p>
  28540. <dl class="table">
  28541. <dt><samp class="option">level_in</samp></dt>
  28542. <dd><p>Set input level prior processing of signal.
  28543. Allowed range is from 0 to 64.
  28544. Default value is 1.
  28545. </p>
  28546. </dd>
  28547. <dt><samp class="option">level_out</samp></dt>
  28548. <dd><p>Set output level after processing of signal.
  28549. Allowed range is from 0 to 64.
  28550. Default value is 1.
  28551. </p>
  28552. </dd>
  28553. <dt><samp class="option">amount</samp></dt>
  28554. <dd><p>Set the amount of harmonics added to original signal.
  28555. Allowed range is from 0 to 64.
  28556. Default value is 1.
  28557. </p>
  28558. </dd>
  28559. <dt><samp class="option">drive</samp></dt>
  28560. <dd><p>Set the amount of newly created harmonics.
  28561. Allowed range is from 0.1 to 10.
  28562. Default value is 8.5.
  28563. </p>
  28564. </dd>
  28565. <dt><samp class="option">blend</samp></dt>
  28566. <dd><p>Set the octave of newly created harmonics.
  28567. Allowed range is from -10 to 10.
  28568. Default value is 0.
  28569. </p>
  28570. </dd>
  28571. <dt><samp class="option">freq</samp></dt>
  28572. <dd><p>Set the lower frequency limit of producing harmonics in Hz.
  28573. Allowed range is from 2000 to 12000 Hz.
  28574. Default is 7500 Hz.
  28575. </p>
  28576. </dd>
  28577. <dt><samp class="option">ceil</samp></dt>
  28578. <dd><p>Set the upper frequency limit of producing harmonics.
  28579. Allowed range is from 9999 to 20000 Hz.
  28580. If value is lower than 10000 Hz no limit is applied.
  28581. </p>
  28582. </dd>
  28583. <dt><samp class="option">listen</samp></dt>
  28584. <dd><p>Mute the original signal and output only added harmonics.
  28585. By default is disabled.
  28586. </p></dd>
  28587. </dl>
  28588. <a name="Commands-7"></a>
  28589. <h4 class="subsection">36.21.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-7" aria-hidden="true">TOC</a></span></h4>
  28590. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28591. </p>
  28592. <a class="anchor" id="afade"></a><a name="afade-1"></a>
  28593. <h3 class="section">36.22 afade<span class="pull-right"><a class="anchor hidden-xs" href="#afade-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afade-1" aria-hidden="true">TOC</a></span></h3>
  28594. <p>Apply fade-in/out effect to input audio.
  28595. </p>
  28596. <p>A description of the accepted parameters follows.
  28597. </p>
  28598. <dl class="table">
  28599. <dt><samp class="option">type, t</samp></dt>
  28600. <dd><p>Specify the effect type, can be either <code class="code">in</code> for fade-in, or
  28601. <code class="code">out</code> for a fade-out effect. Default is <code class="code">in</code>.
  28602. </p>
  28603. </dd>
  28604. <dt><samp class="option">start_sample, ss</samp></dt>
  28605. <dd><p>Specify the number of the start sample for starting to apply the fade
  28606. effect. Default is 0.
  28607. </p>
  28608. </dd>
  28609. <dt><samp class="option">nb_samples, ns</samp></dt>
  28610. <dd><p>Specify the number of samples for which the fade effect has to last. At
  28611. the end of the fade-in effect the output audio will have the same
  28612. volume as the input audio, at the end of the fade-out transition
  28613. the output audio will be silence. Default is 44100.
  28614. </p>
  28615. </dd>
  28616. <dt><samp class="option">start_time, st</samp></dt>
  28617. <dd><p>Specify the start time of the fade effect. Default is 0.
  28618. The value must be specified as a time duration; see
  28619. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  28620. for the accepted syntax.
  28621. If set this option is used instead of <var class="var">start_sample</var>.
  28622. </p>
  28623. </dd>
  28624. <dt><samp class="option">duration, d</samp></dt>
  28625. <dd><p>Specify the duration of the fade effect. See
  28626. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  28627. for the accepted syntax.
  28628. At the end of the fade-in effect the output audio will have the same
  28629. volume as the input audio, at the end of the fade-out transition
  28630. the output audio will be silence.
  28631. By default the duration is determined by <var class="var">nb_samples</var>.
  28632. If set this option is used instead of <var class="var">nb_samples</var>.
  28633. </p>
  28634. </dd>
  28635. <dt><samp class="option">curve</samp></dt>
  28636. <dd><p>Set curve for fade transition.
  28637. </p>
  28638. <p>It accepts the following values:
  28639. </p><dl class="table">
  28640. <dt><samp class="option">tri</samp></dt>
  28641. <dd><p>select triangular, linear slope (default)
  28642. </p></dd>
  28643. <dt><samp class="option">qsin</samp></dt>
  28644. <dd><p>select quarter of sine wave
  28645. </p></dd>
  28646. <dt><samp class="option">hsin</samp></dt>
  28647. <dd><p>select half of sine wave
  28648. </p></dd>
  28649. <dt><samp class="option">esin</samp></dt>
  28650. <dd><p>select exponential sine wave
  28651. </p></dd>
  28652. <dt><samp class="option">log</samp></dt>
  28653. <dd><p>select logarithmic
  28654. </p></dd>
  28655. <dt><samp class="option">ipar</samp></dt>
  28656. <dd><p>select inverted parabola
  28657. </p></dd>
  28658. <dt><samp class="option">qua</samp></dt>
  28659. <dd><p>select quadratic
  28660. </p></dd>
  28661. <dt><samp class="option">cub</samp></dt>
  28662. <dd><p>select cubic
  28663. </p></dd>
  28664. <dt><samp class="option">squ</samp></dt>
  28665. <dd><p>select square root
  28666. </p></dd>
  28667. <dt><samp class="option">cbr</samp></dt>
  28668. <dd><p>select cubic root
  28669. </p></dd>
  28670. <dt><samp class="option">par</samp></dt>
  28671. <dd><p>select parabola
  28672. </p></dd>
  28673. <dt><samp class="option">exp</samp></dt>
  28674. <dd><p>select exponential
  28675. </p></dd>
  28676. <dt><samp class="option">iqsin</samp></dt>
  28677. <dd><p>select inverted quarter of sine wave
  28678. </p></dd>
  28679. <dt><samp class="option">ihsin</samp></dt>
  28680. <dd><p>select inverted half of sine wave
  28681. </p></dd>
  28682. <dt><samp class="option">dese</samp></dt>
  28683. <dd><p>select double-exponential seat
  28684. </p></dd>
  28685. <dt><samp class="option">desi</samp></dt>
  28686. <dd><p>select double-exponential sigmoid
  28687. </p></dd>
  28688. <dt><samp class="option">losi</samp></dt>
  28689. <dd><p>select logistic sigmoid
  28690. </p></dd>
  28691. <dt><samp class="option">sinc</samp></dt>
  28692. <dd><p>select sine cardinal function
  28693. </p></dd>
  28694. <dt><samp class="option">isinc</samp></dt>
  28695. <dd><p>select inverted sine cardinal function
  28696. </p></dd>
  28697. <dt><samp class="option">quat</samp></dt>
  28698. <dd><p>select quartic
  28699. </p></dd>
  28700. <dt><samp class="option">quatr</samp></dt>
  28701. <dd><p>select quartic root
  28702. </p></dd>
  28703. <dt><samp class="option">qsin2</samp></dt>
  28704. <dd><p>select squared quarter of sine wave
  28705. </p></dd>
  28706. <dt><samp class="option">hsin2</samp></dt>
  28707. <dd><p>select squared half of sine wave
  28708. </p></dd>
  28709. <dt><samp class="option">nofade</samp></dt>
  28710. <dd><p>no fade applied
  28711. </p></dd>
  28712. </dl>
  28713. </dd>
  28714. <dt><samp class="option">silence</samp></dt>
  28715. <dd><p>Set the initial gain for fade-in or final gain for fade-out.
  28716. Default value is <code class="code">0.0</code>.
  28717. </p>
  28718. </dd>
  28719. <dt><samp class="option">unity</samp></dt>
  28720. <dd><p>Set the initial gain for fade-out or final gain for fade-in.
  28721. Default value is <code class="code">1.0</code>.
  28722. </p></dd>
  28723. </dl>
  28724. <a name="Commands-8"></a>
  28725. <h4 class="subsection">36.22.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-8" aria-hidden="true">TOC</a></span></h4>
  28726. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28727. </p>
  28728. <a name="Examples-51"></a>
  28729. <h4 class="subsection">36.22.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-51" aria-hidden="true">TOC</a></span></h4>
  28730. <ul class="itemize mark-bullet">
  28731. <li>Fade in first 15 seconds of audio:
  28732. <div class="example">
  28733. <pre class="example-preformatted">afade=t=in:ss=0:d=15
  28734. </pre></div>
  28735. </li><li>Fade out last 25 seconds of a 900 seconds audio:
  28736. <div class="example">
  28737. <pre class="example-preformatted">afade=t=out:st=875:d=25
  28738. </pre></div>
  28739. </li></ul>
  28740. <a name="afftdn"></a>
  28741. <h3 class="section">36.23 afftdn<span class="pull-right"><a class="anchor hidden-xs" href="#afftdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afftdn" aria-hidden="true">TOC</a></span></h3>
  28742. <p>Denoise audio samples with FFT.
  28743. </p>
  28744. <p>A description of the accepted parameters follows.
  28745. </p>
  28746. <dl class="table">
  28747. <dt><samp class="option">noise_reduction, nr</samp></dt>
  28748. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  28749. Default value is 12 dB.
  28750. </p>
  28751. </dd>
  28752. <dt><samp class="option">noise_floor, nf</samp></dt>
  28753. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  28754. Default value is -50 dB.
  28755. </p>
  28756. </dd>
  28757. <dt><samp class="option">noise_type, nt</samp></dt>
  28758. <dd><p>Set the noise type.
  28759. </p>
  28760. <p>It accepts the following values:
  28761. </p><dl class="table">
  28762. <dt><samp class="option">white, w</samp></dt>
  28763. <dd><p>Select white noise.
  28764. </p>
  28765. </dd>
  28766. <dt><samp class="option">vinyl, v</samp></dt>
  28767. <dd><p>Select vinyl noise.
  28768. </p>
  28769. </dd>
  28770. <dt><samp class="option">shellac, s</samp></dt>
  28771. <dd><p>Select shellac noise.
  28772. </p>
  28773. </dd>
  28774. <dt><samp class="option">custom, c</samp></dt>
  28775. <dd><p>Select custom noise, defined in <code class="code">bn</code> option.
  28776. </p>
  28777. <p>Default value is white noise.
  28778. </p></dd>
  28779. </dl>
  28780. </dd>
  28781. <dt><samp class="option">band_noise, bn</samp></dt>
  28782. <dd><p>Set custom band noise profile for every one of 15 bands.
  28783. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  28784. </p>
  28785. </dd>
  28786. <dt><samp class="option">residual_floor, rf</samp></dt>
  28787. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  28788. Default value is -38 dB.
  28789. </p>
  28790. </dd>
  28791. <dt><samp class="option">track_noise, tn</samp></dt>
  28792. <dd><p>Enable noise floor tracking. By default is disabled.
  28793. With this enabled, noise floor is automatically adjusted.
  28794. </p>
  28795. </dd>
  28796. <dt><samp class="option">track_residual, tr</samp></dt>
  28797. <dd><p>Enable residual tracking. By default is disabled.
  28798. </p>
  28799. </dd>
  28800. <dt><samp class="option">output_mode, om</samp></dt>
  28801. <dd><p>Set the output mode.
  28802. </p>
  28803. <p>It accepts the following values:
  28804. </p><dl class="table">
  28805. <dt><samp class="option">input, i</samp></dt>
  28806. <dd><p>Pass input unchanged.
  28807. </p>
  28808. </dd>
  28809. <dt><samp class="option">output, o</samp></dt>
  28810. <dd><p>Pass noise filtered out.
  28811. </p>
  28812. </dd>
  28813. <dt><samp class="option">noise, n</samp></dt>
  28814. <dd><p>Pass only noise.
  28815. </p>
  28816. <p>Default value is <var class="var">output</var>.
  28817. </p></dd>
  28818. </dl>
  28819. </dd>
  28820. <dt><samp class="option">adaptivity, ad</samp></dt>
  28821. <dd><p>Set the adaptivity factor, used how fast to adapt gains adjustments per
  28822. each frequency bin. Value <var class="var">0</var> enables instant adaptation, while higher values
  28823. react much slower.
  28824. Allowed range is from <var class="var">0</var> to <var class="var">1</var>. Default value is <var class="var">0.5</var>.
  28825. </p>
  28826. </dd>
  28827. <dt><samp class="option">floor_offset, fo</samp></dt>
  28828. <dd><p>Set the noise floor offset factor. This option is used to adjust offset applied to measured
  28829. noise floor. It is only effective when noise floor tracking is enabled.
  28830. 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>.
  28831. </p>
  28832. </dd>
  28833. <dt><samp class="option">noise_link, nl</samp></dt>
  28834. <dd><p>Set the noise link used for multichannel audio.
  28835. </p>
  28836. <p>It accepts the following values:
  28837. </p><dl class="table">
  28838. <dt><samp class="option">none</samp></dt>
  28839. <dd><p>Use unchanged channel&rsquo;s noise floor.
  28840. </p>
  28841. </dd>
  28842. <dt><samp class="option">min</samp></dt>
  28843. <dd><p>Use measured min noise floor of all channels.
  28844. </p>
  28845. </dd>
  28846. <dt><samp class="option">max</samp></dt>
  28847. <dd><p>Use measured max noise floor of all channels.
  28848. </p>
  28849. </dd>
  28850. <dt><samp class="option">average</samp></dt>
  28851. <dd><p>Use measured average noise floor of all channels.
  28852. </p>
  28853. <p>Default value is <var class="var">min</var>.
  28854. </p></dd>
  28855. </dl>
  28856. </dd>
  28857. <dt><samp class="option">band_multiplier, bm</samp></dt>
  28858. <dd><p>Set the band multiplier factor, used how much to spread bands across frequency bins.
  28859. 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>.
  28860. </p>
  28861. </dd>
  28862. <dt><samp class="option">sample_noise, sn</samp></dt>
  28863. <dd><p>Toggle capturing and measurement of noise profile from input audio.
  28864. </p>
  28865. <p>It accepts the following values:
  28866. </p><dl class="table">
  28867. <dt><samp class="option">start, begin</samp></dt>
  28868. <dd><p>Start sample noise capture.
  28869. </p>
  28870. </dd>
  28871. <dt><samp class="option">stop, end</samp></dt>
  28872. <dd><p>Stop sample noise capture and measure new noise band profile.
  28873. </p>
  28874. <p>Default value is <code class="code">none</code>.
  28875. </p></dd>
  28876. </dl>
  28877. </dd>
  28878. <dt><samp class="option">gain_smooth, gs</samp></dt>
  28879. <dd><p>Set gain smooth spatial radius, used to smooth gains applied to each frequency bin.
  28880. Useful to reduce random music noise artefacts.
  28881. Higher values increases smoothing of gains.
  28882. Allowed range is from <code class="code">0</code> to <code class="code">50</code>.
  28883. Default value is <code class="code">0</code>.
  28884. </p></dd>
  28885. </dl>
  28886. <a name="Commands-9"></a>
  28887. <h4 class="subsection">36.23.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-9" aria-hidden="true">TOC</a></span></h4>
  28888. <p>This filter supports the some above mentioned options as <a class="ref" href="#commands">commands</a>.
  28889. </p>
  28890. <a name="Examples-52"></a>
  28891. <h4 class="subsection">36.23.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-52" aria-hidden="true">TOC</a></span></h4>
  28892. <ul class="itemize mark-bullet">
  28893. <li>Reduce white noise by 10dB, and use previously measured noise floor of -40dB:
  28894. <div class="example">
  28895. <pre class="example-preformatted">afftdn=nr=10:nf=-40
  28896. </pre></div>
  28897. </li><li>Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic
  28898. tracking of noise floor so noise floor will gradually change during processing:
  28899. <div class="example">
  28900. <pre class="example-preformatted">afftdn=nr=10:nf=-80:tn=1
  28901. </pre></div>
  28902. </li><li>Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile
  28903. of first 0.4 seconds of input audio:
  28904. <div class="example">
  28905. <pre class="example-preformatted">asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
  28906. </pre></div>
  28907. </li></ul>
  28908. <a name="afftfilt"></a>
  28909. <h3 class="section">36.24 afftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#afftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afftfilt" aria-hidden="true">TOC</a></span></h3>
  28910. <p>Apply arbitrary expressions to samples in frequency domain.
  28911. </p>
  28912. <dl class="table">
  28913. <dt><samp class="option">real</samp></dt>
  28914. <dd><p>Set frequency domain real expression for each separate channel separated
  28915. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  28916. If the number of input channels is greater than the number of
  28917. expressions, the last specified expression is used for the remaining
  28918. output channels.
  28919. </p>
  28920. </dd>
  28921. <dt><samp class="option">imag</samp></dt>
  28922. <dd><p>Set frequency domain imaginary expression for each separate channel
  28923. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  28924. </p>
  28925. <p>Each expression in <var class="var">real</var> and <var class="var">imag</var> can contain the following
  28926. constants and functions:
  28927. </p>
  28928. <dl class="table">
  28929. <dt><samp class="option">sr</samp></dt>
  28930. <dd><p>sample rate
  28931. </p>
  28932. </dd>
  28933. <dt><samp class="option">b</samp></dt>
  28934. <dd><p>current frequency bin number
  28935. </p>
  28936. </dd>
  28937. <dt><samp class="option">nb</samp></dt>
  28938. <dd><p>number of available bins
  28939. </p>
  28940. </dd>
  28941. <dt><samp class="option">ch</samp></dt>
  28942. <dd><p>channel number of the current expression
  28943. </p>
  28944. </dd>
  28945. <dt><samp class="option">chs</samp></dt>
  28946. <dd><p>number of channels
  28947. </p>
  28948. </dd>
  28949. <dt><samp class="option">pts</samp></dt>
  28950. <dd><p>current frame pts
  28951. </p>
  28952. </dd>
  28953. <dt><samp class="option">re</samp></dt>
  28954. <dd><p>current real part of frequency bin of current channel
  28955. </p>
  28956. </dd>
  28957. <dt><samp class="option">im</samp></dt>
  28958. <dd><p>current imaginary part of frequency bin of current channel
  28959. </p>
  28960. </dd>
  28961. <dt><samp class="option">real(b, ch)</samp></dt>
  28962. <dd><p>Return the value of real part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  28963. </p>
  28964. </dd>
  28965. <dt><samp class="option">imag(b, ch)</samp></dt>
  28966. <dd><p>Return the value of imaginary part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  28967. </p></dd>
  28968. </dl>
  28969. </dd>
  28970. <dt><samp class="option">win_size</samp></dt>
  28971. <dd><p>Set window size. Allowed range is from 16 to 131072.
  28972. Default is <code class="code">4096</code>
  28973. </p>
  28974. </dd>
  28975. <dt><samp class="option">win_func</samp></dt>
  28976. <dd><p>Set window function.
  28977. </p>
  28978. <p>It accepts the following values:
  28979. </p><dl class="table">
  28980. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  28981. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  28982. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  28983. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  28984. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  28985. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  28986. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  28987. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  28988. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  28989. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  28990. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  28991. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  28992. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  28993. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  28994. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  28995. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  28996. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  28997. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  28998. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  28999. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  29000. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  29001. </dl>
  29002. <p>Default is <code class="code">hann</code>.
  29003. </p>
  29004. </dd>
  29005. <dt><samp class="option">overlap</samp></dt>
  29006. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  29007. window function will be picked. Default is <code class="code">0.75</code>.
  29008. </p></dd>
  29009. </dl>
  29010. <a name="Examples-53"></a>
  29011. <h4 class="subsection">36.24.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-53" aria-hidden="true">TOC</a></span></h4>
  29012. <ul class="itemize mark-bullet">
  29013. <li>Leave almost only low frequencies in audio:
  29014. <div class="example">
  29015. <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;
  29016. </pre></div>
  29017. </li><li>Apply robotize effect:
  29018. <div class="example">
  29019. <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;
  29020. </pre></div>
  29021. </li><li>Apply whisper effect:
  29022. <div class="example">
  29023. <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;
  29024. </pre></div>
  29025. </li><li>Apply phase shift:
  29026. <div class="example">
  29027. <pre class="example-preformatted">afftfilt=&quot;real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)&quot;
  29028. </pre></div>
  29029. </li></ul>
  29030. <a class="anchor" id="afir"></a><a name="afir-1"></a>
  29031. <h3 class="section">36.25 afir<span class="pull-right"><a class="anchor hidden-xs" href="#afir-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afir-1" aria-hidden="true">TOC</a></span></h3>
  29032. <p>Apply an arbitrary Finite Impulse Response filter.
  29033. </p>
  29034. <p>This filter is designed for applying long FIR filters,
  29035. up to 60 seconds long.
  29036. </p>
  29037. <p>It can be used as component for digital crossover filters,
  29038. room equalization, cross talk cancellation, wavefield synthesis,
  29039. auralization, ambiophonics, ambisonics and spatialization.
  29040. </p>
  29041. <p>This filter uses the streams higher than first one as FIR coefficients.
  29042. If the non-first stream holds a single channel, it will be used
  29043. for all input channels in the first stream, otherwise
  29044. the number of channels in the non-first stream must be same as
  29045. the number of channels in the first stream.
  29046. </p>
  29047. <p>It accepts the following parameters:
  29048. </p>
  29049. <dl class="table">
  29050. <dt><samp class="option">dry</samp></dt>
  29051. <dd><p>Set dry gain. This sets input gain.
  29052. </p>
  29053. </dd>
  29054. <dt><samp class="option">wet</samp></dt>
  29055. <dd><p>Set wet gain. This sets final output gain.
  29056. </p>
  29057. </dd>
  29058. <dt><samp class="option">length</samp></dt>
  29059. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  29060. </p>
  29061. </dd>
  29062. <dt><samp class="option">gtype</samp></dt>
  29063. <dd><p>This option is deprecated, and does nothing.
  29064. </p>
  29065. </dd>
  29066. <dt><samp class="option">irnorm</samp></dt>
  29067. <dd><p>Set norm to be applied to IR coefficients before filtering.
  29068. Allowed range is from <var class="var">-1</var> to <var class="var">2</var>.
  29069. IR coefficients are normalized with calculated vector norm set by this option.
  29070. For negative values, no norm is calculated, and IR coefficients are not modified at all.
  29071. Default is <var class="var">1</var>.
  29072. </p>
  29073. </dd>
  29074. <dt><samp class="option">irlink</samp></dt>
  29075. <dd><p>For multichannel IR if this option is set to <var class="var">true</var>, all IR channels will be
  29076. normalized with maximal measured gain of all IR channels coefficients as set by <code class="code">irnorm</code> option.
  29077. When disabled, all IR coefficients in each IR channel will be normalized independently.
  29078. Default is <var class="var">true</var>.
  29079. </p>
  29080. </dd>
  29081. <dt><samp class="option">irgain</samp></dt>
  29082. <dd><p>Set gain to be applied to IR coefficients before filtering.
  29083. Allowed range is 0 to 1. This gain is applied after any gain applied with <var class="var">irnorm</var> option.
  29084. </p>
  29085. </dd>
  29086. <dt><samp class="option">irfmt</samp></dt>
  29087. <dd><p>Set format of IR stream. Can be <code class="code">mono</code> or <code class="code">input</code>.
  29088. Default is <code class="code">input</code>.
  29089. </p>
  29090. </dd>
  29091. <dt><samp class="option">maxir</samp></dt>
  29092. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  29093. Allowed range is 0.1 to 60 seconds.
  29094. </p>
  29095. </dd>
  29096. <dt><samp class="option">response</samp></dt>
  29097. <dd><p>This option is deprecated, and does nothing.
  29098. </p>
  29099. </dd>
  29100. <dt><samp class="option">channel</samp></dt>
  29101. <dd><p>This option is deprecated, and does nothing.
  29102. </p>
  29103. </dd>
  29104. <dt><samp class="option">size</samp></dt>
  29105. <dd><p>This option is deprecated, and does nothing.
  29106. </p>
  29107. </dd>
  29108. <dt><samp class="option">rate</samp></dt>
  29109. <dd><p>This option is deprecated, and does nothing.
  29110. </p>
  29111. </dd>
  29112. <dt><samp class="option">minp</samp></dt>
  29113. <dd><p>Set minimal partition size used for convolution. Default is <var class="var">8192</var>.
  29114. Allowed range is from <var class="var">1</var> to <var class="var">65536</var>.
  29115. Lower values decreases latency at cost of higher CPU usage.
  29116. </p>
  29117. </dd>
  29118. <dt><samp class="option">maxp</samp></dt>
  29119. <dd><p>Set maximal partition size used for convolution. Default is <var class="var">8192</var>.
  29120. Allowed range is from <var class="var">8</var> to <var class="var">65536</var>.
  29121. Lower values may increase CPU usage.
  29122. </p>
  29123. </dd>
  29124. <dt><samp class="option">nbirs</samp></dt>
  29125. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  29126. Allowed range is from <var class="var">1</var> to <var class="var">32</var>. Default is <var class="var">1</var>.
  29127. </p>
  29128. </dd>
  29129. <dt><samp class="option">ir</samp></dt>
  29130. <dd><p>Set IR stream which will be used for convolution, starting from <var class="var">0</var>, should always be
  29131. lower than supplied value by <code class="code">nbirs</code> option. Default is <var class="var">0</var>.
  29132. This option can be changed at runtime via <a class="ref" href="#commands">commands</a>.
  29133. </p>
  29134. </dd>
  29135. <dt><samp class="option">precision</samp></dt>
  29136. <dd><p>Set which precision to use when processing samples.
  29137. </p>
  29138. <dl class="table">
  29139. <dt><samp class="option">auto</samp></dt>
  29140. <dd><p>Auto pick internal sample format depending on other filters.
  29141. </p>
  29142. </dd>
  29143. <dt><samp class="option">float</samp></dt>
  29144. <dd><p>Always use single-floating point precision sample format.
  29145. </p>
  29146. </dd>
  29147. <dt><samp class="option">double</samp></dt>
  29148. <dd><p>Always use double-floating point precision sample format.
  29149. </p></dd>
  29150. </dl>
  29151. <p>Default value is auto.
  29152. </p>
  29153. </dd>
  29154. <dt><samp class="option">irload</samp></dt>
  29155. <dd><p>Set when to load IR stream. Can be <code class="code">init</code> or <code class="code">access</code>.
  29156. First one load and prepares all IRs on initialization, second one
  29157. once on first access of specific IR.
  29158. Default is <code class="code">init</code>.
  29159. </p></dd>
  29160. </dl>
  29161. <a name="Examples-54"></a>
  29162. <h4 class="subsection">36.25.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-54" aria-hidden="true">TOC</a></span></h4>
  29163. <ul class="itemize mark-bullet">
  29164. <li>Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  29165. <div class="example">
  29166. <pre class="example-preformatted">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  29167. </pre></div>
  29168. </li><li>Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel,
  29169. the impulse response files are files with names l_ir.wav and r_ir.wav, and setting irnorm option value:
  29170. <div class="example">
  29171. <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;
  29172. </pre></div>
  29173. </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:
  29174. <div class="example">
  29175. <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;
  29176. </pre></div>
  29177. </li></ul>
  29178. <a class="anchor" id="aformat"></a><a name="aformat-1"></a>
  29179. <h3 class="section">36.26 aformat<span class="pull-right"><a class="anchor hidden-xs" href="#aformat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aformat-1" aria-hidden="true">TOC</a></span></h3>
  29180. <p>Set output format constraints for the input audio. The framework will
  29181. negotiate the most appropriate format to minimize conversions.
  29182. </p>
  29183. <p>It accepts the following parameters:
  29184. </p><dl class="table">
  29185. <dt><samp class="option">sample_fmts, f</samp></dt>
  29186. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  29187. </p>
  29188. </dd>
  29189. <dt><samp class="option">sample_rates, r</samp></dt>
  29190. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  29191. </p>
  29192. </dd>
  29193. <dt><samp class="option">channel_layouts, cl</samp></dt>
  29194. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  29195. </p>
  29196. <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>
  29197. for the required syntax.
  29198. </p></dd>
  29199. </dl>
  29200. <p>If a parameter is omitted, all values are allowed.
  29201. </p>
  29202. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  29203. </p><div class="example">
  29204. <pre class="example-preformatted">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  29205. </pre></div>
  29206. <a name="afreqshift"></a>
  29207. <h3 class="section">36.27 afreqshift<span class="pull-right"><a class="anchor hidden-xs" href="#afreqshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afreqshift" aria-hidden="true">TOC</a></span></h3>
  29208. <p>Apply frequency shift to input audio samples.
  29209. </p>
  29210. <p>The filter accepts the following options:
  29211. </p>
  29212. <dl class="table">
  29213. <dt><samp class="option">shift</samp></dt>
  29214. <dd><p>Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
  29215. Default value is 0.0.
  29216. </p>
  29217. </dd>
  29218. <dt><samp class="option">level</samp></dt>
  29219. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  29220. Default value is 1.0.
  29221. </p>
  29222. </dd>
  29223. <dt><samp class="option">order</samp></dt>
  29224. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  29225. Default value is 8.
  29226. </p></dd>
  29227. </dl>
  29228. <a name="Commands-10"></a>
  29229. <h4 class="subsection">36.27.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-10" aria-hidden="true">TOC</a></span></h4>
  29230. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  29231. </p>
  29232. <a name="afwtdn"></a>
  29233. <h3 class="section">36.28 afwtdn<span class="pull-right"><a class="anchor hidden-xs" href="#afwtdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afwtdn" aria-hidden="true">TOC</a></span></h3>
  29234. <p>Reduce broadband noise from input samples using Wavelets.
  29235. </p>
  29236. <p>A description of the accepted options follows.
  29237. </p>
  29238. <dl class="table">
  29239. <dt><samp class="option">sigma</samp></dt>
  29240. <dd><p>Set the noise sigma, allowed range is from 0 to 1.
  29241. Default value is 0.
  29242. This option controls strength of denoising applied to input samples.
  29243. Most useful way to set this option is via decibels, eg. -45dB.
  29244. </p>
  29245. </dd>
  29246. <dt><samp class="option">levels</samp></dt>
  29247. <dd><p>Set the number of wavelet levels of decomposition.
  29248. Allowed range is from 1 to 12.
  29249. Default value is 10.
  29250. Setting this too low make denoising performance very poor.
  29251. </p>
  29252. </dd>
  29253. <dt><samp class="option">wavet</samp></dt>
  29254. <dd><p>Set wavelet type for decomposition of input frame.
  29255. They are sorted by number of coefficients, from lowest to highest.
  29256. More coefficients means worse filtering speed, but overall better quality.
  29257. Available wavelets are:
  29258. </p>
  29259. <dl class="table">
  29260. <dt>&lsquo;<samp class="samp">sym2</samp>&rsquo;</dt>
  29261. <dt>&lsquo;<samp class="samp">sym4</samp>&rsquo;</dt>
  29262. <dt>&lsquo;<samp class="samp">rbior68</samp>&rsquo;</dt>
  29263. <dt>&lsquo;<samp class="samp">deb10</samp>&rsquo;</dt>
  29264. <dt>&lsquo;<samp class="samp">sym10</samp>&rsquo;</dt>
  29265. <dt>&lsquo;<samp class="samp">coif5</samp>&rsquo;</dt>
  29266. <dt>&lsquo;<samp class="samp">bl3</samp>&rsquo;</dt>
  29267. </dl>
  29268. </dd>
  29269. <dt><samp class="option">percent</samp></dt>
  29270. <dd><p>Set percent of full denoising. Allowed range is from 0 to 100 percent.
  29271. Default value is 85 percent or partial denoising.
  29272. </p>
  29273. </dd>
  29274. <dt><samp class="option">profile</samp></dt>
  29275. <dd><p>If enabled, first input frame will be used as noise profile.
  29276. If first frame samples contain non-noise performance will be very poor.
  29277. </p>
  29278. </dd>
  29279. <dt><samp class="option">adaptive</samp></dt>
  29280. <dd><p>If enabled, input frames are analyzed for presence of noise.
  29281. If noise is detected with high possibility then input frame profile will be
  29282. used for processing following frames, until new noise frame is detected.
  29283. </p>
  29284. </dd>
  29285. <dt><samp class="option">samples</samp></dt>
  29286. <dd><p>Set size of single frame in number of samples. Allowed range is from 512 to
  29287. 65536. Default frame size is 8192 samples.
  29288. </p>
  29289. </dd>
  29290. <dt><samp class="option">softness</samp></dt>
  29291. <dd><p>Set softness applied inside thresholding function. Allowed range is from 0 to
  29292. 10. Default softness is 1.
  29293. </p></dd>
  29294. </dl>
  29295. <a name="Commands-11"></a>
  29296. <h4 class="subsection">36.28.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-11" aria-hidden="true">TOC</a></span></h4>
  29297. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  29298. </p>
  29299. <a name="agate"></a>
  29300. <h3 class="section">36.29 agate<span class="pull-right"><a class="anchor hidden-xs" href="#agate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-agate" aria-hidden="true">TOC</a></span></h3>
  29301. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  29302. processing reduces disturbing noise between useful signals.
  29303. </p>
  29304. <p>Gating is done by detecting the volume below a chosen level <var class="var">threshold</var>
  29305. and dividing it by the factor set with <var class="var">ratio</var>. The bottom of the noise
  29306. floor is set via <var class="var">range</var>. Because an exact manipulation of the signal
  29307. would cause distortion of the waveform the reduction can be levelled over
  29308. time. This is done by setting <var class="var">attack</var> and <var class="var">release</var>.
  29309. </p>
  29310. <p><var class="var">attack</var> determines how long the signal has to fall below the threshold
  29311. before any reduction will occur and <var class="var">release</var> sets the time the signal
  29312. has to rise above the threshold to reduce the reduction again.
  29313. Shorter signals than the chosen attack time will be left untouched.
  29314. </p>
  29315. <dl class="table">
  29316. <dt><samp class="option">level_in</samp></dt>
  29317. <dd><p>Set input level before filtering.
  29318. Default is 1. Allowed range is from 0.015625 to 64.
  29319. </p>
  29320. </dd>
  29321. <dt><samp class="option">mode</samp></dt>
  29322. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  29323. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  29324. will be amplified, expanding dynamic range in upward direction.
  29325. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  29326. </p>
  29327. </dd>
  29328. <dt><samp class="option">range</samp></dt>
  29329. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  29330. Default is 0.06125. Allowed range is from 0 to 1.
  29331. Setting this to 0 disables reduction and then filter behaves like expander.
  29332. </p>
  29333. </dd>
  29334. <dt><samp class="option">threshold</samp></dt>
  29335. <dd><p>If a signal rises above this level the gain reduction is released.
  29336. Default is 0.125. Allowed range is from 0 to 1.
  29337. </p>
  29338. </dd>
  29339. <dt><samp class="option">ratio</samp></dt>
  29340. <dd><p>Set a ratio by which the signal is reduced.
  29341. Default is 2. Allowed range is from 1 to 9000.
  29342. </p>
  29343. </dd>
  29344. <dt><samp class="option">attack</samp></dt>
  29345. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  29346. reduction stops.
  29347. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  29348. </p>
  29349. </dd>
  29350. <dt><samp class="option">release</samp></dt>
  29351. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  29352. reduction is increased again. Default is 250 milliseconds.
  29353. Allowed range is from 0.01 to 9000.
  29354. </p>
  29355. </dd>
  29356. <dt><samp class="option">makeup</samp></dt>
  29357. <dd><p>Set amount of amplification of signal after processing.
  29358. Default is 1. Allowed range is from 1 to 64.
  29359. </p>
  29360. </dd>
  29361. <dt><samp class="option">knee</samp></dt>
  29362. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  29363. Default is 2.828427125. Allowed range is from 1 to 8.
  29364. </p>
  29365. </dd>
  29366. <dt><samp class="option">detection</samp></dt>
  29367. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  29368. Default is <code class="code">rms</code>. Can be <code class="code">peak</code> or <code class="code">rms</code>.
  29369. </p>
  29370. </dd>
  29371. <dt><samp class="option">link</samp></dt>
  29372. <dd><p>Choose if the average level between all channels or the louder channel affects
  29373. the reduction.
  29374. Default is <code class="code">average</code>. Can be <code class="code">average</code> or <code class="code">maximum</code>.
  29375. </p></dd>
  29376. </dl>
  29377. <a name="Commands-12"></a>
  29378. <h4 class="subsection">36.29.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-12" aria-hidden="true">TOC</a></span></h4>
  29379. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  29380. </p>
  29381. <a name="aiir"></a>
  29382. <h3 class="section">36.30 aiir<span class="pull-right"><a class="anchor hidden-xs" href="#aiir" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aiir" aria-hidden="true">TOC</a></span></h3>
  29383. <p>Apply an arbitrary Infinite Impulse Response filter.
  29384. </p>
  29385. <p>It accepts the following parameters:
  29386. </p>
  29387. <dl class="table">
  29388. <dt><samp class="option">zeros, z</samp></dt>
  29389. <dd><p>Set B/numerator/zeros/reflection coefficients.
  29390. </p>
  29391. </dd>
  29392. <dt><samp class="option">poles, p</samp></dt>
  29393. <dd><p>Set A/denominator/poles/ladder coefficients.
  29394. </p>
  29395. </dd>
  29396. <dt><samp class="option">gains, k</samp></dt>
  29397. <dd><p>Set channels gains.
  29398. </p>
  29399. </dd>
  29400. <dt><samp class="option">dry_gain</samp></dt>
  29401. <dd><p>Set input gain.
  29402. </p>
  29403. </dd>
  29404. <dt><samp class="option">wet_gain</samp></dt>
  29405. <dd><p>Set output gain.
  29406. </p>
  29407. </dd>
  29408. <dt><samp class="option">format, f</samp></dt>
  29409. <dd><p>Set coefficients format.
  29410. </p>
  29411. <dl class="table">
  29412. <dt>&lsquo;<samp class="samp">ll</samp>&rsquo;</dt>
  29413. <dd><p>lattice-ladder function
  29414. </p></dd>
  29415. <dt>&lsquo;<samp class="samp">sf</samp>&rsquo;</dt>
  29416. <dd><p>analog transfer function
  29417. </p></dd>
  29418. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  29419. <dd><p>digital transfer function
  29420. </p></dd>
  29421. <dt>&lsquo;<samp class="samp">zp</samp>&rsquo;</dt>
  29422. <dd><p>Z-plane zeros/poles, cartesian (default)
  29423. </p></dd>
  29424. <dt>&lsquo;<samp class="samp">pr</samp>&rsquo;</dt>
  29425. <dd><p>Z-plane zeros/poles, polar radians
  29426. </p></dd>
  29427. <dt>&lsquo;<samp class="samp">pd</samp>&rsquo;</dt>
  29428. <dd><p>Z-plane zeros/poles, polar degrees
  29429. </p></dd>
  29430. <dt>&lsquo;<samp class="samp">sp</samp>&rsquo;</dt>
  29431. <dd><p>S-plane zeros/poles
  29432. </p></dd>
  29433. </dl>
  29434. </dd>
  29435. <dt><samp class="option">process, r</samp></dt>
  29436. <dd><p>Set type of processing.
  29437. </p>
  29438. <dl class="table">
  29439. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  29440. <dd><p>direct processing
  29441. </p></dd>
  29442. <dt>&lsquo;<samp class="samp">s</samp>&rsquo;</dt>
  29443. <dd><p>serial processing
  29444. </p></dd>
  29445. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  29446. <dd><p>parallel processing
  29447. </p></dd>
  29448. </dl>
  29449. </dd>
  29450. <dt><samp class="option">precision, e</samp></dt>
  29451. <dd><p>Set filtering precision.
  29452. </p>
  29453. <dl class="table">
  29454. <dt>&lsquo;<samp class="samp">dbl</samp>&rsquo;</dt>
  29455. <dd><p>double-precision floating-point (default)
  29456. </p></dd>
  29457. <dt>&lsquo;<samp class="samp">flt</samp>&rsquo;</dt>
  29458. <dd><p>single-precision floating-point
  29459. </p></dd>
  29460. <dt>&lsquo;<samp class="samp">i32</samp>&rsquo;</dt>
  29461. <dd><p>32-bit integers
  29462. </p></dd>
  29463. <dt>&lsquo;<samp class="samp">i16</samp>&rsquo;</dt>
  29464. <dd><p>16-bit integers
  29465. </p></dd>
  29466. </dl>
  29467. </dd>
  29468. <dt><samp class="option">normalize, n</samp></dt>
  29469. <dd><p>Normalize filter coefficients, by default is enabled.
  29470. Enabling it will normalize magnitude response at DC to 0dB.
  29471. </p>
  29472. </dd>
  29473. <dt><samp class="option">mix</samp></dt>
  29474. <dd><p>How much to use filtered signal in output. Default is 1.
  29475. Range is between 0 and 1.
  29476. </p>
  29477. </dd>
  29478. <dt><samp class="option">response</samp></dt>
  29479. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  29480. By default it is disabled.
  29481. </p>
  29482. </dd>
  29483. <dt><samp class="option">channel</samp></dt>
  29484. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  29485. displayed. This option is used only when <var class="var">response</var> is enabled.
  29486. </p>
  29487. </dd>
  29488. <dt><samp class="option">size</samp></dt>
  29489. <dd><p>Set video stream size. This option is used only when <var class="var">response</var> is enabled.
  29490. </p></dd>
  29491. </dl>
  29492. <p>Coefficients in <code class="code">tf</code> and <code class="code">sf</code> format are separated by spaces and are in ascending
  29493. order.
  29494. </p>
  29495. <p>Coefficients in <code class="code">zp</code> format are separated by spaces and order of coefficients
  29496. doesn&rsquo;t matter. Coefficients in <code class="code">zp</code> format are complex numbers with <var class="var">i</var>
  29497. imaginary unit.
  29498. </p>
  29499. <p>Different coefficients and gains can be provided for every channel, in such case
  29500. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  29501. used for all remaining channels.
  29502. </p>
  29503. <a name="Examples-55"></a>
  29504. <h4 class="subsection">36.30.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-55" aria-hidden="true">TOC</a></span></h4>
  29505. <ul class="itemize mark-bullet">
  29506. <li>Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  29507. <div class="example">
  29508. <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
  29509. </pre></div>
  29510. </li><li>Same as above but in <code class="code">zp</code> format:
  29511. <div class="example">
  29512. <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
  29513. </pre></div>
  29514. </li><li>Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format:
  29515. <div class="example">
  29516. <pre class="example-preformatted">aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
  29517. </pre></div>
  29518. </li></ul>
  29519. <a name="alimiter"></a>
  29520. <h3 class="section">36.31 alimiter<span class="pull-right"><a class="anchor hidden-xs" href="#alimiter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alimiter" aria-hidden="true">TOC</a></span></h3>
  29521. <p>The limiter prevents an input signal from rising over a desired threshold.
  29522. This limiter uses lookahead technology to prevent your signal from distorting.
  29523. It means that there is a small delay after the signal is processed. Keep in mind
  29524. that the delay it produces is the attack time you set.
  29525. </p>
  29526. <p>The filter accepts the following options:
  29527. </p>
  29528. <dl class="table">
  29529. <dt><samp class="option">level_in</samp></dt>
  29530. <dd><p>Set input gain. Default is 1.
  29531. </p>
  29532. </dd>
  29533. <dt><samp class="option">level_out</samp></dt>
  29534. <dd><p>Set output gain. Default is 1.
  29535. </p>
  29536. </dd>
  29537. <dt><samp class="option">limit</samp></dt>
  29538. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  29539. </p>
  29540. </dd>
  29541. <dt><samp class="option">attack</samp></dt>
  29542. <dd><p>The limiter will reach its attenuation level in this amount of time in
  29543. milliseconds. Default is 5 milliseconds.
  29544. </p>
  29545. </dd>
  29546. <dt><samp class="option">release</samp></dt>
  29547. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  29548. Default is 50 milliseconds.
  29549. </p>
  29550. </dd>
  29551. <dt><samp class="option">asc</samp></dt>
  29552. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  29553. average reduction level rather than reaching a reduction of 0 in the release
  29554. time.
  29555. </p>
  29556. </dd>
  29557. <dt><samp class="option">asc_level</samp></dt>
  29558. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  29559. in release time while 1 produces higher release times.
  29560. </p>
  29561. </dd>
  29562. <dt><samp class="option">level</samp></dt>
  29563. <dd><p>Auto level output signal. Default is enabled.
  29564. This normalizes audio back to 0dB if enabled.
  29565. </p>
  29566. </dd>
  29567. <dt><samp class="option">latency</samp></dt>
  29568. <dd><p>Compensate the delay introduced by using the lookahead buffer set with attack
  29569. parameter. Also flush the valid audio data in the lookahead buffer when the
  29570. stream hits EOF.
  29571. </p></dd>
  29572. </dl>
  29573. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  29574. with <a class="ref" href="#aresample">aresample</a> before applying this filter.
  29575. </p>
  29576. <a name="allpass"></a>
  29577. <h3 class="section">36.32 allpass<span class="pull-right"><a class="anchor hidden-xs" href="#allpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allpass" aria-hidden="true">TOC</a></span></h3>
  29578. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  29579. <var class="var">frequency</var>, and filter-width <var class="var">width</var>.
  29580. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  29581. without changing its frequency to amplitude relationship.
  29582. </p>
  29583. <p>The filter accepts the following options:
  29584. </p>
  29585. <dl class="table">
  29586. <dt><samp class="option">frequency, f</samp></dt>
  29587. <dd><p>Set frequency in Hz.
  29588. </p>
  29589. </dd>
  29590. <dt><samp class="option">width_type, t</samp></dt>
  29591. <dd><p>Set method to specify band-width of filter.
  29592. </p><dl class="table">
  29593. <dt><samp class="option">h</samp></dt>
  29594. <dd><p>Hz
  29595. </p></dd>
  29596. <dt><samp class="option">q</samp></dt>
  29597. <dd><p>Q-Factor
  29598. </p></dd>
  29599. <dt><samp class="option">o</samp></dt>
  29600. <dd><p>octave
  29601. </p></dd>
  29602. <dt><samp class="option">s</samp></dt>
  29603. <dd><p>slope
  29604. </p></dd>
  29605. <dt><samp class="option">k</samp></dt>
  29606. <dd><p>kHz
  29607. </p></dd>
  29608. </dl>
  29609. </dd>
  29610. <dt><samp class="option">width, w</samp></dt>
  29611. <dd><p>Specify the band-width of a filter in width_type units.
  29612. </p>
  29613. </dd>
  29614. <dt><samp class="option">mix, m</samp></dt>
  29615. <dd><p>How much to use filtered signal in output. Default is 1.
  29616. Range is between 0 and 1.
  29617. </p>
  29618. </dd>
  29619. <dt><samp class="option">channels, c</samp></dt>
  29620. <dd><p>Specify which channels to filter, by default all available are filtered.
  29621. </p>
  29622. </dd>
  29623. <dt><samp class="option">normalize, n</samp></dt>
  29624. <dd><p>Normalize biquad coefficients, by default is disabled.
  29625. Enabling it will normalize magnitude response at DC to 0dB.
  29626. </p>
  29627. </dd>
  29628. <dt><samp class="option">order, o</samp></dt>
  29629. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  29630. </p>
  29631. </dd>
  29632. <dt><samp class="option">transform, a</samp></dt>
  29633. <dd><p>Set transform type of IIR filter.
  29634. </p><dl class="table">
  29635. <dt><samp class="option">di</samp></dt>
  29636. <dt><samp class="option">dii</samp></dt>
  29637. <dt><samp class="option">tdi</samp></dt>
  29638. <dt><samp class="option">tdii</samp></dt>
  29639. <dt><samp class="option">latt</samp></dt>
  29640. <dt><samp class="option">svf</samp></dt>
  29641. <dt><samp class="option">zdf</samp></dt>
  29642. </dl>
  29643. </dd>
  29644. <dt><samp class="option">precision, r</samp></dt>
  29645. <dd><p>Set precision of filtering.
  29646. </p><dl class="table">
  29647. <dt><samp class="option">auto</samp></dt>
  29648. <dd><p>Pick automatic sample format depending on surround filters.
  29649. </p></dd>
  29650. <dt><samp class="option">s16</samp></dt>
  29651. <dd><p>Always use signed 16-bit.
  29652. </p></dd>
  29653. <dt><samp class="option">s32</samp></dt>
  29654. <dd><p>Always use signed 32-bit.
  29655. </p></dd>
  29656. <dt><samp class="option">f32</samp></dt>
  29657. <dd><p>Always use float 32-bit.
  29658. </p></dd>
  29659. <dt><samp class="option">f64</samp></dt>
  29660. <dd><p>Always use float 64-bit.
  29661. </p></dd>
  29662. </dl>
  29663. </dd>
  29664. </dl>
  29665. <a name="Commands-13"></a>
  29666. <h4 class="subsection">36.32.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-13" aria-hidden="true">TOC</a></span></h4>
  29667. <p>This filter supports the following commands:
  29668. </p><dl class="table">
  29669. <dt><samp class="option">frequency, f</samp></dt>
  29670. <dd><p>Change allpass frequency.
  29671. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  29672. </p>
  29673. </dd>
  29674. <dt><samp class="option">width_type, t</samp></dt>
  29675. <dd><p>Change allpass width_type.
  29676. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  29677. </p>
  29678. </dd>
  29679. <dt><samp class="option">width, w</samp></dt>
  29680. <dd><p>Change allpass width.
  29681. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  29682. </p>
  29683. </dd>
  29684. <dt><samp class="option">mix, m</samp></dt>
  29685. <dd><p>Change allpass mix.
  29686. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  29687. </p></dd>
  29688. </dl>
  29689. <a name="aloop"></a>
  29690. <h3 class="section">36.33 aloop<span class="pull-right"><a class="anchor hidden-xs" href="#aloop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aloop" aria-hidden="true">TOC</a></span></h3>
  29691. <p>Loop audio samples.
  29692. </p>
  29693. <p>The filter accepts the following options:
  29694. </p>
  29695. <dl class="table">
  29696. <dt><samp class="option">loop</samp></dt>
  29697. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  29698. Default is 0.
  29699. </p>
  29700. </dd>
  29701. <dt><samp class="option">size</samp></dt>
  29702. <dd><p>Set maximal number of samples. Default is 0.
  29703. </p>
  29704. </dd>
  29705. <dt><samp class="option">start</samp></dt>
  29706. <dd><p>Set first sample of loop. Default is 0.
  29707. </p>
  29708. </dd>
  29709. <dt><samp class="option">time</samp></dt>
  29710. <dd><p>Set the time of loop start in seconds.
  29711. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  29712. </p></dd>
  29713. </dl>
  29714. <a class="anchor" id="amerge"></a><a name="amerge-1"></a>
  29715. <h3 class="section">36.34 amerge<span class="pull-right"><a class="anchor hidden-xs" href="#amerge-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amerge-1" aria-hidden="true">TOC</a></span></h3>
  29716. <p>Merge two or more audio streams into a single multi-channel stream.
  29717. </p>
  29718. <p>All inputs must have the same sample rate, and format.
  29719. </p>
  29720. <p>If inputs do not have the same duration, the output will stop with the
  29721. shortest.
  29722. </p>
  29723. <p>The filter accepts the following options:
  29724. </p>
  29725. <dl class="table">
  29726. <dt><samp class="option">inputs</samp></dt>
  29727. <dd><p>Set the number of inputs. Default is 2.
  29728. </p>
  29729. </dd>
  29730. <dt><samp class="option">layout_mode</samp></dt>
  29731. <dd>
  29732. <p>This option controls how the output channel layout is determined and if the
  29733. audio channels are reordered during merge.
  29734. </p>
  29735. <dl class="table">
  29736. <dt><samp class="option">legacy</samp></dt>
  29737. <dd>
  29738. <p>This is the mode how the filter behaved historically so it is the default.
  29739. </p>
  29740. <p>If the channel layouts of the inputs are known and disjoint, and therefore
  29741. compatible, the channel layout of the output will be set accordingly and the
  29742. channels will be reordered as necessary. If the channel layouts of the inputs
  29743. are not disjoint, some of them are unknown, or they are using special channel
  29744. layouts, such as ambisonics, the output will have all the channels of the first
  29745. input then all the channels of the second input, in that order, and the channel
  29746. layout of the output will be the default value corresponding to the total
  29747. number of channels.
  29748. </p>
  29749. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  29750. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  29751. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  29752. first input, b1 is the first channel of the second input).
  29753. </p>
  29754. <p>On the other hand, if both input are in stereo, the output channels will be
  29755. in the default order: a1, a2, b1, b2, and the channel layout will be
  29756. arbitrarily set to 4.0, which may or may not be the expected value.
  29757. </p>
  29758. </dd>
  29759. <dt><samp class="option">reset</samp></dt>
  29760. <dd><p>This mode ignores the input channel layouts and does no channel reordering.
  29761. The output will have all the channels of the first input, then all the channels
  29762. of the second input, in that order, and so on.
  29763. </p>
  29764. <p>The output channel layout will only specify the total channel count.
  29765. </p>
  29766. </dd>
  29767. <dt><samp class="option">normal</samp></dt>
  29768. <dd><p>This mode keeps channel name and designation information from the input
  29769. channels and does no channel reordering. The output will have all the channels
  29770. of the first input, then all the channels of the second input, in that order,
  29771. and so on.
  29772. </p>
  29773. </dd>
  29774. </dl>
  29775. </dd>
  29776. </dl>
  29777. <a name="Examples-56"></a>
  29778. <h4 class="subsection">36.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-56" aria-hidden="true">TOC</a></span></h4>
  29779. <ul class="itemize mark-bullet">
  29780. <li>Merge two mono files into a stereo stream:
  29781. <div class="example">
  29782. <pre class="example-preformatted">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  29783. </pre></div>
  29784. </li><li>Multiple merges assuming 1 video stream and 6 audio streams in <samp class="file">input.mkv</samp>:
  29785. <div class="example">
  29786. <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
  29787. </pre></div>
  29788. </li></ul>
  29789. <a name="amix"></a>
  29790. <h3 class="section">36.35 amix<span class="pull-right"><a class="anchor hidden-xs" href="#amix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amix" aria-hidden="true">TOC</a></span></h3>
  29791. <p>Mixes multiple audio inputs into a single output.
  29792. </p>
  29793. <p>Note that this filter only supports float samples (the <var class="var">amerge</var>
  29794. and <var class="var">pan</var> audio filters support many formats). If the <var class="var">amix</var>
  29795. input has integer samples then <a class="ref" href="#aresample">aresample</a> will be automatically
  29796. inserted to perform the conversion to float samples.
  29797. </p>
  29798. <p>It accepts the following parameters:
  29799. </p><dl class="table">
  29800. <dt><samp class="option">inputs</samp></dt>
  29801. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  29802. </p>
  29803. </dd>
  29804. <dt><samp class="option">duration</samp></dt>
  29805. <dd><p>How to determine the end-of-stream.
  29806. </p><dl class="table">
  29807. <dt><samp class="option">longest</samp></dt>
  29808. <dd><p>The duration of the longest input. (default)
  29809. </p>
  29810. </dd>
  29811. <dt><samp class="option">shortest</samp></dt>
  29812. <dd><p>The duration of the shortest input.
  29813. </p>
  29814. </dd>
  29815. <dt><samp class="option">first</samp></dt>
  29816. <dd><p>The duration of the first input.
  29817. </p>
  29818. </dd>
  29819. </dl>
  29820. </dd>
  29821. <dt><samp class="option">dropout_transition</samp></dt>
  29822. <dd><p>The transition time, in seconds, for volume renormalization when an input
  29823. stream ends. The default value is 2 seconds.
  29824. </p>
  29825. </dd>
  29826. <dt><samp class="option">weights</samp></dt>
  29827. <dd><p>Specify weight of each input audio stream as a sequence of numbers separated
  29828. by a space. If fewer weights are specified compared to number of inputs, the
  29829. last weight is assigned to the remaining inputs.
  29830. Default weight for each input is 1.
  29831. </p>
  29832. </dd>
  29833. <dt><samp class="option">normalize</samp></dt>
  29834. <dd><p>Always scale inputs instead of only doing summation of samples.
  29835. Beware of heavy clipping if inputs are not normalized prior or after filtering
  29836. by this filter if this option is disabled. By default is enabled.
  29837. </p></dd>
  29838. </dl>
  29839. <a name="Examples-57"></a>
  29840. <h4 class="subsection">36.35.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-57" aria-hidden="true">TOC</a></span></h4>
  29841. <ul class="itemize mark-bullet">
  29842. <li>This will mix 3 input audio streams to a single output with the same duration as the
  29843. first input and a dropout transition time of 3 seconds:
  29844. <div class="example">
  29845. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  29846. </pre></div>
  29847. </li><li>This will mix one vocal and one music input audio stream to a single output with the same duration as the
  29848. longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized:
  29849. <div class="example">
  29850. <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
  29851. </pre></div>
  29852. </li></ul>
  29853. <a name="Commands-14"></a>
  29854. <h4 class="subsection">36.35.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-14" aria-hidden="true">TOC</a></span></h4>
  29855. <p>This filter supports the following commands:
  29856. </p><dl class="table">
  29857. <dt><samp class="option">weights</samp></dt>
  29858. <dt><samp class="option">normalize</samp></dt>
  29859. <dd><p>Syntax is same as option with same name.
  29860. </p></dd>
  29861. </dl>
  29862. <a name="amultiply"></a>
  29863. <h3 class="section">36.36 amultiply<span class="pull-right"><a class="anchor hidden-xs" href="#amultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amultiply" aria-hidden="true">TOC</a></span></h3>
  29864. <p>Multiply first audio stream with second audio stream and store result
  29865. in output audio stream. Multiplication is done by multiplying each
  29866. sample from first stream with sample at same position from second stream.
  29867. </p>
  29868. <p>With this element-wise multiplication one can create amplitude fades and
  29869. amplitude modulations.
  29870. </p>
  29871. <a name="anequalizer"></a>
  29872. <h3 class="section">36.37 anequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#anequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anequalizer" aria-hidden="true">TOC</a></span></h3>
  29873. <p>High-order parametric multiband equalizer for each channel.
  29874. </p>
  29875. <p>It accepts the following parameters:
  29876. </p><dl class="table">
  29877. <dt><samp class="option">params</samp></dt>
  29878. <dd>
  29879. <p>This option string is in format:
  29880. &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;
  29881. Each equalizer band is separated by &rsquo;|&rsquo;.
  29882. </p>
  29883. <dl class="table">
  29884. <dt><samp class="option">chn</samp></dt>
  29885. <dd><p>Set channel number to which equalization will be applied.
  29886. If input doesn&rsquo;t have that channel the entry is ignored.
  29887. </p>
  29888. </dd>
  29889. <dt><samp class="option">f</samp></dt>
  29890. <dd><p>Set central frequency for band.
  29891. If input doesn&rsquo;t have that frequency the entry is ignored.
  29892. </p>
  29893. </dd>
  29894. <dt><samp class="option">w</samp></dt>
  29895. <dd><p>Set band width in Hertz.
  29896. </p>
  29897. </dd>
  29898. <dt><samp class="option">g</samp></dt>
  29899. <dd><p>Set band gain in dB.
  29900. </p>
  29901. </dd>
  29902. <dt><samp class="option">t</samp></dt>
  29903. <dd><p>Set filter type for band, optional, can be:
  29904. </p>
  29905. <dl class="table">
  29906. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  29907. <dd><p>Butterworth, this is default.
  29908. </p>
  29909. </dd>
  29910. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  29911. <dd><p>Chebyshev type 1.
  29912. </p>
  29913. </dd>
  29914. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  29915. <dd><p>Chebyshev type 2.
  29916. </p></dd>
  29917. </dl>
  29918. </dd>
  29919. </dl>
  29920. </dd>
  29921. <dt><samp class="option">curves</samp></dt>
  29922. <dd><p>With this option activated frequency response of anequalizer is displayed
  29923. in video stream.
  29924. </p>
  29925. </dd>
  29926. <dt><samp class="option">size</samp></dt>
  29927. <dd><p>Set video stream size. Only useful if curves option is activated.
  29928. </p>
  29929. </dd>
  29930. <dt><samp class="option">mgain</samp></dt>
  29931. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  29932. Setting this to a reasonable value makes it possible to display gain which is derived from
  29933. neighbour bands which are too close to each other and thus produce higher gain
  29934. when both are activated.
  29935. </p>
  29936. </dd>
  29937. <dt><samp class="option">fscale</samp></dt>
  29938. <dd><p>Set frequency scale used to draw frequency response in video output.
  29939. Can be linear or logarithmic. Default is logarithmic.
  29940. </p>
  29941. </dd>
  29942. <dt><samp class="option">colors</samp></dt>
  29943. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  29944. This is list of color names separated by space or by &rsquo;|&rsquo;.
  29945. Unrecognised or missing colors will be replaced by white color.
  29946. </p></dd>
  29947. </dl>
  29948. <a name="Examples-58"></a>
  29949. <h4 class="subsection">36.37.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-58" aria-hidden="true">TOC</a></span></h4>
  29950. <ul class="itemize mark-bullet">
  29951. <li>Lower gain by 10 of central frequency 200Hz and width 100 Hz
  29952. for first 2 channels using Chebyshev type 1 filter:
  29953. <div class="example">
  29954. <pre class="example-preformatted">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  29955. </pre></div>
  29956. </li></ul>
  29957. <a name="Commands-15"></a>
  29958. <h4 class="subsection">36.37.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-15" aria-hidden="true">TOC</a></span></h4>
  29959. <p>This filter supports the following commands:
  29960. </p><dl class="table">
  29961. <dt><samp class="option">change</samp></dt>
  29962. <dd><p>Alter existing filter parameters.
  29963. 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;
  29964. </p>
  29965. <p><var class="var">fN</var> is existing filter number, starting from 0, if no such filter is available
  29966. error is returned.
  29967. <var class="var">freq</var> set new frequency parameter.
  29968. <var class="var">width</var> set new width parameter in Hertz.
  29969. <var class="var">gain</var> set new gain parameter in dB.
  29970. </p>
  29971. <p>Full filter invocation with asendcmd may look like this:
  29972. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  29973. </p></dd>
  29974. </dl>
  29975. <a name="anlmdn"></a>
  29976. <h3 class="section">36.38 anlmdn<span class="pull-right"><a class="anchor hidden-xs" href="#anlmdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlmdn" aria-hidden="true">TOC</a></span></h3>
  29977. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  29978. </p>
  29979. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  29980. context similarity is defined by comparing their surrounding patches of size
  29981. <samp class="option">p</samp>. Patches are searched in an area of <samp class="option">r</samp> around the sample.
  29982. </p>
  29983. <p>The filter accepts the following options:
  29984. </p>
  29985. <dl class="table">
  29986. <dt><samp class="option">strength, s</samp></dt>
  29987. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001.
  29988. </p>
  29989. </dd>
  29990. <dt><samp class="option">patch, p</samp></dt>
  29991. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  29992. Default value is 2 milliseconds.
  29993. </p>
  29994. </dd>
  29995. <dt><samp class="option">research, r</samp></dt>
  29996. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  29997. Default value is 6 milliseconds.
  29998. </p>
  29999. </dd>
  30000. <dt><samp class="option">output, o</samp></dt>
  30001. <dd><p>Set the output mode.
  30002. </p>
  30003. <p>It accepts the following values:
  30004. </p><dl class="table">
  30005. <dt><samp class="option">i</samp></dt>
  30006. <dd><p>Pass input unchanged.
  30007. </p>
  30008. </dd>
  30009. <dt><samp class="option">o</samp></dt>
  30010. <dd><p>Pass noise filtered out.
  30011. </p>
  30012. </dd>
  30013. <dt><samp class="option">n</samp></dt>
  30014. <dd><p>Pass only noise.
  30015. </p>
  30016. <p>Default value is <var class="var">o</var>.
  30017. </p></dd>
  30018. </dl>
  30019. </dd>
  30020. <dt><samp class="option">smooth, m</samp></dt>
  30021. <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>.
  30022. </p></dd>
  30023. </dl>
  30024. <a name="Commands-16"></a>
  30025. <h4 class="subsection">36.38.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-16" aria-hidden="true">TOC</a></span></h4>
  30026. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30027. </p>
  30028. <a name="anlmf_002c-anlms"></a>
  30029. <h3 class="section">36.39 anlmf, anlms<span class="pull-right"><a class="anchor hidden-xs" href="#anlmf_002c-anlms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlmf_002c-anlms" aria-hidden="true">TOC</a></span></h3>
  30030. <p>Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream.
  30031. </p>
  30032. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  30033. relate to producing the least mean square of the error signal (difference between the desired,
  30034. 2nd input audio stream and the actual signal, the 1st input audio stream).
  30035. </p>
  30036. <p>A description of the accepted options follows.
  30037. </p>
  30038. <dl class="table">
  30039. <dt><samp class="option">order</samp></dt>
  30040. <dd><p>Set filter order.
  30041. </p>
  30042. </dd>
  30043. <dt><samp class="option">mu</samp></dt>
  30044. <dd><p>Set filter mu.
  30045. </p>
  30046. </dd>
  30047. <dt><samp class="option">eps</samp></dt>
  30048. <dd><p>Set the filter eps.
  30049. </p>
  30050. </dd>
  30051. <dt><samp class="option">leakage</samp></dt>
  30052. <dd><p>Set the filter leakage.
  30053. </p>
  30054. </dd>
  30055. <dt><samp class="option">out_mode</samp></dt>
  30056. <dd><p>It accepts the following values:
  30057. </p><dl class="table">
  30058. <dt><samp class="option">i</samp></dt>
  30059. <dd><p>Pass the 1st input.
  30060. </p>
  30061. </dd>
  30062. <dt><samp class="option">d</samp></dt>
  30063. <dd><p>Pass the 2nd input.
  30064. </p>
  30065. </dd>
  30066. <dt><samp class="option">o</samp></dt>
  30067. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  30068. </p>
  30069. </dd>
  30070. <dt><samp class="option">n</samp></dt>
  30071. <dd><p>Pass difference between input, 1st input and error signal estimate.
  30072. </p>
  30073. </dd>
  30074. <dt><samp class="option">e</samp></dt>
  30075. <dd><p>Pass error signal estimated samples.
  30076. </p>
  30077. <p>Default value is <var class="var">o</var>.
  30078. </p></dd>
  30079. </dl>
  30080. </dd>
  30081. <dt><samp class="option">precision</samp></dt>
  30082. <dd><p>Set which precision to use when processing samples.
  30083. </p>
  30084. <dl class="table">
  30085. <dt><samp class="option">auto</samp></dt>
  30086. <dd><p>Auto pick internal sample format depending on other filters.
  30087. </p>
  30088. </dd>
  30089. <dt><samp class="option">float</samp></dt>
  30090. <dd><p>Always use single-floating point precision sample format.
  30091. </p>
  30092. </dd>
  30093. <dt><samp class="option">double</samp></dt>
  30094. <dd><p>Always use double-floating point precision sample format.
  30095. </p></dd>
  30096. </dl>
  30097. </dd>
  30098. </dl>
  30099. <a name="Examples-59"></a>
  30100. <h4 class="subsection">36.39.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-59" aria-hidden="true">TOC</a></span></h4>
  30101. <ul class="itemize mark-bullet">
  30102. <li>One of many usages of this filter is noise reduction, input audio is filtered
  30103. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  30104. <div class="example">
  30105. <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
  30106. </pre></div>
  30107. </li></ul>
  30108. <a name="Commands-17"></a>
  30109. <h4 class="subsection">36.39.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-17" aria-hidden="true">TOC</a></span></h4>
  30110. <p>This filter supports the same commands as options, excluding option <code class="code">order</code>.
  30111. </p>
  30112. <a name="anull"></a>
  30113. <h3 class="section">36.40 anull<span class="pull-right"><a class="anchor hidden-xs" href="#anull" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anull" aria-hidden="true">TOC</a></span></h3>
  30114. <p>Pass the audio source unchanged to the output.
  30115. </p>
  30116. <a name="apad"></a>
  30117. <h3 class="section">36.41 apad<span class="pull-right"><a class="anchor hidden-xs" href="#apad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apad" aria-hidden="true">TOC</a></span></h3>
  30118. <p>Pad the end of an audio stream with silence.
  30119. </p>
  30120. <p>This can be used together with <code class="command">ffmpeg</code> <samp class="option">-shortest</samp> to
  30121. extend audio streams to the same length as the video stream.
  30122. </p>
  30123. <p>A description of the accepted options follows.
  30124. </p>
  30125. <dl class="table">
  30126. <dt><samp class="option">packet_size</samp></dt>
  30127. <dd><p>Set silence packet size. Default value is 4096.
  30128. </p>
  30129. </dd>
  30130. <dt><samp class="option">pad_len</samp></dt>
  30131. <dd><p>Set the number of samples of silence to add to the end. After the
  30132. value is reached, the stream is terminated. This option is mutually
  30133. exclusive with <samp class="option">whole_len</samp>.
  30134. </p>
  30135. </dd>
  30136. <dt><samp class="option">whole_len</samp></dt>
  30137. <dd><p>Set the minimum total number of samples in the output audio stream. If
  30138. the value is longer than the input audio length, silence is added to
  30139. the end, until the value is reached. This option is mutually exclusive
  30140. with <samp class="option">pad_len</samp>.
  30141. </p>
  30142. </dd>
  30143. <dt><samp class="option">pad_dur</samp></dt>
  30144. <dd><p>Specify the duration of samples of silence to add. See
  30145. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  30146. for the accepted syntax. Used only if set to non-negative value.
  30147. </p>
  30148. </dd>
  30149. <dt><samp class="option">whole_dur</samp></dt>
  30150. <dd><p>Specify the minimum total duration in the output audio stream. See
  30151. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  30152. for the accepted syntax. Used only if set to non-negative value. If the value is longer than
  30153. the input audio length, silence is added to the end, until the value is reached.
  30154. This option is mutually exclusive with <samp class="option">pad_dur</samp>
  30155. </p></dd>
  30156. </dl>
  30157. <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>
  30158. nor <samp class="option">whole_dur</samp> option is set, the filter will add silence to the end of
  30159. the input stream indefinitely.
  30160. </p>
  30161. <p>Note that for ffmpeg 4.4 and earlier a zero <samp class="option">pad_dur</samp> or
  30162. <samp class="option">whole_dur</samp> also caused the filter to add silence indefinitely.
  30163. </p>
  30164. <a name="Examples-60"></a>
  30165. <h4 class="subsection">36.41.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-60" aria-hidden="true">TOC</a></span></h4>
  30166. <ul class="itemize mark-bullet">
  30167. <li>Add 1024 samples of silence to the end of the input:
  30168. <div class="example">
  30169. <pre class="example-preformatted">apad=pad_len=1024
  30170. </pre></div>
  30171. </li><li>Make sure the audio output will contain at least 10000 samples, pad
  30172. the input with silence if required:
  30173. <div class="example">
  30174. <pre class="example-preformatted">apad=whole_len=10000
  30175. </pre></div>
  30176. </li><li>Use <code class="command">ffmpeg</code> to pad the audio input with silence, so that the
  30177. video stream will always result the shortest and will be converted
  30178. until the end in the output file when using the <samp class="option">shortest</samp>
  30179. option:
  30180. <div class="example">
  30181. <pre class="example-preformatted">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  30182. </pre></div>
  30183. </li></ul>
  30184. <a name="aphaser"></a>
  30185. <h3 class="section">36.42 aphaser<span class="pull-right"><a class="anchor hidden-xs" href="#aphaser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaser" aria-hidden="true">TOC</a></span></h3>
  30186. <p>Add a phasing effect to the input audio.
  30187. </p>
  30188. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  30189. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  30190. </p>
  30191. <p>A description of the accepted parameters follows.
  30192. </p>
  30193. <dl class="table">
  30194. <dt><samp class="option">in_gain</samp></dt>
  30195. <dd><p>Set input gain. Default is 0.4.
  30196. </p>
  30197. </dd>
  30198. <dt><samp class="option">out_gain</samp></dt>
  30199. <dd><p>Set output gain. Default is 0.74
  30200. </p>
  30201. </dd>
  30202. <dt><samp class="option">delay</samp></dt>
  30203. <dd><p>Set delay in milliseconds. Default is 3.0.
  30204. </p>
  30205. </dd>
  30206. <dt><samp class="option">decay</samp></dt>
  30207. <dd><p>Set decay. Default is 0.4.
  30208. </p>
  30209. </dd>
  30210. <dt><samp class="option">speed</samp></dt>
  30211. <dd><p>Set modulation speed in Hz. Default is 0.5.
  30212. </p>
  30213. </dd>
  30214. <dt><samp class="option">type</samp></dt>
  30215. <dd><p>Set modulation type. Default is triangular.
  30216. </p>
  30217. <p>It accepts the following values:
  30218. </p><dl class="table">
  30219. <dt>&lsquo;<samp class="samp">triangular, t</samp>&rsquo;</dt>
  30220. <dt>&lsquo;<samp class="samp">sinusoidal, s</samp>&rsquo;</dt>
  30221. </dl>
  30222. </dd>
  30223. </dl>
  30224. <a name="aphaseshift"></a>
  30225. <h3 class="section">36.43 aphaseshift<span class="pull-right"><a class="anchor hidden-xs" href="#aphaseshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaseshift" aria-hidden="true">TOC</a></span></h3>
  30226. <p>Apply phase shift to input audio samples.
  30227. </p>
  30228. <p>The filter accepts the following options:
  30229. </p>
  30230. <dl class="table">
  30231. <dt><samp class="option">shift</samp></dt>
  30232. <dd><p>Specify phase shift. Allowed range is from -1.0 to 1.0.
  30233. Default value is 0.0.
  30234. </p>
  30235. </dd>
  30236. <dt><samp class="option">level</samp></dt>
  30237. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  30238. Default value is 1.0.
  30239. </p>
  30240. </dd>
  30241. <dt><samp class="option">order</samp></dt>
  30242. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  30243. Default value is 8.
  30244. </p></dd>
  30245. </dl>
  30246. <a name="Commands-18"></a>
  30247. <h4 class="subsection">36.43.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-18" aria-hidden="true">TOC</a></span></h4>
  30248. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30249. </p>
  30250. <a name="apsnr"></a>
  30251. <h3 class="section">36.44 apsnr<span class="pull-right"><a class="anchor hidden-xs" href="#apsnr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apsnr" aria-hidden="true">TOC</a></span></h3>
  30252. <p>Measure Audio Peak Signal-to-Noise Ratio.
  30253. </p>
  30254. <p>This filter takes two audio streams for input, and outputs first
  30255. audio stream.
  30256. Results are in dB per channel at end of either input.
  30257. </p>
  30258. <a name="apsyclip"></a>
  30259. <h3 class="section">36.45 apsyclip<span class="pull-right"><a class="anchor hidden-xs" href="#apsyclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apsyclip" aria-hidden="true">TOC</a></span></h3>
  30260. <p>Apply Psychoacoustic clipper to input audio stream.
  30261. </p>
  30262. <p>The filter accepts the following options:
  30263. </p>
  30264. <dl class="table">
  30265. <dt><samp class="option">level_in</samp></dt>
  30266. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  30267. </p>
  30268. </dd>
  30269. <dt><samp class="option">level_out</samp></dt>
  30270. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  30271. </p>
  30272. </dd>
  30273. <dt><samp class="option">clip</samp></dt>
  30274. <dd><p>Set the clipping start value. Default value is 0dBFS or 1.
  30275. </p>
  30276. </dd>
  30277. <dt><samp class="option">diff</samp></dt>
  30278. <dd><p>Output only difference samples, useful to hear introduced distortions.
  30279. By default is disabled.
  30280. </p>
  30281. </dd>
  30282. <dt><samp class="option">adaptive</samp></dt>
  30283. <dd><p>Set strength of adaptive distortion applied. Default value is 0.5.
  30284. Allowed range is from 0 to 1.
  30285. </p>
  30286. </dd>
  30287. <dt><samp class="option">iterations</samp></dt>
  30288. <dd><p>Set number of iterations of psychoacoustic clipper.
  30289. Allowed range is from 1 to 20. Default value is 10.
  30290. </p>
  30291. </dd>
  30292. <dt><samp class="option">level</samp></dt>
  30293. <dd><p>Auto level output signal. Default is disabled.
  30294. This normalizes audio back to 0dBFS if enabled.
  30295. </p></dd>
  30296. </dl>
  30297. <a name="Commands-19"></a>
  30298. <h4 class="subsection">36.45.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-19" aria-hidden="true">TOC</a></span></h4>
  30299. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30300. </p>
  30301. <a name="apulsator"></a>
  30302. <h3 class="section">36.46 apulsator<span class="pull-right"><a class="anchor hidden-xs" href="#apulsator" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apulsator" aria-hidden="true">TOC</a></span></h3>
  30303. <p>Audio pulsator is something between an autopanner and a tremolo.
  30304. But it can produce funny stereo effects as well. Pulsator changes the volume
  30305. of the left and right channel based on a LFO (low frequency oscillator) with
  30306. different waveforms and shifted phases.
  30307. This filter have the ability to define an offset between left and right
  30308. channel. An offset of 0 means that both LFO shapes match each other.
  30309. The left and right channel are altered equally - a conventional tremolo.
  30310. An offset of 50% means that the shape of the right channel is exactly shifted
  30311. in phase (or moved backwards about half of the frequency) - pulsator acts as
  30312. an autopanner. At 1 both curves match again. Every setting in between moves the
  30313. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  30314. sine and triangle waveforms. The more you set the offset near 1 (starting from
  30315. the 0.5) the faster the signal passes from the left to the right speaker.
  30316. </p>
  30317. <p>The filter accepts the following options:
  30318. </p>
  30319. <dl class="table">
  30320. <dt><samp class="option">level_in</samp></dt>
  30321. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  30322. </p>
  30323. </dd>
  30324. <dt><samp class="option">level_out</samp></dt>
  30325. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  30326. </p>
  30327. </dd>
  30328. <dt><samp class="option">mode</samp></dt>
  30329. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  30330. sawup or sawdown. Default is sine.
  30331. </p>
  30332. </dd>
  30333. <dt><samp class="option">amount</samp></dt>
  30334. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  30335. </p>
  30336. </dd>
  30337. <dt><samp class="option">offset_l</samp></dt>
  30338. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  30339. </p>
  30340. </dd>
  30341. <dt><samp class="option">offset_r</samp></dt>
  30342. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  30343. </p>
  30344. </dd>
  30345. <dt><samp class="option">width</samp></dt>
  30346. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  30347. </p>
  30348. </dd>
  30349. <dt><samp class="option">timing</samp></dt>
  30350. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  30351. </p>
  30352. </dd>
  30353. <dt><samp class="option">bpm</samp></dt>
  30354. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  30355. is set to bpm.
  30356. </p>
  30357. </dd>
  30358. <dt><samp class="option">ms</samp></dt>
  30359. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  30360. is set to ms.
  30361. </p>
  30362. </dd>
  30363. <dt><samp class="option">hz</samp></dt>
  30364. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  30365. if timing is set to hz.
  30366. </p></dd>
  30367. </dl>
  30368. <a class="anchor" id="aresample"></a><a name="aresample-1"></a>
  30369. <h3 class="section">36.47 aresample<span class="pull-right"><a class="anchor hidden-xs" href="#aresample-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aresample-1" aria-hidden="true">TOC</a></span></h3>
  30370. <p>Resample the input audio to the specified parameters, using the
  30371. libswresample library. If none are specified then the filter will
  30372. automatically convert between its input and output.
  30373. </p>
  30374. <p>This filter is also able to stretch/squeeze the audio data to make it match
  30375. the timestamps or to inject silence / cut out audio to make it match the
  30376. timestamps, do a combination of both or do neither.
  30377. </p>
  30378. <p>The filter accepts the syntax
  30379. [<var class="var">sample_rate</var>:]<var class="var">resampler_options</var>, where <var class="var">sample_rate</var>
  30380. expresses a sample rate and <var class="var">resampler_options</var> is a list of
  30381. <var class="var">key</var>=<var class="var">value</var> pairs, separated by &quot;:&quot;. See the
  30382. <a data-manual="ffmpeg-resampler" href="ffmpeg-resampler.html#Resampler-Options">&quot;Resampler Options&quot; section in the
  30383. ffmpeg-resampler(1) manual</a>
  30384. for the complete list of supported options.
  30385. </p>
  30386. <a name="Examples-61"></a>
  30387. <h4 class="subsection">36.47.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-61" aria-hidden="true">TOC</a></span></h4>
  30388. <ul class="itemize mark-bullet">
  30389. <li>Resample the input audio to 44100Hz:
  30390. <div class="example">
  30391. <pre class="example-preformatted">aresample=44100
  30392. </pre></div>
  30393. </li><li>Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  30394. samples per second compensation:
  30395. <div class="example">
  30396. <pre class="example-preformatted">aresample=async=1000
  30397. </pre></div>
  30398. </li></ul>
  30399. <a name="areverse"></a>
  30400. <h3 class="section">36.48 areverse<span class="pull-right"><a class="anchor hidden-xs" href="#areverse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-areverse" aria-hidden="true">TOC</a></span></h3>
  30401. <p>Reverse an audio clip.
  30402. </p>
  30403. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  30404. is suggested.
  30405. </p>
  30406. <a name="Examples-62"></a>
  30407. <h4 class="subsection">36.48.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-62" aria-hidden="true">TOC</a></span></h4>
  30408. <ul class="itemize mark-bullet">
  30409. <li>Take the first 5 seconds of a clip, and reverse it.
  30410. <div class="example">
  30411. <pre class="example-preformatted">atrim=end=5,areverse
  30412. </pre></div>
  30413. </li></ul>
  30414. <a name="arls"></a>
  30415. <h3 class="section">36.49 arls<span class="pull-right"><a class="anchor hidden-xs" href="#arls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-arls" aria-hidden="true">TOC</a></span></h3>
  30416. <p>Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream.
  30417. </p>
  30418. <p>This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that
  30419. relate to producing the minimal weighted linear least squares cost function of the error signal (difference
  30420. between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream).
  30421. </p>
  30422. <p>A description of the accepted options follows.
  30423. </p>
  30424. <dl class="table">
  30425. <dt><samp class="option">order</samp></dt>
  30426. <dd><p>Set the filter order.
  30427. </p>
  30428. </dd>
  30429. <dt><samp class="option">lambda</samp></dt>
  30430. <dd><p>Set the forgetting factor.
  30431. </p>
  30432. </dd>
  30433. <dt><samp class="option">delta</samp></dt>
  30434. <dd><p>Set the coefficient to initialize internal covariance matrix.
  30435. </p>
  30436. </dd>
  30437. <dt><samp class="option">out_mode</samp></dt>
  30438. <dd><p>Set the filter output samples. It accepts the following values:
  30439. </p><dl class="table">
  30440. <dt><samp class="option">i</samp></dt>
  30441. <dd><p>Pass the 1st input.
  30442. </p>
  30443. </dd>
  30444. <dt><samp class="option">d</samp></dt>
  30445. <dd><p>Pass the 2nd input.
  30446. </p>
  30447. </dd>
  30448. <dt><samp class="option">o</samp></dt>
  30449. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  30450. </p>
  30451. </dd>
  30452. <dt><samp class="option">n</samp></dt>
  30453. <dd><p>Pass difference between input, 1st input and error signal estimate.
  30454. </p>
  30455. </dd>
  30456. <dt><samp class="option">e</samp></dt>
  30457. <dd><p>Pass error signal estimated samples.
  30458. </p>
  30459. <p>Default value is <var class="var">o</var>.
  30460. </p></dd>
  30461. </dl>
  30462. </dd>
  30463. <dt><samp class="option">precision</samp></dt>
  30464. <dd><p>Set which precision to use when processing samples.
  30465. </p>
  30466. <dl class="table">
  30467. <dt><samp class="option">auto</samp></dt>
  30468. <dd><p>Auto pick internal sample format depending on other filters.
  30469. </p>
  30470. </dd>
  30471. <dt><samp class="option">float</samp></dt>
  30472. <dd><p>Always use single-floating point precision sample format.
  30473. </p>
  30474. </dd>
  30475. <dt><samp class="option">double</samp></dt>
  30476. <dd><p>Always use double-floating point precision sample format.
  30477. </p></dd>
  30478. </dl>
  30479. </dd>
  30480. </dl>
  30481. <a name="arnndn"></a>
  30482. <h3 class="section">36.50 arnndn<span class="pull-right"><a class="anchor hidden-xs" href="#arnndn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-arnndn" aria-hidden="true">TOC</a></span></h3>
  30483. <p>Reduce noise from speech using Recurrent Neural Networks.
  30484. </p>
  30485. <p>This filter accepts the following options:
  30486. </p>
  30487. <dl class="table">
  30488. <dt><samp class="option">model, m</samp></dt>
  30489. <dd><p>Set train model file to load. This option is always required.
  30490. </p>
  30491. </dd>
  30492. <dt><samp class="option">mix</samp></dt>
  30493. <dd><p>Set how much to mix filtered samples into final output.
  30494. Allowed range is from -1 to 1. Default value is 1.
  30495. Negative values are special, they set how much to keep filtered noise
  30496. in the final filter output. Set this option to -1 to hear actual
  30497. noise removed from input signal.
  30498. </p></dd>
  30499. </dl>
  30500. <a name="Commands-20"></a>
  30501. <h4 class="subsection">36.50.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-20" aria-hidden="true">TOC</a></span></h4>
  30502. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30503. </p>
  30504. <a name="asdr"></a>
  30505. <h3 class="section">36.51 asdr<span class="pull-right"><a class="anchor hidden-xs" href="#asdr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asdr" aria-hidden="true">TOC</a></span></h3>
  30506. <p>Measure Audio Signal-to-Distortion Ratio.
  30507. </p>
  30508. <p>This filter takes two audio streams for input, and outputs first
  30509. audio stream.
  30510. Results are in dB per channel at end of either input.
  30511. </p>
  30512. <a name="asetnsamples"></a>
  30513. <h3 class="section">36.52 asetnsamples<span class="pull-right"><a class="anchor hidden-xs" href="#asetnsamples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetnsamples" aria-hidden="true">TOC</a></span></h3>
  30514. <p>Set the number of samples per each output audio frame.
  30515. </p>
  30516. <p>The last output packet may contain a different number of samples, as
  30517. the filter will flush all the remaining samples when the input audio
  30518. signals its end.
  30519. </p>
  30520. <p>The filter accepts the following options:
  30521. </p>
  30522. <dl class="table">
  30523. <dt><samp class="option">nb_out_samples, n</samp></dt>
  30524. <dd><p>Set the number of frames per each output audio frame. The number is
  30525. intended as the number of samples <em class="emph">per each channel</em>.
  30526. Default value is 1024.
  30527. </p>
  30528. </dd>
  30529. <dt><samp class="option">pad, p</samp></dt>
  30530. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  30531. that the last frame will contain the same number of samples as the
  30532. previous ones. Default value is 1.
  30533. </p></dd>
  30534. </dl>
  30535. <p>For example, to set the number of per-frame samples to 1234 and
  30536. disable padding for the last frame, use:
  30537. </p><div class="example">
  30538. <pre class="example-preformatted">asetnsamples=n=1234:p=0
  30539. </pre></div>
  30540. <a name="asetrate"></a>
  30541. <h3 class="section">36.53 asetrate<span class="pull-right"><a class="anchor hidden-xs" href="#asetrate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetrate" aria-hidden="true">TOC</a></span></h3>
  30542. <p>Set the sample rate without altering the PCM data.
  30543. This will result in a change of speed and pitch.
  30544. </p>
  30545. <p>The filter accepts the following options:
  30546. </p>
  30547. <dl class="table">
  30548. <dt><samp class="option">sample_rate, r</samp></dt>
  30549. <dd><p>Set the output sample rate. Default is 44100 Hz.
  30550. </p></dd>
  30551. </dl>
  30552. <a name="ashowinfo"></a>
  30553. <h3 class="section">36.54 ashowinfo<span class="pull-right"><a class="anchor hidden-xs" href="#ashowinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ashowinfo" aria-hidden="true">TOC</a></span></h3>
  30554. <p>Show a line containing various information for each input audio frame.
  30555. The input audio is not modified.
  30556. </p>
  30557. <p>The shown line contains a sequence of key/value pairs of the form
  30558. <var class="var">key</var>:<var class="var">value</var>.
  30559. </p>
  30560. <p>The following values are shown in the output:
  30561. </p>
  30562. <dl class="table">
  30563. <dt><samp class="option">n</samp></dt>
  30564. <dd><p>The (sequential) number of the input frame, starting from 0.
  30565. </p>
  30566. </dd>
  30567. <dt><samp class="option">pts</samp></dt>
  30568. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  30569. depends on the filter input pad, and is usually 1/<var class="var">sample_rate</var>.
  30570. </p>
  30571. </dd>
  30572. <dt><samp class="option">pts_time</samp></dt>
  30573. <dd><p>The presentation timestamp of the input frame in seconds.
  30574. </p>
  30575. </dd>
  30576. <dt><samp class="option">fmt</samp></dt>
  30577. <dd><p>The sample format.
  30578. </p>
  30579. </dd>
  30580. <dt><samp class="option">chlayout</samp></dt>
  30581. <dd><p>The channel layout.
  30582. </p>
  30583. </dd>
  30584. <dt><samp class="option">rate</samp></dt>
  30585. <dd><p>The sample rate for the audio frame.
  30586. </p>
  30587. </dd>
  30588. <dt><samp class="option">nb_samples</samp></dt>
  30589. <dd><p>The number of samples (per channel) in the frame.
  30590. </p>
  30591. </dd>
  30592. <dt><samp class="option">checksum</samp></dt>
  30593. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  30594. audio, the data is treated as if all the planes were concatenated.
  30595. </p>
  30596. </dd>
  30597. <dt><samp class="option">plane_checksums</samp></dt>
  30598. <dd><p>A list of Adler-32 checksums for each data plane.
  30599. </p></dd>
  30600. </dl>
  30601. <a name="asisdr"></a>
  30602. <h3 class="section">36.55 asisdr<span class="pull-right"><a class="anchor hidden-xs" href="#asisdr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asisdr" aria-hidden="true">TOC</a></span></h3>
  30603. <p>Measure Audio Scaled-Invariant Signal-to-Distortion Ratio.
  30604. </p>
  30605. <p>This filter takes two audio streams for input, and outputs first
  30606. audio stream.
  30607. Results are in dB per channel at end of either input.
  30608. </p>
  30609. <a name="asoftclip"></a>
  30610. <h3 class="section">36.56 asoftclip<span class="pull-right"><a class="anchor hidden-xs" href="#asoftclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asoftclip" aria-hidden="true">TOC</a></span></h3>
  30611. <p>Apply audio soft clipping.
  30612. </p>
  30613. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  30614. along a smooth curve, rather than the abrupt shape of hard-clipping.
  30615. </p>
  30616. <p>This filter accepts the following options:
  30617. </p>
  30618. <dl class="table">
  30619. <dt><samp class="option">type</samp></dt>
  30620. <dd><p>Set type of soft-clipping.
  30621. </p>
  30622. <p>It accepts the following values:
  30623. </p><dl class="table">
  30624. <dt><samp class="option">hard</samp></dt>
  30625. <dt><samp class="option">tanh</samp></dt>
  30626. <dt><samp class="option">atan</samp></dt>
  30627. <dt><samp class="option">cubic</samp></dt>
  30628. <dt><samp class="option">exp</samp></dt>
  30629. <dt><samp class="option">alg</samp></dt>
  30630. <dt><samp class="option">quintic</samp></dt>
  30631. <dt><samp class="option">sin</samp></dt>
  30632. <dt><samp class="option">erf</samp></dt>
  30633. </dl>
  30634. </dd>
  30635. <dt><samp class="option">threshold</samp></dt>
  30636. <dd><p>Set threshold from where to start clipping. Default value is 0dB or 1.
  30637. </p>
  30638. </dd>
  30639. <dt><samp class="option">output</samp></dt>
  30640. <dd><p>Set gain applied to output. Default value is 0dB or 1.
  30641. </p>
  30642. </dd>
  30643. <dt><samp class="option">param</samp></dt>
  30644. <dd><p>Set additional parameter which controls sigmoid function.
  30645. </p>
  30646. </dd>
  30647. <dt><samp class="option">oversample</samp></dt>
  30648. <dd><p>Set oversampling factor.
  30649. </p></dd>
  30650. </dl>
  30651. <a name="Commands-21"></a>
  30652. <h4 class="subsection">36.56.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-21" aria-hidden="true">TOC</a></span></h4>
  30653. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30654. </p>
  30655. <a name="aspectralstats"></a>
  30656. <h3 class="section">36.57 aspectralstats<span class="pull-right"><a class="anchor hidden-xs" href="#aspectralstats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aspectralstats" aria-hidden="true">TOC</a></span></h3>
  30657. <p>Display frequency domain statistical information about the audio channels.
  30658. Statistics are calculated and stored as metadata for each audio channel and for each audio frame.
  30659. </p>
  30660. <p>It accepts the following option:
  30661. </p><dl class="table">
  30662. <dt><samp class="option">win_size</samp></dt>
  30663. <dd><p>Set the window length in samples. Default value is 2048.
  30664. Allowed range is from 32 to 65536.
  30665. </p>
  30666. </dd>
  30667. <dt><samp class="option">win_func</samp></dt>
  30668. <dd><p>Set window function.
  30669. </p>
  30670. <p>It accepts the following values:
  30671. </p><dl class="table">
  30672. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  30673. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  30674. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  30675. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  30676. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  30677. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  30678. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  30679. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  30680. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  30681. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  30682. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  30683. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  30684. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  30685. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  30686. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  30687. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  30688. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  30689. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  30690. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  30691. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  30692. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  30693. </dl>
  30694. <p>Default is <code class="code">hann</code>.
  30695. </p>
  30696. </dd>
  30697. <dt><samp class="option">overlap</samp></dt>
  30698. <dd><p>Set window overlap. Allowed range is from <code class="code">0</code>
  30699. to <code class="code">1</code>. Default value is <code class="code">0.5</code>.
  30700. </p>
  30701. </dd>
  30702. <dt><samp class="option">measure</samp></dt>
  30703. <dd><p>Select the parameters which are measured. The metadata keys can
  30704. be used as flags, default is <samp class="option">all</samp> which measures everything.
  30705. <samp class="option">none</samp> disables all measurement.
  30706. </p></dd>
  30707. </dl>
  30708. <p>A list of each metadata key follows:
  30709. </p>
  30710. <dl class="table">
  30711. <dt><samp class="option">mean</samp></dt>
  30712. <dt><samp class="option">variance</samp></dt>
  30713. <dt><samp class="option">centroid</samp></dt>
  30714. <dt><samp class="option">spread</samp></dt>
  30715. <dt><samp class="option">skewness</samp></dt>
  30716. <dt><samp class="option">kurtosis</samp></dt>
  30717. <dt><samp class="option">entropy</samp></dt>
  30718. <dt><samp class="option">flatness</samp></dt>
  30719. <dt><samp class="option">crest</samp></dt>
  30720. <dt><samp class="option">flux</samp></dt>
  30721. <dt><samp class="option">slope</samp></dt>
  30722. <dt><samp class="option">decrease</samp></dt>
  30723. <dt><samp class="option">rolloff</samp></dt>
  30724. </dl>
  30725. <a name="asr"></a>
  30726. <h3 class="section">36.58 asr<span class="pull-right"><a class="anchor hidden-xs" href="#asr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asr" aria-hidden="true">TOC</a></span></h3>
  30727. <p>Automatic Speech Recognition
  30728. </p>
  30729. <p>This filter uses PocketSphinx for speech recognition. To enable
  30730. compilation of this filter, you need to configure FFmpeg with
  30731. <code class="code">--enable-pocketsphinx</code>.
  30732. </p>
  30733. <p>It accepts the following options:
  30734. </p>
  30735. <dl class="table">
  30736. <dt><samp class="option">rate</samp></dt>
  30737. <dd><p>Set sampling rate of input audio. Defaults is <code class="code">16000</code>.
  30738. This need to match speech models, otherwise one will get poor results.
  30739. </p>
  30740. </dd>
  30741. <dt><samp class="option">hmm</samp></dt>
  30742. <dd><p>Set dictionary containing acoustic model files.
  30743. </p>
  30744. </dd>
  30745. <dt><samp class="option">dict</samp></dt>
  30746. <dd><p>Set pronunciation dictionary.
  30747. </p>
  30748. </dd>
  30749. <dt><samp class="option">lm</samp></dt>
  30750. <dd><p>Set language model file.
  30751. </p>
  30752. </dd>
  30753. <dt><samp class="option">lmctl</samp></dt>
  30754. <dd><p>Set language model set.
  30755. </p>
  30756. </dd>
  30757. <dt><samp class="option">lmname</samp></dt>
  30758. <dd><p>Set which language model to use.
  30759. </p>
  30760. </dd>
  30761. <dt><samp class="option">logfn</samp></dt>
  30762. <dd><p>Set output for log messages.
  30763. </p></dd>
  30764. </dl>
  30765. <p>The filter exports recognized speech as the frame metadata <code class="code">lavfi.asr.text</code>.
  30766. </p>
  30767. <a class="anchor" id="astats"></a><a name="astats-1"></a>
  30768. <h3 class="section">36.59 astats<span class="pull-right"><a class="anchor hidden-xs" href="#astats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-astats-1" aria-hidden="true">TOC</a></span></h3>
  30769. <p>Display time domain statistical information about the audio channels.
  30770. Statistics are calculated and displayed for each audio channel and,
  30771. where applicable, an overall figure is also given.
  30772. </p>
  30773. <p>It accepts the following option:
  30774. </p><dl class="table">
  30775. <dt><samp class="option">length</samp></dt>
  30776. <dd><p>Short window length in seconds, used for peak and through RMS measurement.
  30777. Default is <code class="code">0.05</code> (50 milliseconds). Allowed range is <code class="code">[0 - 10]</code>.
  30778. </p>
  30779. </dd>
  30780. <dt><samp class="option">metadata</samp></dt>
  30781. <dd>
  30782. <p>Set metadata injection. All the metadata keys are prefixed with <code class="code">lavfi.astats.X</code>,
  30783. where <code class="code">X</code> is channel number starting from 1 or string <code class="code">Overall</code>. Default is
  30784. disabled.
  30785. </p>
  30786. <p>Available keys for each channel are:
  30787. <var class="var">Bit_depth</var>
  30788. <var class="var">Crest_factor</var>
  30789. <var class="var">DC_offset</var>
  30790. <var class="var">Dynamic_range</var>
  30791. <var class="var">Entropy</var>
  30792. <var class="var">Flat_factor</var>
  30793. <var class="var">Max_difference</var>
  30794. <var class="var">Max_level</var>
  30795. <var class="var">Mean_difference</var>
  30796. <var class="var">Min_difference</var>
  30797. <var class="var">Min_level</var>
  30798. <var class="var">Noise_floor</var>
  30799. <var class="var">Noise_floor_count</var>
  30800. <var class="var">Number_of_Infs</var>
  30801. <var class="var">Number_of_NaNs</var>
  30802. <var class="var">Number_of_denormals</var>
  30803. <var class="var">Peak_count</var>
  30804. <var class="var">Abs_Peak_count</var>
  30805. <var class="var">Peak_level</var>
  30806. <var class="var">RMS_difference</var>
  30807. <var class="var">RMS_peak</var>
  30808. <var class="var">RMS_trough</var>
  30809. <var class="var">Zero_crossings</var>
  30810. <var class="var">Zero_crossings_rate</var>
  30811. </p>
  30812. <p>and for <code class="code">Overall</code>:
  30813. <var class="var">Bit_depth</var>
  30814. <var class="var">DC_offset</var>
  30815. <var class="var">Entropy</var>
  30816. <var class="var">Flat_factor</var>
  30817. <var class="var">Max_difference</var>
  30818. <var class="var">Max_level</var>
  30819. <var class="var">Mean_difference</var>
  30820. <var class="var">Min_difference</var>
  30821. <var class="var">Min_level</var>
  30822. <var class="var">Noise_floor</var>
  30823. <var class="var">Noise_floor_count</var>
  30824. <var class="var">Number_of_Infs</var>
  30825. <var class="var">Number_of_NaNs</var>
  30826. <var class="var">Number_of_denormals</var>
  30827. <var class="var">Number_of_samples</var>
  30828. <var class="var">Peak_count</var>
  30829. <var class="var">Abs_Peak_count</var>
  30830. <var class="var">Peak_level</var>
  30831. <var class="var">RMS_difference</var>
  30832. <var class="var">RMS_level</var>
  30833. <var class="var">RMS_peak</var>
  30834. <var class="var">RMS_trough</var>
  30835. </p>
  30836. <p>For example, a full key looks like <code class="code">lavfi.astats.1.DC_offset</code> or
  30837. <code class="code">lavfi.astats.Overall.Peak_count</code>.
  30838. </p>
  30839. <p>Read below for the description of the keys.
  30840. </p>
  30841. </dd>
  30842. <dt><samp class="option">reset</samp></dt>
  30843. <dd><p>Set the number of frames over which cumulative stats are calculated before
  30844. being reset. Default is disabled.
  30845. </p>
  30846. </dd>
  30847. <dt><samp class="option">measure_perchannel</samp></dt>
  30848. <dd><p>Select the parameters which are measured per channel. The metadata keys can
  30849. be used as flags, default is <samp class="option">all</samp> which measures everything.
  30850. <samp class="option">none</samp> disables all per channel measurement.
  30851. </p>
  30852. </dd>
  30853. <dt><samp class="option">measure_overall</samp></dt>
  30854. <dd><p>Select the parameters which are measured overall. The metadata keys can
  30855. be used as flags, default is <samp class="option">all</samp> which measures everything.
  30856. <samp class="option">none</samp> disables all overall measurement.
  30857. </p>
  30858. </dd>
  30859. </dl>
  30860. <p>A description of the measure keys follow:
  30861. </p>
  30862. <dl class="table">
  30863. <dt><samp class="option">none</samp></dt>
  30864. <dd><p>no measures
  30865. </p>
  30866. </dd>
  30867. <dt><samp class="option">all</samp></dt>
  30868. <dd><p>all measures
  30869. </p>
  30870. </dd>
  30871. <dt><samp class="option">Bit_depth</samp></dt>
  30872. <dd><p>overall bit depth of audio, i.e. number of bits used for each sample
  30873. </p>
  30874. </dd>
  30875. <dt><samp class="option">Crest_factor</samp></dt>
  30876. <dd><p>standard ratio of peak to RMS level (note: not in dB)
  30877. </p>
  30878. </dd>
  30879. <dt><samp class="option">DC_offset</samp></dt>
  30880. <dd><p>mean amplitude displacement from zero
  30881. </p>
  30882. </dd>
  30883. <dt><samp class="option">Dynamic_range</samp></dt>
  30884. <dd><p>measured dynamic range of audio in dB
  30885. </p>
  30886. </dd>
  30887. <dt><samp class="option">Entropy</samp></dt>
  30888. <dd><p>entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise
  30889. </p>
  30890. </dd>
  30891. <dt><samp class="option">Flat_factor</samp></dt>
  30892. <dd><p>flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  30893. (i.e. either <var class="var">Min_level</var> or <var class="var">Max_level</var>)
  30894. </p>
  30895. </dd>
  30896. <dt><samp class="option">Max_difference</samp></dt>
  30897. <dd><p>maximal difference between two consecutive samples
  30898. </p>
  30899. </dd>
  30900. <dt><samp class="option">Max_level</samp></dt>
  30901. <dd><p>maximal sample level
  30902. </p>
  30903. </dd>
  30904. <dt><samp class="option">Mean_difference</samp></dt>
  30905. <dd><p>mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples
  30906. </p>
  30907. </dd>
  30908. <dt><samp class="option">Min_difference</samp></dt>
  30909. <dd><p>minimal difference between two consecutive samples
  30910. </p>
  30911. </dd>
  30912. <dt><samp class="option">Min_level</samp></dt>
  30913. <dd><p>minimal sample level
  30914. </p>
  30915. </dd>
  30916. <dt><samp class="option">Noise_floor</samp></dt>
  30917. <dd><p>minimum local peak measured in dBFS over a short window
  30918. </p>
  30919. </dd>
  30920. <dt><samp class="option">Noise_floor_count</samp></dt>
  30921. <dd><p>number of occasions (not the number of samples) that the signal attained
  30922. <var class="var">Noise floor</var>
  30923. </p>
  30924. </dd>
  30925. <dt><samp class="option">Number_of_Infs</samp></dt>
  30926. <dd><p>number of samples with an infinite value
  30927. </p>
  30928. </dd>
  30929. <dt><samp class="option">Number_of_NaNs</samp></dt>
  30930. <dd><p>number of samples with a NaN (not a number) value
  30931. </p>
  30932. </dd>
  30933. <dt><samp class="option">Number_of_denormals</samp></dt>
  30934. <dd><p>number of samples with a subnormal value
  30935. </p>
  30936. </dd>
  30937. <dt><samp class="option">Number_of_samples</samp></dt>
  30938. <dd><p>number of samples
  30939. </p>
  30940. </dd>
  30941. <dt><samp class="option">Peak_count</samp></dt>
  30942. <dd><p>number of occasions (not the number of samples) that the signal attained either
  30943. <var class="var">Min_level</var> or <var class="var">Max_level</var>
  30944. </p>
  30945. </dd>
  30946. <dt><samp class="option">Abs_Peak_count</samp></dt>
  30947. <dd><p>number of occasions that the absolute samples taken from the signal attained
  30948. max absolute value of <var class="var">Min_level</var> and <var class="var">Max_level</var>
  30949. </p>
  30950. </dd>
  30951. <dt><samp class="option">Peak_level</samp></dt>
  30952. <dd><p>standard peak level measured in dBFS
  30953. </p>
  30954. </dd>
  30955. <dt><samp class="option">RMS_difference</samp></dt>
  30956. <dd><p>Root Mean Square difference between two consecutive samples
  30957. </p>
  30958. </dd>
  30959. <dt><samp class="option">RMS_level</samp></dt>
  30960. <dd><p>standard RMS level measured in dBFS
  30961. </p>
  30962. </dd>
  30963. <dt><samp class="option">RMS_peak</samp></dt>
  30964. <dt><samp class="option">RMS_trough</samp></dt>
  30965. <dd><p>peak and through values for RMS level measured over a short window,
  30966. measured in dBFS.
  30967. </p>
  30968. </dd>
  30969. <dt><samp class="option">Zero crossings</samp></dt>
  30970. <dd><p>number of points where the waveform crosses the zero level axis
  30971. </p>
  30972. </dd>
  30973. <dt><samp class="option">Zero crossings rate</samp></dt>
  30974. <dd><p>rate of Zero crossings and number of audio samples
  30975. </p></dd>
  30976. </dl>
  30977. <a name="asubboost"></a>
  30978. <h3 class="section">36.60 asubboost<span class="pull-right"><a class="anchor hidden-xs" href="#asubboost" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asubboost" aria-hidden="true">TOC</a></span></h3>
  30979. <p>Boost subwoofer frequencies.
  30980. </p>
  30981. <p>The filter accepts the following options:
  30982. </p>
  30983. <dl class="table">
  30984. <dt><samp class="option">dry</samp></dt>
  30985. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  30986. Default value is 1.0.
  30987. </p>
  30988. </dd>
  30989. <dt><samp class="option">wet</samp></dt>
  30990. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  30991. Default value is 1.0.
  30992. </p>
  30993. </dd>
  30994. <dt><samp class="option">boost</samp></dt>
  30995. <dd><p>Set max boost factor. Allowed range is from 1 to 12. Default value is 2.
  30996. </p>
  30997. </dd>
  30998. <dt><samp class="option">decay</samp></dt>
  30999. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  31000. Default value is 0.0.
  31001. </p>
  31002. </dd>
  31003. <dt><samp class="option">feedback</samp></dt>
  31004. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  31005. Default value is 0.9.
  31006. </p>
  31007. </dd>
  31008. <dt><samp class="option">cutoff</samp></dt>
  31009. <dd><p>Set cutoff frequency in Hertz. Allowed range is 50 to 900.
  31010. Default value is 100.
  31011. </p>
  31012. </dd>
  31013. <dt><samp class="option">slope</samp></dt>
  31014. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  31015. Default value is 0.5.
  31016. </p>
  31017. </dd>
  31018. <dt><samp class="option">delay</samp></dt>
  31019. <dd><p>Set delay. Allowed range is from 1 to 100.
  31020. Default value is 20.
  31021. </p>
  31022. </dd>
  31023. <dt><samp class="option">channels</samp></dt>
  31024. <dd><p>Set the channels to process. Default value is all available.
  31025. </p></dd>
  31026. </dl>
  31027. <a name="Commands-22"></a>
  31028. <h4 class="subsection">36.60.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-22" aria-hidden="true">TOC</a></span></h4>
  31029. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31030. </p>
  31031. <a name="asubcut"></a>
  31032. <h3 class="section">36.61 asubcut<span class="pull-right"><a class="anchor hidden-xs" href="#asubcut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asubcut" aria-hidden="true">TOC</a></span></h3>
  31033. <p>Cut subwoofer frequencies.
  31034. </p>
  31035. <p>This filter allows to set custom, steeper
  31036. roll off than highpass filter, and thus is able to more attenuate
  31037. frequency content in stop-band.
  31038. </p>
  31039. <p>The filter accepts the following options:
  31040. </p>
  31041. <dl class="table">
  31042. <dt><samp class="option">cutoff</samp></dt>
  31043. <dd><p>Set cutoff frequency in Hertz. Allowed range is 2 to 200.
  31044. Default value is 20.
  31045. </p>
  31046. </dd>
  31047. <dt><samp class="option">order</samp></dt>
  31048. <dd><p>Set filter order. Available values are from 3 to 20.
  31049. Default value is 10.
  31050. </p>
  31051. </dd>
  31052. <dt><samp class="option">level</samp></dt>
  31053. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  31054. </p></dd>
  31055. </dl>
  31056. <a name="Commands-23"></a>
  31057. <h4 class="subsection">36.61.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-23" aria-hidden="true">TOC</a></span></h4>
  31058. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31059. </p>
  31060. <a name="asupercut"></a>
  31061. <h3 class="section">36.62 asupercut<span class="pull-right"><a class="anchor hidden-xs" href="#asupercut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asupercut" aria-hidden="true">TOC</a></span></h3>
  31062. <p>Cut super frequencies.
  31063. </p>
  31064. <p>The filter accepts the following options:
  31065. </p>
  31066. <dl class="table">
  31067. <dt><samp class="option">cutoff</samp></dt>
  31068. <dd><p>Set cutoff frequency in Hertz. Allowed range is 20000 to 192000.
  31069. Default value is 20000.
  31070. </p>
  31071. </dd>
  31072. <dt><samp class="option">order</samp></dt>
  31073. <dd><p>Set filter order. Available values are from 3 to 20.
  31074. Default value is 10.
  31075. </p>
  31076. </dd>
  31077. <dt><samp class="option">level</samp></dt>
  31078. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  31079. </p></dd>
  31080. </dl>
  31081. <a name="Commands-24"></a>
  31082. <h4 class="subsection">36.62.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-24" aria-hidden="true">TOC</a></span></h4>
  31083. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31084. </p>
  31085. <a name="asuperpass"></a>
  31086. <h3 class="section">36.63 asuperpass<span class="pull-right"><a class="anchor hidden-xs" href="#asuperpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asuperpass" aria-hidden="true">TOC</a></span></h3>
  31087. <p>Apply high order Butterworth band-pass filter.
  31088. </p>
  31089. <p>The filter accepts the following options:
  31090. </p>
  31091. <dl class="table">
  31092. <dt><samp class="option">centerf</samp></dt>
  31093. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  31094. Default value is 1000.
  31095. </p>
  31096. </dd>
  31097. <dt><samp class="option">order</samp></dt>
  31098. <dd><p>Set filter order. Available values are from 4 to 20.
  31099. Default value is 4.
  31100. </p>
  31101. </dd>
  31102. <dt><samp class="option">qfactor</samp></dt>
  31103. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  31104. </p>
  31105. </dd>
  31106. <dt><samp class="option">level</samp></dt>
  31107. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  31108. </p></dd>
  31109. </dl>
  31110. <a name="Commands-25"></a>
  31111. <h4 class="subsection">36.63.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-25" aria-hidden="true">TOC</a></span></h4>
  31112. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31113. </p>
  31114. <a name="asuperstop"></a>
  31115. <h3 class="section">36.64 asuperstop<span class="pull-right"><a class="anchor hidden-xs" href="#asuperstop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asuperstop" aria-hidden="true">TOC</a></span></h3>
  31116. <p>Apply high order Butterworth band-stop filter.
  31117. </p>
  31118. <p>The filter accepts the following options:
  31119. </p>
  31120. <dl class="table">
  31121. <dt><samp class="option">centerf</samp></dt>
  31122. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  31123. Default value is 1000.
  31124. </p>
  31125. </dd>
  31126. <dt><samp class="option">order</samp></dt>
  31127. <dd><p>Set filter order. Available values are from 4 to 20.
  31128. Default value is 4.
  31129. </p>
  31130. </dd>
  31131. <dt><samp class="option">qfactor</samp></dt>
  31132. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  31133. </p>
  31134. </dd>
  31135. <dt><samp class="option">level</samp></dt>
  31136. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  31137. </p></dd>
  31138. </dl>
  31139. <a name="Commands-26"></a>
  31140. <h4 class="subsection">36.64.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-26" aria-hidden="true">TOC</a></span></h4>
  31141. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31142. </p>
  31143. <a name="atempo"></a>
  31144. <h3 class="section">36.65 atempo<span class="pull-right"><a class="anchor hidden-xs" href="#atempo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atempo" aria-hidden="true">TOC</a></span></h3>
  31145. <p>Adjust audio tempo.
  31146. </p>
  31147. <p>The filter accepts exactly one parameter, the audio tempo. If not
  31148. specified then the filter will assume nominal 1.0 tempo. Tempo must
  31149. be in the [0.5, 100.0] range.
  31150. </p>
  31151. <p>Note that tempo greater than 2 will skip some samples rather than
  31152. blend them in. If for any reason this is a concern it is always
  31153. possible to daisy-chain several instances of atempo to achieve the
  31154. desired product tempo.
  31155. </p>
  31156. <a name="Examples-63"></a>
  31157. <h4 class="subsection">36.65.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-63" aria-hidden="true">TOC</a></span></h4>
  31158. <ul class="itemize mark-bullet">
  31159. <li>Slow down audio to 80% tempo:
  31160. <div class="example">
  31161. <pre class="example-preformatted">atempo=0.8
  31162. </pre></div>
  31163. </li><li>To speed up audio to 300% tempo:
  31164. <div class="example">
  31165. <pre class="example-preformatted">atempo=3
  31166. </pre></div>
  31167. </li><li>To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  31168. <div class="example">
  31169. <pre class="example-preformatted">atempo=sqrt(3),atempo=sqrt(3)
  31170. </pre></div>
  31171. </li></ul>
  31172. <a name="Commands-27"></a>
  31173. <h4 class="subsection">36.65.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-27" aria-hidden="true">TOC</a></span></h4>
  31174. <p>This filter supports the following commands:
  31175. </p><dl class="table">
  31176. <dt><samp class="option">tempo</samp></dt>
  31177. <dd><p>Change filter tempo scale factor.
  31178. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  31179. </p></dd>
  31180. </dl>
  31181. <a name="atilt"></a>
  31182. <h3 class="section">36.66 atilt<span class="pull-right"><a class="anchor hidden-xs" href="#atilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atilt" aria-hidden="true">TOC</a></span></h3>
  31183. <p>Apply spectral tilt filter to audio stream.
  31184. </p>
  31185. <p>This filter apply any spectral roll-off slope over any specified frequency band.
  31186. </p>
  31187. <p>The filter accepts the following options:
  31188. </p>
  31189. <dl class="table">
  31190. <dt><samp class="option">freq</samp></dt>
  31191. <dd><p>Set central frequency of tilt in Hz. Default is 10000 Hz.
  31192. </p>
  31193. </dd>
  31194. <dt><samp class="option">slope</samp></dt>
  31195. <dd><p>Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1.
  31196. </p>
  31197. </dd>
  31198. <dt><samp class="option">width</samp></dt>
  31199. <dd><p>Set width of tilt. Default is 1000. Allowed range is from 100 to 10000.
  31200. </p>
  31201. </dd>
  31202. <dt><samp class="option">order</samp></dt>
  31203. <dd><p>Set order of tilt filter.
  31204. </p>
  31205. </dd>
  31206. <dt><samp class="option">level</samp></dt>
  31207. <dd><p>Set input volume level. Allowed range is from 0 to 4.
  31208. Default is 1.
  31209. </p></dd>
  31210. </dl>
  31211. <a name="Commands-28"></a>
  31212. <h4 class="subsection">36.66.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-28" aria-hidden="true">TOC</a></span></h4>
  31213. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31214. </p>
  31215. <a name="atrim"></a>
  31216. <h3 class="section">36.67 atrim<span class="pull-right"><a class="anchor hidden-xs" href="#atrim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atrim" aria-hidden="true">TOC</a></span></h3>
  31217. <p>Trim the input so that the output contains one continuous subpart of the input.
  31218. </p>
  31219. <p>It accepts the following parameters:
  31220. </p><dl class="table">
  31221. <dt><samp class="option">start</samp></dt>
  31222. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  31223. sample with the timestamp <var class="var">start</var> will be the first sample in the output.
  31224. </p>
  31225. </dd>
  31226. <dt><samp class="option">end</samp></dt>
  31227. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  31228. audio sample immediately preceding the one with the timestamp <var class="var">end</var> will be
  31229. the last sample in the output.
  31230. </p>
  31231. </dd>
  31232. <dt><samp class="option">start_pts</samp></dt>
  31233. <dd><p>Same as <var class="var">start</var>, except this option sets the start timestamp in samples
  31234. instead of seconds.
  31235. </p>
  31236. </dd>
  31237. <dt><samp class="option">end_pts</samp></dt>
  31238. <dd><p>Same as <var class="var">end</var>, except this option sets the end timestamp in samples instead
  31239. of seconds.
  31240. </p>
  31241. </dd>
  31242. <dt><samp class="option">duration</samp></dt>
  31243. <dd><p>The maximum duration of the output in seconds.
  31244. </p>
  31245. </dd>
  31246. <dt><samp class="option">start_sample</samp></dt>
  31247. <dd><p>The number of the first sample that should be output.
  31248. </p>
  31249. </dd>
  31250. <dt><samp class="option">end_sample</samp></dt>
  31251. <dd><p>The number of the first sample that should be dropped.
  31252. </p></dd>
  31253. </dl>
  31254. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  31255. duration specifications; see
  31256. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  31257. </p>
  31258. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  31259. option look at the frame timestamp, while the _sample options simply count the
  31260. samples that pass through the filter. So start/end_pts and start/end_sample will
  31261. give different results when the timestamps are wrong, inexact or do not start at
  31262. zero. Also note that this filter does not modify the timestamps. If you wish
  31263. to have the output timestamps start at zero, insert the asetpts filter after the
  31264. atrim filter.
  31265. </p>
  31266. <p>If multiple start or end options are set, this filter tries to be greedy and
  31267. keep all samples that match at least one of the specified constraints. To keep
  31268. only the part that matches all the constraints at once, chain multiple atrim
  31269. filters.
  31270. </p>
  31271. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  31272. just the end values to keep everything before the specified time.
  31273. </p>
  31274. <p>Examples:
  31275. </p><ul class="itemize mark-bullet">
  31276. <li>Drop everything except the second minute of input:
  31277. <div class="example">
  31278. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=60:120
  31279. </pre></div>
  31280. </li><li>Keep only the first 1000 samples:
  31281. <div class="example">
  31282. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=end_sample=1000
  31283. </pre></div>
  31284. </li></ul>
  31285. <a name="axcorrelate"></a>
  31286. <h3 class="section">36.68 axcorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#axcorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-axcorrelate" aria-hidden="true">TOC</a></span></h3>
  31287. <p>Calculate normalized windowed cross-correlation between two input audio streams.
  31288. </p>
  31289. <p>Resulted samples are always between -1 and 1 inclusive.
  31290. If result is 1 it means two input samples are highly correlated in that selected segment.
  31291. Result 0 means they are not correlated at all.
  31292. If result is -1 it means two input samples are out of phase, which means they cancel each
  31293. other.
  31294. </p>
  31295. <p>The filter accepts the following options:
  31296. </p>
  31297. <dl class="table">
  31298. <dt><samp class="option">size</samp></dt>
  31299. <dd><p>Set size of segment over which cross-correlation is calculated.
  31300. Default is 256. Allowed range is from 2 to 131072.
  31301. </p>
  31302. </dd>
  31303. <dt><samp class="option">algo</samp></dt>
  31304. <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>.
  31305. Default is <code class="code">best</code>. Fast algorithm assumes mean values over any given segment
  31306. are always zero and thus need much less calculations to make.
  31307. This is generally not true, but is valid for typical audio streams.
  31308. </p></dd>
  31309. </dl>
  31310. <a name="Examples-64"></a>
  31311. <h4 class="subsection">36.68.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-64" aria-hidden="true">TOC</a></span></h4>
  31312. <ul class="itemize mark-bullet">
  31313. <li>Calculate correlation between channels in stereo audio stream:
  31314. <div class="example">
  31315. <pre class="example-preformatted">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  31316. </pre></div>
  31317. </li></ul>
  31318. <a name="bandpass"></a>
  31319. <h3 class="section">36.69 bandpass<span class="pull-right"><a class="anchor hidden-xs" href="#bandpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandpass" aria-hidden="true">TOC</a></span></h3>
  31320. <p>Apply a two-pole Butterworth band-pass filter with central
  31321. frequency <var class="var">frequency</var>, and (3dB-point) band-width width.
  31322. The <var class="var">csg</var> option selects a constant skirt gain (peak gain = Q)
  31323. instead of the default: constant 0dB peak gain.
  31324. The filter roll off at 6dB per octave (20dB per decade).
  31325. </p>
  31326. <p>The filter accepts the following options:
  31327. </p>
  31328. <dl class="table">
  31329. <dt><samp class="option">frequency, f</samp></dt>
  31330. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  31331. </p>
  31332. </dd>
  31333. <dt><samp class="option">csg</samp></dt>
  31334. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  31335. </p>
  31336. </dd>
  31337. <dt><samp class="option">width_type, t</samp></dt>
  31338. <dd><p>Set method to specify band-width of filter.
  31339. </p><dl class="table">
  31340. <dt><samp class="option">h</samp></dt>
  31341. <dd><p>Hz
  31342. </p></dd>
  31343. <dt><samp class="option">q</samp></dt>
  31344. <dd><p>Q-Factor
  31345. </p></dd>
  31346. <dt><samp class="option">o</samp></dt>
  31347. <dd><p>octave
  31348. </p></dd>
  31349. <dt><samp class="option">s</samp></dt>
  31350. <dd><p>slope
  31351. </p></dd>
  31352. <dt><samp class="option">k</samp></dt>
  31353. <dd><p>kHz
  31354. </p></dd>
  31355. </dl>
  31356. </dd>
  31357. <dt><samp class="option">width, w</samp></dt>
  31358. <dd><p>Specify the band-width of a filter in width_type units.
  31359. </p>
  31360. </dd>
  31361. <dt><samp class="option">mix, m</samp></dt>
  31362. <dd><p>How much to use filtered signal in output. Default is 1.
  31363. Range is between 0 and 1.
  31364. </p>
  31365. </dd>
  31366. <dt><samp class="option">channels, c</samp></dt>
  31367. <dd><p>Specify which channels to filter, by default all available are filtered.
  31368. </p>
  31369. </dd>
  31370. <dt><samp class="option">normalize, n</samp></dt>
  31371. <dd><p>Normalize biquad coefficients, by default is disabled.
  31372. Enabling it will normalize magnitude response at DC to 0dB.
  31373. </p>
  31374. </dd>
  31375. <dt><samp class="option">transform, a</samp></dt>
  31376. <dd><p>Set transform type of IIR filter.
  31377. </p><dl class="table">
  31378. <dt><samp class="option">di</samp></dt>
  31379. <dt><samp class="option">dii</samp></dt>
  31380. <dt><samp class="option">tdi</samp></dt>
  31381. <dt><samp class="option">tdii</samp></dt>
  31382. <dt><samp class="option">latt</samp></dt>
  31383. <dt><samp class="option">svf</samp></dt>
  31384. <dt><samp class="option">zdf</samp></dt>
  31385. </dl>
  31386. </dd>
  31387. <dt><samp class="option">precision, r</samp></dt>
  31388. <dd><p>Set precision of filtering.
  31389. </p><dl class="table">
  31390. <dt><samp class="option">auto</samp></dt>
  31391. <dd><p>Pick automatic sample format depending on surround filters.
  31392. </p></dd>
  31393. <dt><samp class="option">s16</samp></dt>
  31394. <dd><p>Always use signed 16-bit.
  31395. </p></dd>
  31396. <dt><samp class="option">s32</samp></dt>
  31397. <dd><p>Always use signed 32-bit.
  31398. </p></dd>
  31399. <dt><samp class="option">f32</samp></dt>
  31400. <dd><p>Always use float 32-bit.
  31401. </p></dd>
  31402. <dt><samp class="option">f64</samp></dt>
  31403. <dd><p>Always use float 64-bit.
  31404. </p></dd>
  31405. </dl>
  31406. </dd>
  31407. <dt><samp class="option">block_size, b</samp></dt>
  31408. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  31409. value (higher than impulse response length truncated when reaches near zero values) filtering
  31410. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  31411. </p>
  31412. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  31413. </p></dd>
  31414. </dl>
  31415. <a name="Commands-29"></a>
  31416. <h4 class="subsection">36.69.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-29" aria-hidden="true">TOC</a></span></h4>
  31417. <p>This filter supports the following commands:
  31418. </p><dl class="table">
  31419. <dt><samp class="option">frequency, f</samp></dt>
  31420. <dd><p>Change bandpass frequency.
  31421. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  31422. </p>
  31423. </dd>
  31424. <dt><samp class="option">width_type, t</samp></dt>
  31425. <dd><p>Change bandpass width_type.
  31426. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  31427. </p>
  31428. </dd>
  31429. <dt><samp class="option">width, w</samp></dt>
  31430. <dd><p>Change bandpass width.
  31431. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  31432. </p>
  31433. </dd>
  31434. <dt><samp class="option">mix, m</samp></dt>
  31435. <dd><p>Change bandpass mix.
  31436. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  31437. </p></dd>
  31438. </dl>
  31439. <a name="bandreject"></a>
  31440. <h3 class="section">36.70 bandreject<span class="pull-right"><a class="anchor hidden-xs" href="#bandreject" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandreject" aria-hidden="true">TOC</a></span></h3>
  31441. <p>Apply a two-pole Butterworth band-reject filter with central
  31442. frequency <var class="var">frequency</var>, and (3dB-point) band-width <var class="var">width</var>.
  31443. The filter roll off at 6dB per octave (20dB per decade).
  31444. </p>
  31445. <p>The filter accepts the following options:
  31446. </p>
  31447. <dl class="table">
  31448. <dt><samp class="option">frequency, f</samp></dt>
  31449. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  31450. </p>
  31451. </dd>
  31452. <dt><samp class="option">width_type, t</samp></dt>
  31453. <dd><p>Set method to specify band-width of filter.
  31454. </p><dl class="table">
  31455. <dt><samp class="option">h</samp></dt>
  31456. <dd><p>Hz
  31457. </p></dd>
  31458. <dt><samp class="option">q</samp></dt>
  31459. <dd><p>Q-Factor
  31460. </p></dd>
  31461. <dt><samp class="option">o</samp></dt>
  31462. <dd><p>octave
  31463. </p></dd>
  31464. <dt><samp class="option">s</samp></dt>
  31465. <dd><p>slope
  31466. </p></dd>
  31467. <dt><samp class="option">k</samp></dt>
  31468. <dd><p>kHz
  31469. </p></dd>
  31470. </dl>
  31471. </dd>
  31472. <dt><samp class="option">width, w</samp></dt>
  31473. <dd><p>Specify the band-width of a filter in width_type units.
  31474. </p>
  31475. </dd>
  31476. <dt><samp class="option">mix, m</samp></dt>
  31477. <dd><p>How much to use filtered signal in output. Default is 1.
  31478. Range is between 0 and 1.
  31479. </p>
  31480. </dd>
  31481. <dt><samp class="option">channels, c</samp></dt>
  31482. <dd><p>Specify which channels to filter, by default all available are filtered.
  31483. </p>
  31484. </dd>
  31485. <dt><samp class="option">normalize, n</samp></dt>
  31486. <dd><p>Normalize biquad coefficients, by default is disabled.
  31487. Enabling it will normalize magnitude response at DC to 0dB.
  31488. </p>
  31489. </dd>
  31490. <dt><samp class="option">transform, a</samp></dt>
  31491. <dd><p>Set transform type of IIR filter.
  31492. </p><dl class="table">
  31493. <dt><samp class="option">di</samp></dt>
  31494. <dt><samp class="option">dii</samp></dt>
  31495. <dt><samp class="option">tdi</samp></dt>
  31496. <dt><samp class="option">tdii</samp></dt>
  31497. <dt><samp class="option">latt</samp></dt>
  31498. <dt><samp class="option">svf</samp></dt>
  31499. <dt><samp class="option">zdf</samp></dt>
  31500. </dl>
  31501. </dd>
  31502. <dt><samp class="option">precision, r</samp></dt>
  31503. <dd><p>Set precision of filtering.
  31504. </p><dl class="table">
  31505. <dt><samp class="option">auto</samp></dt>
  31506. <dd><p>Pick automatic sample format depending on surround filters.
  31507. </p></dd>
  31508. <dt><samp class="option">s16</samp></dt>
  31509. <dd><p>Always use signed 16-bit.
  31510. </p></dd>
  31511. <dt><samp class="option">s32</samp></dt>
  31512. <dd><p>Always use signed 32-bit.
  31513. </p></dd>
  31514. <dt><samp class="option">f32</samp></dt>
  31515. <dd><p>Always use float 32-bit.
  31516. </p></dd>
  31517. <dt><samp class="option">f64</samp></dt>
  31518. <dd><p>Always use float 64-bit.
  31519. </p></dd>
  31520. </dl>
  31521. </dd>
  31522. <dt><samp class="option">block_size, b</samp></dt>
  31523. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  31524. value (higher than impulse response length truncated when reaches near zero values) filtering
  31525. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  31526. </p>
  31527. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  31528. </p></dd>
  31529. </dl>
  31530. <a name="Commands-30"></a>
  31531. <h4 class="subsection">36.70.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-30" aria-hidden="true">TOC</a></span></h4>
  31532. <p>This filter supports the following commands:
  31533. </p><dl class="table">
  31534. <dt><samp class="option">frequency, f</samp></dt>
  31535. <dd><p>Change bandreject frequency.
  31536. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  31537. </p>
  31538. </dd>
  31539. <dt><samp class="option">width_type, t</samp></dt>
  31540. <dd><p>Change bandreject width_type.
  31541. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  31542. </p>
  31543. </dd>
  31544. <dt><samp class="option">width, w</samp></dt>
  31545. <dd><p>Change bandreject width.
  31546. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  31547. </p>
  31548. </dd>
  31549. <dt><samp class="option">mix, m</samp></dt>
  31550. <dd><p>Change bandreject mix.
  31551. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  31552. </p></dd>
  31553. </dl>
  31554. <a name="bass_002c-lowshelf"></a>
  31555. <h3 class="section">36.71 bass, lowshelf<span class="pull-right"><a class="anchor hidden-xs" href="#bass_002c-lowshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bass_002c-lowshelf" aria-hidden="true">TOC</a></span></h3>
  31556. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  31557. shelving filter with a response similar to that of a standard
  31558. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  31559. </p>
  31560. <p>The filter accepts the following options:
  31561. </p>
  31562. <dl class="table">
  31563. <dt><samp class="option">gain, g</samp></dt>
  31564. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  31565. (for a large cut) to +20 (for a large boost).
  31566. Beware of clipping when using a positive gain.
  31567. </p>
  31568. </dd>
  31569. <dt><samp class="option">frequency, f</samp></dt>
  31570. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  31571. to extend or reduce the frequency range to be boosted or cut.
  31572. The default value is <code class="code">100</code> Hz.
  31573. </p>
  31574. </dd>
  31575. <dt><samp class="option">width_type, t</samp></dt>
  31576. <dd><p>Set method to specify band-width of filter.
  31577. </p><dl class="table">
  31578. <dt><samp class="option">h</samp></dt>
  31579. <dd><p>Hz
  31580. </p></dd>
  31581. <dt><samp class="option">q</samp></dt>
  31582. <dd><p>Q-Factor
  31583. </p></dd>
  31584. <dt><samp class="option">o</samp></dt>
  31585. <dd><p>octave
  31586. </p></dd>
  31587. <dt><samp class="option">s</samp></dt>
  31588. <dd><p>slope
  31589. </p></dd>
  31590. <dt><samp class="option">k</samp></dt>
  31591. <dd><p>kHz
  31592. </p></dd>
  31593. </dl>
  31594. </dd>
  31595. <dt><samp class="option">width, w</samp></dt>
  31596. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  31597. </p>
  31598. </dd>
  31599. <dt><samp class="option">poles, p</samp></dt>
  31600. <dd><p>Set number of poles. Default is 2.
  31601. </p>
  31602. </dd>
  31603. <dt><samp class="option">mix, m</samp></dt>
  31604. <dd><p>How much to use filtered signal in output. Default is 1.
  31605. Range is between 0 and 1.
  31606. </p>
  31607. </dd>
  31608. <dt><samp class="option">channels, c</samp></dt>
  31609. <dd><p>Specify which channels to filter, by default all available are filtered.
  31610. </p>
  31611. </dd>
  31612. <dt><samp class="option">normalize, n</samp></dt>
  31613. <dd><p>Normalize biquad coefficients, by default is disabled.
  31614. Enabling it will normalize magnitude response at DC to 0dB.
  31615. </p>
  31616. </dd>
  31617. <dt><samp class="option">transform, a</samp></dt>
  31618. <dd><p>Set transform type of IIR filter.
  31619. </p><dl class="table">
  31620. <dt><samp class="option">di</samp></dt>
  31621. <dt><samp class="option">dii</samp></dt>
  31622. <dt><samp class="option">tdi</samp></dt>
  31623. <dt><samp class="option">tdii</samp></dt>
  31624. <dt><samp class="option">latt</samp></dt>
  31625. <dt><samp class="option">svf</samp></dt>
  31626. <dt><samp class="option">zdf</samp></dt>
  31627. </dl>
  31628. </dd>
  31629. <dt><samp class="option">precision, r</samp></dt>
  31630. <dd><p>Set precision of filtering.
  31631. </p><dl class="table">
  31632. <dt><samp class="option">auto</samp></dt>
  31633. <dd><p>Pick automatic sample format depending on surround filters.
  31634. </p></dd>
  31635. <dt><samp class="option">s16</samp></dt>
  31636. <dd><p>Always use signed 16-bit.
  31637. </p></dd>
  31638. <dt><samp class="option">s32</samp></dt>
  31639. <dd><p>Always use signed 32-bit.
  31640. </p></dd>
  31641. <dt><samp class="option">f32</samp></dt>
  31642. <dd><p>Always use float 32-bit.
  31643. </p></dd>
  31644. <dt><samp class="option">f64</samp></dt>
  31645. <dd><p>Always use float 64-bit.
  31646. </p></dd>
  31647. </dl>
  31648. </dd>
  31649. <dt><samp class="option">block_size, b</samp></dt>
  31650. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  31651. value (higher than impulse response length truncated when reaches near zero values) filtering
  31652. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  31653. </p>
  31654. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  31655. </p></dd>
  31656. </dl>
  31657. <a name="Commands-31"></a>
  31658. <h4 class="subsection">36.71.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-31" aria-hidden="true">TOC</a></span></h4>
  31659. <p>This filter supports the following commands:
  31660. </p><dl class="table">
  31661. <dt><samp class="option">frequency, f</samp></dt>
  31662. <dd><p>Change bass frequency.
  31663. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  31664. </p>
  31665. </dd>
  31666. <dt><samp class="option">width_type, t</samp></dt>
  31667. <dd><p>Change bass width_type.
  31668. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  31669. </p>
  31670. </dd>
  31671. <dt><samp class="option">width, w</samp></dt>
  31672. <dd><p>Change bass width.
  31673. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  31674. </p>
  31675. </dd>
  31676. <dt><samp class="option">gain, g</samp></dt>
  31677. <dd><p>Change bass gain.
  31678. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  31679. </p>
  31680. </dd>
  31681. <dt><samp class="option">mix, m</samp></dt>
  31682. <dd><p>Change bass mix.
  31683. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  31684. </p></dd>
  31685. </dl>
  31686. <a name="biquad"></a>
  31687. <h3 class="section">36.72 biquad<span class="pull-right"><a class="anchor hidden-xs" href="#biquad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-biquad" aria-hidden="true">TOC</a></span></h3>
  31688. <p>Apply a biquad IIR filter with the given coefficients.
  31689. 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>
  31690. are the numerator and denominator coefficients respectively.
  31691. and <var class="var">channels</var>, <var class="var">c</var> specify which channels to filter, by default all
  31692. available are filtered.
  31693. </p>
  31694. <a name="Commands-32"></a>
  31695. <h4 class="subsection">36.72.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-32" aria-hidden="true">TOC</a></span></h4>
  31696. <p>This filter supports the following commands:
  31697. </p><dl class="table">
  31698. <dt><samp class="option">a0</samp></dt>
  31699. <dt><samp class="option">a1</samp></dt>
  31700. <dt><samp class="option">a2</samp></dt>
  31701. <dt><samp class="option">b0</samp></dt>
  31702. <dt><samp class="option">b1</samp></dt>
  31703. <dt><samp class="option">b2</samp></dt>
  31704. <dd><p>Change biquad parameter.
  31705. Syntax for the command is : &quot;<var class="var">value</var>&quot;
  31706. </p>
  31707. </dd>
  31708. <dt><samp class="option">mix, m</samp></dt>
  31709. <dd><p>How much to use filtered signal in output. Default is 1.
  31710. Range is between 0 and 1.
  31711. </p>
  31712. </dd>
  31713. <dt><samp class="option">channels, c</samp></dt>
  31714. <dd><p>Specify which channels to filter, by default all available are filtered.
  31715. </p>
  31716. </dd>
  31717. <dt><samp class="option">normalize, n</samp></dt>
  31718. <dd><p>Normalize biquad coefficients, by default is disabled.
  31719. Enabling it will normalize magnitude response at DC to 0dB.
  31720. </p>
  31721. </dd>
  31722. <dt><samp class="option">transform, a</samp></dt>
  31723. <dd><p>Set transform type of IIR filter.
  31724. </p><dl class="table">
  31725. <dt><samp class="option">di</samp></dt>
  31726. <dt><samp class="option">dii</samp></dt>
  31727. <dt><samp class="option">tdi</samp></dt>
  31728. <dt><samp class="option">tdii</samp></dt>
  31729. <dt><samp class="option">latt</samp></dt>
  31730. <dt><samp class="option">svf</samp></dt>
  31731. <dt><samp class="option">zdf</samp></dt>
  31732. </dl>
  31733. </dd>
  31734. <dt><samp class="option">precision, r</samp></dt>
  31735. <dd><p>Set precision of filtering.
  31736. </p><dl class="table">
  31737. <dt><samp class="option">auto</samp></dt>
  31738. <dd><p>Pick automatic sample format depending on surround filters.
  31739. </p></dd>
  31740. <dt><samp class="option">s16</samp></dt>
  31741. <dd><p>Always use signed 16-bit.
  31742. </p></dd>
  31743. <dt><samp class="option">s32</samp></dt>
  31744. <dd><p>Always use signed 32-bit.
  31745. </p></dd>
  31746. <dt><samp class="option">f32</samp></dt>
  31747. <dd><p>Always use float 32-bit.
  31748. </p></dd>
  31749. <dt><samp class="option">f64</samp></dt>
  31750. <dd><p>Always use float 64-bit.
  31751. </p></dd>
  31752. </dl>
  31753. </dd>
  31754. <dt><samp class="option">block_size, b</samp></dt>
  31755. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  31756. value (higher than impulse response length truncated when reaches near zero values) filtering
  31757. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  31758. </p>
  31759. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  31760. </p></dd>
  31761. </dl>
  31762. <a name="bs2b"></a>
  31763. <h3 class="section">36.73 bs2b<span class="pull-right"><a class="anchor hidden-xs" href="#bs2b" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bs2b" aria-hidden="true">TOC</a></span></h3>
  31764. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  31765. stereo audio records.
  31766. </p>
  31767. <p>To enable compilation of this filter you need to configure FFmpeg with
  31768. <code class="code">--enable-libbs2b</code>.
  31769. </p>
  31770. <p>It accepts the following parameters:
  31771. </p><dl class="table">
  31772. <dt><samp class="option">profile</samp></dt>
  31773. <dd><p>Pre-defined crossfeed level.
  31774. </p><dl class="table">
  31775. <dt><samp class="option">default</samp></dt>
  31776. <dd><p>Default level (fcut=700, feed=50).
  31777. </p>
  31778. </dd>
  31779. <dt><samp class="option">cmoy</samp></dt>
  31780. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  31781. </p>
  31782. </dd>
  31783. <dt><samp class="option">jmeier</samp></dt>
  31784. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  31785. </p>
  31786. </dd>
  31787. </dl>
  31788. </dd>
  31789. <dt><samp class="option">fcut</samp></dt>
  31790. <dd><p>Cut frequency (in Hz).
  31791. </p>
  31792. </dd>
  31793. <dt><samp class="option">feed</samp></dt>
  31794. <dd><p>Feed level (in Hz).
  31795. </p>
  31796. </dd>
  31797. </dl>
  31798. <a name="channelmap"></a>
  31799. <h3 class="section">36.74 channelmap<span class="pull-right"><a class="anchor hidden-xs" href="#channelmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelmap" aria-hidden="true">TOC</a></span></h3>
  31800. <p>Remap input channels to new locations.
  31801. </p>
  31802. <p>It accepts the following parameters:
  31803. </p><dl class="table">
  31804. <dt><samp class="option">map</samp></dt>
  31805. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  31806. mappings, each in the <code class="code"><var class="var">in_channel</var>-<var class="var">out_channel</var></code> or
  31807. <code class="code"><var class="var">in_channel</var></code> form. <var class="var">in_channel</var> can be either the name of the
  31808. input channel (e.g. FL for front left) or its index in the input channel
  31809. layout. <var class="var">out_channel</var> is the name of the output channel or its index in the
  31810. output channel layout. If <var class="var">out_channel</var> is not given then it is implicitly
  31811. an index, starting with zero and increasing by one for each mapping. Mixing
  31812. different types of mappings is not allowed and will result in a parse error.
  31813. </p>
  31814. </dd>
  31815. <dt><samp class="option">channel_layout</samp></dt>
  31816. <dd><p>The channel layout of the output stream. If not specified, then filter will
  31817. guess it based on the <var class="var">out_channel</var> names or the number of mappings.
  31818. Guessed layouts will not necessarily contain channels in the order of the
  31819. mappings.
  31820. </p></dd>
  31821. </dl>
  31822. <p>If no mapping is present, the filter will implicitly map input channels to
  31823. output channels, preserving indices.
  31824. </p>
  31825. <a name="Examples-65"></a>
  31826. <h4 class="subsection">36.74.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-65" aria-hidden="true">TOC</a></span></h4>
  31827. <ul class="itemize mark-bullet">
  31828. <li>For example, assuming a 5.1+downmix input MOV file,
  31829. <div class="example">
  31830. <pre class="example-preformatted">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  31831. </pre></div>
  31832. <p>will create an output WAV file tagged as stereo from the downmix channels of
  31833. the input.
  31834. </p>
  31835. </li><li>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  31836. <div class="example">
  31837. <pre class="example-preformatted">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  31838. </pre></div>
  31839. </li></ul>
  31840. <a name="channelsplit"></a>
  31841. <h3 class="section">36.75 channelsplit<span class="pull-right"><a class="anchor hidden-xs" href="#channelsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelsplit" aria-hidden="true">TOC</a></span></h3>
  31842. <p>Split each channel from an input audio stream into a separate output stream.
  31843. </p>
  31844. <p>It accepts the following parameters:
  31845. </p><dl class="table">
  31846. <dt><samp class="option">channel_layout</samp></dt>
  31847. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  31848. </p></dd>
  31849. <dt><samp class="option">channels</samp></dt>
  31850. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  31851. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  31852. </p>
  31853. <p>Choosing channels not present in channel layout in the input will result in an error.
  31854. </p></dd>
  31855. </dl>
  31856. <a name="Examples-66"></a>
  31857. <h4 class="subsection">36.75.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-66" aria-hidden="true">TOC</a></span></h4>
  31858. <ul class="itemize mark-bullet">
  31859. <li>For example, assuming a stereo input MP3 file,
  31860. <div class="example">
  31861. <pre class="example-preformatted">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  31862. </pre></div>
  31863. <p>will create an output Matroska file with two audio streams, one containing only
  31864. the left channel and the other the right channel.
  31865. </p>
  31866. </li><li>Split a 5.1 WAV file into per-channel files:
  31867. <div class="example">
  31868. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex
  31869. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  31870. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  31871. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  31872. side_right.wav
  31873. </pre></div>
  31874. </li><li>Extract only LFE from a 5.1 WAV file:
  31875. <div class="example">
  31876. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  31877. -map '[LFE]' lfe.wav
  31878. </pre></div>
  31879. </li></ul>
  31880. <a name="chorus"></a>
  31881. <h3 class="section">36.76 chorus<span class="pull-right"><a class="anchor hidden-xs" href="#chorus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chorus" aria-hidden="true">TOC</a></span></h3>
  31882. <p>Add a chorus effect to the audio.
  31883. </p>
  31884. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  31885. </p>
  31886. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  31887. constant, with chorus, it is varied using sinusoidal or triangular modulation.
  31888. The modulation depth defines the range the modulated delay is played before or after
  31889. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  31890. sound tuned around the original one, like in a chorus where some vocals are slightly
  31891. off key.
  31892. </p>
  31893. <p>It accepts the following parameters:
  31894. </p><dl class="table">
  31895. <dt><samp class="option">in_gain</samp></dt>
  31896. <dd><p>Set input gain. Default is 0.4.
  31897. </p>
  31898. </dd>
  31899. <dt><samp class="option">out_gain</samp></dt>
  31900. <dd><p>Set output gain. Default is 0.4.
  31901. </p>
  31902. </dd>
  31903. <dt><samp class="option">delays</samp></dt>
  31904. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  31905. </p>
  31906. </dd>
  31907. <dt><samp class="option">decays</samp></dt>
  31908. <dd><p>Set decays.
  31909. </p>
  31910. </dd>
  31911. <dt><samp class="option">speeds</samp></dt>
  31912. <dd><p>Set speeds.
  31913. </p>
  31914. </dd>
  31915. <dt><samp class="option">depths</samp></dt>
  31916. <dd><p>Set depths.
  31917. </p></dd>
  31918. </dl>
  31919. <a name="Examples-67"></a>
  31920. <h4 class="subsection">36.76.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-67" aria-hidden="true">TOC</a></span></h4>
  31921. <ul class="itemize mark-bullet">
  31922. <li>A single delay:
  31923. <div class="example">
  31924. <pre class="example-preformatted">chorus=0.7:0.9:55:0.4:0.25:2
  31925. </pre></div>
  31926. </li><li>Two delays:
  31927. <div class="example">
  31928. <pre class="example-preformatted">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  31929. </pre></div>
  31930. </li><li>Fuller sounding chorus with three delays:
  31931. <div class="example">
  31932. <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
  31933. </pre></div>
  31934. </li></ul>
  31935. <a name="compand"></a>
  31936. <h3 class="section">36.77 compand<span class="pull-right"><a class="anchor hidden-xs" href="#compand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compand" aria-hidden="true">TOC</a></span></h3>
  31937. <p>Compress or expand the audio&rsquo;s dynamic range.
  31938. </p>
  31939. <p>It accepts the following parameters:
  31940. </p>
  31941. <dl class="table">
  31942. <dt><samp class="option">attacks</samp></dt>
  31943. <dt><samp class="option">decays</samp></dt>
  31944. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  31945. of the input signal is averaged to determine its volume. <var class="var">attacks</var> refers to
  31946. increase of volume and <var class="var">decays</var> refers to decrease of volume. For most
  31947. situations, the attack time (response to the audio getting louder) should be
  31948. shorter than the decay time, because the human ear is more sensitive to sudden
  31949. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  31950. a typical value for decay is 0.8 seconds.
  31951. If specified number of attacks &amp; decays is lower than number of channels, the last
  31952. set attack/decay will be used for all remaining channels.
  31953. </p>
  31954. </dd>
  31955. <dt><samp class="option">points</samp></dt>
  31956. <dd><p>A list of points for the transfer function, specified in dB relative to the
  31957. maximum possible signal amplitude. Each key points list must be defined using
  31958. the following syntax: <code class="code">x0/y0|x1/y1|x2/y2|....</code> or
  31959. <code class="code">x0/y0 x1/y1 x2/y2 ....</code>
  31960. </p>
  31961. <p>The input values must be in strictly increasing order but the transfer function
  31962. does not have to be monotonically rising. The point <code class="code">0/0</code> is assumed but
  31963. may be overridden (by <code class="code">0/out-dBn</code>). Typical values for the transfer
  31964. function are <code class="code">-70/-70|-60/-20|1/0</code>.
  31965. </p>
  31966. </dd>
  31967. <dt><samp class="option">soft-knee</samp></dt>
  31968. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  31969. </p>
  31970. </dd>
  31971. <dt><samp class="option">gain</samp></dt>
  31972. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  31973. function. This allows for easy adjustment of the overall gain.
  31974. It defaults to 0.
  31975. </p>
  31976. </dd>
  31977. <dt><samp class="option">volume</samp></dt>
  31978. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  31979. starts. This permits the user to supply a nominal level initially, so that, for
  31980. example, a very large gain is not applied to initial signal levels before the
  31981. companding has begun to operate. A typical value for audio which is initially
  31982. quiet is -90 dB. It defaults to 0.
  31983. </p>
  31984. </dd>
  31985. <dt><samp class="option">delay</samp></dt>
  31986. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  31987. delayed before being fed to the volume adjuster. Specifying a delay
  31988. approximately equal to the attack/decay times allows the filter to effectively
  31989. operate in predictive rather than reactive mode. It defaults to 0.
  31990. </p>
  31991. </dd>
  31992. </dl>
  31993. <a name="Examples-68"></a>
  31994. <h4 class="subsection">36.77.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-68" aria-hidden="true">TOC</a></span></h4>
  31995. <ul class="itemize mark-bullet">
  31996. <li>Make music with both quiet and loud passages suitable for listening to in a
  31997. noisy environment:
  31998. <div class="example">
  31999. <pre class="example-preformatted">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  32000. </pre></div>
  32001. <p>Another example for audio with whisper and explosion parts:
  32002. </p><div class="example">
  32003. <pre class="example-preformatted">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  32004. </pre></div>
  32005. </li><li>A noise gate for when the noise is at a lower level than the signal:
  32006. <div class="example">
  32007. <pre class="example-preformatted">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  32008. </pre></div>
  32009. </li><li>Here is another noise gate, this time for when the noise is at a higher level
  32010. than the signal (making it, in some ways, similar to squelch):
  32011. <div class="example">
  32012. <pre class="example-preformatted">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  32013. </pre></div>
  32014. </li><li>2:1 compression starting at -6dB:
  32015. <div class="example">
  32016. <pre class="example-preformatted">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  32017. </pre></div>
  32018. </li><li>2:1 compression starting at -9dB:
  32019. <div class="example">
  32020. <pre class="example-preformatted">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  32021. </pre></div>
  32022. </li><li>2:1 compression starting at -12dB:
  32023. <div class="example">
  32024. <pre class="example-preformatted">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  32025. </pre></div>
  32026. </li><li>2:1 compression starting at -18dB:
  32027. <div class="example">
  32028. <pre class="example-preformatted">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  32029. </pre></div>
  32030. </li><li>3:1 compression starting at -15dB:
  32031. <div class="example">
  32032. <pre class="example-preformatted">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  32033. </pre></div>
  32034. </li><li>Compressor/Gate:
  32035. <div class="example">
  32036. <pre class="example-preformatted">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  32037. </pre></div>
  32038. </li><li>Expander:
  32039. <div class="example">
  32040. <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
  32041. </pre></div>
  32042. </li><li>Hard limiter at -6dB:
  32043. <div class="example">
  32044. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  32045. </pre></div>
  32046. </li><li>Hard limiter at -12dB:
  32047. <div class="example">
  32048. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  32049. </pre></div>
  32050. </li><li>Hard noise gate at -35 dB:
  32051. <div class="example">
  32052. <pre class="example-preformatted">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  32053. </pre></div>
  32054. </li><li>Soft limiter:
  32055. <div class="example">
  32056. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  32057. </pre></div>
  32058. </li></ul>
  32059. <a name="compensationdelay"></a>
  32060. <h3 class="section">36.78 compensationdelay<span class="pull-right"><a class="anchor hidden-xs" href="#compensationdelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compensationdelay" aria-hidden="true">TOC</a></span></h3>
  32061. <p>Compensation Delay Line is a metric based delay to compensate differing
  32062. positions of microphones or speakers.
  32063. </p>
  32064. <p>For example, you have recorded guitar with two microphones placed in
  32065. different locations. Because the front of sound wave has fixed speed in
  32066. normal conditions, the phasing of microphones can vary and depends on
  32067. their location and interposition. The best sound mix can be achieved when
  32068. these microphones are in phase (synchronized). Note that a distance of
  32069. ~30 cm between microphones makes one microphone capture the signal in
  32070. antiphase to the other microphone. That makes the final mix sound moody.
  32071. This filter helps to solve phasing problems by adding different delays
  32072. to each microphone track and make them synchronized.
  32073. </p>
  32074. <p>The best result can be reached when you take one track as base and
  32075. synchronize other tracks one by one with it.
  32076. Remember that synchronization/delay tolerance depends on sample rate, too.
  32077. Higher sample rates will give more tolerance.
  32078. </p>
  32079. <p>The filter accepts the following parameters:
  32080. </p>
  32081. <dl class="table">
  32082. <dt><samp class="option">mm</samp></dt>
  32083. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  32084. Default is 0.
  32085. </p>
  32086. </dd>
  32087. <dt><samp class="option">cm</samp></dt>
  32088. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  32089. Default is 0.
  32090. </p>
  32091. </dd>
  32092. <dt><samp class="option">m</samp></dt>
  32093. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  32094. Default is 0.
  32095. </p>
  32096. </dd>
  32097. <dt><samp class="option">dry</samp></dt>
  32098. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  32099. Default is 0.
  32100. </p>
  32101. </dd>
  32102. <dt><samp class="option">wet</samp></dt>
  32103. <dd><p>Set wet amount. Amount of processed (wet) signal.
  32104. Default is 1.
  32105. </p>
  32106. </dd>
  32107. <dt><samp class="option">temp</samp></dt>
  32108. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  32109. Default is 20.
  32110. </p></dd>
  32111. </dl>
  32112. <a name="Commands-33"></a>
  32113. <h4 class="subsection">36.78.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-33" aria-hidden="true">TOC</a></span></h4>
  32114. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32115. </p>
  32116. <a name="crossfeed"></a>
  32117. <h3 class="section">36.79 crossfeed<span class="pull-right"><a class="anchor hidden-xs" href="#crossfeed" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crossfeed" aria-hidden="true">TOC</a></span></h3>
  32118. <p>Apply headphone crossfeed filter.
  32119. </p>
  32120. <p>Crossfeed is the process of blending the left and right channels of stereo
  32121. audio recording.
  32122. It is mainly used to reduce extreme stereo separation of low frequencies.
  32123. </p>
  32124. <p>The intent is to produce more speaker like sound to the listener.
  32125. </p>
  32126. <p>The filter accepts the following options:
  32127. </p>
  32128. <dl class="table">
  32129. <dt><samp class="option">strength</samp></dt>
  32130. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  32131. This sets gain of low shelf filter for side part of stereo image.
  32132. Default is -6dB. Max allowed is -30db when strength is set to 1.
  32133. </p>
  32134. </dd>
  32135. <dt><samp class="option">range</samp></dt>
  32136. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  32137. This sets cut off frequency of low shelf filter. Default is cut off near
  32138. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  32139. </p>
  32140. </dd>
  32141. <dt><samp class="option">slope</samp></dt>
  32142. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  32143. Allowed range is from 0.01 to 1.
  32144. </p>
  32145. </dd>
  32146. <dt><samp class="option">level_in</samp></dt>
  32147. <dd><p>Set input gain. Default is 0.9.
  32148. </p>
  32149. </dd>
  32150. <dt><samp class="option">level_out</samp></dt>
  32151. <dd><p>Set output gain. Default is 1.
  32152. </p>
  32153. </dd>
  32154. <dt><samp class="option">block_size</samp></dt>
  32155. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  32156. value (higher than impulse response length truncated when reaches near zero values) filtering
  32157. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  32158. </p>
  32159. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  32160. </p></dd>
  32161. </dl>
  32162. <a name="Commands-34"></a>
  32163. <h4 class="subsection">36.79.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-34" aria-hidden="true">TOC</a></span></h4>
  32164. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32165. </p>
  32166. <a name="crystalizer"></a>
  32167. <h3 class="section">36.80 crystalizer<span class="pull-right"><a class="anchor hidden-xs" href="#crystalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crystalizer" aria-hidden="true">TOC</a></span></h3>
  32168. <p>Simple algorithm for audio noise sharpening.
  32169. </p>
  32170. <p>This filter linearly increases differences between each audio sample.
  32171. </p>
  32172. <p>The filter accepts the following options:
  32173. </p>
  32174. <dl class="table">
  32175. <dt><samp class="option">i</samp></dt>
  32176. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0
  32177. (unchanged sound) to 10.0 (maximum effect).
  32178. To inverse filtering use negative value.
  32179. </p>
  32180. </dd>
  32181. <dt><samp class="option">c</samp></dt>
  32182. <dd><p>Enable clipping. By default is enabled.
  32183. </p></dd>
  32184. </dl>
  32185. <a name="Commands-35"></a>
  32186. <h4 class="subsection">36.80.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-35" aria-hidden="true">TOC</a></span></h4>
  32187. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32188. </p>
  32189. <a name="dcshift"></a>
  32190. <h3 class="section">36.81 dcshift<span class="pull-right"><a class="anchor hidden-xs" href="#dcshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dcshift" aria-hidden="true">TOC</a></span></h3>
  32191. <p>Apply a DC shift to the audio.
  32192. </p>
  32193. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  32194. in the recording chain) from the audio. The effect of a DC offset is reduced
  32195. headroom and hence volume. The <a class="ref" href="#astats">astats</a> filter can be used to determine if
  32196. a signal has a DC offset.
  32197. </p>
  32198. <dl class="table">
  32199. <dt><samp class="option">shift</samp></dt>
  32200. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  32201. the audio.
  32202. </p>
  32203. </dd>
  32204. <dt><samp class="option">limitergain</samp></dt>
  32205. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  32206. used to prevent clipping.
  32207. </p></dd>
  32208. </dl>
  32209. <a name="deesser"></a>
  32210. <h3 class="section">36.82 deesser<span class="pull-right"><a class="anchor hidden-xs" href="#deesser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deesser" aria-hidden="true">TOC</a></span></h3>
  32211. <p>Apply de-essing to the audio samples.
  32212. </p>
  32213. <dl class="table">
  32214. <dt><samp class="option">i</samp></dt>
  32215. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  32216. Default is 0.
  32217. </p>
  32218. </dd>
  32219. <dt><samp class="option">m</samp></dt>
  32220. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  32221. Default is 0.5.
  32222. </p>
  32223. </dd>
  32224. <dt><samp class="option">f</samp></dt>
  32225. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  32226. Default is 0.5.
  32227. </p>
  32228. </dd>
  32229. <dt><samp class="option">s</samp></dt>
  32230. <dd><p>Set the output mode.
  32231. </p>
  32232. <p>It accepts the following values:
  32233. </p><dl class="table">
  32234. <dt><samp class="option">i</samp></dt>
  32235. <dd><p>Pass input unchanged.
  32236. </p>
  32237. </dd>
  32238. <dt><samp class="option">o</samp></dt>
  32239. <dd><p>Pass ess filtered out.
  32240. </p>
  32241. </dd>
  32242. <dt><samp class="option">e</samp></dt>
  32243. <dd><p>Pass only ess.
  32244. </p>
  32245. <p>Default value is <var class="var">o</var>.
  32246. </p></dd>
  32247. </dl>
  32248. </dd>
  32249. </dl>
  32250. <a name="dialoguenhance"></a>
  32251. <h3 class="section">36.83 dialoguenhance<span class="pull-right"><a class="anchor hidden-xs" href="#dialoguenhance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dialoguenhance" aria-hidden="true">TOC</a></span></h3>
  32252. <p>Enhance dialogue in stereo audio.
  32253. </p>
  32254. <p>This filter accepts stereo input and produce surround (3.0) channels output.
  32255. The newly produced front center channel have enhanced speech dialogue originally
  32256. available in both stereo channels.
  32257. This filter outputs front left and front right channels same as available in stereo input.
  32258. </p>
  32259. <p>The filter accepts the following options:
  32260. </p>
  32261. <dl class="table">
  32262. <dt><samp class="option">original</samp></dt>
  32263. <dd><p>Set the original center factor to keep in front center channel output.
  32264. Allowed range is from 0 to 1. Default value is 1.
  32265. </p>
  32266. </dd>
  32267. <dt><samp class="option">enhance</samp></dt>
  32268. <dd><p>Set the dialogue enhance factor to put in front center channel output.
  32269. Allowed range is from 0 to 3. Default value is 1.
  32270. </p>
  32271. </dd>
  32272. <dt><samp class="option">voice</samp></dt>
  32273. <dd><p>Set the voice detection factor.
  32274. Allowed range is from 2 to 32. Default value is 2.
  32275. </p></dd>
  32276. </dl>
  32277. <a name="Commands-36"></a>
  32278. <h4 class="subsection">36.83.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-36" aria-hidden="true">TOC</a></span></h4>
  32279. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32280. </p>
  32281. <a name="drmeter"></a>
  32282. <h3 class="section">36.84 drmeter<span class="pull-right"><a class="anchor hidden-xs" href="#drmeter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drmeter" aria-hidden="true">TOC</a></span></h3>
  32283. <p>Measure audio dynamic range.
  32284. </p>
  32285. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  32286. is found in transition material. And anything less that 8 have very poor dynamics
  32287. and is very compressed.
  32288. </p>
  32289. <p>The filter accepts the following options:
  32290. </p>
  32291. <dl class="table">
  32292. <dt><samp class="option">length</samp></dt>
  32293. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  32294. Default is 3 seconds.
  32295. </p></dd>
  32296. </dl>
  32297. <a name="dynaudnorm"></a>
  32298. <h3 class="section">36.85 dynaudnorm<span class="pull-right"><a class="anchor hidden-xs" href="#dynaudnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dynaudnorm" aria-hidden="true">TOC</a></span></h3>
  32299. <p>Dynamic Audio Normalizer.
  32300. </p>
  32301. <p>This filter applies a certain amount of gain to the input audio in order
  32302. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  32303. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  32304. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  32305. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  32306. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  32307. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  32308. sections, in the sense that the volume of each section is brought to the
  32309. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  32310. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  32311. of the dynamic range *within* each section of the audio file.
  32312. </p>
  32313. <dl class="table">
  32314. <dt><samp class="option">framelen, f</samp></dt>
  32315. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  32316. Default is 500 milliseconds.
  32317. The Dynamic Audio Normalizer processes the input audio in small chunks,
  32318. referred to as frames. This is required, because a peak magnitude has no
  32319. meaning for just a single sample value. Instead, we need to determine the
  32320. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  32321. normalizer would simply use the peak magnitude of the complete file, the
  32322. Dynamic Audio Normalizer determines the peak magnitude individually for each
  32323. frame. The length of a frame is specified in milliseconds. By default, the
  32324. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  32325. been found to give good results with most files.
  32326. Note that the exact frame length, in number of samples, will be determined
  32327. automatically, based on the sampling rate of the individual input audio file.
  32328. </p>
  32329. </dd>
  32330. <dt><samp class="option">gausssize, g</samp></dt>
  32331. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  32332. number. Default is 31.
  32333. Probably the most important parameter of the Dynamic Audio Normalizer is the
  32334. <code class="code">window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  32335. is specified in frames, centered around the current frame. For the sake of
  32336. simplicity, this must be an odd number. Consequently, the default value of 31
  32337. takes into account the current frame, as well as the 15 preceding frames and
  32338. the 15 subsequent frames. Using a larger window results in a stronger
  32339. smoothing effect and thus in less gain variation, i.e. slower gain
  32340. adaptation. Conversely, using a smaller window results in a weaker smoothing
  32341. effect and thus in more gain variation, i.e. faster gain adaptation.
  32342. In other words, the more you increase this value, the more the Dynamic Audio
  32343. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  32344. contrary, the more you decrease this value, the more the Dynamic Audio
  32345. Normalizer will behave like a dynamic range compressor.
  32346. </p>
  32347. </dd>
  32348. <dt><samp class="option">peak, p</samp></dt>
  32349. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  32350. level for the normalized audio input. This filter will try to approach the
  32351. target peak magnitude as closely as possible, but at the same time it also
  32352. makes sure that the normalized signal will never exceed the peak magnitude.
  32353. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  32354. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  32355. It is not recommended to go above this value.
  32356. </p>
  32357. </dd>
  32358. <dt><samp class="option">maxgain, m</samp></dt>
  32359. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  32360. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  32361. factor for each input frame, i.e. the maximum gain factor that does not
  32362. result in clipping or distortion. The maximum gain factor is determined by
  32363. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  32364. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  32365. (global) maximum gain factor. This is done in order to avoid excessive gain
  32366. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  32367. factor is 10.0, For most inputs the default value should be sufficient and
  32368. it usually is not recommended to increase this value. Though, for input
  32369. with an extremely low overall volume level, it may be necessary to allow even
  32370. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  32371. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  32372. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  32373. gain factors will smoothly approach the threshold value, but never exceed that
  32374. value.
  32375. </p>
  32376. </dd>
  32377. <dt><samp class="option">targetrms, r</samp></dt>
  32378. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  32379. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  32380. This means that the maximum local gain factor for each frame is defined
  32381. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  32382. be amplified as much as possible without exceeding the maximum signal
  32383. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  32384. Normalizer can also take into account the frame&rsquo;s root mean square,
  32385. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  32386. determine the power of a time-varying signal. It is therefore considered
  32387. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  32388. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  32389. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  32390. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  32391. factor is defined as the factor that would result in exactly that RMS value.
  32392. Note, however, that the maximum local gain factor is still restricted by the
  32393. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  32394. </p>
  32395. </dd>
  32396. <dt><samp class="option">coupling, n</samp></dt>
  32397. <dd><p>Enable channels coupling. By default is enabled.
  32398. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  32399. amount. This means the same gain factor will be applied to all channels, i.e.
  32400. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  32401. However, in some recordings, it may happen that the volume of the different
  32402. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  32403. In this case, this option can be used to disable the channel coupling. This way,
  32404. the gain factor will be determined independently for each channel, depending
  32405. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  32406. harmonizing the volume of the different channels.
  32407. </p>
  32408. </dd>
  32409. <dt><samp class="option">correctdc, c</samp></dt>
  32410. <dd><p>Enable DC bias correction. By default is disabled.
  32411. An audio signal (in the time domain) is a sequence of sample values.
  32412. In the Dynamic Audio Normalizer these sample values are represented in the
  32413. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  32414. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  32415. That means if we calculate the mean value of all samples in a file, or in a
  32416. single frame, then the result should be 0.0 or at least very close to that
  32417. value. If, however, there is a significant deviation of the mean value from
  32418. 0.0, in either positive or negative direction, this is referred to as a
  32419. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  32420. Audio Normalizer provides optional DC bias correction.
  32421. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  32422. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  32423. that value from all of the frame&rsquo;s sample values which ensures those samples
  32424. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  32425. boundaries, the DC correction offset values will be interpolated smoothly
  32426. between neighbouring frames.
  32427. </p>
  32428. </dd>
  32429. <dt><samp class="option">altboundary, b</samp></dt>
  32430. <dd><p>Enable alternative boundary mode. By default is disabled.
  32431. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  32432. around each frame. This includes the preceding frames as well as the
  32433. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  32434. beginning and at the very end of the audio file, not all neighbouring
  32435. frames are available. In particular, for the first few frames in the audio
  32436. file, the preceding frames are not known. And, similarly, for the last few
  32437. frames in the audio file, the subsequent frames are not known. Thus, the
  32438. question arises which gain factors should be assumed for the missing frames
  32439. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  32440. to deal with this situation. The default boundary mode assumes a gain factor
  32441. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  32442. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  32443. </p>
  32444. </dd>
  32445. <dt><samp class="option">compress, s</samp></dt>
  32446. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  32447. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  32448. compression. This means that signal peaks will not be pruned and thus the
  32449. full dynamic range will be retained within each local neighbourhood. However,
  32450. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  32451. normalization algorithm with a more &quot;traditional&quot; compression.
  32452. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  32453. (thresholding) function. If (and only if) the compression feature is enabled,
  32454. all input frames will be processed by a soft knee thresholding function prior
  32455. to the actual normalization process. Put simply, the thresholding function is
  32456. going to prune all samples whose magnitude exceeds a certain threshold value.
  32457. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  32458. value. Instead, the threshold value will be adjusted for each individual
  32459. frame.
  32460. In general, smaller parameters result in stronger compression, and vice versa.
  32461. Values below 3.0 are not recommended, because audible distortion may appear.
  32462. </p>
  32463. </dd>
  32464. <dt><samp class="option">threshold, t</samp></dt>
  32465. <dd><p>Set the target threshold value. This specifies the lowest permissible
  32466. magnitude level for the audio input which will be normalized.
  32467. If input frame volume is above this value frame will be normalized.
  32468. Otherwise frame may not be normalized at all. The default value is set
  32469. to 0, which means all input frames will be normalized.
  32470. This option is mostly useful if digital noise is not wanted to be amplified.
  32471. </p>
  32472. </dd>
  32473. <dt><samp class="option">channels, h</samp></dt>
  32474. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  32475. </p>
  32476. </dd>
  32477. <dt><samp class="option">overlap, o</samp></dt>
  32478. <dd><p>Specify overlap for frames. If set to 0 (default) no frame overlapping is done.
  32479. Using &gt;0 and &lt;1 values will make less conservative gain adjustments, like
  32480. when framelen option is set to smaller value, if framelen option value is
  32481. compensated for non-zero overlap then gain adjustments will be smoother across time
  32482. compared to zero overlap case.
  32483. </p>
  32484. </dd>
  32485. <dt><samp class="option">curve, v</samp></dt>
  32486. <dd><p>Specify the peak mapping curve expression which is going to be used when calculating
  32487. gain applied to frames. The max output frame gain will still be limited by other
  32488. options mentioned previously for this filter.
  32489. </p>
  32490. <p>The expression can contain the following constants:
  32491. </p>
  32492. <dl class="table">
  32493. <dt><samp class="option">ch</samp></dt>
  32494. <dd><p>current channel number
  32495. </p>
  32496. </dd>
  32497. <dt><samp class="option">sn</samp></dt>
  32498. <dd><p>current sample number
  32499. </p>
  32500. </dd>
  32501. <dt><samp class="option">nb_channels</samp></dt>
  32502. <dd><p>number of channels
  32503. </p>
  32504. </dd>
  32505. <dt><samp class="option">t</samp></dt>
  32506. <dd><p>timestamp expressed in seconds
  32507. </p>
  32508. </dd>
  32509. <dt><samp class="option">sr</samp></dt>
  32510. <dd><p>sample rate
  32511. </p>
  32512. </dd>
  32513. <dt><samp class="option">p</samp></dt>
  32514. <dd><p>current frame peak value
  32515. </p></dd>
  32516. </dl>
  32517. </dd>
  32518. </dl>
  32519. <a name="Commands-37"></a>
  32520. <h4 class="subsection">36.85.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-37" aria-hidden="true">TOC</a></span></h4>
  32521. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32522. </p>
  32523. <a name="earwax"></a>
  32524. <h3 class="section">36.86 earwax<span class="pull-right"><a class="anchor hidden-xs" href="#earwax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-earwax" aria-hidden="true">TOC</a></span></h3>
  32525. <p>Make audio easier to listen to on headphones.
  32526. </p>
  32527. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  32528. so that when listened to on headphones the stereo image is moved from
  32529. inside your head (standard for headphones) to outside and in front of
  32530. the listener (standard for speakers).
  32531. </p>
  32532. <p>Ported from SoX.
  32533. </p>
  32534. <a name="equalizer"></a>
  32535. <h3 class="section">36.87 equalizer<span class="pull-right"><a class="anchor hidden-xs" href="#equalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-equalizer" aria-hidden="true">TOC</a></span></h3>
  32536. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  32537. filter, the signal-level at and around a selected frequency can
  32538. be increased or decreased, whilst (unlike bandpass and bandreject
  32539. filters) that at all other frequencies is unchanged.
  32540. </p>
  32541. <p>In order to produce complex equalisation curves, this filter can
  32542. be given several times, each with a different central frequency.
  32543. </p>
  32544. <p>The filter accepts the following options:
  32545. </p>
  32546. <dl class="table">
  32547. <dt><samp class="option">frequency, f</samp></dt>
  32548. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  32549. </p>
  32550. </dd>
  32551. <dt><samp class="option">width_type, t</samp></dt>
  32552. <dd><p>Set method to specify band-width of filter.
  32553. </p><dl class="table">
  32554. <dt><samp class="option">h</samp></dt>
  32555. <dd><p>Hz
  32556. </p></dd>
  32557. <dt><samp class="option">q</samp></dt>
  32558. <dd><p>Q-Factor
  32559. </p></dd>
  32560. <dt><samp class="option">o</samp></dt>
  32561. <dd><p>octave
  32562. </p></dd>
  32563. <dt><samp class="option">s</samp></dt>
  32564. <dd><p>slope
  32565. </p></dd>
  32566. <dt><samp class="option">k</samp></dt>
  32567. <dd><p>kHz
  32568. </p></dd>
  32569. </dl>
  32570. </dd>
  32571. <dt><samp class="option">width, w</samp></dt>
  32572. <dd><p>Specify the band-width of a filter in width_type units.
  32573. </p>
  32574. </dd>
  32575. <dt><samp class="option">gain, g</samp></dt>
  32576. <dd><p>Set the required gain or attenuation in dB.
  32577. Beware of clipping when using a positive gain.
  32578. </p>
  32579. </dd>
  32580. <dt><samp class="option">mix, m</samp></dt>
  32581. <dd><p>How much to use filtered signal in output. Default is 1.
  32582. Range is between 0 and 1.
  32583. </p>
  32584. </dd>
  32585. <dt><samp class="option">channels, c</samp></dt>
  32586. <dd><p>Specify which channels to filter, by default all available are filtered.
  32587. </p>
  32588. </dd>
  32589. <dt><samp class="option">normalize, n</samp></dt>
  32590. <dd><p>Normalize biquad coefficients, by default is disabled.
  32591. Enabling it will normalize magnitude response at DC to 0dB.
  32592. </p>
  32593. </dd>
  32594. <dt><samp class="option">transform, a</samp></dt>
  32595. <dd><p>Set transform type of IIR filter.
  32596. </p><dl class="table">
  32597. <dt><samp class="option">di</samp></dt>
  32598. <dt><samp class="option">dii</samp></dt>
  32599. <dt><samp class="option">tdi</samp></dt>
  32600. <dt><samp class="option">tdii</samp></dt>
  32601. <dt><samp class="option">latt</samp></dt>
  32602. <dt><samp class="option">svf</samp></dt>
  32603. <dt><samp class="option">zdf</samp></dt>
  32604. </dl>
  32605. </dd>
  32606. <dt><samp class="option">precision, r</samp></dt>
  32607. <dd><p>Set precision of filtering.
  32608. </p><dl class="table">
  32609. <dt><samp class="option">auto</samp></dt>
  32610. <dd><p>Pick automatic sample format depending on surround filters.
  32611. </p></dd>
  32612. <dt><samp class="option">s16</samp></dt>
  32613. <dd><p>Always use signed 16-bit.
  32614. </p></dd>
  32615. <dt><samp class="option">s32</samp></dt>
  32616. <dd><p>Always use signed 32-bit.
  32617. </p></dd>
  32618. <dt><samp class="option">f32</samp></dt>
  32619. <dd><p>Always use float 32-bit.
  32620. </p></dd>
  32621. <dt><samp class="option">f64</samp></dt>
  32622. <dd><p>Always use float 64-bit.
  32623. </p></dd>
  32624. </dl>
  32625. </dd>
  32626. <dt><samp class="option">block_size, b</samp></dt>
  32627. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  32628. value (higher than impulse response length truncated when reaches near zero values) filtering
  32629. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  32630. </p>
  32631. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  32632. </p></dd>
  32633. </dl>
  32634. <a name="Examples-69"></a>
  32635. <h4 class="subsection">36.87.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-69" aria-hidden="true">TOC</a></span></h4>
  32636. <ul class="itemize mark-bullet">
  32637. <li>Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  32638. <div class="example">
  32639. <pre class="example-preformatted">equalizer=f=1000:t=h:width=200:g=-10
  32640. </pre></div>
  32641. </li><li>Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  32642. <div class="example">
  32643. <pre class="example-preformatted">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  32644. </pre></div>
  32645. </li></ul>
  32646. <a name="Commands-38"></a>
  32647. <h4 class="subsection">36.87.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-38" aria-hidden="true">TOC</a></span></h4>
  32648. <p>This filter supports the following commands:
  32649. </p><dl class="table">
  32650. <dt><samp class="option">frequency, f</samp></dt>
  32651. <dd><p>Change equalizer frequency.
  32652. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  32653. </p>
  32654. </dd>
  32655. <dt><samp class="option">width_type, t</samp></dt>
  32656. <dd><p>Change equalizer width_type.
  32657. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  32658. </p>
  32659. </dd>
  32660. <dt><samp class="option">width, w</samp></dt>
  32661. <dd><p>Change equalizer width.
  32662. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  32663. </p>
  32664. </dd>
  32665. <dt><samp class="option">gain, g</samp></dt>
  32666. <dd><p>Change equalizer gain.
  32667. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  32668. </p>
  32669. </dd>
  32670. <dt><samp class="option">mix, m</samp></dt>
  32671. <dd><p>Change equalizer mix.
  32672. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  32673. </p></dd>
  32674. </dl>
  32675. <a name="extrastereo"></a>
  32676. <h3 class="section">36.88 extrastereo<span class="pull-right"><a class="anchor hidden-xs" href="#extrastereo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extrastereo" aria-hidden="true">TOC</a></span></h3>
  32677. <p>Linearly increases the difference between left and right channels which
  32678. adds some sort of &quot;live&quot; effect to playback.
  32679. </p>
  32680. <p>The filter accepts the following options:
  32681. </p>
  32682. <dl class="table">
  32683. <dt><samp class="option">m</samp></dt>
  32684. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  32685. (average of both channels), with 1.0 sound will be unchanged, with
  32686. -1.0 left and right channels will be swapped.
  32687. </p>
  32688. </dd>
  32689. <dt><samp class="option">c</samp></dt>
  32690. <dd><p>Enable clipping. By default is enabled.
  32691. </p></dd>
  32692. </dl>
  32693. <a name="Commands-39"></a>
  32694. <h4 class="subsection">36.88.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-39" aria-hidden="true">TOC</a></span></h4>
  32695. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32696. </p>
  32697. <a name="firequalizer"></a>
  32698. <h3 class="section">36.89 firequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#firequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-firequalizer" aria-hidden="true">TOC</a></span></h3>
  32699. <p>Apply FIR Equalization using arbitrary frequency response.
  32700. </p>
  32701. <p>The filter accepts the following option:
  32702. </p>
  32703. <dl class="table">
  32704. <dt><samp class="option">gain</samp></dt>
  32705. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  32706. </p><dl class="table">
  32707. <dt><samp class="option">f</samp></dt>
  32708. <dd><p>the evaluated frequency
  32709. </p></dd>
  32710. <dt><samp class="option">sr</samp></dt>
  32711. <dd><p>sample rate
  32712. </p></dd>
  32713. <dt><samp class="option">ch</samp></dt>
  32714. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  32715. </p></dd>
  32716. <dt><samp class="option">chid</samp></dt>
  32717. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  32718. multichannels evaluation is disabled
  32719. </p></dd>
  32720. <dt><samp class="option">chs</samp></dt>
  32721. <dd><p>number of channels
  32722. </p></dd>
  32723. <dt><samp class="option">chlayout</samp></dt>
  32724. <dd><p>channel_layout, see libavutil/channel_layout.h
  32725. </p>
  32726. </dd>
  32727. </dl>
  32728. <p>and functions:
  32729. </p><dl class="table">
  32730. <dt><samp class="option">gain_interpolate(f)</samp></dt>
  32731. <dd><p>interpolate gain on frequency f based on gain_entry
  32732. </p></dd>
  32733. <dt><samp class="option">cubic_interpolate(f)</samp></dt>
  32734. <dd><p>same as gain_interpolate, but smoother
  32735. </p></dd>
  32736. </dl>
  32737. <p>This option is also available as command. Default is <code class="code">gain_interpolate(f)</code>.
  32738. </p>
  32739. </dd>
  32740. <dt><samp class="option">gain_entry</samp></dt>
  32741. <dd><p>Set gain entry for gain_interpolate function. The expression can
  32742. contain functions:
  32743. </p><dl class="table">
  32744. <dt><samp class="option">entry(f, g)</samp></dt>
  32745. <dd><p>store gain entry at frequency f with value g
  32746. </p></dd>
  32747. </dl>
  32748. <p>This option is also available as command.
  32749. </p>
  32750. </dd>
  32751. <dt><samp class="option">delay</samp></dt>
  32752. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  32753. Default is <code class="code">0.01</code>.
  32754. </p>
  32755. </dd>
  32756. <dt><samp class="option">accuracy</samp></dt>
  32757. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  32758. Default is <code class="code">5</code>.
  32759. </p>
  32760. </dd>
  32761. <dt><samp class="option">wfunc</samp></dt>
  32762. <dd><p>Set window function. Acceptable values are:
  32763. </p><dl class="table">
  32764. <dt><samp class="option">rectangular</samp></dt>
  32765. <dd><p>rectangular window, useful when gain curve is already smooth
  32766. </p></dd>
  32767. <dt><samp class="option">hann</samp></dt>
  32768. <dd><p>hann window (default)
  32769. </p></dd>
  32770. <dt><samp class="option">hamming</samp></dt>
  32771. <dd><p>hamming window
  32772. </p></dd>
  32773. <dt><samp class="option">blackman</samp></dt>
  32774. <dd><p>blackman window
  32775. </p></dd>
  32776. <dt><samp class="option">nuttall3</samp></dt>
  32777. <dd><p>3-terms continuous 1st derivative nuttall window
  32778. </p></dd>
  32779. <dt><samp class="option">mnuttall3</samp></dt>
  32780. <dd><p>minimum 3-terms discontinuous nuttall window
  32781. </p></dd>
  32782. <dt><samp class="option">nuttall</samp></dt>
  32783. <dd><p>4-terms continuous 1st derivative nuttall window
  32784. </p></dd>
  32785. <dt><samp class="option">bnuttall</samp></dt>
  32786. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  32787. </p></dd>
  32788. <dt><samp class="option">bharris</samp></dt>
  32789. <dd><p>blackman-harris window
  32790. </p></dd>
  32791. <dt><samp class="option">tukey</samp></dt>
  32792. <dd><p>tukey window
  32793. </p></dd>
  32794. </dl>
  32795. </dd>
  32796. <dt><samp class="option">fixed</samp></dt>
  32797. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  32798. filtering with large delay. Default is disabled.
  32799. </p>
  32800. </dd>
  32801. <dt><samp class="option">multi</samp></dt>
  32802. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  32803. </p>
  32804. </dd>
  32805. <dt><samp class="option">zero_phase</samp></dt>
  32806. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  32807. Default is disabled.
  32808. </p>
  32809. </dd>
  32810. <dt><samp class="option">scale</samp></dt>
  32811. <dd><p>Set scale used by gain. Acceptable values are:
  32812. </p><dl class="table">
  32813. <dt><samp class="option">linlin</samp></dt>
  32814. <dd><p>linear frequency, linear gain
  32815. </p></dd>
  32816. <dt><samp class="option">linlog</samp></dt>
  32817. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  32818. </p></dd>
  32819. <dt><samp class="option">loglin</samp></dt>
  32820. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  32821. </p></dd>
  32822. <dt><samp class="option">loglog</samp></dt>
  32823. <dd><p>logarithmic frequency, logarithmic gain
  32824. </p></dd>
  32825. </dl>
  32826. </dd>
  32827. <dt><samp class="option">dumpfile</samp></dt>
  32828. <dd><p>Set file for dumping, suitable for gnuplot.
  32829. </p>
  32830. </dd>
  32831. <dt><samp class="option">dumpscale</samp></dt>
  32832. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  32833. Default is linlog.
  32834. </p>
  32835. </dd>
  32836. <dt><samp class="option">fft2</samp></dt>
  32837. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  32838. Default is disabled.
  32839. </p>
  32840. </dd>
  32841. <dt><samp class="option">min_phase</samp></dt>
  32842. <dd><p>Enable minimum phase impulse response. Default is disabled.
  32843. </p></dd>
  32844. </dl>
  32845. <a name="Examples-70"></a>
  32846. <h4 class="subsection">36.89.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-70" aria-hidden="true">TOC</a></span></h4>
  32847. <ul class="itemize mark-bullet">
  32848. <li>lowpass at 1000 Hz:
  32849. <div class="example">
  32850. <pre class="example-preformatted">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  32851. </pre></div>
  32852. </li><li>lowpass at 1000 Hz with gain_entry:
  32853. <div class="example">
  32854. <pre class="example-preformatted">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  32855. </pre></div>
  32856. </li><li>custom equalization:
  32857. <div class="example">
  32858. <pre class="example-preformatted">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  32859. </pre></div>
  32860. </li><li>higher delay with zero phase to compensate delay:
  32861. <div class="example">
  32862. <pre class="example-preformatted">firequalizer=delay=0.1:fixed=on:zero_phase=on
  32863. </pre></div>
  32864. </li><li>lowpass on left channel, highpass on right channel:
  32865. <div class="example">
  32866. <pre class="example-preformatted">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  32867. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  32868. </pre></div>
  32869. </li></ul>
  32870. <a name="flanger"></a>
  32871. <h3 class="section">36.90 flanger<span class="pull-right"><a class="anchor hidden-xs" href="#flanger" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flanger" aria-hidden="true">TOC</a></span></h3>
  32872. <p>Apply a flanging effect to the audio.
  32873. </p>
  32874. <p>The filter accepts the following options:
  32875. </p>
  32876. <dl class="table">
  32877. <dt><samp class="option">delay</samp></dt>
  32878. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  32879. </p>
  32880. </dd>
  32881. <dt><samp class="option">depth</samp></dt>
  32882. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  32883. </p>
  32884. </dd>
  32885. <dt><samp class="option">regen</samp></dt>
  32886. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  32887. Default value is 0.
  32888. </p>
  32889. </dd>
  32890. <dt><samp class="option">width</samp></dt>
  32891. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  32892. Default value is 71.
  32893. </p>
  32894. </dd>
  32895. <dt><samp class="option">speed</samp></dt>
  32896. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  32897. </p>
  32898. </dd>
  32899. <dt><samp class="option">shape</samp></dt>
  32900. <dd><p>Set swept wave shape, can be <var class="var">triangular</var> or <var class="var">sinusoidal</var>.
  32901. Default value is <var class="var">sinusoidal</var>.
  32902. </p>
  32903. </dd>
  32904. <dt><samp class="option">phase</samp></dt>
  32905. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  32906. Default value is 25.
  32907. </p>
  32908. </dd>
  32909. <dt><samp class="option">interp</samp></dt>
  32910. <dd><p>Set delay-line interpolation, <var class="var">linear</var> or <var class="var">quadratic</var>.
  32911. Default is <var class="var">linear</var>.
  32912. </p></dd>
  32913. </dl>
  32914. <a name="haas"></a>
  32915. <h3 class="section">36.91 haas<span class="pull-right"><a class="anchor hidden-xs" href="#haas" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haas" aria-hidden="true">TOC</a></span></h3>
  32916. <p>Apply Haas effect to audio.
  32917. </p>
  32918. <p>Note that this makes most sense to apply on mono signals.
  32919. With this filter applied to mono signals it give some directionality and
  32920. stretches its stereo image.
  32921. </p>
  32922. <p>The filter accepts the following options:
  32923. </p>
  32924. <dl class="table">
  32925. <dt><samp class="option">level_in</samp></dt>
  32926. <dd><p>Set input level. By default is <var class="var">1</var>, or 0dB
  32927. </p>
  32928. </dd>
  32929. <dt><samp class="option">level_out</samp></dt>
  32930. <dd><p>Set output level. By default is <var class="var">1</var>, or 0dB.
  32931. </p>
  32932. </dd>
  32933. <dt><samp class="option">side_gain</samp></dt>
  32934. <dd><p>Set gain applied to side part of signal. By default is <var class="var">1</var>.
  32935. </p>
  32936. </dd>
  32937. <dt><samp class="option">middle_source</samp></dt>
  32938. <dd><p>Set kind of middle source. Can be one of the following:
  32939. </p>
  32940. <dl class="table">
  32941. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  32942. <dd><p>Pick left channel.
  32943. </p>
  32944. </dd>
  32945. <dt>&lsquo;<samp class="samp">right</samp>&rsquo;</dt>
  32946. <dd><p>Pick right channel.
  32947. </p>
  32948. </dd>
  32949. <dt>&lsquo;<samp class="samp">mid</samp>&rsquo;</dt>
  32950. <dd><p>Pick middle part signal of stereo image.
  32951. </p>
  32952. </dd>
  32953. <dt>&lsquo;<samp class="samp">side</samp>&rsquo;</dt>
  32954. <dd><p>Pick side part signal of stereo image.
  32955. </p></dd>
  32956. </dl>
  32957. </dd>
  32958. <dt><samp class="option">middle_phase</samp></dt>
  32959. <dd><p>Change middle phase. By default is disabled.
  32960. </p>
  32961. </dd>
  32962. <dt><samp class="option">left_delay</samp></dt>
  32963. <dd><p>Set left channel delay. By default is <var class="var">2.05</var> milliseconds.
  32964. </p>
  32965. </dd>
  32966. <dt><samp class="option">left_balance</samp></dt>
  32967. <dd><p>Set left channel balance. By default is <var class="var">-1</var>.
  32968. </p>
  32969. </dd>
  32970. <dt><samp class="option">left_gain</samp></dt>
  32971. <dd><p>Set left channel gain. By default is <var class="var">1</var>.
  32972. </p>
  32973. </dd>
  32974. <dt><samp class="option">left_phase</samp></dt>
  32975. <dd><p>Change left phase. By default is disabled.
  32976. </p>
  32977. </dd>
  32978. <dt><samp class="option">right_delay</samp></dt>
  32979. <dd><p>Set right channel delay. By defaults is <var class="var">2.12</var> milliseconds.
  32980. </p>
  32981. </dd>
  32982. <dt><samp class="option">right_balance</samp></dt>
  32983. <dd><p>Set right channel balance. By default is <var class="var">1</var>.
  32984. </p>
  32985. </dd>
  32986. <dt><samp class="option">right_gain</samp></dt>
  32987. <dd><p>Set right channel gain. By default is <var class="var">1</var>.
  32988. </p>
  32989. </dd>
  32990. <dt><samp class="option">right_phase</samp></dt>
  32991. <dd><p>Change right phase. By default is enabled.
  32992. </p></dd>
  32993. </dl>
  32994. <a name="hdcd"></a>
  32995. <h3 class="section">36.92 hdcd<span class="pull-right"><a class="anchor hidden-xs" href="#hdcd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hdcd" aria-hidden="true">TOC</a></span></h3>
  32996. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  32997. embedded HDCD codes is expanded into a 20-bit PCM stream.
  32998. </p>
  32999. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  33000. of HDCD, and detects the Transient Filter flag.
  33001. </p>
  33002. <div class="example">
  33003. <pre class="example-preformatted">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  33004. </pre></div>
  33005. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  33006. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  33007. like <code class="command">-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  33008. </p><div class="example">
  33009. <pre class="example-preformatted">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  33010. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  33011. </pre></div>
  33012. <p>The filter accepts the following options:
  33013. </p>
  33014. <dl class="table">
  33015. <dt><samp class="option">disable_autoconvert</samp></dt>
  33016. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  33017. </p>
  33018. </dd>
  33019. <dt><samp class="option">process_stereo</samp></dt>
  33020. <dd><p>Process the stereo channels together. If target_gain does not match between
  33021. channels, consider it invalid and use the last valid target_gain.
  33022. </p>
  33023. </dd>
  33024. <dt><samp class="option">cdt_ms</samp></dt>
  33025. <dd><p>Set the code detect timer period in ms.
  33026. </p>
  33027. </dd>
  33028. <dt><samp class="option">force_pe</samp></dt>
  33029. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  33030. </p>
  33031. </dd>
  33032. <dt><samp class="option">analyze_mode</samp></dt>
  33033. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  33034. specific aspect of the decoding process. The output file can be loaded in
  33035. an audio editor alongside the original to aid analysis.
  33036. </p>
  33037. <p><code class="code">analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  33038. </p>
  33039. <p>Modes are:
  33040. </p><dl class="table">
  33041. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  33042. <dd><p>Disabled
  33043. </p></dd>
  33044. <dt>&lsquo;<samp class="samp">1, lle</samp>&rsquo;</dt>
  33045. <dd><p>Gain adjustment level at each sample
  33046. </p></dd>
  33047. <dt>&lsquo;<samp class="samp">2, pe</samp>&rsquo;</dt>
  33048. <dd><p>Samples where peak extend occurs
  33049. </p></dd>
  33050. <dt>&lsquo;<samp class="samp">3, cdt</samp>&rsquo;</dt>
  33051. <dd><p>Samples where the code detect timer is active
  33052. </p></dd>
  33053. <dt>&lsquo;<samp class="samp">4, tgm</samp>&rsquo;</dt>
  33054. <dd><p>Samples where the target gain does not match between channels
  33055. </p></dd>
  33056. </dl>
  33057. </dd>
  33058. </dl>
  33059. <a name="headphone"></a>
  33060. <h3 class="section">36.93 headphone<span class="pull-right"><a class="anchor hidden-xs" href="#headphone" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-headphone" aria-hidden="true">TOC</a></span></h3>
  33061. <p>Apply head-related transfer functions (HRTFs) to create virtual
  33062. loudspeakers around the user for binaural listening via headphones.
  33063. The HRIRs are provided via additional streams, for each channel
  33064. one stereo input stream is needed.
  33065. </p>
  33066. <p>The filter accepts the following options:
  33067. </p>
  33068. <dl class="table">
  33069. <dt><samp class="option">map</samp></dt>
  33070. <dd><p>Set mapping of input streams for convolution.
  33071. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  33072. are given as additional stream inputs for filter.
  33073. This also specify number of input streams. Number of input streams
  33074. must be not less than number of channels in first stream plus one.
  33075. </p>
  33076. </dd>
  33077. <dt><samp class="option">gain</samp></dt>
  33078. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  33079. </p>
  33080. </dd>
  33081. <dt><samp class="option">type</samp></dt>
  33082. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  33083. processing audio in time domain which is slow.
  33084. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  33085. Default is <var class="var">freq</var>.
  33086. </p>
  33087. </dd>
  33088. <dt><samp class="option">lfe</samp></dt>
  33089. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  33090. </p>
  33091. </dd>
  33092. <dt><samp class="option">size</samp></dt>
  33093. <dd><p>Set size of frame in number of samples which will be processed at once.
  33094. Default value is <var class="var">1024</var>. Allowed range is from 1024 to 96000.
  33095. </p>
  33096. </dd>
  33097. <dt><samp class="option">hrir</samp></dt>
  33098. <dd><p>Set format of hrir stream.
  33099. Default value is <var class="var">stereo</var>. Alternative value is <var class="var">multich</var>.
  33100. If value is set to <var class="var">stereo</var>, number of additional streams should
  33101. be greater or equal to number of input channels in first input stream.
  33102. Also each additional stream should have stereo number of channels.
  33103. If value is set to <var class="var">multich</var>, number of additional streams should
  33104. be exactly one. Also number of input channels of additional stream
  33105. should be equal or greater than twice number of channels of first input
  33106. stream.
  33107. </p></dd>
  33108. </dl>
  33109. <a name="Examples-71"></a>
  33110. <h4 class="subsection">36.93.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-71" aria-hidden="true">TOC</a></span></h4>
  33111. <ul class="itemize mark-bullet">
  33112. <li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  33113. each amovie filter use stereo file with IR coefficients as input.
  33114. The files give coefficients for each position of virtual loudspeaker:
  33115. <div class="example">
  33116. <pre class="example-preformatted">ffmpeg -i input.wav
  33117. -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;
  33118. output.wav
  33119. </pre></div>
  33120. </li><li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  33121. but now in <var class="var">multich</var> <var class="var">hrir</var> format.
  33122. <div class="example">
  33123. <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;
  33124. output.wav
  33125. </pre></div>
  33126. </li></ul>
  33127. <a name="highpass"></a>
  33128. <h3 class="section">36.94 highpass<span class="pull-right"><a class="anchor hidden-xs" href="#highpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-highpass" aria-hidden="true">TOC</a></span></h3>
  33129. <p>Apply a high-pass filter with 3dB point frequency.
  33130. The filter can be either single-pole, or double-pole (the default).
  33131. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  33132. </p>
  33133. <p>The filter accepts the following options:
  33134. </p>
  33135. <dl class="table">
  33136. <dt><samp class="option">frequency, f</samp></dt>
  33137. <dd><p>Set frequency in Hz. Default is 3000.
  33138. </p>
  33139. </dd>
  33140. <dt><samp class="option">poles, p</samp></dt>
  33141. <dd><p>Set number of poles. Default is 2.
  33142. </p>
  33143. </dd>
  33144. <dt><samp class="option">width_type, t</samp></dt>
  33145. <dd><p>Set method to specify band-width of filter.
  33146. </p><dl class="table">
  33147. <dt><samp class="option">h</samp></dt>
  33148. <dd><p>Hz
  33149. </p></dd>
  33150. <dt><samp class="option">q</samp></dt>
  33151. <dd><p>Q-Factor
  33152. </p></dd>
  33153. <dt><samp class="option">o</samp></dt>
  33154. <dd><p>octave
  33155. </p></dd>
  33156. <dt><samp class="option">s</samp></dt>
  33157. <dd><p>slope
  33158. </p></dd>
  33159. <dt><samp class="option">k</samp></dt>
  33160. <dd><p>kHz
  33161. </p></dd>
  33162. </dl>
  33163. </dd>
  33164. <dt><samp class="option">width, w</samp></dt>
  33165. <dd><p>Specify the band-width of a filter in width_type units.
  33166. Applies only to double-pole filter.
  33167. The default is 0.707q and gives a Butterworth response.
  33168. </p>
  33169. </dd>
  33170. <dt><samp class="option">mix, m</samp></dt>
  33171. <dd><p>How much to use filtered signal in output. Default is 1.
  33172. Range is between 0 and 1.
  33173. </p>
  33174. </dd>
  33175. <dt><samp class="option">channels, c</samp></dt>
  33176. <dd><p>Specify which channels to filter, by default all available are filtered.
  33177. </p>
  33178. </dd>
  33179. <dt><samp class="option">normalize, n</samp></dt>
  33180. <dd><p>Normalize biquad coefficients, by default is disabled.
  33181. Enabling it will normalize magnitude response at DC to 0dB.
  33182. </p>
  33183. </dd>
  33184. <dt><samp class="option">transform, a</samp></dt>
  33185. <dd><p>Set transform type of IIR filter.
  33186. </p><dl class="table">
  33187. <dt><samp class="option">di</samp></dt>
  33188. <dt><samp class="option">dii</samp></dt>
  33189. <dt><samp class="option">tdi</samp></dt>
  33190. <dt><samp class="option">tdii</samp></dt>
  33191. <dt><samp class="option">latt</samp></dt>
  33192. <dt><samp class="option">svf</samp></dt>
  33193. <dt><samp class="option">zdf</samp></dt>
  33194. </dl>
  33195. </dd>
  33196. <dt><samp class="option">precision, r</samp></dt>
  33197. <dd><p>Set precision of filtering.
  33198. </p><dl class="table">
  33199. <dt><samp class="option">auto</samp></dt>
  33200. <dd><p>Pick automatic sample format depending on surround filters.
  33201. </p></dd>
  33202. <dt><samp class="option">s16</samp></dt>
  33203. <dd><p>Always use signed 16-bit.
  33204. </p></dd>
  33205. <dt><samp class="option">s32</samp></dt>
  33206. <dd><p>Always use signed 32-bit.
  33207. </p></dd>
  33208. <dt><samp class="option">f32</samp></dt>
  33209. <dd><p>Always use float 32-bit.
  33210. </p></dd>
  33211. <dt><samp class="option">f64</samp></dt>
  33212. <dd><p>Always use float 64-bit.
  33213. </p></dd>
  33214. </dl>
  33215. </dd>
  33216. <dt><samp class="option">block_size, b</samp></dt>
  33217. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  33218. value (higher than impulse response length truncated when reaches near zero values) filtering
  33219. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  33220. </p>
  33221. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  33222. </p></dd>
  33223. </dl>
  33224. <a name="Commands-40"></a>
  33225. <h4 class="subsection">36.94.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-40" aria-hidden="true">TOC</a></span></h4>
  33226. <p>This filter supports the following commands:
  33227. </p><dl class="table">
  33228. <dt><samp class="option">frequency, f</samp></dt>
  33229. <dd><p>Change highpass frequency.
  33230. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  33231. </p>
  33232. </dd>
  33233. <dt><samp class="option">width_type, t</samp></dt>
  33234. <dd><p>Change highpass width_type.
  33235. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  33236. </p>
  33237. </dd>
  33238. <dt><samp class="option">width, w</samp></dt>
  33239. <dd><p>Change highpass width.
  33240. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  33241. </p>
  33242. </dd>
  33243. <dt><samp class="option">mix, m</samp></dt>
  33244. <dd><p>Change highpass mix.
  33245. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  33246. </p></dd>
  33247. </dl>
  33248. <a name="join"></a>
  33249. <h3 class="section">36.95 join<span class="pull-right"><a class="anchor hidden-xs" href="#join" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-join" aria-hidden="true">TOC</a></span></h3>
  33250. <p>Join multiple input streams into one multi-channel stream.
  33251. </p>
  33252. <p>It accepts the following parameters:
  33253. </p><dl class="table">
  33254. <dt><samp class="option">inputs</samp></dt>
  33255. <dd><p>The number of input streams. It defaults to 2.
  33256. </p>
  33257. </dd>
  33258. <dt><samp class="option">channel_layout</samp></dt>
  33259. <dd><p>The desired output channel layout. It defaults to stereo.
  33260. </p>
  33261. </dd>
  33262. <dt><samp class="option">map</samp></dt>
  33263. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  33264. 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>
  33265. form. <var class="var">input_idx</var> is the 0-based index of the input stream. <var class="var">in_channel</var>
  33266. can be either the name of the input channel (e.g. FL for front left) or its
  33267. index in the specified input stream. <var class="var">out_channel</var> is the name of the output
  33268. channel.
  33269. </p></dd>
  33270. </dl>
  33271. <p>The filter will attempt to guess the mappings when they are not specified
  33272. explicitly. It does so by first trying to find an unused matching input channel
  33273. and if that fails it picks the first unused input channel.
  33274. </p>
  33275. <p>Join 3 inputs (with properly set channel layouts):
  33276. </p><div class="example">
  33277. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  33278. </pre></div>
  33279. <p>Build a 5.1 output from 6 single-channel streams:
  33280. </p><div class="example">
  33281. <pre class="example-preformatted">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  33282. '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'
  33283. out
  33284. </pre></div>
  33285. <a name="ladspa"></a>
  33286. <h3 class="section">36.96 ladspa<span class="pull-right"><a class="anchor hidden-xs" href="#ladspa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ladspa" aria-hidden="true">TOC</a></span></h3>
  33287. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  33288. </p>
  33289. <p>To enable compilation of this filter you need to configure FFmpeg with
  33290. <code class="code">--enable-ladspa</code>.
  33291. </p>
  33292. <dl class="table">
  33293. <dt><samp class="option">file, f</samp></dt>
  33294. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  33295. variable <code class="env">LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  33296. each one of the directories specified by the colon separated list in
  33297. <code class="env">LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  33298. this order: <samp class="file">HOME/.ladspa/lib/</samp>, <samp class="file">/usr/local/lib/ladspa/</samp>,
  33299. <samp class="file">/usr/lib/ladspa/</samp>.
  33300. </p>
  33301. </dd>
  33302. <dt><samp class="option">plugin, p</samp></dt>
  33303. <dd><p>Specifies the plugin within the library. Some libraries contain only
  33304. one plugin, but others contain many of them. If this is not set filter
  33305. will list all available plugins within the specified library.
  33306. </p>
  33307. </dd>
  33308. <dt><samp class="option">controls, c</samp></dt>
  33309. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  33310. values that determine the behavior of the loaded plugin (for example delay,
  33311. threshold or gain).
  33312. Controls need to be defined using the following syntax:
  33313. c0=<var class="var">value0</var>|c1=<var class="var">value1</var>|c2=<var class="var">value2</var>|..., where
  33314. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  33315. Alternatively they can be also defined using the following syntax:
  33316. <var class="var">value0</var>|<var class="var">value1</var>|<var class="var">value2</var>|..., where
  33317. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  33318. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  33319. their valid ranges are printed.
  33320. </p>
  33321. </dd>
  33322. <dt><samp class="option">sample_rate, s</samp></dt>
  33323. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  33324. zero inputs.
  33325. </p>
  33326. </dd>
  33327. <dt><samp class="option">nb_samples, n</samp></dt>
  33328. <dd><p>Set the number of samples per channel per each output frame, default
  33329. is 1024. Only used if plugin have zero inputs.
  33330. </p>
  33331. </dd>
  33332. <dt><samp class="option">duration, d</samp></dt>
  33333. <dd><p>Set the minimum duration of the sourced audio. See
  33334. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  33335. for the accepted syntax.
  33336. Note that the resulting duration may be greater than the specified duration,
  33337. as the generated audio is always cut at the end of a complete frame.
  33338. If not specified, or the expressed duration is negative, the audio is
  33339. supposed to be generated forever.
  33340. Only used if plugin have zero inputs.
  33341. </p>
  33342. </dd>
  33343. <dt><samp class="option">latency, l</samp></dt>
  33344. <dd><p>Enable latency compensation, by default is disabled.
  33345. Only used if plugin have inputs.
  33346. </p></dd>
  33347. </dl>
  33348. <a name="Examples-72"></a>
  33349. <h4 class="subsection">36.96.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-72" aria-hidden="true">TOC</a></span></h4>
  33350. <ul class="itemize mark-bullet">
  33351. <li>List all available plugins within amp (LADSPA example plugin) library:
  33352. <div class="example">
  33353. <pre class="example-preformatted">ladspa=file=amp
  33354. </pre></div>
  33355. </li><li>List all available controls and their valid ranges for <code class="code">vcf_notch</code>
  33356. plugin from <code class="code">VCF</code> library:
  33357. <div class="example">
  33358. <pre class="example-preformatted">ladspa=f=vcf:p=vcf_notch:c=help
  33359. </pre></div>
  33360. </li><li>Simulate low quality audio equipment using <code class="code">Computer Music Toolkit</code> (CMT)
  33361. plugin library:
  33362. <div class="example">
  33363. <pre class="example-preformatted">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  33364. </pre></div>
  33365. </li><li>Add reverberation to the audio using TAP-plugins
  33366. (Tom&rsquo;s Audio Processing plugins):
  33367. <div class="example">
  33368. <pre class="example-preformatted">ladspa=file=tap_reverb:tap_reverb
  33369. </pre></div>
  33370. </li><li>Generate white noise, with 0.2 amplitude:
  33371. <div class="example">
  33372. <pre class="example-preformatted">ladspa=file=cmt:noise_source_white:c=c0=.2
  33373. </pre></div>
  33374. </li><li>Generate 20 bpm clicks using plugin <code class="code">C* Click - Metronome</code> from the
  33375. <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  33376. <div class="example">
  33377. <pre class="example-preformatted">ladspa=file=caps:Click:c=c1=20'
  33378. </pre></div>
  33379. </li><li>Apply <code class="code">C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  33380. <div class="example">
  33381. <pre class="example-preformatted">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  33382. </pre></div>
  33383. </li><li>Increase volume by 20dB using fast lookahead limiter from Steve Harris
  33384. <code class="code">SWH Plugins</code> collection:
  33385. <div class="example">
  33386. <pre class="example-preformatted">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  33387. </pre></div>
  33388. </li><li>Attenuate low frequencies using Multiband EQ from Steve Harris
  33389. <code class="code">SWH Plugins</code> collection:
  33390. <div class="example">
  33391. <pre class="example-preformatted">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  33392. </pre></div>
  33393. </li><li>Reduce stereo image using <code class="code">Narrower</code> from the <code class="code">C* Audio Plugin Suite</code>
  33394. (CAPS) library:
  33395. <div class="example">
  33396. <pre class="example-preformatted">ladspa=caps:Narrower
  33397. </pre></div>
  33398. </li><li>Another white noise, now using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  33399. <div class="example">
  33400. <pre class="example-preformatted">ladspa=caps:White:.2
  33401. </pre></div>
  33402. </li><li>Some fractal noise, using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  33403. <div class="example">
  33404. <pre class="example-preformatted">ladspa=caps:Fractal:c=c1=1
  33405. </pre></div>
  33406. </li><li>Dynamic volume normalization using <code class="code">VLevel</code> plugin:
  33407. <div class="example">
  33408. <pre class="example-preformatted">ladspa=vlevel-ladspa:vlevel_mono
  33409. </pre></div>
  33410. </li></ul>
  33411. <a name="Commands-41"></a>
  33412. <h4 class="subsection">36.96.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-41" aria-hidden="true">TOC</a></span></h4>
  33413. <p>This filter supports the following commands:
  33414. </p><dl class="table">
  33415. <dt><samp class="option">cN</samp></dt>
  33416. <dd><p>Modify the <var class="var">N</var>-th control value.
  33417. </p>
  33418. <p>If the specified value is not valid, it is ignored and prior one is kept.
  33419. </p></dd>
  33420. </dl>
  33421. <a name="loudnorm"></a>
  33422. <h3 class="section">36.97 loudnorm<span class="pull-right"><a class="anchor hidden-xs" href="#loudnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-loudnorm" aria-hidden="true">TOC</a></span></h3>
  33423. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  33424. Support for both single pass (livestreams, files) and double pass (files) modes.
  33425. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  33426. detect true peaks, the audio stream will be upsampled to 192 kHz.
  33427. Use the <code class="code">-ar</code> option or <code class="code">aresample</code> filter to explicitly set an output sample rate.
  33428. </p>
  33429. <p>The filter accepts the following options:
  33430. </p>
  33431. <dl class="table">
  33432. <dt><samp class="option">I, i</samp></dt>
  33433. <dd><p>Set integrated loudness target.
  33434. Range is -70.0 - -5.0. Default value is -24.0.
  33435. </p>
  33436. </dd>
  33437. <dt><samp class="option">LRA, lra</samp></dt>
  33438. <dd><p>Set loudness range target.
  33439. Range is 1.0 - 50.0. Default value is 7.0.
  33440. </p>
  33441. </dd>
  33442. <dt><samp class="option">TP, tp</samp></dt>
  33443. <dd><p>Set maximum true peak.
  33444. Range is -9.0 - +0.0. Default value is -2.0.
  33445. </p>
  33446. </dd>
  33447. <dt><samp class="option">measured_I, measured_i</samp></dt>
  33448. <dd><p>Measured IL of input file.
  33449. Range is -99.0 - +0.0.
  33450. </p>
  33451. </dd>
  33452. <dt><samp class="option">measured_LRA, measured_lra</samp></dt>
  33453. <dd><p>Measured LRA of input file.
  33454. Range is 0.0 - 99.0.
  33455. </p>
  33456. </dd>
  33457. <dt><samp class="option">measured_TP, measured_tp</samp></dt>
  33458. <dd><p>Measured true peak of input file.
  33459. Range is -99.0 - +99.0.
  33460. </p>
  33461. </dd>
  33462. <dt><samp class="option">measured_thresh</samp></dt>
  33463. <dd><p>Measured threshold of input file.
  33464. Range is -99.0 - +0.0.
  33465. </p>
  33466. </dd>
  33467. <dt><samp class="option">offset</samp></dt>
  33468. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  33469. Range is -99.0 - +99.0. Default is +0.0.
  33470. </p>
  33471. </dd>
  33472. <dt><samp class="option">linear</samp></dt>
  33473. <dd><p>Normalize by linearly scaling the source audio.
  33474. <code class="code">measured_I</code>, <code class="code">measured_LRA</code>, <code class="code">measured_TP</code>,
  33475. and <code class="code">measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  33476. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  33477. result in a true peak which exceeds the target TP. If any of these
  33478. conditions aren&rsquo;t met, normalization mode will revert to <var class="var">dynamic</var>.
  33479. Options are <code class="code">true</code> or <code class="code">false</code>. Default is <code class="code">true</code>.
  33480. </p>
  33481. </dd>
  33482. <dt><samp class="option">dual_mono</samp></dt>
  33483. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  33484. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  33485. If set to <code class="code">true</code>, this option will compensate for this effect.
  33486. Multi-channel input files are not affected by this option.
  33487. Options are true or false. Default is false.
  33488. </p>
  33489. </dd>
  33490. <dt><samp class="option">print_format</samp></dt>
  33491. <dd><p>Set print format for stats. Options are summary, json, or none.
  33492. Default value is none.
  33493. </p></dd>
  33494. </dl>
  33495. <a name="lowpass"></a>
  33496. <h3 class="section">36.98 lowpass<span class="pull-right"><a class="anchor hidden-xs" href="#lowpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lowpass" aria-hidden="true">TOC</a></span></h3>
  33497. <p>Apply a low-pass filter with 3dB point frequency.
  33498. The filter can be either single-pole or double-pole (the default).
  33499. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  33500. </p>
  33501. <p>The filter accepts the following options:
  33502. </p>
  33503. <dl class="table">
  33504. <dt><samp class="option">frequency, f</samp></dt>
  33505. <dd><p>Set frequency in Hz. Default is 500.
  33506. </p>
  33507. </dd>
  33508. <dt><samp class="option">poles, p</samp></dt>
  33509. <dd><p>Set number of poles. Default is 2.
  33510. </p>
  33511. </dd>
  33512. <dt><samp class="option">width_type, t</samp></dt>
  33513. <dd><p>Set method to specify band-width of filter.
  33514. </p><dl class="table">
  33515. <dt><samp class="option">h</samp></dt>
  33516. <dd><p>Hz
  33517. </p></dd>
  33518. <dt><samp class="option">q</samp></dt>
  33519. <dd><p>Q-Factor
  33520. </p></dd>
  33521. <dt><samp class="option">o</samp></dt>
  33522. <dd><p>octave
  33523. </p></dd>
  33524. <dt><samp class="option">s</samp></dt>
  33525. <dd><p>slope
  33526. </p></dd>
  33527. <dt><samp class="option">k</samp></dt>
  33528. <dd><p>kHz
  33529. </p></dd>
  33530. </dl>
  33531. </dd>
  33532. <dt><samp class="option">width, w</samp></dt>
  33533. <dd><p>Specify the band-width of a filter in width_type units.
  33534. Applies only to double-pole filter.
  33535. The default is 0.707q and gives a Butterworth response.
  33536. </p>
  33537. </dd>
  33538. <dt><samp class="option">mix, m</samp></dt>
  33539. <dd><p>How much to use filtered signal in output. Default is 1.
  33540. Range is between 0 and 1.
  33541. </p>
  33542. </dd>
  33543. <dt><samp class="option">channels, c</samp></dt>
  33544. <dd><p>Specify which channels to filter, by default all available are filtered.
  33545. </p>
  33546. </dd>
  33547. <dt><samp class="option">normalize, n</samp></dt>
  33548. <dd><p>Normalize biquad coefficients, by default is disabled.
  33549. Enabling it will normalize magnitude response at DC to 0dB.
  33550. </p>
  33551. </dd>
  33552. <dt><samp class="option">transform, a</samp></dt>
  33553. <dd><p>Set transform type of IIR filter.
  33554. </p><dl class="table">
  33555. <dt><samp class="option">di</samp></dt>
  33556. <dt><samp class="option">dii</samp></dt>
  33557. <dt><samp class="option">tdi</samp></dt>
  33558. <dt><samp class="option">tdii</samp></dt>
  33559. <dt><samp class="option">latt</samp></dt>
  33560. <dt><samp class="option">svf</samp></dt>
  33561. <dt><samp class="option">zdf</samp></dt>
  33562. </dl>
  33563. </dd>
  33564. <dt><samp class="option">precision, r</samp></dt>
  33565. <dd><p>Set precision of filtering.
  33566. </p><dl class="table">
  33567. <dt><samp class="option">auto</samp></dt>
  33568. <dd><p>Pick automatic sample format depending on surround filters.
  33569. </p></dd>
  33570. <dt><samp class="option">s16</samp></dt>
  33571. <dd><p>Always use signed 16-bit.
  33572. </p></dd>
  33573. <dt><samp class="option">s32</samp></dt>
  33574. <dd><p>Always use signed 32-bit.
  33575. </p></dd>
  33576. <dt><samp class="option">f32</samp></dt>
  33577. <dd><p>Always use float 32-bit.
  33578. </p></dd>
  33579. <dt><samp class="option">f64</samp></dt>
  33580. <dd><p>Always use float 64-bit.
  33581. </p></dd>
  33582. </dl>
  33583. </dd>
  33584. <dt><samp class="option">block_size, b</samp></dt>
  33585. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  33586. value (higher than impulse response length truncated when reaches near zero values) filtering
  33587. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  33588. </p>
  33589. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  33590. </p></dd>
  33591. </dl>
  33592. <a name="Examples-73"></a>
  33593. <h4 class="subsection">36.98.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-73" aria-hidden="true">TOC</a></span></h4>
  33594. <ul class="itemize mark-bullet">
  33595. <li>Lowpass only LFE channel, it LFE is not present it does nothing:
  33596. <div class="example">
  33597. <pre class="example-preformatted">lowpass=c=LFE
  33598. </pre></div>
  33599. </li></ul>
  33600. <a name="Commands-42"></a>
  33601. <h4 class="subsection">36.98.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-42" aria-hidden="true">TOC</a></span></h4>
  33602. <p>This filter supports the following commands:
  33603. </p><dl class="table">
  33604. <dt><samp class="option">frequency, f</samp></dt>
  33605. <dd><p>Change lowpass frequency.
  33606. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  33607. </p>
  33608. </dd>
  33609. <dt><samp class="option">width_type, t</samp></dt>
  33610. <dd><p>Change lowpass width_type.
  33611. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  33612. </p>
  33613. </dd>
  33614. <dt><samp class="option">width, w</samp></dt>
  33615. <dd><p>Change lowpass width.
  33616. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  33617. </p>
  33618. </dd>
  33619. <dt><samp class="option">mix, m</samp></dt>
  33620. <dd><p>Change lowpass mix.
  33621. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  33622. </p></dd>
  33623. </dl>
  33624. <a name="lv2"></a>
  33625. <h3 class="section">36.99 lv2<span class="pull-right"><a class="anchor hidden-xs" href="#lv2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lv2" aria-hidden="true">TOC</a></span></h3>
  33626. <p>Load a LV2 (LADSPA Version 2) plugin.
  33627. </p>
  33628. <p>To enable compilation of this filter you need to configure FFmpeg with
  33629. <code class="code">--enable-lv2</code>.
  33630. </p>
  33631. <dl class="table">
  33632. <dt><samp class="option">plugin, p</samp></dt>
  33633. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  33634. </p>
  33635. </dd>
  33636. <dt><samp class="option">controls, c</samp></dt>
  33637. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  33638. values that determine the behavior of the loaded plugin (for example delay,
  33639. threshold or gain).
  33640. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  33641. their valid ranges are printed.
  33642. </p>
  33643. </dd>
  33644. <dt><samp class="option">sample_rate, s</samp></dt>
  33645. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  33646. zero inputs.
  33647. </p>
  33648. </dd>
  33649. <dt><samp class="option">nb_samples, n</samp></dt>
  33650. <dd><p>Set the number of samples per channel per each output frame, default
  33651. is 1024. Only used if plugin have zero inputs.
  33652. </p>
  33653. </dd>
  33654. <dt><samp class="option">duration, d</samp></dt>
  33655. <dd><p>Set the minimum duration of the sourced audio. See
  33656. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  33657. for the accepted syntax.
  33658. Note that the resulting duration may be greater than the specified duration,
  33659. as the generated audio is always cut at the end of a complete frame.
  33660. If not specified, or the expressed duration is negative, the audio is
  33661. supposed to be generated forever.
  33662. Only used if plugin have zero inputs.
  33663. </p></dd>
  33664. </dl>
  33665. <a name="Examples-74"></a>
  33666. <h4 class="subsection">36.99.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-74" aria-hidden="true">TOC</a></span></h4>
  33667. <ul class="itemize mark-bullet">
  33668. <li>Apply bass enhancer plugin from Calf:
  33669. <div class="example">
  33670. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  33671. </pre></div>
  33672. </li><li>Apply vinyl plugin from Calf:
  33673. <div class="example">
  33674. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  33675. </pre></div>
  33676. </li><li>Apply bit crusher plugin from ArtyFX:
  33677. <div class="example">
  33678. <pre class="example-preformatted">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  33679. </pre></div>
  33680. </li></ul>
  33681. <a name="Commands-43"></a>
  33682. <h4 class="subsection">36.99.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-43" aria-hidden="true">TOC</a></span></h4>
  33683. <p>This filter supports all options that are exported by plugin as commands.
  33684. </p>
  33685. <a name="mcompand"></a>
  33686. <h3 class="section">36.100 mcompand<span class="pull-right"><a class="anchor hidden-xs" href="#mcompand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcompand" aria-hidden="true">TOC</a></span></h3>
  33687. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  33688. </p>
  33689. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  33690. This is akin to the crossover of a loudspeaker, and results in flat frequency
  33691. response when absent compander action.
  33692. </p>
  33693. <p>It accepts the following parameters:
  33694. </p>
  33695. <dl class="table">
  33696. <dt><samp class="option">args</samp></dt>
  33697. <dd><p>This option syntax is:
  33698. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  33699. For explanation of each item refer to compand filter documentation.
  33700. </p></dd>
  33701. </dl>
  33702. <a class="anchor" id="pan"></a><a name="pan-1"></a>
  33703. <h3 class="section">36.101 pan<span class="pull-right"><a class="anchor hidden-xs" href="#pan-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pan-1" aria-hidden="true">TOC</a></span></h3>
  33704. <p>Mix channels with specific gain levels. The filter accepts the output
  33705. channel layout followed by a set of channels definitions.
  33706. </p>
  33707. <p>This filter is also designed to efficiently remap the channels of an audio
  33708. stream.
  33709. </p>
  33710. <p>The filter accepts parameters of the form:
  33711. &quot;<var class="var">l</var>|<var class="var">outdef</var>|<var class="var">outdef</var>|...&quot;
  33712. </p>
  33713. <dl class="table">
  33714. <dt><samp class="option">l</samp></dt>
  33715. <dd><p>output channel layout or number of channels
  33716. </p>
  33717. </dd>
  33718. <dt><samp class="option">outdef</samp></dt>
  33719. <dd><p>output channel specification, of the form:
  33720. &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;
  33721. </p>
  33722. </dd>
  33723. <dt><samp class="option">out_name</samp></dt>
  33724. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  33725. number (c0, c1, etc.)
  33726. </p>
  33727. </dd>
  33728. <dt><samp class="option">gain</samp></dt>
  33729. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  33730. </p>
  33731. </dd>
  33732. <dt><samp class="option">in_name</samp></dt>
  33733. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  33734. named and numbered input channels
  33735. </p></dd>
  33736. </dl>
  33737. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  33738. that specification will be renormalized so that the total is 1, thus
  33739. avoiding clipping noise.
  33740. </p>
  33741. <a name="Mixing-examples"></a>
  33742. <h4 class="subsection">36.101.1 Mixing examples<span class="pull-right"><a class="anchor hidden-xs" href="#Mixing-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Mixing-examples" aria-hidden="true">TOC</a></span></h4>
  33743. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  33744. factor for the left channel:
  33745. </p><div class="example">
  33746. <pre class="example-preformatted">pan=1c|c0=0.9*c0+0.1*c1
  33747. </pre></div>
  33748. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  33749. 7-channels surround:
  33750. </p><div class="example">
  33751. <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
  33752. </pre></div>
  33753. <p>Note that <code class="command">ffmpeg</code> integrates a default down-mix (and up-mix) system
  33754. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  33755. needs.
  33756. </p>
  33757. <a name="Remapping-examples"></a>
  33758. <h4 class="subsection">36.101.2 Remapping examples<span class="pull-right"><a class="anchor hidden-xs" href="#Remapping-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Remapping-examples" aria-hidden="true">TOC</a></span></h4>
  33759. <p>The channel remapping will be effective if, and only if:
  33760. </p>
  33761. <ul class="itemize mark-bullet">
  33762. <li>gain coefficients are zeroes or ones,
  33763. </li><li>only one input per channel output,
  33764. </li></ul>
  33765. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  33766. channel mapping detected&quot;), and use an optimized and lossless method to do the
  33767. remapping.
  33768. </p>
  33769. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  33770. dropping the extra channels:
  33771. </p><div class="example">
  33772. <pre class="example-preformatted">pan=&quot;stereo| c0=FL | c1=FR&quot;
  33773. </pre></div>
  33774. <p>Given the same source, you can also switch front left and front right channels
  33775. and keep the input channel layout:
  33776. </p><div class="example">
  33777. <pre class="example-preformatted">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  33778. </pre></div>
  33779. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  33780. still keep the stereo channel layout) with:
  33781. </p><div class="example">
  33782. <pre class="example-preformatted">pan=&quot;stereo|c1=c1&quot;
  33783. </pre></div>
  33784. <p>Still with a stereo audio stream input, you can copy the right channel in both
  33785. front left and right:
  33786. </p><div class="example">
  33787. <pre class="example-preformatted">pan=&quot;stereo| c0=FR | c1=FR&quot;
  33788. </pre></div>
  33789. <a name="replaygain"></a>
  33790. <h3 class="section">36.102 replaygain<span class="pull-right"><a class="anchor hidden-xs" href="#replaygain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-replaygain" aria-hidden="true">TOC</a></span></h3>
  33791. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  33792. outputs it unchanged.
  33793. At end of filtering it displays <code class="code">track_gain</code> and <code class="code">track_peak</code>.
  33794. </p>
  33795. <p>The filter accepts the following exported read-only options:
  33796. </p>
  33797. <dl class="table">
  33798. <dt><samp class="option">track_gain</samp></dt>
  33799. <dd><p>Exported track gain in dB at end of stream.
  33800. </p>
  33801. </dd>
  33802. <dt><samp class="option">track_peak</samp></dt>
  33803. <dd><p>Exported track peak at end of stream.
  33804. </p></dd>
  33805. </dl>
  33806. <a name="resample"></a>
  33807. <h3 class="section">36.103 resample<span class="pull-right"><a class="anchor hidden-xs" href="#resample" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-resample" aria-hidden="true">TOC</a></span></h3>
  33808. <p>Convert the audio sample format, sample rate and channel layout. It is
  33809. not meant to be used directly.
  33810. </p>
  33811. <a name="rubberband"></a>
  33812. <h3 class="section">36.104 rubberband<span class="pull-right"><a class="anchor hidden-xs" href="#rubberband" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rubberband" aria-hidden="true">TOC</a></span></h3>
  33813. <p>Apply time-stretching and pitch-shifting with librubberband.
  33814. </p>
  33815. <p>To enable compilation of this filter, you need to configure FFmpeg with
  33816. <code class="code">--enable-librubberband</code>.
  33817. </p>
  33818. <p>The filter accepts the following options:
  33819. </p>
  33820. <dl class="table">
  33821. <dt><samp class="option">tempo</samp></dt>
  33822. <dd><p>Set tempo scale factor.
  33823. </p>
  33824. </dd>
  33825. <dt><samp class="option">pitch</samp></dt>
  33826. <dd><p>Set pitch scale factor.
  33827. </p>
  33828. </dd>
  33829. <dt><samp class="option">transients</samp></dt>
  33830. <dd><p>Set transients detector.
  33831. Possible values are:
  33832. </p><dl class="table">
  33833. <dt><var class="var">crisp</var></dt>
  33834. <dt><var class="var">mixed</var></dt>
  33835. <dt><var class="var">smooth</var></dt>
  33836. </dl>
  33837. </dd>
  33838. <dt><samp class="option">detector</samp></dt>
  33839. <dd><p>Set detector.
  33840. Possible values are:
  33841. </p><dl class="table">
  33842. <dt><var class="var">compound</var></dt>
  33843. <dt><var class="var">percussive</var></dt>
  33844. <dt><var class="var">soft</var></dt>
  33845. </dl>
  33846. </dd>
  33847. <dt><samp class="option">phase</samp></dt>
  33848. <dd><p>Set phase.
  33849. Possible values are:
  33850. </p><dl class="table">
  33851. <dt><var class="var">laminar</var></dt>
  33852. <dt><var class="var">independent</var></dt>
  33853. </dl>
  33854. </dd>
  33855. <dt><samp class="option">window</samp></dt>
  33856. <dd><p>Set processing window size.
  33857. Possible values are:
  33858. </p><dl class="table">
  33859. <dt><var class="var">standard</var></dt>
  33860. <dt><var class="var">short</var></dt>
  33861. <dt><var class="var">long</var></dt>
  33862. </dl>
  33863. </dd>
  33864. <dt><samp class="option">smoothing</samp></dt>
  33865. <dd><p>Set smoothing.
  33866. Possible values are:
  33867. </p><dl class="table">
  33868. <dt><var class="var">off</var></dt>
  33869. <dt><var class="var">on</var></dt>
  33870. </dl>
  33871. </dd>
  33872. <dt><samp class="option">formant</samp></dt>
  33873. <dd><p>Enable formant preservation when shift pitching.
  33874. Possible values are:
  33875. </p><dl class="table">
  33876. <dt><var class="var">shifted</var></dt>
  33877. <dt><var class="var">preserved</var></dt>
  33878. </dl>
  33879. </dd>
  33880. <dt><samp class="option">pitchq</samp></dt>
  33881. <dd><p>Set pitch quality.
  33882. Possible values are:
  33883. </p><dl class="table">
  33884. <dt><var class="var">quality</var></dt>
  33885. <dt><var class="var">speed</var></dt>
  33886. <dt><var class="var">consistency</var></dt>
  33887. </dl>
  33888. </dd>
  33889. <dt><samp class="option">channels</samp></dt>
  33890. <dd><p>Set channels.
  33891. Possible values are:
  33892. </p><dl class="table">
  33893. <dt><var class="var">apart</var></dt>
  33894. <dt><var class="var">together</var></dt>
  33895. </dl>
  33896. </dd>
  33897. </dl>
  33898. <a name="Commands-44"></a>
  33899. <h4 class="subsection">36.104.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-44" aria-hidden="true">TOC</a></span></h4>
  33900. <p>This filter supports the following commands:
  33901. </p><dl class="table">
  33902. <dt><samp class="option">tempo</samp></dt>
  33903. <dd><p>Change filter tempo scale factor.
  33904. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  33905. </p>
  33906. </dd>
  33907. <dt><samp class="option">pitch</samp></dt>
  33908. <dd><p>Change filter pitch scale factor.
  33909. Syntax for the command is : &quot;<var class="var">pitch</var>&quot;
  33910. </p></dd>
  33911. </dl>
  33912. <a name="sidechaincompress"></a>
  33913. <h3 class="section">36.105 sidechaincompress<span class="pull-right"><a class="anchor hidden-xs" href="#sidechaincompress" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidechaincompress" aria-hidden="true">TOC</a></span></h3>
  33914. <p>This filter acts like normal compressor but has the ability to compress
  33915. detected signal using second input signal.
  33916. It needs two input streams and returns one output stream.
  33917. First input stream will be processed depending on second stream signal.
  33918. The filtered signal then can be filtered with other filters in later stages of
  33919. processing. See <a class="ref" href="#pan">pan</a> and <a class="ref" href="#amerge">amerge</a> filter.
  33920. </p>
  33921. <p>The filter accepts the following options:
  33922. </p>
  33923. <dl class="table">
  33924. <dt><samp class="option">level_in</samp></dt>
  33925. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  33926. </p>
  33927. </dd>
  33928. <dt><samp class="option">mode</samp></dt>
  33929. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  33930. Default is <code class="code">downward</code>.
  33931. </p>
  33932. </dd>
  33933. <dt><samp class="option">threshold</samp></dt>
  33934. <dd><p>If a signal of second stream raises above this level it will affect the gain
  33935. reduction of first stream.
  33936. By default is 0.125. Range is between 0.00097563 and 1.
  33937. </p>
  33938. </dd>
  33939. <dt><samp class="option">ratio</samp></dt>
  33940. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  33941. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  33942. Default is 2. Range is between 1 and 20.
  33943. </p>
  33944. </dd>
  33945. <dt><samp class="option">attack</samp></dt>
  33946. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  33947. reduction starts. Default is 20. Range is between 0.01 and 2000.
  33948. </p>
  33949. </dd>
  33950. <dt><samp class="option">release</samp></dt>
  33951. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  33952. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  33953. </p>
  33954. </dd>
  33955. <dt><samp class="option">makeup</samp></dt>
  33956. <dd><p>Set the amount by how much signal will be amplified after processing.
  33957. Default is 1. Range is from 1 to 64.
  33958. </p>
  33959. </dd>
  33960. <dt><samp class="option">knee</samp></dt>
  33961. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  33962. Default is 2.82843. Range is between 1 and 8.
  33963. </p>
  33964. </dd>
  33965. <dt><samp class="option">link</samp></dt>
  33966. <dd><p>Choose if the <code class="code">average</code> level between all channels of side-chain stream
  33967. or the louder(<code class="code">maximum</code>) channel of side-chain stream affects the
  33968. reduction. Default is <code class="code">average</code>.
  33969. </p>
  33970. </dd>
  33971. <dt><samp class="option">detection</samp></dt>
  33972. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  33973. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mainly smoother.
  33974. </p>
  33975. </dd>
  33976. <dt><samp class="option">level_sc</samp></dt>
  33977. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  33978. </p>
  33979. </dd>
  33980. <dt><samp class="option">mix</samp></dt>
  33981. <dd><p>How much to use compressed signal in output. Default is 1.
  33982. Range is between 0 and 1.
  33983. </p></dd>
  33984. </dl>
  33985. <a name="Commands-45"></a>
  33986. <h4 class="subsection">36.105.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-45" aria-hidden="true">TOC</a></span></h4>
  33987. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  33988. </p>
  33989. <a name="Examples-75"></a>
  33990. <h4 class="subsection">36.105.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-75" aria-hidden="true">TOC</a></span></h4>
  33991. <ul class="itemize mark-bullet">
  33992. <li>Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  33993. depending on the signal of 2nd input and later compressed signal to be
  33994. merged with 2nd input:
  33995. <div class="example">
  33996. <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;
  33997. </pre></div>
  33998. </li></ul>
  33999. <a name="sidechaingate"></a>
  34000. <h3 class="section">36.106 sidechaingate<span class="pull-right"><a class="anchor hidden-xs" href="#sidechaingate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidechaingate" aria-hidden="true">TOC</a></span></h3>
  34001. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  34002. filter the detected signal before sending it to the gain reduction stage.
  34003. Normally a gate uses the full range signal to detect a level above the
  34004. threshold.
  34005. For example: If you cut all lower frequencies from your sidechain signal
  34006. the gate will decrease the volume of your track only if not enough highs
  34007. appear. With this technique you are able to reduce the resonation of a
  34008. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  34009. guitar.
  34010. It needs two input streams and returns one output stream.
  34011. First input stream will be processed depending on second stream signal.
  34012. </p>
  34013. <p>The filter accepts the following options:
  34014. </p>
  34015. <dl class="table">
  34016. <dt><samp class="option">level_in</samp></dt>
  34017. <dd><p>Set input level before filtering.
  34018. Default is 1. Allowed range is from 0.015625 to 64.
  34019. </p>
  34020. </dd>
  34021. <dt><samp class="option">mode</samp></dt>
  34022. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  34023. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  34024. will be amplified, expanding dynamic range in upward direction.
  34025. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  34026. </p>
  34027. </dd>
  34028. <dt><samp class="option">range</samp></dt>
  34029. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  34030. Default is 0.06125. Allowed range is from 0 to 1.
  34031. Setting this to 0 disables reduction and then filter behaves like expander.
  34032. </p>
  34033. </dd>
  34034. <dt><samp class="option">threshold</samp></dt>
  34035. <dd><p>If a signal rises above this level the gain reduction is released.
  34036. Default is 0.125. Allowed range is from 0 to 1.
  34037. </p>
  34038. </dd>
  34039. <dt><samp class="option">ratio</samp></dt>
  34040. <dd><p>Set a ratio about which the signal is reduced.
  34041. Default is 2. Allowed range is from 1 to 9000.
  34042. </p>
  34043. </dd>
  34044. <dt><samp class="option">attack</samp></dt>
  34045. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  34046. reduction stops.
  34047. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  34048. </p>
  34049. </dd>
  34050. <dt><samp class="option">release</samp></dt>
  34051. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  34052. reduction is increased again. Default is 250 milliseconds.
  34053. Allowed range is from 0.01 to 9000.
  34054. </p>
  34055. </dd>
  34056. <dt><samp class="option">makeup</samp></dt>
  34057. <dd><p>Set amount of amplification of signal after processing.
  34058. Default is 1. Allowed range is from 1 to 64.
  34059. </p>
  34060. </dd>
  34061. <dt><samp class="option">knee</samp></dt>
  34062. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  34063. Default is 2.828427125. Allowed range is from 1 to 8.
  34064. </p>
  34065. </dd>
  34066. <dt><samp class="option">detection</samp></dt>
  34067. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  34068. Default is rms. Can be peak or rms.
  34069. </p>
  34070. </dd>
  34071. <dt><samp class="option">link</samp></dt>
  34072. <dd><p>Choose if the average level between all channels or the louder channel affects
  34073. the reduction.
  34074. Default is average. Can be average or maximum.
  34075. </p>
  34076. </dd>
  34077. <dt><samp class="option">level_sc</samp></dt>
  34078. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  34079. </p></dd>
  34080. </dl>
  34081. <a name="Commands-46"></a>
  34082. <h4 class="subsection">36.106.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-46" aria-hidden="true">TOC</a></span></h4>
  34083. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34084. </p>
  34085. <a name="silencedetect"></a>
  34086. <h3 class="section">36.107 silencedetect<span class="pull-right"><a class="anchor hidden-xs" href="#silencedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silencedetect" aria-hidden="true">TOC</a></span></h3>
  34087. <p>Detect silence in an audio stream.
  34088. </p>
  34089. <p>This filter logs a message when it detects that the input audio volume is less
  34090. or equal to a noise tolerance value for a duration greater or equal to the
  34091. minimum detected noise duration.
  34092. </p>
  34093. <p>The printed times and duration are expressed in seconds. The
  34094. <code class="code">lavfi.silence_start</code> or <code class="code">lavfi.silence_start.X</code> metadata key
  34095. is set on the first frame whose timestamp equals or exceeds the detection
  34096. duration and it contains the timestamp of the first frame of the silence.
  34097. </p>
  34098. <p>The <code class="code">lavfi.silence_duration</code> or <code class="code">lavfi.silence_duration.X</code>
  34099. and <code class="code">lavfi.silence_end</code> or <code class="code">lavfi.silence_end.X</code> metadata
  34100. keys are set on the first frame after the silence. If <samp class="option">mono</samp> is
  34101. enabled, and each channel is evaluated separately, the <code class="code">.X</code>
  34102. suffixed keys are used, and <code class="code">X</code> corresponds to the channel number.
  34103. </p>
  34104. <p>The filter accepts the following options:
  34105. </p>
  34106. <dl class="table">
  34107. <dt><samp class="option">noise, n</samp></dt>
  34108. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  34109. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  34110. </p>
  34111. </dd>
  34112. <dt><samp class="option">duration, d</samp></dt>
  34113. <dd><p>Set silence duration until notification (default is 2 seconds). See
  34114. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  34115. for the accepted syntax.
  34116. </p>
  34117. </dd>
  34118. <dt><samp class="option">mono, m</samp></dt>
  34119. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  34120. </p></dd>
  34121. </dl>
  34122. <a name="Examples-76"></a>
  34123. <h4 class="subsection">36.107.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-76" aria-hidden="true">TOC</a></span></h4>
  34124. <ul class="itemize mark-bullet">
  34125. <li>Detect 5 seconds of silence with -50dB noise tolerance:
  34126. <div class="example">
  34127. <pre class="example-preformatted">silencedetect=n=-50dB:d=5
  34128. </pre></div>
  34129. </li><li>Complete example with <code class="command">ffmpeg</code> to detect silence with 0.0001 noise
  34130. tolerance in <samp class="file">silence.mp3</samp>:
  34131. <div class="example">
  34132. <pre class="example-preformatted">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  34133. </pre></div>
  34134. </li></ul>
  34135. <a name="silenceremove"></a>
  34136. <h3 class="section">36.108 silenceremove<span class="pull-right"><a class="anchor hidden-xs" href="#silenceremove" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silenceremove" aria-hidden="true">TOC</a></span></h3>
  34137. <p>Remove silence from the beginning, middle or end of the audio.
  34138. </p>
  34139. <p>The filter accepts the following options:
  34140. </p>
  34141. <dl class="table">
  34142. <dt><samp class="option">start_periods</samp></dt>
  34143. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  34144. the audio. A value of zero indicates no silence should be trimmed from the
  34145. beginning. When specifying a non-zero value, it trims audio up until it
  34146. finds non-silence. Normally, when trimming silence from beginning of audio
  34147. the <var class="var">start_periods</var> will be <code class="code">1</code> but it can be increased to higher
  34148. values to trim all audio up to specific count of non-silence periods.
  34149. Default value is <code class="code">0</code>.
  34150. </p>
  34151. </dd>
  34152. <dt><samp class="option">start_duration</samp></dt>
  34153. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  34154. trimming audio. By increasing the duration, bursts of noises can be treated
  34155. as silence and trimmed off. Default value is <code class="code">0</code>.
  34156. </p>
  34157. </dd>
  34158. <dt><samp class="option">start_threshold</samp></dt>
  34159. <dd><p>This indicates what sample value should be treated as silence. For digital
  34160. audio, a value of <code class="code">0</code> may be fine but for audio recorded from analog,
  34161. you may wish to increase the value to account for background noise.
  34162. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  34163. or amplitude ratio. Default value is <code class="code">0</code>.
  34164. </p>
  34165. </dd>
  34166. <dt><samp class="option">start_silence</samp></dt>
  34167. <dd><p>Specify max duration of silence at beginning that will be kept after
  34168. trimming. Default is 0, which is equal to trimming all samples detected
  34169. as silence.
  34170. </p>
  34171. </dd>
  34172. <dt><samp class="option">start_mode</samp></dt>
  34173. <dd><p>Specify mode of detection of silence end at start of multi-channel audio.
  34174. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">any</var>.
  34175. With <var class="var">any</var>, any sample from any channel that is detected as non-silence
  34176. will trigger end of silence trimming at start of audio stream.
  34177. With <var class="var">all</var>, only if every sample from every channel is detected as non-silence
  34178. will trigger end of silence trimming at start of audio stream, limited usage.
  34179. </p>
  34180. </dd>
  34181. <dt><samp class="option">stop_periods</samp></dt>
  34182. <dd><p>Set the count for trimming silence from the end of audio. When specifying a
  34183. positive value, it trims audio after it finds specified silence period.
  34184. To remove silence from the middle of a file, specify a <var class="var">stop_periods</var>
  34185. that is negative. This value is then treated as a positive value and is
  34186. used to indicate the effect should restart processing as specified by
  34187. <var class="var">stop_periods</var>, making it suitable for removing periods of silence
  34188. in the middle of the audio.
  34189. Default value is <code class="code">0</code>.
  34190. </p>
  34191. </dd>
  34192. <dt><samp class="option">stop_duration</samp></dt>
  34193. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  34194. more. By specifying a higher duration, silence that is wanted can be left in
  34195. the audio.
  34196. Default value is <code class="code">0</code>.
  34197. </p>
  34198. </dd>
  34199. <dt><samp class="option">stop_threshold</samp></dt>
  34200. <dd><p>This is the same as <samp class="option">start_threshold</samp> but for trimming silence from
  34201. the end of audio.
  34202. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  34203. or amplitude ratio. Default value is <code class="code">0</code>.
  34204. </p>
  34205. </dd>
  34206. <dt><samp class="option">stop_silence</samp></dt>
  34207. <dd><p>Specify max duration of silence at end that will be kept after
  34208. trimming. Default is 0, which is equal to trimming all samples detected
  34209. as silence.
  34210. </p>
  34211. </dd>
  34212. <dt><samp class="option">stop_mode</samp></dt>
  34213. <dd><p>Specify mode of detection of silence start after start of multi-channel audio.
  34214. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  34215. With <var class="var">any</var>, any sample from any channel that is detected as silence
  34216. will trigger start of silence trimming after start of audio stream, limited usage.
  34217. With <var class="var">all</var>, only if every sample from every channel is detected as silence
  34218. will trigger start of silence trimming after start of audio stream.
  34219. </p>
  34220. </dd>
  34221. <dt><samp class="option">detection</samp></dt>
  34222. <dd><p>Set how is silence detected.
  34223. </p><dl class="table">
  34224. <dt><samp class="option">avg</samp></dt>
  34225. <dd><p>Mean of absolute values of samples in moving window.
  34226. </p></dd>
  34227. <dt><samp class="option">rms</samp></dt>
  34228. <dd><p>Root squared mean of absolute values of samples in moving window.
  34229. </p></dd>
  34230. <dt><samp class="option">peak</samp></dt>
  34231. <dd><p>Maximum of absolute values of samples in moving window.
  34232. </p></dd>
  34233. <dt><samp class="option">median</samp></dt>
  34234. <dd><p>Median of absolute values of samples in moving window.
  34235. </p></dd>
  34236. <dt><samp class="option">ptp</samp></dt>
  34237. <dd><p>Absolute of max peak to min peak difference of samples in moving window.
  34238. </p></dd>
  34239. <dt><samp class="option">dev</samp></dt>
  34240. <dd><p>Standard deviation of values of samples in moving window.
  34241. </p></dd>
  34242. </dl>
  34243. <p>Default value is <code class="code">rms</code>.
  34244. </p>
  34245. </dd>
  34246. <dt><samp class="option">window</samp></dt>
  34247. <dd><p>Set duration in number of seconds used to calculate size of window in number
  34248. of samples for detecting silence. Using <code class="code">0</code> will effectively disable
  34249. any windowing and use only single sample per channel for silence detection.
  34250. In that case it may be needed to also set <samp class="option">start_silence</samp> and/or
  34251. <samp class="option">stop_silence</samp> to nonzero values with also <samp class="option">start_duration</samp> and/or
  34252. <samp class="option">stop_duration</samp> to nonzero values.
  34253. Default value is <code class="code">0.02</code>. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  34254. </p>
  34255. </dd>
  34256. <dt><samp class="option">timestamp</samp></dt>
  34257. <dd><p>Set processing mode of every audio frame output timestamp.
  34258. </p><dl class="table">
  34259. <dt><samp class="option">write</samp></dt>
  34260. <dd><p>Full timestamps rewrite, keep only the start time for the first output frame.
  34261. </p></dd>
  34262. <dt><samp class="option">copy</samp></dt>
  34263. <dd><p>Non-dropped frames are left with same timestamp as input audio frame.
  34264. </p></dd>
  34265. </dl>
  34266. <p>Defaults value is <code class="code">write</code>.
  34267. </p></dd>
  34268. </dl>
  34269. <a name="Examples-77"></a>
  34270. <h4 class="subsection">36.108.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-77" aria-hidden="true">TOC</a></span></h4>
  34271. <ul class="itemize mark-bullet">
  34272. <li>The following example shows how this filter can be used to start a recording
  34273. that does not contain the delay at the start which usually occurs between
  34274. pressing the record button and the start of the performance:
  34275. <div class="example">
  34276. <pre class="example-preformatted">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  34277. </pre></div>
  34278. </li><li>Trim all silence encountered from beginning to end where there is more than 1
  34279. second of silence in audio:
  34280. <div class="example">
  34281. <pre class="example-preformatted">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  34282. </pre></div>
  34283. </li><li>Trim all digital silence samples, using peak detection, from beginning to end
  34284. where there is more than 0 samples of digital silence in audio and digital
  34285. silence is detected in all channels at same positions in stream:
  34286. <div class="example">
  34287. <pre class="example-preformatted">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  34288. </pre></div>
  34289. </li><li>Trim every 2nd encountered silence period from beginning to end where there is
  34290. more than 1 second of silence per silence period in audio:
  34291. <div class="example">
  34292. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB
  34293. </pre></div>
  34294. </li><li>Similar as above, but keep maximum of 0.5 seconds of silence from each trimmed period:
  34295. <div class="example">
  34296. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5
  34297. </pre></div>
  34298. </li><li>Similar as above, but keep maximum of 1.5 seconds of silence from start of audio:
  34299. <div class="example">
  34300. <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
  34301. </pre></div>
  34302. </li></ul>
  34303. <a name="Commands-47"></a>
  34304. <h4 class="subsection">36.108.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-47" aria-hidden="true">TOC</a></span></h4>
  34305. <p>This filter supports some above options as <a class="ref" href="#commands">commands</a>.
  34306. </p>
  34307. <a name="sofalizer"></a>
  34308. <h3 class="section">36.109 sofalizer<span class="pull-right"><a class="anchor hidden-xs" href="#sofalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sofalizer" aria-hidden="true">TOC</a></span></h3>
  34309. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  34310. loudspeakers around the user for binaural listening via headphones (audio
  34311. formats up to 9 channels supported).
  34312. The HRTFs are stored in SOFA files (see <a class="url" href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  34313. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  34314. Austrian Academy of Sciences.
  34315. </p>
  34316. <p>To enable compilation of this filter you need to configure FFmpeg with
  34317. <code class="code">--enable-libmysofa</code>.
  34318. </p>
  34319. <p>The filter accepts the following options:
  34320. </p>
  34321. <dl class="table">
  34322. <dt><samp class="option">sofa</samp></dt>
  34323. <dd><p>Set the SOFA file used for rendering.
  34324. </p>
  34325. </dd>
  34326. <dt><samp class="option">gain</samp></dt>
  34327. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  34328. </p>
  34329. </dd>
  34330. <dt><samp class="option">rotation</samp></dt>
  34331. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  34332. </p>
  34333. </dd>
  34334. <dt><samp class="option">elevation</samp></dt>
  34335. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  34336. </p>
  34337. </dd>
  34338. <dt><samp class="option">radius</samp></dt>
  34339. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  34340. HRTFs. Default is 1.
  34341. </p>
  34342. </dd>
  34343. <dt><samp class="option">type</samp></dt>
  34344. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  34345. processing audio in time domain which is slow.
  34346. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  34347. Default is <var class="var">freq</var>.
  34348. </p>
  34349. </dd>
  34350. <dt><samp class="option">speakers</samp></dt>
  34351. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  34352. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  34353. Each virtual loudspeaker is described with short channel name following with
  34354. azimuth and elevation in degrees.
  34355. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  34356. For example to override front left and front right channel positions use:
  34357. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  34358. Descriptions with unrecognised channel names are ignored.
  34359. </p>
  34360. </dd>
  34361. <dt><samp class="option">lfegain</samp></dt>
  34362. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  34363. </p>
  34364. </dd>
  34365. <dt><samp class="option">framesize</samp></dt>
  34366. <dd><p>Set custom frame size in number of samples. Default is 1024.
  34367. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp class="samp">type</samp>&rsquo;
  34368. is set to <var class="var">freq</var>.
  34369. </p>
  34370. </dd>
  34371. <dt><samp class="option">normalize</samp></dt>
  34372. <dd><p>Should all IRs be normalized upon importing SOFA file.
  34373. By default is enabled.
  34374. </p>
  34375. </dd>
  34376. <dt><samp class="option">interpolate</samp></dt>
  34377. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  34378. does not match. By default is disabled.
  34379. </p>
  34380. </dd>
  34381. <dt><samp class="option">minphase</samp></dt>
  34382. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  34383. </p>
  34384. </dd>
  34385. <dt><samp class="option">anglestep</samp></dt>
  34386. <dd><p>Set neighbor search angle step. Only used if option <var class="var">interpolate</var> is enabled.
  34387. </p>
  34388. </dd>
  34389. <dt><samp class="option">radstep</samp></dt>
  34390. <dd><p>Set neighbor search radius step. Only used if option <var class="var">interpolate</var> is enabled.
  34391. </p></dd>
  34392. </dl>
  34393. <a name="Examples-78"></a>
  34394. <h4 class="subsection">36.109.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-78" aria-hidden="true">TOC</a></span></h4>
  34395. <ul class="itemize mark-bullet">
  34396. <li>Using ClubFritz6 sofa file:
  34397. <div class="example">
  34398. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  34399. </pre></div>
  34400. </li><li>Using ClubFritz12 sofa file and bigger radius with small rotation:
  34401. <div class="example">
  34402. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  34403. </pre></div>
  34404. </li><li>Similar as above but with custom speaker positions for front left, front right, back left and back right
  34405. and also with custom gain:
  34406. <div class="example">
  34407. <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;
  34408. </pre></div>
  34409. </li></ul>
  34410. <a name="speechnorm"></a>
  34411. <h3 class="section">36.110 speechnorm<span class="pull-right"><a class="anchor hidden-xs" href="#speechnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-speechnorm" aria-hidden="true">TOC</a></span></h3>
  34412. <p>Speech Normalizer.
  34413. </p>
  34414. <p>This filter expands or compresses each half-cycle of audio samples
  34415. (local set of samples all above or all below zero and between two nearest zero crossings) depending
  34416. on threshold value, so audio reaches target peak value under conditions controlled by below options.
  34417. </p>
  34418. <p>The filter accepts the following options:
  34419. </p>
  34420. <dl class="table">
  34421. <dt><samp class="option">peak, p</samp></dt>
  34422. <dd><p>Set the expansion target peak value. This specifies the highest allowed absolute amplitude
  34423. level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0.
  34424. </p>
  34425. </dd>
  34426. <dt><samp class="option">expansion, e</samp></dt>
  34427. <dd><p>Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  34428. This option controls maximum local half-cycle of samples expansion. The maximum expansion
  34429. would be such that local peak value reaches target peak value but never to surpass it and that
  34430. ratio between new and previous peak value does not surpass this option value.
  34431. </p>
  34432. </dd>
  34433. <dt><samp class="option">compression, c</samp></dt>
  34434. <dd><p>Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  34435. This option controls maximum local half-cycle of samples compression. This option is used
  34436. only if <samp class="option">threshold</samp> option is set to value greater than 0.0, then in such cases
  34437. when local peak is lower or same as value set by <samp class="option">threshold</samp> all samples belonging to
  34438. that peak&rsquo;s half-cycle will be compressed by current compression factor.
  34439. </p>
  34440. </dd>
  34441. <dt><samp class="option">threshold, t</samp></dt>
  34442. <dd><p>Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  34443. This option specifies which half-cycles of samples will be compressed and which will be expanded.
  34444. Any half-cycle samples with their local peak value below or same as this option value will be
  34445. compressed by current compression factor, otherwise, if greater than threshold value they will be
  34446. expanded with expansion factor so that it could reach peak target value but never surpass it.
  34447. </p>
  34448. </dd>
  34449. <dt><samp class="option">raise, r</samp></dt>
  34450. <dd><p>Set the expansion raising amount per each half-cycle of samples. Default value is 0.001.
  34451. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per
  34452. each new half-cycle until it reaches <samp class="option">expansion</samp> value.
  34453. Setting this options too high may lead to distortions.
  34454. </p>
  34455. </dd>
  34456. <dt><samp class="option">fall, f</samp></dt>
  34457. <dd><p>Set the compression raising amount per each half-cycle of samples. Default value is 0.001.
  34458. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per
  34459. each new half-cycle until it reaches <samp class="option">compression</samp> value.
  34460. </p>
  34461. </dd>
  34462. <dt><samp class="option">channels, h</samp></dt>
  34463. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  34464. </p>
  34465. </dd>
  34466. <dt><samp class="option">invert, i</samp></dt>
  34467. <dd><p>Enable inverted filtering, by default is disabled. This inverts interpretation of <samp class="option">threshold</samp>
  34468. option. When enabled any half-cycle of samples with their local peak value below or same as
  34469. <samp class="option">threshold</samp> option will be expanded otherwise it will be compressed.
  34470. </p>
  34471. </dd>
  34472. <dt><samp class="option">link, l</samp></dt>
  34473. <dd><p>Link channels when calculating gain applied to each filtered channel sample, by default is disabled.
  34474. When disabled each filtered channel gain calculation is independent, otherwise when this option
  34475. is enabled the minimum of all possible gains for each filtered channel is used.
  34476. </p>
  34477. </dd>
  34478. <dt><samp class="option">rms, m</samp></dt>
  34479. <dd><p>Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized
  34480. audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0.
  34481. </p></dd>
  34482. </dl>
  34483. <a name="Commands-48"></a>
  34484. <h4 class="subsection">36.110.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-48" aria-hidden="true">TOC</a></span></h4>
  34485. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34486. </p>
  34487. <a name="Examples-79"></a>
  34488. <h4 class="subsection">36.110.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-79" aria-hidden="true">TOC</a></span></h4>
  34489. <ul class="itemize mark-bullet">
  34490. <li>Weak and slow amplification:
  34491. <div class="example">
  34492. <pre class="example-preformatted">speechnorm=e=3:r=0.00001:l=1
  34493. </pre></div>
  34494. </li><li>Moderate and slow amplification:
  34495. <div class="example">
  34496. <pre class="example-preformatted">speechnorm=e=6.25:r=0.00001:l=1
  34497. </pre></div>
  34498. </li><li>Strong and fast amplification:
  34499. <div class="example">
  34500. <pre class="example-preformatted">speechnorm=e=12.5:r=0.0001:l=1
  34501. </pre></div>
  34502. </li><li>Very strong and fast amplification:
  34503. <div class="example">
  34504. <pre class="example-preformatted">speechnorm=e=25:r=0.0001:l=1
  34505. </pre></div>
  34506. </li><li>Extreme and fast amplification:
  34507. <div class="example">
  34508. <pre class="example-preformatted">speechnorm=e=50:r=0.0001:l=1
  34509. </pre></div>
  34510. </li></ul>
  34511. <a name="stereotools"></a>
  34512. <h3 class="section">36.111 stereotools<span class="pull-right"><a class="anchor hidden-xs" href="#stereotools" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereotools" aria-hidden="true">TOC</a></span></h3>
  34513. <p>This filter has some handy utilities to manage stereo signals, for converting
  34514. M/S stereo recordings to L/R signal while having control over the parameters
  34515. or spreading the stereo image of master track.
  34516. </p>
  34517. <p>The filter accepts the following options:
  34518. </p>
  34519. <dl class="table">
  34520. <dt><samp class="option">level_in</samp></dt>
  34521. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  34522. Allowed range is from 0.015625 to 64.
  34523. </p>
  34524. </dd>
  34525. <dt><samp class="option">level_out</samp></dt>
  34526. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  34527. Allowed range is from 0.015625 to 64.
  34528. </p>
  34529. </dd>
  34530. <dt><samp class="option">balance_in</samp></dt>
  34531. <dd><p>Set input balance between both channels. Default is 0.
  34532. Allowed range is from -1 to 1.
  34533. </p>
  34534. </dd>
  34535. <dt><samp class="option">balance_out</samp></dt>
  34536. <dd><p>Set output balance between both channels. Default is 0.
  34537. Allowed range is from -1 to 1.
  34538. </p>
  34539. </dd>
  34540. <dt><samp class="option">softclip</samp></dt>
  34541. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  34542. clipping. Disabled by default.
  34543. </p>
  34544. </dd>
  34545. <dt><samp class="option">mutel</samp></dt>
  34546. <dd><p>Mute the left channel. Disabled by default.
  34547. </p>
  34548. </dd>
  34549. <dt><samp class="option">muter</samp></dt>
  34550. <dd><p>Mute the right channel. Disabled by default.
  34551. </p>
  34552. </dd>
  34553. <dt><samp class="option">phasel</samp></dt>
  34554. <dd><p>Change the phase of the left channel. Disabled by default.
  34555. </p>
  34556. </dd>
  34557. <dt><samp class="option">phaser</samp></dt>
  34558. <dd><p>Change the phase of the right channel. Disabled by default.
  34559. </p>
  34560. </dd>
  34561. <dt><samp class="option">mode</samp></dt>
  34562. <dd><p>Set stereo mode. Available values are:
  34563. </p>
  34564. <dl class="table">
  34565. <dt>&lsquo;<samp class="samp">lr&gt;lr</samp>&rsquo;</dt>
  34566. <dd><p>Left/Right to Left/Right, this is default.
  34567. </p>
  34568. </dd>
  34569. <dt>&lsquo;<samp class="samp">lr&gt;ms</samp>&rsquo;</dt>
  34570. <dd><p>Left/Right to Mid/Side.
  34571. </p>
  34572. </dd>
  34573. <dt>&lsquo;<samp class="samp">ms&gt;lr</samp>&rsquo;</dt>
  34574. <dd><p>Mid/Side to Left/Right.
  34575. </p>
  34576. </dd>
  34577. <dt>&lsquo;<samp class="samp">lr&gt;ll</samp>&rsquo;</dt>
  34578. <dd><p>Left/Right to Left/Left.
  34579. </p>
  34580. </dd>
  34581. <dt>&lsquo;<samp class="samp">lr&gt;rr</samp>&rsquo;</dt>
  34582. <dd><p>Left/Right to Right/Right.
  34583. </p>
  34584. </dd>
  34585. <dt>&lsquo;<samp class="samp">lr&gt;l+r</samp>&rsquo;</dt>
  34586. <dd><p>Left/Right to Left + Right.
  34587. </p>
  34588. </dd>
  34589. <dt>&lsquo;<samp class="samp">lr&gt;rl</samp>&rsquo;</dt>
  34590. <dd><p>Left/Right to Right/Left.
  34591. </p>
  34592. </dd>
  34593. <dt>&lsquo;<samp class="samp">ms&gt;ll</samp>&rsquo;</dt>
  34594. <dd><p>Mid/Side to Left/Left.
  34595. </p>
  34596. </dd>
  34597. <dt>&lsquo;<samp class="samp">ms&gt;rr</samp>&rsquo;</dt>
  34598. <dd><p>Mid/Side to Right/Right.
  34599. </p>
  34600. </dd>
  34601. <dt>&lsquo;<samp class="samp">ms&gt;rl</samp>&rsquo;</dt>
  34602. <dd><p>Mid/Side to Right/Left.
  34603. </p>
  34604. </dd>
  34605. <dt>&lsquo;<samp class="samp">lr&gt;l-r</samp>&rsquo;</dt>
  34606. <dd><p>Left/Right to Left - Right.
  34607. </p></dd>
  34608. </dl>
  34609. </dd>
  34610. <dt><samp class="option">slev</samp></dt>
  34611. <dd><p>Set level of side signal. Default is 1.
  34612. Allowed range is from 0.015625 to 64.
  34613. </p>
  34614. </dd>
  34615. <dt><samp class="option">sbal</samp></dt>
  34616. <dd><p>Set balance of side signal. Default is 0.
  34617. Allowed range is from -1 to 1.
  34618. </p>
  34619. </dd>
  34620. <dt><samp class="option">mlev</samp></dt>
  34621. <dd><p>Set level of the middle signal. Default is 1.
  34622. Allowed range is from 0.015625 to 64.
  34623. </p>
  34624. </dd>
  34625. <dt><samp class="option">mpan</samp></dt>
  34626. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  34627. </p>
  34628. </dd>
  34629. <dt><samp class="option">base</samp></dt>
  34630. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  34631. Allowed range is from -1 to 1.
  34632. </p>
  34633. </dd>
  34634. <dt><samp class="option">delay</samp></dt>
  34635. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  34636. vice versa. Default is 0. Allowed range is from -20 to 20.
  34637. </p>
  34638. </dd>
  34639. <dt><samp class="option">sclevel</samp></dt>
  34640. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  34641. </p>
  34642. </dd>
  34643. <dt><samp class="option">phase</samp></dt>
  34644. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  34645. </p>
  34646. </dd>
  34647. <dt><samp class="option">bmode_in, bmode_out</samp></dt>
  34648. <dd><p>Set balance mode for balance_in/balance_out option.
  34649. </p>
  34650. <p>Can be one of the following:
  34651. </p>
  34652. <dl class="table">
  34653. <dt>&lsquo;<samp class="samp">balance</samp>&rsquo;</dt>
  34654. <dd><p>Classic balance mode. Attenuate one channel at time.
  34655. Gain is raised up to 1.
  34656. </p>
  34657. </dd>
  34658. <dt>&lsquo;<samp class="samp">amplitude</samp>&rsquo;</dt>
  34659. <dd><p>Similar as classic mode above but gain is raised up to 2.
  34660. </p>
  34661. </dd>
  34662. <dt>&lsquo;<samp class="samp">power</samp>&rsquo;</dt>
  34663. <dd><p>Equal power distribution, from -6dB to +6dB range.
  34664. </p></dd>
  34665. </dl>
  34666. </dd>
  34667. </dl>
  34668. <a name="Commands-49"></a>
  34669. <h4 class="subsection">36.111.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-49" aria-hidden="true">TOC</a></span></h4>
  34670. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34671. </p>
  34672. <a name="Examples-80"></a>
  34673. <h4 class="subsection">36.111.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-80" aria-hidden="true">TOC</a></span></h4>
  34674. <ul class="itemize mark-bullet">
  34675. <li>Apply karaoke like effect:
  34676. <div class="example">
  34677. <pre class="example-preformatted">stereotools=mlev=0.015625
  34678. </pre></div>
  34679. </li><li>Convert M/S signal to L/R:
  34680. <div class="example">
  34681. <pre class="example-preformatted">&quot;stereotools=mode=ms&gt;lr&quot;
  34682. </pre></div>
  34683. </li></ul>
  34684. <a name="stereowiden"></a>
  34685. <h3 class="section">36.112 stereowiden<span class="pull-right"><a class="anchor hidden-xs" href="#stereowiden" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereowiden" aria-hidden="true">TOC</a></span></h3>
  34686. <p>This filter enhance the stereo effect by suppressing signal common to both
  34687. channels and by delaying the signal of left into right and vice versa,
  34688. thereby widening the stereo effect.
  34689. </p>
  34690. <p>The filter accepts the following options:
  34691. </p>
  34692. <dl class="table">
  34693. <dt><samp class="option">delay</samp></dt>
  34694. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  34695. Default is 20 milliseconds.
  34696. </p>
  34697. </dd>
  34698. <dt><samp class="option">feedback</samp></dt>
  34699. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  34700. effect of left signal in right output and vice versa which gives widening
  34701. effect. Default is 0.3.
  34702. </p>
  34703. </dd>
  34704. <dt><samp class="option">crossfeed</samp></dt>
  34705. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  34706. the mono. If the value is 1 it will cancel all the signal common to both
  34707. channels. Default is 0.3.
  34708. </p>
  34709. </dd>
  34710. <dt><samp class="option">drymix</samp></dt>
  34711. <dd><p>Set level of input signal of original channel. Default is 0.8.
  34712. </p></dd>
  34713. </dl>
  34714. <a name="Commands-50"></a>
  34715. <h4 class="subsection">36.112.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-50" aria-hidden="true">TOC</a></span></h4>
  34716. <p>This filter supports the all above options except <code class="code">delay</code> as <a class="ref" href="#commands">commands</a>.
  34717. </p>
  34718. <a name="superequalizer"></a>
  34719. <h3 class="section">36.113 superequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#superequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-superequalizer" aria-hidden="true">TOC</a></span></h3>
  34720. <p>Apply 18 band equalizer.
  34721. </p>
  34722. <p>The filter accepts the following options:
  34723. </p><dl class="table">
  34724. <dt><samp class="option">1b</samp></dt>
  34725. <dd><p>Set 65Hz band gain.
  34726. </p></dd>
  34727. <dt><samp class="option">2b</samp></dt>
  34728. <dd><p>Set 92Hz band gain.
  34729. </p></dd>
  34730. <dt><samp class="option">3b</samp></dt>
  34731. <dd><p>Set 131Hz band gain.
  34732. </p></dd>
  34733. <dt><samp class="option">4b</samp></dt>
  34734. <dd><p>Set 185Hz band gain.
  34735. </p></dd>
  34736. <dt><samp class="option">5b</samp></dt>
  34737. <dd><p>Set 262Hz band gain.
  34738. </p></dd>
  34739. <dt><samp class="option">6b</samp></dt>
  34740. <dd><p>Set 370Hz band gain.
  34741. </p></dd>
  34742. <dt><samp class="option">7b</samp></dt>
  34743. <dd><p>Set 523Hz band gain.
  34744. </p></dd>
  34745. <dt><samp class="option">8b</samp></dt>
  34746. <dd><p>Set 740Hz band gain.
  34747. </p></dd>
  34748. <dt><samp class="option">9b</samp></dt>
  34749. <dd><p>Set 1047Hz band gain.
  34750. </p></dd>
  34751. <dt><samp class="option">10b</samp></dt>
  34752. <dd><p>Set 1480Hz band gain.
  34753. </p></dd>
  34754. <dt><samp class="option">11b</samp></dt>
  34755. <dd><p>Set 2093Hz band gain.
  34756. </p></dd>
  34757. <dt><samp class="option">12b</samp></dt>
  34758. <dd><p>Set 2960Hz band gain.
  34759. </p></dd>
  34760. <dt><samp class="option">13b</samp></dt>
  34761. <dd><p>Set 4186Hz band gain.
  34762. </p></dd>
  34763. <dt><samp class="option">14b</samp></dt>
  34764. <dd><p>Set 5920Hz band gain.
  34765. </p></dd>
  34766. <dt><samp class="option">15b</samp></dt>
  34767. <dd><p>Set 8372Hz band gain.
  34768. </p></dd>
  34769. <dt><samp class="option">16b</samp></dt>
  34770. <dd><p>Set 11840Hz band gain.
  34771. </p></dd>
  34772. <dt><samp class="option">17b</samp></dt>
  34773. <dd><p>Set 16744Hz band gain.
  34774. </p></dd>
  34775. <dt><samp class="option">18b</samp></dt>
  34776. <dd><p>Set 20000Hz band gain.
  34777. </p></dd>
  34778. </dl>
  34779. <a name="surround"></a>
  34780. <h3 class="section">36.114 surround<span class="pull-right"><a class="anchor hidden-xs" href="#surround" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-surround" aria-hidden="true">TOC</a></span></h3>
  34781. <p>Apply audio surround upmix filter.
  34782. </p>
  34783. <p>This filter allows to produce multichannel output from audio stream.
  34784. </p>
  34785. <p>The filter accepts the following options:
  34786. </p>
  34787. <dl class="table">
  34788. <dt><samp class="option">chl_out</samp></dt>
  34789. <dd><p>Set output channel layout. By default, this is <var class="var">5.1</var>.
  34790. </p>
  34791. <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>
  34792. for the required syntax.
  34793. </p>
  34794. </dd>
  34795. <dt><samp class="option">chl_in</samp></dt>
  34796. <dd><p>Set input channel layout. By default, this is <var class="var">stereo</var>.
  34797. </p>
  34798. <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>
  34799. for the required syntax.
  34800. </p>
  34801. </dd>
  34802. <dt><samp class="option">level_in</samp></dt>
  34803. <dd><p>Set input volume level. By default, this is <var class="var">1</var>.
  34804. </p>
  34805. </dd>
  34806. <dt><samp class="option">level_out</samp></dt>
  34807. <dd><p>Set output volume level. By default, this is <var class="var">1</var>.
  34808. </p>
  34809. </dd>
  34810. <dt><samp class="option">lfe</samp></dt>
  34811. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  34812. </p>
  34813. </dd>
  34814. <dt><samp class="option">lfe_low</samp></dt>
  34815. <dd><p>Set LFE low cut off frequency. By default, this is <var class="var">128</var> Hz.
  34816. </p>
  34817. </dd>
  34818. <dt><samp class="option">lfe_high</samp></dt>
  34819. <dd><p>Set LFE high cut off frequency. By default, this is <var class="var">256</var> Hz.
  34820. </p>
  34821. </dd>
  34822. <dt><samp class="option">lfe_mode</samp></dt>
  34823. <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>.
  34824. In <var class="var">add</var> mode, LFE channel is created from input audio and added to output.
  34825. In <var class="var">sub</var> mode, LFE channel is created from input audio and added to output but
  34826. also all non-LFE output channels are subtracted with output LFE channel.
  34827. </p>
  34828. </dd>
  34829. <dt><samp class="option">smooth</samp></dt>
  34830. <dd><p>Set temporal smoothness strength, used to gradually change factors when transforming
  34831. stereo sound in time. Allowed range is from <var class="var">0.0</var> to <var class="var">1.0</var>.
  34832. Useful to improve output quality with <var class="var">focus</var> option values greater than <var class="var">0.0</var>.
  34833. Default is <var class="var">0.0</var>. Only values inside this range and without edges are effective.
  34834. </p>
  34835. </dd>
  34836. <dt><samp class="option">angle</samp></dt>
  34837. <dd><p>Set angle of stereo surround transform, Allowed range is from <var class="var">0</var> to <var class="var">360</var>.
  34838. Default is <var class="var">90</var>.
  34839. </p>
  34840. </dd>
  34841. <dt><samp class="option">focus</samp></dt>
  34842. <dd><p>Set focus of stereo surround transform, Allowed range is from <var class="var">-1</var> to <var class="var">1</var>.
  34843. Default is <var class="var">0</var>.
  34844. </p>
  34845. </dd>
  34846. <dt><samp class="option">fc_in</samp></dt>
  34847. <dd><p>Set front center input volume. By default, this is <var class="var">1</var>.
  34848. </p>
  34849. </dd>
  34850. <dt><samp class="option">fc_out</samp></dt>
  34851. <dd><p>Set front center output volume. By default, this is <var class="var">1</var>.
  34852. </p>
  34853. </dd>
  34854. <dt><samp class="option">fl_in</samp></dt>
  34855. <dd><p>Set front left input volume. By default, this is <var class="var">1</var>.
  34856. </p>
  34857. </dd>
  34858. <dt><samp class="option">fl_out</samp></dt>
  34859. <dd><p>Set front left output volume. By default, this is <var class="var">1</var>.
  34860. </p>
  34861. </dd>
  34862. <dt><samp class="option">fr_in</samp></dt>
  34863. <dd><p>Set front right input volume. By default, this is <var class="var">1</var>.
  34864. </p>
  34865. </dd>
  34866. <dt><samp class="option">fr_out</samp></dt>
  34867. <dd><p>Set front right output volume. By default, this is <var class="var">1</var>.
  34868. </p>
  34869. </dd>
  34870. <dt><samp class="option">sl_in</samp></dt>
  34871. <dd><p>Set side left input volume. By default, this is <var class="var">1</var>.
  34872. </p>
  34873. </dd>
  34874. <dt><samp class="option">sl_out</samp></dt>
  34875. <dd><p>Set side left output volume. By default, this is <var class="var">1</var>.
  34876. </p>
  34877. </dd>
  34878. <dt><samp class="option">sr_in</samp></dt>
  34879. <dd><p>Set side right input volume. By default, this is <var class="var">1</var>.
  34880. </p>
  34881. </dd>
  34882. <dt><samp class="option">sr_out</samp></dt>
  34883. <dd><p>Set side right output volume. By default, this is <var class="var">1</var>.
  34884. </p>
  34885. </dd>
  34886. <dt><samp class="option">bl_in</samp></dt>
  34887. <dd><p>Set back left input volume. By default, this is <var class="var">1</var>.
  34888. </p>
  34889. </dd>
  34890. <dt><samp class="option">bl_out</samp></dt>
  34891. <dd><p>Set back left output volume. By default, this is <var class="var">1</var>.
  34892. </p>
  34893. </dd>
  34894. <dt><samp class="option">br_in</samp></dt>
  34895. <dd><p>Set back right input volume. By default, this is <var class="var">1</var>.
  34896. </p>
  34897. </dd>
  34898. <dt><samp class="option">br_out</samp></dt>
  34899. <dd><p>Set back right output volume. By default, this is <var class="var">1</var>.
  34900. </p>
  34901. </dd>
  34902. <dt><samp class="option">bc_in</samp></dt>
  34903. <dd><p>Set back center input volume. By default, this is <var class="var">1</var>.
  34904. </p>
  34905. </dd>
  34906. <dt><samp class="option">bc_out</samp></dt>
  34907. <dd><p>Set back center output volume. By default, this is <var class="var">1</var>.
  34908. </p>
  34909. </dd>
  34910. <dt><samp class="option">lfe_in</samp></dt>
  34911. <dd><p>Set LFE input volume. By default, this is <var class="var">1</var>.
  34912. </p>
  34913. </dd>
  34914. <dt><samp class="option">lfe_out</samp></dt>
  34915. <dd><p>Set LFE output volume. By default, this is <var class="var">1</var>.
  34916. </p>
  34917. </dd>
  34918. <dt><samp class="option">allx</samp></dt>
  34919. <dd><p>Set spread usage of stereo image across X axis for all channels.
  34920. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  34921. By default this value is negative <var class="var">-1</var>, and thus unused.
  34922. </p>
  34923. </dd>
  34924. <dt><samp class="option">ally</samp></dt>
  34925. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  34926. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  34927. By default this value is negative <var class="var">-1</var>, and thus unused.
  34928. </p>
  34929. </dd>
  34930. <dt><samp class="option">fcx, flx, frx, blx, brx, slx, srx, bcx</samp></dt>
  34931. <dd><p>Set spread usage of stereo image across X axis for each channel.
  34932. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  34933. By default this value is <var class="var">0.5</var>.
  34934. </p>
  34935. </dd>
  34936. <dt><samp class="option">fcy, fly, fry, bly, bry, sly, sry, bcy</samp></dt>
  34937. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  34938. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  34939. By default this value is <var class="var">0.5</var>.
  34940. </p>
  34941. </dd>
  34942. <dt><samp class="option">win_size</samp></dt>
  34943. <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>.
  34944. </p>
  34945. </dd>
  34946. <dt><samp class="option">win_func</samp></dt>
  34947. <dd><p>Set window function.
  34948. </p>
  34949. <p>It accepts the following values:
  34950. </p><dl class="table">
  34951. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  34952. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  34953. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  34954. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  34955. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  34956. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  34957. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  34958. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  34959. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  34960. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  34961. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  34962. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  34963. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  34964. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  34965. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  34966. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  34967. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  34968. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  34969. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  34970. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  34971. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  34972. </dl>
  34973. <p>Default is <code class="code">hann</code>.
  34974. </p>
  34975. </dd>
  34976. <dt><samp class="option">overlap</samp></dt>
  34977. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  34978. window function will be picked. Default is <code class="code">0.5</code>.
  34979. </p></dd>
  34980. </dl>
  34981. <a name="tiltshelf"></a>
  34982. <h3 class="section">36.115 tiltshelf<span class="pull-right"><a class="anchor hidden-xs" href="#tiltshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tiltshelf" aria-hidden="true">TOC</a></span></h3>
  34983. <p>Boost or cut the lower frequencies and cut or boost higher frequencies
  34984. of the audio using a two-pole shelving filter with a response similar to
  34985. that of a standard hi-fi&rsquo;s tone-controls.
  34986. This is also known as shelving equalisation (EQ).
  34987. </p>
  34988. <p>The filter accepts the following options:
  34989. </p>
  34990. <dl class="table">
  34991. <dt><samp class="option">gain, g</samp></dt>
  34992. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  34993. (for a large cut) to +20 (for a large boost).
  34994. Beware of clipping when using a positive gain.
  34995. </p>
  34996. </dd>
  34997. <dt><samp class="option">frequency, f</samp></dt>
  34998. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  34999. to extend or reduce the frequency range to be boosted or cut.
  35000. The default value is <code class="code">3000</code> Hz.
  35001. </p>
  35002. </dd>
  35003. <dt><samp class="option">width_type, t</samp></dt>
  35004. <dd><p>Set method to specify band-width of filter.
  35005. </p><dl class="table">
  35006. <dt><samp class="option">h</samp></dt>
  35007. <dd><p>Hz
  35008. </p></dd>
  35009. <dt><samp class="option">q</samp></dt>
  35010. <dd><p>Q-Factor
  35011. </p></dd>
  35012. <dt><samp class="option">o</samp></dt>
  35013. <dd><p>octave
  35014. </p></dd>
  35015. <dt><samp class="option">s</samp></dt>
  35016. <dd><p>slope
  35017. </p></dd>
  35018. <dt><samp class="option">k</samp></dt>
  35019. <dd><p>kHz
  35020. </p></dd>
  35021. </dl>
  35022. </dd>
  35023. <dt><samp class="option">width, w</samp></dt>
  35024. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  35025. </p>
  35026. </dd>
  35027. <dt><samp class="option">poles, p</samp></dt>
  35028. <dd><p>Set number of poles. Default is 2.
  35029. </p>
  35030. </dd>
  35031. <dt><samp class="option">mix, m</samp></dt>
  35032. <dd><p>How much to use filtered signal in output. Default is 1.
  35033. Range is between 0 and 1.
  35034. </p>
  35035. </dd>
  35036. <dt><samp class="option">channels, c</samp></dt>
  35037. <dd><p>Specify which channels to filter, by default all available are filtered.
  35038. </p>
  35039. </dd>
  35040. <dt><samp class="option">normalize, n</samp></dt>
  35041. <dd><p>Normalize biquad coefficients, by default is disabled.
  35042. Enabling it will normalize magnitude response at DC to 0dB.
  35043. </p>
  35044. </dd>
  35045. <dt><samp class="option">transform, a</samp></dt>
  35046. <dd><p>Set transform type of IIR filter.
  35047. </p><dl class="table">
  35048. <dt><samp class="option">di</samp></dt>
  35049. <dt><samp class="option">dii</samp></dt>
  35050. <dt><samp class="option">tdi</samp></dt>
  35051. <dt><samp class="option">tdii</samp></dt>
  35052. <dt><samp class="option">latt</samp></dt>
  35053. <dt><samp class="option">svf</samp></dt>
  35054. <dt><samp class="option">zdf</samp></dt>
  35055. </dl>
  35056. </dd>
  35057. <dt><samp class="option">precision, r</samp></dt>
  35058. <dd><p>Set precision of filtering.
  35059. </p><dl class="table">
  35060. <dt><samp class="option">auto</samp></dt>
  35061. <dd><p>Pick automatic sample format depending on surround filters.
  35062. </p></dd>
  35063. <dt><samp class="option">s16</samp></dt>
  35064. <dd><p>Always use signed 16-bit.
  35065. </p></dd>
  35066. <dt><samp class="option">s32</samp></dt>
  35067. <dd><p>Always use signed 32-bit.
  35068. </p></dd>
  35069. <dt><samp class="option">f32</samp></dt>
  35070. <dd><p>Always use float 32-bit.
  35071. </p></dd>
  35072. <dt><samp class="option">f64</samp></dt>
  35073. <dd><p>Always use float 64-bit.
  35074. </p></dd>
  35075. </dl>
  35076. </dd>
  35077. <dt><samp class="option">block_size, b</samp></dt>
  35078. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  35079. value (higher than impulse response length truncated when reaches near zero values) filtering
  35080. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  35081. </p>
  35082. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  35083. </p></dd>
  35084. </dl>
  35085. <a name="Commands-51"></a>
  35086. <h4 class="subsection">36.115.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-51" aria-hidden="true">TOC</a></span></h4>
  35087. <p>This filter supports some options as <a class="ref" href="#commands">commands</a>.
  35088. </p>
  35089. <a name="treble_002c-highshelf"></a>
  35090. <h3 class="section">36.116 treble, highshelf<span class="pull-right"><a class="anchor hidden-xs" href="#treble_002c-highshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-treble_002c-highshelf" aria-hidden="true">TOC</a></span></h3>
  35091. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  35092. shelving filter with a response similar to that of a standard
  35093. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  35094. </p>
  35095. <p>The filter accepts the following options:
  35096. </p>
  35097. <dl class="table">
  35098. <dt><samp class="option">gain, g</samp></dt>
  35099. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  35100. Nyquist frequency. Its useful range is about -20 (for a large cut)
  35101. to +20 (for a large boost). Beware of clipping when using a positive gain.
  35102. </p>
  35103. </dd>
  35104. <dt><samp class="option">frequency, f</samp></dt>
  35105. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  35106. to extend or reduce the frequency range to be boosted or cut.
  35107. The default value is <code class="code">3000</code> Hz.
  35108. </p>
  35109. </dd>
  35110. <dt><samp class="option">width_type, t</samp></dt>
  35111. <dd><p>Set method to specify band-width of filter.
  35112. </p><dl class="table">
  35113. <dt><samp class="option">h</samp></dt>
  35114. <dd><p>Hz
  35115. </p></dd>
  35116. <dt><samp class="option">q</samp></dt>
  35117. <dd><p>Q-Factor
  35118. </p></dd>
  35119. <dt><samp class="option">o</samp></dt>
  35120. <dd><p>octave
  35121. </p></dd>
  35122. <dt><samp class="option">s</samp></dt>
  35123. <dd><p>slope
  35124. </p></dd>
  35125. <dt><samp class="option">k</samp></dt>
  35126. <dd><p>kHz
  35127. </p></dd>
  35128. </dl>
  35129. </dd>
  35130. <dt><samp class="option">width, w</samp></dt>
  35131. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  35132. </p>
  35133. </dd>
  35134. <dt><samp class="option">poles, p</samp></dt>
  35135. <dd><p>Set number of poles. Default is 2.
  35136. </p>
  35137. </dd>
  35138. <dt><samp class="option">mix, m</samp></dt>
  35139. <dd><p>How much to use filtered signal in output. Default is 1.
  35140. Range is between 0 and 1.
  35141. </p>
  35142. </dd>
  35143. <dt><samp class="option">channels, c</samp></dt>
  35144. <dd><p>Specify which channels to filter, by default all available are filtered.
  35145. </p>
  35146. </dd>
  35147. <dt><samp class="option">normalize, n</samp></dt>
  35148. <dd><p>Normalize biquad coefficients, by default is disabled.
  35149. Enabling it will normalize magnitude response at DC to 0dB.
  35150. </p>
  35151. </dd>
  35152. <dt><samp class="option">transform, a</samp></dt>
  35153. <dd><p>Set transform type of IIR filter.
  35154. </p><dl class="table">
  35155. <dt><samp class="option">di</samp></dt>
  35156. <dt><samp class="option">dii</samp></dt>
  35157. <dt><samp class="option">tdi</samp></dt>
  35158. <dt><samp class="option">tdii</samp></dt>
  35159. <dt><samp class="option">latt</samp></dt>
  35160. <dt><samp class="option">svf</samp></dt>
  35161. <dt><samp class="option">zdf</samp></dt>
  35162. </dl>
  35163. </dd>
  35164. <dt><samp class="option">precision, r</samp></dt>
  35165. <dd><p>Set precision of filtering.
  35166. </p><dl class="table">
  35167. <dt><samp class="option">auto</samp></dt>
  35168. <dd><p>Pick automatic sample format depending on surround filters.
  35169. </p></dd>
  35170. <dt><samp class="option">s16</samp></dt>
  35171. <dd><p>Always use signed 16-bit.
  35172. </p></dd>
  35173. <dt><samp class="option">s32</samp></dt>
  35174. <dd><p>Always use signed 32-bit.
  35175. </p></dd>
  35176. <dt><samp class="option">f32</samp></dt>
  35177. <dd><p>Always use float 32-bit.
  35178. </p></dd>
  35179. <dt><samp class="option">f64</samp></dt>
  35180. <dd><p>Always use float 64-bit.
  35181. </p></dd>
  35182. </dl>
  35183. </dd>
  35184. <dt><samp class="option">block_size, b</samp></dt>
  35185. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  35186. value (higher than impulse response length truncated when reaches near zero values) filtering
  35187. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  35188. </p>
  35189. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  35190. </p></dd>
  35191. </dl>
  35192. <a name="Commands-52"></a>
  35193. <h4 class="subsection">36.116.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-52" aria-hidden="true">TOC</a></span></h4>
  35194. <p>This filter supports the following commands:
  35195. </p><dl class="table">
  35196. <dt><samp class="option">frequency, f</samp></dt>
  35197. <dd><p>Change treble frequency.
  35198. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  35199. </p>
  35200. </dd>
  35201. <dt><samp class="option">width_type, t</samp></dt>
  35202. <dd><p>Change treble width_type.
  35203. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  35204. </p>
  35205. </dd>
  35206. <dt><samp class="option">width, w</samp></dt>
  35207. <dd><p>Change treble width.
  35208. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  35209. </p>
  35210. </dd>
  35211. <dt><samp class="option">gain, g</samp></dt>
  35212. <dd><p>Change treble gain.
  35213. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  35214. </p>
  35215. </dd>
  35216. <dt><samp class="option">mix, m</samp></dt>
  35217. <dd><p>Change treble mix.
  35218. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  35219. </p></dd>
  35220. </dl>
  35221. <a name="tremolo"></a>
  35222. <h3 class="section">36.117 tremolo<span class="pull-right"><a class="anchor hidden-xs" href="#tremolo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tremolo" aria-hidden="true">TOC</a></span></h3>
  35223. <p>Sinusoidal amplitude modulation.
  35224. </p>
  35225. <p>The filter accepts the following options:
  35226. </p>
  35227. <dl class="table">
  35228. <dt><samp class="option">f</samp></dt>
  35229. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  35230. (20 Hz or lower) will result in a tremolo effect.
  35231. This filter may also be used as a ring modulator by specifying
  35232. a modulation frequency higher than 20 Hz.
  35233. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  35234. </p>
  35235. </dd>
  35236. <dt><samp class="option">d</samp></dt>
  35237. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  35238. Default value is 0.5.
  35239. </p></dd>
  35240. </dl>
  35241. <a name="vibrato"></a>
  35242. <h3 class="section">36.118 vibrato<span class="pull-right"><a class="anchor hidden-xs" href="#vibrato" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vibrato" aria-hidden="true">TOC</a></span></h3>
  35243. <p>Sinusoidal phase modulation.
  35244. </p>
  35245. <p>The filter accepts the following options:
  35246. </p>
  35247. <dl class="table">
  35248. <dt><samp class="option">f</samp></dt>
  35249. <dd><p>Modulation frequency in Hertz.
  35250. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  35251. </p>
  35252. </dd>
  35253. <dt><samp class="option">d</samp></dt>
  35254. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  35255. Default value is 0.5.
  35256. </p></dd>
  35257. </dl>
  35258. <a name="virtualbass"></a>
  35259. <h3 class="section">36.119 virtualbass<span class="pull-right"><a class="anchor hidden-xs" href="#virtualbass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-virtualbass" aria-hidden="true">TOC</a></span></h3>
  35260. <p>Apply audio Virtual Bass filter.
  35261. </p>
  35262. <p>This filter accepts stereo input and produce stereo with LFE (2.1) channels output.
  35263. The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels.
  35264. This filter outputs front left and front right channels unchanged as available in stereo input.
  35265. </p>
  35266. <p>The filter accepts the following options:
  35267. </p>
  35268. <dl class="table">
  35269. <dt><samp class="option">cutoff</samp></dt>
  35270. <dd><p>Set the virtual bass cutoff frequency. Default value is 250 Hz.
  35271. Allowed range is from 100 to 500 Hz.
  35272. </p>
  35273. </dd>
  35274. <dt><samp class="option">strength</samp></dt>
  35275. <dd><p>Set the virtual bass strength. Allowed range is from 0.5 to 3.
  35276. Default value is 3.
  35277. </p></dd>
  35278. </dl>
  35279. <a name="volume"></a>
  35280. <h3 class="section">36.120 volume<span class="pull-right"><a class="anchor hidden-xs" href="#volume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volume" aria-hidden="true">TOC</a></span></h3>
  35281. <p>Adjust the input audio volume.
  35282. </p>
  35283. <p>It accepts the following parameters:
  35284. </p><dl class="table">
  35285. <dt><samp class="option">volume</samp></dt>
  35286. <dd><p>Set audio volume expression.
  35287. </p>
  35288. <p>Output values are clipped to the maximum value.
  35289. </p>
  35290. <p>The output audio volume is given by the relation:
  35291. </p><div class="example">
  35292. <pre class="example-preformatted"><var class="var">output_volume</var> = <var class="var">volume</var> * <var class="var">input_volume</var>
  35293. </pre></div>
  35294. <p>The default value for <var class="var">volume</var> is &quot;1.0&quot;.
  35295. </p>
  35296. </dd>
  35297. <dt><samp class="option">precision</samp></dt>
  35298. <dd><p>This parameter represents the mathematical precision.
  35299. </p>
  35300. <p>It determines which input sample formats will be allowed, which affects the
  35301. precision of the volume scaling.
  35302. </p>
  35303. <dl class="table">
  35304. <dt><samp class="option">fixed</samp></dt>
  35305. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  35306. </p></dd>
  35307. <dt><samp class="option">float</samp></dt>
  35308. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  35309. </p></dd>
  35310. <dt><samp class="option">double</samp></dt>
  35311. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  35312. </p></dd>
  35313. </dl>
  35314. </dd>
  35315. <dt><samp class="option">replaygain</samp></dt>
  35316. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  35317. </p>
  35318. <dl class="table">
  35319. <dt><samp class="option">drop</samp></dt>
  35320. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  35321. </p>
  35322. </dd>
  35323. <dt><samp class="option">ignore</samp></dt>
  35324. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  35325. </p>
  35326. </dd>
  35327. <dt><samp class="option">track</samp></dt>
  35328. <dd><p>Prefer the track gain, if present.
  35329. </p>
  35330. </dd>
  35331. <dt><samp class="option">album</samp></dt>
  35332. <dd><p>Prefer the album gain, if present.
  35333. </p></dd>
  35334. </dl>
  35335. </dd>
  35336. <dt><samp class="option">replaygain_preamp</samp></dt>
  35337. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  35338. </p>
  35339. <p>Default value for <var class="var">replaygain_preamp</var> is 0.0.
  35340. </p>
  35341. </dd>
  35342. <dt><samp class="option">replaygain_noclip</samp></dt>
  35343. <dd><p>Prevent clipping by limiting the gain applied.
  35344. </p>
  35345. <p>Default value for <var class="var">replaygain_noclip</var> is 1.
  35346. </p>
  35347. </dd>
  35348. <dt><samp class="option">eval</samp></dt>
  35349. <dd><p>Set when the volume expression is evaluated.
  35350. </p>
  35351. <p>It accepts the following values:
  35352. </p><dl class="table">
  35353. <dt>&lsquo;<samp class="samp">once</samp>&rsquo;</dt>
  35354. <dd><p>only evaluate expression once during the filter initialization, or
  35355. when the &lsquo;<samp class="samp">volume</samp>&rsquo; command is sent
  35356. </p>
  35357. </dd>
  35358. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  35359. <dd><p>evaluate expression for each incoming frame
  35360. </p></dd>
  35361. </dl>
  35362. <p>Default value is &lsquo;<samp class="samp">once</samp>&rsquo;.
  35363. </p></dd>
  35364. </dl>
  35365. <p>The volume expression can contain the following parameters.
  35366. </p>
  35367. <dl class="table">
  35368. <dt><samp class="option">n</samp></dt>
  35369. <dd><p>frame number (starting at zero)
  35370. </p></dd>
  35371. <dt><samp class="option">nb_channels</samp></dt>
  35372. <dd><p>number of channels
  35373. </p></dd>
  35374. <dt><samp class="option">nb_consumed_samples</samp></dt>
  35375. <dd><p>number of samples consumed by the filter
  35376. </p></dd>
  35377. <dt><samp class="option">nb_samples</samp></dt>
  35378. <dd><p>number of samples in the current frame
  35379. </p></dd>
  35380. <dt><samp class="option">pos</samp></dt>
  35381. <dd><p>original frame position in the file; deprecated, do not use
  35382. </p></dd>
  35383. <dt><samp class="option">pts</samp></dt>
  35384. <dd><p>frame PTS
  35385. </p></dd>
  35386. <dt><samp class="option">sample_rate</samp></dt>
  35387. <dd><p>sample rate
  35388. </p></dd>
  35389. <dt><samp class="option">startpts</samp></dt>
  35390. <dd><p>PTS at start of stream
  35391. </p></dd>
  35392. <dt><samp class="option">startt</samp></dt>
  35393. <dd><p>time at start of stream
  35394. </p></dd>
  35395. <dt><samp class="option">t</samp></dt>
  35396. <dd><p>frame time
  35397. </p></dd>
  35398. <dt><samp class="option">tb</samp></dt>
  35399. <dd><p>timestamp timebase
  35400. </p></dd>
  35401. <dt><samp class="option">volume</samp></dt>
  35402. <dd><p>last set volume value
  35403. </p></dd>
  35404. </dl>
  35405. <p>Note that when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">once</samp>&rsquo; only the
  35406. <var class="var">sample_rate</var> and <var class="var">tb</var> variables are available, all other
  35407. variables will evaluate to NAN.
  35408. </p>
  35409. <a name="Commands-53"></a>
  35410. <h4 class="subsection">36.120.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-53" aria-hidden="true">TOC</a></span></h4>
  35411. <p>This filter supports the following commands:
  35412. </p><dl class="table">
  35413. <dt><samp class="option">volume</samp></dt>
  35414. <dd><p>Modify the volume expression.
  35415. The command accepts the same syntax of the corresponding option.
  35416. </p>
  35417. <p>If the specified expression is not valid, it is kept at its current
  35418. value.
  35419. </p></dd>
  35420. </dl>
  35421. <a name="Examples-81"></a>
  35422. <h4 class="subsection">36.120.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-81" aria-hidden="true">TOC</a></span></h4>
  35423. <ul class="itemize mark-bullet">
  35424. <li>Halve the input audio volume:
  35425. <div class="example">
  35426. <pre class="example-preformatted">volume=volume=0.5
  35427. volume=volume=1/2
  35428. volume=volume=-6.0206dB
  35429. </pre></div>
  35430. <p>In all the above example the named key for <samp class="option">volume</samp> can be
  35431. omitted, for example like in:
  35432. </p><div class="example">
  35433. <pre class="example-preformatted">volume=0.5
  35434. </pre></div>
  35435. </li><li>Increase input audio power by 6 decibels using fixed-point precision:
  35436. <div class="example">
  35437. <pre class="example-preformatted">volume=volume=6dB:precision=fixed
  35438. </pre></div>
  35439. </li><li>Fade volume after time 10 with an annihilation period of 5 seconds:
  35440. <div class="example">
  35441. <pre class="example-preformatted">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  35442. </pre></div>
  35443. </li></ul>
  35444. <a name="volumedetect"></a>
  35445. <h3 class="section">36.121 volumedetect<span class="pull-right"><a class="anchor hidden-xs" href="#volumedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volumedetect" aria-hidden="true">TOC</a></span></h3>
  35446. <p>Detect the volume of the input video.
  35447. </p>
  35448. <p>The filter has no parameters. It supports only 16-bit signed integer samples,
  35449. so the input will be converted when needed. Statistics about the volume will
  35450. be printed in the log when the input stream end is reached.
  35451. </p>
  35452. <p>In particular it will show the mean volume (root mean square), maximum
  35453. volume (on a per-sample basis), and the beginning of a histogram of the
  35454. registered volume values (from the maximum value to a cumulated 1/1000 of
  35455. the samples).
  35456. </p>
  35457. <p>All volumes are in decibels relative to the maximum PCM value.
  35458. </p>
  35459. <a name="Examples-82"></a>
  35460. <h4 class="subsection">36.121.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-82" aria-hidden="true">TOC</a></span></h4>
  35461. <p>Here is an excerpt of the output:
  35462. </p><div class="example">
  35463. <pre class="example-preformatted">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  35464. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  35465. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  35466. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  35467. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  35468. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  35469. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  35470. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  35471. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  35472. </pre></div>
  35473. <p>It means that:
  35474. </p><ul class="itemize mark-bullet">
  35475. <li>The mean square energy is approximately -27 dB, or 10^-2.7.
  35476. </li><li>The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  35477. </li><li>There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  35478. </li></ul>
  35479. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  35480. raising it by +5 dB causes clipping for 6 samples, etc.
  35481. </p>
  35482. <a class="anchor" id="whisper"></a><a name="whisper-1"></a>
  35483. <h3 class="section">36.122 whisper<span class="pull-right"><a class="anchor hidden-xs" href="#whisper-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-whisper-1" aria-hidden="true">TOC</a></span></h3>
  35484. <p>It runs automatic speech recognition using the OpenAI&rsquo;s Whisper model.
  35485. </p>
  35486. <p>It requires the whisper.cpp library (https://github.com/ggml-org/whisper.cpp)
  35487. as a prerequisite. After installing the library it can be enabled using:
  35488. <code class="code">./configure --enable-whisper</code>.
  35489. </p>
  35490. <p>The filter has following options:
  35491. </p>
  35492. <dl class="table">
  35493. <dt><samp class="option">model</samp></dt>
  35494. <dd><p>The file path of the downloaded whisper.cpp model (mandatory).
  35495. </p>
  35496. </dd>
  35497. <dt><samp class="option">language</samp></dt>
  35498. <dd><p>The language to use for transcription (&rsquo;auto&rsquo; for auto-detect).
  35499. Default value: <code class="code">&quot;auto&quot;</code>
  35500. </p>
  35501. </dd>
  35502. <dt><samp class="option">queue</samp></dt>
  35503. <dd><p>The maximum size that will be queued into the filter before processing the audio
  35504. with whisper. Using a small value the audio stream will be processed more often,
  35505. but the transcription quality will be lower and the required processing power
  35506. will be higher. Using a large value (e.g. 10-20s) will produce more accurate
  35507. results using less CPU (as using the whisper-cli tool), but the transcription
  35508. latency will be higher, thus not useful to process real-time streams.
  35509. Consider using the vad_model option associated with a large queue value.
  35510. Default value: <code class="code">&quot;3&quot;</code>
  35511. </p>
  35512. </dd>
  35513. <dt><samp class="option">use_gpu</samp></dt>
  35514. <dd><p>If the GPU support should be enabled.
  35515. Default value: <code class="code">&quot;true&quot;</code>
  35516. </p>
  35517. </dd>
  35518. <dt><samp class="option">gpu_device</samp></dt>
  35519. <dd><p>The GPU device index to use.
  35520. Default value: <code class="code">&quot;0&quot;</code>
  35521. </p>
  35522. </dd>
  35523. <dt><samp class="option">destination</samp></dt>
  35524. <dd><p>If set, the transcription output will be sent to the specified file or URL
  35525. (use one of the FFmpeg AVIO protocols); otherwise, the output will be logged as
  35526. info messages.
  35527. The output will also be set in the &quot;lavfi.whisper.text&quot; frame metadata.
  35528. If the destination is a file and it already exists, it will be overwritten.
  35529. </p>
  35530. </dd>
  35531. <dt><samp class="option">format</samp></dt>
  35532. <dd><p>The destination format string; it could be &quot;text&quot; (only the transcribed text
  35533. will be sent to the destination), &quot;srt&quot; (subtitle format) or &quot;json&quot;.
  35534. Default value: <code class="code">&quot;text&quot;</code>
  35535. </p>
  35536. </dd>
  35537. <dt><samp class="option">vad_model</samp></dt>
  35538. <dd><p>Path to the VAD model file. If set, the filter will load an additional voice
  35539. activity detection module (https://github.com/snakers4/silero-vad) that will be
  35540. used to fragment the audio queue; use this option setting a valid path obtained
  35541. from the whisper.cpp repository (e.g. &quot;../whisper.cpp/models/ggml-silero-v5.1.2.bin&quot;)
  35542. and increase the queue parameter to a higher value (e.g. 20).
  35543. </p>
  35544. </dd>
  35545. <dt><samp class="option">vad_threshold</samp></dt>
  35546. <dd><p>The VAD threshold to use.
  35547. Default value: <code class="code">&quot;0.5&quot;</code>
  35548. </p>
  35549. </dd>
  35550. <dt><samp class="option">vad_min_speech_duration</samp></dt>
  35551. <dd><p>The minimum VAD speaking duration.
  35552. Default value: <code class="code">&quot;0.1&quot;</code>
  35553. </p>
  35554. </dd>
  35555. <dt><samp class="option">vad_min_silence_duration</samp></dt>
  35556. <dd><p>The minimum VAD silence duration.
  35557. Default value: <code class="code">&quot;0.5&quot;</code>
  35558. </p>
  35559. </dd>
  35560. </dl>
  35561. <a name="Examples-83"></a>
  35562. <h4 class="subsection">36.122.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-83" aria-hidden="true">TOC</a></span></h4>
  35563. <ul class="itemize mark-bullet">
  35564. <li>Run a transcription with srt file generation:
  35565. <div class="example">
  35566. <pre class="example-preformatted">ffmpeg -i input.mp4 -vn -af &quot;whisper=model=../whisper.cpp/models/ggml-base.en.bin\
  35567. :language=en\
  35568. :queue=3\
  35569. :destination=output.srt\
  35570. :format=srt&quot; -f null -
  35571. </pre></div>
  35572. </li><li>Run a transcription and send the output in JSON format to an HTTP service:
  35573. <div class="example">
  35574. <pre class="example-preformatted">ffmpeg -i input.mp4 -vn -af &quot;whisper=model=../whisper.cpp/models/ggml-base.en.bin\
  35575. :language=en\
  35576. :queue=3\
  35577. :destination=http\\://localhost\\:3000\
  35578. :format=json' -f null -
  35579. </pre></div>
  35580. </li><li>Transcribe the microphone input using the VAD option:
  35581. <div class="example">
  35582. <pre class="example-preformatted">ffmpeg -loglevel warning -f pulse -i default \
  35583. -af 'highpass=f=200,lowpass=f=3000,whisper=model=../whisper.cpp/models/ggml-medium.bin\
  35584. :language=en\
  35585. :queue=10\
  35586. :destination=-\
  35587. :format=json\
  35588. :vad_model=../whisper.cpp/models/ggml-silero-v5.1.2.bin' -f null -
  35589. </pre></div>
  35590. </li></ul>
  35591. <a name="Audio-Sources"></a>
  35592. <h2 class="chapter">37 Audio Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sources" aria-hidden="true">TOC</a></span></h2>
  35593. <p>Below is a description of the currently available audio sources.
  35594. </p>
  35595. <a name="abuffer"></a>
  35596. <h3 class="section">37.1 abuffer<span class="pull-right"><a class="anchor hidden-xs" href="#abuffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffer" aria-hidden="true">TOC</a></span></h3>
  35597. <p>Buffer audio frames, and make them available to the filter chain.
  35598. </p>
  35599. <p>This source is mainly intended for a programmatic use, in particular
  35600. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  35601. </p>
  35602. <p>It accepts the following parameters:
  35603. </p><dl class="table">
  35604. <dt><samp class="option">time_base</samp></dt>
  35605. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  35606. either a floating-point number or in <var class="var">numerator</var>/<var class="var">denominator</var> form.
  35607. </p>
  35608. </dd>
  35609. <dt><samp class="option">sample_rate</samp></dt>
  35610. <dd><p>The sample rate of the incoming audio buffers.
  35611. </p>
  35612. </dd>
  35613. <dt><samp class="option">sample_fmt</samp></dt>
  35614. <dd><p>The sample format of the incoming audio buffers.
  35615. Either a sample format name or its corresponding integer representation from
  35616. the enum AVSampleFormat in <samp class="file">libavutil/samplefmt.h</samp>
  35617. </p>
  35618. </dd>
  35619. <dt><samp class="option">channel_layout</samp></dt>
  35620. <dd><p>The channel layout of the incoming audio buffers.
  35621. Either a channel layout name from channel_layout_map in
  35622. <samp class="file">libavutil/channel_layout.c</samp> or its corresponding integer representation
  35623. from the AV_CH_LAYOUT_* macros in <samp class="file">libavutil/channel_layout.h</samp>
  35624. </p>
  35625. </dd>
  35626. <dt><samp class="option">channels</samp></dt>
  35627. <dd><p>The number of channels of the incoming audio buffers.
  35628. If both <var class="var">channels</var> and <var class="var">channel_layout</var> are specified, then they
  35629. must be consistent.
  35630. </p>
  35631. </dd>
  35632. </dl>
  35633. <a name="Examples-84"></a>
  35634. <h4 class="subsection">37.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-84" aria-hidden="true">TOC</a></span></h4>
  35635. <div class="example">
  35636. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  35637. </pre></div>
  35638. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  35639. Since the sample format with name &quot;s16p&quot; corresponds to the number
  35640. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  35641. equivalent to:
  35642. </p><div class="example">
  35643. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  35644. </pre></div>
  35645. <a name="aevalsrc"></a>
  35646. <h3 class="section">37.2 aevalsrc<span class="pull-right"><a class="anchor hidden-xs" href="#aevalsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aevalsrc" aria-hidden="true">TOC</a></span></h3>
  35647. <p>Generate an audio signal specified by an expression.
  35648. </p>
  35649. <p>This source accepts in input one or more expressions (one for each
  35650. channel), which are evaluated and used to generate a corresponding
  35651. audio signal.
  35652. </p>
  35653. <p>This source accepts the following options:
  35654. </p>
  35655. <dl class="table">
  35656. <dt><samp class="option">exprs</samp></dt>
  35657. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  35658. <samp class="option">channel_layout</samp> option is not specified, the selected channel layout
  35659. depends on the number of provided expressions. Otherwise the last
  35660. specified expression is applied to the remaining output channels.
  35661. </p>
  35662. </dd>
  35663. <dt><samp class="option">channel_layout, c</samp></dt>
  35664. <dd><p>Set the channel layout. The number of channels in the specified layout
  35665. must be equal to the number of specified expressions.
  35666. </p>
  35667. </dd>
  35668. <dt><samp class="option">duration, d</samp></dt>
  35669. <dd><p>Set the minimum duration of the sourced audio. See
  35670. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  35671. for the accepted syntax.
  35672. Note that the resulting duration may be greater than the specified
  35673. duration, as the generated audio is always cut at the end of a
  35674. complete frame.
  35675. </p>
  35676. <p>If not specified, or the expressed duration is negative, the audio is
  35677. supposed to be generated forever.
  35678. </p>
  35679. </dd>
  35680. <dt><samp class="option">nb_samples, n</samp></dt>
  35681. <dd><p>Set the number of samples per channel per each output frame,
  35682. default to 1024.
  35683. </p>
  35684. </dd>
  35685. <dt><samp class="option">sample_rate, s</samp></dt>
  35686. <dd><p>Specify the sample rate, default to 44100.
  35687. </p></dd>
  35688. </dl>
  35689. <p>Each expression in <var class="var">exprs</var> can contain the following constants:
  35690. </p>
  35691. <dl class="table">
  35692. <dt><samp class="option">n</samp></dt>
  35693. <dd><p>number of the evaluated sample, starting from 0
  35694. </p>
  35695. </dd>
  35696. <dt><samp class="option">t</samp></dt>
  35697. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  35698. </p>
  35699. </dd>
  35700. <dt><samp class="option">s</samp></dt>
  35701. <dd><p>sample rate
  35702. </p>
  35703. </dd>
  35704. </dl>
  35705. <a name="Examples-85"></a>
  35706. <h4 class="subsection">37.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-85" aria-hidden="true">TOC</a></span></h4>
  35707. <ul class="itemize mark-bullet">
  35708. <li>Generate silence:
  35709. <div class="example">
  35710. <pre class="example-preformatted">aevalsrc=0
  35711. </pre></div>
  35712. </li><li>Generate a sin signal with frequency of 440 Hz, set sample rate to
  35713. 8000 Hz:
  35714. <div class="example">
  35715. <pre class="example-preformatted">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  35716. </pre></div>
  35717. </li><li>Generate a two channels signal, specify the channel layout (Front
  35718. Center + Back Center) explicitly:
  35719. <div class="example">
  35720. <pre class="example-preformatted">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  35721. </pre></div>
  35722. </li><li>Generate white noise:
  35723. <div class="example">
  35724. <pre class="example-preformatted">aevalsrc=&quot;-2+random(0)&quot;
  35725. </pre></div>
  35726. </li><li>Generate an amplitude modulated signal:
  35727. <div class="example">
  35728. <pre class="example-preformatted">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  35729. </pre></div>
  35730. </li><li>Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  35731. <div class="example">
  35732. <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;
  35733. </pre></div>
  35734. </li></ul>
  35735. <a name="afdelaysrc"></a>
  35736. <h3 class="section">37.3 afdelaysrc<span class="pull-right"><a class="anchor hidden-xs" href="#afdelaysrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afdelaysrc" aria-hidden="true">TOC</a></span></h3>
  35737. <p>Generate a fractional delay FIR coefficients.
  35738. </p>
  35739. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  35740. </p>
  35741. <p>The filter accepts the following options:
  35742. </p>
  35743. <dl class="table">
  35744. <dt><samp class="option">delay, d</samp></dt>
  35745. <dd><p>Set the fractional delay. Default is 0.
  35746. </p>
  35747. </dd>
  35748. <dt><samp class="option">sample_rate, r</samp></dt>
  35749. <dd><p>Set the sample rate, default is 44100.
  35750. </p>
  35751. </dd>
  35752. <dt><samp class="option">nb_samples, n</samp></dt>
  35753. <dd><p>Set the number of samples per each frame. Default is 1024.
  35754. </p>
  35755. </dd>
  35756. <dt><samp class="option">taps, t</samp></dt>
  35757. <dd><p>Set the number of filter coefficients in output audio stream.
  35758. Default value is 0.
  35759. </p>
  35760. </dd>
  35761. <dt><samp class="option">channel_layout, c</samp></dt>
  35762. <dd><p>Specifies the channel layout, and can be a string representing a channel layout.
  35763. The default value of <var class="var">channel_layout</var> is &quot;stereo&quot;.
  35764. </p></dd>
  35765. </dl>
  35766. <a name="afireqsrc"></a>
  35767. <h3 class="section">37.4 afireqsrc<span class="pull-right"><a class="anchor hidden-xs" href="#afireqsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afireqsrc" aria-hidden="true">TOC</a></span></h3>
  35768. <p>Generate a FIR equalizer coefficients.
  35769. </p>
  35770. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  35771. </p>
  35772. <p>The filter accepts the following options:
  35773. </p>
  35774. <dl class="table">
  35775. <dt><samp class="option">preset, p</samp></dt>
  35776. <dd><p>Set equalizer preset.
  35777. Default preset is <code class="code">flat</code>.
  35778. </p>
  35779. <p>Available presets are:
  35780. </p><dl class="table">
  35781. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  35782. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  35783. <dt>&lsquo;<samp class="samp">acoustic</samp>&rsquo;</dt>
  35784. <dt>&lsquo;<samp class="samp">bass</samp>&rsquo;</dt>
  35785. <dt>&lsquo;<samp class="samp">beats</samp>&rsquo;</dt>
  35786. <dt>&lsquo;<samp class="samp">classic</samp>&rsquo;</dt>
  35787. <dt>&lsquo;<samp class="samp">clear</samp>&rsquo;</dt>
  35788. <dt>&lsquo;<samp class="samp">deep bass</samp>&rsquo;</dt>
  35789. <dt>&lsquo;<samp class="samp">dubstep</samp>&rsquo;</dt>
  35790. <dt>&lsquo;<samp class="samp">electronic</samp>&rsquo;</dt>
  35791. <dt>&lsquo;<samp class="samp">hard-style</samp>&rsquo;</dt>
  35792. <dt>&lsquo;<samp class="samp">hip-hop</samp>&rsquo;</dt>
  35793. <dt>&lsquo;<samp class="samp">jazz</samp>&rsquo;</dt>
  35794. <dt>&lsquo;<samp class="samp">metal</samp>&rsquo;</dt>
  35795. <dt>&lsquo;<samp class="samp">movie</samp>&rsquo;</dt>
  35796. <dt>&lsquo;<samp class="samp">pop</samp>&rsquo;</dt>
  35797. <dt>&lsquo;<samp class="samp">r&amp;b</samp>&rsquo;</dt>
  35798. <dt>&lsquo;<samp class="samp">rock</samp>&rsquo;</dt>
  35799. <dt>&lsquo;<samp class="samp">vocal booster</samp>&rsquo;</dt>
  35800. </dl>
  35801. </dd>
  35802. <dt><samp class="option">gains, g</samp></dt>
  35803. <dd><p>Set custom gains for each band. Only used if the preset option is set to <code class="code">custom</code>.
  35804. Gains are separated by white spaces and each gain is set in dBFS.
  35805. Default is <code class="code">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</code>.
  35806. </p>
  35807. </dd>
  35808. <dt><samp class="option">bands, b</samp></dt>
  35809. <dd><p>Set the custom bands from where custom equalizer gains are set.
  35810. This must be in strictly increasing order. Only used if the preset option is set to <code class="code">custom</code>.
  35811. Bands are separated by white spaces and each band represent frequency in Hz.
  35812. Default is <code class="code">25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000</code>.
  35813. </p>
  35814. </dd>
  35815. <dt><samp class="option">taps, t</samp></dt>
  35816. <dd><p>Set number of filter coefficients in output audio stream.
  35817. Default value is <code class="code">4096</code>.
  35818. </p>
  35819. </dd>
  35820. <dt><samp class="option">sample_rate, r</samp></dt>
  35821. <dd><p>Set sample rate of output audio stream, default is <code class="code">44100</code>.
  35822. </p>
  35823. </dd>
  35824. <dt><samp class="option">nb_samples, n</samp></dt>
  35825. <dd><p>Set number of samples per each frame in output audio stream. Default is <code class="code">1024</code>.
  35826. </p>
  35827. </dd>
  35828. <dt><samp class="option">interp, i</samp></dt>
  35829. <dd><p>Set interpolation method for FIR equalizer coefficients. Can be <code class="code">linear</code> or <code class="code">cubic</code>.
  35830. </p>
  35831. </dd>
  35832. <dt><samp class="option">phase, h</samp></dt>
  35833. <dd><p>Set phase type of FIR filter. Can be <code class="code">linear</code> or <code class="code">min</code>: minimum-phase.
  35834. Default is minimum-phase filter.
  35835. </p></dd>
  35836. </dl>
  35837. <a name="afirsrc"></a>
  35838. <h3 class="section">37.5 afirsrc<span class="pull-right"><a class="anchor hidden-xs" href="#afirsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afirsrc" aria-hidden="true">TOC</a></span></h3>
  35839. <p>Generate a FIR coefficients using frequency sampling method.
  35840. </p>
  35841. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  35842. </p>
  35843. <p>The filter accepts the following options:
  35844. </p>
  35845. <dl class="table">
  35846. <dt><samp class="option">taps, t</samp></dt>
  35847. <dd><p>Set number of filter coefficients in output audio stream.
  35848. Default value is 1025.
  35849. </p>
  35850. </dd>
  35851. <dt><samp class="option">frequency, f</samp></dt>
  35852. <dd><p>Set frequency points from where magnitude and phase are set.
  35853. This must be in non decreasing order, and first element must be 0, while last element
  35854. must be 1. Elements are separated by white spaces.
  35855. </p>
  35856. </dd>
  35857. <dt><samp class="option">magnitude, m</samp></dt>
  35858. <dd><p>Set magnitude value for every frequency point set by <samp class="option">frequency</samp>.
  35859. Number of values must be same as number of frequency points.
  35860. Values are separated by white spaces.
  35861. </p>
  35862. </dd>
  35863. <dt><samp class="option">phase, p</samp></dt>
  35864. <dd><p>Set phase value for every frequency point set by <samp class="option">frequency</samp>.
  35865. Number of values must be same as number of frequency points.
  35866. Values are separated by white spaces.
  35867. </p>
  35868. </dd>
  35869. <dt><samp class="option">sample_rate, r</samp></dt>
  35870. <dd><p>Set sample rate, default is 44100.
  35871. </p>
  35872. </dd>
  35873. <dt><samp class="option">nb_samples, n</samp></dt>
  35874. <dd><p>Set number of samples per each frame. Default is 1024.
  35875. </p>
  35876. </dd>
  35877. <dt><samp class="option">win_func, w</samp></dt>
  35878. <dd><p>Set window function. Default is blackman.
  35879. </p></dd>
  35880. </dl>
  35881. <a name="anullsrc"></a>
  35882. <h3 class="section">37.6 anullsrc<span class="pull-right"><a class="anchor hidden-xs" href="#anullsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsrc" aria-hidden="true">TOC</a></span></h3>
  35883. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  35884. as a template and to be employed in analysis / debugging tools, or as
  35885. the source for filters which ignore the input data (for example the sox
  35886. synth filter).
  35887. </p>
  35888. <p>This source accepts the following options:
  35889. </p>
  35890. <dl class="table">
  35891. <dt><samp class="option">channel_layout, cl</samp></dt>
  35892. <dd>
  35893. <p>Specifies the channel layout, and can be either an integer or a string
  35894. representing a channel layout. The default value of <var class="var">channel_layout</var>
  35895. is &quot;stereo&quot;.
  35896. </p>
  35897. <p>Check the channel_layout_map definition in
  35898. <samp class="file">libavutil/channel_layout.c</samp> for the mapping between strings and
  35899. channel layout values.
  35900. </p>
  35901. </dd>
  35902. <dt><samp class="option">sample_rate, r</samp></dt>
  35903. <dd><p>Specifies the sample rate, and defaults to 44100.
  35904. </p>
  35905. </dd>
  35906. <dt><samp class="option">nb_samples, n</samp></dt>
  35907. <dd><p>Set the number of samples per requested frames.
  35908. </p>
  35909. </dd>
  35910. <dt><samp class="option">duration, d</samp></dt>
  35911. <dd><p>Set the duration of the sourced audio. See
  35912. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  35913. for the accepted syntax.
  35914. </p>
  35915. <p>If not specified, or the expressed duration is negative, the audio is
  35916. supposed to be generated forever.
  35917. </p></dd>
  35918. </dl>
  35919. <a name="Examples-86"></a>
  35920. <h4 class="subsection">37.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-86" aria-hidden="true">TOC</a></span></h4>
  35921. <ul class="itemize mark-bullet">
  35922. <li>Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  35923. <div class="example">
  35924. <pre class="example-preformatted">anullsrc=r=48000:cl=4
  35925. </pre></div>
  35926. </li><li>Do the same operation with a more obvious syntax:
  35927. <div class="example">
  35928. <pre class="example-preformatted">anullsrc=r=48000:cl=mono
  35929. </pre></div>
  35930. </li></ul>
  35931. <p>All the parameters need to be explicitly defined.
  35932. </p>
  35933. <a name="flite"></a>
  35934. <h3 class="section">37.7 flite<span class="pull-right"><a class="anchor hidden-xs" href="#flite" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flite" aria-hidden="true">TOC</a></span></h3>
  35935. <p>Synthesize a voice utterance using the libflite library.
  35936. </p>
  35937. <p>To enable compilation of this filter you need to configure FFmpeg with
  35938. <code class="code">--enable-libflite</code>.
  35939. </p>
  35940. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  35941. </p>
  35942. <p>The filter accepts the following options:
  35943. </p>
  35944. <dl class="table">
  35945. <dt><samp class="option">list_voices</samp></dt>
  35946. <dd><p>If set to 1, list the names of the available voices and exit
  35947. immediately. Default value is 0.
  35948. </p>
  35949. </dd>
  35950. <dt><samp class="option">nb_samples, n</samp></dt>
  35951. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  35952. </p>
  35953. </dd>
  35954. <dt><samp class="option">textfile</samp></dt>
  35955. <dd><p>Set the filename containing the text to speak.
  35956. </p>
  35957. </dd>
  35958. <dt><samp class="option">text</samp></dt>
  35959. <dd><p>Set the text to speak.
  35960. </p>
  35961. </dd>
  35962. <dt><samp class="option">voice, v</samp></dt>
  35963. <dd><p>Set the voice to use for the speech synthesis. Default value is
  35964. <code class="code">kal</code>. See also the <var class="var">list_voices</var> option.
  35965. </p></dd>
  35966. </dl>
  35967. <a name="Examples-87"></a>
  35968. <h4 class="subsection">37.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-87" aria-hidden="true">TOC</a></span></h4>
  35969. <ul class="itemize mark-bullet">
  35970. <li>Read from file <samp class="file">speech.txt</samp>, and synthesize the text using the
  35971. standard flite voice:
  35972. <div class="example">
  35973. <pre class="example-preformatted">flite=textfile=speech.txt
  35974. </pre></div>
  35975. </li><li>Read the specified text selecting the <code class="code">slt</code> voice:
  35976. <div class="example">
  35977. <pre class="example-preformatted">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  35978. </pre></div>
  35979. </li><li>Input text to ffmpeg:
  35980. <div class="example">
  35981. <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
  35982. </pre></div>
  35983. </li><li>Make <samp class="file">ffplay</samp> speak the specified text, using <code class="code">flite</code> and
  35984. the <code class="code">lavfi</code> device:
  35985. <div class="example">
  35986. <pre class="example-preformatted">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  35987. </pre></div>
  35988. </li></ul>
  35989. <p>For more information about libflite, check:
  35990. <a class="url" href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  35991. </p>
  35992. <a name="anoisesrc"></a>
  35993. <h3 class="section">37.8 anoisesrc<span class="pull-right"><a class="anchor hidden-xs" href="#anoisesrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anoisesrc" aria-hidden="true">TOC</a></span></h3>
  35994. <p>Generate a noise audio signal.
  35995. </p>
  35996. <p>The filter accepts the following options:
  35997. </p>
  35998. <dl class="table">
  35999. <dt><samp class="option">sample_rate, r</samp></dt>
  36000. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  36001. </p>
  36002. </dd>
  36003. <dt><samp class="option">amplitude, a</samp></dt>
  36004. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  36005. is 1.0.
  36006. </p>
  36007. </dd>
  36008. <dt><samp class="option">duration, d</samp></dt>
  36009. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  36010. results in noise with an infinite length.
  36011. </p>
  36012. </dd>
  36013. <dt><samp class="option">color, colour, c</samp></dt>
  36014. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  36015. blue, violet and velvet. Default color is white.
  36016. </p>
  36017. </dd>
  36018. <dt><samp class="option">seed, s</samp></dt>
  36019. <dd><p>Specify a value used to seed the PRNG.
  36020. </p>
  36021. </dd>
  36022. <dt><samp class="option">nb_samples, n</samp></dt>
  36023. <dd><p>Set the number of samples per each output frame, default is 1024.
  36024. </p>
  36025. </dd>
  36026. <dt><samp class="option">density</samp></dt>
  36027. <dd><p>Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05.
  36028. </p></dd>
  36029. </dl>
  36030. <a name="Examples-88"></a>
  36031. <h4 class="subsection">37.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-88" aria-hidden="true">TOC</a></span></h4>
  36032. <ul class="itemize mark-bullet">
  36033. <li>Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  36034. <div class="example">
  36035. <pre class="example-preformatted">anoisesrc=d=60:c=pink:r=44100:a=0.5
  36036. </pre></div>
  36037. </li></ul>
  36038. <a name="hilbert"></a>
  36039. <h3 class="section">37.9 hilbert<span class="pull-right"><a class="anchor hidden-xs" href="#hilbert" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hilbert" aria-hidden="true">TOC</a></span></h3>
  36040. <p>Generate odd-tap Hilbert transform FIR coefficients.
  36041. </p>
  36042. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for phase-shifting
  36043. the signal by 90 degrees.
  36044. </p>
  36045. <p>This is used in many matrix coding schemes and for analytic signal generation.
  36046. The process is often written as a multiplication by i (or j), the imaginary unit.
  36047. </p>
  36048. <p>The filter accepts the following options:
  36049. </p>
  36050. <dl class="table">
  36051. <dt><samp class="option">sample_rate, s</samp></dt>
  36052. <dd><p>Set sample rate, default is 44100.
  36053. </p>
  36054. </dd>
  36055. <dt><samp class="option">taps, t</samp></dt>
  36056. <dd><p>Set length of FIR filter, default is 22051.
  36057. </p>
  36058. </dd>
  36059. <dt><samp class="option">nb_samples, n</samp></dt>
  36060. <dd><p>Set number of samples per each frame.
  36061. </p>
  36062. </dd>
  36063. <dt><samp class="option">win_func, w</samp></dt>
  36064. <dd><p>Set window function to be used when generating FIR coefficients.
  36065. </p></dd>
  36066. </dl>
  36067. <a name="sinc"></a>
  36068. <h3 class="section">37.10 sinc<span class="pull-right"><a class="anchor hidden-xs" href="#sinc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sinc" aria-hidden="true">TOC</a></span></h3>
  36069. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  36070. </p>
  36071. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  36072. </p>
  36073. <p>The filter accepts the following options:
  36074. </p>
  36075. <dl class="table">
  36076. <dt><samp class="option">sample_rate, r</samp></dt>
  36077. <dd><p>Set sample rate, default is 44100.
  36078. </p>
  36079. </dd>
  36080. <dt><samp class="option">nb_samples, n</samp></dt>
  36081. <dd><p>Set number of samples per each frame. Default is 1024.
  36082. </p>
  36083. </dd>
  36084. <dt><samp class="option">hp</samp></dt>
  36085. <dd><p>Set high-pass frequency. Default is 0.
  36086. </p>
  36087. </dd>
  36088. <dt><samp class="option">lp</samp></dt>
  36089. <dd><p>Set low-pass frequency. Default is 0.
  36090. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  36091. is higher than 0 then filter will create band-pass filter coefficients,
  36092. otherwise band-reject filter coefficients.
  36093. </p>
  36094. </dd>
  36095. <dt><samp class="option">phase</samp></dt>
  36096. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  36097. </p>
  36098. </dd>
  36099. <dt><samp class="option">beta</samp></dt>
  36100. <dd><p>Set Kaiser window beta.
  36101. </p>
  36102. </dd>
  36103. <dt><samp class="option">att</samp></dt>
  36104. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  36105. </p>
  36106. </dd>
  36107. <dt><samp class="option">round</samp></dt>
  36108. <dd><p>Enable rounding, by default is disabled.
  36109. </p>
  36110. </dd>
  36111. <dt><samp class="option">hptaps</samp></dt>
  36112. <dd><p>Set number of taps for high-pass filter.
  36113. </p>
  36114. </dd>
  36115. <dt><samp class="option">lptaps</samp></dt>
  36116. <dd><p>Set number of taps for low-pass filter.
  36117. </p></dd>
  36118. </dl>
  36119. <a name="sine"></a>
  36120. <h3 class="section">37.11 sine<span class="pull-right"><a class="anchor hidden-xs" href="#sine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sine" aria-hidden="true">TOC</a></span></h3>
  36121. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  36122. </p>
  36123. <p>The audio signal is bit-exact.
  36124. </p>
  36125. <p>The filter accepts the following options:
  36126. </p>
  36127. <dl class="table">
  36128. <dt><samp class="option">frequency, f</samp></dt>
  36129. <dd><p>Set the carrier frequency. Default is 440 Hz.
  36130. </p>
  36131. </dd>
  36132. <dt><samp class="option">beep_factor, b</samp></dt>
  36133. <dd><p>Enable a periodic beep every second with frequency <var class="var">beep_factor</var> times
  36134. the carrier frequency. Default is 0, meaning the beep is disabled.
  36135. </p>
  36136. </dd>
  36137. <dt><samp class="option">sample_rate, r</samp></dt>
  36138. <dd><p>Specify the sample rate, default is 44100.
  36139. </p>
  36140. </dd>
  36141. <dt><samp class="option">duration, d</samp></dt>
  36142. <dd><p>Specify the duration of the generated audio stream.
  36143. </p>
  36144. </dd>
  36145. <dt><samp class="option">samples_per_frame</samp></dt>
  36146. <dd><p>Set the number of samples per output frame.
  36147. </p>
  36148. <p>The expression can contain the following constants:
  36149. </p>
  36150. <dl class="table">
  36151. <dt><samp class="option">n</samp></dt>
  36152. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  36153. </p>
  36154. </dd>
  36155. <dt><samp class="option">pts</samp></dt>
  36156. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  36157. expressed in <var class="var">TB</var> units.
  36158. </p>
  36159. </dd>
  36160. <dt><samp class="option">t</samp></dt>
  36161. <dd><p>The PTS of the output audio frame, expressed in seconds.
  36162. </p>
  36163. </dd>
  36164. <dt><samp class="option">TB</samp></dt>
  36165. <dd><p>The timebase of the output audio frames.
  36166. </p></dd>
  36167. </dl>
  36168. <p>Default is <code class="code">1024</code>.
  36169. </p></dd>
  36170. </dl>
  36171. <a name="Examples-89"></a>
  36172. <h4 class="subsection">37.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-89" aria-hidden="true">TOC</a></span></h4>
  36173. <ul class="itemize mark-bullet">
  36174. <li>Generate a simple 440 Hz sine wave:
  36175. <div class="example">
  36176. <pre class="example-preformatted">sine
  36177. </pre></div>
  36178. </li><li>Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  36179. <div class="example">
  36180. <pre class="example-preformatted">sine=220:4:d=5
  36181. sine=f=220:b=4:d=5
  36182. sine=frequency=220:beep_factor=4:duration=5
  36183. </pre></div>
  36184. </li><li>Generate a 1 kHz sine wave following <code class="code">1602,1601,1602,1601,1602</code> NTSC
  36185. pattern:
  36186. <div class="example">
  36187. <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)))'
  36188. </pre></div>
  36189. </li></ul>
  36190. <a name="Audio-Sinks"></a>
  36191. <h2 class="chapter">38 Audio Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sinks" aria-hidden="true">TOC</a></span></h2>
  36192. <p>Below is a description of the currently available audio sinks.
  36193. </p>
  36194. <a name="abuffersink"></a>
  36195. <h3 class="section">38.1 abuffersink<span class="pull-right"><a class="anchor hidden-xs" href="#abuffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffersink" aria-hidden="true">TOC</a></span></h3>
  36196. <p>Buffer audio frames, and make them available to the end of filter chain.
  36197. </p>
  36198. <p>This sink is mainly intended for programmatic use, in particular
  36199. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  36200. or the options system.
  36201. </p>
  36202. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  36203. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  36204. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  36205. </p><a name="anullsink"></a>
  36206. <h3 class="section">38.2 anullsink<span class="pull-right"><a class="anchor hidden-xs" href="#anullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsink" aria-hidden="true">TOC</a></span></h3>
  36207. <p>Null audio sink; do absolutely nothing with the input audio. It is
  36208. mainly useful as a template and for use in analysis / debugging
  36209. tools.
  36210. </p>
  36211. <a name="Video-Filters"></a>
  36212. <h2 class="chapter">39 Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  36213. <p>When you configure your FFmpeg build, you can disable any of the
  36214. existing filters using <code class="code">--disable-filters</code>.
  36215. The configure output will show the video filters included in your
  36216. build.
  36217. </p>
  36218. <p>Below is a description of the currently available video filters.
  36219. </p>
  36220. <a name="addroi"></a>
  36221. <h3 class="section">39.1 addroi<span class="pull-right"><a class="anchor hidden-xs" href="#addroi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-addroi" aria-hidden="true">TOC</a></span></h3>
  36222. <p>Mark a region of interest in a video frame.
  36223. </p>
  36224. <p>The frame data is passed through unchanged, but metadata is attached
  36225. to the frame indicating regions of interest which can affect the
  36226. behaviour of later encoding. Multiple regions can be marked by
  36227. applying the filter multiple times.
  36228. </p>
  36229. <dl class="table">
  36230. <dt><samp class="option">x</samp></dt>
  36231. <dd><p>Region distance in pixels from the left edge of the frame.
  36232. </p></dd>
  36233. <dt><samp class="option">y</samp></dt>
  36234. <dd><p>Region distance in pixels from the top edge of the frame.
  36235. </p></dd>
  36236. <dt><samp class="option">w</samp></dt>
  36237. <dd><p>Region width in pixels.
  36238. </p></dd>
  36239. <dt><samp class="option">h</samp></dt>
  36240. <dd><p>Region height in pixels.
  36241. </p>
  36242. <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,
  36243. and may contain the following variables:
  36244. </p><dl class="table">
  36245. <dt><samp class="option">iw</samp></dt>
  36246. <dd><p>Width of the input frame.
  36247. </p></dd>
  36248. <dt><samp class="option">ih</samp></dt>
  36249. <dd><p>Height of the input frame.
  36250. </p></dd>
  36251. </dl>
  36252. </dd>
  36253. <dt><samp class="option">qoffset</samp></dt>
  36254. <dd><p>Quantisation offset to apply within the region.
  36255. </p>
  36256. <p>This must be a real value in the range -1 to +1. A value of zero
  36257. indicates no quality change. A negative value asks for better quality
  36258. (less quantisation), while a positive value asks for worse quality
  36259. (greater quantisation).
  36260. </p>
  36261. <p>The range is calibrated so that the extreme values indicate the
  36262. largest possible offset - if the rest of the frame is encoded with the
  36263. worst possible quality, an offset of -1 indicates that this region
  36264. should be encoded with the best possible quality anyway. Intermediate
  36265. values are then interpolated in some codec-dependent way.
  36266. </p>
  36267. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  36268. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  36269. this region should be encoded with a QP around one-tenth of the full
  36270. range better than the rest of the frame. So, if most of the frame
  36271. were to be encoded with a QP of around 30, this region would get a QP
  36272. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  36273. An extreme value of -1 would indicate that this region should be
  36274. encoded with the best possible quality regardless of the treatment of
  36275. the rest of the frame - that is, should be encoded at a QP of -12.
  36276. </p></dd>
  36277. <dt><samp class="option">clear</samp></dt>
  36278. <dd><p>If set to true, remove any existing regions of interest marked on the
  36279. frame before adding the new one.
  36280. </p></dd>
  36281. </dl>
  36282. <a name="Examples-90"></a>
  36283. <h4 class="subsection">39.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-90" aria-hidden="true">TOC</a></span></h4>
  36284. <ul class="itemize mark-bullet">
  36285. <li>Mark the centre quarter of the frame as interesting.
  36286. <div class="example">
  36287. <pre class="example-preformatted">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  36288. </pre></div>
  36289. </li><li>Mark the 100-pixel-wide region on the left edge of the frame as very
  36290. uninteresting (to be encoded at much lower quality than the rest of
  36291. the frame).
  36292. <div class="example">
  36293. <pre class="example-preformatted">addroi=0:0:100:ih:+1/5
  36294. </pre></div>
  36295. </li></ul>
  36296. <a name="alphaextract"></a>
  36297. <h3 class="section">39.2 alphaextract<span class="pull-right"><a class="anchor hidden-xs" href="#alphaextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphaextract" aria-hidden="true">TOC</a></span></h3>
  36298. <p>Extract the alpha component from the input as a grayscale video. This
  36299. is especially useful with the <var class="var">alphamerge</var> filter.
  36300. </p>
  36301. <a name="alphamerge"></a>
  36302. <h3 class="section">39.3 alphamerge<span class="pull-right"><a class="anchor hidden-xs" href="#alphamerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphamerge" aria-hidden="true">TOC</a></span></h3>
  36303. <p>Add or replace the alpha component of the primary input with the
  36304. grayscale value of a second input. This is intended for use with
  36305. <var class="var">alphaextract</var> to allow the transmission or storage of frame
  36306. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  36307. channel.
  36308. </p>
  36309. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  36310. and a separate video created with <var class="var">alphaextract</var>, you might use:
  36311. </p><div class="example">
  36312. <pre class="example-preformatted">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  36313. </pre></div>
  36314. <a name="amplify"></a>
  36315. <h3 class="section">39.4 amplify<span class="pull-right"><a class="anchor hidden-xs" href="#amplify" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amplify" aria-hidden="true">TOC</a></span></h3>
  36316. <p>Amplify differences between current pixel and pixels of adjacent frames in
  36317. same pixel location.
  36318. </p>
  36319. <p>This filter accepts the following options:
  36320. </p>
  36321. <dl class="table">
  36322. <dt><samp class="option">radius</samp></dt>
  36323. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  36324. For example radius of 3 will instruct filter to calculate average of 7 frames.
  36325. </p>
  36326. </dd>
  36327. <dt><samp class="option">factor</samp></dt>
  36328. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  36329. </p>
  36330. </dd>
  36331. <dt><samp class="option">threshold</samp></dt>
  36332. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  36333. this value will not alter source pixel. Default is 10.
  36334. Allowed range is from 0 to 65535.
  36335. </p>
  36336. </dd>
  36337. <dt><samp class="option">tolerance</samp></dt>
  36338. <dd><p>Set tolerance for difference amplification. Any difference lower to
  36339. this value will not alter source pixel. Default is 0.
  36340. Allowed range is from 0 to 65535.
  36341. </p>
  36342. </dd>
  36343. <dt><samp class="option">low</samp></dt>
  36344. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  36345. This option controls maximum possible value that will decrease source pixel value.
  36346. </p>
  36347. </dd>
  36348. <dt><samp class="option">high</samp></dt>
  36349. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  36350. This option controls maximum possible value that will increase source pixel value.
  36351. </p>
  36352. </dd>
  36353. <dt><samp class="option">planes</samp></dt>
  36354. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  36355. </p></dd>
  36356. </dl>
  36357. <a name="Commands-54"></a>
  36358. <h4 class="subsection">39.4.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-54" aria-hidden="true">TOC</a></span></h4>
  36359. <p>This filter supports the following <a class="ref" href="#commands">commands</a> that corresponds to option of same name:
  36360. </p><dl class="table">
  36361. <dt><samp class="option">factor</samp></dt>
  36362. <dt><samp class="option">threshold</samp></dt>
  36363. <dt><samp class="option">tolerance</samp></dt>
  36364. <dt><samp class="option">low</samp></dt>
  36365. <dt><samp class="option">high</samp></dt>
  36366. <dt><samp class="option">planes</samp></dt>
  36367. </dl>
  36368. <a name="ass-1"></a>
  36369. <h3 class="section">39.5 ass<span class="pull-right"><a class="anchor hidden-xs" href="#ass-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ass-1" aria-hidden="true">TOC</a></span></h3>
  36370. <p>Same as the <a class="ref" href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  36371. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  36372. Substation Alpha) subtitles files.
  36373. </p>
  36374. <p>This filter accepts the following option in addition to the common options from
  36375. the <a class="ref" href="#subtitles">subtitles</a> filter:
  36376. </p>
  36377. <dl class="table">
  36378. <dt><samp class="option">shaping</samp></dt>
  36379. <dd><p>Set the shaping engine
  36380. </p>
  36381. <p>Available values are:
  36382. </p><dl class="table">
  36383. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  36384. <dd><p>The default libass shaping engine, which is the best available.
  36385. </p></dd>
  36386. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  36387. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  36388. </p></dd>
  36389. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  36390. <dd><p>Slower shaper using OpenType for substitutions and positioning
  36391. </p></dd>
  36392. </dl>
  36393. <p>The default is <code class="code">auto</code>.
  36394. </p></dd>
  36395. </dl>
  36396. <a name="atadenoise"></a>
  36397. <h3 class="section">39.6 atadenoise<span class="pull-right"><a class="anchor hidden-xs" href="#atadenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atadenoise" aria-hidden="true">TOC</a></span></h3>
  36398. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  36399. </p>
  36400. <p>The filter accepts the following options:
  36401. </p>
  36402. <dl class="table">
  36403. <dt><samp class="option">0a</samp></dt>
  36404. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  36405. Valid range is 0 to 0.3.
  36406. </p>
  36407. </dd>
  36408. <dt><samp class="option">0b</samp></dt>
  36409. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  36410. Valid range is 0 to 5.
  36411. </p>
  36412. </dd>
  36413. <dt><samp class="option">1a</samp></dt>
  36414. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  36415. Valid range is 0 to 0.3.
  36416. </p>
  36417. </dd>
  36418. <dt><samp class="option">1b</samp></dt>
  36419. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  36420. Valid range is 0 to 5.
  36421. </p>
  36422. </dd>
  36423. <dt><samp class="option">2a</samp></dt>
  36424. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  36425. Valid range is 0 to 0.3.
  36426. </p>
  36427. </dd>
  36428. <dt><samp class="option">2b</samp></dt>
  36429. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  36430. Valid range is 0 to 5.
  36431. </p>
  36432. <p>Threshold A is designed to react on abrupt changes in the input signal and
  36433. threshold B is designed to react on continuous changes in the input signal.
  36434. </p>
  36435. </dd>
  36436. <dt><samp class="option">s</samp></dt>
  36437. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  36438. number in range [5, 129].
  36439. </p>
  36440. </dd>
  36441. <dt><samp class="option">p</samp></dt>
  36442. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  36443. </p>
  36444. </dd>
  36445. <dt><samp class="option">a</samp></dt>
  36446. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code class="code">p</code> parallel.
  36447. Alternatively can be set to <code class="code">s</code> serial.
  36448. </p>
  36449. <p>Parallel can be faster then serial, while other way around is never true.
  36450. Parallel will abort early on first change being greater then thresholds, while serial
  36451. will continue processing other side of frames if they are equal or below thresholds.
  36452. </p>
  36453. </dd>
  36454. <dt><samp class="option">0s</samp></dt>
  36455. <dt><samp class="option">1s</samp></dt>
  36456. <dt><samp class="option">2s</samp></dt>
  36457. <dd><p>Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
  36458. Valid range is from 0 to 32767.
  36459. This options controls weight for each pixel in radius defined by size.
  36460. Default value means every pixel have same weight.
  36461. Setting this option to 0 effectively disables filtering.
  36462. </p></dd>
  36463. </dl>
  36464. <a name="Commands-55"></a>
  36465. <h4 class="subsection">39.6.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-55" aria-hidden="true">TOC</a></span></h4>
  36466. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options except option <code class="code">s</code>.
  36467. The command accepts the same syntax of the corresponding option.
  36468. </p>
  36469. <a name="avgblur"></a>
  36470. <h3 class="section">39.7 avgblur<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur" aria-hidden="true">TOC</a></span></h3>
  36471. <p>Apply average blur filter.
  36472. </p>
  36473. <p>The filter accepts the following options:
  36474. </p>
  36475. <dl class="table">
  36476. <dt><samp class="option">sizeX</samp></dt>
  36477. <dd><p>Set horizontal radius size.
  36478. </p>
  36479. </dd>
  36480. <dt><samp class="option">planes</samp></dt>
  36481. <dd><p>Set which planes to filter. By default all planes are filtered.
  36482. </p>
  36483. </dd>
  36484. <dt><samp class="option">sizeY</samp></dt>
  36485. <dd><p>Set vertical radius size, if zero it will be same as <code class="code">sizeX</code>.
  36486. Default is <code class="code">0</code>.
  36487. </p></dd>
  36488. </dl>
  36489. <a name="Commands-56"></a>
  36490. <h4 class="subsection">39.7.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-56" aria-hidden="true">TOC</a></span></h4>
  36491. <p>This filter supports same commands as options.
  36492. The command accepts the same syntax of the corresponding option.
  36493. </p>
  36494. <p>If the specified expression is not valid, it is kept at its current
  36495. value.
  36496. </p>
  36497. <a name="backgroundkey"></a>
  36498. <h3 class="section">39.8 backgroundkey<span class="pull-right"><a class="anchor hidden-xs" href="#backgroundkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-backgroundkey" aria-hidden="true">TOC</a></span></h3>
  36499. <p>Turns a static background into transparency.
  36500. </p>
  36501. <p>The filter accepts the following option:
  36502. </p>
  36503. <dl class="table">
  36504. <dt><samp class="option">threshold</samp></dt>
  36505. <dd><p>Threshold for scene change detection.
  36506. </p></dd>
  36507. <dt><samp class="option">similarity</samp></dt>
  36508. <dd><p>Similarity percentage with the background.
  36509. </p></dd>
  36510. <dt><samp class="option">blend</samp></dt>
  36511. <dd><p>Set the blend amount for pixels that are not similar.
  36512. </p></dd>
  36513. </dl>
  36514. <a name="Commands-57"></a>
  36515. <h4 class="subsection">39.8.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-57" aria-hidden="true">TOC</a></span></h4>
  36516. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36517. </p>
  36518. <a name="bbox"></a>
  36519. <h3 class="section">39.9 bbox<span class="pull-right"><a class="anchor hidden-xs" href="#bbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bbox" aria-hidden="true">TOC</a></span></h3>
  36520. <p>Compute the bounding box for the non-black pixels in the input frame
  36521. luma plane.
  36522. </p>
  36523. <p>This filter computes the bounding box containing all the pixels with a
  36524. luma value greater than the minimum allowed value.
  36525. The parameters describing the bounding box are printed on the filter
  36526. log.
  36527. </p>
  36528. <p>The filter accepts the following option:
  36529. </p>
  36530. <dl class="table">
  36531. <dt><samp class="option">min_val</samp></dt>
  36532. <dd><p>Set the minimal luma value. Default is <code class="code">16</code>.
  36533. </p></dd>
  36534. </dl>
  36535. <a name="Commands-58"></a>
  36536. <h4 class="subsection">39.9.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-58" aria-hidden="true">TOC</a></span></h4>
  36537. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36538. </p>
  36539. <a name="bilateral"></a>
  36540. <h3 class="section">39.10 bilateral<span class="pull-right"><a class="anchor hidden-xs" href="#bilateral" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bilateral" aria-hidden="true">TOC</a></span></h3>
  36541. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  36542. </p>
  36543. <p>The filter accepts the following options:
  36544. </p><dl class="table">
  36545. <dt><samp class="option">sigmaS</samp></dt>
  36546. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  36547. Allowed range is 0 to 512. Default is 0.1.
  36548. </p>
  36549. </dd>
  36550. <dt><samp class="option">sigmaR</samp></dt>
  36551. <dd><p>Set sigma of gaussian function to calculate range weight.
  36552. Allowed range is 0 to 1. Default is 0.1.
  36553. </p>
  36554. </dd>
  36555. <dt><samp class="option">planes</samp></dt>
  36556. <dd><p>Set planes to filter. Default is first only.
  36557. </p></dd>
  36558. </dl>
  36559. <a name="Commands-59"></a>
  36560. <h4 class="subsection">39.10.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-59" aria-hidden="true">TOC</a></span></h4>
  36561. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  36562. </p>
  36563. <a name="bitplanenoise"></a>
  36564. <h3 class="section">39.11 bitplanenoise<span class="pull-right"><a class="anchor hidden-xs" href="#bitplanenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bitplanenoise" aria-hidden="true">TOC</a></span></h3>
  36565. <p>Show and measure bit plane noise.
  36566. </p>
  36567. <p>The filter accepts the following options:
  36568. </p>
  36569. <dl class="table">
  36570. <dt><samp class="option">bitplane</samp></dt>
  36571. <dd><p>Set which plane to analyze. Default is <code class="code">1</code>.
  36572. </p>
  36573. </dd>
  36574. <dt><samp class="option">filter</samp></dt>
  36575. <dd><p>Filter out noisy pixels from <code class="code">bitplane</code> set above.
  36576. Default is disabled.
  36577. </p></dd>
  36578. </dl>
  36579. <a name="blackdetect_002c-blackdetect_005fvulkan"></a>
  36580. <h3 class="section">39.12 blackdetect, blackdetect_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#blackdetect_002c-blackdetect_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackdetect_002c-blackdetect_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  36581. <p>Detect video intervals that are (almost) completely black. Can be
  36582. useful to detect chapter transitions, commercials, or invalid
  36583. recordings.
  36584. </p>
  36585. <p>The filter outputs its detection analysis to both the log as well as
  36586. frame metadata. If a black segment of at least the specified minimum
  36587. duration is found, a line with the start and end timestamps as well
  36588. as duration is printed to the log with level <code class="code">info</code>. In addition,
  36589. a log line with level <code class="code">debug</code> is printed per frame showing the
  36590. black amount detected for that frame.
  36591. </p>
  36592. <p>The filter also attaches metadata to the first frame of a black
  36593. segment with key <code class="code">lavfi.black_start</code> and to the first frame
  36594. after the black segment ends with key <code class="code">lavfi.black_end</code>. The
  36595. value is the frame&rsquo;s timestamp. This metadata is added regardless
  36596. of the minimum duration specified.
  36597. </p>
  36598. <p>The filter accepts the following options:
  36599. </p>
  36600. <dl class="table">
  36601. <dt><samp class="option">black_min_duration, d</samp></dt>
  36602. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  36603. be a non-negative floating point number.
  36604. </p>
  36605. <p>Default value is 2.0.
  36606. </p>
  36607. </dd>
  36608. <dt><samp class="option">picture_black_ratio_th, pic_th</samp></dt>
  36609. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  36610. Express the minimum value for the ratio:
  36611. </p><div class="example">
  36612. <pre class="example-preformatted"><var class="var">nb_black_pixels</var> / <var class="var">nb_pixels</var>
  36613. </pre></div>
  36614. <p>for which a picture is considered black.
  36615. Default value is 0.98.
  36616. </p>
  36617. </dd>
  36618. <dt><samp class="option">pixel_black_th, pix_th</samp></dt>
  36619. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  36620. </p>
  36621. <p>The threshold expresses the maximum pixel luma value for which a
  36622. pixel is considered &quot;black&quot;. The provided value is scaled according to
  36623. the following equation:
  36624. </p><div class="example">
  36625. <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>
  36626. </pre></div>
  36627. <p><var class="var">luma_range_size</var> and <var class="var">luma_minimum_value</var> depend on
  36628. the input video format, the range is [0-255] for YUV full-range
  36629. formats and [16-235] for YUV non full-range formats.
  36630. </p>
  36631. <p>Default value is 0.10.
  36632. </p>
  36633. </dd>
  36634. <dt><samp class="option">alpha</samp></dt>
  36635. <dd><p>If true, check the alpha channel instead of the luma channel. Detects frames
  36636. which are (almost) transparent, instead of frames which are almost black.
  36637. </p>
  36638. <p>Default value is disabled.
  36639. </p></dd>
  36640. </dl>
  36641. <p>The following example sets the maximum pixel threshold to the minimum
  36642. value, and detects only black intervals of 2 or more seconds:
  36643. </p><div class="example">
  36644. <pre class="example-preformatted">blackdetect=d=2:pix_th=0.00
  36645. </pre></div>
  36646. <a name="blackframe"></a>
  36647. <h3 class="section">39.13 blackframe<span class="pull-right"><a class="anchor hidden-xs" href="#blackframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackframe" aria-hidden="true">TOC</a></span></h3>
  36648. <p>Detect frames that are (almost) completely black. Can be useful to
  36649. detect chapter transitions or commercials. Output lines consist of
  36650. the frame number of the detected frame, the percentage of blackness,
  36651. the position in the file if known or -1 and the timestamp in seconds.
  36652. </p>
  36653. <p>In order to display the output lines, you need to set the loglevel at
  36654. least to the AV_LOG_INFO value.
  36655. </p>
  36656. <p>This filter exports frame metadata <code class="code">lavfi.blackframe.pblack</code>.
  36657. The value represents the percentage of pixels in the picture that
  36658. are below the threshold value.
  36659. </p>
  36660. <p>It accepts the following parameters:
  36661. </p>
  36662. <dl class="table">
  36663. <dt><samp class="option">amount</samp></dt>
  36664. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  36665. <code class="code">98</code>.
  36666. </p>
  36667. </dd>
  36668. <dt><samp class="option">threshold, thresh</samp></dt>
  36669. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  36670. <code class="code">32</code>.
  36671. </p>
  36672. </dd>
  36673. </dl>
  36674. <a class="anchor" id="blend"></a><a name="blend-1"></a>
  36675. <h3 class="section">39.14 blend<span class="pull-right"><a class="anchor hidden-xs" href="#blend-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blend-1" aria-hidden="true">TOC</a></span></h3>
  36676. <p>Blend two video frames into each other.
  36677. </p>
  36678. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  36679. stream, the first input is the &quot;top&quot; layer and second input is
  36680. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  36681. </p>
  36682. <p>The <code class="code">tblend</code> (time blend) filter takes two consecutive frames
  36683. from one single stream, and outputs the result obtained by blending
  36684. the new frame on top of the old frame.
  36685. </p>
  36686. <p>A description of the accepted options follows.
  36687. </p>
  36688. <dl class="table">
  36689. <dt><samp class="option">c0_mode</samp></dt>
  36690. <dt><samp class="option">c1_mode</samp></dt>
  36691. <dt><samp class="option">c2_mode</samp></dt>
  36692. <dt><samp class="option">c3_mode</samp></dt>
  36693. <dt><samp class="option">all_mode</samp></dt>
  36694. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  36695. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  36696. </p>
  36697. <p>Available values for component modes are:
  36698. </p><dl class="table">
  36699. <dt>&lsquo;<samp class="samp">addition</samp>&rsquo;</dt>
  36700. <dt>&lsquo;<samp class="samp">and</samp>&rsquo;</dt>
  36701. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  36702. <dt>&lsquo;<samp class="samp">bleach</samp>&rsquo;</dt>
  36703. <dt>&lsquo;<samp class="samp">burn</samp>&rsquo;</dt>
  36704. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  36705. <dt>&lsquo;<samp class="samp">difference</samp>&rsquo;</dt>
  36706. <dt>&lsquo;<samp class="samp">divide</samp>&rsquo;</dt>
  36707. <dt>&lsquo;<samp class="samp">dodge</samp>&rsquo;</dt>
  36708. <dt>&lsquo;<samp class="samp">exclusion</samp>&rsquo;</dt>
  36709. <dt>&lsquo;<samp class="samp">extremity</samp>&rsquo;</dt>
  36710. <dt>&lsquo;<samp class="samp">freeze</samp>&rsquo;</dt>
  36711. <dt>&lsquo;<samp class="samp">geometric</samp>&rsquo;</dt>
  36712. <dt>&lsquo;<samp class="samp">glow</samp>&rsquo;</dt>
  36713. <dt>&lsquo;<samp class="samp">grainextract</samp>&rsquo;</dt>
  36714. <dt>&lsquo;<samp class="samp">grainmerge</samp>&rsquo;</dt>
  36715. <dt>&lsquo;<samp class="samp">hardlight</samp>&rsquo;</dt>
  36716. <dt>&lsquo;<samp class="samp">hardmix</samp>&rsquo;</dt>
  36717. <dt>&lsquo;<samp class="samp">hardoverlay</samp>&rsquo;</dt>
  36718. <dt>&lsquo;<samp class="samp">harmonic</samp>&rsquo;</dt>
  36719. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  36720. <dt>&lsquo;<samp class="samp">interpolate</samp>&rsquo;</dt>
  36721. <dt>&lsquo;<samp class="samp">lighten</samp>&rsquo;</dt>
  36722. <dt>&lsquo;<samp class="samp">linearlight</samp>&rsquo;</dt>
  36723. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  36724. <dt>&lsquo;<samp class="samp">multiply128</samp>&rsquo;</dt>
  36725. <dt>&lsquo;<samp class="samp">negation</samp>&rsquo;</dt>
  36726. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  36727. <dt>&lsquo;<samp class="samp">or</samp>&rsquo;</dt>
  36728. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  36729. <dt>&lsquo;<samp class="samp">phoenix</samp>&rsquo;</dt>
  36730. <dt>&lsquo;<samp class="samp">pinlight</samp>&rsquo;</dt>
  36731. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  36732. <dt>&lsquo;<samp class="samp">screen</samp>&rsquo;</dt>
  36733. <dt>&lsquo;<samp class="samp">softdifference</samp>&rsquo;</dt>
  36734. <dt>&lsquo;<samp class="samp">softlight</samp>&rsquo;</dt>
  36735. <dt>&lsquo;<samp class="samp">stain</samp>&rsquo;</dt>
  36736. <dt>&lsquo;<samp class="samp">subtract</samp>&rsquo;</dt>
  36737. <dt>&lsquo;<samp class="samp">vividlight</samp>&rsquo;</dt>
  36738. <dt>&lsquo;<samp class="samp">xor</samp>&rsquo;</dt>
  36739. </dl>
  36740. </dd>
  36741. <dt><samp class="option">c0_opacity</samp></dt>
  36742. <dt><samp class="option">c1_opacity</samp></dt>
  36743. <dt><samp class="option">c2_opacity</samp></dt>
  36744. <dt><samp class="option">c3_opacity</samp></dt>
  36745. <dt><samp class="option">all_opacity</samp></dt>
  36746. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  36747. of <var class="var">all_opacity</var>. Only used in combination with pixel component blend modes.
  36748. </p>
  36749. </dd>
  36750. <dt><samp class="option">c0_expr</samp></dt>
  36751. <dt><samp class="option">c1_expr</samp></dt>
  36752. <dt><samp class="option">c2_expr</samp></dt>
  36753. <dt><samp class="option">c3_expr</samp></dt>
  36754. <dt><samp class="option">all_expr</samp></dt>
  36755. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  36756. of <var class="var">all_expr</var>. Note that related mode options will be ignored if those are set.
  36757. </p>
  36758. <p>The expressions can use the following variables:
  36759. </p>
  36760. <dl class="table">
  36761. <dt><samp class="option">N</samp></dt>
  36762. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  36763. </p>
  36764. </dd>
  36765. <dt><samp class="option">X</samp></dt>
  36766. <dt><samp class="option">Y</samp></dt>
  36767. <dd><p>the coordinates of the current sample
  36768. </p>
  36769. </dd>
  36770. <dt><samp class="option">W</samp></dt>
  36771. <dt><samp class="option">H</samp></dt>
  36772. <dd><p>the width and height of currently filtered plane
  36773. </p>
  36774. </dd>
  36775. <dt><samp class="option">SW</samp></dt>
  36776. <dt><samp class="option">SH</samp></dt>
  36777. <dd><p>Width and height scale for the plane being filtered. It is the
  36778. ratio between the dimensions of the current plane to the luma plane,
  36779. e.g. for a <code class="code">yuv420p</code> frame, the values are <code class="code">1,1</code> for
  36780. the luma plane and <code class="code">0.5,0.5</code> for the chroma planes.
  36781. </p>
  36782. </dd>
  36783. <dt><samp class="option">T</samp></dt>
  36784. <dd><p>Time of the current frame, expressed in seconds.
  36785. </p>
  36786. </dd>
  36787. <dt><samp class="option">TOP, A</samp></dt>
  36788. <dd><p>Value of pixel component at current location for first video frame (top layer).
  36789. </p>
  36790. </dd>
  36791. <dt><samp class="option">BOTTOM, B</samp></dt>
  36792. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  36793. </p></dd>
  36794. </dl>
  36795. </dd>
  36796. </dl>
  36797. <p>The <code class="code">blend</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  36798. </p>
  36799. <a name="Examples-91"></a>
  36800. <h4 class="subsection">39.14.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-91" aria-hidden="true">TOC</a></span></h4>
  36801. <ul class="itemize mark-bullet">
  36802. <li>Apply transition from bottom layer to top layer in first 10 seconds:
  36803. <div class="example">
  36804. <pre class="example-preformatted">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  36805. </pre></div>
  36806. </li><li>Apply linear horizontal transition from top layer to bottom layer:
  36807. <div class="example">
  36808. <pre class="example-preformatted">blend=all_expr='A*(X/W)+B*(1-X/W)'
  36809. </pre></div>
  36810. </li><li>Apply 1x1 checkerboard effect:
  36811. <div class="example">
  36812. <pre class="example-preformatted">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  36813. </pre></div>
  36814. </li><li>Apply uncover left effect:
  36815. <div class="example">
  36816. <pre class="example-preformatted">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  36817. </pre></div>
  36818. </li><li>Apply uncover down effect:
  36819. <div class="example">
  36820. <pre class="example-preformatted">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  36821. </pre></div>
  36822. </li><li>Apply uncover up-left effect:
  36823. <div class="example">
  36824. <pre class="example-preformatted">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  36825. </pre></div>
  36826. </li><li>Split diagonally video and shows top and bottom layer on each side:
  36827. <div class="example">
  36828. <pre class="example-preformatted">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  36829. </pre></div>
  36830. </li><li>Display differences between the current and the previous frame:
  36831. <div class="example">
  36832. <pre class="example-preformatted">tblend=all_mode=grainextract
  36833. </pre></div>
  36834. </li></ul>
  36835. <a name="Commands-60"></a>
  36836. <h4 class="subsection">39.14.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-60" aria-hidden="true">TOC</a></span></h4>
  36837. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  36838. </p>
  36839. <a class="anchor" id="blockdetect"></a><a name="blockdetect-1"></a>
  36840. <h3 class="section">39.15 blockdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blockdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blockdetect-1" aria-hidden="true">TOC</a></span></h3>
  36841. <p>Determines blockiness of frames without altering the input frames.
  36842. </p>
  36843. <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.
  36844. </p>
  36845. <p>The filter accepts the following options:
  36846. </p>
  36847. <dl class="table">
  36848. <dt><samp class="option">period_min</samp></dt>
  36849. <dt><samp class="option">period_max</samp></dt>
  36850. <dd><p>Set minimum and maximum values for determining pixel grids (periods).
  36851. Default values are [3,24].
  36852. </p>
  36853. </dd>
  36854. <dt><samp class="option">planes</samp></dt>
  36855. <dd><p>Set planes to filter. Default is first only.
  36856. </p></dd>
  36857. </dl>
  36858. <a name="Examples-92"></a>
  36859. <h4 class="subsection">39.15.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-92" aria-hidden="true">TOC</a></span></h4>
  36860. <ul class="itemize mark-bullet">
  36861. <li>Determine blockiness for the first plane and search for periods within [8,32]:
  36862. <div class="example">
  36863. <pre class="example-preformatted">blockdetect=period_min=8:period_max=32:planes=1
  36864. </pre></div>
  36865. </li></ul>
  36866. <a class="anchor" id="blurdetect"></a><a name="blurdetect-1"></a>
  36867. <h3 class="section">39.16 blurdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blurdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blurdetect-1" aria-hidden="true">TOC</a></span></h3>
  36868. <p>Determines blurriness of frames without altering the input frames.
  36869. </p>
  36870. <p>Based on Marziliano, Pina, et al. &quot;A no-reference perceptual blur metric.&quot;
  36871. Allows for a block-based abbreviation.
  36872. </p>
  36873. <p>The filter accepts the following options:
  36874. </p>
  36875. <dl class="table">
  36876. <dt><samp class="option">low</samp></dt>
  36877. <dt><samp class="option">high</samp></dt>
  36878. <dd><p>Set low and high threshold values used by the Canny thresholding
  36879. algorithm.
  36880. </p>
  36881. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  36882. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  36883. by the low threshold.
  36884. </p>
  36885. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  36886. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  36887. </p>
  36888. <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>
  36889. is <code class="code">50/255</code>.
  36890. </p>
  36891. </dd>
  36892. <dt><samp class="option">radius</samp></dt>
  36893. <dd><p>Define the radius to search around an edge pixel for local maxima.
  36894. </p>
  36895. </dd>
  36896. <dt><samp class="option">block_pct</samp></dt>
  36897. <dd><p>Determine blurriness only for the most significant blocks, given in percentage.
  36898. </p>
  36899. </dd>
  36900. <dt><samp class="option">block_width</samp></dt>
  36901. <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>.
  36902. </p>
  36903. </dd>
  36904. <dt><samp class="option">block_height</samp></dt>
  36905. <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>.
  36906. </p>
  36907. </dd>
  36908. <dt><samp class="option">planes</samp></dt>
  36909. <dd><p>Set planes to filter. Default is first only.
  36910. </p></dd>
  36911. </dl>
  36912. <a name="Examples-93"></a>
  36913. <h4 class="subsection">39.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-93" aria-hidden="true">TOC</a></span></h4>
  36914. <ul class="itemize mark-bullet">
  36915. <li>Determine blur for 80% of most significant 32x32 blocks:
  36916. <div class="example">
  36917. <pre class="example-preformatted">blurdetect=block_width=32:block_height=32:block_pct=80
  36918. </pre></div>
  36919. </li></ul>
  36920. <a name="bm3d"></a>
  36921. <h3 class="section">39.17 bm3d<span class="pull-right"><a class="anchor hidden-xs" href="#bm3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bm3d" aria-hidden="true">TOC</a></span></h3>
  36922. <p>Denoise frames using Block-Matching 3D algorithm.
  36923. </p>
  36924. <p>The filter accepts the following options.
  36925. </p>
  36926. <dl class="table">
  36927. <dt><samp class="option">sigma</samp></dt>
  36928. <dd><p>Set denoising strength. Default value is 1.
  36929. Allowed range is from 0 to 999.9.
  36930. The denoising algorithm is very sensitive to sigma, so adjust it
  36931. according to the source.
  36932. </p>
  36933. </dd>
  36934. <dt><samp class="option">block</samp></dt>
  36935. <dd><p>Set local patch size. This sets dimensions in 2D.
  36936. </p>
  36937. </dd>
  36938. <dt><samp class="option">bstep</samp></dt>
  36939. <dd><p>Set sliding step for processing blocks. Default value is 4.
  36940. Allowed range is from 1 to 64.
  36941. Smaller values allows processing more reference blocks and is slower.
  36942. </p>
  36943. </dd>
  36944. <dt><samp class="option">group</samp></dt>
  36945. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  36946. When set to 1, no block matching is done. Larger values allows more blocks
  36947. in single group.
  36948. Allowed range is from 1 to 256.
  36949. </p>
  36950. </dd>
  36951. <dt><samp class="option">range</samp></dt>
  36952. <dd><p>Set radius for search block matching. Default is 9.
  36953. Allowed range is from 1 to INT32_MAX.
  36954. </p>
  36955. </dd>
  36956. <dt><samp class="option">mstep</samp></dt>
  36957. <dd><p>Set step between two search locations for block matching. Default is 1.
  36958. Allowed range is from 1 to 64. Smaller is slower.
  36959. </p>
  36960. </dd>
  36961. <dt><samp class="option">thmse</samp></dt>
  36962. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  36963. INT32_MAX.
  36964. </p>
  36965. </dd>
  36966. <dt><samp class="option">hdthr</samp></dt>
  36967. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  36968. Larger values results in stronger hard-thresholding filtering in frequency
  36969. domain.
  36970. </p>
  36971. </dd>
  36972. <dt><samp class="option">estim</samp></dt>
  36973. <dd><p>Set filtering estimation mode. Can be <code class="code">basic</code> or <code class="code">final</code>.
  36974. Default is <code class="code">basic</code>.
  36975. </p>
  36976. </dd>
  36977. <dt><samp class="option">ref</samp></dt>
  36978. <dd><p>If enabled, filter will use 2nd stream for block matching.
  36979. Default is disabled for <code class="code">basic</code> value of <var class="var">estim</var> option,
  36980. and always enabled if value of <var class="var">estim</var> is <code class="code">final</code>.
  36981. </p>
  36982. </dd>
  36983. <dt><samp class="option">planes</samp></dt>
  36984. <dd><p>Set planes to filter. Default is all available except alpha.
  36985. </p></dd>
  36986. </dl>
  36987. <a name="Examples-94"></a>
  36988. <h4 class="subsection">39.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-94" aria-hidden="true">TOC</a></span></h4>
  36989. <ul class="itemize mark-bullet">
  36990. <li>Basic filtering with bm3d:
  36991. <div class="example">
  36992. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  36993. </pre></div>
  36994. </li><li>Same as above, but filtering only luma:
  36995. <div class="example">
  36996. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  36997. </pre></div>
  36998. </li><li>Same as above, but with both estimation modes:
  36999. <div class="example">
  37000. <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
  37001. </pre></div>
  37002. </li><li>Same as above, but prefilter with <a class="ref" href="#nlmeans">nlmeans</a> filter instead:
  37003. <div class="example">
  37004. <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
  37005. </pre></div>
  37006. </li></ul>
  37007. <a name="boxblur"></a>
  37008. <h3 class="section">39.18 boxblur<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur" aria-hidden="true">TOC</a></span></h3>
  37009. <p>Apply a boxblur algorithm to the input video.
  37010. </p>
  37011. <p>It accepts the following parameters:
  37012. </p>
  37013. <dl class="table">
  37014. <dt><samp class="option">luma_radius, lr</samp></dt>
  37015. <dt><samp class="option">luma_power, lp</samp></dt>
  37016. <dt><samp class="option">chroma_radius, cr</samp></dt>
  37017. <dt><samp class="option">chroma_power, cp</samp></dt>
  37018. <dt><samp class="option">alpha_radius, ar</samp></dt>
  37019. <dt><samp class="option">alpha_power, ap</samp></dt>
  37020. </dl>
  37021. <p>A description of the accepted options follows.
  37022. </p>
  37023. <dl class="table">
  37024. <dt><samp class="option">luma_radius, lr</samp></dt>
  37025. <dt><samp class="option">chroma_radius, cr</samp></dt>
  37026. <dt><samp class="option">alpha_radius, ar</samp></dt>
  37027. <dd><p>Set an expression for the box radius in pixels used for blurring the
  37028. corresponding input plane.
  37029. </p>
  37030. <p>The radius value must be a non-negative number, and must not be
  37031. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  37032. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  37033. planes.
  37034. </p>
  37035. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  37036. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  37037. corresponding value set for <samp class="option">luma_radius</samp>.
  37038. </p>
  37039. <p>The expressions can contain the following constants:
  37040. </p><dl class="table">
  37041. <dt><samp class="option">w</samp></dt>
  37042. <dt><samp class="option">h</samp></dt>
  37043. <dd><p>The input width and height in pixels.
  37044. </p>
  37045. </dd>
  37046. <dt><samp class="option">cw</samp></dt>
  37047. <dt><samp class="option">ch</samp></dt>
  37048. <dd><p>The input chroma image width and height in pixels.
  37049. </p>
  37050. </dd>
  37051. <dt><samp class="option">hsub</samp></dt>
  37052. <dt><samp class="option">vsub</samp></dt>
  37053. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  37054. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  37055. </p></dd>
  37056. </dl>
  37057. </dd>
  37058. <dt><samp class="option">luma_power, lp</samp></dt>
  37059. <dt><samp class="option">chroma_power, cp</samp></dt>
  37060. <dt><samp class="option">alpha_power, ap</samp></dt>
  37061. <dd><p>Specify how many times the boxblur filter is applied to the
  37062. corresponding plane.
  37063. </p>
  37064. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  37065. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  37066. corresponding value set for <samp class="option">luma_power</samp>.
  37067. </p>
  37068. <p>A value of 0 will disable the effect.
  37069. </p></dd>
  37070. </dl>
  37071. <a name="Examples-95"></a>
  37072. <h4 class="subsection">39.18.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-95" aria-hidden="true">TOC</a></span></h4>
  37073. <ul class="itemize mark-bullet">
  37074. <li>Apply a boxblur filter with the luma, chroma, and alpha radii
  37075. set to 2:
  37076. <div class="example">
  37077. <pre class="example-preformatted">boxblur=luma_radius=2:luma_power=1
  37078. boxblur=2:1
  37079. </pre></div>
  37080. </li><li>Set the luma radius to 2, and alpha and chroma radius to 0:
  37081. <div class="example">
  37082. <pre class="example-preformatted">boxblur=2:1:cr=0:ar=0
  37083. </pre></div>
  37084. </li><li>Set the luma and chroma radii to a fraction of the video dimension:
  37085. <div class="example">
  37086. <pre class="example-preformatted">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  37087. </pre></div>
  37088. </li></ul>
  37089. <a class="anchor" id="bwdif"></a><a name="bwdif-1"></a>
  37090. <h3 class="section">39.19 bwdif<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif-1" aria-hidden="true">TOC</a></span></h3>
  37091. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  37092. Deinterlacing Filter&quot;).
  37093. </p>
  37094. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  37095. interpolation algorithms.
  37096. It accepts the following parameters:
  37097. </p>
  37098. <dl class="table">
  37099. <dt><samp class="option">mode</samp></dt>
  37100. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  37101. </p>
  37102. <dl class="table">
  37103. <dt><samp class="option">0, send_frame</samp></dt>
  37104. <dd><p>Output one frame for each frame.
  37105. </p></dd>
  37106. <dt><samp class="option">1, send_field</samp></dt>
  37107. <dd><p>Output one frame for each field.
  37108. </p></dd>
  37109. </dl>
  37110. <p>The default value is <code class="code">send_field</code>.
  37111. </p>
  37112. </dd>
  37113. <dt><samp class="option">parity</samp></dt>
  37114. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  37115. of the following values:
  37116. </p>
  37117. <dl class="table">
  37118. <dt><samp class="option">0, tff</samp></dt>
  37119. <dd><p>Assume the top field is first.
  37120. </p></dd>
  37121. <dt><samp class="option">1, bff</samp></dt>
  37122. <dd><p>Assume the bottom field is first.
  37123. </p></dd>
  37124. <dt><samp class="option">-1, auto</samp></dt>
  37125. <dd><p>Enable automatic detection of field parity.
  37126. </p></dd>
  37127. </dl>
  37128. <p>The default value is <code class="code">auto</code>.
  37129. If the interlacing is unknown or the decoder does not export this information,
  37130. top field first will be assumed.
  37131. </p>
  37132. </dd>
  37133. <dt><samp class="option">deint</samp></dt>
  37134. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  37135. values:
  37136. </p>
  37137. <dl class="table">
  37138. <dt><samp class="option">0, all</samp></dt>
  37139. <dd><p>Deinterlace all frames.
  37140. </p></dd>
  37141. <dt><samp class="option">1, interlaced</samp></dt>
  37142. <dd><p>Only deinterlace frames marked as interlaced.
  37143. </p></dd>
  37144. </dl>
  37145. <p>The default value is <code class="code">all</code>.
  37146. </p></dd>
  37147. </dl>
  37148. <a name="ccrepack"></a>
  37149. <h3 class="section">39.20 ccrepack<span class="pull-right"><a class="anchor hidden-xs" href="#ccrepack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ccrepack" aria-hidden="true">TOC</a></span></h3>
  37150. <p>Repack CEA-708 closed captioning side data
  37151. </p>
  37152. <p>This filter fixes various issues seen with commercial encoders
  37153. related to upstream malformed CEA-708 payloads, specifically
  37154. incorrect number of tuples (wrong cc_count for the target FPS),
  37155. and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at
  37156. the first entries in the payload).
  37157. </p>
  37158. <a name="cas"></a>
  37159. <h3 class="section">39.21 cas<span class="pull-right"><a class="anchor hidden-xs" href="#cas" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cas" aria-hidden="true">TOC</a></span></h3>
  37160. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  37161. </p>
  37162. <p>The filter accepts the following options:
  37163. </p>
  37164. <dl class="table">
  37165. <dt><samp class="option">strength</samp></dt>
  37166. <dd><p>Set the sharpening strength. Default value is 0.
  37167. </p>
  37168. </dd>
  37169. <dt><samp class="option">planes</samp></dt>
  37170. <dd><p>Set planes to filter. Default value is to filter all
  37171. planes except alpha plane.
  37172. </p></dd>
  37173. </dl>
  37174. <a name="Commands-61"></a>
  37175. <h4 class="subsection">39.21.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-61" aria-hidden="true">TOC</a></span></h4>
  37176. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37177. </p>
  37178. <a name="chromahold"></a>
  37179. <h3 class="section">39.22 chromahold<span class="pull-right"><a class="anchor hidden-xs" href="#chromahold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromahold" aria-hidden="true">TOC</a></span></h3>
  37180. <p>Remove all color information for all colors except for certain one.
  37181. </p>
  37182. <p>The filter accepts the following options:
  37183. </p>
  37184. <dl class="table">
  37185. <dt><samp class="option">color</samp></dt>
  37186. <dd><p>The color which will not be replaced with neutral chroma.
  37187. </p>
  37188. </dd>
  37189. <dt><samp class="option">similarity</samp></dt>
  37190. <dd><p>Similarity percentage with the above color.
  37191. 0.01 matches only the exact key color, while 1.0 matches everything.
  37192. </p>
  37193. </dd>
  37194. <dt><samp class="option">blend</samp></dt>
  37195. <dd><p>Blend percentage.
  37196. 0.0 makes pixels either fully gray, or not gray at all.
  37197. Higher values result in more preserved color.
  37198. </p>
  37199. </dd>
  37200. <dt><samp class="option">yuv</samp></dt>
  37201. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  37202. </p>
  37203. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  37204. This can be used to pass exact YUV values as hexadecimal numbers.
  37205. </p></dd>
  37206. </dl>
  37207. <a name="Commands-62"></a>
  37208. <h4 class="subsection">39.22.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-62" aria-hidden="true">TOC</a></span></h4>
  37209. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37210. The command accepts the same syntax of the corresponding option.
  37211. </p>
  37212. <p>If the specified expression is not valid, it is kept at its current
  37213. value.
  37214. </p>
  37215. <a class="anchor" id="chromakey"></a><a name="chromakey-1"></a>
  37216. <h3 class="section">39.23 chromakey<span class="pull-right"><a class="anchor hidden-xs" href="#chromakey-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromakey-1" aria-hidden="true">TOC</a></span></h3>
  37217. <p>YUV colorspace color/chroma keying.
  37218. </p>
  37219. <p>The filter accepts the following options:
  37220. </p>
  37221. <dl class="table">
  37222. <dt><samp class="option">color</samp></dt>
  37223. <dd><p>The color which will be replaced with transparency.
  37224. </p>
  37225. </dd>
  37226. <dt><samp class="option">similarity</samp></dt>
  37227. <dd><p>Similarity percentage with the key color.
  37228. </p>
  37229. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  37230. </p>
  37231. </dd>
  37232. <dt><samp class="option">blend</samp></dt>
  37233. <dd><p>Blend percentage.
  37234. </p>
  37235. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  37236. </p>
  37237. <p>Higher values result in semi-transparent pixels, with a higher transparency
  37238. the more similar the pixels color is to the key color.
  37239. </p>
  37240. </dd>
  37241. <dt><samp class="option">yuv</samp></dt>
  37242. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  37243. </p>
  37244. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  37245. This can be used to pass exact YUV values as hexadecimal numbers.
  37246. </p></dd>
  37247. </dl>
  37248. <a name="Commands-63"></a>
  37249. <h4 class="subsection">39.23.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-63" aria-hidden="true">TOC</a></span></h4>
  37250. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37251. The command accepts the same syntax of the corresponding option.
  37252. </p>
  37253. <p>If the specified expression is not valid, it is kept at its current
  37254. value.
  37255. </p>
  37256. <a name="Examples-96"></a>
  37257. <h4 class="subsection">39.23.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-96" aria-hidden="true">TOC</a></span></h4>
  37258. <ul class="itemize mark-bullet">
  37259. <li>Make every green pixel in the input image transparent:
  37260. <div class="example">
  37261. <pre class="example-preformatted">ffmpeg -i input.png -vf chromakey=green out.png
  37262. </pre></div>
  37263. </li><li>Overlay a greenscreen-video on top of a static black background.
  37264. <div class="example">
  37265. <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
  37266. </pre></div>
  37267. </li></ul>
  37268. <a name="chromanr"></a>
  37269. <h3 class="section">39.24 chromanr<span class="pull-right"><a class="anchor hidden-xs" href="#chromanr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromanr" aria-hidden="true">TOC</a></span></h3>
  37270. <p>Reduce chrominance noise.
  37271. </p>
  37272. <p>The filter accepts the following options:
  37273. </p>
  37274. <dl class="table">
  37275. <dt><samp class="option">thres</samp></dt>
  37276. <dd><p>Set threshold for averaging chrominance values.
  37277. Sum of absolute difference of Y, U and V pixel components of current
  37278. pixel and neighbour pixels lower than this threshold will be used in
  37279. averaging. Luma component is left unchanged and is copied to output.
  37280. Default value is 30. Allowed range is from 1 to 200.
  37281. </p>
  37282. </dd>
  37283. <dt><samp class="option">sizew</samp></dt>
  37284. <dd><p>Set horizontal radius of rectangle used for averaging.
  37285. Allowed range is from 1 to 100. Default value is 5.
  37286. </p>
  37287. </dd>
  37288. <dt><samp class="option">sizeh</samp></dt>
  37289. <dd><p>Set vertical radius of rectangle used for averaging.
  37290. Allowed range is from 1 to 100. Default value is 5.
  37291. </p>
  37292. </dd>
  37293. <dt><samp class="option">stepw</samp></dt>
  37294. <dd><p>Set horizontal step when averaging. Default value is 1.
  37295. Allowed range is from 1 to 50.
  37296. Mostly useful to speed-up filtering.
  37297. </p>
  37298. </dd>
  37299. <dt><samp class="option">steph</samp></dt>
  37300. <dd><p>Set vertical step when averaging. Default value is 1.
  37301. Allowed range is from 1 to 50.
  37302. Mostly useful to speed-up filtering.
  37303. </p>
  37304. </dd>
  37305. <dt><samp class="option">threy</samp></dt>
  37306. <dd><p>Set Y threshold for averaging chrominance values.
  37307. Set finer control for max allowed difference between Y components
  37308. of current pixel and neighbour pixels.
  37309. Default value is 200. Allowed range is from 1 to 200.
  37310. </p>
  37311. </dd>
  37312. <dt><samp class="option">threu</samp></dt>
  37313. <dd><p>Set U threshold for averaging chrominance values.
  37314. Set finer control for max allowed difference between U components
  37315. of current pixel and neighbour pixels.
  37316. Default value is 200. Allowed range is from 1 to 200.
  37317. </p>
  37318. </dd>
  37319. <dt><samp class="option">threv</samp></dt>
  37320. <dd><p>Set V threshold for averaging chrominance values.
  37321. Set finer control for max allowed difference between V components
  37322. of current pixel and neighbour pixels.
  37323. Default value is 200. Allowed range is from 1 to 200.
  37324. </p>
  37325. </dd>
  37326. <dt><samp class="option">distance</samp></dt>
  37327. <dd><p>Set distance type used in calculations.
  37328. </p>
  37329. <dl class="table">
  37330. <dt>&lsquo;<samp class="samp">manhattan</samp>&rsquo;</dt>
  37331. <dd><p>Absolute difference.
  37332. </p></dd>
  37333. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  37334. <dd><p>Difference squared.
  37335. </p></dd>
  37336. </dl>
  37337. <p>Default distance type is manhattan.
  37338. </p></dd>
  37339. </dl>
  37340. <a name="Commands-64"></a>
  37341. <h4 class="subsection">39.24.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-64" aria-hidden="true">TOC</a></span></h4>
  37342. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37343. The command accepts the same syntax of the corresponding option.
  37344. </p>
  37345. <a name="chromashift"></a>
  37346. <h3 class="section">39.25 chromashift<span class="pull-right"><a class="anchor hidden-xs" href="#chromashift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromashift" aria-hidden="true">TOC</a></span></h3>
  37347. <p>Shift chroma pixels horizontally and/or vertically.
  37348. </p>
  37349. <p>The filter accepts the following options:
  37350. </p><dl class="table">
  37351. <dt><samp class="option">cbh</samp></dt>
  37352. <dd><p>Set amount to shift chroma-blue horizontally.
  37353. </p></dd>
  37354. <dt><samp class="option">cbv</samp></dt>
  37355. <dd><p>Set amount to shift chroma-blue vertically.
  37356. </p></dd>
  37357. <dt><samp class="option">crh</samp></dt>
  37358. <dd><p>Set amount to shift chroma-red horizontally.
  37359. </p></dd>
  37360. <dt><samp class="option">crv</samp></dt>
  37361. <dd><p>Set amount to shift chroma-red vertically.
  37362. </p></dd>
  37363. <dt><samp class="option">edge</samp></dt>
  37364. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  37365. </p></dd>
  37366. </dl>
  37367. <a name="Commands-65"></a>
  37368. <h4 class="subsection">39.25.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-65" aria-hidden="true">TOC</a></span></h4>
  37369. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37370. </p>
  37371. <a name="ciescope"></a>
  37372. <h3 class="section">39.26 ciescope<span class="pull-right"><a class="anchor hidden-xs" href="#ciescope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ciescope" aria-hidden="true">TOC</a></span></h3>
  37373. <p>Display CIE color diagram with pixels overlaid onto it.
  37374. </p>
  37375. <p>The filter accepts the following options:
  37376. </p>
  37377. <dl class="table">
  37378. <dt><samp class="option">system</samp></dt>
  37379. <dd><p>Set color system.
  37380. </p>
  37381. <dl class="table">
  37382. <dt>&lsquo;<samp class="samp">ntsc, 470m</samp>&rsquo;</dt>
  37383. <dt>&lsquo;<samp class="samp">ebu, 470bg</samp>&rsquo;</dt>
  37384. <dt>&lsquo;<samp class="samp">smpte</samp>&rsquo;</dt>
  37385. <dt>&lsquo;<samp class="samp">240m</samp>&rsquo;</dt>
  37386. <dt>&lsquo;<samp class="samp">apple</samp>&rsquo;</dt>
  37387. <dt>&lsquo;<samp class="samp">widergb</samp>&rsquo;</dt>
  37388. <dt>&lsquo;<samp class="samp">cie1931</samp>&rsquo;</dt>
  37389. <dt>&lsquo;<samp class="samp">rec709, hdtv</samp>&rsquo;</dt>
  37390. <dt>&lsquo;<samp class="samp">uhdtv, rec2020</samp>&rsquo;</dt>
  37391. <dt>&lsquo;<samp class="samp">dcip3</samp>&rsquo;</dt>
  37392. </dl>
  37393. </dd>
  37394. <dt><samp class="option">cie</samp></dt>
  37395. <dd><p>Set CIE system.
  37396. </p>
  37397. <dl class="table">
  37398. <dt>&lsquo;<samp class="samp">xyy</samp>&rsquo;</dt>
  37399. <dt>&lsquo;<samp class="samp">ucs</samp>&rsquo;</dt>
  37400. <dt>&lsquo;<samp class="samp">luv</samp>&rsquo;</dt>
  37401. </dl>
  37402. </dd>
  37403. <dt><samp class="option">gamuts</samp></dt>
  37404. <dd><p>Set what gamuts to draw.
  37405. </p>
  37406. <p>See <code class="code">system</code> option for available values.
  37407. </p>
  37408. </dd>
  37409. <dt><samp class="option">size, s</samp></dt>
  37410. <dd><p>Set ciescope size, by default set to 512.
  37411. </p>
  37412. </dd>
  37413. <dt><samp class="option">intensity, i</samp></dt>
  37414. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  37415. </p>
  37416. </dd>
  37417. <dt><samp class="option">contrast</samp></dt>
  37418. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  37419. </p>
  37420. </dd>
  37421. <dt><samp class="option">corrgamma</samp></dt>
  37422. <dd><p>Correct gamma displayed on scope, by default enabled.
  37423. </p>
  37424. </dd>
  37425. <dt><samp class="option">showwhite</samp></dt>
  37426. <dd><p>Show white point on CIE diagram, by default disabled.
  37427. </p>
  37428. </dd>
  37429. <dt><samp class="option">gamma</samp></dt>
  37430. <dd><p>Set input gamma. Used only with XYZ input color space.
  37431. </p>
  37432. </dd>
  37433. <dt><samp class="option">fill</samp></dt>
  37434. <dd><p>Fill with CIE colors. By default is enabled.
  37435. </p></dd>
  37436. </dl>
  37437. <a name="codecview"></a>
  37438. <h3 class="section">39.27 codecview<span class="pull-right"><a class="anchor hidden-xs" href="#codecview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codecview" aria-hidden="true">TOC</a></span></h3>
  37439. <p>Visualize information exported by some codecs.
  37440. </p>
  37441. <p>Some codecs can export information through frames using side-data or other
  37442. means. For example, some MPEG based codecs export motion vectors through the
  37443. <var class="var">export_mvs</var> flag in the codec <samp class="option">flags2</samp> option.
  37444. </p>
  37445. <p>The filter accepts the following option:
  37446. </p>
  37447. <dl class="table">
  37448. <dt><samp class="option">block</samp></dt>
  37449. <dd><p>Display block partition structure using the luma plane.
  37450. </p>
  37451. </dd>
  37452. <dt><samp class="option">mv</samp></dt>
  37453. <dd><p>Set motion vectors to visualize.
  37454. </p>
  37455. <p>Available flags for <var class="var">mv</var> are:
  37456. </p>
  37457. <dl class="table">
  37458. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  37459. <dd><p>forward predicted MVs of P-frames
  37460. </p></dd>
  37461. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  37462. <dd><p>forward predicted MVs of B-frames
  37463. </p></dd>
  37464. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  37465. <dd><p>backward predicted MVs of B-frames
  37466. </p></dd>
  37467. </dl>
  37468. </dd>
  37469. <dt><samp class="option">qp</samp></dt>
  37470. <dd><p>Display quantization parameters using the chroma planes.
  37471. </p>
  37472. </dd>
  37473. <dt><samp class="option">mv_type, mvt</samp></dt>
  37474. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var class="var">frame_type</var> option.
  37475. </p>
  37476. <p>Available flags for <var class="var">mv_type</var> are:
  37477. </p>
  37478. <dl class="table">
  37479. <dt>&lsquo;<samp class="samp">fp</samp>&rsquo;</dt>
  37480. <dd><p>forward predicted MVs
  37481. </p></dd>
  37482. <dt>&lsquo;<samp class="samp">bp</samp>&rsquo;</dt>
  37483. <dd><p>backward predicted MVs
  37484. </p></dd>
  37485. </dl>
  37486. </dd>
  37487. <dt><samp class="option">frame_type, ft</samp></dt>
  37488. <dd><p>Set frame type to visualize motion vectors of.
  37489. </p>
  37490. <p>Available flags for <var class="var">frame_type</var> are:
  37491. </p>
  37492. <dl class="table">
  37493. <dt>&lsquo;<samp class="samp">if</samp>&rsquo;</dt>
  37494. <dd><p>intra-coded frames (I-frames)
  37495. </p></dd>
  37496. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  37497. <dd><p>predicted frames (P-frames)
  37498. </p></dd>
  37499. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  37500. <dd><p>bi-directionally predicted frames (B-frames)
  37501. </p></dd>
  37502. </dl>
  37503. </dd>
  37504. </dl>
  37505. <a name="Examples-97"></a>
  37506. <h4 class="subsection">39.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-97" aria-hidden="true">TOC</a></span></h4>
  37507. <ul class="itemize mark-bullet">
  37508. <li>Visualize forward predicted MVs of all frames using <code class="command">ffplay</code>:
  37509. <div class="example">
  37510. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  37511. </pre></div>
  37512. </li><li>Visualize multi-directionals MVs of P and B-Frames using <code class="command">ffplay</code>:
  37513. <div class="example">
  37514. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  37515. </pre></div>
  37516. </li></ul>
  37517. <a name="colorbalance"></a>
  37518. <h3 class="section">39.28 colorbalance<span class="pull-right"><a class="anchor hidden-xs" href="#colorbalance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorbalance" aria-hidden="true">TOC</a></span></h3>
  37519. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  37520. </p>
  37521. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  37522. regions for the red-cyan, green-magenta or blue-yellow balance.
  37523. </p>
  37524. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  37525. value towards the complementary color.
  37526. </p>
  37527. <p>The filter accepts the following options:
  37528. </p>
  37529. <dl class="table">
  37530. <dt><samp class="option">rs</samp></dt>
  37531. <dt><samp class="option">gs</samp></dt>
  37532. <dt><samp class="option">bs</samp></dt>
  37533. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  37534. </p>
  37535. </dd>
  37536. <dt><samp class="option">rm</samp></dt>
  37537. <dt><samp class="option">gm</samp></dt>
  37538. <dt><samp class="option">bm</samp></dt>
  37539. <dd><p>Adjust red, green and blue midtones (medium pixels).
  37540. </p>
  37541. </dd>
  37542. <dt><samp class="option">rh</samp></dt>
  37543. <dt><samp class="option">gh</samp></dt>
  37544. <dt><samp class="option">bh</samp></dt>
  37545. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  37546. </p>
  37547. <p>Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  37548. </p>
  37549. </dd>
  37550. <dt><samp class="option">pl</samp></dt>
  37551. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  37552. </p></dd>
  37553. </dl>
  37554. <a name="Examples-98"></a>
  37555. <h4 class="subsection">39.28.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-98" aria-hidden="true">TOC</a></span></h4>
  37556. <ul class="itemize mark-bullet">
  37557. <li>Add red color cast to shadows:
  37558. <div class="example">
  37559. <pre class="example-preformatted">colorbalance=rs=.3
  37560. </pre></div>
  37561. </li></ul>
  37562. <a name="Commands-66"></a>
  37563. <h4 class="subsection">39.28.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-66" aria-hidden="true">TOC</a></span></h4>
  37564. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37565. </p>
  37566. <a name="colorcontrast"></a>
  37567. <h3 class="section">39.29 colorcontrast<span class="pull-right"><a class="anchor hidden-xs" href="#colorcontrast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorcontrast" aria-hidden="true">TOC</a></span></h3>
  37568. <p>Adjust color contrast between RGB components.
  37569. </p>
  37570. <p>The filter accepts the following options:
  37571. </p>
  37572. <dl class="table">
  37573. <dt><samp class="option">rc</samp></dt>
  37574. <dd><p>Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  37575. </p>
  37576. </dd>
  37577. <dt><samp class="option">gm</samp></dt>
  37578. <dd><p>Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  37579. </p>
  37580. </dd>
  37581. <dt><samp class="option">by</samp></dt>
  37582. <dd><p>Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  37583. </p>
  37584. </dd>
  37585. <dt><samp class="option">rcw</samp></dt>
  37586. <dt><samp class="option">gmw</samp></dt>
  37587. <dt><samp class="option">byw</samp></dt>
  37588. <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.
  37589. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled.
  37590. </p>
  37591. </dd>
  37592. <dt><samp class="option">pl</samp></dt>
  37593. <dd><p>Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  37594. </p></dd>
  37595. </dl>
  37596. <a name="Commands-67"></a>
  37597. <h4 class="subsection">39.29.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-67" aria-hidden="true">TOC</a></span></h4>
  37598. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37599. </p>
  37600. <a name="colorcorrect"></a>
  37601. <h3 class="section">39.30 colorcorrect<span class="pull-right"><a class="anchor hidden-xs" href="#colorcorrect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorcorrect" aria-hidden="true">TOC</a></span></h3>
  37602. <p>Adjust color white balance selectively for blacks and whites.
  37603. This filter operates in YUV colorspace.
  37604. </p>
  37605. <p>The filter accepts the following options:
  37606. </p>
  37607. <dl class="table">
  37608. <dt><samp class="option">rl</samp></dt>
  37609. <dd><p>Set the red shadow spot. Allowed range is from -1.0 to 1.0.
  37610. Default value is 0.
  37611. </p>
  37612. </dd>
  37613. <dt><samp class="option">bl</samp></dt>
  37614. <dd><p>Set the blue shadow spot. Allowed range is from -1.0 to 1.0.
  37615. Default value is 0.
  37616. </p>
  37617. </dd>
  37618. <dt><samp class="option">rh</samp></dt>
  37619. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  37620. Default value is 0.
  37621. </p>
  37622. </dd>
  37623. <dt><samp class="option">bh</samp></dt>
  37624. <dd><p>Set the blue highlight spot. Allowed range is from -1.0 to 1.0.
  37625. Default value is 0.
  37626. </p>
  37627. </dd>
  37628. <dt><samp class="option">saturation</samp></dt>
  37629. <dd><p>Set the amount of saturation. Allowed range is from -3.0 to 3.0.
  37630. Default value is 1.
  37631. </p>
  37632. </dd>
  37633. <dt><samp class="option">analyze</samp></dt>
  37634. <dd><p>If set to anything other than <code class="code">manual</code> it will analyze every frame and use derived
  37635. parameters for filtering output frame.
  37636. </p>
  37637. <p>Possible values are:
  37638. </p><dl class="table">
  37639. <dt>&lsquo;<samp class="samp">manual</samp>&rsquo;</dt>
  37640. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  37641. <dt>&lsquo;<samp class="samp">minmax</samp>&rsquo;</dt>
  37642. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  37643. </dl>
  37644. <p>Default value is <code class="code">manual</code>.
  37645. </p></dd>
  37646. </dl>
  37647. <a name="Commands-68"></a>
  37648. <h4 class="subsection">39.30.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-68" aria-hidden="true">TOC</a></span></h4>
  37649. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37650. </p>
  37651. <a name="colorchannelmixer"></a>
  37652. <h3 class="section">39.31 colorchannelmixer<span class="pull-right"><a class="anchor hidden-xs" href="#colorchannelmixer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorchannelmixer" aria-hidden="true">TOC</a></span></h3>
  37653. <p>Adjust video input frames by re-mixing color channels.
  37654. </p>
  37655. <p>This filter modifies a color channel by adding the values associated to
  37656. the other channels of the same pixels. For example if the value to
  37657. modify is red, the output value will be:
  37658. </p><div class="example">
  37659. <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>
  37660. </pre></div>
  37661. <p>The filter accepts the following options:
  37662. </p>
  37663. <dl class="table">
  37664. <dt><samp class="option">rr</samp></dt>
  37665. <dt><samp class="option">rg</samp></dt>
  37666. <dt><samp class="option">rb</samp></dt>
  37667. <dt><samp class="option">ra</samp></dt>
  37668. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  37669. 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>.
  37670. </p>
  37671. </dd>
  37672. <dt><samp class="option">gr</samp></dt>
  37673. <dt><samp class="option">gg</samp></dt>
  37674. <dt><samp class="option">gb</samp></dt>
  37675. <dt><samp class="option">ga</samp></dt>
  37676. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  37677. 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>.
  37678. </p>
  37679. </dd>
  37680. <dt><samp class="option">br</samp></dt>
  37681. <dt><samp class="option">bg</samp></dt>
  37682. <dt><samp class="option">bb</samp></dt>
  37683. <dt><samp class="option">ba</samp></dt>
  37684. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  37685. 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>.
  37686. </p>
  37687. </dd>
  37688. <dt><samp class="option">ar</samp></dt>
  37689. <dt><samp class="option">ag</samp></dt>
  37690. <dt><samp class="option">ab</samp></dt>
  37691. <dt><samp class="option">aa</samp></dt>
  37692. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  37693. 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>.
  37694. </p>
  37695. <p>Allowed ranges for options are <code class="code">[-2.0, 2.0]</code>.
  37696. </p>
  37697. </dd>
  37698. <dt><samp class="option">pc</samp></dt>
  37699. <dd><p>Set preserve color mode. The accepted values are:
  37700. </p><dl class="table">
  37701. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  37702. <dd><p>Disable color preserving, this is default.
  37703. </p></dd>
  37704. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  37705. <dd><p>Preserve luminance.
  37706. </p></dd>
  37707. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  37708. <dd><p>Preserve max value of RGB triplet.
  37709. </p></dd>
  37710. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  37711. <dd><p>Preserve average value of RGB triplet.
  37712. </p></dd>
  37713. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  37714. <dd><p>Preserve sum value of RGB triplet.
  37715. </p></dd>
  37716. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  37717. <dd><p>Preserve normalized value of RGB triplet.
  37718. </p></dd>
  37719. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  37720. <dd><p>Preserve power value of RGB triplet.
  37721. </p></dd>
  37722. </dl>
  37723. </dd>
  37724. <dt><samp class="option">pa</samp></dt>
  37725. <dd><p>Set the preserve color amount when changing colors. Allowed range is from <code class="code">[0.0, 1.0]</code>.
  37726. Default is <code class="code">0.0</code>, thus disabled.
  37727. </p></dd>
  37728. </dl>
  37729. <a name="Examples-99"></a>
  37730. <h4 class="subsection">39.31.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-99" aria-hidden="true">TOC</a></span></h4>
  37731. <ul class="itemize mark-bullet">
  37732. <li>Convert source to grayscale:
  37733. <div class="example">
  37734. <pre class="example-preformatted">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  37735. </pre></div>
  37736. </li><li>Simulate sepia tones:
  37737. <div class="example">
  37738. <pre class="example-preformatted">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  37739. </pre></div>
  37740. </li></ul>
  37741. <a name="Commands-69"></a>
  37742. <h4 class="subsection">39.31.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-69" aria-hidden="true">TOC</a></span></h4>
  37743. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37744. </p>
  37745. <a name="colordetect"></a>
  37746. <h3 class="section">39.32 colordetect<span class="pull-right"><a class="anchor hidden-xs" href="#colordetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colordetect" aria-hidden="true">TOC</a></span></h3>
  37747. <p>Analyze the video frames to determine the effective value range and alpha
  37748. mode.
  37749. </p>
  37750. <p>The filter accepts the following options:
  37751. </p>
  37752. <dl class="table">
  37753. <dt><samp class="option">mode</samp></dt>
  37754. <dd><p>Set of properties to detect. Unavailable properties, such as alpha mode for
  37755. an input image without an alpha channel, will be ignored automatically.
  37756. </p>
  37757. <p>Accepts a combination of the following flags:
  37758. </p>
  37759. <dl class="table">
  37760. <dt>&lsquo;<samp class="samp">color_range</samp>&rsquo;</dt>
  37761. <dd><p>Detect if the source contains luma pixels outside the limited (MPEG) range,
  37762. which indicates that this is a full range YUV source.
  37763. </p></dd>
  37764. <dt>&lsquo;<samp class="samp">alpha_mode</samp>&rsquo;</dt>
  37765. <dd><p>Detect if the source contains color values above the alpha channel, which
  37766. indicates that the alpha channel is independent (straight), rather than
  37767. premultiplied. Also detects if the alpha plane is fully opaque or not.
  37768. </p></dd>
  37769. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  37770. <dd><p>Enable detection of all of the above properties. This is the default.
  37771. </p></dd>
  37772. </dl>
  37773. </dd>
  37774. </dl>
  37775. <a name="colorize"></a>
  37776. <h3 class="section">39.33 colorize<span class="pull-right"><a class="anchor hidden-xs" href="#colorize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorize" aria-hidden="true">TOC</a></span></h3>
  37777. <p>Overlay a solid color on the video stream.
  37778. </p>
  37779. <p>The filter accepts the following options:
  37780. </p>
  37781. <dl class="table">
  37782. <dt><samp class="option">hue</samp></dt>
  37783. <dd><p>Set the color hue. Allowed range is from 0 to 360.
  37784. Default value is 0.
  37785. </p>
  37786. </dd>
  37787. <dt><samp class="option">saturation</samp></dt>
  37788. <dd><p>Set the color saturation. Allowed range is from 0 to 1.
  37789. Default value is 0.5.
  37790. </p>
  37791. </dd>
  37792. <dt><samp class="option">lightness</samp></dt>
  37793. <dd><p>Set the color lightness. Allowed range is from 0 to 1.
  37794. Default value is 0.5.
  37795. </p>
  37796. </dd>
  37797. <dt><samp class="option">mix</samp></dt>
  37798. <dd><p>Set the mix of source lightness. By default is set to 1.0.
  37799. Allowed range is from 0.0 to 1.0.
  37800. </p></dd>
  37801. </dl>
  37802. <a name="Commands-70"></a>
  37803. <h4 class="subsection">39.33.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-70" aria-hidden="true">TOC</a></span></h4>
  37804. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37805. </p>
  37806. <a name="colorkey"></a>
  37807. <h3 class="section">39.34 colorkey<span class="pull-right"><a class="anchor hidden-xs" href="#colorkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorkey" aria-hidden="true">TOC</a></span></h3>
  37808. <p>RGB colorspace color keying.
  37809. This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel
  37810. which falls within the similarity radius of the key color to 0. The alpha value for pixels outside
  37811. the similarity radius depends on the value of the blend option.
  37812. </p>
  37813. <p>The filter accepts the following options:
  37814. </p>
  37815. <dl class="table">
  37816. <dt><samp class="option">color</samp></dt>
  37817. <dd><p>Set the color for which alpha will be set to 0 (full transparency).
  37818. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  37819. Default is <code class="code">black</code>.
  37820. </p>
  37821. </dd>
  37822. <dt><samp class="option">similarity</samp></dt>
  37823. <dd><p>Set the radius from the key color within which other colors also have full transparency.
  37824. The computed distance is related to the unit fractional distance in 3D space between the RGB values
  37825. 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
  37826. around the exact key color, while 1.0 matches everything.
  37827. Default is <code class="code">0.01</code>.
  37828. </p>
  37829. </dd>
  37830. <dt><samp class="option">blend</samp></dt>
  37831. <dd><p>Set how the alpha value for pixels that fall outside the similarity radius is computed.
  37832. 0.0 makes pixels either fully transparent or fully opaque.
  37833. Higher values result in semi-transparent pixels, with greater transparency
  37834. the more similar the pixel color is to the key color.
  37835. Range is 0.0 to 1.0. Default is <code class="code">0.0</code>.
  37836. </p></dd>
  37837. </dl>
  37838. <a name="Examples-100"></a>
  37839. <h4 class="subsection">39.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-100" aria-hidden="true">TOC</a></span></h4>
  37840. <ul class="itemize mark-bullet">
  37841. <li>Make every green pixel in the input image transparent:
  37842. <div class="example">
  37843. <pre class="example-preformatted">ffmpeg -i input.png -vf colorkey=green out.png
  37844. </pre></div>
  37845. </li><li>Overlay a greenscreen-video on top of a static background image.
  37846. <div class="example">
  37847. <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
  37848. </pre></div>
  37849. </li></ul>
  37850. <a name="Commands-71"></a>
  37851. <h4 class="subsection">39.34.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-71" aria-hidden="true">TOC</a></span></h4>
  37852. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37853. The command accepts the same syntax of the corresponding option.
  37854. </p>
  37855. <p>If the specified expression is not valid, it is kept at its current
  37856. value.
  37857. </p>
  37858. <a name="colorhold"></a>
  37859. <h3 class="section">39.35 colorhold<span class="pull-right"><a class="anchor hidden-xs" href="#colorhold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorhold" aria-hidden="true">TOC</a></span></h3>
  37860. <p>Remove all color information for all RGB colors except for certain one.
  37861. </p>
  37862. <p>The filter accepts the following options:
  37863. </p>
  37864. <dl class="table">
  37865. <dt><samp class="option">color</samp></dt>
  37866. <dd><p>The color which will not be replaced with neutral gray.
  37867. </p>
  37868. </dd>
  37869. <dt><samp class="option">similarity</samp></dt>
  37870. <dd><p>Similarity percentage with the above color.
  37871. 0.01 matches only the exact key color, while 1.0 matches everything.
  37872. </p>
  37873. </dd>
  37874. <dt><samp class="option">blend</samp></dt>
  37875. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  37876. Higher values result in more preserved color.
  37877. </p></dd>
  37878. </dl>
  37879. <a name="Commands-72"></a>
  37880. <h4 class="subsection">39.35.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-72" aria-hidden="true">TOC</a></span></h4>
  37881. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37882. The command accepts the same syntax of the corresponding option.
  37883. </p>
  37884. <p>If the specified expression is not valid, it is kept at its current
  37885. value.
  37886. </p>
  37887. <a name="colorlevels"></a>
  37888. <h3 class="section">39.36 colorlevels<span class="pull-right"><a class="anchor hidden-xs" href="#colorlevels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorlevels" aria-hidden="true">TOC</a></span></h3>
  37889. <p>Adjust video input frames using levels.
  37890. </p>
  37891. <p>The filter accepts the following options:
  37892. </p>
  37893. <dl class="table">
  37894. <dt><samp class="option">rimin</samp></dt>
  37895. <dt><samp class="option">gimin</samp></dt>
  37896. <dt><samp class="option">bimin</samp></dt>
  37897. <dt><samp class="option">aimin</samp></dt>
  37898. <dd><p>Adjust red, green, blue and alpha input black point.
  37899. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  37900. </p>
  37901. </dd>
  37902. <dt><samp class="option">rimax</samp></dt>
  37903. <dt><samp class="option">gimax</samp></dt>
  37904. <dt><samp class="option">bimax</samp></dt>
  37905. <dt><samp class="option">aimax</samp></dt>
  37906. <dd><p>Adjust red, green, blue and alpha input white point.
  37907. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">1</code>.
  37908. </p>
  37909. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  37910. (dark tones), change the balance of bright and dark tones.
  37911. </p>
  37912. </dd>
  37913. <dt><samp class="option">romin</samp></dt>
  37914. <dt><samp class="option">gomin</samp></dt>
  37915. <dt><samp class="option">bomin</samp></dt>
  37916. <dt><samp class="option">aomin</samp></dt>
  37917. <dd><p>Adjust red, green, blue and alpha output black point.
  37918. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">0</code>.
  37919. </p>
  37920. </dd>
  37921. <dt><samp class="option">romax</samp></dt>
  37922. <dt><samp class="option">gomax</samp></dt>
  37923. <dt><samp class="option">bomax</samp></dt>
  37924. <dt><samp class="option">aomax</samp></dt>
  37925. <dd><p>Adjust red, green, blue and alpha output white point.
  37926. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">1</code>.
  37927. </p>
  37928. <p>Output levels allows manual selection of a constrained output level range.
  37929. </p>
  37930. </dd>
  37931. <dt><samp class="option">preserve</samp></dt>
  37932. <dd><p>Set preserve color mode. The accepted values are:
  37933. </p><dl class="table">
  37934. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  37935. <dd><p>Disable color preserving, this is default.
  37936. </p></dd>
  37937. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  37938. <dd><p>Preserve luminance.
  37939. </p></dd>
  37940. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  37941. <dd><p>Preserve max value of RGB triplet.
  37942. </p></dd>
  37943. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  37944. <dd><p>Preserve average value of RGB triplet.
  37945. </p></dd>
  37946. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  37947. <dd><p>Preserve sum value of RGB triplet.
  37948. </p></dd>
  37949. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  37950. <dd><p>Preserve normalized value of RGB triplet.
  37951. </p></dd>
  37952. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  37953. <dd><p>Preserve power value of RGB triplet.
  37954. </p></dd>
  37955. </dl>
  37956. </dd>
  37957. </dl>
  37958. <a name="Examples-101"></a>
  37959. <h4 class="subsection">39.36.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-101" aria-hidden="true">TOC</a></span></h4>
  37960. <ul class="itemize mark-bullet">
  37961. <li>Make video output darker:
  37962. <div class="example">
  37963. <pre class="example-preformatted">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  37964. </pre></div>
  37965. </li><li>Increase contrast:
  37966. <div class="example">
  37967. <pre class="example-preformatted">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  37968. </pre></div>
  37969. </li><li>Make video output lighter:
  37970. <div class="example">
  37971. <pre class="example-preformatted">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  37972. </pre></div>
  37973. </li><li>Increase brightness:
  37974. <div class="example">
  37975. <pre class="example-preformatted">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  37976. </pre></div>
  37977. </li></ul>
  37978. <a name="Commands-73"></a>
  37979. <h4 class="subsection">39.36.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-73" aria-hidden="true">TOC</a></span></h4>
  37980. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37981. </p>
  37982. <a name="colormap"></a>
  37983. <h3 class="section">39.37 colormap<span class="pull-right"><a class="anchor hidden-xs" href="#colormap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colormap" aria-hidden="true">TOC</a></span></h3>
  37984. <p>Apply custom color maps to video stream.
  37985. </p>
  37986. <p>This filter needs three input video streams.
  37987. First stream is video stream that is going to be filtered out.
  37988. Second and third video stream specify color patches for source
  37989. color to target color mapping.
  37990. </p>
  37991. <p>The filter accepts the following options:
  37992. </p>
  37993. <dl class="table">
  37994. <dt><samp class="option">patch_size</samp></dt>
  37995. <dd><p>Set the source and target video stream patch size in pixels.
  37996. </p>
  37997. </dd>
  37998. <dt><samp class="option">nb_patches</samp></dt>
  37999. <dd><p>Set the max number of used patches from source and target video stream.
  38000. Default value is number of patches available in additional video streams.
  38001. Max allowed number of patches is <code class="code">64</code>.
  38002. </p>
  38003. </dd>
  38004. <dt><samp class="option">type</samp></dt>
  38005. <dd><p>Set the adjustments used for target colors. Can be <code class="code">relative</code> or <code class="code">absolute</code>.
  38006. Defaults is <code class="code">absolute</code>.
  38007. </p>
  38008. </dd>
  38009. <dt><samp class="option">kernel</samp></dt>
  38010. <dd><p>Set the kernel used to measure color differences between mapped colors.
  38011. </p>
  38012. <p>The accepted values are:
  38013. </p><dl class="table">
  38014. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  38015. <dt>&lsquo;<samp class="samp">weuclidean</samp>&rsquo;</dt>
  38016. </dl>
  38017. <p>Default is <code class="code">euclidean</code>.
  38018. </p></dd>
  38019. </dl>
  38020. <a name="colormatrix"></a>
  38021. <h3 class="section">39.38 colormatrix<span class="pull-right"><a class="anchor hidden-xs" href="#colormatrix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colormatrix" aria-hidden="true">TOC</a></span></h3>
  38022. <p>Convert color matrix.
  38023. </p>
  38024. <p>The filter accepts the following options:
  38025. </p>
  38026. <dl class="table">
  38027. <dt><samp class="option">src</samp></dt>
  38028. <dt><samp class="option">dst</samp></dt>
  38029. <dd><p>Specify the source and destination color matrix. Both values must be
  38030. specified.
  38031. </p>
  38032. <p>The accepted values are:
  38033. </p><dl class="table">
  38034. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38035. <dd><p>BT.709
  38036. </p>
  38037. </dd>
  38038. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  38039. <dd><p>FCC
  38040. </p>
  38041. </dd>
  38042. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  38043. <dd><p>BT.601
  38044. </p>
  38045. </dd>
  38046. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  38047. <dd><p>BT.470
  38048. </p>
  38049. </dd>
  38050. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38051. <dd><p>BT.470BG
  38052. </p>
  38053. </dd>
  38054. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38055. <dd><p>SMPTE-170M
  38056. </p>
  38057. </dd>
  38058. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38059. <dd><p>SMPTE-240M
  38060. </p>
  38061. </dd>
  38062. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  38063. <dd><p>BT.2020
  38064. </p></dd>
  38065. </dl>
  38066. </dd>
  38067. </dl>
  38068. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  38069. </p><div class="example">
  38070. <pre class="example-preformatted">colormatrix=bt601:smpte240m
  38071. </pre></div>
  38072. <a name="colorspace"></a>
  38073. <h3 class="section">39.39 colorspace<span class="pull-right"><a class="anchor hidden-xs" href="#colorspace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorspace" aria-hidden="true">TOC</a></span></h3>
  38074. <p>Convert colorspace, transfer characteristics or color primaries.
  38075. Input video needs to have an even size.
  38076. </p>
  38077. <p>The filter accepts the following options:
  38078. </p>
  38079. <dl class="table">
  38080. <dd><a class="anchor" id="all"></a></dd>
  38081. <dt><samp class="option">all</samp></dt>
  38082. <dd><p>Specify all color properties at once.
  38083. </p>
  38084. <p>The accepted values are:
  38085. </p><dl class="table">
  38086. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  38087. <dd><p>BT.470M
  38088. </p>
  38089. </dd>
  38090. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38091. <dd><p>BT.470BG
  38092. </p>
  38093. </dd>
  38094. <dt>&lsquo;<samp class="samp">bt601-6-525</samp>&rsquo;</dt>
  38095. <dd><p>BT.601-6 525
  38096. </p>
  38097. </dd>
  38098. <dt>&lsquo;<samp class="samp">bt601-6-625</samp>&rsquo;</dt>
  38099. <dd><p>BT.601-6 625
  38100. </p>
  38101. </dd>
  38102. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38103. <dd><p>BT.709
  38104. </p>
  38105. </dd>
  38106. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38107. <dd><p>SMPTE-170M
  38108. </p>
  38109. </dd>
  38110. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38111. <dd><p>SMPTE-240M
  38112. </p>
  38113. </dd>
  38114. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  38115. <dd><p>BT.2020
  38116. </p>
  38117. </dd>
  38118. </dl>
  38119. <a class="anchor" id="space"></a></dd>
  38120. <dt><samp class="option">space</samp></dt>
  38121. <dd><p>Specify output colorspace.
  38122. </p>
  38123. <p>The accepted values are:
  38124. </p><dl class="table">
  38125. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38126. <dd><p>BT.709
  38127. </p>
  38128. </dd>
  38129. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  38130. <dd><p>FCC
  38131. </p>
  38132. </dd>
  38133. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38134. <dd><p>BT.470BG or BT.601-6 625
  38135. </p>
  38136. </dd>
  38137. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38138. <dd><p>SMPTE-170M or BT.601-6 525
  38139. </p>
  38140. </dd>
  38141. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38142. <dd><p>SMPTE-240M
  38143. </p>
  38144. </dd>
  38145. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  38146. <dd><p>YCgCo
  38147. </p>
  38148. </dd>
  38149. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  38150. <dd><p>BT.2020 with non-constant luminance
  38151. </p>
  38152. </dd>
  38153. </dl>
  38154. <a class="anchor" id="trc"></a></dd>
  38155. <dt><samp class="option">trc</samp></dt>
  38156. <dd><p>Specify output transfer characteristics.
  38157. </p>
  38158. <p>The accepted values are:
  38159. </p><dl class="table">
  38160. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38161. <dd><p>BT.709
  38162. </p>
  38163. </dd>
  38164. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  38165. <dd><p>BT.470M
  38166. </p>
  38167. </dd>
  38168. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38169. <dd><p>BT.470BG
  38170. </p>
  38171. </dd>
  38172. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  38173. <dd><p>Constant gamma of 2.2
  38174. </p>
  38175. </dd>
  38176. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  38177. <dd><p>Constant gamma of 2.8
  38178. </p>
  38179. </dd>
  38180. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38181. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  38182. </p>
  38183. </dd>
  38184. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38185. <dd><p>SMPTE-240M
  38186. </p>
  38187. </dd>
  38188. <dt>&lsquo;<samp class="samp">srgb</samp>&rsquo;</dt>
  38189. <dd><p>SRGB
  38190. </p>
  38191. </dd>
  38192. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  38193. <dd><p>iec61966-2-1
  38194. </p>
  38195. </dd>
  38196. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  38197. <dd><p>iec61966-2-4
  38198. </p>
  38199. </dd>
  38200. <dt>&lsquo;<samp class="samp">xvycc</samp>&rsquo;</dt>
  38201. <dd><p>xvycc
  38202. </p>
  38203. </dd>
  38204. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  38205. <dd><p>BT.2020 for 10-bits content
  38206. </p>
  38207. </dd>
  38208. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  38209. <dd><p>BT.2020 for 12-bits content
  38210. </p>
  38211. </dd>
  38212. </dl>
  38213. <a class="anchor" id="primaries"></a></dd>
  38214. <dt><samp class="option">primaries</samp></dt>
  38215. <dd><p>Specify output color primaries.
  38216. </p>
  38217. <p>The accepted values are:
  38218. </p><dl class="table">
  38219. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38220. <dd><p>BT.709
  38221. </p>
  38222. </dd>
  38223. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  38224. <dd><p>BT.470M
  38225. </p>
  38226. </dd>
  38227. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38228. <dd><p>BT.470BG or BT.601-6 625
  38229. </p>
  38230. </dd>
  38231. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38232. <dd><p>SMPTE-170M or BT.601-6 525
  38233. </p>
  38234. </dd>
  38235. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38236. <dd><p>SMPTE-240M
  38237. </p>
  38238. </dd>
  38239. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  38240. <dd><p>film
  38241. </p>
  38242. </dd>
  38243. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  38244. <dd><p>SMPTE-431
  38245. </p>
  38246. </dd>
  38247. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  38248. <dd><p>SMPTE-432
  38249. </p>
  38250. </dd>
  38251. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  38252. <dd><p>BT.2020
  38253. </p>
  38254. </dd>
  38255. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  38256. <dd><p>JEDEC P22 phosphors
  38257. </p>
  38258. </dd>
  38259. </dl>
  38260. <a class="anchor" id="range"></a></dd>
  38261. <dt><samp class="option">range</samp></dt>
  38262. <dd><p>Specify output color range.
  38263. </p>
  38264. <p>The accepted values are:
  38265. </p><dl class="table">
  38266. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  38267. <dd><p>TV (restricted) range
  38268. </p>
  38269. </dd>
  38270. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  38271. <dd><p>MPEG (restricted) range
  38272. </p>
  38273. </dd>
  38274. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  38275. <dd><p>PC (full) range
  38276. </p>
  38277. </dd>
  38278. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  38279. <dd><p>JPEG (full) range
  38280. </p>
  38281. </dd>
  38282. </dl>
  38283. </dd>
  38284. <dt><samp class="option">format</samp></dt>
  38285. <dd><p>Specify output color format.
  38286. </p>
  38287. <p>The accepted values are:
  38288. </p><dl class="table">
  38289. <dt>&lsquo;<samp class="samp">yuv420p</samp>&rsquo;</dt>
  38290. <dd><p>YUV 4:2:0 planar 8-bits
  38291. </p>
  38292. </dd>
  38293. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  38294. <dd><p>YUV 4:2:0 planar 10-bits
  38295. </p>
  38296. </dd>
  38297. <dt>&lsquo;<samp class="samp">yuv420p12</samp>&rsquo;</dt>
  38298. <dd><p>YUV 4:2:0 planar 12-bits
  38299. </p>
  38300. </dd>
  38301. <dt>&lsquo;<samp class="samp">yuv422p</samp>&rsquo;</dt>
  38302. <dd><p>YUV 4:2:2 planar 8-bits
  38303. </p>
  38304. </dd>
  38305. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  38306. <dd><p>YUV 4:2:2 planar 10-bits
  38307. </p>
  38308. </dd>
  38309. <dt>&lsquo;<samp class="samp">yuv422p12</samp>&rsquo;</dt>
  38310. <dd><p>YUV 4:2:2 planar 12-bits
  38311. </p>
  38312. </dd>
  38313. <dt>&lsquo;<samp class="samp">yuv444p</samp>&rsquo;</dt>
  38314. <dd><p>YUV 4:4:4 planar 8-bits
  38315. </p>
  38316. </dd>
  38317. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  38318. <dd><p>YUV 4:4:4 planar 10-bits
  38319. </p>
  38320. </dd>
  38321. <dt>&lsquo;<samp class="samp">yuv444p12</samp>&rsquo;</dt>
  38322. <dd><p>YUV 4:4:4 planar 12-bits
  38323. </p>
  38324. </dd>
  38325. </dl>
  38326. </dd>
  38327. <dt><samp class="option">fast</samp></dt>
  38328. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  38329. significantly less CPU, but will be mathematically incorrect. To get output
  38330. compatible with that produced by the colormatrix filter, use fast=1.
  38331. </p>
  38332. </dd>
  38333. <dt><samp class="option">dither</samp></dt>
  38334. <dd><p>Specify dithering mode.
  38335. </p>
  38336. <p>The accepted values are:
  38337. </p><dl class="table">
  38338. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  38339. <dd><p>No dithering
  38340. </p>
  38341. </dd>
  38342. <dt>&lsquo;<samp class="samp">fsb</samp>&rsquo;</dt>
  38343. <dd><p>Floyd-Steinberg dithering
  38344. </p></dd>
  38345. </dl>
  38346. </dd>
  38347. <dt><samp class="option">wpadapt</samp></dt>
  38348. <dd><p>Whitepoint adaptation mode.
  38349. </p>
  38350. <p>The accepted values are:
  38351. </p><dl class="table">
  38352. <dt>&lsquo;<samp class="samp">bradford</samp>&rsquo;</dt>
  38353. <dd><p>Bradford whitepoint adaptation
  38354. </p>
  38355. </dd>
  38356. <dt>&lsquo;<samp class="samp">vonkries</samp>&rsquo;</dt>
  38357. <dd><p>von Kries whitepoint adaptation
  38358. </p>
  38359. </dd>
  38360. <dt>&lsquo;<samp class="samp">identity</samp>&rsquo;</dt>
  38361. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  38362. </p></dd>
  38363. </dl>
  38364. </dd>
  38365. <dt><samp class="option">clipgamut</samp></dt>
  38366. <dd><p>Controls how to clip out-of-gamut colors that arise as a result of colorspace conversion.
  38367. </p>
  38368. <p>The accepted values are:
  38369. </p><dl class="table">
  38370. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  38371. <dd><p>No clipping of out of gamut colors.
  38372. </p>
  38373. </dd>
  38374. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  38375. <dd><p>Clips the RGB values to the [0, 1] range when building the gamma transfer LUTs.
  38376. </p></dd>
  38377. </dl>
  38378. </dd>
  38379. <dt><samp class="option">iall</samp></dt>
  38380. <dd><p>Override all input properties at once. Same accepted values as <a class="ref" href="#all">all</a>.
  38381. </p>
  38382. </dd>
  38383. <dt><samp class="option">ispace</samp></dt>
  38384. <dd><p>Override input colorspace. Same accepted values as <a class="ref" href="#space">space</a>.
  38385. </p>
  38386. </dd>
  38387. <dt><samp class="option">iprimaries</samp></dt>
  38388. <dd><p>Override input color primaries. Same accepted values as <a class="ref" href="#primaries">primaries</a>.
  38389. </p>
  38390. </dd>
  38391. <dt><samp class="option">itrc</samp></dt>
  38392. <dd><p>Override input transfer characteristics. Same accepted values as <a class="ref" href="#trc">trc</a>.
  38393. </p>
  38394. </dd>
  38395. <dt><samp class="option">irange</samp></dt>
  38396. <dd><p>Override input color range. Same accepted values as <a class="ref" href="#range">range</a>.
  38397. </p>
  38398. </dd>
  38399. </dl>
  38400. <p>The filter converts the transfer characteristics, color space and color
  38401. primaries to the specified user values. The output value, if not specified,
  38402. is set to a default value based on the &quot;all&quot; property. If that property is
  38403. also not specified, the filter will log an error. The output color range and
  38404. format default to the same value as the input color range and format. The
  38405. input transfer characteristics, color space, color primaries and color range
  38406. should be set on the input data. If any of these are missing, the filter will
  38407. log an error and no conversion will take place.
  38408. </p>
  38409. <p>For example to convert the input to SMPTE-240M, use the command:
  38410. </p><div class="example">
  38411. <pre class="example-preformatted">colorspace=smpte240m
  38412. </pre></div>
  38413. <a name="colortemperature"></a>
  38414. <h3 class="section">39.40 colortemperature<span class="pull-right"><a class="anchor hidden-xs" href="#colortemperature" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colortemperature" aria-hidden="true">TOC</a></span></h3>
  38415. <p>Adjust color temperature in video to simulate variations in ambient color temperature.
  38416. </p>
  38417. <p>The filter accepts the following options:
  38418. </p>
  38419. <dl class="table">
  38420. <dt><samp class="option">temperature</samp></dt>
  38421. <dd><p>Set the temperature in Kelvin. Allowed range is from 1000 to 40000.
  38422. Default value is 6500 K.
  38423. </p>
  38424. </dd>
  38425. <dt><samp class="option">mix</samp></dt>
  38426. <dd><p>Set mixing with filtered output. Allowed range is from 0 to 1.
  38427. Default value is 1.
  38428. </p>
  38429. </dd>
  38430. <dt><samp class="option">pl</samp></dt>
  38431. <dd><p>Set the amount of preserving lightness. Allowed range is from 0 to 1.
  38432. Default value is 0.
  38433. </p></dd>
  38434. </dl>
  38435. <a name="Commands-74"></a>
  38436. <h4 class="subsection">39.40.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-74" aria-hidden="true">TOC</a></span></h4>
  38437. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  38438. </p>
  38439. <a name="convolution"></a>
  38440. <h3 class="section">39.41 convolution<span class="pull-right"><a class="anchor hidden-xs" href="#convolution" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolution" aria-hidden="true">TOC</a></span></h3>
  38441. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  38442. </p>
  38443. <p>The filter accepts the following options:
  38444. </p>
  38445. <dl class="table">
  38446. <dt><samp class="option">0m</samp></dt>
  38447. <dt><samp class="option">1m</samp></dt>
  38448. <dt><samp class="option">2m</samp></dt>
  38449. <dt><samp class="option">3m</samp></dt>
  38450. <dd><p>Set matrix for each plane.
  38451. Matrix is sequence of 9, 25 or 49 signed integers in <var class="var">square</var> mode,
  38452. and from 1 to 49 odd number of signed integers in <var class="var">row</var> mode.
  38453. </p>
  38454. </dd>
  38455. <dt><samp class="option">0rdiv</samp></dt>
  38456. <dt><samp class="option">1rdiv</samp></dt>
  38457. <dt><samp class="option">2rdiv</samp></dt>
  38458. <dt><samp class="option">3rdiv</samp></dt>
  38459. <dd><p>Set multiplier for calculated value for each plane.
  38460. If unset or 0, it will be 1/sum of all matrix elements.
  38461. </p>
  38462. </dd>
  38463. <dt><samp class="option">0bias</samp></dt>
  38464. <dt><samp class="option">1bias</samp></dt>
  38465. <dt><samp class="option">2bias</samp></dt>
  38466. <dt><samp class="option">3bias</samp></dt>
  38467. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  38468. Useful for making the overall image brighter or darker. Default is 0.0.
  38469. </p>
  38470. </dd>
  38471. <dt><samp class="option">0mode</samp></dt>
  38472. <dt><samp class="option">1mode</samp></dt>
  38473. <dt><samp class="option">2mode</samp></dt>
  38474. <dt><samp class="option">3mode</samp></dt>
  38475. <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>.
  38476. Default is <var class="var">square</var>.
  38477. </p></dd>
  38478. </dl>
  38479. <a name="Commands-75"></a>
  38480. <h4 class="subsection">39.41.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-75" aria-hidden="true">TOC</a></span></h4>
  38481. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38482. </p>
  38483. <a name="Examples-102"></a>
  38484. <h4 class="subsection">39.41.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-102" aria-hidden="true">TOC</a></span></h4>
  38485. <ul class="itemize mark-bullet">
  38486. <li>Apply sharpen:
  38487. <div class="example">
  38488. <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;
  38489. </pre></div>
  38490. </li><li>Apply blur:
  38491. <div class="example">
  38492. <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;
  38493. </pre></div>
  38494. </li><li>Apply edge enhance:
  38495. <div class="example">
  38496. <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;
  38497. </pre></div>
  38498. </li><li>Apply edge detect:
  38499. <div class="example">
  38500. <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;
  38501. </pre></div>
  38502. </li><li>Apply laplacian edge detector which includes diagonals:
  38503. <div class="example">
  38504. <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;
  38505. </pre></div>
  38506. </li><li>Apply emboss:
  38507. <div class="example">
  38508. <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;
  38509. </pre></div>
  38510. </li></ul>
  38511. <a name="convolve"></a>
  38512. <h3 class="section">39.42 convolve<span class="pull-right"><a class="anchor hidden-xs" href="#convolve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolve" aria-hidden="true">TOC</a></span></h3>
  38513. <p>Apply 2D convolution of video stream in frequency domain using second stream
  38514. as impulse.
  38515. </p>
  38516. <p>The filter accepts the following options:
  38517. </p>
  38518. <dl class="table">
  38519. <dt><samp class="option">planes</samp></dt>
  38520. <dd><p>Set which planes to process.
  38521. </p>
  38522. </dd>
  38523. <dt><samp class="option">impulse</samp></dt>
  38524. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  38525. or <var class="var">all</var>. Default is <var class="var">all</var>.
  38526. </p></dd>
  38527. </dl>
  38528. <p>The <code class="code">convolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  38529. </p>
  38530. <a name="copy"></a>
  38531. <h3 class="section">39.43 copy<span class="pull-right"><a class="anchor hidden-xs" href="#copy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-copy" aria-hidden="true">TOC</a></span></h3>
  38532. <p>Copy the input video source unchanged to the output. This is mainly useful for
  38533. testing purposes.
  38534. </p>
  38535. <a class="anchor" id="coreimage"></a><a name="coreimage-1"></a>
  38536. <h3 class="section">39.44 coreimage<span class="pull-right"><a class="anchor hidden-xs" href="#coreimage-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-coreimage-1" aria-hidden="true">TOC</a></span></h3>
  38537. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  38538. </p>
  38539. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  38540. processed by video hardware. However, software-based OpenGL implementations
  38541. exist which means there is no guarantee for hardware processing. It depends on
  38542. the respective OSX.
  38543. </p>
  38544. <p>There are many filters and image generators provided by Apple that come with a
  38545. large variety of options. The filter has to be referenced by its name along
  38546. with its options.
  38547. </p>
  38548. <p>The coreimage filter accepts the following options:
  38549. </p><dl class="table">
  38550. <dt><samp class="option">list_filters</samp></dt>
  38551. <dd><p>List all available filters and generators along with all their respective
  38552. options as well as possible minimum and maximum values along with the default
  38553. values.
  38554. </p><div class="example">
  38555. <pre class="example-preformatted">list_filters=true
  38556. </pre></div>
  38557. </dd>
  38558. <dt><samp class="option">filter</samp></dt>
  38559. <dd><p>Specify all filters by their respective name and options.
  38560. Use <var class="var">list_filters</var> to determine all valid filter names and options.
  38561. Numerical options are specified by a float value and are automatically clamped
  38562. to their respective value range. Vector and color options have to be specified
  38563. by a list of space separated float values. Character escaping has to be done.
  38564. A special option name <code class="code">default</code> is available to use default options for a
  38565. filter.
  38566. </p>
  38567. <p>It is required to specify either <code class="code">default</code> or at least one of the filter options.
  38568. All omitted options are used with their default values.
  38569. The syntax of the filter string is as follows:
  38570. </p><div class="example">
  38571. <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;][@...]][#...]
  38572. </pre></div>
  38573. </dd>
  38574. <dt><samp class="option">output_rect</samp></dt>
  38575. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  38576. input image. It is given by a list of space separated float values:
  38577. </p><div class="example">
  38578. <pre class="example-preformatted">output_rect=x\ y\ width\ height
  38579. </pre></div>
  38580. <p>If not given, the output rectangle equals the dimensions of the input image.
  38581. The output rectangle is automatically cropped at the borders of the input
  38582. image. Negative values are valid for each component.
  38583. </p><div class="example">
  38584. <pre class="example-preformatted">output_rect=25\ 25\ 100\ 100
  38585. </pre></div>
  38586. </dd>
  38587. </dl>
  38588. <p>Several filters can be chained for successive processing without GPU-HOST
  38589. transfers allowing for fast processing of complex filter chains.
  38590. Currently, only filters with zero (generators) or exactly one (filters) input
  38591. image and one output image are supported. Also, transition filters are not yet
  38592. usable as intended.
  38593. </p>
  38594. <p>Some filters generate output images with additional padding depending on the
  38595. respective filter kernel. The padding is automatically removed to ensure the
  38596. filter output has the same size as the input image.
  38597. </p>
  38598. <p>For image generators, the size of the output image is determined by the
  38599. previous output image of the filter chain or the input image of the whole
  38600. filterchain, respectively. The generators do not use the pixel information of
  38601. this image to generate their output. However, the generated output is
  38602. blended onto this image, resulting in partial or complete coverage of the
  38603. output image.
  38604. </p>
  38605. <p>The <a class="ref" href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  38606. which are directly fed into the filter chain. By using it, providing input
  38607. images by another video source or an input video is not required.
  38608. </p>
  38609. <a name="Examples-103"></a>
  38610. <h4 class="subsection">39.44.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-103" aria-hidden="true">TOC</a></span></h4>
  38611. <ul class="itemize mark-bullet">
  38612. <li>List all filters available:
  38613. <div class="example">
  38614. <pre class="example-preformatted">coreimage=list_filters=true
  38615. </pre></div>
  38616. </li><li>Use the CIBoxBlur filter with default options to blur an image:
  38617. <div class="example">
  38618. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default
  38619. </pre></div>
  38620. </li><li>Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  38621. its center at 100x100 and a radius of 50 pixels:
  38622. <div class="example">
  38623. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  38624. </pre></div>
  38625. </li><li>Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  38626. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  38627. <div class="example">
  38628. <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
  38629. </pre></div>
  38630. </li></ul>
  38631. <a name="corr"></a>
  38632. <h3 class="section">39.45 corr<span class="pull-right"><a class="anchor hidden-xs" href="#corr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-corr" aria-hidden="true">TOC</a></span></h3>
  38633. <p>Obtain the correlation between two input videos.
  38634. </p>
  38635. <p>This filter takes two input videos.
  38636. </p>
  38637. <p>Both input videos must have the same resolution and pixel format for
  38638. this filter to work correctly. Also it assumes that both inputs
  38639. have the same number of frames, which are compared one by one.
  38640. </p>
  38641. <p>The obtained per component, average, min and max correlation is printed through
  38642. the logging system.
  38643. </p>
  38644. <p>The filter stores the calculated correlation of each frame in frame metadata.
  38645. </p>
  38646. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  38647. </p>
  38648. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  38649. with the reference file <samp class="file">ref.mpg</samp>.
  38650. </p>
  38651. <div class="example">
  38652. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
  38653. </pre></div>
  38654. <a name="cover_005frect"></a>
  38655. <h3 class="section">39.46 cover_rect<span class="pull-right"><a class="anchor hidden-xs" href="#cover_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cover_005frect" aria-hidden="true">TOC</a></span></h3>
  38656. <p>Cover a rectangular object
  38657. </p>
  38658. <p>It accepts the following options:
  38659. </p>
  38660. <dl class="table">
  38661. <dt><samp class="option">cover</samp></dt>
  38662. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  38663. </p>
  38664. </dd>
  38665. <dt><samp class="option">mode</samp></dt>
  38666. <dd><p>Set covering mode.
  38667. </p>
  38668. <p>It accepts the following values:
  38669. </p><dl class="table">
  38670. <dt>&lsquo;<samp class="samp">cover</samp>&rsquo;</dt>
  38671. <dd><p>cover it by the supplied image
  38672. </p></dd>
  38673. <dt>&lsquo;<samp class="samp">blur</samp>&rsquo;</dt>
  38674. <dd><p>cover it by interpolating the surrounding pixels
  38675. </p></dd>
  38676. </dl>
  38677. <p>Default value is <var class="var">blur</var>.
  38678. </p></dd>
  38679. </dl>
  38680. <a name="Examples-104"></a>
  38681. <h4 class="subsection">39.46.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-104" aria-hidden="true">TOC</a></span></h4>
  38682. <ul class="itemize mark-bullet">
  38683. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  38684. <div class="example">
  38685. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  38686. </pre></div>
  38687. </li></ul>
  38688. <a name="crop"></a>
  38689. <h3 class="section">39.47 crop<span class="pull-right"><a class="anchor hidden-xs" href="#crop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crop" aria-hidden="true">TOC</a></span></h3>
  38690. <p>Crop the input video to given dimensions.
  38691. </p>
  38692. <p>It accepts the following parameters:
  38693. </p>
  38694. <dl class="table">
  38695. <dt><samp class="option">w, out_w</samp></dt>
  38696. <dd><p>The width of the output video. It defaults to <code class="code">iw</code>.
  38697. This expression is evaluated only once during the filter
  38698. configuration, or when the &lsquo;<samp class="samp">w</samp>&rsquo; or &lsquo;<samp class="samp">out_w</samp>&rsquo; command is sent.
  38699. </p>
  38700. </dd>
  38701. <dt><samp class="option">h, out_h</samp></dt>
  38702. <dd><p>The height of the output video. It defaults to <code class="code">ih</code>.
  38703. This expression is evaluated only once during the filter
  38704. configuration, or when the &lsquo;<samp class="samp">h</samp>&rsquo; or &lsquo;<samp class="samp">out_h</samp>&rsquo; command is sent.
  38705. </p>
  38706. </dd>
  38707. <dt><samp class="option">x</samp></dt>
  38708. <dd><p>The horizontal position, in the input video, of the left edge of the output
  38709. video. It defaults to <code class="code">(in_w-out_w)/2</code>.
  38710. This expression is evaluated per-frame.
  38711. </p>
  38712. </dd>
  38713. <dt><samp class="option">y</samp></dt>
  38714. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  38715. It defaults to <code class="code">(in_h-out_h)/2</code>.
  38716. This expression is evaluated per-frame.
  38717. </p>
  38718. </dd>
  38719. <dt><samp class="option">keep_aspect</samp></dt>
  38720. <dd><p>If set to 1 will force the output display aspect ratio
  38721. to be the same of the input, by changing the output sample aspect
  38722. ratio. It defaults to 0.
  38723. </p>
  38724. </dd>
  38725. <dt><samp class="option">exact</samp></dt>
  38726. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  38727. width/height/x/y as specified and will not be rounded to nearest smaller value.
  38728. It defaults to 0.
  38729. </p></dd>
  38730. </dl>
  38731. <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
  38732. expressions containing the following constants:
  38733. </p>
  38734. <dl class="table">
  38735. <dt><samp class="option">x</samp></dt>
  38736. <dt><samp class="option">y</samp></dt>
  38737. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  38738. each new frame.
  38739. </p>
  38740. </dd>
  38741. <dt><samp class="option">in_w</samp></dt>
  38742. <dt><samp class="option">in_h</samp></dt>
  38743. <dd><p>The input width and height.
  38744. </p>
  38745. </dd>
  38746. <dt><samp class="option">iw</samp></dt>
  38747. <dt><samp class="option">ih</samp></dt>
  38748. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  38749. </p>
  38750. </dd>
  38751. <dt><samp class="option">out_w</samp></dt>
  38752. <dt><samp class="option">out_h</samp></dt>
  38753. <dd><p>The output (cropped) width and height.
  38754. </p>
  38755. </dd>
  38756. <dt><samp class="option">ow</samp></dt>
  38757. <dt><samp class="option">oh</samp></dt>
  38758. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  38759. </p>
  38760. </dd>
  38761. <dt><samp class="option">a</samp></dt>
  38762. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  38763. </p>
  38764. </dd>
  38765. <dt><samp class="option">sar</samp></dt>
  38766. <dd><p>input sample aspect ratio
  38767. </p>
  38768. </dd>
  38769. <dt><samp class="option">dar</samp></dt>
  38770. <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>
  38771. </p>
  38772. </dd>
  38773. <dt><samp class="option">hsub</samp></dt>
  38774. <dt><samp class="option">vsub</samp></dt>
  38775. <dd><p>horizontal and vertical chroma subsample values. For example for the
  38776. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  38777. </p>
  38778. </dd>
  38779. <dt><samp class="option">n</samp></dt>
  38780. <dd><p>The number of the input frame, starting from 0.
  38781. </p>
  38782. </dd>
  38783. <dt><samp class="option">pos</samp></dt>
  38784. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  38785. do not use
  38786. </p>
  38787. </dd>
  38788. <dt><samp class="option">t</samp></dt>
  38789. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  38790. </p>
  38791. </dd>
  38792. </dl>
  38793. <p>The expression for <var class="var">out_w</var> may depend on the value of <var class="var">out_h</var>,
  38794. and the expression for <var class="var">out_h</var> may depend on <var class="var">out_w</var>, but they
  38795. 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
  38796. evaluated after <var class="var">out_w</var> and <var class="var">out_h</var>.
  38797. </p>
  38798. <p>The <var class="var">x</var> and <var class="var">y</var> parameters specify the expressions for the
  38799. position of the top-left corner of the output (non-cropped) area. They
  38800. are evaluated for each frame. If the evaluated value is not valid, it
  38801. is approximated to the nearest valid value.
  38802. </p>
  38803. <p>The expression for <var class="var">x</var> may depend on <var class="var">y</var>, and the expression
  38804. for <var class="var">y</var> may depend on <var class="var">x</var>.
  38805. </p>
  38806. <a name="Examples-105"></a>
  38807. <h4 class="subsection">39.47.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-105" aria-hidden="true">TOC</a></span></h4>
  38808. <ul class="itemize mark-bullet">
  38809. <li>Crop area with size 100x100 at position (12,34).
  38810. <div class="example">
  38811. <pre class="example-preformatted">crop=100:100:12:34
  38812. </pre></div>
  38813. <p>Using named options, the example above becomes:
  38814. </p><div class="example">
  38815. <pre class="example-preformatted">crop=w=100:h=100:x=12:y=34
  38816. </pre></div>
  38817. </li><li>Crop the central input area with size 100x100:
  38818. <div class="example">
  38819. <pre class="example-preformatted">crop=100:100
  38820. </pre></div>
  38821. </li><li>Crop the central input area with size 2/3 of the input video:
  38822. <div class="example">
  38823. <pre class="example-preformatted">crop=2/3*in_w:2/3*in_h
  38824. </pre></div>
  38825. </li><li>Crop the input video central square:
  38826. <div class="example">
  38827. <pre class="example-preformatted">crop=out_w=in_h
  38828. crop=in_h
  38829. </pre></div>
  38830. </li><li>Delimit the rectangle with the top-left corner placed at position
  38831. 100:100 and the right-bottom corner corresponding to the right-bottom
  38832. corner of the input image.
  38833. <div class="example">
  38834. <pre class="example-preformatted">crop=in_w-100:in_h-100:100:100
  38835. </pre></div>
  38836. </li><li>Crop 10 pixels from the left and right borders, and 20 pixels from
  38837. the top and bottom borders
  38838. <div class="example">
  38839. <pre class="example-preformatted">crop=in_w-2*10:in_h-2*20
  38840. </pre></div>
  38841. </li><li>Keep only the bottom right quarter of the input image:
  38842. <div class="example">
  38843. <pre class="example-preformatted">crop=in_w/2:in_h/2:in_w/2:in_h/2
  38844. </pre></div>
  38845. </li><li>Crop height for getting Greek harmony:
  38846. <div class="example">
  38847. <pre class="example-preformatted">crop=in_w:1/PHI*in_w
  38848. </pre></div>
  38849. </li><li>Apply trembling effect:
  38850. <div class="example">
  38851. <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)
  38852. </pre></div>
  38853. </li><li>Apply erratic camera effect depending on timestamp:
  38854. <div class="example">
  38855. <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)
  38856. </pre></div>
  38857. </li><li>Set x depending on the value of y:
  38858. <div class="example">
  38859. <pre class="example-preformatted">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  38860. </pre></div>
  38861. </li></ul>
  38862. <a name="Commands-76"></a>
  38863. <h4 class="subsection">39.47.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-76" aria-hidden="true">TOC</a></span></h4>
  38864. <p>This filter supports the following commands:
  38865. </p><dl class="table">
  38866. <dt><samp class="option">w, out_w</samp></dt>
  38867. <dt><samp class="option">h, out_h</samp></dt>
  38868. <dt><samp class="option">x</samp></dt>
  38869. <dt><samp class="option">y</samp></dt>
  38870. <dd><p>Set width/height of the output video and the horizontal/vertical position
  38871. in the input video.
  38872. The command accepts the same syntax of the corresponding option.
  38873. </p>
  38874. <p>If the specified expression is not valid, it is kept at its current
  38875. value.
  38876. </p></dd>
  38877. </dl>
  38878. <a name="cropdetect"></a>
  38879. <h3 class="section">39.48 cropdetect<span class="pull-right"><a class="anchor hidden-xs" href="#cropdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cropdetect" aria-hidden="true">TOC</a></span></h3>
  38880. <p>Auto-detect the crop size.
  38881. </p>
  38882. <p>It calculates the necessary cropping parameters and prints the
  38883. recommended parameters via the logging system. The detected dimensions
  38884. correspond to the non-black or video area of the input video according to <var class="var">mode</var>.
  38885. </p>
  38886. <p>It accepts the following parameters:
  38887. </p>
  38888. <dl class="table">
  38889. <dt><samp class="option">mode</samp></dt>
  38890. <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.
  38891. </p>
  38892. <dl class="table">
  38893. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  38894. <dd><p>Detect black pixels surrounding the playing video. For fine control use option <var class="var">limit</var>.
  38895. </p>
  38896. </dd>
  38897. <dt>&lsquo;<samp class="samp">mvedges</samp>&rsquo;</dt>
  38898. <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.
  38899. </p></dd>
  38900. </dl>
  38901. </dd>
  38902. <dt><samp class="option">limit</samp></dt>
  38903. <dd><p>Set higher black value threshold, which can be optionally specified
  38904. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  38905. value greater to the set value is considered non-black. It defaults to 24.
  38906. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  38907. on the bitdepth of the pixel format.
  38908. </p>
  38909. </dd>
  38910. <dt><samp class="option">round</samp></dt>
  38911. <dd><p>The value which the width/height should be divisible by. It defaults to
  38912. 16. The offset is automatically adjusted to center the video. Use 2 to
  38913. get only even dimensions (needed for 4:2:2 video). 16 is best when
  38914. encoding to most video codecs.
  38915. </p>
  38916. </dd>
  38917. <dt><samp class="option">skip</samp></dt>
  38918. <dd><p>Set the number of initial frames for which evaluation is skipped.
  38919. Default is 2. Range is 0 to INT_MAX.
  38920. </p>
  38921. </dd>
  38922. <dt><samp class="option">reset_count, reset</samp></dt>
  38923. <dd><p>Set the counter that determines after how many frames cropdetect will
  38924. reset the previously detected largest video area and start over to
  38925. detect the current optimal crop area. Default value is 0.
  38926. </p>
  38927. <p>This can be useful when channel logos distort the video area. 0
  38928. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  38929. playback.
  38930. </p>
  38931. </dd>
  38932. <dt><samp class="option">mv_threshold</samp></dt>
  38933. <dd><p>Set motion in pixel units as threshold for motion detection. It defaults to 8.
  38934. </p>
  38935. </dd>
  38936. <dt><samp class="option">low</samp></dt>
  38937. <dt><samp class="option">high</samp></dt>
  38938. <dd><p>Set low and high threshold values used by the Canny thresholding
  38939. algorithm.
  38940. </p>
  38941. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  38942. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  38943. by the low threshold.
  38944. </p>
  38945. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  38946. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  38947. </p>
  38948. <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>
  38949. is <code class="code">15/255</code>.
  38950. </p></dd>
  38951. </dl>
  38952. <a name="Examples-106"></a>
  38953. <h4 class="subsection">39.48.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-106" aria-hidden="true">TOC</a></span></h4>
  38954. <ul class="itemize mark-bullet">
  38955. <li>Find video area surrounded by black borders:
  38956. <div class="example">
  38957. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
  38958. </pre></div>
  38959. </li><li>Find an embedded video area, generate motion vectors beforehand:
  38960. <div class="example">
  38961. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
  38962. </pre></div>
  38963. </li><li>Find an embedded video area, use motion vectors from decoder:
  38964. <div class="example">
  38965. <pre class="example-preformatted">ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
  38966. </pre></div>
  38967. </li></ul>
  38968. <a name="Commands-77"></a>
  38969. <h4 class="subsection">39.48.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-77" aria-hidden="true">TOC</a></span></h4>
  38970. <p>This filter supports the following commands:
  38971. </p>
  38972. <dl class="table">
  38973. <dt><samp class="option">limit</samp></dt>
  38974. <dd><p>The command accepts the same syntax of the corresponding option.
  38975. If the specified expression is not valid, it is kept at its current value.
  38976. </p></dd>
  38977. </dl>
  38978. <a class="anchor" id="cue"></a><a name="cue-1"></a>
  38979. <h3 class="section">39.49 cue<span class="pull-right"><a class="anchor hidden-xs" href="#cue-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cue-1" aria-hidden="true">TOC</a></span></h3>
  38980. <p>Delay video filtering until a given wallclock timestamp. The filter first
  38981. passes on <samp class="option">preroll</samp> amount of frames, then it buffers at most
  38982. <samp class="option">buffer</samp> amount of frames and waits for the cue. After reaching the cue
  38983. it forwards the buffered frames and also any subsequent frames coming in its
  38984. input.
  38985. </p>
  38986. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  38987. realtime output devices like decklink. By putting the delay in the filtering
  38988. chain and pre-buffering frames the process can pass on data to output almost
  38989. immediately after the target wallclock timestamp is reached.
  38990. </p>
  38991. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  38992. some use cases.
  38993. </p>
  38994. <dl class="table">
  38995. <dt><samp class="option">cue</samp></dt>
  38996. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  38997. </p>
  38998. </dd>
  38999. <dt><samp class="option">preroll</samp></dt>
  39000. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  39001. </p>
  39002. </dd>
  39003. <dt><samp class="option">buffer</samp></dt>
  39004. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  39005. in seconds. Default is 0.
  39006. </p>
  39007. </dd>
  39008. </dl>
  39009. <a class="anchor" id="curves"></a><a name="curves-1"></a>
  39010. <h3 class="section">39.50 curves<span class="pull-right"><a class="anchor hidden-xs" href="#curves-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-curves-1" aria-hidden="true">TOC</a></span></h3>
  39011. <p>Apply color adjustments using curves.
  39012. </p>
  39013. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  39014. component (red, green and blue) has its values defined by <var class="var">N</var> key points
  39015. tied from each other using a smooth curve. The x-axis represents the pixel
  39016. values from the input frame, and the y-axis the new pixel values to be set for
  39017. the output frame.
  39018. </p>
  39019. <p>By default, a component curve is defined by the two points <var class="var">(0;0)</var> and
  39020. <var class="var">(1;1)</var>. This creates a straight line where each original pixel value is
  39021. &quot;adjusted&quot; to its own value, which means no change to the image.
  39022. </p>
  39023. <p>The filter allows you to redefine these two points and add some more. A new
  39024. curve will be defined to pass smoothly through all these new coordinates. The
  39025. new defined points need to be strictly increasing over the x-axis, and their
  39026. <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
  39027. formed by using a natural or monotonic cubic spline interpolation, depending
  39028. on the <var class="var">interp</var> option (default: <code class="code">natural</code>). The <code class="code">natural</code>
  39029. spline produces a smoother curve in general while the monotonic (<code class="code">pchip</code>)
  39030. spline guarantees the transitions between the specified points to be
  39031. monotonic. If the computed curves happened to go outside the vector spaces,
  39032. the values will be clipped accordingly.
  39033. </p>
  39034. <p>The filter accepts the following options:
  39035. </p>
  39036. <dl class="table">
  39037. <dt><samp class="option">preset</samp></dt>
  39038. <dd><p>Select one of the available color presets. This option can be used in addition
  39039. to the <samp class="option">r</samp>, <samp class="option">g</samp>, <samp class="option">b</samp> parameters; in this case, the later
  39040. options takes priority on the preset values.
  39041. Available presets are:
  39042. </p><dl class="table">
  39043. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  39044. <dt>&lsquo;<samp class="samp">color_negative</samp>&rsquo;</dt>
  39045. <dt>&lsquo;<samp class="samp">cross_process</samp>&rsquo;</dt>
  39046. <dt>&lsquo;<samp class="samp">darker</samp>&rsquo;</dt>
  39047. <dt>&lsquo;<samp class="samp">increase_contrast</samp>&rsquo;</dt>
  39048. <dt>&lsquo;<samp class="samp">lighter</samp>&rsquo;</dt>
  39049. <dt>&lsquo;<samp class="samp">linear_contrast</samp>&rsquo;</dt>
  39050. <dt>&lsquo;<samp class="samp">medium_contrast</samp>&rsquo;</dt>
  39051. <dt>&lsquo;<samp class="samp">negative</samp>&rsquo;</dt>
  39052. <dt>&lsquo;<samp class="samp">strong_contrast</samp>&rsquo;</dt>
  39053. <dt>&lsquo;<samp class="samp">vintage</samp>&rsquo;</dt>
  39054. </dl>
  39055. <p>Default is <code class="code">none</code>.
  39056. </p></dd>
  39057. <dt><samp class="option">master, m</samp></dt>
  39058. <dd><p>Set the master key points. These points will define a second pass mapping. It
  39059. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  39060. <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
  39061. post-processing LUT.
  39062. </p></dd>
  39063. <dt><samp class="option">red, r</samp></dt>
  39064. <dd><p>Set the key points for the red component.
  39065. </p></dd>
  39066. <dt><samp class="option">green, g</samp></dt>
  39067. <dd><p>Set the key points for the green component.
  39068. </p></dd>
  39069. <dt><samp class="option">blue, b</samp></dt>
  39070. <dd><p>Set the key points for the blue component.
  39071. </p></dd>
  39072. <dt><samp class="option">all</samp></dt>
  39073. <dd><p>Set the key points for all components (not including master).
  39074. Can be used in addition to the other key points component
  39075. options. In this case, the unset component(s) will fallback on this
  39076. <samp class="option">all</samp> setting.
  39077. </p></dd>
  39078. <dt><samp class="option">psfile</samp></dt>
  39079. <dd><p>Specify a Photoshop curves file (<code class="code">.acv</code>) to import the settings from.
  39080. </p></dd>
  39081. <dt><samp class="option">plot</samp></dt>
  39082. <dd><p>Save Gnuplot script of the curves in specified file.
  39083. </p></dd>
  39084. <dt><samp class="option">interp</samp></dt>
  39085. <dd><p>Specify the kind of interpolation. Available algorithms are:
  39086. </p><dl class="table">
  39087. <dt>&lsquo;<samp class="samp">natural</samp>&rsquo;</dt>
  39088. <dd><p>Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable.
  39089. </p></dd>
  39090. <dt>&lsquo;<samp class="samp">pchip</samp>&rsquo;</dt>
  39091. <dd><p>Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP).
  39092. </p></dd>
  39093. </dl>
  39094. </dd>
  39095. </dl>
  39096. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  39097. defined using the following syntax: <code class="code">x0/y0 x1/y1 x2/y2 ...</code>.
  39098. </p>
  39099. <a name="Commands-78"></a>
  39100. <h4 class="subsection">39.50.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-78" aria-hidden="true">TOC</a></span></h4>
  39101. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  39102. </p>
  39103. <a name="Examples-107"></a>
  39104. <h4 class="subsection">39.50.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-107" aria-hidden="true">TOC</a></span></h4>
  39105. <ul class="itemize mark-bullet">
  39106. <li>Increase slightly the middle level of blue:
  39107. <div class="example">
  39108. <pre class="example-preformatted">curves=blue='0/0 0.5/0.58 1/1'
  39109. </pre></div>
  39110. </li><li>Vintage effect:
  39111. <div class="example">
  39112. <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'
  39113. </pre></div>
  39114. <p>Here we obtain the following coordinates for each components:
  39115. </p><dl class="table">
  39116. <dt><var class="var">red</var></dt>
  39117. <dd><p><code class="code">(0;0.11) (0.42;0.51) (1;0.95)</code>
  39118. </p></dd>
  39119. <dt><var class="var">green</var></dt>
  39120. <dd><p><code class="code">(0;0) (0.50;0.48) (1;1)</code>
  39121. </p></dd>
  39122. <dt><var class="var">blue</var></dt>
  39123. <dd><p><code class="code">(0;0.22) (0.49;0.44) (1;0.80)</code>
  39124. </p></dd>
  39125. </dl>
  39126. </li><li>The previous example can also be achieved with the associated built-in preset:
  39127. <div class="example">
  39128. <pre class="example-preformatted">curves=preset=vintage
  39129. </pre></div>
  39130. </li><li>Or simply:
  39131. <div class="example">
  39132. <pre class="example-preformatted">curves=vintage
  39133. </pre></div>
  39134. </li><li>Use a Photoshop preset and redefine the points of the green component:
  39135. <div class="example">
  39136. <pre class="example-preformatted">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  39137. </pre></div>
  39138. </li><li>Check out the curves of the <code class="code">cross_process</code> profile using <code class="command">ffmpeg</code>
  39139. and <code class="command">gnuplot</code>:
  39140. <div class="example">
  39141. <pre class="example-preformatted">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  39142. gnuplot -p /tmp/curves.plt
  39143. </pre></div>
  39144. </li></ul>
  39145. <a name="datascope"></a>
  39146. <h3 class="section">39.51 datascope<span class="pull-right"><a class="anchor hidden-xs" href="#datascope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-datascope" aria-hidden="true">TOC</a></span></h3>
  39147. <p>Video data analysis filter.
  39148. </p>
  39149. <p>This filter shows hexadecimal pixel values of part of video.
  39150. </p>
  39151. <p>The filter accepts the following options:
  39152. </p>
  39153. <dl class="table">
  39154. <dt><samp class="option">size, s</samp></dt>
  39155. <dd><p>Set output video size.
  39156. </p>
  39157. </dd>
  39158. <dt><samp class="option">x</samp></dt>
  39159. <dd><p>Set x offset from where to pick pixels.
  39160. </p>
  39161. </dd>
  39162. <dt><samp class="option">y</samp></dt>
  39163. <dd><p>Set y offset from where to pick pixels.
  39164. </p>
  39165. </dd>
  39166. <dt><samp class="option">mode</samp></dt>
  39167. <dd><p>Set scope mode, can be one of the following:
  39168. </p><dl class="table">
  39169. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  39170. <dd><p>Draw hexadecimal pixel values with white color on black background.
  39171. </p>
  39172. </dd>
  39173. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  39174. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  39175. background.
  39176. </p>
  39177. </dd>
  39178. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  39179. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  39180. the text color is picked in such way so its always visible.
  39181. </p></dd>
  39182. </dl>
  39183. </dd>
  39184. <dt><samp class="option">axis</samp></dt>
  39185. <dd><p>Draw rows and columns numbers on left and top of video.
  39186. </p>
  39187. </dd>
  39188. <dt><samp class="option">opacity</samp></dt>
  39189. <dd><p>Set background opacity.
  39190. </p>
  39191. </dd>
  39192. <dt><samp class="option">format</samp></dt>
  39193. <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>.
  39194. </p>
  39195. </dd>
  39196. <dt><samp class="option">components</samp></dt>
  39197. <dd><p>Set pixel components to display. By default all pixel components are displayed.
  39198. </p></dd>
  39199. </dl>
  39200. <a name="Commands-79"></a>
  39201. <h4 class="subsection">39.51.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-79" aria-hidden="true">TOC</a></span></h4>
  39202. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options excluding <code class="code">size</code> option.
  39203. </p>
  39204. <a name="dblur"></a>
  39205. <h3 class="section">39.52 dblur<span class="pull-right"><a class="anchor hidden-xs" href="#dblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dblur" aria-hidden="true">TOC</a></span></h3>
  39206. <p>Apply Directional blur filter.
  39207. </p>
  39208. <p>The filter accepts the following options:
  39209. </p>
  39210. <dl class="table">
  39211. <dt><samp class="option">angle</samp></dt>
  39212. <dd><p>Set angle of directional blur. Default is <code class="code">45</code>.
  39213. </p>
  39214. </dd>
  39215. <dt><samp class="option">radius</samp></dt>
  39216. <dd><p>Set radius of directional blur. Default is <code class="code">5</code>.
  39217. </p>
  39218. </dd>
  39219. <dt><samp class="option">planes</samp></dt>
  39220. <dd><p>Set which planes to filter. By default all planes are filtered.
  39221. </p></dd>
  39222. </dl>
  39223. <a name="Commands-80"></a>
  39224. <h4 class="subsection">39.52.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-80" aria-hidden="true">TOC</a></span></h4>
  39225. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  39226. The command accepts the same syntax of the corresponding option.
  39227. </p>
  39228. <p>If the specified expression is not valid, it is kept at its current
  39229. value.
  39230. </p>
  39231. <a name="dctdnoiz"></a>
  39232. <h3 class="section">39.53 dctdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#dctdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dctdnoiz" aria-hidden="true">TOC</a></span></h3>
  39233. <p>Denoise frames using 2D DCT (frequency domain filtering).
  39234. </p>
  39235. <p>This filter is not designed for real time.
  39236. </p>
  39237. <p>The filter accepts the following options:
  39238. </p>
  39239. <dl class="table">
  39240. <dt><samp class="option">sigma, s</samp></dt>
  39241. <dd><p>Set the noise sigma constant.
  39242. </p>
  39243. <p>This <var class="var">sigma</var> defines a hard threshold of <code class="code">3 * sigma</code>; every DCT
  39244. coefficient (absolute value) below this threshold with be dropped.
  39245. </p>
  39246. <p>If you need a more advanced filtering, see <samp class="option">expr</samp>.
  39247. </p>
  39248. <p>Default is <code class="code">0</code>.
  39249. </p>
  39250. </dd>
  39251. <dt><samp class="option">overlap</samp></dt>
  39252. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  39253. may want to reduce this value, at the cost of a less effective filter and the
  39254. risk of various artefacts.
  39255. </p>
  39256. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  39257. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  39258. </p>
  39259. <p>Default value is <var class="var">blocksize</var>-1, which is the best possible setting.
  39260. </p>
  39261. </dd>
  39262. <dt><samp class="option">expr, e</samp></dt>
  39263. <dd><p>Set the coefficient factor expression.
  39264. </p>
  39265. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  39266. multiplier value for the coefficient.
  39267. </p>
  39268. <p>If this is option is set, the <samp class="option">sigma</samp> option will be ignored.
  39269. </p>
  39270. <p>The absolute value of the coefficient can be accessed through the <var class="var">c</var>
  39271. variable.
  39272. </p>
  39273. </dd>
  39274. <dt><samp class="option">n</samp></dt>
  39275. <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
  39276. <var class="var">blocksize</var>, which is the width and height of the processed blocks.
  39277. </p>
  39278. <p>The default value is <var class="var">3</var> (8x8) and can be raised to <var class="var">4</var> for a
  39279. <var class="var">blocksize</var> of 16x16. Note that changing this setting has huge consequences
  39280. on the speed processing. Also, a larger block size does not necessarily means a
  39281. better de-noising.
  39282. </p></dd>
  39283. </dl>
  39284. <a name="Examples-108"></a>
  39285. <h4 class="subsection">39.53.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-108" aria-hidden="true">TOC</a></span></h4>
  39286. <p>Apply a denoise with a <samp class="option">sigma</samp> of <code class="code">4.5</code>:
  39287. </p><div class="example">
  39288. <pre class="example-preformatted">dctdnoiz=4.5
  39289. </pre></div>
  39290. <p>The same operation can be achieved using the expression system:
  39291. </p><div class="example">
  39292. <pre class="example-preformatted">dctdnoiz=e='gte(c, 4.5*3)'
  39293. </pre></div>
  39294. <p>Violent denoise using a block size of <code class="code">16x16</code>:
  39295. </p><div class="example">
  39296. <pre class="example-preformatted">dctdnoiz=15:n=4
  39297. </pre></div>
  39298. <a name="deband"></a>
  39299. <h3 class="section">39.54 deband<span class="pull-right"><a class="anchor hidden-xs" href="#deband" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deband" aria-hidden="true">TOC</a></span></h3>
  39300. <p>Remove banding artifacts from input video.
  39301. It works by replacing banded pixels with average value of referenced pixels.
  39302. </p>
  39303. <p>The filter accepts the following options:
  39304. </p>
  39305. <dl class="table">
  39306. <dt><samp class="option">1thr</samp></dt>
  39307. <dt><samp class="option">2thr</samp></dt>
  39308. <dt><samp class="option">3thr</samp></dt>
  39309. <dt><samp class="option">4thr</samp></dt>
  39310. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  39311. Valid range is 0.00003 to 0.5.
  39312. If difference between current pixel and reference pixel is less than threshold,
  39313. it will be considered as banded.
  39314. </p>
  39315. </dd>
  39316. <dt><samp class="option">range, r</samp></dt>
  39317. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  39318. in range 0 to set value will be used. If negative, exact absolute value
  39319. will be used.
  39320. The range defines square of four pixels around current pixel.
  39321. </p>
  39322. </dd>
  39323. <dt><samp class="option">direction, d</samp></dt>
  39324. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  39325. random direction from 0 to set direction will be picked. If negative, exact of
  39326. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  39327. will pick only pixels on same row and -PI/2 will pick only pixels on same
  39328. column.
  39329. </p>
  39330. </dd>
  39331. <dt><samp class="option">blur, b</samp></dt>
  39332. <dd><p>If enabled, current pixel is compared with average value of all four
  39333. surrounding pixels. The default is enabled. If disabled current pixel is
  39334. compared with all four surrounding pixels. The pixel is considered banded
  39335. if only all four differences with surrounding pixels are less than threshold.
  39336. </p>
  39337. </dd>
  39338. <dt><samp class="option">coupling, c</samp></dt>
  39339. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  39340. e.g. banding detection threshold is triggered for all color components.
  39341. The default is disabled.
  39342. </p></dd>
  39343. </dl>
  39344. <a name="Commands-81"></a>
  39345. <h4 class="subsection">39.54.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-81" aria-hidden="true">TOC</a></span></h4>
  39346. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  39347. </p>
  39348. <a name="deblock"></a>
  39349. <h3 class="section">39.55 deblock<span class="pull-right"><a class="anchor hidden-xs" href="#deblock" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deblock" aria-hidden="true">TOC</a></span></h3>
  39350. <p>Remove blocking artifacts from input video.
  39351. </p>
  39352. <p>The filter accepts the following options:
  39353. </p>
  39354. <dl class="table">
  39355. <dt><samp class="option">filter</samp></dt>
  39356. <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>.
  39357. This controls what kind of deblocking is applied.
  39358. </p>
  39359. </dd>
  39360. <dt><samp class="option">block</samp></dt>
  39361. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var class="var">8</var>.
  39362. </p>
  39363. </dd>
  39364. <dt><samp class="option">alpha</samp></dt>
  39365. <dt><samp class="option">beta</samp></dt>
  39366. <dt><samp class="option">gamma</samp></dt>
  39367. <dt><samp class="option">delta</samp></dt>
  39368. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  39369. Defaults are: <var class="var">0.098</var> for <var class="var">alpha</var> and <var class="var">0.05</var> for the rest.
  39370. Using higher threshold gives more deblocking strength.
  39371. Setting <var class="var">alpha</var> controls threshold detection at exact edge of block.
  39372. Remaining options controls threshold detection near the edge. Each one for
  39373. below/above or left/right. Setting any of those to <var class="var">0</var> disables
  39374. deblocking.
  39375. </p>
  39376. </dd>
  39377. <dt><samp class="option">planes</samp></dt>
  39378. <dd><p>Set planes to filter. Default is to filter all available planes.
  39379. </p></dd>
  39380. </dl>
  39381. <a name="Examples-109"></a>
  39382. <h4 class="subsection">39.55.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-109" aria-hidden="true">TOC</a></span></h4>
  39383. <ul class="itemize mark-bullet">
  39384. <li>Deblock using weak filter and block size of 4 pixels.
  39385. <div class="example">
  39386. <pre class="example-preformatted">deblock=filter=weak:block=4
  39387. </pre></div>
  39388. </li><li>Deblock using strong filter, block size of 4 pixels and custom thresholds for
  39389. deblocking more edges.
  39390. <div class="example">
  39391. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  39392. </pre></div>
  39393. </li><li>Similar as above, but filter only first plane.
  39394. <div class="example">
  39395. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  39396. </pre></div>
  39397. </li><li>Similar as above, but filter only second and third plane.
  39398. <div class="example">
  39399. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  39400. </pre></div>
  39401. </li></ul>
  39402. <a name="Commands-82"></a>
  39403. <h4 class="subsection">39.55.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-82" aria-hidden="true">TOC</a></span></h4>
  39404. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  39405. </p>
  39406. <a class="anchor" id="decimate"></a><a name="decimate-1"></a>
  39407. <h3 class="section">39.56 decimate<span class="pull-right"><a class="anchor hidden-xs" href="#decimate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decimate-1" aria-hidden="true">TOC</a></span></h3>
  39408. <p>Drop duplicated frames at regular intervals.
  39409. </p>
  39410. <p>The filter accepts the following options:
  39411. </p>
  39412. <dl class="table">
  39413. <dt><samp class="option">cycle</samp></dt>
  39414. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  39415. <var class="var">N</var> means one frame in every batch of <var class="var">N</var> frames will be dropped.
  39416. Default is <code class="code">5</code>.
  39417. </p>
  39418. </dd>
  39419. <dt><samp class="option">dupthresh</samp></dt>
  39420. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  39421. is less than or equal to this value, then it is declared as duplicate. Default
  39422. is <code class="code">1.1</code>
  39423. </p>
  39424. </dd>
  39425. <dt><samp class="option">scthresh</samp></dt>
  39426. <dd><p>Set scene change threshold. Default is <code class="code">15</code>.
  39427. </p>
  39428. </dd>
  39429. <dt><samp class="option">blockx</samp></dt>
  39430. <dt><samp class="option">blocky</samp></dt>
  39431. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  39432. Larger blocks give better noise suppression, but also give worse detection of
  39433. small movements. Must be a power of two. Default is <code class="code">32</code>.
  39434. </p>
  39435. </dd>
  39436. <dt><samp class="option">ppsrc</samp></dt>
  39437. <dd><p>Mark main input as a pre-processed input and activate clean source input
  39438. stream. This allows the input to be pre-processed with various filters to help
  39439. the metrics calculation while keeping the frame selection lossless. When set to
  39440. <code class="code">1</code>, the first stream is for the pre-processed input, and the second
  39441. stream is the clean source from where the kept frames are chosen. Default is
  39442. <code class="code">0</code>.
  39443. </p>
  39444. </dd>
  39445. <dt><samp class="option">chroma</samp></dt>
  39446. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  39447. <code class="code">1</code>.
  39448. </p>
  39449. </dd>
  39450. <dt><samp class="option">mixed</samp></dt>
  39451. <dd><p>Set whether or not the input only partially contains content to be decimated.
  39452. Default is <code class="code">false</code>.
  39453. If enabled video output stream will be in variable frame rate.
  39454. </p></dd>
  39455. </dl>
  39456. <a name="deconvolve"></a>
  39457. <h3 class="section">39.57 deconvolve<span class="pull-right"><a class="anchor hidden-xs" href="#deconvolve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deconvolve" aria-hidden="true">TOC</a></span></h3>
  39458. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  39459. as impulse.
  39460. </p>
  39461. <p>The filter accepts the following options:
  39462. </p>
  39463. <dl class="table">
  39464. <dt><samp class="option">planes</samp></dt>
  39465. <dd><p>Set which planes to process.
  39466. </p>
  39467. </dd>
  39468. <dt><samp class="option">impulse</samp></dt>
  39469. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  39470. or <var class="var">all</var>. Default is <var class="var">all</var>.
  39471. </p>
  39472. </dd>
  39473. <dt><samp class="option">noise</samp></dt>
  39474. <dd><p>Set noise when doing divisions. Default is <var class="var">0.0000001</var>. Useful when width
  39475. and height are not same and not power of 2 or if stream prior to convolving
  39476. had noise.
  39477. </p></dd>
  39478. </dl>
  39479. <p>The <code class="code">deconvolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  39480. </p>
  39481. <a name="dedot"></a>
  39482. <h3 class="section">39.58 dedot<span class="pull-right"><a class="anchor hidden-xs" href="#dedot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dedot" aria-hidden="true">TOC</a></span></h3>
  39483. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  39484. </p>
  39485. <p>It accepts the following options:
  39486. </p>
  39487. <dl class="table">
  39488. <dt><samp class="option">m</samp></dt>
  39489. <dd><p>Set mode of operation. Can be combination of <var class="var">dotcrawl</var> for cross-luminance reduction and/or
  39490. <var class="var">rainbows</var> for cross-color reduction.
  39491. </p>
  39492. </dd>
  39493. <dt><samp class="option">lt</samp></dt>
  39494. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  39495. </p>
  39496. </dd>
  39497. <dt><samp class="option">tl</samp></dt>
  39498. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  39499. </p>
  39500. </dd>
  39501. <dt><samp class="option">tc</samp></dt>
  39502. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  39503. </p>
  39504. </dd>
  39505. <dt><samp class="option">ct</samp></dt>
  39506. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  39507. </p></dd>
  39508. </dl>
  39509. <a name="deflate"></a>
  39510. <h3 class="section">39.59 deflate<span class="pull-right"><a class="anchor hidden-xs" href="#deflate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deflate" aria-hidden="true">TOC</a></span></h3>
  39511. <p>Apply deflate effect to the video.
  39512. </p>
  39513. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  39514. only values lower than the pixel.
  39515. </p>
  39516. <p>It accepts the following options:
  39517. </p>
  39518. <dl class="table">
  39519. <dt><samp class="option">threshold0</samp></dt>
  39520. <dt><samp class="option">threshold1</samp></dt>
  39521. <dt><samp class="option">threshold2</samp></dt>
  39522. <dt><samp class="option">threshold3</samp></dt>
  39523. <dd><p>Limit the maximum change for each plane, default is 65535.
  39524. If 0, plane will remain unchanged.
  39525. </p></dd>
  39526. </dl>
  39527. <a name="Commands-83"></a>
  39528. <h4 class="subsection">39.59.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-83" aria-hidden="true">TOC</a></span></h4>
  39529. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  39530. </p>
  39531. <a name="deflicker"></a>
  39532. <h3 class="section">39.60 deflicker<span class="pull-right"><a class="anchor hidden-xs" href="#deflicker" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deflicker" aria-hidden="true">TOC</a></span></h3>
  39533. <p>Remove temporal frame luminance variations.
  39534. </p>
  39535. <p>It accepts the following options:
  39536. </p>
  39537. <dl class="table">
  39538. <dt><samp class="option">size, s</samp></dt>
  39539. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  39540. </p>
  39541. </dd>
  39542. <dt><samp class="option">mode, m</samp></dt>
  39543. <dd><p>Set averaging mode to smooth temporal luminance variations.
  39544. </p>
  39545. <p>Available values are:
  39546. </p><dl class="table">
  39547. <dt>&lsquo;<samp class="samp">am</samp>&rsquo;</dt>
  39548. <dd><p>Arithmetic mean
  39549. </p>
  39550. </dd>
  39551. <dt>&lsquo;<samp class="samp">gm</samp>&rsquo;</dt>
  39552. <dd><p>Geometric mean
  39553. </p>
  39554. </dd>
  39555. <dt>&lsquo;<samp class="samp">hm</samp>&rsquo;</dt>
  39556. <dd><p>Harmonic mean
  39557. </p>
  39558. </dd>
  39559. <dt>&lsquo;<samp class="samp">qm</samp>&rsquo;</dt>
  39560. <dd><p>Quadratic mean
  39561. </p>
  39562. </dd>
  39563. <dt>&lsquo;<samp class="samp">cm</samp>&rsquo;</dt>
  39564. <dd><p>Cubic mean
  39565. </p>
  39566. </dd>
  39567. <dt>&lsquo;<samp class="samp">pm</samp>&rsquo;</dt>
  39568. <dd><p>Power mean
  39569. </p>
  39570. </dd>
  39571. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  39572. <dd><p>Median
  39573. </p></dd>
  39574. </dl>
  39575. </dd>
  39576. <dt><samp class="option">bypass</samp></dt>
  39577. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  39578. </p></dd>
  39579. </dl>
  39580. <a name="dejudder"></a>
  39581. <h3 class="section">39.61 dejudder<span class="pull-right"><a class="anchor hidden-xs" href="#dejudder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dejudder" aria-hidden="true">TOC</a></span></h3>
  39582. <p>Remove judder produced by partially interlaced telecined content.
  39583. </p>
  39584. <p>Judder can be introduced, for instance, by <a class="ref" href="#pullup">pullup</a> filter. If the original
  39585. source was partially telecined content then the output of <code class="code">pullup,dejudder</code>
  39586. will have a variable frame rate. May change the recorded frame rate of the
  39587. container. Aside from that change, this filter will not affect constant frame
  39588. rate video.
  39589. </p>
  39590. <p>The option available in this filter is:
  39591. </p><dl class="table">
  39592. <dt><samp class="option">cycle</samp></dt>
  39593. <dd><p>Specify the length of the window over which the judder repeats.
  39594. </p>
  39595. <p>Accepts any integer greater than 1. Useful values are:
  39596. </p><dl class="table">
  39597. <dt>&lsquo;<samp class="samp">4</samp>&rsquo;</dt>
  39598. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  39599. </p>
  39600. </dd>
  39601. <dt>&lsquo;<samp class="samp">5</samp>&rsquo;</dt>
  39602. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  39603. </p>
  39604. </dd>
  39605. <dt>&lsquo;<samp class="samp">20</samp>&rsquo;</dt>
  39606. <dd><p>If a mixture of the two.
  39607. </p></dd>
  39608. </dl>
  39609. <p>The default is &lsquo;<samp class="samp">4</samp>&rsquo;.
  39610. </p></dd>
  39611. </dl>
  39612. <a name="delogo"></a>
  39613. <h3 class="section">39.62 delogo<span class="pull-right"><a class="anchor hidden-xs" href="#delogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-delogo" aria-hidden="true">TOC</a></span></h3>
  39614. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  39615. pixels. Just set a rectangle covering the logo and watch it disappear
  39616. (and sometimes something even uglier appear - your mileage may vary).
  39617. </p>
  39618. <p>It accepts the following parameters:
  39619. </p><dl class="table">
  39620. <dt><samp class="option">x</samp></dt>
  39621. <dt><samp class="option">y</samp></dt>
  39622. <dd><p>Specify the top left corner coordinates of the logo. They must be
  39623. specified.
  39624. </p>
  39625. </dd>
  39626. <dt><samp class="option">w</samp></dt>
  39627. <dt><samp class="option">h</samp></dt>
  39628. <dd><p>Specify the width and height of the logo to clear. They must be
  39629. specified.
  39630. </p>
  39631. </dd>
  39632. <dt><samp class="option">show</samp></dt>
  39633. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  39634. 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.
  39635. The default value is 0.
  39636. </p>
  39637. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  39638. replaced with interpolated values. The values of the next pixels
  39639. immediately outside this rectangle in each direction will be used to
  39640. compute the interpolated pixel values inside the rectangle.
  39641. </p>
  39642. </dd>
  39643. </dl>
  39644. <a name="Examples-110"></a>
  39645. <h4 class="subsection">39.62.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-110" aria-hidden="true">TOC</a></span></h4>
  39646. <ul class="itemize mark-bullet">
  39647. <li>Set a rectangle covering the area with top left corner coordinates 0,0
  39648. and size 100x77:
  39649. <div class="example">
  39650. <pre class="example-preformatted">delogo=x=0:y=0:w=100:h=77
  39651. </pre></div>
  39652. </li></ul>
  39653. <a class="anchor" id="derain"></a><a name="derain-1"></a>
  39654. <h3 class="section">39.63 derain<span class="pull-right"><a class="anchor hidden-xs" href="#derain-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-derain-1" aria-hidden="true">TOC</a></span></h3>
  39655. <p>Remove the rain in the input image/video by applying the derain methods based on
  39656. convolutional neural networks. Supported models:
  39657. </p>
  39658. <ul class="itemize mark-bullet">
  39659. <li>Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  39660. 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>.
  39661. </li></ul>
  39662. <p>Training as well as model generation scripts are provided in
  39663. the repository at <a class="url" href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  39664. </p>
  39665. <p>The filter accepts the following options:
  39666. </p>
  39667. <dl class="table">
  39668. <dt><samp class="option">filter_type</samp></dt>
  39669. <dd><p>Specify which filter to use. This option accepts the following values:
  39670. </p>
  39671. <dl class="table">
  39672. <dt>&lsquo;<samp class="samp">derain</samp>&rsquo;</dt>
  39673. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  39674. </p>
  39675. </dd>
  39676. <dt>&lsquo;<samp class="samp">dehaze</samp>&rsquo;</dt>
  39677. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  39678. </p></dd>
  39679. </dl>
  39680. <p>Default value is &lsquo;<samp class="samp">derain</samp>&rsquo;.
  39681. </p>
  39682. </dd>
  39683. <dt><samp class="option">dnn_backend</samp></dt>
  39684. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  39685. the following values:
  39686. </p>
  39687. <dl class="table">
  39688. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  39689. <dd><p>TensorFlow backend. To enable this backend you
  39690. need to install the TensorFlow for C library (see
  39691. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  39692. <code class="code">--enable-libtensorflow</code>
  39693. </p></dd>
  39694. </dl>
  39695. </dd>
  39696. <dt><samp class="option">model</samp></dt>
  39697. <dd><p>Set path to model file specifying network architecture and its parameters.
  39698. Note that different backends use different file formats. TensorFlow can load files for only its format.
  39699. </p></dd>
  39700. </dl>
  39701. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  39702. </p>
  39703. <a name="deshake"></a>
  39704. <h3 class="section">39.64 deshake<span class="pull-right"><a class="anchor hidden-xs" href="#deshake" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake" aria-hidden="true">TOC</a></span></h3>
  39705. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  39706. filter helps remove camera shake from hand-holding a camera, bumping a
  39707. tripod, moving on a vehicle, etc.
  39708. </p>
  39709. <p>The filter accepts the following options:
  39710. </p>
  39711. <dl class="table">
  39712. <dt><samp class="option">x</samp></dt>
  39713. <dt><samp class="option">y</samp></dt>
  39714. <dt><samp class="option">w</samp></dt>
  39715. <dt><samp class="option">h</samp></dt>
  39716. <dd><p>Specify a rectangular area where to limit the search for motion
  39717. vectors.
  39718. If desired the search for motion vectors can be limited to a
  39719. rectangular area of the frame defined by its top left corner, width
  39720. and height. These parameters have the same meaning as the drawbox
  39721. filter which can be used to visualise the position of the bounding
  39722. box.
  39723. </p>
  39724. <p>This is useful when simultaneous movement of subjects within the frame
  39725. might be confused for camera motion by the motion vector search.
  39726. </p>
  39727. <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
  39728. then the full frame is used. This allows later options to be set
  39729. without specifying the bounding box for the motion vector search.
  39730. </p>
  39731. <p>Default - search the whole frame.
  39732. </p>
  39733. </dd>
  39734. <dt><samp class="option">rx</samp></dt>
  39735. <dt><samp class="option">ry</samp></dt>
  39736. <dd><p>Specify the maximum extent of movement in x and y directions in the
  39737. range 0-64 pixels. Default 16.
  39738. </p>
  39739. </dd>
  39740. <dt><samp class="option">edge</samp></dt>
  39741. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  39742. frame. Available values are:
  39743. </p><dl class="table">
  39744. <dt>&lsquo;<samp class="samp">blank, 0</samp>&rsquo;</dt>
  39745. <dd><p>Fill zeroes at blank locations
  39746. </p></dd>
  39747. <dt>&lsquo;<samp class="samp">original, 1</samp>&rsquo;</dt>
  39748. <dd><p>Original image at blank locations
  39749. </p></dd>
  39750. <dt>&lsquo;<samp class="samp">clamp, 2</samp>&rsquo;</dt>
  39751. <dd><p>Extruded edge value at blank locations
  39752. </p></dd>
  39753. <dt>&lsquo;<samp class="samp">mirror, 3</samp>&rsquo;</dt>
  39754. <dd><p>Mirrored edge at blank locations
  39755. </p></dd>
  39756. </dl>
  39757. <p>Default value is &lsquo;<samp class="samp">mirror</samp>&rsquo;.
  39758. </p>
  39759. </dd>
  39760. <dt><samp class="option">blocksize</samp></dt>
  39761. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  39762. default 8.
  39763. </p>
  39764. </dd>
  39765. <dt><samp class="option">contrast</samp></dt>
  39766. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  39767. the specified contrast (difference between darkest and lightest
  39768. pixels) will be considered. Range 1-255, default 125.
  39769. </p>
  39770. </dd>
  39771. <dt><samp class="option">search</samp></dt>
  39772. <dd><p>Specify the search strategy. Available values are:
  39773. </p><dl class="table">
  39774. <dt>&lsquo;<samp class="samp">exhaustive, 0</samp>&rsquo;</dt>
  39775. <dd><p>Set exhaustive search
  39776. </p></dd>
  39777. <dt>&lsquo;<samp class="samp">less, 1</samp>&rsquo;</dt>
  39778. <dd><p>Set less exhaustive search.
  39779. </p></dd>
  39780. </dl>
  39781. <p>Default value is &lsquo;<samp class="samp">exhaustive</samp>&rsquo;.
  39782. </p>
  39783. </dd>
  39784. <dt><samp class="option">filename</samp></dt>
  39785. <dd><p>If set then a detailed log of the motion search is written to the
  39786. specified file.
  39787. </p>
  39788. </dd>
  39789. </dl>
  39790. <a name="despill"></a>
  39791. <h3 class="section">39.65 despill<span class="pull-right"><a class="anchor hidden-xs" href="#despill" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-despill" aria-hidden="true">TOC</a></span></h3>
  39792. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  39793. greenscreen or bluescreen.
  39794. </p>
  39795. <p>This filter accepts the following options:
  39796. </p>
  39797. <dl class="table">
  39798. <dt><samp class="option">type</samp></dt>
  39799. <dd><p>Set what type of despill to use.
  39800. </p>
  39801. </dd>
  39802. <dt><samp class="option">mix</samp></dt>
  39803. <dd><p>Set how spillmap will be generated.
  39804. </p>
  39805. </dd>
  39806. <dt><samp class="option">expand</samp></dt>
  39807. <dd><p>Set how much to get rid of still remaining spill.
  39808. </p>
  39809. </dd>
  39810. <dt><samp class="option">red</samp></dt>
  39811. <dd><p>Controls amount of red in spill area.
  39812. </p>
  39813. </dd>
  39814. <dt><samp class="option">green</samp></dt>
  39815. <dd><p>Controls amount of green in spill area.
  39816. Should be -1 for greenscreen.
  39817. </p>
  39818. </dd>
  39819. <dt><samp class="option">blue</samp></dt>
  39820. <dd><p>Controls amount of blue in spill area.
  39821. Should be -1 for bluescreen.
  39822. </p>
  39823. </dd>
  39824. <dt><samp class="option">brightness</samp></dt>
  39825. <dd><p>Controls brightness of spill area, preserving colors.
  39826. </p>
  39827. </dd>
  39828. <dt><samp class="option">alpha</samp></dt>
  39829. <dd><p>Modify alpha from generated spillmap.
  39830. </p></dd>
  39831. </dl>
  39832. <a name="Commands-84"></a>
  39833. <h4 class="subsection">39.65.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-84" aria-hidden="true">TOC</a></span></h4>
  39834. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  39835. </p>
  39836. <a name="detelecine"></a>
  39837. <h3 class="section">39.66 detelecine<span class="pull-right"><a class="anchor hidden-xs" href="#detelecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-detelecine" aria-hidden="true">TOC</a></span></h3>
  39838. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  39839. pattern specified using the pattern option which must be the same as that passed
  39840. to the telecine filter.
  39841. </p>
  39842. <p>This filter accepts the following options:
  39843. </p>
  39844. <dl class="table">
  39845. <dt><samp class="option">first_field</samp></dt>
  39846. <dd><dl class="table">
  39847. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  39848. <dd><p>top field first
  39849. </p></dd>
  39850. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  39851. <dd><p>bottom field first
  39852. The default value is <code class="code">top</code>.
  39853. </p></dd>
  39854. </dl>
  39855. </dd>
  39856. <dt><samp class="option">pattern</samp></dt>
  39857. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  39858. The default value is <code class="code">23</code>.
  39859. </p>
  39860. </dd>
  39861. <dt><samp class="option">start_frame</samp></dt>
  39862. <dd><p>A number representing position of the first frame with respect to the telecine
  39863. pattern. This is to be used if the stream is cut. The default value is <code class="code">0</code>.
  39864. </p></dd>
  39865. </dl>
  39866. <a class="anchor" id="dilation"></a><a name="dilation-1"></a>
  39867. <h3 class="section">39.67 dilation<span class="pull-right"><a class="anchor hidden-xs" href="#dilation-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation-1" aria-hidden="true">TOC</a></span></h3>
  39868. <p>Apply dilation effect to the video.
  39869. </p>
  39870. <p>This filter replaces the pixel by the local(3x3) maximum.
  39871. </p>
  39872. <p>It accepts the following options:
  39873. </p>
  39874. <dl class="table">
  39875. <dt><samp class="option">threshold0</samp></dt>
  39876. <dt><samp class="option">threshold1</samp></dt>
  39877. <dt><samp class="option">threshold2</samp></dt>
  39878. <dt><samp class="option">threshold3</samp></dt>
  39879. <dd><p>Limit the maximum change for each plane, default is 65535.
  39880. If 0, plane will remain unchanged.
  39881. </p>
  39882. </dd>
  39883. <dt><samp class="option">coordinates</samp></dt>
  39884. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  39885. pixels are used.
  39886. </p>
  39887. <p>Flags to local 3x3 coordinates maps like this:
  39888. </p>
  39889. <p>1 2 3
  39890. 4 5
  39891. 6 7 8
  39892. </p></dd>
  39893. </dl>
  39894. <a name="Commands-85"></a>
  39895. <h4 class="subsection">39.67.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-85" aria-hidden="true">TOC</a></span></h4>
  39896. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  39897. </p>
  39898. <a name="displace"></a>
  39899. <h3 class="section">39.68 displace<span class="pull-right"><a class="anchor hidden-xs" href="#displace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-displace" aria-hidden="true">TOC</a></span></h3>
  39900. <p>Displace pixels as indicated by second and third input stream.
  39901. </p>
  39902. <p>It takes three input streams and outputs one stream, the first input is the
  39903. source, and second and third input are displacement maps.
  39904. </p>
  39905. <p>The second input specifies how much to displace pixels along the
  39906. x-axis, while the third input specifies how much to displace pixels
  39907. along the y-axis.
  39908. If one of displacement map streams terminates, last frame from that
  39909. displacement map will be used.
  39910. </p>
  39911. <p>Note that once generated, displacements maps can be reused over and over again.
  39912. </p>
  39913. <p>A description of the accepted options follows.
  39914. </p>
  39915. <dl class="table">
  39916. <dt><samp class="option">edge</samp></dt>
  39917. <dd><p>Set displace behavior for pixels that are out of range.
  39918. </p>
  39919. <p>Available values are:
  39920. </p><dl class="table">
  39921. <dt>&lsquo;<samp class="samp">blank</samp>&rsquo;</dt>
  39922. <dd><p>Missing pixels are replaced by black pixels.
  39923. </p>
  39924. </dd>
  39925. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  39926. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  39927. </p>
  39928. </dd>
  39929. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  39930. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  39931. </p>
  39932. </dd>
  39933. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  39934. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  39935. </p></dd>
  39936. </dl>
  39937. <p>Default is &lsquo;<samp class="samp">smear</samp>&rsquo;.
  39938. </p>
  39939. </dd>
  39940. </dl>
  39941. <a name="Examples-111"></a>
  39942. <h4 class="subsection">39.68.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-111" aria-hidden="true">TOC</a></span></h4>
  39943. <ul class="itemize mark-bullet">
  39944. <li>Add ripple effect to rgb input of video size hd720:
  39945. <div class="example">
  39946. <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
  39947. </pre></div>
  39948. </li><li>Add wave effect to rgb input of video size hd720:
  39949. <div class="example">
  39950. <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
  39951. </pre></div>
  39952. </li></ul>
  39953. <a name="dnn_005fclassify"></a>
  39954. <h3 class="section">39.69 dnn_classify<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fclassify" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fclassify" aria-hidden="true">TOC</a></span></h3>
  39955. <p>Do classification with deep neural networks based on bounding boxes.
  39956. </p>
  39957. <p>The filter accepts the following options:
  39958. </p>
  39959. <dl class="table">
  39960. <dt><samp class="option">dnn_backend</samp></dt>
  39961. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  39962. only openvino now, tensorflow backends will be added.
  39963. </p>
  39964. </dd>
  39965. <dt><samp class="option">model</samp></dt>
  39966. <dd><p>Set path to model file specifying network architecture and its parameters.
  39967. Note that different backends use different file formats.
  39968. </p>
  39969. </dd>
  39970. <dt><samp class="option">input</samp></dt>
  39971. <dd><p>Set the input name of the dnn network.
  39972. </p>
  39973. </dd>
  39974. <dt><samp class="option">output</samp></dt>
  39975. <dd><p>Set the output name of the dnn network.
  39976. </p>
  39977. </dd>
  39978. <dt><samp class="option">confidence</samp></dt>
  39979. <dd><p>Set the confidence threshold (default: 0.5).
  39980. </p>
  39981. </dd>
  39982. <dt><samp class="option">labels</samp></dt>
  39983. <dd><p>Set path to label file specifying the mapping between label id and name.
  39984. Each label name is written in one line, tailing spaces and empty lines are skipped.
  39985. The first line is the name of label id 0,
  39986. and the second line is the name of label id 1, etc.
  39987. The label id is considered as name if the label file is not provided.
  39988. </p>
  39989. </dd>
  39990. <dt><samp class="option">backend_configs</samp></dt>
  39991. <dd><p>Set the configs to be passed into backend
  39992. </p>
  39993. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  39994. please use tools/python/tf_sess_config.py to get the configs for your system.
  39995. </p>
  39996. </dd>
  39997. </dl>
  39998. <a name="dnn_005fdetect"></a>
  39999. <h3 class="section">39.70 dnn_detect<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fdetect" aria-hidden="true">TOC</a></span></h3>
  40000. <p>Do object detection with deep neural networks.
  40001. </p>
  40002. <p>The filter accepts the following options:
  40003. </p>
  40004. <dl class="table">
  40005. <dt><samp class="option">dnn_backend</samp></dt>
  40006. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  40007. only openvino now, tensorflow backends will be added.
  40008. </p>
  40009. </dd>
  40010. <dt><samp class="option">model</samp></dt>
  40011. <dd><p>Set path to model file specifying network architecture and its parameters.
  40012. Note that different backends use different file formats.
  40013. </p>
  40014. </dd>
  40015. <dt><samp class="option">input</samp></dt>
  40016. <dd><p>Set the input name of the dnn network.
  40017. </p>
  40018. </dd>
  40019. <dt><samp class="option">output</samp></dt>
  40020. <dd><p>Set the output name of the dnn network.
  40021. </p>
  40022. </dd>
  40023. <dt><samp class="option">confidence</samp></dt>
  40024. <dd><p>Set the confidence threshold (default: 0.5).
  40025. </p>
  40026. </dd>
  40027. <dt><samp class="option">labels</samp></dt>
  40028. <dd><p>Set path to label file specifying the mapping between label id and name.
  40029. Each label name is written in one line, tailing spaces and empty lines are skipped.
  40030. The first line is the name of label id 0 (usually it is &rsquo;background&rsquo;),
  40031. and the second line is the name of label id 1, etc.
  40032. The label id is considered as name if the label file is not provided.
  40033. </p>
  40034. </dd>
  40035. <dt><samp class="option">backend_configs</samp></dt>
  40036. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  40037. Roll back to sync execution if the backend does not support async.
  40038. </p>
  40039. </dd>
  40040. </dl>
  40041. <a class="anchor" id="dnn_005fprocessing"></a><a name="dnn_005fprocessing-1"></a>
  40042. <h3 class="section">39.71 dnn_processing<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fprocessing-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fprocessing-1" aria-hidden="true">TOC</a></span></h3>
  40043. <p>Do image processing with deep neural networks. It works together with another filter
  40044. which converts the pixel format of the Frame to what the dnn network requires.
  40045. </p>
  40046. <p>The filter accepts the following options:
  40047. </p>
  40048. <dl class="table">
  40049. <dt><samp class="option">dnn_backend</samp></dt>
  40050. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  40051. the following values:
  40052. </p>
  40053. <dl class="table">
  40054. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  40055. <dd><p>TensorFlow backend. To enable this backend you
  40056. need to install the TensorFlow for C library (see
  40057. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  40058. <code class="code">--enable-libtensorflow</code>
  40059. </p>
  40060. </dd>
  40061. <dt>&lsquo;<samp class="samp">openvino</samp>&rsquo;</dt>
  40062. <dd><p>OpenVINO backend. To enable this backend you
  40063. need to build and install the OpenVINO for C library (see
  40064. <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
  40065. <code class="code">--enable-libopenvino</code> (&ndash;extra-cflags=-I... &ndash;extra-ldflags=-L... might
  40066. be needed if the header files and libraries are not installed into system path)
  40067. </p>
  40068. </dd>
  40069. <dt>&lsquo;<samp class="samp">torch</samp>&rsquo;</dt>
  40070. <dd><p>Libtorch backend. To enable this backend you need to build and install Libtroch
  40071. for C++ library. Please download cxx11 ABI version (see
  40072. <a class="url" href="https://pytorch.org/get-started/locally">https://pytorch.org/get-started/locally</a>)
  40073. and configure FFmpeg with <code class="code">--enable-libtorch
  40074. --extra-cflags=-I/libtorch_root/libtorch/include
  40075. --extra-cflags=-I/libtorch_root/libtorch/include/torch/csrc/api/include
  40076. --extra-ldflags=-L/libtorch_root/libtorch/lib/</code>
  40077. </p>
  40078. </dd>
  40079. </dl>
  40080. </dd>
  40081. <dt><samp class="option">model</samp></dt>
  40082. <dd><p>Set path to model file specifying network architecture and its parameters.
  40083. Note that different backends use different file formats. TensorFlow, OpenVINO
  40084. and Libtorch backend can load files for only its format.
  40085. </p>
  40086. </dd>
  40087. <dt><samp class="option">input</samp></dt>
  40088. <dd><p>Set the input name of the dnn network.
  40089. </p>
  40090. </dd>
  40091. <dt><samp class="option">output</samp></dt>
  40092. <dd><p>Set the output name of the dnn network.
  40093. </p>
  40094. </dd>
  40095. <dt><samp class="option">backend_configs</samp></dt>
  40096. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  40097. Roll back to sync execution if the backend does not support async.
  40098. </p>
  40099. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  40100. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  40101. </p>
  40102. </dd>
  40103. </dl>
  40104. <a name="Examples-112"></a>
  40105. <h4 class="subsection">39.71.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-112" aria-hidden="true">TOC</a></span></h4>
  40106. <ul class="itemize mark-bullet">
  40107. <li>Remove rain in rgb24 frame with can.pb (see <a class="ref" href="#derain">derain</a> filter):
  40108. <div class="example">
  40109. <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
  40110. </pre></div>
  40111. </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):
  40112. <div class="example">
  40113. <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
  40114. </pre></div>
  40115. </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),
  40116. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  40117. <div class="example">
  40118. <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
  40119. </pre></div>
  40120. </li></ul>
  40121. <a name="drawbox"></a>
  40122. <h3 class="section">39.72 drawbox<span class="pull-right"><a class="anchor hidden-xs" href="#drawbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawbox" aria-hidden="true">TOC</a></span></h3>
  40123. <p>Draw a colored box on the input image.
  40124. </p>
  40125. <p>It accepts the following parameters:
  40126. </p>
  40127. <dl class="table">
  40128. <dt><samp class="option">x</samp></dt>
  40129. <dt><samp class="option">y</samp></dt>
  40130. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  40131. </p>
  40132. </dd>
  40133. <dt><samp class="option">width, w</samp></dt>
  40134. <dt><samp class="option">height, h</samp></dt>
  40135. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  40136. the input width and height. It defaults to 0.
  40137. </p>
  40138. </dd>
  40139. <dt><samp class="option">color, c</samp></dt>
  40140. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  40141. 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
  40142. value <code class="code">invert</code> is used, the box edge color is the same as the
  40143. video with inverted luma.
  40144. </p>
  40145. </dd>
  40146. <dt><samp class="option">thickness, t</samp></dt>
  40147. <dd><p>The expression which sets the thickness of the box edge.
  40148. A value of <code class="code">fill</code> will create a filled box. Default value is <code class="code">3</code>.
  40149. </p>
  40150. <p>See below for the list of accepted constants.
  40151. </p>
  40152. </dd>
  40153. <dt><samp class="option">replace</samp></dt>
  40154. <dd><p>Applicable if the input has alpha. With value <code class="code">1</code>, the pixels of the painted box
  40155. will overwrite the video&rsquo;s color and alpha pixels.
  40156. Default is <code class="code">0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  40157. </p></dd>
  40158. </dl>
  40159. <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
  40160. following constants:
  40161. </p>
  40162. <dl class="table">
  40163. <dt><samp class="option">dar</samp></dt>
  40164. <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>.
  40165. </p>
  40166. </dd>
  40167. <dt><samp class="option">hsub</samp></dt>
  40168. <dt><samp class="option">vsub</samp></dt>
  40169. <dd><p>horizontal and vertical chroma subsample values. For example for the
  40170. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  40171. </p>
  40172. </dd>
  40173. <dt><samp class="option">in_h, ih</samp></dt>
  40174. <dt><samp class="option">in_w, iw</samp></dt>
  40175. <dd><p>The input width and height.
  40176. </p>
  40177. </dd>
  40178. <dt><samp class="option">sar</samp></dt>
  40179. <dd><p>The input sample aspect ratio.
  40180. </p>
  40181. </dd>
  40182. <dt><samp class="option">x</samp></dt>
  40183. <dt><samp class="option">y</samp></dt>
  40184. <dd><p>The x and y offset coordinates where the box is drawn.
  40185. </p>
  40186. </dd>
  40187. <dt><samp class="option">w</samp></dt>
  40188. <dt><samp class="option">h</samp></dt>
  40189. <dd><p>The width and height of the drawn box.
  40190. </p>
  40191. </dd>
  40192. <dt><samp class="option">box_source</samp></dt>
  40193. <dd><p>Box source can be set as side_data_detection_bboxes if you want to use box data in
  40194. detection bboxes of side data.
  40195. </p>
  40196. <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
  40197. still use box data in detection bboxes of side data. So please do not use this parameter if you were
  40198. not sure about the box source.
  40199. </p>
  40200. </dd>
  40201. <dt><samp class="option">t</samp></dt>
  40202. <dd><p>The thickness of the drawn box.
  40203. </p>
  40204. <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
  40205. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  40206. </p>
  40207. </dd>
  40208. </dl>
  40209. <a name="Examples-113"></a>
  40210. <h4 class="subsection">39.72.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-113" aria-hidden="true">TOC</a></span></h4>
  40211. <ul class="itemize mark-bullet">
  40212. <li>Draw a black box around the edge of the input image:
  40213. <div class="example">
  40214. <pre class="example-preformatted">drawbox
  40215. </pre></div>
  40216. </li><li>Draw a box with color red and an opacity of 50%:
  40217. <div class="example">
  40218. <pre class="example-preformatted">drawbox=10:20:200:60:red@0.5
  40219. </pre></div>
  40220. <p>The previous example can be specified as:
  40221. </p><div class="example">
  40222. <pre class="example-preformatted">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  40223. </pre></div>
  40224. </li><li>Fill the box with pink color:
  40225. <div class="example">
  40226. <pre class="example-preformatted">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  40227. </pre></div>
  40228. </li><li>Draw a 2-pixel red 2.40:1 mask:
  40229. <div class="example">
  40230. <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
  40231. </pre></div>
  40232. </li></ul>
  40233. <a name="Commands-86"></a>
  40234. <h4 class="subsection">39.72.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-86" aria-hidden="true">TOC</a></span></h4>
  40235. <p>This filter supports same commands as options.
  40236. The command accepts the same syntax of the corresponding option.
  40237. </p>
  40238. <p>If the specified expression is not valid, it is kept at its current
  40239. value.
  40240. </p>
  40241. <a class="anchor" id="drawgraph"></a><a name="drawgraph-1"></a>
  40242. <h3 class="section">39.73 drawgraph<span class="pull-right"><a class="anchor hidden-xs" href="#drawgraph-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgraph-1" aria-hidden="true">TOC</a></span></h3>
  40243. <p>Draw a graph using input video metadata.
  40244. </p>
  40245. <p>It accepts the following parameters:
  40246. </p>
  40247. <dl class="table">
  40248. <dt><samp class="option">m1</samp></dt>
  40249. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  40250. </p>
  40251. </dd>
  40252. <dt><samp class="option">fg1</samp></dt>
  40253. <dd><p>Set 1st foreground color expression.
  40254. </p>
  40255. </dd>
  40256. <dt><samp class="option">m2</samp></dt>
  40257. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  40258. </p>
  40259. </dd>
  40260. <dt><samp class="option">fg2</samp></dt>
  40261. <dd><p>Set 2nd foreground color expression.
  40262. </p>
  40263. </dd>
  40264. <dt><samp class="option">m3</samp></dt>
  40265. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  40266. </p>
  40267. </dd>
  40268. <dt><samp class="option">fg3</samp></dt>
  40269. <dd><p>Set 3rd foreground color expression.
  40270. </p>
  40271. </dd>
  40272. <dt><samp class="option">m4</samp></dt>
  40273. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  40274. </p>
  40275. </dd>
  40276. <dt><samp class="option">fg4</samp></dt>
  40277. <dd><p>Set 4th foreground color expression.
  40278. </p>
  40279. </dd>
  40280. <dt><samp class="option">min</samp></dt>
  40281. <dd><p>Set minimal value of metadata value.
  40282. </p>
  40283. </dd>
  40284. <dt><samp class="option">max</samp></dt>
  40285. <dd><p>Set maximal value of metadata value.
  40286. </p>
  40287. </dd>
  40288. <dt><samp class="option">bg</samp></dt>
  40289. <dd><p>Set graph background color. Default is white.
  40290. </p>
  40291. </dd>
  40292. <dt><samp class="option">mode</samp></dt>
  40293. <dd><p>Set graph mode.
  40294. </p>
  40295. <p>Available values for mode is:
  40296. </p><dl class="table">
  40297. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  40298. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  40299. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  40300. </dl>
  40301. <p>Default is <code class="code">line</code>.
  40302. </p>
  40303. </dd>
  40304. <dt><samp class="option">slide</samp></dt>
  40305. <dd><p>Set slide mode.
  40306. </p>
  40307. <p>Available values for slide is:
  40308. </p><dl class="table">
  40309. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  40310. <dd><p>Draw new frame when right border is reached.
  40311. </p>
  40312. </dd>
  40313. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  40314. <dd><p>Replace old columns with new ones.
  40315. </p>
  40316. </dd>
  40317. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  40318. <dd><p>Scroll from right to left.
  40319. </p>
  40320. </dd>
  40321. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  40322. <dd><p>Scroll from left to right.
  40323. </p>
  40324. </dd>
  40325. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  40326. <dd><p>Draw single picture.
  40327. </p></dd>
  40328. </dl>
  40329. <p>Default is <code class="code">frame</code>.
  40330. </p>
  40331. </dd>
  40332. <dt><samp class="option">size</samp></dt>
  40333. <dd><p>Set size of graph video. For the syntax of this option, check the
  40334. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  40335. The default value is <code class="code">900x256</code>.
  40336. </p>
  40337. </dd>
  40338. <dt><samp class="option">rate, r</samp></dt>
  40339. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  40340. </p>
  40341. <p>The foreground color expressions can use the following variables:
  40342. </p><dl class="table">
  40343. <dt><samp class="option">MIN</samp></dt>
  40344. <dd><p>Minimal value of metadata value.
  40345. </p>
  40346. </dd>
  40347. <dt><samp class="option">MAX</samp></dt>
  40348. <dd><p>Maximal value of metadata value.
  40349. </p>
  40350. </dd>
  40351. <dt><samp class="option">VAL</samp></dt>
  40352. <dd><p>Current metadata key value.
  40353. </p></dd>
  40354. </dl>
  40355. <p>The color is defined as 0xAABBGGRR.
  40356. </p></dd>
  40357. </dl>
  40358. <p>Example using metadata from <a class="ref" href="#signalstats">signalstats</a> filter:
  40359. </p><div class="example">
  40360. <pre class="example-preformatted">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  40361. </pre></div>
  40362. <p>Example using metadata from <a class="ref" href="#ebur128">ebur128</a> filter:
  40363. </p><div class="example">
  40364. <pre class="example-preformatted">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  40365. </pre></div>
  40366. <a name="drawgrid"></a>
  40367. <h3 class="section">39.74 drawgrid<span class="pull-right"><a class="anchor hidden-xs" href="#drawgrid" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgrid" aria-hidden="true">TOC</a></span></h3>
  40368. <p>Draw a grid on the input image.
  40369. </p>
  40370. <p>It accepts the following parameters:
  40371. </p>
  40372. <dl class="table">
  40373. <dt><samp class="option">x</samp></dt>
  40374. <dt><samp class="option">y</samp></dt>
  40375. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  40376. </p>
  40377. </dd>
  40378. <dt><samp class="option">width, w</samp></dt>
  40379. <dt><samp class="option">height, h</samp></dt>
  40380. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  40381. input width and height, respectively, minus <code class="code">thickness</code>, so image gets
  40382. framed. Default to 0.
  40383. </p>
  40384. </dd>
  40385. <dt><samp class="option">color, c</samp></dt>
  40386. <dd><p>Specify the color of the grid. For the general syntax of this option,
  40387. 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
  40388. value <code class="code">invert</code> is used, the grid color is the same as the
  40389. video with inverted luma.
  40390. </p>
  40391. </dd>
  40392. <dt><samp class="option">thickness, t</samp></dt>
  40393. <dd><p>The expression which sets the thickness of the grid line. Default value is <code class="code">1</code>.
  40394. </p>
  40395. <p>See below for the list of accepted constants.
  40396. </p>
  40397. </dd>
  40398. <dt><samp class="option">replace</samp></dt>
  40399. <dd><p>Applicable if the input has alpha. With <code class="code">1</code> the pixels of the painted grid
  40400. will overwrite the video&rsquo;s color and alpha pixels.
  40401. Default is <code class="code">0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  40402. </p></dd>
  40403. </dl>
  40404. <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
  40405. following constants:
  40406. </p>
  40407. <dl class="table">
  40408. <dt><samp class="option">dar</samp></dt>
  40409. <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>.
  40410. </p>
  40411. </dd>
  40412. <dt><samp class="option">hsub</samp></dt>
  40413. <dt><samp class="option">vsub</samp></dt>
  40414. <dd><p>horizontal and vertical chroma subsample values. For example for the
  40415. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  40416. </p>
  40417. </dd>
  40418. <dt><samp class="option">in_h, ih</samp></dt>
  40419. <dt><samp class="option">in_w, iw</samp></dt>
  40420. <dd><p>The input grid cell width and height.
  40421. </p>
  40422. </dd>
  40423. <dt><samp class="option">sar</samp></dt>
  40424. <dd><p>The input sample aspect ratio.
  40425. </p>
  40426. </dd>
  40427. <dt><samp class="option">x</samp></dt>
  40428. <dt><samp class="option">y</samp></dt>
  40429. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  40430. </p>
  40431. </dd>
  40432. <dt><samp class="option">w</samp></dt>
  40433. <dt><samp class="option">h</samp></dt>
  40434. <dd><p>The width and height of the drawn cell.
  40435. </p>
  40436. </dd>
  40437. <dt><samp class="option">t</samp></dt>
  40438. <dd><p>The thickness of the drawn cell.
  40439. </p>
  40440. <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
  40441. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  40442. </p>
  40443. </dd>
  40444. </dl>
  40445. <a name="Examples-114"></a>
  40446. <h4 class="subsection">39.74.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-114" aria-hidden="true">TOC</a></span></h4>
  40447. <ul class="itemize mark-bullet">
  40448. <li>Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  40449. <div class="example">
  40450. <pre class="example-preformatted">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  40451. </pre></div>
  40452. </li><li>Draw a white 3x3 grid with an opacity of 50%:
  40453. <div class="example">
  40454. <pre class="example-preformatted">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  40455. </pre></div>
  40456. </li></ul>
  40457. <a name="Commands-87"></a>
  40458. <h4 class="subsection">39.74.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-87" aria-hidden="true">TOC</a></span></h4>
  40459. <p>This filter supports same commands as options.
  40460. The command accepts the same syntax of the corresponding option.
  40461. </p>
  40462. <p>If the specified expression is not valid, it is kept at its current
  40463. value.
  40464. </p>
  40465. <a class="anchor" id="drawtext"></a><a name="drawtext-1"></a>
  40466. <h3 class="section">39.75 drawtext<span class="pull-right"><a class="anchor hidden-xs" href="#drawtext-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawtext-1" aria-hidden="true">TOC</a></span></h3>
  40467. <p>Draw a text string or text from a specified file on top of a video, using the
  40468. libfreetype library.
  40469. </p>
  40470. <p>To enable compilation of this filter, you need to configure FFmpeg with
  40471. <code class="code">--enable-libfreetype</code> and <code class="code">--enable-libharfbuzz</code>.
  40472. To enable default font fallback and the <var class="var">font</var> option you need to
  40473. configure FFmpeg with <code class="code">--enable-libfontconfig</code>.
  40474. To enable the <var class="var">text_shaping</var> option, you need to configure FFmpeg with
  40475. <code class="code">--enable-libfribidi</code>.
  40476. </p>
  40477. <a name="Syntax-2"></a>
  40478. <h4 class="subsection">39.75.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax-2" aria-hidden="true">TOC</a></span></h4>
  40479. <p>It accepts the following parameters:
  40480. </p>
  40481. <dl class="table">
  40482. <dt><samp class="option">box</samp></dt>
  40483. <dd><p>Used to draw a box around text using the background color.
  40484. The value must be either 1 (enable) or 0 (disable).
  40485. The default value of <var class="var">box</var> is 0.
  40486. </p>
  40487. </dd>
  40488. <dt><samp class="option">boxborderw</samp></dt>
  40489. <dd><p>Set the width of the border to be drawn around the box using <var class="var">boxcolor</var>.
  40490. The value must be specified using one of the following formats:
  40491. </p><ul class="itemize mark-bullet">
  40492. <li><code class="code">boxborderw=10</code> set the width of all the borders to 10
  40493. </li><li><code class="code">boxborderw=10|20</code> set the width of the top and bottom borders to 10
  40494. and the width of the left and right borders to 20
  40495. </li><li><code class="code">boxborderw=10|20|30</code> set the width of the top border to 10, the width
  40496. of the bottom border to 30 and the width of the left and right borders to 20
  40497. </li><li><code class="code">boxborderw=10|20|30|40</code> set the borders width to 10 (top), 20 (right),
  40498. 30 (bottom), 40 (left)
  40499. </li></ul>
  40500. <p>The default value of <var class="var">boxborderw</var> is &quot;0&quot;.
  40501. </p>
  40502. </dd>
  40503. <dt><samp class="option">boxcolor</samp></dt>
  40504. <dd><p>The color to be used for drawing box around text. For the syntax of this
  40505. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  40506. </p>
  40507. <p>The default value of <var class="var">boxcolor</var> is &quot;white&quot;.
  40508. </p>
  40509. </dd>
  40510. <dt><samp class="option">line_spacing</samp></dt>
  40511. <dd><p>Set the line spacing in pixels. The default value of <var class="var">line_spacing</var> is 0.
  40512. </p>
  40513. </dd>
  40514. <dt><samp class="option">text_align</samp></dt>
  40515. <dd><p>Set the vertical and horizontal alignment of the text with respect to the box boundaries.
  40516. The value is combination of flags, one for the vertical alignment (T=top,
  40517. M=middle, B=bottom) and one for the horizontal alignment (L=left, C=center, R=right).
  40518. Please note that tab characters are only supported with the left horizontal alignment.
  40519. </p>
  40520. </dd>
  40521. <dt><samp class="option">y_align</samp></dt>
  40522. <dd><p>Specify what the <var class="var">y</var> value is referred to. Possible values are:
  40523. </p><ul class="itemize mark-bullet">
  40524. <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>
  40525. </li><li><code class="code">baseline</code> the baseline of the first text line is placed at <var class="var">y</var>
  40526. </li><li><code class="code">font</code> the baseline of the first text line is placed at <var class="var">y</var> plus the
  40527. ascent (in pixels) defined in the font metrics
  40528. </li></ul>
  40529. <p>The default value of <var class="var">y_align</var> is &quot;text&quot; for backward compatibility.
  40530. </p>
  40531. </dd>
  40532. <dt><samp class="option">borderw</samp></dt>
  40533. <dd><p>Set the width of the border to be drawn around the text using <var class="var">bordercolor</var>.
  40534. The default value of <var class="var">borderw</var> is 0.
  40535. </p>
  40536. </dd>
  40537. <dt><samp class="option">bordercolor</samp></dt>
  40538. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  40539. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  40540. </p>
  40541. <p>The default value of <var class="var">bordercolor</var> is &quot;black&quot;.
  40542. </p>
  40543. </dd>
  40544. <dt><samp class="option">expansion</samp></dt>
  40545. <dd><p>Select how the <var class="var">text</var> is expanded. Can be either <code class="code">none</code>,
  40546. <code class="code">strftime</code> (deprecated) or <code class="code">normal</code> (default). See the
  40547. <a class="ref" href="#drawtext_005fexpansion">Text expansion</a> section below for details.
  40548. </p>
  40549. </dd>
  40550. <dt><samp class="option">basetime</samp></dt>
  40551. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  40552. in the deprecated <code class="code">strftime</code> expansion mode. To emulate in normal expansion
  40553. mode use the <code class="code">pts</code> function, supplying the start time (in seconds)
  40554. as the second argument.
  40555. </p>
  40556. </dd>
  40557. <dt><samp class="option">fix_bounds</samp></dt>
  40558. <dd><p>If true, check and fix text coords to avoid clipping.
  40559. </p>
  40560. </dd>
  40561. <dt><samp class="option">fontcolor</samp></dt>
  40562. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  40563. the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  40564. </p>
  40565. <p>The default value of <var class="var">fontcolor</var> is &quot;black&quot;.
  40566. </p>
  40567. </dd>
  40568. <dt><samp class="option">fontcolor_expr</samp></dt>
  40569. <dd><p>String which is expanded the same way as <var class="var">text</var> to obtain dynamic
  40570. <var class="var">fontcolor</var> value. By default this option has empty value and is not
  40571. processed. When this option is set, it overrides <var class="var">fontcolor</var> option.
  40572. </p>
  40573. </dd>
  40574. <dt><samp class="option">font</samp></dt>
  40575. <dd><p>The font family to be used for drawing text. By default Sans.
  40576. </p>
  40577. </dd>
  40578. <dt><samp class="option">fontfile</samp></dt>
  40579. <dd><p>The font file to be used for drawing text. The path must be included.
  40580. This parameter is mandatory if the fontconfig support is disabled.
  40581. </p>
  40582. </dd>
  40583. <dt><samp class="option">alpha</samp></dt>
  40584. <dd><p>Draw the text applying alpha blending. The value can
  40585. be a number between 0.0 and 1.0.
  40586. The expression accepts the same variables <var class="var">x, y</var> as well.
  40587. The default value is 1.
  40588. Please see <var class="var">fontcolor_expr</var>.
  40589. </p>
  40590. </dd>
  40591. <dt><samp class="option">fontsize</samp></dt>
  40592. <dd><p>The font size to be used for drawing text.
  40593. The default value of <var class="var">fontsize</var> is 16.
  40594. </p>
  40595. </dd>
  40596. <dt><samp class="option">text_shaping</samp></dt>
  40597. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  40598. right-to-left text and join Arabic characters) before drawing it.
  40599. Otherwise, just draw the text exactly as given.
  40600. By default 1 (if supported).
  40601. </p>
  40602. </dd>
  40603. <dt><samp class="option">ft_load_flags</samp></dt>
  40604. <dd><p>The flags to be used for loading the fonts.
  40605. </p>
  40606. <p>The flags map the corresponding flags supported by libfreetype, and are
  40607. a combination of the following values:
  40608. </p><dl class="table">
  40609. <dt><var class="var">default</var></dt>
  40610. <dt><var class="var">no_scale</var></dt>
  40611. <dt><var class="var">no_hinting</var></dt>
  40612. <dt><var class="var">render</var></dt>
  40613. <dt><var class="var">no_bitmap</var></dt>
  40614. <dt><var class="var">vertical_layout</var></dt>
  40615. <dt><var class="var">force_autohint</var></dt>
  40616. <dt><var class="var">crop_bitmap</var></dt>
  40617. <dt><var class="var">pedantic</var></dt>
  40618. <dt><var class="var">ignore_global_advance_width</var></dt>
  40619. <dt><var class="var">no_recurse</var></dt>
  40620. <dt><var class="var">ignore_transform</var></dt>
  40621. <dt><var class="var">monochrome</var></dt>
  40622. <dt><var class="var">linear_design</var></dt>
  40623. <dt><var class="var">no_autohint</var></dt>
  40624. </dl>
  40625. <p>Default value is &quot;default&quot;.
  40626. </p>
  40627. <p>For more information consult the documentation for the FT_LOAD_*
  40628. libfreetype flags.
  40629. </p>
  40630. </dd>
  40631. <dt><samp class="option">shadowcolor</samp></dt>
  40632. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  40633. syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the
  40634. ffmpeg-utils manual</a>.
  40635. </p>
  40636. <p>The default value of <var class="var">shadowcolor</var> is &quot;black&quot;.
  40637. </p>
  40638. </dd>
  40639. <dt><samp class="option">boxw</samp></dt>
  40640. <dd><p>Set the width of the box to be drawn around text.
  40641. The default value of <var class="var">boxw</var> is computed automatically to match the text width
  40642. </p>
  40643. </dd>
  40644. <dt><samp class="option">boxh</samp></dt>
  40645. <dd><p>Set the height of the box to be drawn around text.
  40646. The default value of <var class="var">boxh</var> is computed automatically to match the text height
  40647. </p>
  40648. </dd>
  40649. <dt><samp class="option">shadowx</samp></dt>
  40650. <dt><samp class="option">shadowy</samp></dt>
  40651. <dd><p>The x and y offsets for the text shadow position with respect to the
  40652. position of the text. They can be either positive or negative
  40653. values. The default value for both is &quot;0&quot;.
  40654. </p>
  40655. </dd>
  40656. <dt><samp class="option">start_number</samp></dt>
  40657. <dd><p>The starting frame number for the n/frame_num variable. The default value
  40658. is &quot;0&quot;.
  40659. </p>
  40660. </dd>
  40661. <dt><samp class="option">tabsize</samp></dt>
  40662. <dd><p>The size in number of spaces to use for rendering the tab.
  40663. Default value is 4.
  40664. </p>
  40665. </dd>
  40666. <dt><samp class="option">timecode</samp></dt>
  40667. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  40668. format. It can be used with or without text parameter. <var class="var">timecode_rate</var>
  40669. option must be specified.
  40670. </p>
  40671. </dd>
  40672. <dt><samp class="option">timecode_rate, rate, r</samp></dt>
  40673. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  40674. integer. Minimum value is &quot;1&quot;.
  40675. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  40676. </p>
  40677. </dd>
  40678. <dt><samp class="option">tc24hmax</samp></dt>
  40679. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  40680. Default is 0 (disabled).
  40681. </p>
  40682. </dd>
  40683. <dt><samp class="option">text</samp></dt>
  40684. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  40685. encoded characters.
  40686. This parameter is mandatory if no file is specified with the parameter
  40687. <var class="var">textfile</var>.
  40688. </p>
  40689. </dd>
  40690. <dt><samp class="option">textfile</samp></dt>
  40691. <dd><p>A text file containing text to be drawn. The text must be a sequence
  40692. of UTF-8 encoded characters.
  40693. </p>
  40694. <p>This parameter is mandatory if no text string is specified with the
  40695. parameter <var class="var">text</var>.
  40696. </p>
  40697. <p>If both <var class="var">text</var> and <var class="var">textfile</var> are specified, an error is thrown.
  40698. </p>
  40699. </dd>
  40700. <dt><samp class="option">text_source</samp></dt>
  40701. <dd><p>Text source should be set as side_data_detection_bboxes if you want to use text data in
  40702. detection bboxes of side data.
  40703. </p>
  40704. <p>If text source is set, <var class="var">text</var> and <var class="var">textfile</var> will be ignored and still use
  40705. text data in detection bboxes of side data. So please do not use this parameter
  40706. if you are not sure about the text source.
  40707. </p>
  40708. </dd>
  40709. <dt><samp class="option">reload</samp></dt>
  40710. <dd><p>The <var class="var">textfile</var> will be reloaded at specified frame interval.
  40711. Be sure to update <var class="var">textfile</var> atomically, or it may be read partially,
  40712. or even fail.
  40713. Range is 0 to INT_MAX. Default is 0.
  40714. </p>
  40715. </dd>
  40716. <dt><samp class="option">x</samp></dt>
  40717. <dt><samp class="option">y</samp></dt>
  40718. <dd><p>The expressions which specify the offsets where text will be drawn
  40719. within the video frame. They are relative to the top/left border of the
  40720. output image.
  40721. </p>
  40722. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is &quot;0&quot;.
  40723. </p>
  40724. <p>See below for the list of accepted constants and functions.
  40725. </p></dd>
  40726. </dl>
  40727. <p>The parameters for <var class="var">x</var> and <var class="var">y</var> are expressions containing the
  40728. following constants and functions:
  40729. </p>
  40730. <dl class="table">
  40731. <dt><samp class="option">dar</samp></dt>
  40732. <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>
  40733. </p>
  40734. </dd>
  40735. <dt><samp class="option">hsub</samp></dt>
  40736. <dt><samp class="option">vsub</samp></dt>
  40737. <dd><p>horizontal and vertical chroma subsample values. For example for the
  40738. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  40739. </p>
  40740. </dd>
  40741. <dt><samp class="option">line_h, lh</samp></dt>
  40742. <dd><p>the height of each text line
  40743. </p>
  40744. </dd>
  40745. <dt><samp class="option">main_h, h, H</samp></dt>
  40746. <dd><p>the input height
  40747. </p>
  40748. </dd>
  40749. <dt><samp class="option">main_w, w, W</samp></dt>
  40750. <dd><p>the input width
  40751. </p>
  40752. </dd>
  40753. <dt><samp class="option">max_glyph_a, ascent</samp></dt>
  40754. <dd><p>the maximum distance from the baseline to the highest/upper grid
  40755. coordinate used to place a glyph outline point, for all the rendered
  40756. glyphs.
  40757. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  40758. upwards.
  40759. </p>
  40760. </dd>
  40761. <dt><samp class="option">max_glyph_d, descent</samp></dt>
  40762. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  40763. used to place a glyph outline point, for all the rendered glyphs.
  40764. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  40765. upwards.
  40766. </p>
  40767. </dd>
  40768. <dt><samp class="option">max_glyph_h</samp></dt>
  40769. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  40770. contained in the rendered text, it is equivalent to <var class="var">ascent</var> -
  40771. <var class="var">descent</var>.
  40772. </p>
  40773. </dd>
  40774. <dt><samp class="option">max_glyph_w</samp></dt>
  40775. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  40776. contained in the rendered text
  40777. </p>
  40778. </dd>
  40779. <dt><samp class="option">font_a</samp></dt>
  40780. <dd><p>the ascent size defined in the font metrics
  40781. </p>
  40782. </dd>
  40783. <dt><samp class="option">font_d</samp></dt>
  40784. <dd><p>the descent size defined in the font metrics
  40785. </p>
  40786. </dd>
  40787. <dt><samp class="option">top_a</samp></dt>
  40788. <dd><p>the maximum ascender of the glyphs of the first text line
  40789. </p>
  40790. </dd>
  40791. <dt><samp class="option">bottom_d</samp></dt>
  40792. <dd><p>the maximum descender of the glyphs of the last text line
  40793. </p>
  40794. </dd>
  40795. <dt><samp class="option">n</samp></dt>
  40796. <dd><p>the number of input frame, starting from 0
  40797. </p>
  40798. </dd>
  40799. <dt><samp class="option">rand(min, max)</samp></dt>
  40800. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  40801. </p>
  40802. </dd>
  40803. <dt><samp class="option">sar</samp></dt>
  40804. <dd><p>The input sample aspect ratio.
  40805. </p>
  40806. </dd>
  40807. <dt><samp class="option">t</samp></dt>
  40808. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  40809. </p>
  40810. </dd>
  40811. <dt><samp class="option">text_h, th</samp></dt>
  40812. <dd><p>the height of the rendered text
  40813. </p>
  40814. </dd>
  40815. <dt><samp class="option">text_w, tw</samp></dt>
  40816. <dd><p>the width of the rendered text
  40817. </p>
  40818. </dd>
  40819. <dt><samp class="option">x</samp></dt>
  40820. <dt><samp class="option">y</samp></dt>
  40821. <dd><p>the x and y offset coordinates where the text is drawn.
  40822. </p>
  40823. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer
  40824. to each other, so you can for example specify <code class="code">y=x/dar</code>.
  40825. </p>
  40826. </dd>
  40827. <dt><samp class="option">pict_type</samp></dt>
  40828. <dd><p>A one character description of the current frame&rsquo;s picture type.
  40829. </p>
  40830. </dd>
  40831. <dt><samp class="option">pkt_pos</samp></dt>
  40832. <dd><p>The current packet&rsquo;s position in the input file or stream
  40833. (in bytes, from the start of the input). A value of -1 indicates
  40834. this info is not available.
  40835. </p>
  40836. </dd>
  40837. <dt><samp class="option">duration</samp></dt>
  40838. <dd><p>The current packet&rsquo;s duration, in seconds.
  40839. </p>
  40840. </dd>
  40841. <dt><samp class="option">pkt_size</samp></dt>
  40842. <dd><p>The current packet&rsquo;s size (in bytes).
  40843. </p></dd>
  40844. </dl>
  40845. <a class="anchor" id="drawtext_005fexpansion"></a><a name="Text-expansion"></a>
  40846. <h4 class="subsection">39.75.2 Text expansion<span class="pull-right"><a class="anchor hidden-xs" href="#Text-expansion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Text-expansion" aria-hidden="true">TOC</a></span></h4>
  40847. <p>If <samp class="option">expansion</samp> is set to <code class="code">strftime</code>, the filter recognizes
  40848. sequences accepted by the <code class="code">strftime</code> C function in the provided
  40849. text and expands them accordingly. Check the documentation of
  40850. <code class="code">strftime</code>. This feature is deprecated in favor of <code class="code">normal</code>
  40851. expansion with the <code class="code">gmtime</code> or <code class="code">localtime</code> expansion
  40852. functions.
  40853. </p>
  40854. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  40855. </p>
  40856. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  40857. the following expansion mechanism is used.
  40858. </p>
  40859. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  40860. the second character.
  40861. </p>
  40862. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  40863. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  40864. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  40865. they should be escaped.
  40866. </p>
  40867. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  40868. option in the filter argument string and as the filter argument in the
  40869. filtergraph description, and possibly also for the shell, that makes up to four
  40870. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  40871. these problems.
  40872. </p>
  40873. <p>The following functions are available:
  40874. </p>
  40875. <dl class="table">
  40876. <dt><code class="command">expr, e</code></dt>
  40877. <dd><p>The expression evaluation result.
  40878. </p>
  40879. <p>It must take one argument specifying the expression to be evaluated,
  40880. which accepts the same constants and functions as the <var class="var">x</var> and
  40881. <var class="var">y</var> values. Note that not all constants should be used, for
  40882. example the text size is not known when evaluating the expression, so
  40883. the constants <var class="var">text_w</var> and <var class="var">text_h</var> will have an undefined
  40884. value.
  40885. </p>
  40886. </dd>
  40887. <dt><code class="command">expr_int_format, eif</code></dt>
  40888. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  40889. </p>
  40890. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  40891. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  40892. &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
  40893. <code class="code">printf</code> function.
  40894. The third parameter is optional and sets the number of positions taken by the output.
  40895. It can be used to add padding with zeros from the left.
  40896. </p>
  40897. </dd>
  40898. <dt><code class="command">gmtime</code></dt>
  40899. <dd><p>The time at which the filter is running, expressed in UTC.
  40900. It can accept an argument: a <code class="code">strftime</code> C function format string.
  40901. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  40902. which prints fractions of the second with optionally specified number of digits.
  40903. </p>
  40904. </dd>
  40905. <dt><code class="command">localtime</code></dt>
  40906. <dd><p>The time at which the filter is running, expressed in the local time zone.
  40907. It can accept an argument: a <code class="code">strftime</code> C function format string.
  40908. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  40909. which prints fractions of the second with optionally specified number of digits.
  40910. </p>
  40911. </dd>
  40912. <dt><code class="command">metadata</code></dt>
  40913. <dd><p>Frame metadata. Takes one or two arguments.
  40914. </p>
  40915. <p>The first argument is mandatory and specifies the metadata key.
  40916. </p>
  40917. <p>The second argument is optional and specifies a default value, used when the
  40918. metadata key is not found or empty.
  40919. </p>
  40920. <p>Available metadata can be identified by inspecting entries
  40921. starting with TAG included within each frame section
  40922. printed by running <code class="code">ffprobe -show_frames</code>.
  40923. </p>
  40924. <p>String metadata generated in filters leading to
  40925. the drawtext filter are also available.
  40926. </p>
  40927. </dd>
  40928. <dt><code class="command">n, frame_num</code></dt>
  40929. <dd><p>The frame number, starting from 0.
  40930. </p>
  40931. </dd>
  40932. <dt><code class="command">pict_type</code></dt>
  40933. <dd><p>A one character description of the current picture type.
  40934. </p>
  40935. </dd>
  40936. <dt><code class="command">pts</code></dt>
  40937. <dd><p>The timestamp of the current frame.
  40938. It can take up to three arguments.
  40939. </p>
  40940. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code>
  40941. for seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands
  40942. for a formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  40943. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  40944. <code class="code">localtime</code> stands for the timestamp of the frame formatted as
  40945. local time zone time.
  40946. </p>
  40947. <p>The second argument is an offset added to the timestamp.
  40948. </p>
  40949. <p>If the format is set to <code class="code">hms</code>, a third argument <code class="code">24HH</code> may be
  40950. supplied to present the hour part of the formatted timestamp in 24h format
  40951. (00-23).
  40952. </p>
  40953. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third
  40954. argument may be supplied: a <code class="code">strftime</code> C function format string.
  40955. By default, <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  40956. </p></dd>
  40957. </dl>
  40958. <a name="Commands-88"></a>
  40959. <h4 class="subsection">39.75.3 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-88" aria-hidden="true">TOC</a></span></h4>
  40960. <p>This filter supports altering parameters via commands:
  40961. </p><dl class="table">
  40962. <dt><samp class="option">reinit</samp></dt>
  40963. <dd><p>Alter existing filter parameters.
  40964. </p>
  40965. <p>Syntax for the argument is the same as for filter invocation, e.g.
  40966. </p>
  40967. <div class="example">
  40968. <pre class="example-preformatted">fontsize=56:fontcolor=green:text='Hello World'
  40969. </pre></div>
  40970. <p>Full filter invocation with sendcmd would look like this:
  40971. </p>
  40972. <div class="example">
  40973. <pre class="example-preformatted">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  40974. </pre></div>
  40975. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  40976. continue with its existing parameters.
  40977. </p>
  40978. </dd>
  40979. </dl>
  40980. <p>The following options are also supported as <a class="ref" href="#commands">commands</a>:
  40981. </p>
  40982. <ul class="itemize mark-bullet">
  40983. <li>x
  40984. </li><li>y
  40985. </li><li>alpha
  40986. </li><li>fontsize
  40987. </li><li>fontcolor
  40988. </li><li>boxcolor
  40989. </li><li>bordercolor
  40990. </li><li>shadowcolor
  40991. </li><li>box
  40992. </li><li>boxw
  40993. </li><li>boxh
  40994. </li><li>boxborderw
  40995. </li><li>line_spacing
  40996. </li><li>text_align
  40997. </li><li>shadowx
  40998. </li><li>shadowy
  40999. </li><li>borderw
  41000. </li></ul>
  41001. <a name="Examples-115"></a>
  41002. <h4 class="subsection">39.75.4 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-115" aria-hidden="true">TOC</a></span></h4>
  41003. <ul class="itemize mark-bullet">
  41004. <li>Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  41005. optional parameters.
  41006. <div class="example">
  41007. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  41008. </pre></div>
  41009. </li><li>Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  41010. and y=50 (counting from the top-left corner of the screen), text is
  41011. yellow with a red box around it. Both the text and the box have an
  41012. opacity of 20%.
  41013. <div class="example">
  41014. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  41015. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  41016. </pre></div>
  41017. <p>Note that the double quotes are not necessary if spaces are not used
  41018. within the parameter list.
  41019. </p>
  41020. </li><li>Show the text at the center of the video frame:
  41021. <div class="example">
  41022. <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;
  41023. </pre></div>
  41024. </li><li>Show the text at a random position, switching to a new position every 30 seconds:
  41025. <div class="example">
  41026. <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;
  41027. </pre></div>
  41028. </li><li>Show a text line sliding from right to left in the last row of the video
  41029. frame. The file <samp class="file">LONG_LINE</samp> is assumed to contain a single line
  41030. with no newlines.
  41031. <div class="example">
  41032. <pre class="example-preformatted">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  41033. </pre></div>
  41034. </li><li>Show the content of file <samp class="file">CREDITS</samp> off the bottom of the frame and scroll up.
  41035. <div class="example">
  41036. <pre class="example-preformatted">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  41037. </pre></div>
  41038. </li><li>Draw a single green letter &quot;g&quot;, at the center of the input video.
  41039. The glyph baseline is placed at half screen height.
  41040. <div class="example">
  41041. <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;
  41042. </pre></div>
  41043. </li><li>Show text for 1 second every 3 seconds:
  41044. <div class="example">
  41045. <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;
  41046. </pre></div>
  41047. </li><li>Use fontconfig to set the font. Note that the colons need to be escaped.
  41048. <div class="example">
  41049. <pre class="example-preformatted">drawtext='fontfile=Linux Libertine O-40\\:style=Semibold:text=FFmpeg'
  41050. </pre></div>
  41051. </li><li>Draw &quot;Test Text&quot; with font size dependent on height of the video.
  41052. <div class="example">
  41053. <pre class="example-preformatted">drawtext=&quot;text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)&quot;
  41054. </pre></div>
  41055. </li><li>Print the date of a real-time encoding (see documentation for the
  41056. <code class="code">strftime</code> C function):
  41057. <div class="example">
  41058. <pre class="example-preformatted">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  41059. </pre></div>
  41060. </li><li>Show text fading in and out (appearing/disappearing):
  41061. <div class="example">
  41062. <pre class="example-preformatted">#!/bin/sh
  41063. DS=1.0 # display start
  41064. DE=10.0 # display end
  41065. FID=1.5 # fade in duration
  41066. FOD=5 # fade out duration
  41067. 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;
  41068. </pre></div>
  41069. </li><li>Horizontally align multiple separate texts. Note that <samp class="option">max_glyph_a</samp>
  41070. and the <samp class="option">fontsize</samp> value are included in the <samp class="option">y</samp> offset.
  41071. <div class="example">
  41072. <pre class="example-preformatted">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  41073. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  41074. </pre></div>
  41075. </li><li>Plot special <var class="var">lavf.image2dec.source_basename</var> metadata onto each frame if
  41076. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  41077. must have option <samp class="option">-export_path_metadata 1</samp> for the special metadata fields
  41078. to be available for filters.
  41079. <div class="example">
  41080. <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;
  41081. </pre></div>
  41082. </li></ul>
  41083. <p>For more information about libfreetype, check:
  41084. <a class="url" href="http://www.freetype.org/">http://www.freetype.org/</a>.
  41085. </p>
  41086. <p>For more information about fontconfig, check:
  41087. <a class="url" href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  41088. </p>
  41089. <p>For more information about libfribidi, check:
  41090. <a class="url" href="http://fribidi.org/">http://fribidi.org/</a>.
  41091. </p>
  41092. <p>For more information about libharfbuzz, check:
  41093. <a class="url" href="https://github.com/harfbuzz/harfbuzz">https://github.com/harfbuzz/harfbuzz</a>.
  41094. </p>
  41095. <a class="anchor" id="drawvg"></a><a name="drawvg-1"></a>
  41096. <h3 class="section">39.76 drawvg<span class="pull-right"><a class="anchor hidden-xs" href="#drawvg-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawvg-1" aria-hidden="true">TOC</a></span></h3>
  41097. <p>Draw vector graphics on top of video frames, by executing a script written in
  41098. a custom language called VGS (<em class="emph">Vector Graphics Script</em>).
  41099. </p>
  41100. <p>The documentation for the language can be found in
  41101. <a data-manual="drawvg-reference" href="drawvg-reference.html#Top">drawvg - Language Reference</a>. A version of this reference
  41102. with rendered examples can be found at the
  41103. <a class="uref" href="https://ayosec.github.io/ffmpeg-drawvg/playground/docs/langref.html">author&rsquo;s site</a>.
  41104. </p>
  41105. <p>Graphics are rendered using the <a class="uref" href="https://cairographics.org/">cario 2D
  41106. graphics library</a>.
  41107. </p>
  41108. <p>To enable compilation of this filter, you need to configure FFmpeg with
  41109. <code class="code">--enable-cairo</code>.
  41110. </p>
  41111. <a name="Parameters"></a>
  41112. <h4 class="subsection">39.76.1 Parameters<span class="pull-right"><a class="anchor hidden-xs" href="#Parameters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Parameters" aria-hidden="true">TOC</a></span></h4>
  41113. <p>Either <code class="code">script</code> or <code class="code">file</code> must be set.
  41114. </p>
  41115. <dl class="table">
  41116. <dt><samp class="option">s, script</samp></dt>
  41117. <dd><p>Script source to draw the graphics.
  41118. </p>
  41119. </dd>
  41120. <dt><samp class="option">file</samp></dt>
  41121. <dd><p>Path of the file to load the script source.
  41122. </p>
  41123. </dd>
  41124. </dl>
  41125. <a name="Pixel-Formats"></a>
  41126. <h4 class="subsection">39.76.2 Pixel Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Pixel-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pixel-Formats" aria-hidden="true">TOC</a></span></h4>
  41127. <p>Since Cairo only supports RGB images, if the input video is something else (like
  41128. YUV 4:2:0), before executing the script the video is converted to a format
  41129. compatible with Cairo. Then, you have to use either the <a class="ref" href="#format">format</a> filter,
  41130. or the <code class="code">-pix_fmt</code> option, to convert it to the expected format in the
  41131. output.
  41132. </p>
  41133. <a name="Examples-116"></a>
  41134. <h4 class="subsection">39.76.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-116" aria-hidden="true">TOC</a></span></h4>
  41135. <ul class="itemize mark-bullet">
  41136. <li>Draw the outline of an ellipse.
  41137. <div class="example">
  41138. <pre class="example-preformatted">ffmpeg -i input.webm \
  41139. -vf 'drawvg=ellipse (w/2) (h/2) (w/3) (h/3) stroke' \
  41140. -pix_fmt yuv420p \
  41141. output.webm
  41142. </pre></div>
  41143. </li><li>
  41144. Draw a square rotating in the middle of the frame.
  41145. <p>The script for drawvg is in a file <code class="code">draw.vgs</code>:
  41146. </p>
  41147. <div class="example">
  41148. <pre class="example-preformatted">translate (w/2) (h/2)
  41149. rotate t
  41150. rect -100 -100 200 200
  41151. setcolor red@0.5
  41152. fill
  41153. </pre></div>
  41154. <p>Then:
  41155. </p>
  41156. <div class="example">
  41157. <pre class="example-preformatted">ffmpeg -i input.webm -vf 'drawvg=file=draw.vgs,format=yuv420p' output.webm
  41158. </pre></div>
  41159. </li></ul>
  41160. <a name="edgedetect"></a>
  41161. <h3 class="section">39.77 edgedetect<span class="pull-right"><a class="anchor hidden-xs" href="#edgedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-edgedetect" aria-hidden="true">TOC</a></span></h3>
  41162. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  41163. </p>
  41164. <p>The filter accepts the following options:
  41165. </p>
  41166. <dl class="table">
  41167. <dt><samp class="option">low</samp></dt>
  41168. <dt><samp class="option">high</samp></dt>
  41169. <dd><p>Set low and high threshold values used by the Canny thresholding
  41170. algorithm.
  41171. </p>
  41172. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  41173. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  41174. by the low threshold.
  41175. </p>
  41176. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  41177. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  41178. </p>
  41179. <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>
  41180. is <code class="code">50/255</code>.
  41181. </p>
  41182. </dd>
  41183. <dt><samp class="option">mode</samp></dt>
  41184. <dd><p>Define the drawing mode.
  41185. </p>
  41186. <dl class="table">
  41187. <dt>&lsquo;<samp class="samp">wires</samp>&rsquo;</dt>
  41188. <dd><p>Draw white/gray wires on black background.
  41189. </p>
  41190. </dd>
  41191. <dt>&lsquo;<samp class="samp">colormix</samp>&rsquo;</dt>
  41192. <dd><p>Mix the colors to create a paint/cartoon effect.
  41193. </p>
  41194. </dd>
  41195. <dt>&lsquo;<samp class="samp">canny</samp>&rsquo;</dt>
  41196. <dd><p>Apply Canny edge detector on all selected planes.
  41197. </p></dd>
  41198. </dl>
  41199. <p>Default value is <var class="var">wires</var>.
  41200. </p>
  41201. </dd>
  41202. <dt><samp class="option">planes</samp></dt>
  41203. <dd><p>Select planes for filtering. By default all available planes are filtered.
  41204. </p></dd>
  41205. </dl>
  41206. <a name="Examples-117"></a>
  41207. <h4 class="subsection">39.77.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-117" aria-hidden="true">TOC</a></span></h4>
  41208. <ul class="itemize mark-bullet">
  41209. <li>Standard edge detection with custom values for the hysteresis thresholding:
  41210. <div class="example">
  41211. <pre class="example-preformatted">edgedetect=low=0.1:high=0.4
  41212. </pre></div>
  41213. </li><li>Painting effect without thresholding:
  41214. <div class="example">
  41215. <pre class="example-preformatted">edgedetect=mode=colormix:high=0
  41216. </pre></div>
  41217. </li></ul>
  41218. <a name="elbg"></a>
  41219. <h3 class="section">39.78 elbg<span class="pull-right"><a class="anchor hidden-xs" href="#elbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-elbg" aria-hidden="true">TOC</a></span></h3>
  41220. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  41221. </p>
  41222. <p>For each input image, the filter will compute the optimal mapping from
  41223. the input to the output given the codebook length, that is the number
  41224. of distinct output colors.
  41225. </p>
  41226. <p>This filter accepts the following options.
  41227. </p>
  41228. <dl class="table">
  41229. <dt><samp class="option">codebook_length, l</samp></dt>
  41230. <dd><p>Set codebook length. The value must be a positive integer, and
  41231. represents the number of distinct output colors. Default value is 256.
  41232. </p>
  41233. </dd>
  41234. <dt><samp class="option">nb_steps, n</samp></dt>
  41235. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  41236. mapping. The higher the value the better the result and the higher the
  41237. computation time. Default value is 1.
  41238. </p>
  41239. </dd>
  41240. <dt><samp class="option">seed, s</samp></dt>
  41241. <dd><p>Set a random seed, must be an integer included between 0 and
  41242. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  41243. will try to use a good random seed on a best effort basis.
  41244. </p>
  41245. </dd>
  41246. <dt><samp class="option">pal8</samp></dt>
  41247. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  41248. length greater than 256. Default is disabled.
  41249. </p>
  41250. </dd>
  41251. <dt><samp class="option">use_alpha</samp></dt>
  41252. <dd><p>Include alpha values in the quantization calculation. Allows creating
  41253. palettized output images (e.g. PNG8) with multiple alpha smooth blending.
  41254. </p></dd>
  41255. </dl>
  41256. <a name="entropy"></a>
  41257. <h3 class="section">39.79 entropy<span class="pull-right"><a class="anchor hidden-xs" href="#entropy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-entropy" aria-hidden="true">TOC</a></span></h3>
  41258. <p>Measure graylevel entropy in histogram of color channels of video frames.
  41259. </p>
  41260. <p>It accepts the following parameters:
  41261. </p>
  41262. <dl class="table">
  41263. <dt><samp class="option">mode</samp></dt>
  41264. <dd><p>Can be either <var class="var">normal</var> or <var class="var">diff</var>. Default is <var class="var">normal</var>.
  41265. </p>
  41266. <p><var class="var">diff</var> mode measures entropy of histogram delta values, absolute differences
  41267. between neighbour histogram values.
  41268. </p></dd>
  41269. </dl>
  41270. <a name="epx"></a>
  41271. <h3 class="section">39.80 epx<span class="pull-right"><a class="anchor hidden-xs" href="#epx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-epx" aria-hidden="true">TOC</a></span></h3>
  41272. <p>Apply the EPX magnification filter which is designed for pixel art.
  41273. </p>
  41274. <p>It accepts the following option:
  41275. </p>
  41276. <dl class="table">
  41277. <dt><samp class="option">n</samp></dt>
  41278. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xEPX</code>, <code class="code">3</code> for
  41279. <code class="code">3xEPX</code>.
  41280. Default is <code class="code">3</code>.
  41281. </p></dd>
  41282. </dl>
  41283. <a name="eq"></a>
  41284. <h3 class="section">39.81 eq<span class="pull-right"><a class="anchor hidden-xs" href="#eq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eq" aria-hidden="true">TOC</a></span></h3>
  41285. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  41286. </p>
  41287. <p>The filter accepts the following options:
  41288. </p>
  41289. <dl class="table">
  41290. <dt><samp class="option">contrast</samp></dt>
  41291. <dd><p>Set the contrast expression. The value must be a float value in range
  41292. <code class="code">-1000.0</code> to <code class="code">1000.0</code>. The default value is &quot;1&quot;.
  41293. </p>
  41294. </dd>
  41295. <dt><samp class="option">brightness</samp></dt>
  41296. <dd><p>Set the brightness expression. The value must be a float value in
  41297. range <code class="code">-1.0</code> to <code class="code">1.0</code>. The default value is &quot;0&quot;.
  41298. </p>
  41299. </dd>
  41300. <dt><samp class="option">saturation</samp></dt>
  41301. <dd><p>Set the saturation expression. The value must be a float in
  41302. range <code class="code">0.0</code> to <code class="code">3.0</code>. The default value is &quot;1&quot;.
  41303. </p>
  41304. </dd>
  41305. <dt><samp class="option">gamma</samp></dt>
  41306. <dd><p>Set the gamma expression. The value must be a float in range
  41307. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  41308. </p>
  41309. </dd>
  41310. <dt><samp class="option">gamma_r</samp></dt>
  41311. <dd><p>Set the gamma expression for red. The value must be a float in
  41312. range <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  41313. </p>
  41314. </dd>
  41315. <dt><samp class="option">gamma_g</samp></dt>
  41316. <dd><p>Set the gamma expression for green. The value must be a float in range
  41317. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  41318. </p>
  41319. </dd>
  41320. <dt><samp class="option">gamma_b</samp></dt>
  41321. <dd><p>Set the gamma expression for blue. The value must be a float in range
  41322. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  41323. </p>
  41324. </dd>
  41325. <dt><samp class="option">gamma_weight</samp></dt>
  41326. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  41327. of a high gamma value on bright image areas, e.g. keep them from
  41328. getting overamplified and just plain white. The value must be a float
  41329. 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
  41330. gamma correction all the way down while <code class="code">1.0</code> leaves it at its
  41331. full strength. Default is &quot;1&quot;.
  41332. </p>
  41333. </dd>
  41334. <dt><samp class="option">eval</samp></dt>
  41335. <dd><p>Set when the expressions for brightness, contrast, saturation and
  41336. gamma expressions are evaluated.
  41337. </p>
  41338. <p>It accepts the following values:
  41339. </p><dl class="table">
  41340. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  41341. <dd><p>only evaluate expressions once during the filter initialization or
  41342. when a command is processed
  41343. </p>
  41344. </dd>
  41345. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  41346. <dd><p>evaluate expressions for each incoming frame
  41347. </p></dd>
  41348. </dl>
  41349. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  41350. </p></dd>
  41351. </dl>
  41352. <p>The expressions accept the following parameters:
  41353. </p><dl class="table">
  41354. <dt><samp class="option">n</samp></dt>
  41355. <dd><p>frame count of the input frame starting from 0
  41356. </p>
  41357. </dd>
  41358. <dt><samp class="option">pos</samp></dt>
  41359. <dd><p>byte position of the corresponding packet in the input file, NAN if
  41360. unspecified; deprecated, do not use
  41361. </p>
  41362. </dd>
  41363. <dt><samp class="option">r</samp></dt>
  41364. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  41365. </p>
  41366. </dd>
  41367. <dt><samp class="option">t</samp></dt>
  41368. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  41369. </p></dd>
  41370. </dl>
  41371. <a name="Commands-89"></a>
  41372. <h4 class="subsection">39.81.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-89" aria-hidden="true">TOC</a></span></h4>
  41373. <p>The filter supports the following commands:
  41374. </p>
  41375. <dl class="table">
  41376. <dt><samp class="option">contrast</samp></dt>
  41377. <dd><p>Set the contrast expression.
  41378. </p>
  41379. </dd>
  41380. <dt><samp class="option">brightness</samp></dt>
  41381. <dd><p>Set the brightness expression.
  41382. </p>
  41383. </dd>
  41384. <dt><samp class="option">saturation</samp></dt>
  41385. <dd><p>Set the saturation expression.
  41386. </p>
  41387. </dd>
  41388. <dt><samp class="option">gamma</samp></dt>
  41389. <dd><p>Set the gamma expression.
  41390. </p>
  41391. </dd>
  41392. <dt><samp class="option">gamma_r</samp></dt>
  41393. <dd><p>Set the gamma_r expression.
  41394. </p>
  41395. </dd>
  41396. <dt><samp class="option">gamma_g</samp></dt>
  41397. <dd><p>Set gamma_g expression.
  41398. </p>
  41399. </dd>
  41400. <dt><samp class="option">gamma_b</samp></dt>
  41401. <dd><p>Set gamma_b expression.
  41402. </p>
  41403. </dd>
  41404. <dt><samp class="option">gamma_weight</samp></dt>
  41405. <dd><p>Set gamma_weight expression.
  41406. </p>
  41407. <p>The command accepts the same syntax of the corresponding option.
  41408. </p>
  41409. <p>If the specified expression is not valid, it is kept at its current
  41410. value.
  41411. </p>
  41412. </dd>
  41413. </dl>
  41414. <a class="anchor" id="erosion"></a><a name="erosion-1"></a>
  41415. <h3 class="section">39.82 erosion<span class="pull-right"><a class="anchor hidden-xs" href="#erosion-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion-1" aria-hidden="true">TOC</a></span></h3>
  41416. <p>Apply erosion effect to the video.
  41417. </p>
  41418. <p>This filter replaces the pixel by the local(3x3) minimum.
  41419. </p>
  41420. <p>It accepts the following options:
  41421. </p>
  41422. <dl class="table">
  41423. <dt><samp class="option">threshold0</samp></dt>
  41424. <dt><samp class="option">threshold1</samp></dt>
  41425. <dt><samp class="option">threshold2</samp></dt>
  41426. <dt><samp class="option">threshold3</samp></dt>
  41427. <dd><p>Limit the maximum change for each plane, default is 65535.
  41428. If 0, plane will remain unchanged.
  41429. </p>
  41430. </dd>
  41431. <dt><samp class="option">coordinates</samp></dt>
  41432. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  41433. pixels are used.
  41434. </p>
  41435. <p>Flags to local 3x3 coordinates maps like this:
  41436. </p>
  41437. <p>1 2 3
  41438. 4 5
  41439. 6 7 8
  41440. </p></dd>
  41441. </dl>
  41442. <a name="Commands-90"></a>
  41443. <h4 class="subsection">39.82.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-90" aria-hidden="true">TOC</a></span></h4>
  41444. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  41445. </p>
  41446. <a name="estdif"></a>
  41447. <h3 class="section">39.83 estdif<span class="pull-right"><a class="anchor hidden-xs" href="#estdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-estdif" aria-hidden="true">TOC</a></span></h3>
  41448. <p>Deinterlace the input video (&quot;estdif&quot; stands for &quot;Edge Slope
  41449. Tracing Deinterlacing Filter&quot;).
  41450. </p>
  41451. <p>Spatial only filter that uses edge slope tracing algorithm
  41452. to interpolate missing lines.
  41453. It accepts the following parameters:
  41454. </p>
  41455. <dl class="table">
  41456. <dt><samp class="option">mode</samp></dt>
  41457. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  41458. </p>
  41459. <dl class="table">
  41460. <dt><samp class="option">frame</samp></dt>
  41461. <dd><p>Output one frame for each frame.
  41462. </p></dd>
  41463. <dt><samp class="option">field</samp></dt>
  41464. <dd><p>Output one frame for each field.
  41465. </p></dd>
  41466. </dl>
  41467. <p>The default value is <code class="code">field</code>.
  41468. </p>
  41469. </dd>
  41470. <dt><samp class="option">parity</samp></dt>
  41471. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  41472. of the following values:
  41473. </p>
  41474. <dl class="table">
  41475. <dt><samp class="option">tff</samp></dt>
  41476. <dd><p>Assume the top field is first.
  41477. </p></dd>
  41478. <dt><samp class="option">bff</samp></dt>
  41479. <dd><p>Assume the bottom field is first.
  41480. </p></dd>
  41481. <dt><samp class="option">auto</samp></dt>
  41482. <dd><p>Enable automatic detection of field parity.
  41483. </p></dd>
  41484. </dl>
  41485. <p>The default value is <code class="code">auto</code>.
  41486. If the interlacing is unknown or the decoder does not export this information,
  41487. top field first will be assumed.
  41488. </p>
  41489. </dd>
  41490. <dt><samp class="option">deint</samp></dt>
  41491. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  41492. values:
  41493. </p>
  41494. <dl class="table">
  41495. <dt><samp class="option">all</samp></dt>
  41496. <dd><p>Deinterlace all frames.
  41497. </p></dd>
  41498. <dt><samp class="option">interlaced</samp></dt>
  41499. <dd><p>Only deinterlace frames marked as interlaced.
  41500. </p></dd>
  41501. </dl>
  41502. <p>The default value is <code class="code">all</code>.
  41503. </p>
  41504. </dd>
  41505. <dt><samp class="option">rslope</samp></dt>
  41506. <dd><p>Specify the search radius for edge slope tracing. Default value is 1.
  41507. Allowed range is from 1 to 15.
  41508. </p>
  41509. </dd>
  41510. <dt><samp class="option">redge</samp></dt>
  41511. <dd><p>Specify the search radius for best edge matching. Default value is 2.
  41512. Allowed range is from 0 to 15.
  41513. </p>
  41514. </dd>
  41515. <dt><samp class="option">ecost</samp></dt>
  41516. <dd><p>Specify the edge cost for edge matching. Default value is 2.
  41517. Allowed range is from 0 to 50.
  41518. </p>
  41519. </dd>
  41520. <dt><samp class="option">mcost</samp></dt>
  41521. <dd><p>Specify the middle cost for edge matching. Default value is 1.
  41522. Allowed range is from 0 to 50.
  41523. </p>
  41524. </dd>
  41525. <dt><samp class="option">dcost</samp></dt>
  41526. <dd><p>Specify the distance cost for edge matching. Default value is 1.
  41527. Allowed range is from 0 to 50.
  41528. </p>
  41529. </dd>
  41530. <dt><samp class="option">interp</samp></dt>
  41531. <dd><p>Specify the interpolation used. Default is 4-point interpolation. It accepts one
  41532. of the following values:
  41533. </p>
  41534. <dl class="table">
  41535. <dt><samp class="option">2p</samp></dt>
  41536. <dd><p>Two-point interpolation.
  41537. </p></dd>
  41538. <dt><samp class="option">4p</samp></dt>
  41539. <dd><p>Four-point interpolation.
  41540. </p></dd>
  41541. <dt><samp class="option">6p</samp></dt>
  41542. <dd><p>Six-point interpolation.
  41543. </p></dd>
  41544. </dl>
  41545. </dd>
  41546. </dl>
  41547. <a name="Commands-91"></a>
  41548. <h4 class="subsection">39.83.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-91" aria-hidden="true">TOC</a></span></h4>
  41549. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  41550. </p>
  41551. <a name="exposure"></a>
  41552. <h3 class="section">39.84 exposure<span class="pull-right"><a class="anchor hidden-xs" href="#exposure" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-exposure" aria-hidden="true">TOC</a></span></h3>
  41553. <p>Adjust exposure of the video stream.
  41554. </p>
  41555. <p>The filter accepts the following options:
  41556. </p>
  41557. <dl class="table">
  41558. <dt><samp class="option">exposure</samp></dt>
  41559. <dd><p>Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV
  41560. Default value is 0 EV.
  41561. </p>
  41562. </dd>
  41563. <dt><samp class="option">black</samp></dt>
  41564. <dd><p>Set the black level correction. Allowed range is from -1.0 to 1.0.
  41565. Default value is 0.
  41566. </p></dd>
  41567. </dl>
  41568. <a name="Commands-92"></a>
  41569. <h4 class="subsection">39.84.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-92" aria-hidden="true">TOC</a></span></h4>
  41570. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  41571. </p>
  41572. <a name="extractplanes"></a>
  41573. <h3 class="section">39.85 extractplanes<span class="pull-right"><a class="anchor hidden-xs" href="#extractplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extractplanes" aria-hidden="true">TOC</a></span></h3>
  41574. <p>Extract color channel components from input video stream into
  41575. separate grayscale video streams.
  41576. </p>
  41577. <p>The filter accepts the following option:
  41578. </p>
  41579. <dl class="table">
  41580. <dt><samp class="option">planes</samp></dt>
  41581. <dd><p>Set plane(s) to extract.
  41582. </p>
  41583. <p>Available values for planes are:
  41584. </p><dl class="table">
  41585. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  41586. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  41587. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  41588. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  41589. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  41590. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  41591. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  41592. </dl>
  41593. <p>Choosing planes not available in the input will result in an error.
  41594. That means you cannot select <code class="code">r</code>, <code class="code">g</code>, <code class="code">b</code> planes
  41595. with <code class="code">y</code>, <code class="code">u</code>, <code class="code">v</code> planes at same time.
  41596. </p></dd>
  41597. </dl>
  41598. <a name="Examples-118"></a>
  41599. <h4 class="subsection">39.85.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-118" aria-hidden="true">TOC</a></span></h4>
  41600. <ul class="itemize mark-bullet">
  41601. <li>Extract luma, u and v color channel component from input video frame
  41602. into 3 grayscale outputs:
  41603. <div class="example">
  41604. <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
  41605. </pre></div>
  41606. </li></ul>
  41607. <a name="fade"></a>
  41608. <h3 class="section">39.86 fade<span class="pull-right"><a class="anchor hidden-xs" href="#fade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fade" aria-hidden="true">TOC</a></span></h3>
  41609. <p>Apply a fade-in/out effect to the input video.
  41610. </p>
  41611. <p>It accepts the following parameters:
  41612. </p>
  41613. <dl class="table">
  41614. <dt><samp class="option">type, t</samp></dt>
  41615. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  41616. effect.
  41617. Default is <code class="code">in</code>.
  41618. </p>
  41619. </dd>
  41620. <dt><samp class="option">start_frame, s</samp></dt>
  41621. <dd><p>Specify the number of the frame to start applying the fade
  41622. effect at. Default is 0.
  41623. </p>
  41624. </dd>
  41625. <dt><samp class="option">nb_frames, n</samp></dt>
  41626. <dd><p>The number of frames that the fade effect lasts. At the end of the
  41627. fade-in effect, the output video will have the same intensity as the input video.
  41628. At the end of the fade-out transition, the output video will be filled with the
  41629. selected <samp class="option">color</samp>.
  41630. Default is 25.
  41631. </p>
  41632. </dd>
  41633. <dt><samp class="option">alpha</samp></dt>
  41634. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  41635. Default value is 0.
  41636. </p>
  41637. </dd>
  41638. <dt><samp class="option">start_time, st</samp></dt>
  41639. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  41640. effect. If both start_frame and start_time are specified, the fade will start at
  41641. whichever comes last. Default is 0.
  41642. </p>
  41643. </dd>
  41644. <dt><samp class="option">duration, d</samp></dt>
  41645. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  41646. fade-in effect the output video will have the same intensity as the input video,
  41647. at the end of the fade-out transition the output video will be filled with the
  41648. selected <samp class="option">color</samp>.
  41649. If both duration and nb_frames are specified, duration is used. Default is 0
  41650. (nb_frames is used by default).
  41651. </p>
  41652. </dd>
  41653. <dt><samp class="option">color, c</samp></dt>
  41654. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  41655. </p></dd>
  41656. </dl>
  41657. <a name="Examples-119"></a>
  41658. <h4 class="subsection">39.86.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-119" aria-hidden="true">TOC</a></span></h4>
  41659. <ul class="itemize mark-bullet">
  41660. <li>Fade in the first 30 frames of video:
  41661. <div class="example">
  41662. <pre class="example-preformatted">fade=in:0:30
  41663. </pre></div>
  41664. <p>The command above is equivalent to:
  41665. </p><div class="example">
  41666. <pre class="example-preformatted">fade=t=in:s=0:n=30
  41667. </pre></div>
  41668. </li><li>Fade out the last 45 frames of a 200-frame video:
  41669. <div class="example">
  41670. <pre class="example-preformatted">fade=out:155:45
  41671. fade=type=out:start_frame=155:nb_frames=45
  41672. </pre></div>
  41673. </li><li>Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  41674. <div class="example">
  41675. <pre class="example-preformatted">fade=in:0:25, fade=out:975:25
  41676. </pre></div>
  41677. </li><li>Make the first 5 frames yellow, then fade in from frame 5-24:
  41678. <div class="example">
  41679. <pre class="example-preformatted">fade=in:5:20:color=yellow
  41680. </pre></div>
  41681. </li><li>Fade in alpha over first 25 frames of video:
  41682. <div class="example">
  41683. <pre class="example-preformatted">fade=in:0:25:alpha=1
  41684. </pre></div>
  41685. </li><li>Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  41686. <div class="example">
  41687. <pre class="example-preformatted">fade=t=in:st=5.5:d=0.5
  41688. </pre></div>
  41689. </li></ul>
  41690. <a name="feedback"></a>
  41691. <h3 class="section">39.87 feedback<span class="pull-right"><a class="anchor hidden-xs" href="#feedback" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-feedback" aria-hidden="true">TOC</a></span></h3>
  41692. <p>Apply feedback video filter.
  41693. </p>
  41694. <p>This filter pass cropped input frames to 2nd output.
  41695. From there it can be filtered with other video filters.
  41696. After filter receives frame from 2nd input, that frame
  41697. is combined on top of original frame from 1st input and passed
  41698. to 1st output.
  41699. </p>
  41700. <p>The typical usage is filter only part of frame.
  41701. </p>
  41702. <p>The filter accepts the following options:
  41703. </p><dl class="table">
  41704. <dt><samp class="option">x</samp></dt>
  41705. <dt><samp class="option">y</samp></dt>
  41706. <dd><p>Set the top left crop position.
  41707. </p>
  41708. </dd>
  41709. <dt><samp class="option">w</samp></dt>
  41710. <dt><samp class="option">h</samp></dt>
  41711. <dd><p>Set the crop size.
  41712. </p></dd>
  41713. </dl>
  41714. <a name="Examples-120"></a>
  41715. <h4 class="subsection">39.87.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-120" aria-hidden="true">TOC</a></span></h4>
  41716. <ul class="itemize mark-bullet">
  41717. <li>Blur only top left rectangular part of video frame size 100x100 with gblur filter.
  41718. <div class="example">
  41719. <pre class="example-preformatted">[in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
  41720. </pre></div>
  41721. </li><li>Draw black box on top left part of video frame of size 100x100 with drawbox filter.
  41722. <div class="example">
  41723. <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]
  41724. </pre></div>
  41725. </li><li>Pixelize rectangular part of video frame of size 100x100 with pixelize filter.
  41726. <div class="example">
  41727. <pre class="example-preformatted">[in][blurin]feedback=x=320:y=240:w=100:h=100[out][blurout];[blurout]pixelize[blurin]
  41728. </pre></div>
  41729. </li></ul>
  41730. <a name="fftdnoiz"></a>
  41731. <h3 class="section">39.88 fftdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#fftdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftdnoiz" aria-hidden="true">TOC</a></span></h3>
  41732. <p>Denoise frames using 3D FFT (frequency domain filtering).
  41733. </p>
  41734. <p>The filter accepts the following options:
  41735. </p>
  41736. <dl class="table">
  41737. <dt><samp class="option">sigma</samp></dt>
  41738. <dd><p>Set the noise sigma constant. This sets denoising strength.
  41739. Default value is 1. Allowed range is from 0 to 30.
  41740. Using very high sigma with low overlap may give blocking artifacts.
  41741. </p>
  41742. </dd>
  41743. <dt><samp class="option">amount</samp></dt>
  41744. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  41745. Default value is 1. Allowed range is from 0 to 1.
  41746. </p>
  41747. </dd>
  41748. <dt><samp class="option">block</samp></dt>
  41749. <dd><p>Set size of block in pixels, Default is 32, can be 8 to 256.
  41750. </p>
  41751. </dd>
  41752. <dt><samp class="option">overlap</samp></dt>
  41753. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  41754. </p>
  41755. </dd>
  41756. <dt><samp class="option">method</samp></dt>
  41757. <dd><p>Set denoising method. Default is <code class="code">wiener</code>, can also be <code class="code">hard</code>.
  41758. </p>
  41759. </dd>
  41760. <dt><samp class="option">prev</samp></dt>
  41761. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  41762. </p>
  41763. </dd>
  41764. <dt><samp class="option">next</samp></dt>
  41765. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  41766. </p>
  41767. </dd>
  41768. <dt><samp class="option">planes</samp></dt>
  41769. <dd><p>Set planes which will be filtered, by default are all available filtered
  41770. except alpha.
  41771. </p></dd>
  41772. </dl>
  41773. <a name="fftfilt"></a>
  41774. <h3 class="section">39.89 fftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#fftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftfilt" aria-hidden="true">TOC</a></span></h3>
  41775. <p>Apply arbitrary expressions to samples in frequency domain
  41776. </p>
  41777. <dl class="table">
  41778. <dt><samp class="option">dc_Y</samp></dt>
  41779. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  41780. accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The default
  41781. value is set to <code class="code">0</code>.
  41782. </p>
  41783. </dd>
  41784. <dt><samp class="option">dc_U</samp></dt>
  41785. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  41786. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  41787. default value is set to <code class="code">0</code>.
  41788. </p>
  41789. </dd>
  41790. <dt><samp class="option">dc_V</samp></dt>
  41791. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  41792. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  41793. default value is set to <code class="code">0</code>.
  41794. </p>
  41795. </dd>
  41796. <dt><samp class="option">weight_Y</samp></dt>
  41797. <dd><p>Set the frequency domain weight expression for the luma plane.
  41798. </p>
  41799. </dd>
  41800. <dt><samp class="option">weight_U</samp></dt>
  41801. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  41802. </p>
  41803. </dd>
  41804. <dt><samp class="option">weight_V</samp></dt>
  41805. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  41806. </p>
  41807. </dd>
  41808. <dt><samp class="option">eval</samp></dt>
  41809. <dd><p>Set when the expressions are evaluated.
  41810. </p>
  41811. <p>It accepts the following values:
  41812. </p><dl class="table">
  41813. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  41814. <dd><p>Only evaluate expressions once during the filter initialization.
  41815. </p>
  41816. </dd>
  41817. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  41818. <dd><p>Evaluate expressions for each incoming frame.
  41819. </p></dd>
  41820. </dl>
  41821. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  41822. </p>
  41823. <p>The filter accepts the following variables:
  41824. </p></dd>
  41825. <dt><samp class="option">X</samp></dt>
  41826. <dt><samp class="option">Y</samp></dt>
  41827. <dd><p>The coordinates of the current sample.
  41828. </p>
  41829. </dd>
  41830. <dt><samp class="option">W</samp></dt>
  41831. <dt><samp class="option">H</samp></dt>
  41832. <dd><p>The width and height of the image.
  41833. </p>
  41834. </dd>
  41835. <dt><samp class="option">N</samp></dt>
  41836. <dd><p>The number of input frame, starting from 0.
  41837. </p>
  41838. </dd>
  41839. <dt><samp class="option">WS</samp></dt>
  41840. <dt><samp class="option">HS</samp></dt>
  41841. <dd><p>The size of FFT array for horizontal and vertical processing.
  41842. </p></dd>
  41843. </dl>
  41844. <a name="Examples-121"></a>
  41845. <h4 class="subsection">39.89.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-121" aria-hidden="true">TOC</a></span></h4>
  41846. <ul class="itemize mark-bullet">
  41847. <li>High-pass:
  41848. <div class="example">
  41849. <pre class="example-preformatted">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  41850. </pre></div>
  41851. </li><li>Low-pass:
  41852. <div class="example">
  41853. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  41854. </pre></div>
  41855. </li><li>Sharpen:
  41856. <div class="example">
  41857. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  41858. </pre></div>
  41859. </li><li>Blur:
  41860. <div class="example">
  41861. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  41862. </pre></div>
  41863. </li></ul>
  41864. <a name="field"></a>
  41865. <h3 class="section">39.90 field<span class="pull-right"><a class="anchor hidden-xs" href="#field" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-field" aria-hidden="true">TOC</a></span></h3>
  41866. <p>Extract a single field from an interlaced image using stride
  41867. arithmetic to avoid wasting CPU time. The output frames are marked as
  41868. non-interlaced.
  41869. </p>
  41870. <p>The filter accepts the following options:
  41871. </p>
  41872. <dl class="table">
  41873. <dt><samp class="option">type</samp></dt>
  41874. <dd><p>Specify whether to extract the top (if the value is <code class="code">0</code> or
  41875. <code class="code">top</code>) or the bottom field (if the value is <code class="code">1</code> or
  41876. <code class="code">bottom</code>).
  41877. </p></dd>
  41878. </dl>
  41879. <a name="fieldhint"></a>
  41880. <h3 class="section">39.91 fieldhint<span class="pull-right"><a class="anchor hidden-xs" href="#fieldhint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldhint" aria-hidden="true">TOC</a></span></h3>
  41881. <p>Create new frames by copying the top and bottom fields from surrounding frames
  41882. supplied as numbers by the hint file.
  41883. </p>
  41884. <dl class="table">
  41885. <dt><samp class="option">hint</samp></dt>
  41886. <dd><p>Set file containing hints: absolute/relative frame numbers.
  41887. </p>
  41888. <p>There must be one line for each frame in a clip. Each line must contain two
  41889. numbers separated by the comma, optionally followed by <code class="code">-</code> or <code class="code">+</code>.
  41890. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  41891. is current frame number for <code class="code">absolute</code> mode or out of [-1, 1] range
  41892. for <code class="code">relative</code> mode. First number tells from which frame to pick up top
  41893. field and second number tells from which frame to pick up bottom field.
  41894. </p>
  41895. <p>If optionally followed by <code class="code">+</code> output frame will be marked as interlaced,
  41896. else if followed by <code class="code">-</code> output frame will be marked as progressive, else
  41897. it will be marked same as input frame.
  41898. If optionally followed by <code class="code">t</code> output frame will use only top field, or in
  41899. case of <code class="code">b</code> it will use only bottom field.
  41900. If line starts with <code class="code">#</code> or <code class="code">;</code> that line is skipped.
  41901. </p>
  41902. </dd>
  41903. <dt><samp class="option">mode</samp></dt>
  41904. <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>.
  41905. The <code class="code">pattern</code> mode is same as <code class="code">relative</code> mode, except at last entry of file if there
  41906. are more frames to process than <code class="code">hint</code> file is seek back to start.
  41907. </p></dd>
  41908. </dl>
  41909. <p>Example of first several lines of <code class="code">hint</code> file for <code class="code">relative</code> mode:
  41910. </p><div class="example">
  41911. <pre class="example-preformatted">0,0 - # first frame
  41912. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  41913. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  41914. 1,0 -
  41915. 0,0 -
  41916. 0,0 -
  41917. 1,0 -
  41918. 1,0 -
  41919. 1,0 -
  41920. 0,0 -
  41921. 0,0 -
  41922. 1,0 -
  41923. 1,0 -
  41924. 1,0 -
  41925. 0,0 -
  41926. </pre></div>
  41927. <a name="fieldmatch"></a>
  41928. <h3 class="section">39.92 fieldmatch<span class="pull-right"><a class="anchor hidden-xs" href="#fieldmatch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldmatch" aria-hidden="true">TOC</a></span></h3>
  41929. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  41930. progressive frames from a telecined stream. The filter does not drop duplicated
  41931. frames, so to achieve a complete inverse telecine <code class="code">fieldmatch</code> needs to be
  41932. followed by a decimation filter such as <a class="ref" href="#decimate">decimate</a> in the filtergraph.
  41933. </p>
  41934. <p>The separation of the field matching and the decimation is notably motivated by
  41935. the possibility of inserting a de-interlacing filter fallback between the two.
  41936. If the source has mixed telecined and real interlaced content,
  41937. <code class="code">fieldmatch</code> will not be able to match fields for the interlaced parts.
  41938. But these remaining combed frames will be marked as interlaced, and thus can be
  41939. de-interlaced by a later filter such as <a class="ref" href="#yadif">yadif</a> before decimation.
  41940. </p>
  41941. <p>In addition to the various configuration options, <code class="code">fieldmatch</code> can take an
  41942. optional second stream, activated through the <samp class="option">ppsrc</samp> option. If
  41943. enabled, the frames reconstruction will be based on the fields and frames from
  41944. this second stream. This allows the first input to be pre-processed in order to
  41945. help the various algorithms of the filter, while keeping the output lossless
  41946. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  41947. or brightness/contrast adjustments can help.
  41948. </p>
  41949. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  41950. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  41951. which <code class="code">fieldmatch</code> is based on. While the semantic and usage are very
  41952. close, some behaviour and options names can differ.
  41953. </p>
  41954. <p>The <a class="ref" href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  41955. If your input has mixed telecined (30fps) and progressive content with a lower
  41956. framerate like 24fps use the following filterchain to produce the necessary cfr
  41957. stream: <code class="code">dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  41958. </p>
  41959. <p>The filter accepts the following options:
  41960. </p>
  41961. <dl class="table">
  41962. <dt><samp class="option">order</samp></dt>
  41963. <dd><p>Specify the assumed field order of the input stream. Available values are:
  41964. </p>
  41965. <dl class="table">
  41966. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  41967. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  41968. </p></dd>
  41969. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  41970. <dd><p>Assume bottom field first.
  41971. </p></dd>
  41972. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  41973. <dd><p>Assume top field first.
  41974. </p></dd>
  41975. </dl>
  41976. <p>Note that it is sometimes recommended not to trust the parity announced by the
  41977. stream.
  41978. </p>
  41979. <p>Default value is <var class="var">auto</var>.
  41980. </p>
  41981. </dd>
  41982. <dt><samp class="option">mode</samp></dt>
  41983. <dd><p>Set the matching mode or strategy to use. <samp class="option">pc</samp> mode is the safest in the
  41984. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  41985. possible, but if there are bad edits or blended fields it will end up
  41986. outputting combed frames when a good match might actually exist. On the other
  41987. hand, <samp class="option">pcn_ub</samp> mode is the most risky in terms of creating jerkiness,
  41988. but will almost always find a good frame if there is one. The other values are
  41989. all somewhere in between <samp class="option">pc</samp> and <samp class="option">pcn_ub</samp> in terms of risking
  41990. jerkiness and creating duplicate frames versus finding good matches in sections
  41991. with bad edits, orphaned fields, blended fields, etc.
  41992. </p>
  41993. <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.
  41994. </p>
  41995. <p>Available values are:
  41996. </p>
  41997. <dl class="table">
  41998. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  41999. <dd><p>2-way matching (p/c)
  42000. </p></dd>
  42001. <dt>&lsquo;<samp class="samp">pc_n</samp>&rsquo;</dt>
  42002. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  42003. </p></dd>
  42004. <dt>&lsquo;<samp class="samp">pc_u</samp>&rsquo;</dt>
  42005. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  42006. </p></dd>
  42007. <dt>&lsquo;<samp class="samp">pc_n_ub</samp>&rsquo;</dt>
  42008. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  42009. still combed (p/c + n + u/b)
  42010. </p></dd>
  42011. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  42012. <dd><p>3-way matching (p/c/n)
  42013. </p></dd>
  42014. <dt>&lsquo;<samp class="samp">pcn_ub</samp>&rsquo;</dt>
  42015. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  42016. detected as combed (p/c/n + u/b)
  42017. </p></dd>
  42018. </dl>
  42019. <p>The parenthesis at the end indicate the matches that would be used for that
  42020. 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
  42021. <var class="var">top</var>).
  42022. </p>
  42023. <p>In terms of speed <samp class="option">pc</samp> mode is by far the fastest and <samp class="option">pcn_ub</samp> is
  42024. the slowest.
  42025. </p>
  42026. <p>Default value is <var class="var">pc_n</var>.
  42027. </p>
  42028. </dd>
  42029. <dt><samp class="option">ppsrc</samp></dt>
  42030. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  42031. input stream as the clean source to pick the fields from. See the filter
  42032. introduction for more details. It is similar to the <samp class="option">clip2</samp> feature from
  42033. VFM/TFM.
  42034. </p>
  42035. <p>Default value is <code class="code">0</code> (disabled).
  42036. </p>
  42037. </dd>
  42038. <dt><samp class="option">field</samp></dt>
  42039. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  42040. <samp class="option">order</samp> unless you experience matching failures with that setting. In
  42041. certain circumstances changing the field that is used to match from can have a
  42042. large impact on matching performance. Available values are:
  42043. </p>
  42044. <dl class="table">
  42045. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  42046. <dd><p>Automatic (same value as <samp class="option">order</samp>).
  42047. </p></dd>
  42048. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  42049. <dd><p>Match from the bottom field.
  42050. </p></dd>
  42051. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  42052. <dd><p>Match from the top field.
  42053. </p></dd>
  42054. </dl>
  42055. <p>Default value is <var class="var">auto</var>.
  42056. </p>
  42057. </dd>
  42058. <dt><samp class="option">mchroma</samp></dt>
  42059. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  42060. cases it is recommended to leave this enabled. You should set this to <code class="code">0</code>
  42061. only if your clip has bad chroma problems such as heavy rainbowing or other
  42062. artifacts. Setting this to <code class="code">0</code> could also be used to speed things up at
  42063. the cost of some accuracy.
  42064. </p>
  42065. <p>Default value is <code class="code">1</code>.
  42066. </p>
  42067. </dd>
  42068. <dt><samp class="option">y0</samp></dt>
  42069. <dt><samp class="option">y1</samp></dt>
  42070. <dd><p>These define an exclusion band which excludes the lines between <samp class="option">y0</samp> and
  42071. <samp class="option">y1</samp> from being included in the field matching decision. An exclusion
  42072. band can be used to ignore subtitles, a logo, or other things that may
  42073. interfere with the matching. <samp class="option">y0</samp> sets the starting scan line and
  42074. <samp class="option">y1</samp> sets the ending line; all lines in between <samp class="option">y0</samp> and
  42075. <samp class="option">y1</samp> (including <samp class="option">y0</samp> and <samp class="option">y1</samp>) will be ignored. Setting
  42076. <samp class="option">y0</samp> and <samp class="option">y1</samp> to the same value will disable the feature.
  42077. <samp class="option">y0</samp> and <samp class="option">y1</samp> defaults to <code class="code">0</code>.
  42078. </p>
  42079. </dd>
  42080. <dt><samp class="option">scthresh</samp></dt>
  42081. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  42082. the luma plane. Good values are in the <code class="code">[8.0, 14.0]</code> range. Scene change
  42083. detection is only relevant in case <samp class="option">combmatch</samp>=<var class="var">sc</var>. The range for
  42084. <samp class="option">scthresh</samp> is <code class="code">[0.0, 100.0]</code>.
  42085. </p>
  42086. <p>Default value is <code class="code">12.0</code>.
  42087. </p>
  42088. </dd>
  42089. <dt><samp class="option">combmatch</samp></dt>
  42090. <dd><p>When <samp class="option">combatch</samp> is not <var class="var">none</var>, <code class="code">fieldmatch</code> will take into
  42091. account the combed scores of matches when deciding what match to use as the
  42092. final match. Available values are:
  42093. </p>
  42094. <dl class="table">
  42095. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  42096. <dd><p>No final matching based on combed scores.
  42097. </p></dd>
  42098. <dt>&lsquo;<samp class="samp">sc</samp>&rsquo;</dt>
  42099. <dd><p>Combed scores are only used when a scene change is detected.
  42100. </p></dd>
  42101. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  42102. <dd><p>Use combed scores all the time.
  42103. </p></dd>
  42104. </dl>
  42105. <p>Default is <var class="var">sc</var>.
  42106. </p>
  42107. </dd>
  42108. <dt><samp class="option">combdbg</samp></dt>
  42109. <dd><p>Force <code class="code">fieldmatch</code> to calculate the combed metrics for certain matches and
  42110. print them. This setting is known as <samp class="option">micout</samp> in TFM/VFM vocabulary.
  42111. Available values are:
  42112. </p>
  42113. <dl class="table">
  42114. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  42115. <dd><p>No forced calculation.
  42116. </p></dd>
  42117. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  42118. <dd><p>Force p/c/n calculations.
  42119. </p></dd>
  42120. <dt>&lsquo;<samp class="samp">pcnub</samp>&rsquo;</dt>
  42121. <dd><p>Force p/c/n/u/b calculations.
  42122. </p></dd>
  42123. </dl>
  42124. <p>Default value is <var class="var">none</var>.
  42125. </p>
  42126. </dd>
  42127. <dt><samp class="option">cthresh</samp></dt>
  42128. <dd><p>This is the area combing threshold used for combed frame detection. This
  42129. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  42130. Larger values mean combing must be more visible and smaller values mean combing
  42131. can be less visible or strong and still be detected. Valid settings are from
  42132. <code class="code">-1</code> (every pixel will be detected as combed) to <code class="code">255</code> (no pixel will
  42133. be detected as combed). This is basically a pixel difference value. A good
  42134. range is <code class="code">[8, 12]</code>.
  42135. </p>
  42136. <p>Default value is <code class="code">9</code>.
  42137. </p>
  42138. </dd>
  42139. <dt><samp class="option">chroma</samp></dt>
  42140. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  42141. disable this if your source has chroma problems (rainbowing, etc.) that are
  42142. causing problems for the combed frame detection with chroma enabled. Actually,
  42143. using <samp class="option">chroma</samp>=<var class="var">0</var> is usually more reliable, except for the case
  42144. where there is chroma only combing in the source.
  42145. </p>
  42146. <p>Default value is <code class="code">0</code>.
  42147. </p>
  42148. </dd>
  42149. <dt><samp class="option">blockx</samp></dt>
  42150. <dt><samp class="option">blocky</samp></dt>
  42151. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  42152. frame detection. This has to do with the size of the area in which
  42153. <samp class="option">combpel</samp> pixels are required to be detected as combed for a frame to be
  42154. declared combed. See the <samp class="option">combpel</samp> parameter description for more info.
  42155. Possible values are any number that is a power of 2 starting at 4 and going up
  42156. to 512.
  42157. </p>
  42158. <p>Default value is <code class="code">16</code>.
  42159. </p>
  42160. </dd>
  42161. <dt><samp class="option">combpel</samp></dt>
  42162. <dd><p>The number of combed pixels inside any of the <samp class="option">blocky</samp> by
  42163. <samp class="option">blockx</samp> size blocks on the frame for the frame to be detected as
  42164. combed. While <samp class="option">cthresh</samp> controls how &quot;visible&quot; the combing must be, this
  42165. setting controls &quot;how much&quot; combing there must be in any localized area (a
  42166. window defined by the <samp class="option">blockx</samp> and <samp class="option">blocky</samp> settings) on the
  42167. frame. Minimum value is <code class="code">0</code> and maximum is <code class="code">blocky x blockx</code> (at
  42168. which point no frames will ever be detected as combed). This setting is known
  42169. as <samp class="option">MI</samp> in TFM/VFM vocabulary.
  42170. </p>
  42171. <p>Default value is <code class="code">80</code>.
  42172. </p></dd>
  42173. </dl>
  42174. <a class="anchor" id="p_002fc_002fn_002fu_002fb-meaning"></a><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
  42175. <h4 class="subsection">39.92.1 p/c/n/u/b meaning<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">TOC</a></span></h4>
  42176. <a name="p_002fc_002fn"></a>
  42177. <h4 class="subsubsection">39.92.1.1 p/c/n<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn" aria-hidden="true">TOC</a></span></h4>
  42178. <p>We assume the following telecined stream:
  42179. </p>
  42180. <div class="example">
  42181. <pre class="example-preformatted">Top fields: 1 2 2 3 4
  42182. Bottom fields: 1 2 3 4 4
  42183. </pre></div>
  42184. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  42185. first two frames are progressive, the 3rd and 4th are combed, and so on.
  42186. </p>
  42187. <p>When <code class="code">fieldmatch</code> is configured to run a matching from bottom
  42188. (<samp class="option">field</samp>=<var class="var">bottom</var>) this is how this input stream get transformed:
  42189. </p>
  42190. <div class="example">
  42191. <pre class="example-preformatted">Input stream:
  42192. T 1 2 2 3 4
  42193. B 1 2 3 4 4 &lt;-- matching reference
  42194. Matches: c c n n c
  42195. Output stream:
  42196. T 1 2 3 4 4
  42197. B 1 2 3 4 4
  42198. </pre></div>
  42199. <p>As a result of the field matching, we can see that some frames get duplicated.
  42200. To perform a complete inverse telecine, you need to rely on a decimation filter
  42201. after this operation. See for instance the <a class="ref" href="#decimate">decimate</a> filter.
  42202. </p>
  42203. <p>The same operation now matching from top fields (<samp class="option">field</samp>=<var class="var">top</var>)
  42204. looks like this:
  42205. </p>
  42206. <div class="example">
  42207. <pre class="example-preformatted">Input stream:
  42208. T 1 2 2 3 4 &lt;-- matching reference
  42209. B 1 2 3 4 4
  42210. Matches: c c p p c
  42211. Output stream:
  42212. T 1 2 2 3 4
  42213. B 1 2 2 3 4
  42214. </pre></div>
  42215. <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;
  42216. basically, they refer to the frame and field of the opposite parity:
  42217. </p>
  42218. <ul class="itemize mark-bullet">
  42219. <li><var class="var">p</var> matches the field of the opposite parity in the previous frame
  42220. </li><li><var class="var">c</var> matches the field of the opposite parity in the current frame
  42221. </li><li><var class="var">n</var> matches the field of the opposite parity in the next frame
  42222. </li></ul>
  42223. <a name="u_002fb"></a>
  42224. <h4 class="subsubsection">39.92.1.2 u/b<span class="pull-right"><a class="anchor hidden-xs" href="#u_002fb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-u_002fb" aria-hidden="true">TOC</a></span></h4>
  42225. <p>The <var class="var">u</var> and <var class="var">b</var> matching are a bit special in the sense that they match
  42226. from the opposite parity flag. In the following examples, we assume that we are
  42227. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  42228. &rsquo;x&rsquo; is placed above and below each matched fields.
  42229. </p>
  42230. <p>With bottom matching (<samp class="option">field</samp>=<var class="var">bottom</var>):
  42231. </p><div class="example">
  42232. <pre class="example-preformatted">Match: c p n b u
  42233. x x x x x
  42234. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  42235. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  42236. x x x x x
  42237. Output frames:
  42238. 2 1 2 2 2
  42239. 2 2 2 1 3
  42240. </pre></div>
  42241. <p>With top matching (<samp class="option">field</samp>=<var class="var">top</var>):
  42242. </p><div class="example">
  42243. <pre class="example-preformatted">Match: c p n b u
  42244. x x x x x
  42245. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  42246. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  42247. x x x x x
  42248. Output frames:
  42249. 2 2 2 1 2
  42250. 2 1 3 2 2
  42251. </pre></div>
  42252. <a name="Examples-122"></a>
  42253. <h4 class="subsection">39.92.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-122" aria-hidden="true">TOC</a></span></h4>
  42254. <p>Simple IVTC of a top field first telecined stream:
  42255. </p><div class="example">
  42256. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=none, decimate
  42257. </pre></div>
  42258. <p>Advanced IVTC, with fallback on <a class="ref" href="#yadif">yadif</a> for still combed frames:
  42259. </p><div class="example">
  42260. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  42261. </pre></div>
  42262. <a name="fieldorder"></a>
  42263. <h3 class="section">39.93 fieldorder<span class="pull-right"><a class="anchor hidden-xs" href="#fieldorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldorder" aria-hidden="true">TOC</a></span></h3>
  42264. <p>Transform the field order of the input video.
  42265. </p>
  42266. <p>It accepts the following parameters:
  42267. </p>
  42268. <dl class="table">
  42269. <dt><samp class="option">order</samp></dt>
  42270. <dd><p>The output field order. Valid values are <var class="var">tff</var> for top field first or <var class="var">bff</var>
  42271. for bottom field first.
  42272. </p></dd>
  42273. </dl>
  42274. <p>The default value is &lsquo;<samp class="samp">tff</samp>&rsquo;.
  42275. </p>
  42276. <p>The transformation is done by shifting the picture content up or down
  42277. by one line, and filling the remaining line with appropriate picture content.
  42278. This method is consistent with most broadcast field order converters.
  42279. </p>
  42280. <p>If the input video is not flagged as being interlaced, or it is already
  42281. flagged as being of the required output field order, then this filter does
  42282. not alter the incoming video.
  42283. </p>
  42284. <p>It is very useful when converting to or from PAL DV material,
  42285. which is bottom field first.
  42286. </p>
  42287. <p>For example:
  42288. </p><div class="example">
  42289. <pre class="example-preformatted">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  42290. </pre></div>
  42291. <a name="fillborders"></a>
  42292. <h3 class="section">39.94 fillborders<span class="pull-right"><a class="anchor hidden-xs" href="#fillborders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fillborders" aria-hidden="true">TOC</a></span></h3>
  42293. <p>Fill borders of the input video, without changing video stream dimensions.
  42294. Sometimes video can have garbage at the four edges and you may not want to
  42295. crop video input to keep size multiple of some number.
  42296. </p>
  42297. <p>This filter accepts the following options:
  42298. </p>
  42299. <dl class="table">
  42300. <dt><samp class="option">left</samp></dt>
  42301. <dd><p>Number of pixels to fill from left border.
  42302. </p>
  42303. </dd>
  42304. <dt><samp class="option">right</samp></dt>
  42305. <dd><p>Number of pixels to fill from right border.
  42306. </p>
  42307. </dd>
  42308. <dt><samp class="option">top</samp></dt>
  42309. <dd><p>Number of pixels to fill from top border.
  42310. </p>
  42311. </dd>
  42312. <dt><samp class="option">bottom</samp></dt>
  42313. <dd><p>Number of pixels to fill from bottom border.
  42314. </p>
  42315. </dd>
  42316. <dt><samp class="option">mode</samp></dt>
  42317. <dd><p>Set fill mode.
  42318. </p>
  42319. <p>It accepts the following values:
  42320. </p><dl class="table">
  42321. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  42322. <dd><p>fill pixels using outermost pixels
  42323. </p>
  42324. </dd>
  42325. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  42326. <dd><p>fill pixels using mirroring (half sample symmetric)
  42327. </p>
  42328. </dd>
  42329. <dt>&lsquo;<samp class="samp">fixed</samp>&rsquo;</dt>
  42330. <dd><p>fill pixels with constant value
  42331. </p>
  42332. </dd>
  42333. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  42334. <dd><p>fill pixels using reflecting (whole sample symmetric)
  42335. </p>
  42336. </dd>
  42337. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  42338. <dd><p>fill pixels using wrapping
  42339. </p>
  42340. </dd>
  42341. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  42342. <dd><p>fade pixels to constant value
  42343. </p>
  42344. </dd>
  42345. <dt>&lsquo;<samp class="samp">margins</samp>&rsquo;</dt>
  42346. <dd><p>fill pixels at top and bottom with weighted averages pixels near borders
  42347. </p></dd>
  42348. </dl>
  42349. <p>Default is <var class="var">smear</var>.
  42350. </p>
  42351. </dd>
  42352. <dt><samp class="option">color</samp></dt>
  42353. <dd><p>Set color for pixels in fixed or fade mode. Default is <var class="var">black</var>.
  42354. </p></dd>
  42355. </dl>
  42356. <a name="Commands-93"></a>
  42357. <h4 class="subsection">39.94.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-93" aria-hidden="true">TOC</a></span></h4>
  42358. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  42359. The command accepts the same syntax of the corresponding option.
  42360. </p>
  42361. <p>If the specified expression is not valid, it is kept at its current
  42362. value.
  42363. </p>
  42364. <a name="find_005frect"></a>
  42365. <h3 class="section">39.95 find_rect<span class="pull-right"><a class="anchor hidden-xs" href="#find_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-find_005frect" aria-hidden="true">TOC</a></span></h3>
  42366. <p>Find a rectangular object in the input video.
  42367. </p>
  42368. <p>The object to search for must be specified as a gray8 image specified with the
  42369. <samp class="option">object</samp> option.
  42370. </p>
  42371. <p>For each possible match, a score is computed. If the score reaches the specified
  42372. threshold, the object is considered found.
  42373. </p>
  42374. <p>If the input video contains multiple instances of the object, the filter will
  42375. find only one of them.
  42376. </p>
  42377. <p>When an object is found, the following metadata entries are set in the matching
  42378. frame:
  42379. </p><dl class="table">
  42380. <dt><samp class="option">lavfi.rect.w</samp></dt>
  42381. <dd><p>width of object
  42382. </p>
  42383. </dd>
  42384. <dt><samp class="option">lavfi.rect.h</samp></dt>
  42385. <dd><p>height of object
  42386. </p>
  42387. </dd>
  42388. <dt><samp class="option">lavfi.rect.x</samp></dt>
  42389. <dd><p>x position of object
  42390. </p>
  42391. </dd>
  42392. <dt><samp class="option">lavfi.rect.y</samp></dt>
  42393. <dd><p>y position of object
  42394. </p>
  42395. </dd>
  42396. <dt><samp class="option">lavfi.rect.score</samp></dt>
  42397. <dd><p>match score of the found object
  42398. </p></dd>
  42399. </dl>
  42400. <p>It accepts the following options:
  42401. </p>
  42402. <dl class="table">
  42403. <dt><samp class="option">object</samp></dt>
  42404. <dd><p>Filepath of the object image, needs to be in gray8.
  42405. </p>
  42406. </dd>
  42407. <dt><samp class="option">threshold</samp></dt>
  42408. <dd><p>Detection threshold, expressed as a decimal number in the range 0-1.
  42409. </p>
  42410. <p>A threshold value of 0.01 means only exact matches, a threshold of 0.99 means
  42411. almost everything matches.
  42412. </p>
  42413. <p>Default value is 0.5.
  42414. </p>
  42415. </dd>
  42416. <dt><samp class="option">mipmaps</samp></dt>
  42417. <dd><p>Number of mipmaps, default is 3.
  42418. </p>
  42419. </dd>
  42420. <dt><samp class="option">xmin, ymin, xmax, ymax</samp></dt>
  42421. <dd><p>Specifies the rectangle in which to search.
  42422. </p>
  42423. </dd>
  42424. <dt><samp class="option">discard</samp></dt>
  42425. <dd><p>Discard frames where object is not detected. Default is disabled.
  42426. </p></dd>
  42427. </dl>
  42428. <a name="Examples-123"></a>
  42429. <h4 class="subsection">39.95.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-123" aria-hidden="true">TOC</a></span></h4>
  42430. <ul class="itemize mark-bullet">
  42431. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  42432. <div class="example">
  42433. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  42434. </pre></div>
  42435. </li><li>Find the position of an object in each frame using <code class="command">ffprobe</code> and write
  42436. it to a log file:
  42437. <div class="example">
  42438. <pre class="example-preformatted">ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
  42439. -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
  42440. -of csv -o find_rect.csv
  42441. </pre></div>
  42442. </li></ul>
  42443. <a name="floodfill"></a>
  42444. <h3 class="section">39.96 floodfill<span class="pull-right"><a class="anchor hidden-xs" href="#floodfill" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-floodfill" aria-hidden="true">TOC</a></span></h3>
  42445. <p>Flood area with values of same pixel components with another values.
  42446. </p>
  42447. <p>It accepts the following options:
  42448. </p><dl class="table">
  42449. <dt><samp class="option">x</samp></dt>
  42450. <dd><p>Set pixel x coordinate.
  42451. </p>
  42452. </dd>
  42453. <dt><samp class="option">y</samp></dt>
  42454. <dd><p>Set pixel y coordinate.
  42455. </p>
  42456. </dd>
  42457. <dt><samp class="option">s0</samp></dt>
  42458. <dd><p>Set source #0 component value.
  42459. </p>
  42460. </dd>
  42461. <dt><samp class="option">s1</samp></dt>
  42462. <dd><p>Set source #1 component value.
  42463. </p>
  42464. </dd>
  42465. <dt><samp class="option">s2</samp></dt>
  42466. <dd><p>Set source #2 component value.
  42467. </p>
  42468. </dd>
  42469. <dt><samp class="option">s3</samp></dt>
  42470. <dd><p>Set source #3 component value.
  42471. </p>
  42472. </dd>
  42473. <dt><samp class="option">d0</samp></dt>
  42474. <dd><p>Set destination #0 component value.
  42475. </p>
  42476. </dd>
  42477. <dt><samp class="option">d1</samp></dt>
  42478. <dd><p>Set destination #1 component value.
  42479. </p>
  42480. </dd>
  42481. <dt><samp class="option">d2</samp></dt>
  42482. <dd><p>Set destination #2 component value.
  42483. </p>
  42484. </dd>
  42485. <dt><samp class="option">d3</samp></dt>
  42486. <dd><p>Set destination #3 component value.
  42487. </p></dd>
  42488. </dl>
  42489. <a class="anchor" id="format"></a><a name="format-1"></a>
  42490. <h3 class="section">39.97 format<span class="pull-right"><a class="anchor hidden-xs" href="#format-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-format-1" aria-hidden="true">TOC</a></span></h3>
  42491. <p>Convert the input video to one of the specified pixel formats.
  42492. Libavfilter will try to pick one that is suitable as input to
  42493. the next filter.
  42494. </p>
  42495. <p>It accepts the following parameters:
  42496. </p><dl class="table">
  42497. <dt><samp class="option">pix_fmts</samp></dt>
  42498. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  42499. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  42500. </p>
  42501. </dd>
  42502. <dt><samp class="option">color_spaces</samp></dt>
  42503. <dd><p>A &rsquo;|&rsquo;-separated list of color space names, such as
  42504. &quot;color_spaces=bt709|bt470bg|bt2020nc&quot;.
  42505. </p>
  42506. </dd>
  42507. <dt><samp class="option">color_ranges</samp></dt>
  42508. <dd><p>A &rsquo;|&rsquo;-separated list of color range names, such as
  42509. &quot;color_ranges=tv|pc&quot;.
  42510. </p>
  42511. </dd>
  42512. <dt><samp class="option">alpha_modes</samp></dt>
  42513. <dd><p>A &rsquo;|&rsquo;-separated list of color range names, such as
  42514. &quot;alpha_modes=straight|premultiplied&quot;.
  42515. </p>
  42516. </dd>
  42517. </dl>
  42518. <a name="Examples-124"></a>
  42519. <h4 class="subsection">39.97.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-124" aria-hidden="true">TOC</a></span></h4>
  42520. <ul class="itemize mark-bullet">
  42521. <li>Convert the input video to the <var class="var">yuv420p</var> format
  42522. <div class="example">
  42523. <pre class="example-preformatted">format=pix_fmts=yuv420p
  42524. </pre></div>
  42525. <p>Convert the input video to any of the formats in the list
  42526. </p><div class="example">
  42527. <pre class="example-preformatted">format=pix_fmts=yuv420p|yuv444p|yuv410p
  42528. </pre></div>
  42529. </li></ul>
  42530. <a class="anchor" id="fps"></a><a name="fps-1"></a>
  42531. <h3 class="section">39.98 fps<span class="pull-right"><a class="anchor hidden-xs" href="#fps-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fps-1" aria-hidden="true">TOC</a></span></h3>
  42532. <p>Convert the video to specified constant frame rate by duplicating or dropping
  42533. frames as necessary.
  42534. </p>
  42535. <p>It accepts the following parameters:
  42536. </p><dl class="table">
  42537. <dt><samp class="option">fps</samp></dt>
  42538. <dd><p>The desired output frame rate. It accepts expressions containing the following
  42539. constants:
  42540. </p>
  42541. <dl class="table">
  42542. <dt>&lsquo;<samp class="samp">source_fps</samp>&rsquo;</dt>
  42543. <dd><p>The input&rsquo;s frame rate
  42544. </p>
  42545. </dd>
  42546. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  42547. <dd><p>NTSC frame rate of <code class="code">30000/1001</code>
  42548. </p>
  42549. </dd>
  42550. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  42551. <dd><p>PAL frame rate of <code class="code">25.0</code>
  42552. </p>
  42553. </dd>
  42554. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  42555. <dd><p>Film frame rate of <code class="code">24.0</code>
  42556. </p>
  42557. </dd>
  42558. <dt>&lsquo;<samp class="samp">ntsc_film</samp>&rsquo;</dt>
  42559. <dd><p>NTSC-film frame rate of <code class="code">24000/1001</code>
  42560. </p></dd>
  42561. </dl>
  42562. <p>The default is <code class="code">25</code>.
  42563. </p>
  42564. </dd>
  42565. <dt><samp class="option">start_time</samp></dt>
  42566. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  42567. padding/trimming at the start of stream. By default, no assumption is made
  42568. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  42569. For example, this could be set to 0 to pad the beginning with duplicates of
  42570. the first frame if a video stream starts after the audio stream or to trim any
  42571. frames with a negative PTS.
  42572. </p>
  42573. </dd>
  42574. <dt><samp class="option">round</samp></dt>
  42575. <dd><p>Timestamp (PTS) rounding method.
  42576. </p>
  42577. <p>Possible values are:
  42578. </p><dl class="table">
  42579. <dt><samp class="option">zero</samp></dt>
  42580. <dd><p>round towards 0
  42581. </p></dd>
  42582. <dt><samp class="option">inf</samp></dt>
  42583. <dd><p>round away from 0
  42584. </p></dd>
  42585. <dt><samp class="option">down</samp></dt>
  42586. <dd><p>round towards -infinity
  42587. </p></dd>
  42588. <dt><samp class="option">up</samp></dt>
  42589. <dd><p>round towards +infinity
  42590. </p></dd>
  42591. <dt><samp class="option">near</samp></dt>
  42592. <dd><p>round to nearest
  42593. </p></dd>
  42594. </dl>
  42595. <p>The default is <code class="code">near</code>.
  42596. </p>
  42597. </dd>
  42598. <dt><samp class="option">eof_action</samp></dt>
  42599. <dd><p>Action performed when reading the last frame.
  42600. </p>
  42601. <p>Possible values are:
  42602. </p><dl class="table">
  42603. <dt><samp class="option">round</samp></dt>
  42604. <dd><p>Use same timestamp rounding method as used for other frames.
  42605. </p></dd>
  42606. <dt><samp class="option">pass</samp></dt>
  42607. <dd><p>Pass through last frame if input duration has not been reached yet.
  42608. </p></dd>
  42609. </dl>
  42610. <p>The default is <code class="code">round</code>.
  42611. </p>
  42612. </dd>
  42613. </dl>
  42614. <p>Alternatively, the options can be specified as a flat string:
  42615. <var class="var">fps</var>[:<var class="var">start_time</var>[:<var class="var">round</var>]].
  42616. </p>
  42617. <p>See also the <a class="ref" href="#setpts">setpts</a> filter.
  42618. </p>
  42619. <a name="Examples-125"></a>
  42620. <h4 class="subsection">39.98.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-125" aria-hidden="true">TOC</a></span></h4>
  42621. <ul class="itemize mark-bullet">
  42622. <li>A typical usage in order to set the fps to 25:
  42623. <div class="example">
  42624. <pre class="example-preformatted">fps=fps=25
  42625. </pre></div>
  42626. </li><li>Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  42627. <div class="example">
  42628. <pre class="example-preformatted">fps=fps=film:round=near
  42629. </pre></div>
  42630. </li></ul>
  42631. <a name="framepack"></a>
  42632. <h3 class="section">39.99 framepack<span class="pull-right"><a class="anchor hidden-xs" href="#framepack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framepack" aria-hidden="true">TOC</a></span></h3>
  42633. <p>Pack two different video streams into a stereoscopic video, setting proper
  42634. metadata on supported codecs. The two views should have the same size and
  42635. framerate and processing will stop when the shorter video ends. Please note
  42636. that you may conveniently adjust view properties with the <a class="ref" href="#scale">scale</a> and
  42637. <a class="ref" href="#fps">fps</a> filters.
  42638. </p>
  42639. <p>It accepts the following parameters:
  42640. </p><dl class="table">
  42641. <dt><samp class="option">format</samp></dt>
  42642. <dd><p>The desired packing format. Supported values are:
  42643. </p>
  42644. <dl class="table">
  42645. <dt><samp class="option">sbs</samp></dt>
  42646. <dd><p>The views are next to each other (default).
  42647. </p>
  42648. </dd>
  42649. <dt><samp class="option">tab</samp></dt>
  42650. <dd><p>The views are on top of each other.
  42651. </p>
  42652. </dd>
  42653. <dt><samp class="option">lines</samp></dt>
  42654. <dd><p>The views are packed by line.
  42655. </p>
  42656. </dd>
  42657. <dt><samp class="option">columns</samp></dt>
  42658. <dd><p>The views are packed by column.
  42659. </p>
  42660. </dd>
  42661. <dt><samp class="option">frameseq</samp></dt>
  42662. <dd><p>The views are temporally interleaved.
  42663. </p>
  42664. </dd>
  42665. </dl>
  42666. </dd>
  42667. </dl>
  42668. <p>Some examples:
  42669. </p>
  42670. <div class="example">
  42671. <pre class="example-preformatted"># Convert left and right views into a frame-sequential video
  42672. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  42673. # Convert views into a side-by-side video with the same output resolution as the input
  42674. 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
  42675. </pre></div>
  42676. <a name="framerate"></a>
  42677. <h3 class="section">39.100 framerate<span class="pull-right"><a class="anchor hidden-xs" href="#framerate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framerate" aria-hidden="true">TOC</a></span></h3>
  42678. <p>Change the frame rate by interpolating new video output frames from the source
  42679. frames.
  42680. </p>
  42681. <p>This filter is not designed to function correctly with interlaced media. If
  42682. you wish to change the frame rate of interlaced media then you are required
  42683. to deinterlace before this filter and re-interlace after this filter.
  42684. </p>
  42685. <p>A description of the accepted options follows.
  42686. </p>
  42687. <dl class="table">
  42688. <dt><samp class="option">fps</samp></dt>
  42689. <dd><p>Specify the output frames per second. This option can also be specified
  42690. as a value alone. The default is <code class="code">50</code>.
  42691. </p>
  42692. </dd>
  42693. <dt><samp class="option">interp_start</samp></dt>
  42694. <dd><p>Specify the start of a range where the output frame will be created as a
  42695. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  42696. the default is <code class="code">15</code>.
  42697. </p>
  42698. </dd>
  42699. <dt><samp class="option">interp_end</samp></dt>
  42700. <dd><p>Specify the end of a range where the output frame will be created as a
  42701. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  42702. the default is <code class="code">240</code>.
  42703. </p>
  42704. </dd>
  42705. <dt><samp class="option">scene</samp></dt>
  42706. <dd><p>Specify the level at which a scene change is detected as a value between
  42707. 0 and 100 to indicate a new scene; a low value reflects a low
  42708. probability for the current frame to introduce a new scene, while a higher
  42709. value means the current frame is more likely to be one.
  42710. The default is <code class="code">8.2</code>.
  42711. </p>
  42712. </dd>
  42713. <dt><samp class="option">flags</samp></dt>
  42714. <dd><p>Specify flags influencing the filter process.
  42715. </p>
  42716. <p>Available value for <var class="var">flags</var> is:
  42717. </p>
  42718. <dl class="table">
  42719. <dt><samp class="option">scene_change_detect, scd</samp></dt>
  42720. <dd><p>Enable scene change detection using the value of the option <var class="var">scene</var>.
  42721. This flag is enabled by default.
  42722. </p></dd>
  42723. </dl>
  42724. </dd>
  42725. </dl>
  42726. <a name="framestep"></a>
  42727. <h3 class="section">39.101 framestep<span class="pull-right"><a class="anchor hidden-xs" href="#framestep" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framestep" aria-hidden="true">TOC</a></span></h3>
  42728. <p>Select one frame every N-th frame.
  42729. </p>
  42730. <p>This filter accepts the following option:
  42731. </p><dl class="table">
  42732. <dt><samp class="option">step</samp></dt>
  42733. <dd><p>Select frame after every <code class="code">step</code> frames.
  42734. Allowed values are positive integers higher than 0. Default value is <code class="code">1</code>.
  42735. </p></dd>
  42736. </dl>
  42737. <a name="freezedetect"></a>
  42738. <h3 class="section">39.102 freezedetect<span class="pull-right"><a class="anchor hidden-xs" href="#freezedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-freezedetect" aria-hidden="true">TOC</a></span></h3>
  42739. <p>Detect frozen video.
  42740. </p>
  42741. <p>This filter logs a message and sets frame metadata when it detects that the
  42742. input video has no significant change in content during a specified duration.
  42743. Video freeze detection calculates the mean average absolute difference of all
  42744. the components of video frames and compares it to a noise floor.
  42745. </p>
  42746. <p>The printed times and duration are expressed in seconds. The
  42747. <code class="code">lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  42748. whose timestamp equals or exceeds the detection duration and it contains the
  42749. timestamp of the first frame of the freeze. The
  42750. <code class="code">lavfi.freezedetect.freeze_duration</code> and
  42751. <code class="code">lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  42752. after the freeze.
  42753. </p>
  42754. <p>The filter accepts the following options:
  42755. </p>
  42756. <dl class="table">
  42757. <dt><samp class="option">noise, n</samp></dt>
  42758. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  42759. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  42760. 0.001.
  42761. </p>
  42762. </dd>
  42763. <dt><samp class="option">duration, d</samp></dt>
  42764. <dd><p>Set freeze duration until notification (default is 2 seconds).
  42765. </p></dd>
  42766. </dl>
  42767. <a name="freezeframes"></a>
  42768. <h3 class="section">39.103 freezeframes<span class="pull-right"><a class="anchor hidden-xs" href="#freezeframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-freezeframes" aria-hidden="true">TOC</a></span></h3>
  42769. <p>Freeze video frames.
  42770. </p>
  42771. <p>This filter freezes video frames using frame from 2nd input.
  42772. </p>
  42773. <p>The filter accepts the following options:
  42774. </p>
  42775. <dl class="table">
  42776. <dt><samp class="option">first</samp></dt>
  42777. <dd><p>Set number of first frame from which to start freeze.
  42778. </p>
  42779. </dd>
  42780. <dt><samp class="option">last</samp></dt>
  42781. <dd><p>Set number of last frame from which to end freeze.
  42782. </p>
  42783. </dd>
  42784. <dt><samp class="option">replace</samp></dt>
  42785. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  42786. </p></dd>
  42787. </dl>
  42788. <a class="anchor" id="frei0r"></a><a name="frei0r-1"></a>
  42789. <h3 class="section">39.104 frei0r<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r-1" aria-hidden="true">TOC</a></span></h3>
  42790. <p>Apply a frei0r effect to the input video.
  42791. </p>
  42792. <p>To enable the compilation of this filter, you need to install the frei0r
  42793. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  42794. </p>
  42795. <p>It accepts the following parameters:
  42796. </p>
  42797. <dl class="table">
  42798. <dt><samp class="option">filter_name</samp></dt>
  42799. <dd><p>The name of the frei0r effect to load. If the environment variable
  42800. <code class="env">FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  42801. directories specified by the colon-separated list in <code class="env">FREI0R_PATH</code>.
  42802. Otherwise, the standard frei0r paths are searched, in this order:
  42803. <samp class="file">HOME/.frei0r-1/lib/</samp>, <samp class="file">/usr/local/lib/frei0r-1/</samp>,
  42804. <samp class="file">/usr/lib/frei0r-1/</samp>.
  42805. </p>
  42806. </dd>
  42807. <dt><samp class="option">filter_params</samp></dt>
  42808. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  42809. </p>
  42810. </dd>
  42811. </dl>
  42812. <p>A frei0r effect parameter can be a boolean (its value is either
  42813. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  42814. <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
  42815. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  42816. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  42817. a position (specified as <var class="var">X</var>/<var class="var">Y</var>, where
  42818. <var class="var">X</var> and <var class="var">Y</var> are floating point numbers) and/or a string.
  42819. </p>
  42820. <p>The number and types of parameters depend on the loaded effect. If an
  42821. effect parameter is not specified, the default value is set.
  42822. </p>
  42823. <a name="Examples-126"></a>
  42824. <h4 class="subsection">39.104.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-126" aria-hidden="true">TOC</a></span></h4>
  42825. <ul class="itemize mark-bullet">
  42826. <li>Apply the distort0r effect, setting the first two double parameters:
  42827. <div class="example">
  42828. <pre class="example-preformatted">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  42829. </pre></div>
  42830. </li><li>Apply the colordistance effect, taking a color as the first parameter:
  42831. <div class="example">
  42832. <pre class="example-preformatted">frei0r=colordistance:0.2/0.3/0.4
  42833. frei0r=colordistance:violet
  42834. frei0r=colordistance:0x112233
  42835. </pre></div>
  42836. </li><li>Apply the perspective effect, specifying the top left and top right image
  42837. positions:
  42838. <div class="example">
  42839. <pre class="example-preformatted">frei0r=perspective:0.2/0.2|0.8/0.2
  42840. </pre></div>
  42841. </li></ul>
  42842. <p>For more information, see
  42843. <a class="url" href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  42844. </p>
  42845. <a name="Commands-94"></a>
  42846. <h4 class="subsection">39.104.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-94" aria-hidden="true">TOC</a></span></h4>
  42847. <p>This filter supports the <samp class="option">filter_params</samp> option as <a class="ref" href="#commands">commands</a>.
  42848. </p>
  42849. <a name="fspp"></a>
  42850. <h3 class="section">39.105 fspp<span class="pull-right"><a class="anchor hidden-xs" href="#fspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fspp" aria-hidden="true">TOC</a></span></h3>
  42851. <p>Apply fast and simple postprocessing. It is a faster version of <a class="ref" href="#spp">spp</a>.
  42852. </p>
  42853. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  42854. processing filter, one of them is performed once per block, not per pixel.
  42855. This allows for much higher speed.
  42856. </p>
  42857. <p>The filter accepts the following options:
  42858. </p>
  42859. <dl class="table">
  42860. <dt><samp class="option">quality</samp></dt>
  42861. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  42862. an integer in the range 4-5. Default value is <code class="code">4</code>.
  42863. </p>
  42864. </dd>
  42865. <dt><samp class="option">qp</samp></dt>
  42866. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  42867. If not set, the filter will use the QP from the video stream (if available).
  42868. </p>
  42869. </dd>
  42870. <dt><samp class="option">strength</samp></dt>
  42871. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  42872. more details but also more artifacts, while higher values make the image smoother
  42873. but also blurrier. Default value is <code class="code">0</code> − PSNR optimal.
  42874. </p>
  42875. </dd>
  42876. <dt><samp class="option">use_bframe_qp</samp></dt>
  42877. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  42878. option may cause flicker since the B-Frames have often larger QP. Default is
  42879. <code class="code">0</code> (not enabled).
  42880. </p>
  42881. </dd>
  42882. </dl>
  42883. <a class="anchor" id="fsync"></a><a name="fsync-1"></a>
  42884. <h3 class="section">39.106 fsync<span class="pull-right"><a class="anchor hidden-xs" href="#fsync-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fsync-1" aria-hidden="true">TOC</a></span></h3>
  42885. <p>Synchronize video frames with an external mapping from a file.
  42886. </p>
  42887. <p>For each input PTS given in the map file it either drops or creates as many
  42888. frames as necessary to recreate the sequence of output frames given in the
  42889. map file.
  42890. </p>
  42891. <p>This filter is useful to recreate the output frames of a framerate conversion
  42892. by the <a class="ref" href="#fps">fps</a> filter, recorded into a map file using the ffmpeg option
  42893. <code class="code">-stats_mux_pre</code>, and do further processing to the corresponding frames
  42894. e.g. quality comparison.
  42895. </p>
  42896. <p>Each line of the map file must contain three items per input frame, the input
  42897. PTS (decimal), the output PTS (decimal) and the
  42898. output TIMEBASE (decimal/decimal), separated by a space.
  42899. This file format corresponds to the output
  42900. of <code class="code">-stats_mux_pre_fmt=&quot;{ptsi} {pts} {tb}&quot;</code>.
  42901. </p>
  42902. <p>The filter assumes the map file is sorted by increasing input PTS.
  42903. </p>
  42904. <p>The filter accepts the following options:
  42905. </p><dl class="table">
  42906. <dt><samp class="option">file, f</samp></dt>
  42907. <dd><p>The filename of the map file to be used.
  42908. </p></dd>
  42909. </dl>
  42910. <p>Example:
  42911. </p><div class="example">
  42912. <pre class="example-preformatted"># Convert a video to 25 fps and record a MAP_FILE file with the default format of this filter
  42913. ffmpeg -i INPUT -vf fps=fps=25 -stats_mux_pre MAP_FILE -stats_mux_pre_fmt &quot;{ptsi} {pts} {tb}&quot; OUTPUT
  42914. # Sort MAP_FILE by increasing input PTS
  42915. sort -n MAP_FILE
  42916. # Use INPUT, OUTPUT and the MAP_FILE from above to compare the corresponding frames in INPUT and OUTPUT via SSIM
  42917. ffmpeg -i INPUT -i OUTPUT -filter_complex '[0:v]fsync=file=MAP_FILE[ref];[1:v][ref]ssim' -f null -
  42918. </pre></div>
  42919. <a name="gblur"></a>
  42920. <h3 class="section">39.107 gblur<span class="pull-right"><a class="anchor hidden-xs" href="#gblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gblur" aria-hidden="true">TOC</a></span></h3>
  42921. <p>Apply Gaussian blur filter.
  42922. </p>
  42923. <p>The filter accepts the following options:
  42924. </p>
  42925. <dl class="table">
  42926. <dt><samp class="option">sigma</samp></dt>
  42927. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  42928. </p>
  42929. </dd>
  42930. <dt><samp class="option">steps</samp></dt>
  42931. <dd><p>Set number of steps for Gaussian approximation. Default is <code class="code">1</code>.
  42932. </p>
  42933. </dd>
  42934. <dt><samp class="option">planes</samp></dt>
  42935. <dd><p>Set which planes to filter. By default all planes are filtered.
  42936. </p>
  42937. </dd>
  42938. <dt><samp class="option">sigmaV</samp></dt>
  42939. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  42940. Default is <code class="code">-1</code>.
  42941. </p></dd>
  42942. </dl>
  42943. <a name="Commands-95"></a>
  42944. <h4 class="subsection">39.107.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-95" aria-hidden="true">TOC</a></span></h4>
  42945. <p>This filter supports same commands as options.
  42946. The command accepts the same syntax of the corresponding option.
  42947. </p>
  42948. <p>If the specified expression is not valid, it is kept at its current
  42949. value.
  42950. </p>
  42951. <a name="geq"></a>
  42952. <h3 class="section">39.108 geq<span class="pull-right"><a class="anchor hidden-xs" href="#geq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-geq" aria-hidden="true">TOC</a></span></h3>
  42953. <p>Apply generic equation to each pixel.
  42954. </p>
  42955. <p>The filter accepts the following options:
  42956. </p>
  42957. <dl class="table">
  42958. <dt><samp class="option">lum_expr, lum</samp></dt>
  42959. <dd><p>Set the luma expression.
  42960. </p></dd>
  42961. <dt><samp class="option">cb_expr, cb</samp></dt>
  42962. <dd><p>Set the chrominance blue expression.
  42963. </p></dd>
  42964. <dt><samp class="option">cr_expr, cr</samp></dt>
  42965. <dd><p>Set the chrominance red expression.
  42966. </p></dd>
  42967. <dt><samp class="option">alpha_expr, a</samp></dt>
  42968. <dd><p>Set the alpha expression.
  42969. </p></dd>
  42970. <dt><samp class="option">red_expr, r</samp></dt>
  42971. <dd><p>Set the red expression.
  42972. </p></dd>
  42973. <dt><samp class="option">green_expr, g</samp></dt>
  42974. <dd><p>Set the green expression.
  42975. </p></dd>
  42976. <dt><samp class="option">blue_expr, b</samp></dt>
  42977. <dd><p>Set the blue expression.
  42978. </p></dd>
  42979. </dl>
  42980. <p>The colorspace is selected according to the specified options. If one
  42981. of the <samp class="option">lum_expr</samp>, <samp class="option">cb_expr</samp>, or <samp class="option">cr_expr</samp>
  42982. options is specified, the filter will automatically select a YCbCr
  42983. colorspace. If one of the <samp class="option">red_expr</samp>, <samp class="option">green_expr</samp>, or
  42984. <samp class="option">blue_expr</samp> options is specified, it will select an RGB
  42985. colorspace.
  42986. </p>
  42987. <p>If one of the chrominance expression is not defined, it falls back on the other
  42988. one. If no alpha expression is specified it will evaluate to opaque value.
  42989. If none of chrominance expressions are specified, they will evaluate
  42990. to the luma expression.
  42991. </p>
  42992. <p>The expressions can use the following variables and functions:
  42993. </p>
  42994. <dl class="table">
  42995. <dt><samp class="option">N</samp></dt>
  42996. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  42997. </p>
  42998. </dd>
  42999. <dt><samp class="option">X</samp></dt>
  43000. <dt><samp class="option">Y</samp></dt>
  43001. <dd><p>The coordinates of the current sample.
  43002. </p>
  43003. </dd>
  43004. <dt><samp class="option">W</samp></dt>
  43005. <dt><samp class="option">H</samp></dt>
  43006. <dd><p>The width and height of the image.
  43007. </p>
  43008. </dd>
  43009. <dt><samp class="option">SW</samp></dt>
  43010. <dt><samp class="option">SH</samp></dt>
  43011. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  43012. ratio between the corresponding luma plane number of pixels and the current
  43013. plane ones. E.g. for YUV4:2:0 the values are <code class="code">1,1</code> for the luma plane, and
  43014. <code class="code">0.5,0.5</code> for chroma planes.
  43015. </p>
  43016. </dd>
  43017. <dt><samp class="option">T</samp></dt>
  43018. <dd><p>Time of the current frame, expressed in seconds.
  43019. </p>
  43020. </dd>
  43021. <dt><samp class="option">p(x, y)</samp></dt>
  43022. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the current
  43023. plane.
  43024. </p>
  43025. </dd>
  43026. <dt><samp class="option">lum(x, y)</samp></dt>
  43027. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the luma
  43028. plane.
  43029. </p>
  43030. </dd>
  43031. <dt><samp class="option">cb(x, y)</samp></dt>
  43032. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  43033. blue-difference chroma plane. Return 0 if there is no such plane.
  43034. </p>
  43035. </dd>
  43036. <dt><samp class="option">cr(x, y)</samp></dt>
  43037. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  43038. red-difference chroma plane. Return 0 if there is no such plane.
  43039. </p>
  43040. </dd>
  43041. <dt><samp class="option">r(x, y)</samp></dt>
  43042. <dt><samp class="option">g(x, y)</samp></dt>
  43043. <dt><samp class="option">b(x, y)</samp></dt>
  43044. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  43045. red/green/blue component. Return 0 if there is no such component.
  43046. </p>
  43047. </dd>
  43048. <dt><samp class="option">alpha(x, y)</samp></dt>
  43049. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the alpha
  43050. plane. Return 0 if there is no such plane.
  43051. </p>
  43052. </dd>
  43053. <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>
  43054. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  43055. sums of samples within a rectangle. See the functions without the sum postfix.
  43056. </p>
  43057. </dd>
  43058. <dt><samp class="option">interpolation</samp></dt>
  43059. <dd><p>Set one of interpolation methods:
  43060. </p><dl class="table">
  43061. <dt><samp class="option">nearest, n</samp></dt>
  43062. <dt><samp class="option">bilinear, b</samp></dt>
  43063. </dl>
  43064. <p>Default is bilinear.
  43065. </p></dd>
  43066. </dl>
  43067. <p>For functions, if <var class="var">x</var> and <var class="var">y</var> are outside the area, the value will be
  43068. automatically clipped to the closer edge.
  43069. </p>
  43070. <p>Please note that this filter can use multiple threads in which case each slice
  43071. will have its own expression state. If you want to use only a single expression
  43072. state because your expressions depend on previous state then you should limit
  43073. the number of filter threads to 1.
  43074. </p>
  43075. <a name="Examples-127"></a>
  43076. <h4 class="subsection">39.108.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-127" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-127" aria-hidden="true">TOC</a></span></h4>
  43077. <ul class="itemize mark-bullet">
  43078. <li>Flip the image horizontally:
  43079. <div class="example">
  43080. <pre class="example-preformatted">geq=p(W-X\,Y)
  43081. </pre></div>
  43082. </li><li>Generate a bidimensional sine wave, with angle <code class="code">PI/3</code> and a
  43083. wavelength of 100 pixels:
  43084. <div class="example">
  43085. <pre class="example-preformatted">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  43086. </pre></div>
  43087. </li><li>Generate a fancy enigmatic moving light:
  43088. <div class="example">
  43089. <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
  43090. </pre></div>
  43091. </li><li>Generate a quick emboss effect:
  43092. <div class="example">
  43093. <pre class="example-preformatted">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  43094. </pre></div>
  43095. </li><li>Modify RGB components depending on pixel position:
  43096. <div class="example">
  43097. <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)'
  43098. </pre></div>
  43099. </li><li>Create a radial gradient that is the same size as the input (also see
  43100. the <a class="ref" href="#vignette">vignette</a> filter):
  43101. <div class="example">
  43102. <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
  43103. </pre></div>
  43104. </li></ul>
  43105. <a name="gradfun"></a>
  43106. <h3 class="section">39.109 gradfun<span class="pull-right"><a class="anchor hidden-xs" href="#gradfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradfun" aria-hidden="true">TOC</a></span></h3>
  43107. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  43108. regions by truncation to 8-bit color depth.
  43109. Interpolate the gradients that should go where the bands are, and
  43110. dither them.
  43111. </p>
  43112. <p>It is designed for playback only. Do not use it prior to
  43113. lossy compression, because compression tends to lose the dither and
  43114. bring back the bands.
  43115. </p>
  43116. <p>It accepts the following parameters:
  43117. </p>
  43118. <dl class="table">
  43119. <dt><samp class="option">strength</samp></dt>
  43120. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  43121. the threshold for detecting nearly flat regions. Acceptable values range from
  43122. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  43123. valid range.
  43124. </p>
  43125. </dd>
  43126. <dt><samp class="option">radius</samp></dt>
  43127. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  43128. gradients, but also prevents the filter from modifying the pixels near detailed
  43129. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  43130. values will be clipped to the valid range.
  43131. </p>
  43132. </dd>
  43133. </dl>
  43134. <p>Alternatively, the options can be specified as a flat string:
  43135. <var class="var">strength</var>[:<var class="var">radius</var>]
  43136. </p>
  43137. <a name="Examples-128"></a>
  43138. <h4 class="subsection">39.109.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-128" aria-hidden="true">TOC</a></span></h4>
  43139. <ul class="itemize mark-bullet">
  43140. <li>Apply the filter with a <code class="code">3.5</code> strength and radius of <code class="code">8</code>:
  43141. <div class="example">
  43142. <pre class="example-preformatted">gradfun=3.5:8
  43143. </pre></div>
  43144. </li><li>Specify radius, omitting the strength (which will fall-back to the default
  43145. value):
  43146. <div class="example">
  43147. <pre class="example-preformatted">gradfun=radius=8
  43148. </pre></div>
  43149. </li></ul>
  43150. <a class="anchor" id="graphmonitor"></a><a name="graphmonitor-1"></a>
  43151. <h3 class="section">39.110 graphmonitor<span class="pull-right"><a class="anchor hidden-xs" href="#graphmonitor-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graphmonitor-1" aria-hidden="true">TOC</a></span></h3>
  43152. <p>Show various filtergraph stats.
  43153. </p>
  43154. <p>With this filter one can debug complete filtergraph.
  43155. Especially issues with links filling with queued frames.
  43156. </p>
  43157. <p>The filter accepts the following options:
  43158. </p>
  43159. <dl class="table">
  43160. <dt><samp class="option">size, s</samp></dt>
  43161. <dd><p>Set video output size. Default is <var class="var">hd720</var>.
  43162. </p>
  43163. </dd>
  43164. <dt><samp class="option">opacity, o</samp></dt>
  43165. <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>.
  43166. </p>
  43167. </dd>
  43168. <dt><samp class="option">mode, m</samp></dt>
  43169. <dd><p>Set output mode flags.
  43170. </p>
  43171. <p>Available values for flags are:
  43172. </p><dl class="table">
  43173. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  43174. <dd><p>No any filtering. Default.
  43175. </p></dd>
  43176. <dt>&lsquo;<samp class="samp">compact</samp>&rsquo;</dt>
  43177. <dd><p>Show only filters with queued frames.
  43178. </p></dd>
  43179. <dt>&lsquo;<samp class="samp">nozero</samp>&rsquo;</dt>
  43180. <dd><p>Show only filters with non-zero stats.
  43181. </p></dd>
  43182. <dt>&lsquo;<samp class="samp">noeof</samp>&rsquo;</dt>
  43183. <dd><p>Show only filters with non-eof stat.
  43184. </p></dd>
  43185. <dt>&lsquo;<samp class="samp">nodisabled</samp>&rsquo;</dt>
  43186. <dd><p>Show only filters that are enabled in timeline.
  43187. </p></dd>
  43188. </dl>
  43189. </dd>
  43190. <dt><samp class="option">flags, f</samp></dt>
  43191. <dd><p>Set flags which enable which stats are shown in video.
  43192. </p>
  43193. <p>Available values for flags are:
  43194. </p><dl class="table">
  43195. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  43196. <dd><p>All flags turned off.
  43197. </p>
  43198. </dd>
  43199. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  43200. <dd><p>All flags turned on.
  43201. </p>
  43202. </dd>
  43203. <dt>&lsquo;<samp class="samp">queue</samp>&rsquo;</dt>
  43204. <dd><p>Display number of queued frames in each link.
  43205. </p>
  43206. </dd>
  43207. <dt>&lsquo;<samp class="samp">frame_count_in</samp>&rsquo;</dt>
  43208. <dd><p>Display number of frames taken from filter.
  43209. </p>
  43210. </dd>
  43211. <dt>&lsquo;<samp class="samp">frame_count_out</samp>&rsquo;</dt>
  43212. <dd><p>Display number of frames given out from filter.
  43213. </p>
  43214. </dd>
  43215. <dt>&lsquo;<samp class="samp">frame_count_delta</samp>&rsquo;</dt>
  43216. <dd><p>Display delta number of frames between above two values.
  43217. </p>
  43218. </dd>
  43219. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  43220. <dd><p>Display current filtered frame pts.
  43221. </p>
  43222. </dd>
  43223. <dt>&lsquo;<samp class="samp">pts_delta</samp>&rsquo;</dt>
  43224. <dd><p>Display pts delta between current and previous frame.
  43225. </p>
  43226. </dd>
  43227. <dt>&lsquo;<samp class="samp">time</samp>&rsquo;</dt>
  43228. <dd><p>Display current filtered frame time.
  43229. </p>
  43230. </dd>
  43231. <dt>&lsquo;<samp class="samp">time_delta</samp>&rsquo;</dt>
  43232. <dd><p>Display time delta between current and previous frame.
  43233. </p>
  43234. </dd>
  43235. <dt>&lsquo;<samp class="samp">timebase</samp>&rsquo;</dt>
  43236. <dd><p>Display time base for filter link.
  43237. </p>
  43238. </dd>
  43239. <dt>&lsquo;<samp class="samp">format</samp>&rsquo;</dt>
  43240. <dd><p>Display used format for filter link.
  43241. </p>
  43242. </dd>
  43243. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  43244. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  43245. </p>
  43246. </dd>
  43247. <dt>&lsquo;<samp class="samp">rate</samp>&rsquo;</dt>
  43248. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  43249. </p>
  43250. </dd>
  43251. <dt>&lsquo;<samp class="samp">eof</samp>&rsquo;</dt>
  43252. <dd><p>Display link output status.
  43253. </p>
  43254. </dd>
  43255. <dt>&lsquo;<samp class="samp">sample_count_in</samp>&rsquo;</dt>
  43256. <dd><p>Display number of samples taken from filter.
  43257. </p>
  43258. </dd>
  43259. <dt>&lsquo;<samp class="samp">sample_count_out</samp>&rsquo;</dt>
  43260. <dd><p>Display number of samples given out from filter.
  43261. </p>
  43262. </dd>
  43263. <dt>&lsquo;<samp class="samp">sample_count_delta</samp>&rsquo;</dt>
  43264. <dd><p>Display delta number of samples between above two values.
  43265. </p>
  43266. </dd>
  43267. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  43268. <dd><p>Show the timeline filter status.
  43269. </p></dd>
  43270. </dl>
  43271. </dd>
  43272. <dt><samp class="option">rate, r</samp></dt>
  43273. <dd><p>Set upper limit for video rate of output stream, Default value is <var class="var">25</var>.
  43274. This guarantee that output video frame rate will not be higher than this value.
  43275. </p></dd>
  43276. </dl>
  43277. <a name="grayworld"></a>
  43278. <h3 class="section">39.111 grayworld<span class="pull-right"><a class="anchor hidden-xs" href="#grayworld" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-grayworld" aria-hidden="true">TOC</a></span></h3>
  43279. <p>A color constancy filter that applies color correction based on the grayworld assumption
  43280. </p>
  43281. <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>
  43282. </p>
  43283. <p>The algorithm uses linear light, so input
  43284. data should be linearized beforehand (and possibly correctly tagged).
  43285. </p>
  43286. <div class="example">
  43287. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
  43288. </pre></div>
  43289. <a name="greyedge"></a>
  43290. <h3 class="section">39.112 greyedge<span class="pull-right"><a class="anchor hidden-xs" href="#greyedge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-greyedge" aria-hidden="true">TOC</a></span></h3>
  43291. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  43292. and corrects the scene colors accordingly.
  43293. </p>
  43294. <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>
  43295. </p>
  43296. <p>The filter accepts the following options:
  43297. </p>
  43298. <dl class="table">
  43299. <dt><samp class="option">difford</samp></dt>
  43300. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  43301. [0,2] and default value is 1.
  43302. </p>
  43303. </dd>
  43304. <dt><samp class="option">minknorm</samp></dt>
  43305. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  43306. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  43307. max value instead of calculating Minkowski distance.
  43308. </p>
  43309. </dd>
  43310. <dt><samp class="option">sigma</samp></dt>
  43311. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  43312. chosen in the range [0,1024.0] and default value = 1. floor( <var class="var">sigma</var> * break_off_sigma(3) )
  43313. can&rsquo;t be equal to 0 if <var class="var">difford</var> is greater than 0.
  43314. </p></dd>
  43315. </dl>
  43316. <a name="Examples-129"></a>
  43317. <h4 class="subsection">39.112.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-129" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-129" aria-hidden="true">TOC</a></span></h4>
  43318. <ul class="itemize mark-bullet">
  43319. <li>Grey Edge:
  43320. <div class="example">
  43321. <pre class="example-preformatted">greyedge=difford=1:minknorm=5:sigma=2
  43322. </pre></div>
  43323. </li><li>Max Edge:
  43324. <div class="example">
  43325. <pre class="example-preformatted">greyedge=difford=1:minknorm=0:sigma=2
  43326. </pre></div>
  43327. </li></ul>
  43328. <a name="guided"></a>
  43329. <h3 class="section">39.113 guided<span class="pull-right"><a class="anchor hidden-xs" href="#guided" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-guided" aria-hidden="true">TOC</a></span></h3>
  43330. <p>Apply guided filter for edge-preserving smoothing, dehazing and so on.
  43331. </p>
  43332. <p>The filter accepts the following options:
  43333. </p><dl class="table">
  43334. <dt><samp class="option">radius</samp></dt>
  43335. <dd><p>Set the box radius in pixels.
  43336. Allowed range is 1 to 20. Default is 3.
  43337. </p>
  43338. </dd>
  43339. <dt><samp class="option">eps</samp></dt>
  43340. <dd><p>Set regularization parameter (with square).
  43341. Allowed range is 0 to 1. Default is 0.01.
  43342. </p>
  43343. </dd>
  43344. <dt><samp class="option">mode</samp></dt>
  43345. <dd><p>Set filter mode. Can be <code class="code">basic</code> or <code class="code">fast</code>.
  43346. Default is <code class="code">basic</code>.
  43347. </p>
  43348. </dd>
  43349. <dt><samp class="option">sub</samp></dt>
  43350. <dd><p>Set subsampling ratio for <code class="code">fast</code> mode.
  43351. Range is 2 to 64. Default is 4.
  43352. No subsampling occurs in <code class="code">basic</code> mode.
  43353. </p>
  43354. </dd>
  43355. <dt><samp class="option">guidance</samp></dt>
  43356. <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>.
  43357. If <code class="code">off</code>, single input is required.
  43358. If <code class="code">on</code>, two inputs of the same resolution and pixel format are required.
  43359. The second input serves as the guidance.
  43360. </p>
  43361. </dd>
  43362. <dt><samp class="option">planes</samp></dt>
  43363. <dd><p>Set planes to filter. Default is first only.
  43364. </p></dd>
  43365. </dl>
  43366. <a name="Commands-96"></a>
  43367. <h4 class="subsection">39.113.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-96" aria-hidden="true">TOC</a></span></h4>
  43368. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  43369. </p>
  43370. <a name="Examples-130"></a>
  43371. <h4 class="subsection">39.113.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-130" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-130" aria-hidden="true">TOC</a></span></h4>
  43372. <ul class="itemize mark-bullet">
  43373. <li>Edge-preserving smoothing with guided filter:
  43374. <div class="example">
  43375. <pre class="example-preformatted">ffmpeg -i in.png -vf guided out.png
  43376. </pre></div>
  43377. </li><li>Dehazing, structure-transferring filtering, detail enhancement with guided filter.
  43378. For the generation of guidance image, refer to paper &quot;Guided Image Filtering&quot;.
  43379. See: <a class="url" href="http://kaiminghe.com/publications/pami12guidedfilter.pdf">http://kaiminghe.com/publications/pami12guidedfilter.pdf</a>.
  43380. <div class="example">
  43381. <pre class="example-preformatted">ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
  43382. </pre></div>
  43383. </li></ul>
  43384. <a class="anchor" id="haldclut"></a><a name="haldclut-1"></a>
  43385. <h3 class="section">39.114 haldclut<span class="pull-right"><a class="anchor hidden-xs" href="#haldclut-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haldclut-1" aria-hidden="true">TOC</a></span></h3>
  43386. <p>Apply a Hald CLUT to a video stream.
  43387. </p>
  43388. <p>First input is the video stream to process, and second one is the Hald CLUT.
  43389. The Hald CLUT input can be a simple picture or a complete video stream.
  43390. </p>
  43391. <p>The filter accepts the following options:
  43392. </p>
  43393. <dl class="table">
  43394. <dt><samp class="option">clut</samp></dt>
  43395. <dd><p>Set which CLUT video frames will be processed from second input stream,
  43396. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  43397. </p>
  43398. </dd>
  43399. <dt><samp class="option">shortest</samp></dt>
  43400. <dd><p>Force termination when the shortest input terminates. Default is <code class="code">0</code>.
  43401. </p></dd>
  43402. <dt><samp class="option">repeatlast</samp></dt>
  43403. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  43404. <code class="code">0</code> disable the filter after the last frame of the CLUT is reached.
  43405. Default is <code class="code">1</code>.
  43406. </p></dd>
  43407. </dl>
  43408. <p><code class="code">haldclut</code> also has the same interpolation options as <a class="ref" href="#lut3d">lut3d</a> (both
  43409. filters share the same internals).
  43410. </p>
  43411. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  43412. </p>
  43413. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  43414. (Hald CLUT author) at <a class="url" href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  43415. </p>
  43416. <a name="Commands-97"></a>
  43417. <h4 class="subsection">39.114.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-97" aria-hidden="true">TOC</a></span></h4>
  43418. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  43419. </p>
  43420. <a name="Workflow-examples"></a>
  43421. <h4 class="subsection">39.114.2 Workflow examples<span class="pull-right"><a class="anchor hidden-xs" href="#Workflow-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Workflow-examples" aria-hidden="true">TOC</a></span></h4>
  43422. <a name="Hald-CLUT-video-stream"></a>
  43423. <h4 class="subsubsection">39.114.2.1 Hald CLUT video stream<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-video-stream" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-video-stream" aria-hidden="true">TOC</a></span></h4>
  43424. <p>Generate an identity Hald CLUT stream altered with various effects:
  43425. </p><div class="example">
  43426. <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
  43427. </pre></div>
  43428. <p>Note: make sure you use a lossless codec.
  43429. </p>
  43430. <p>Then use it with <code class="code">haldclut</code> to apply it on some random stream:
  43431. </p><div class="example">
  43432. <pre class="example-preformatted">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  43433. </pre></div>
  43434. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  43435. <samp class="file">clut.nut</samp>), then the latest picture of that CLUT stream will be applied
  43436. to the remaining frames of the <code class="code">mandelbrot</code> stream.
  43437. </p>
  43438. <a name="Hald-CLUT-with-preview"></a>
  43439. <h4 class="subsubsection">39.114.2.2 Hald CLUT with preview<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-with-preview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-with-preview" aria-hidden="true">TOC</a></span></h4>
  43440. <p>A Hald CLUT is supposed to be a squared image of <code class="code">Level*Level*Level</code> by
  43441. <code class="code">Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  43442. biggest possible square starting at the top left of the picture. The remaining
  43443. padding pixels (bottom or right) will be ignored. This area can be used to add
  43444. a preview of the Hald CLUT.
  43445. </p>
  43446. <p>Typically, the following generated Hald CLUT will be supported by the
  43447. <code class="code">haldclut</code> filter:
  43448. </p>
  43449. <div class="example">
  43450. <pre class="example-preformatted">ffmpeg -f lavfi -i <a class="ref" href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  43451. pad=iw+320 [padded_clut];
  43452. smptebars=s=320x256, split [a][b];
  43453. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  43454. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  43455. </pre></div>
  43456. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  43457. bars are displayed on the right-top, and below the same color bars processed by
  43458. the color changes.
  43459. </p>
  43460. <p>Then, the effect of this Hald CLUT can be visualized with:
  43461. </p><div class="example">
  43462. <pre class="example-preformatted">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  43463. </pre></div>
  43464. <a name="hflip"></a>
  43465. <h3 class="section">39.115 hflip<span class="pull-right"><a class="anchor hidden-xs" href="#hflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hflip" aria-hidden="true">TOC</a></span></h3>
  43466. <p>Flip the input video horizontally.
  43467. </p>
  43468. <p>For example, to horizontally flip the input video with <code class="command">ffmpeg</code>:
  43469. </p><div class="example">
  43470. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  43471. </pre></div>
  43472. <a name="histeq"></a>
  43473. <h3 class="section">39.116 histeq<span class="pull-right"><a class="anchor hidden-xs" href="#histeq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histeq" aria-hidden="true">TOC</a></span></h3>
  43474. <p>This filter applies a global color histogram equalization on a
  43475. per-frame basis.
  43476. </p>
  43477. <p>It can be used to correct video that has a compressed range of pixel
  43478. intensities. The filter redistributes the pixel intensities to
  43479. equalize their distribution across the intensity range. It may be
  43480. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  43481. useful only for correcting degraded or poorly captured source
  43482. video.
  43483. </p>
  43484. <p>The filter accepts the following options:
  43485. </p>
  43486. <dl class="table">
  43487. <dt><samp class="option">strength</samp></dt>
  43488. <dd><p>Determine the amount of equalization to be applied. As the strength
  43489. is reduced, the distribution of pixel intensities more-and-more
  43490. approaches that of the input frame. The value must be a float number
  43491. in the range [0,1] and defaults to 0.200.
  43492. </p>
  43493. </dd>
  43494. <dt><samp class="option">intensity</samp></dt>
  43495. <dd><p>Set the maximum intensity that can generated and scale the output
  43496. values appropriately. The strength should be set as desired and then
  43497. the intensity can be limited if needed to avoid washing-out. The value
  43498. must be a float number in the range [0,1] and defaults to 0.210.
  43499. </p>
  43500. </dd>
  43501. <dt><samp class="option">antibanding</samp></dt>
  43502. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  43503. the luminance of output pixels by a small amount to avoid banding of
  43504. the histogram. Possible values are <code class="code">none</code>, <code class="code">weak</code> or
  43505. <code class="code">strong</code>. It defaults to <code class="code">none</code>.
  43506. </p></dd>
  43507. </dl>
  43508. <a class="anchor" id="histogram"></a><a name="histogram-1"></a>
  43509. <h3 class="section">39.117 histogram<span class="pull-right"><a class="anchor hidden-xs" href="#histogram-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histogram-1" aria-hidden="true">TOC</a></span></h3>
  43510. <p>Compute and draw a color distribution histogram for the input video.
  43511. </p>
  43512. <p>The computed histogram is a representation of the color component
  43513. distribution in an image.
  43514. </p>
  43515. <p>Standard histogram displays the color components distribution in an image.
  43516. Displays color graph for each color component. Shows distribution of
  43517. the Y, U, V, A or R, G, B components, depending on input format, in the
  43518. current frame. Below each graph a color component scale meter is shown.
  43519. </p>
  43520. <p>The filter accepts the following options:
  43521. </p>
  43522. <dl class="table">
  43523. <dt><samp class="option">level_height</samp></dt>
  43524. <dd><p>Set height of level. Default value is <code class="code">200</code>.
  43525. Allowed range is [50, 2048].
  43526. </p>
  43527. </dd>
  43528. <dt><samp class="option">scale_height</samp></dt>
  43529. <dd><p>Set height of color scale. Default value is <code class="code">12</code>.
  43530. Allowed range is [0, 40].
  43531. </p>
  43532. </dd>
  43533. <dt><samp class="option">display_mode</samp></dt>
  43534. <dd><p>Set display mode.
  43535. It accepts the following values:
  43536. </p><dl class="table">
  43537. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  43538. <dd><p>Per color component graphs are placed below each other.
  43539. </p>
  43540. </dd>
  43541. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  43542. <dd><p>Per color component graphs are placed side by side.
  43543. </p>
  43544. </dd>
  43545. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  43546. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  43547. that the graphs representing color components are superimposed directly
  43548. over one another.
  43549. </p></dd>
  43550. </dl>
  43551. <p>Default is <code class="code">stack</code>.
  43552. </p>
  43553. </dd>
  43554. <dt><samp class="option">levels_mode</samp></dt>
  43555. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  43556. Default is <code class="code">linear</code>.
  43557. </p>
  43558. </dd>
  43559. <dt><samp class="option">components</samp></dt>
  43560. <dd><p>Set what color components to display.
  43561. Default is <code class="code">7</code>.
  43562. </p>
  43563. </dd>
  43564. <dt><samp class="option">fgopacity</samp></dt>
  43565. <dd><p>Set foreground opacity. Default is <code class="code">0.7</code>.
  43566. </p>
  43567. </dd>
  43568. <dt><samp class="option">bgopacity</samp></dt>
  43569. <dd><p>Set background opacity. Default is <code class="code">0.5</code>.
  43570. </p>
  43571. </dd>
  43572. <dt><samp class="option">colors_mode</samp></dt>
  43573. <dd><p>Set colors mode.
  43574. It accepts the following values:
  43575. </p><dl class="table">
  43576. <dt>&lsquo;<samp class="samp">whiteonblack</samp>&rsquo;</dt>
  43577. <dt>&lsquo;<samp class="samp">blackonwhite</samp>&rsquo;</dt>
  43578. <dt>&lsquo;<samp class="samp">whiteongray</samp>&rsquo;</dt>
  43579. <dt>&lsquo;<samp class="samp">blackongray</samp>&rsquo;</dt>
  43580. <dt>&lsquo;<samp class="samp">coloronblack</samp>&rsquo;</dt>
  43581. <dt>&lsquo;<samp class="samp">coloronwhite</samp>&rsquo;</dt>
  43582. <dt>&lsquo;<samp class="samp">colorongray</samp>&rsquo;</dt>
  43583. <dt>&lsquo;<samp class="samp">blackoncolor</samp>&rsquo;</dt>
  43584. <dt>&lsquo;<samp class="samp">whiteoncolor</samp>&rsquo;</dt>
  43585. <dt>&lsquo;<samp class="samp">grayoncolor</samp>&rsquo;</dt>
  43586. </dl>
  43587. <p>Default is <code class="code">whiteonblack</code>.
  43588. </p></dd>
  43589. </dl>
  43590. <a name="Examples-131"></a>
  43591. <h4 class="subsection">39.117.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-131" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-131" aria-hidden="true">TOC</a></span></h4>
  43592. <ul class="itemize mark-bullet">
  43593. <li>Calculate and draw histogram:
  43594. <div class="example">
  43595. <pre class="example-preformatted">ffplay -i input -vf histogram
  43596. </pre></div>
  43597. </li></ul>
  43598. <a class="anchor" id="hqdn3d"></a><a name="hqdn3d-1"></a>
  43599. <h3 class="section">39.118 hqdn3d<span class="pull-right"><a class="anchor hidden-xs" href="#hqdn3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqdn3d-1" aria-hidden="true">TOC</a></span></h3>
  43600. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  43601. image noise, producing smooth images and making still images really
  43602. still. It should enhance compressibility.
  43603. </p>
  43604. <p>It accepts the following optional parameters:
  43605. </p>
  43606. <dl class="table">
  43607. <dt><samp class="option">luma_spatial</samp></dt>
  43608. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  43609. It defaults to 4.0.
  43610. </p>
  43611. </dd>
  43612. <dt><samp class="option">chroma_spatial</samp></dt>
  43613. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  43614. It defaults to 3.0*<var class="var">luma_spatial</var>/4.0.
  43615. </p>
  43616. </dd>
  43617. <dt><samp class="option">luma_tmp</samp></dt>
  43618. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  43619. 6.0*<var class="var">luma_spatial</var>/4.0.
  43620. </p>
  43621. </dd>
  43622. <dt><samp class="option">chroma_tmp</samp></dt>
  43623. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  43624. <var class="var">luma_tmp</var>*<var class="var">chroma_spatial</var>/<var class="var">luma_spatial</var>.
  43625. </p></dd>
  43626. </dl>
  43627. <a name="Commands-98"></a>
  43628. <h4 class="subsection">39.118.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-98" aria-hidden="true">TOC</a></span></h4>
  43629. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  43630. The command accepts the same syntax of the corresponding option.
  43631. </p>
  43632. <p>If the specified expression is not valid, it is kept at its current
  43633. value.
  43634. </p>
  43635. <a class="anchor" id="hwdownload"></a><a name="hwdownload-1"></a>
  43636. <h3 class="section">39.119 hwdownload<span class="pull-right"><a class="anchor hidden-xs" href="#hwdownload-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwdownload-1" aria-hidden="true">TOC</a></span></h3>
  43637. <p>Download hardware frames to system memory.
  43638. </p>
  43639. <p>The input must be in hardware frames, and the output a non-hardware format.
  43640. Not all formats will be supported on the output - it may be necessary to insert
  43641. an additional <samp class="option">format</samp> filter immediately following in the graph to get
  43642. the output in a supported format.
  43643. </p>
  43644. <a name="hwmap"></a>
  43645. <h3 class="section">39.120 hwmap<span class="pull-right"><a class="anchor hidden-xs" href="#hwmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwmap" aria-hidden="true">TOC</a></span></h3>
  43646. <p>Map hardware frames to system memory or to another device.
  43647. </p>
  43648. <p>This filter has several different modes of operation; which one is used depends
  43649. on the input and output formats:
  43650. </p><ul class="itemize mark-bullet">
  43651. <li>Hardware frame input, normal frame output
  43652. <p>Map the input frames to system memory and pass them to the output. If the
  43653. original hardware frame is later required (for example, after overlaying
  43654. something else on part of it), the <samp class="option">hwmap</samp> filter can be used again
  43655. in the next mode to retrieve it.
  43656. </p></li><li>Normal frame input, hardware frame output
  43657. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  43658. that is, return the original hardware frame.
  43659. </p>
  43660. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  43661. device for the output, then map them back to the software format at the input
  43662. and give those frames to the preceding filter. This will then act like the
  43663. <samp class="option">hwupload</samp> filter, but may be able to avoid an additional copy when
  43664. the input is already in a compatible format.
  43665. </p></li><li>Hardware frame input and output
  43666. <p>A device must be supplied for the output, either directly or with the
  43667. <samp class="option">derive_device</samp> option. The input and output devices must be of
  43668. different types and compatible - the exact meaning of this is
  43669. system-dependent, but typically it means that they must refer to the same
  43670. underlying hardware context (for example, refer to the same graphics card).
  43671. </p>
  43672. <p>If the input frames were originally created on the output device, then unmap
  43673. to retrieve the original frames.
  43674. </p>
  43675. <p>Otherwise, map the frames to the output device - create new hardware frames
  43676. on the output corresponding to the frames on the input.
  43677. </p></li></ul>
  43678. <p>The following additional parameters are accepted:
  43679. </p>
  43680. <dl class="table">
  43681. <dt><samp class="option">mode</samp></dt>
  43682. <dd><p>Set the frame mapping mode. Some combination of:
  43683. </p><dl class="table">
  43684. <dt><var class="var">read</var></dt>
  43685. <dd><p>The mapped frame should be readable.
  43686. </p></dd>
  43687. <dt><var class="var">write</var></dt>
  43688. <dd><p>The mapped frame should be writeable.
  43689. </p></dd>
  43690. <dt><var class="var">overwrite</var></dt>
  43691. <dd><p>The mapping will always overwrite the entire frame.
  43692. </p>
  43693. <p>This may improve performance in some cases, as the original contents of the
  43694. frame need not be loaded.
  43695. </p></dd>
  43696. <dt><var class="var">direct</var></dt>
  43697. <dd><p>The mapping must not involve any copying.
  43698. </p>
  43699. <p>Indirect mappings to copies of frames are created in some cases where either
  43700. direct mapping is not possible or it would have unexpected properties.
  43701. Setting this flag ensures that the mapping is direct and will fail if that is
  43702. not possible.
  43703. </p></dd>
  43704. </dl>
  43705. <p>Defaults to <var class="var">read+write</var> if not specified.
  43706. </p>
  43707. </dd>
  43708. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  43709. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  43710. device of type <var class="var">type</var> from the device the input frames exist on.
  43711. </p>
  43712. </dd>
  43713. <dt><samp class="option">reverse</samp></dt>
  43714. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  43715. and map them back to the source. This may be necessary in some cases where
  43716. a mapping in one direction is required but only the opposite direction is
  43717. supported by the devices being used.
  43718. </p>
  43719. <p>This option is dangerous - it may break the preceding filter in undefined
  43720. ways if there are any additional constraints on that filter&rsquo;s output.
  43721. Do not use it without fully understanding the implications of its use.
  43722. </p></dd>
  43723. </dl>
  43724. <a class="anchor" id="hwupload"></a><a name="hwupload-1"></a>
  43725. <h3 class="section">39.121 hwupload<span class="pull-right"><a class="anchor hidden-xs" href="#hwupload-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwupload-1" aria-hidden="true">TOC</a></span></h3>
  43726. <p>Upload system memory frames to hardware surfaces.
  43727. </p>
  43728. <p>The device to upload to must be supplied when the filter is initialised. If
  43729. using ffmpeg, select the appropriate device with the <samp class="option">-filter_hw_device</samp>
  43730. option or with the <samp class="option">derive_device</samp> option. The input and output devices
  43731. must be of different types and compatible - the exact meaning of this is
  43732. system-dependent, but typically it means that they must refer to the same
  43733. underlying hardware context (for example, refer to the same graphics card).
  43734. </p>
  43735. <p>The following additional parameters are accepted:
  43736. </p>
  43737. <dl class="table">
  43738. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  43739. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  43740. device of type <var class="var">type</var> from the device the input frames exist on.
  43741. </p></dd>
  43742. </dl>
  43743. <a class="anchor" id="hwupload_005fcuda"></a><a name="hwupload_005fcuda-1"></a>
  43744. <h3 class="section">39.122 hwupload_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#hwupload_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwupload_005fcuda-1" aria-hidden="true">TOC</a></span></h3>
  43745. <p>Upload system memory frames to a CUDA device.
  43746. </p>
  43747. <p>It accepts the following optional parameters:
  43748. </p>
  43749. <dl class="table">
  43750. <dt><samp class="option">device</samp></dt>
  43751. <dd><p>The number of the CUDA device to use
  43752. </p></dd>
  43753. </dl>
  43754. <a name="hqx"></a>
  43755. <h3 class="section">39.123 hqx<span class="pull-right"><a class="anchor hidden-xs" href="#hqx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqx" aria-hidden="true">TOC</a></span></h3>
  43756. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  43757. was originally created by Maxim Stepin.
  43758. </p>
  43759. <p>It accepts the following option:
  43760. </p>
  43761. <dl class="table">
  43762. <dt><samp class="option">n</samp></dt>
  43763. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">hq2x</code>, <code class="code">3</code> for
  43764. <code class="code">hq3x</code> and <code class="code">4</code> for <code class="code">hq4x</code>.
  43765. Default is <code class="code">3</code>.
  43766. </p></dd>
  43767. </dl>
  43768. <a class="anchor" id="hstack"></a><a name="hstack-1"></a>
  43769. <h3 class="section">39.124 hstack<span class="pull-right"><a class="anchor hidden-xs" href="#hstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack-1" aria-hidden="true">TOC</a></span></h3>
  43770. <p>Stack input videos horizontally.
  43771. </p>
  43772. <p>All streams must be of same pixel format and of same height.
  43773. </p>
  43774. <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
  43775. to create same output.
  43776. </p>
  43777. <p>The filter accepts the following option:
  43778. </p>
  43779. <dl class="table">
  43780. <dt><samp class="option">inputs</samp></dt>
  43781. <dd><p>Set number of input streams. Default is 2.
  43782. </p>
  43783. </dd>
  43784. <dt><samp class="option">shortest</samp></dt>
  43785. <dd><p>If set to 1, force the output to terminate when the shortest input
  43786. terminates. Default value is 0.
  43787. </p></dd>
  43788. </dl>
  43789. <a name="hsvhold"></a>
  43790. <h3 class="section">39.125 hsvhold<span class="pull-right"><a class="anchor hidden-xs" href="#hsvhold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hsvhold" aria-hidden="true">TOC</a></span></h3>
  43791. <p>Turns a certain HSV range into gray values.
  43792. </p>
  43793. <p>This filter measures color difference between set HSV color in options
  43794. and ones measured in video stream. Depending on options, output
  43795. colors can be changed to be gray or not.
  43796. </p>
  43797. <p>The filter accepts the following options:
  43798. </p>
  43799. <dl class="table">
  43800. <dt><samp class="option">hue</samp></dt>
  43801. <dd><p>Set the hue value which will be used in color difference calculation.
  43802. Allowed range is from -360 to 360. Default value is 0.
  43803. </p>
  43804. </dd>
  43805. <dt><samp class="option">sat</samp></dt>
  43806. <dd><p>Set the saturation value which will be used in color difference calculation.
  43807. Allowed range is from -1 to 1. Default value is 0.
  43808. </p>
  43809. </dd>
  43810. <dt><samp class="option">val</samp></dt>
  43811. <dd><p>Set the value which will be used in color difference calculation.
  43812. Allowed range is from -1 to 1. Default value is 0.
  43813. </p>
  43814. </dd>
  43815. <dt><samp class="option">similarity</samp></dt>
  43816. <dd><p>Set similarity percentage with the key color.
  43817. Allowed range is from 0 to 1. Default value is 0.01.
  43818. </p>
  43819. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  43820. </p>
  43821. </dd>
  43822. <dt><samp class="option">blend</samp></dt>
  43823. <dd><p>Blend percentage.
  43824. Allowed range is from 0 to 1. Default value is 0.
  43825. </p>
  43826. <p>0.0 makes pixels either fully gray, or not gray at all.
  43827. </p>
  43828. <p>Higher values result in more gray pixels, with a higher gray pixel
  43829. the more similar the pixels color is to the key color.
  43830. </p></dd>
  43831. </dl>
  43832. <a name="hsvkey"></a>
  43833. <h3 class="section">39.126 hsvkey<span class="pull-right"><a class="anchor hidden-xs" href="#hsvkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hsvkey" aria-hidden="true">TOC</a></span></h3>
  43834. <p>Turns a certain HSV range into transparency.
  43835. </p>
  43836. <p>This filter measures color difference between set HSV color in options
  43837. and ones measured in video stream. Depending on options, output
  43838. colors can be changed to transparent by adding alpha channel.
  43839. </p>
  43840. <p>The filter accepts the following options:
  43841. </p>
  43842. <dl class="table">
  43843. <dt><samp class="option">hue</samp></dt>
  43844. <dd><p>Set the hue value which will be used in color difference calculation.
  43845. Allowed range is from -360 to 360. Default value is 0.
  43846. </p>
  43847. </dd>
  43848. <dt><samp class="option">sat</samp></dt>
  43849. <dd><p>Set the saturation value which will be used in color difference calculation.
  43850. Allowed range is from -1 to 1. Default value is 0.
  43851. </p>
  43852. </dd>
  43853. <dt><samp class="option">val</samp></dt>
  43854. <dd><p>Set the value which will be used in color difference calculation.
  43855. Allowed range is from -1 to 1. Default value is 0.
  43856. </p>
  43857. </dd>
  43858. <dt><samp class="option">similarity</samp></dt>
  43859. <dd><p>Set similarity percentage with the key color.
  43860. Allowed range is from 0 to 1. Default value is 0.01.
  43861. </p>
  43862. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  43863. </p>
  43864. </dd>
  43865. <dt><samp class="option">blend</samp></dt>
  43866. <dd><p>Blend percentage.
  43867. Allowed range is from 0 to 1. Default value is 0.
  43868. </p>
  43869. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  43870. </p>
  43871. <p>Higher values result in semi-transparent pixels, with a higher transparency
  43872. the more similar the pixels color is to the key color.
  43873. </p></dd>
  43874. </dl>
  43875. <a name="hue"></a>
  43876. <h3 class="section">39.127 hue<span class="pull-right"><a class="anchor hidden-xs" href="#hue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hue" aria-hidden="true">TOC</a></span></h3>
  43877. <p>Modify the hue and/or the saturation of the input.
  43878. </p>
  43879. <p>It accepts the following parameters:
  43880. </p>
  43881. <dl class="table">
  43882. <dt><samp class="option">h</samp></dt>
  43883. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  43884. and defaults to &quot;0&quot;.
  43885. </p>
  43886. </dd>
  43887. <dt><samp class="option">s</samp></dt>
  43888. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  43889. defaults to &quot;1&quot;.
  43890. </p>
  43891. </dd>
  43892. <dt><samp class="option">H</samp></dt>
  43893. <dd><p>Specify the hue angle as a number of radians. It accepts an
  43894. expression, and defaults to &quot;0&quot;.
  43895. </p>
  43896. </dd>
  43897. <dt><samp class="option">b</samp></dt>
  43898. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  43899. defaults to &quot;0&quot;.
  43900. </p></dd>
  43901. </dl>
  43902. <p><samp class="option">h</samp> and <samp class="option">H</samp> are mutually exclusive, and can&rsquo;t be
  43903. specified at the same time.
  43904. </p>
  43905. <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
  43906. expressions containing the following constants:
  43907. </p>
  43908. <dl class="table">
  43909. <dt><samp class="option">n</samp></dt>
  43910. <dd><p>frame count of the input frame starting from 0
  43911. </p>
  43912. </dd>
  43913. <dt><samp class="option">pts</samp></dt>
  43914. <dd><p>presentation timestamp of the input frame expressed in time base units
  43915. </p>
  43916. </dd>
  43917. <dt><samp class="option">r</samp></dt>
  43918. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  43919. </p>
  43920. </dd>
  43921. <dt><samp class="option">t</samp></dt>
  43922. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  43923. </p>
  43924. </dd>
  43925. <dt><samp class="option">tb</samp></dt>
  43926. <dd><p>time base of the input video
  43927. </p></dd>
  43928. </dl>
  43929. <a name="Examples-132"></a>
  43930. <h4 class="subsection">39.127.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-132" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-132" aria-hidden="true">TOC</a></span></h4>
  43931. <ul class="itemize mark-bullet">
  43932. <li>Set the hue to 90 degrees and the saturation to 1.0:
  43933. <div class="example">
  43934. <pre class="example-preformatted">hue=h=90:s=1
  43935. </pre></div>
  43936. </li><li>Same command but expressing the hue in radians:
  43937. <div class="example">
  43938. <pre class="example-preformatted">hue=H=PI/2:s=1
  43939. </pre></div>
  43940. </li><li>Rotate hue and make the saturation swing between 0
  43941. and 2 over a period of 1 second:
  43942. <div class="example">
  43943. <pre class="example-preformatted">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  43944. </pre></div>
  43945. </li><li>Apply a 3 seconds saturation fade-in effect starting at 0:
  43946. <div class="example">
  43947. <pre class="example-preformatted">hue=&quot;s=min(t/3\,1)&quot;
  43948. </pre></div>
  43949. <p>The general fade-in expression can be written as:
  43950. </p><div class="example">
  43951. <pre class="example-preformatted">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  43952. </pre></div>
  43953. </li><li>Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  43954. <div class="example">
  43955. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  43956. </pre></div>
  43957. <p>The general fade-out expression can be written as:
  43958. </p><div class="example">
  43959. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  43960. </pre></div>
  43961. </li></ul>
  43962. <a name="Commands-99"></a>
  43963. <h4 class="subsection">39.127.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-99" aria-hidden="true">TOC</a></span></h4>
  43964. <p>This filter supports the following commands:
  43965. </p><dl class="table">
  43966. <dt><samp class="option">b</samp></dt>
  43967. <dt><samp class="option">s</samp></dt>
  43968. <dt><samp class="option">h</samp></dt>
  43969. <dt><samp class="option">H</samp></dt>
  43970. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  43971. The command accepts the same syntax of the corresponding option.
  43972. </p>
  43973. <p>If the specified expression is not valid, it is kept at its current
  43974. value.
  43975. </p></dd>
  43976. </dl>
  43977. <a name="huesaturation"></a>
  43978. <h3 class="section">39.128 huesaturation<span class="pull-right"><a class="anchor hidden-xs" href="#huesaturation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-huesaturation" aria-hidden="true">TOC</a></span></h3>
  43979. <p>Apply hue-saturation-intensity adjustments to input video stream.
  43980. </p>
  43981. <p>This filter operates in RGB colorspace.
  43982. </p>
  43983. <p>This filter accepts the following options:
  43984. </p>
  43985. <dl class="table">
  43986. <dt><samp class="option">hue</samp></dt>
  43987. <dd><p>Set the hue shift in degrees to apply. Default is 0.
  43988. Allowed range is from -180 to 180.
  43989. </p>
  43990. </dd>
  43991. <dt><samp class="option">saturation</samp></dt>
  43992. <dd><p>Set the saturation shift. Default is 0.
  43993. Allowed range is from -1 to 1.
  43994. </p>
  43995. </dd>
  43996. <dt><samp class="option">intensity</samp></dt>
  43997. <dd><p>Set the intensity shift. Default is 0.
  43998. Allowed range is from -1 to 1.
  43999. </p>
  44000. </dd>
  44001. <dt><samp class="option">colors</samp></dt>
  44002. <dd><p>Set which primary and complementary colors are going to be adjusted.
  44003. This options is set by providing one or multiple values.
  44004. This can select multiple colors at once. By default all colors are selected.
  44005. </p><dl class="table">
  44006. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  44007. <dd><p>Adjust reds.
  44008. </p></dd>
  44009. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  44010. <dd><p>Adjust yellows.
  44011. </p></dd>
  44012. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  44013. <dd><p>Adjust greens.
  44014. </p></dd>
  44015. <dt>&lsquo;<samp class="samp">c</samp>&rsquo;</dt>
  44016. <dd><p>Adjust cyans.
  44017. </p></dd>
  44018. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  44019. <dd><p>Adjust blues.
  44020. </p></dd>
  44021. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  44022. <dd><p>Adjust magentas.
  44023. </p></dd>
  44024. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  44025. <dd><p>Adjust all colors.
  44026. </p></dd>
  44027. </dl>
  44028. </dd>
  44029. <dt><samp class="option">strength</samp></dt>
  44030. <dd><p>Set strength of filtering. Allowed range is from 0 to 100.
  44031. Default value is 1.
  44032. </p>
  44033. </dd>
  44034. <dt><samp class="option">rw, gw, bw</samp></dt>
  44035. <dd><p>Set weight for each RGB component. Allowed range is from 0 to 1.
  44036. By default is set to 0.333, 0.334, 0.333.
  44037. Those options are used in saturation and lightess processing.
  44038. </p>
  44039. </dd>
  44040. <dt><samp class="option">lightness</samp></dt>
  44041. <dd><p>Set preserving lightness, by default is disabled.
  44042. Adjusting hues can change lightness from original RGB triplet,
  44043. with this option enabled lightness is kept at same value.
  44044. </p></dd>
  44045. </dl>
  44046. <a name="hysteresis"></a>
  44047. <h3 class="section">39.129 hysteresis<span class="pull-right"><a class="anchor hidden-xs" href="#hysteresis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hysteresis" aria-hidden="true">TOC</a></span></h3>
  44048. <p>Grow first stream into second stream by connecting components.
  44049. This makes it possible to build more robust edge masks.
  44050. </p>
  44051. <p>This filter accepts the following options:
  44052. </p>
  44053. <dl class="table">
  44054. <dt><samp class="option">planes</samp></dt>
  44055. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  44056. copied from first stream.
  44057. By default value 0xf, all planes will be processed.
  44058. </p>
  44059. </dd>
  44060. <dt><samp class="option">threshold</samp></dt>
  44061. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  44062. this value filter algorithm for connecting components is activated.
  44063. By default value is 0.
  44064. </p></dd>
  44065. </dl>
  44066. <p>The <code class="code">hysteresis</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  44067. </p>
  44068. <a name="iccdetect"></a>
  44069. <h3 class="section">39.130 iccdetect<span class="pull-right"><a class="anchor hidden-xs" href="#iccdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iccdetect" aria-hidden="true">TOC</a></span></h3>
  44070. <p>Detect the colorspace from an embedded ICC profile (if present), and update
  44071. the frame&rsquo;s tags accordingly.
  44072. </p>
  44073. <p>This filter accepts the following options:
  44074. </p>
  44075. <dl class="table">
  44076. <dt><samp class="option">force</samp></dt>
  44077. <dd><p>If true, the frame&rsquo;s existing colorspace tags will always be overridden by
  44078. values detected from an ICC profile. Otherwise, they will only be assigned if
  44079. they contain <code class="code">unknown</code>. Enabled by default.
  44080. </p></dd>
  44081. </dl>
  44082. <a name="iccgen"></a>
  44083. <h3 class="section">39.131 iccgen<span class="pull-right"><a class="anchor hidden-xs" href="#iccgen" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iccgen" aria-hidden="true">TOC</a></span></h3>
  44084. <p>Generate ICC profiles and attach them to frames.
  44085. </p>
  44086. <p>This filter accepts the following options:
  44087. </p>
  44088. <dl class="table">
  44089. <dt><samp class="option">color_primaries</samp></dt>
  44090. <dt><samp class="option">color_trc</samp></dt>
  44091. <dd><p>Configure the colorspace that the ICC profile will be generated for. The
  44092. default value of <code class="code">auto</code> infers the value from the input frame&rsquo;s metadata,
  44093. defaulting to BT.709/sRGB as appropriate.
  44094. </p>
  44095. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values, but note that
  44096. <code class="code">unknown</code> are not valid values for this filter.
  44097. </p>
  44098. </dd>
  44099. <dt><samp class="option">force</samp></dt>
  44100. <dd><p>If true, an ICC profile will be generated even if it would overwrite an
  44101. already existing ICC profile. Disabled by default.
  44102. </p></dd>
  44103. </dl>
  44104. <a name="identity"></a>
  44105. <h3 class="section">39.132 identity<span class="pull-right"><a class="anchor hidden-xs" href="#identity" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-identity" aria-hidden="true">TOC</a></span></h3>
  44106. <p>Obtain the identity score between two input videos.
  44107. </p>
  44108. <p>This filter takes two input videos.
  44109. </p>
  44110. <p>Both input videos must have the same resolution and pixel format for
  44111. this filter to work correctly. Also it assumes that both inputs
  44112. have the same number of frames, which are compared one by one.
  44113. </p>
  44114. <p>The obtained per component, average, min and max identity score is printed through
  44115. the logging system.
  44116. </p>
  44117. <p>The filter stores the calculated identity scores of each frame in frame metadata.
  44118. </p>
  44119. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  44120. </p>
  44121. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  44122. with the reference file <samp class="file">ref.mpg</samp>.
  44123. </p>
  44124. <div class="example">
  44125. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
  44126. </pre></div>
  44127. <a name="idet"></a>
  44128. <h3 class="section">39.133 idet<span class="pull-right"><a class="anchor hidden-xs" href="#idet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-idet" aria-hidden="true">TOC</a></span></h3>
  44129. <p>Detect video interlacing type.
  44130. </p>
  44131. <p>This filter tries to detect if the input frames are interlaced, progressive,
  44132. top or bottom field first. It will also try to detect fields that are
  44133. repeated between adjacent frames (a sign of telecine).
  44134. </p>
  44135. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  44136. Multiple frame detection incorporates the classification history of previous frames.
  44137. </p>
  44138. <p>The filter will log these metadata values:
  44139. </p>
  44140. <dl class="table">
  44141. <dt><samp class="option">single.current_frame</samp></dt>
  44142. <dd><p>Detected type of current frame using single-frame detection. One of:
  44143. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  44144. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  44145. </p>
  44146. </dd>
  44147. <dt><samp class="option">single.tff</samp></dt>
  44148. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  44149. </p>
  44150. </dd>
  44151. <dt><samp class="option">multiple.tff</samp></dt>
  44152. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  44153. </p>
  44154. </dd>
  44155. <dt><samp class="option">single.bff</samp></dt>
  44156. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  44157. </p>
  44158. </dd>
  44159. <dt><samp class="option">multiple.current_frame</samp></dt>
  44160. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  44161. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  44162. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  44163. </p>
  44164. </dd>
  44165. <dt><samp class="option">multiple.bff</samp></dt>
  44166. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  44167. </p>
  44168. </dd>
  44169. <dt><samp class="option">single.progressive</samp></dt>
  44170. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  44171. </p>
  44172. </dd>
  44173. <dt><samp class="option">multiple.progressive</samp></dt>
  44174. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  44175. </p>
  44176. </dd>
  44177. <dt><samp class="option">single.undetermined</samp></dt>
  44178. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  44179. </p>
  44180. </dd>
  44181. <dt><samp class="option">multiple.undetermined</samp></dt>
  44182. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  44183. </p>
  44184. </dd>
  44185. <dt><samp class="option">repeated.current_frame</samp></dt>
  44186. <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;.
  44187. </p>
  44188. </dd>
  44189. <dt><samp class="option">repeated.neither</samp></dt>
  44190. <dd><p>Cumulative number of frames with no repeated field.
  44191. </p>
  44192. </dd>
  44193. <dt><samp class="option">repeated.top</samp></dt>
  44194. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  44195. </p>
  44196. </dd>
  44197. <dt><samp class="option">repeated.bottom</samp></dt>
  44198. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  44199. </p></dd>
  44200. </dl>
  44201. <p>The filter accepts the following options:
  44202. </p>
  44203. <dl class="table">
  44204. <dt><samp class="option">intl_thres</samp></dt>
  44205. <dd><p>Set interlacing threshold.
  44206. </p></dd>
  44207. <dt><samp class="option">prog_thres</samp></dt>
  44208. <dd><p>Set progressive threshold.
  44209. </p></dd>
  44210. <dt><samp class="option">rep_thres</samp></dt>
  44211. <dd><p>Threshold for repeated field detection.
  44212. </p></dd>
  44213. <dt><samp class="option">half_life</samp></dt>
  44214. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  44215. statistics is halved (i.e., it contributes only 0.5 to its
  44216. classification). The default of 0 means that all frames seen are given
  44217. full weight of 1.0 forever.
  44218. </p></dd>
  44219. <dt><samp class="option">analyze_interlaced_flag</samp></dt>
  44220. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  44221. if the interlaced flag is accurate, it will not count undetermined frames.
  44222. If the flag is found to be accurate it will be used without any further
  44223. computations, if it is found to be inaccurate it will be cleared without any
  44224. further computations. This allows inserting the idet filter as a low computational
  44225. method to clean up the interlaced flag
  44226. </p></dd>
  44227. </dl>
  44228. <a name="Examples-133"></a>
  44229. <h4 class="subsection">39.133.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-133" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-133" aria-hidden="true">TOC</a></span></h4>
  44230. <p>Inspect the field order of the first 360 frames in a video, in verbose detail:
  44231. </p><div class="example">
  44232. <pre class="example-preformatted">ffmpeg -i INPUT -filter:v idet,metadata=mode=print -frames:v 360 -an -f null -
  44233. </pre></div>
  44234. <p>The idet filter will add analysis metadata to each frame, which will then be
  44235. discarded. At the end, the filter will also print a final report with statistics.
  44236. </p>
  44237. <a name="il"></a>
  44238. <h3 class="section">39.134 il<span class="pull-right"><a class="anchor hidden-xs" href="#il" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-il" aria-hidden="true">TOC</a></span></h3>
  44239. <p>Deinterleave or interleave fields.
  44240. </p>
  44241. <p>This filter allows one to process interlaced images fields without
  44242. deinterlacing them. Deinterleaving splits the input frame into 2
  44243. fields (so called half pictures). Odd lines are moved to the top
  44244. half of the output image, even lines to the bottom half.
  44245. You can process (filter) them independently and then re-interleave them.
  44246. </p>
  44247. <p>The filter accepts the following options:
  44248. </p>
  44249. <dl class="table">
  44250. <dt><samp class="option">luma_mode, l</samp></dt>
  44251. <dt><samp class="option">chroma_mode, c</samp></dt>
  44252. <dt><samp class="option">alpha_mode, a</samp></dt>
  44253. <dd><p>Available values for <var class="var">luma_mode</var>, <var class="var">chroma_mode</var> and
  44254. <var class="var">alpha_mode</var> are:
  44255. </p>
  44256. <dl class="table">
  44257. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  44258. <dd><p>Do nothing.
  44259. </p>
  44260. </dd>
  44261. <dt>&lsquo;<samp class="samp">deinterleave, d</samp>&rsquo;</dt>
  44262. <dd><p>Deinterleave fields, placing one above the other.
  44263. </p>
  44264. </dd>
  44265. <dt>&lsquo;<samp class="samp">interleave, i</samp>&rsquo;</dt>
  44266. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  44267. </p></dd>
  44268. </dl>
  44269. <p>Default value is <code class="code">none</code>.
  44270. </p>
  44271. </dd>
  44272. <dt><samp class="option">luma_swap, ls</samp></dt>
  44273. <dt><samp class="option">chroma_swap, cs</samp></dt>
  44274. <dt><samp class="option">alpha_swap, as</samp></dt>
  44275. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code class="code">0</code>.
  44276. </p></dd>
  44277. </dl>
  44278. <a name="Commands-100"></a>
  44279. <h4 class="subsection">39.134.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-100" aria-hidden="true">TOC</a></span></h4>
  44280. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  44281. </p>
  44282. <a name="inflate"></a>
  44283. <h3 class="section">39.135 inflate<span class="pull-right"><a class="anchor hidden-xs" href="#inflate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-inflate" aria-hidden="true">TOC</a></span></h3>
  44284. <p>Apply inflate effect to the video.
  44285. </p>
  44286. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  44287. only values higher than the pixel.
  44288. </p>
  44289. <p>It accepts the following options:
  44290. </p>
  44291. <dl class="table">
  44292. <dt><samp class="option">threshold0</samp></dt>
  44293. <dt><samp class="option">threshold1</samp></dt>
  44294. <dt><samp class="option">threshold2</samp></dt>
  44295. <dt><samp class="option">threshold3</samp></dt>
  44296. <dd><p>Limit the maximum change for each plane, default is 65535.
  44297. If 0, plane will remain unchanged.
  44298. </p></dd>
  44299. </dl>
  44300. <a name="Commands-101"></a>
  44301. <h4 class="subsection">39.135.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-101" aria-hidden="true">TOC</a></span></h4>
  44302. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  44303. </p>
  44304. <a name="interlace_002c-interlace_005fvulkan"></a>
  44305. <h3 class="section">39.136 interlace, interlace_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#interlace_002c-interlace_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interlace_002c-interlace_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  44306. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  44307. lower) lines from odd frames with lower (or upper) lines from even frames,
  44308. halving the frame rate and preserving image height.
  44309. </p>
  44310. <div class="example">
  44311. <pre class="example-preformatted"> Original Original New Frame
  44312. Frame 'j' Frame 'j+1' (tff)
  44313. ========== =========== ==================
  44314. Line 0 --------------------&gt; Frame 'j' Line 0
  44315. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  44316. Line 2 ---------------------&gt; Frame 'j' Line 2
  44317. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  44318. ... ... ...
  44319. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  44320. </pre></div>
  44321. <p>It accepts the following optional parameters:
  44322. </p>
  44323. <dl class="table">
  44324. <dt><samp class="option">scan</samp></dt>
  44325. <dd><p>This determines whether the interlaced frame is taken from the even
  44326. (tff - default) or odd (bff) lines of the progressive frame.
  44327. </p>
  44328. </dd>
  44329. <dt><samp class="option">lowpass</samp></dt>
  44330. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  44331. reduce moire patterns.
  44332. </p>
  44333. <dl class="table">
  44334. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  44335. <dd><p>Disable vertical lowpass filter
  44336. </p>
  44337. </dd>
  44338. <dt>&lsquo;<samp class="samp">1, linear</samp>&rsquo;</dt>
  44339. <dd><p>Enable linear filter (default)
  44340. </p>
  44341. </dd>
  44342. <dt>&lsquo;<samp class="samp">2, complex</samp>&rsquo;</dt>
  44343. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  44344. but better retain detail and subjective sharpness impression.
  44345. </p>
  44346. </dd>
  44347. </dl>
  44348. </dd>
  44349. </dl>
  44350. <a name="kerndeint"></a>
  44351. <h3 class="section">39.137 kerndeint<span class="pull-right"><a class="anchor hidden-xs" href="#kerndeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kerndeint" aria-hidden="true">TOC</a></span></h3>
  44352. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  44353. deinterling. Work on interlaced parts of a video to produce
  44354. progressive frames.
  44355. </p>
  44356. <p>The description of the accepted parameters follows.
  44357. </p>
  44358. <dl class="table">
  44359. <dt><samp class="option">thresh</samp></dt>
  44360. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  44361. determining if a pixel line must be processed. It must be an integer
  44362. in the range [0,255] and defaults to 10. A value of 0 will result in
  44363. applying the process on every pixels.
  44364. </p>
  44365. </dd>
  44366. <dt><samp class="option">map</samp></dt>
  44367. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  44368. Default is 0.
  44369. </p>
  44370. </dd>
  44371. <dt><samp class="option">order</samp></dt>
  44372. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  44373. 0. Default is 0.
  44374. </p>
  44375. </dd>
  44376. <dt><samp class="option">sharp</samp></dt>
  44377. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  44378. </p>
  44379. </dd>
  44380. <dt><samp class="option">twoway</samp></dt>
  44381. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  44382. </p></dd>
  44383. </dl>
  44384. <a name="Examples-134"></a>
  44385. <h4 class="subsection">39.137.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-134" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-134" aria-hidden="true">TOC</a></span></h4>
  44386. <ul class="itemize mark-bullet">
  44387. <li>Apply default values:
  44388. <div class="example">
  44389. <pre class="example-preformatted">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  44390. </pre></div>
  44391. </li><li>Enable additional sharpening:
  44392. <div class="example">
  44393. <pre class="example-preformatted">kerndeint=sharp=1
  44394. </pre></div>
  44395. </li><li>Paint processed pixels in white:
  44396. <div class="example">
  44397. <pre class="example-preformatted">kerndeint=map=1
  44398. </pre></div>
  44399. </li></ul>
  44400. <a name="kirsch"></a>
  44401. <h3 class="section">39.138 kirsch<span class="pull-right"><a class="anchor hidden-xs" href="#kirsch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kirsch" aria-hidden="true">TOC</a></span></h3>
  44402. <p>Apply kirsch operator to input video stream.
  44403. </p>
  44404. <p>The filter accepts the following option:
  44405. </p>
  44406. <dl class="table">
  44407. <dt><samp class="option">planes</samp></dt>
  44408. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  44409. By default value 0xf, all planes will be processed.
  44410. </p>
  44411. </dd>
  44412. <dt><samp class="option">scale</samp></dt>
  44413. <dd><p>Set value which will be multiplied with filtered result.
  44414. </p>
  44415. </dd>
  44416. <dt><samp class="option">delta</samp></dt>
  44417. <dd><p>Set value which will be added to filtered result.
  44418. </p></dd>
  44419. </dl>
  44420. <a name="Commands-102"></a>
  44421. <h4 class="subsection">39.138.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-102" aria-hidden="true">TOC</a></span></h4>
  44422. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  44423. </p>
  44424. <a name="lagfun"></a>
  44425. <h3 class="section">39.139 lagfun<span class="pull-right"><a class="anchor hidden-xs" href="#lagfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lagfun" aria-hidden="true">TOC</a></span></h3>
  44426. <p>Slowly update darker pixels.
  44427. </p>
  44428. <p>This filter makes short flashes of light appear longer.
  44429. This filter accepts the following options:
  44430. </p>
  44431. <dl class="table">
  44432. <dt><samp class="option">decay</samp></dt>
  44433. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  44434. </p>
  44435. </dd>
  44436. <dt><samp class="option">planes</samp></dt>
  44437. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  44438. </p></dd>
  44439. </dl>
  44440. <a name="Commands-103"></a>
  44441. <h4 class="subsection">39.139.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-103" aria-hidden="true">TOC</a></span></h4>
  44442. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  44443. </p>
  44444. <a name="lenscorrection"></a>
  44445. <h3 class="section">39.140 lenscorrection<span class="pull-right"><a class="anchor hidden-xs" href="#lenscorrection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lenscorrection" aria-hidden="true">TOC</a></span></h3>
  44446. <p>Correct radial lens distortion
  44447. </p>
  44448. <p>This filter can be used to correct for radial distortion as can result from the use
  44449. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  44450. one can use tools available for example as part of opencv or simply trial-and-error.
  44451. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  44452. and extract the k1 and k2 coefficients from the resulting matrix.
  44453. </p>
  44454. <p>Note that effectively the same filter is available in the open-source tools Krita and
  44455. Digikam from the KDE project.
  44456. </p>
  44457. <p>In contrast to the <a class="ref" href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  44458. this filter corrects the distortion of the image, whereas <a class="ref" href="#vignette">vignette</a> corrects the
  44459. brightness distribution, so you may want to use both filters together in certain
  44460. cases, though you will have to take care of ordering, i.e. whether vignetting should
  44461. be applied before or after lens correction.
  44462. </p>
  44463. <a name="Options-120"></a>
  44464. <h4 class="subsection">39.140.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-120" aria-hidden="true">TOC</a></span></h4>
  44465. <p>The filter accepts the following options:
  44466. </p>
  44467. <dl class="table">
  44468. <dt><samp class="option">cx</samp></dt>
  44469. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  44470. distortion. This value has a range [0,1] and is expressed as fractions of the image
  44471. width. Default is 0.5.
  44472. </p></dd>
  44473. <dt><samp class="option">cy</samp></dt>
  44474. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  44475. distortion. This value has a range [0,1] and is expressed as fractions of the image
  44476. height. Default is 0.5.
  44477. </p></dd>
  44478. <dt><samp class="option">k1</samp></dt>
  44479. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  44480. no correction. Default is 0.
  44481. </p></dd>
  44482. <dt><samp class="option">k2</samp></dt>
  44483. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  44484. 0 means no correction. Default is 0.
  44485. </p></dd>
  44486. <dt><samp class="option">i</samp></dt>
  44487. <dd><p>Set interpolation type. Can be <code class="code">nearest</code> or <code class="code">bilinear</code>.
  44488. Default is <code class="code">nearest</code>.
  44489. </p></dd>
  44490. <dt><samp class="option">fc</samp></dt>
  44491. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  44492. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  44493. manual</a>. Default color is <code class="code">black@0</code>.
  44494. </p></dd>
  44495. </dl>
  44496. <p>The formula that generates the correction is:
  44497. </p>
  44498. <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)
  44499. </p>
  44500. <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
  44501. distances from the focal point in the source and target images, respectively.
  44502. </p>
  44503. <a name="Commands-104"></a>
  44504. <h4 class="subsection">39.140.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-104" aria-hidden="true">TOC</a></span></h4>
  44505. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  44506. </p>
  44507. <a name="lensfun"></a>
  44508. <h3 class="section">39.141 lensfun<span class="pull-right"><a class="anchor hidden-xs" href="#lensfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lensfun" aria-hidden="true">TOC</a></span></h3>
  44509. <p>Apply lens correction via the lensfun library (<a class="url" href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  44510. </p>
  44511. <p>The <code class="code">lensfun</code> filter requires the camera make, camera model, and lens model
  44512. to apply the lens correction. The filter will load the lensfun database and
  44513. query it to find the corresponding camera and lens entries in the database. As
  44514. long as these entries can be found with the given options, the filter can
  44515. perform corrections on frames. Note that incomplete strings will result in the
  44516. filter choosing the best match with the given options, and the filter will
  44517. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  44518. provide the make, camera model, and lens model as they are required.
  44519. </p>
  44520. <p>To obtain a list of available makes and models, leave out one or both of <code class="code">make</code> and
  44521. <code class="code">model</code> options. The filter will send the full list to the log with level <code class="code">INFO</code>.
  44522. The first column is the make and the second column is the model.
  44523. To obtain a list of available lenses, set any values for make and model and leave out the
  44524. <code class="code">lens_model</code> option. The filter will send the full list of lenses in the log with level
  44525. <code class="code">INFO</code>. The ffmpeg tool will exit after the list is printed.
  44526. </p>
  44527. <p>The filter accepts the following options:
  44528. </p>
  44529. <dl class="table">
  44530. <dt><samp class="option">make</samp></dt>
  44531. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  44532. </p>
  44533. </dd>
  44534. <dt><samp class="option">model</samp></dt>
  44535. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  44536. required.
  44537. </p>
  44538. </dd>
  44539. <dt><samp class="option">lens_model</samp></dt>
  44540. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  44541. option is required.
  44542. </p>
  44543. </dd>
  44544. <dt><samp class="option">db_path</samp></dt>
  44545. <dd><p>The full path to the lens database folder. If not set, the filter will attempt to
  44546. load the database from the install path when the library was built. Default is unset.
  44547. </p>
  44548. </dd>
  44549. <dt><samp class="option">mode</samp></dt>
  44550. <dd><p>The type of correction to apply. The following values are valid options:
  44551. </p>
  44552. <dl class="table">
  44553. <dt>&lsquo;<samp class="samp">vignetting</samp>&rsquo;</dt>
  44554. <dd><p>Enables fixing lens vignetting.
  44555. </p>
  44556. </dd>
  44557. <dt>&lsquo;<samp class="samp">geometry</samp>&rsquo;</dt>
  44558. <dd><p>Enables fixing lens geometry. This is the default.
  44559. </p>
  44560. </dd>
  44561. <dt>&lsquo;<samp class="samp">subpixel</samp>&rsquo;</dt>
  44562. <dd><p>Enables fixing chromatic aberrations.
  44563. </p>
  44564. </dd>
  44565. <dt>&lsquo;<samp class="samp">vig_geo</samp>&rsquo;</dt>
  44566. <dd><p>Enables fixing lens vignetting and lens geometry.
  44567. </p>
  44568. </dd>
  44569. <dt>&lsquo;<samp class="samp">vig_subpixel</samp>&rsquo;</dt>
  44570. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  44571. </p>
  44572. </dd>
  44573. <dt>&lsquo;<samp class="samp">distortion</samp>&rsquo;</dt>
  44574. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  44575. </p>
  44576. </dd>
  44577. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  44578. <dd><p>Enables all possible corrections.
  44579. </p>
  44580. </dd>
  44581. </dl>
  44582. </dd>
  44583. <dt><samp class="option">focal_length</samp></dt>
  44584. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  44585. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  44586. range should be chosen when using that lens. Default 18.
  44587. </p>
  44588. </dd>
  44589. <dt><samp class="option">aperture</samp></dt>
  44590. <dd><p>The aperture of the image/video (expected constant for video). Note that
  44591. aperture is only used for vignetting correction. Default 3.5.
  44592. </p>
  44593. </dd>
  44594. <dt><samp class="option">focus_distance</samp></dt>
  44595. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  44596. focus distance is only used for vignetting and only slightly affects the
  44597. vignetting correction process. If unknown, leave it at the default value (which
  44598. is 1000).
  44599. </p>
  44600. </dd>
  44601. <dt><samp class="option">scale</samp></dt>
  44602. <dd><p>The scale factor which is applied after transformation. After correction the
  44603. video is no longer necessarily rectangular. This parameter controls how much of
  44604. the resulting image is visible. The value 0 means that a value will be chosen
  44605. automatically such that there is little or no unmapped area in the output
  44606. image. 1.0 means that no additional scaling is done. Lower values may result
  44607. in more of the corrected image being visible, while higher values may avoid
  44608. unmapped areas in the output.
  44609. </p>
  44610. </dd>
  44611. <dt><samp class="option">target_geometry</samp></dt>
  44612. <dd><p>The target geometry of the output image/video. The following values are valid
  44613. options:
  44614. </p>
  44615. <dl class="table">
  44616. <dt>&lsquo;<samp class="samp">rectilinear (default)</samp>&rsquo;</dt>
  44617. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  44618. <dt>&lsquo;<samp class="samp">panoramic</samp>&rsquo;</dt>
  44619. <dt>&lsquo;<samp class="samp">equirectangular</samp>&rsquo;</dt>
  44620. <dt>&lsquo;<samp class="samp">fisheye_orthographic</samp>&rsquo;</dt>
  44621. <dt>&lsquo;<samp class="samp">fisheye_stereographic</samp>&rsquo;</dt>
  44622. <dt>&lsquo;<samp class="samp">fisheye_equisolid</samp>&rsquo;</dt>
  44623. <dt>&lsquo;<samp class="samp">fisheye_thoby</samp>&rsquo;</dt>
  44624. </dl>
  44625. </dd>
  44626. <dt><samp class="option">reverse</samp></dt>
  44627. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  44628. it).
  44629. </p>
  44630. </dd>
  44631. <dt><samp class="option">interpolation</samp></dt>
  44632. <dd><p>The type of interpolation used when correcting distortion. The following values
  44633. are valid options:
  44634. </p>
  44635. <dl class="table">
  44636. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  44637. <dt>&lsquo;<samp class="samp">linear (default)</samp>&rsquo;</dt>
  44638. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  44639. </dl>
  44640. </dd>
  44641. </dl>
  44642. <a name="Examples-135"></a>
  44643. <h4 class="subsection">39.141.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-135" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-135" aria-hidden="true">TOC</a></span></h4>
  44644. <ul class="itemize mark-bullet">
  44645. <li>Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  44646. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  44647. aperture of &quot;8.0&quot;.
  44648. <div class="example">
  44649. <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
  44650. </pre></div>
  44651. </li><li>Apply the same as before, but only for the first 5 seconds of video.
  44652. <div class="example">
  44653. <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
  44654. </pre></div>
  44655. </li></ul>
  44656. <a name="lcevc"></a>
  44657. <h3 class="section">39.142 lcevc<span class="pull-right"><a class="anchor hidden-xs" href="#lcevc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lcevc" aria-hidden="true">TOC</a></span></h3>
  44658. <p>Low Complexity Enhancement Video Codec filter based on liblcevc_dec
  44659. (<a class="url" href="https://github.com/v-novaltd/LCEVCdec">https://github.com/v-novaltd/LCEVCdec</a>).
  44660. </p>
  44661. <a name="libplacebo"></a>
  44662. <h3 class="section">39.143 libplacebo<span class="pull-right"><a class="anchor hidden-xs" href="#libplacebo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libplacebo" aria-hidden="true">TOC</a></span></h3>
  44663. <p>Flexible GPU-accelerated processing filter based on libplacebo
  44664. (<a class="url" href="https://code.videolan.org/videolan/libplacebo">https://code.videolan.org/videolan/libplacebo</a>).
  44665. </p>
  44666. <a name="Options-121"></a>
  44667. <h4 class="subsection">39.143.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-121" aria-hidden="true">TOC</a></span></h4>
  44668. <p>The options for this filter are divided into the following sections:
  44669. </p>
  44670. <a name="Output-mode"></a>
  44671. <h4 class="subsubsection">39.143.1.1 Output mode<span class="pull-right"><a class="anchor hidden-xs" href="#Output-mode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Output-mode" aria-hidden="true">TOC</a></span></h4>
  44672. <p>These options control the overall output mode. By default, libplacebo will try
  44673. to preserve the source colorimetry and size as best as it can, but it will
  44674. apply any embedded film grain, dolby vision metadata or anamorphic SAR present
  44675. in source frames.
  44676. </p><dl class="table">
  44677. <dt><samp class="option">inputs</samp></dt>
  44678. <dd><p>Set the number of inputs. This can be used, alongside the <code class="code">idx</code> variable,
  44679. to allow placing/blending multiple inputs inside the output frame. This
  44680. effectively enables functionality similar to <a class="ref" href="#hstack">hstack</a>, <a class="ref" href="#overlay">overlay</a>, etc.
  44681. </p>
  44682. </dd>
  44683. <dt><samp class="option">w</samp></dt>
  44684. <dt><samp class="option">h</samp></dt>
  44685. <dd><p>Set the output video dimension expression. Default values are <code class="code">iw</code> and
  44686. <code class="code">ih</code>.
  44687. </p>
  44688. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  44689. </p>
  44690. </dd>
  44691. <dt><samp class="option">crop_x</samp></dt>
  44692. <dt><samp class="option">crop_y</samp></dt>
  44693. <dd><p>Set the input crop x/y expressions, default values are <code class="code">(iw-cw)/2</code> and
  44694. <code class="code">(ih-ch)/2</code>.
  44695. </p>
  44696. </dd>
  44697. <dt><samp class="option">crop_w</samp></dt>
  44698. <dt><samp class="option">crop_h</samp></dt>
  44699. <dd><p>Set the input crop width/height expressions, default values are <code class="code">iw</code> and
  44700. <code class="code">ih</code>.
  44701. </p>
  44702. </dd>
  44703. <dt><samp class="option">pos_x</samp></dt>
  44704. <dt><samp class="option">pos_y</samp></dt>
  44705. <dd><p>Set the output placement x/y expressions, default values are <code class="code">(ow-pw)/2</code>
  44706. and <code class="code">(oh-ph)/2</code>.
  44707. </p>
  44708. </dd>
  44709. <dt><samp class="option">pos_w</samp></dt>
  44710. <dt><samp class="option">pos_h</samp></dt>
  44711. <dd><p>Set the output placement width/height expressions, default values are <code class="code">ow</code>
  44712. and <code class="code">oh</code>.
  44713. </p>
  44714. </dd>
  44715. <dt><samp class="option">rotate</samp></dt>
  44716. <dd><p>Rotate the input frame clockwise by the specified angle.
  44717. </p>
  44718. <dl class="table">
  44719. <dt>&lsquo;<samp class="samp">0, 360</samp>&rsquo;</dt>
  44720. <dt>&lsquo;<samp class="samp">90</samp>&rsquo;</dt>
  44721. <dt>&lsquo;<samp class="samp">180</samp>&rsquo;</dt>
  44722. <dt>&lsquo;<samp class="samp">270</samp>&rsquo;</dt>
  44723. </dl>
  44724. </dd>
  44725. <dt><samp class="option">fps</samp></dt>
  44726. <dd><p>Set the output frame rate. This can be rational, e.g. <code class="code">60000/1001</code>. If
  44727. set to the special string <code class="code">none</code> (the default), input timestamps will
  44728. instead be passed through to the output unmodified. Otherwise, the input video
  44729. frames will be interpolated as necessary to rescale the video to the specified
  44730. target framerate, in a manner as determined by the <samp class="option">frame_mixer</samp> option.
  44731. </p>
  44732. </dd>
  44733. <dt><samp class="option">format</samp></dt>
  44734. <dd><p>Set the output format override. If unset (the default), frames will be output
  44735. in the same format as the respective input frames. Otherwise, format conversion
  44736. will be performed.
  44737. </p>
  44738. </dd>
  44739. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  44740. <dt><samp class="option">force_divisible_by</samp></dt>
  44741. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options. Note that
  44742. <samp class="option">force_divisible_by</samp> also works with <code class="code">fit_sense=constraint</code>.
  44743. </p>
  44744. </dd>
  44745. <dt><samp class="option">reset_sar</samp></dt>
  44746. <dd><p>If enabled, output frames will always have a pixel aspect ratio of 1:1. If
  44747. disabled (the default), any aspect ratio mismatches, including those from
  44748. e.g. anamorphic video sources, are forwarded to the output pixel aspect ratio.
  44749. </p>
  44750. </dd>
  44751. <dt><samp class="option">normalize_sar</samp></dt>
  44752. <dd><p>Like <samp class="option">reset_sar</samp>, but instead of stretching the video content to fill
  44753. the new output aspect ratio, the content is instead padded or cropped as
  44754. necessary. Mutually exclusive with <samp class="option">fit_mode</samp>. Disabled by default.
  44755. </p>
  44756. </dd>
  44757. <dt><samp class="option">pad_crop_ratio</samp></dt>
  44758. <dd><p>Specifies a ratio (between <code class="code">0.0</code> and <code class="code">1.0</code>) between padding and
  44759. cropping when the input aspect ratio does not match the output aspect ratio and
  44760. <samp class="option">normalize_sar</samp> is in effect. The default of <code class="code">0.0</code> always pads the
  44761. content with black borders, while a value of <code class="code">1.0</code> always crops off parts
  44762. of the content. Intermediate values are possible, leading to a mix of the two
  44763. approaches.
  44764. </p>
  44765. </dd>
  44766. <dt><samp class="option">fit_mode</samp></dt>
  44767. <dd><p>Specify the content fit strategy according to a list of predefined modes.
  44768. Determines how the input image is to be placed inside the destination crop
  44769. rectangle (as defined by <code class="code">pos_x/y</code> and <code class="code">pos_w/h</code>). The names and
  44770. their implementations are taken from the CSS &rsquo;object-fit&rsquo; property. Note that
  44771. this option is mutually exclusive with <samp class="option">normalize_sar</samp>. Defaults to
  44772. <code class="code">fill</code>. Valid values are:
  44773. </p>
  44774. <dl class="table">
  44775. <dt>&lsquo;<samp class="samp">fill</samp>&rsquo;</dt>
  44776. <dd><p>Stretch the input to the output rectangle, ignoring aspect ratio mismatches.
  44777. Note that unless <samp class="option">reset_sar</samp> is also enabled, the output will still
  44778. have the correct pixel aspect ratio tagged.
  44779. </p>
  44780. </dd>
  44781. <dt>&lsquo;<samp class="samp">contain</samp>&rsquo;</dt>
  44782. <dd><p>Scale the input to fit inside the output, preserving aspect ratio by padding.
  44783. Equivalent to <samp class="option">normalize_sar</samp> with <samp class="option">pad_crop_ratio</samp> set to
  44784. <code class="code">0.0</code>.
  44785. </p>
  44786. </dd>
  44787. <dt>&lsquo;<samp class="samp">cover</samp>&rsquo;</dt>
  44788. <dd><p>Scale the input to fill the output, preserving aspect ratio by cropping.
  44789. Equivalent to <samp class="option">normalize_sar</samp> with <samp class="option">pad_crop_ratio</samp> set to
  44790. <code class="code">1.0</code>.
  44791. </p>
  44792. </dd>
  44793. <dt>&lsquo;<samp class="samp">none, place</samp>&rsquo;</dt>
  44794. <dd><p>Don&rsquo;t scale the input. The input will be placed inside the output rectangle at
  44795. its natural size; which may result in additional padding or cropping.
  44796. </p>
  44797. </dd>
  44798. <dt>&lsquo;<samp class="samp">scale_down</samp>&rsquo;</dt>
  44799. <dd><p>Scale the input down as much as needed to fit inside the output. Equivalent
  44800. to either <code class="code">contain</code> or <code class="code">none</code>, depending on whether the input is
  44801. larger than the output or not.
  44802. </p></dd>
  44803. </dl>
  44804. </dd>
  44805. <dt><samp class="option">fit_sense</samp></dt>
  44806. <dd><p>When <samp class="option">fit_mode</samp> is in use, this option controls how the fit strategy
  44807. is applied against the specified output resolution. Mutually exclusive with
  44808. <samp class="option">force_original_aspect_ratio</samp>. Valid values are:
  44809. </p>
  44810. <dl class="table">
  44811. <dt>&lsquo;<samp class="samp">target</samp>&rsquo;</dt>
  44812. <dd><p>The computed output resolution is taken as the exact size of the output frame.
  44813. This is the default behavior.
  44814. </p>
  44815. </dd>
  44816. <dt>&lsquo;<samp class="samp">constraint</samp>&rsquo;</dt>
  44817. <dd><p>The computed output resolution is a size reference against which the fit mode
  44818. is applied, enlarging or decreasing the true frame size as needed to fit the
  44819. content.
  44820. </p></dd>
  44821. </dl>
  44822. </dd>
  44823. <dt><samp class="option">fillcolor</samp></dt>
  44824. <dd><p>Set the color used to fill the output area not covered by the output image, for
  44825. example as a result of <samp class="option">normalize_sar</samp>. For the general syntax of this
  44826. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  44827. manual</a>. Defaults to <code class="code">black@0</code>.
  44828. </p>
  44829. </dd>
  44830. <dt><samp class="option">corner_rounding</samp></dt>
  44831. <dd><p>Render frames with rounded corners. The value, given as a float ranging from
  44832. <code class="code">0.0</code> to <code class="code">1.0</code>, indicates the relative degree of rounding, from fully
  44833. square to fully circular. In other words, it gives the radius divided by half
  44834. the smaller side length. Defaults to <code class="code">0.0</code>.
  44835. </p>
  44836. </dd>
  44837. <dt><samp class="option">lut</samp></dt>
  44838. <dd><p>Specifies a custom LUT (in Adobe .cube format) to apply to the colors
  44839. as part of color conversion. The exact interpretation depends on the value
  44840. of <samp class="option">lut_type</samp>.
  44841. </p>
  44842. </dd>
  44843. <dt><samp class="option">lut_type</samp></dt>
  44844. <dd><p>Controls the interpretation of color values fed to and from the LUT
  44845. specified as <samp class="option">lut</samp>. Valid values are:
  44846. </p>
  44847. <dl class="table">
  44848. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  44849. <dd><p>Chooses the interpretation of the LUT automatically from tagged
  44850. metadata, and otherwise falls back to &lsquo;<samp class="samp">native</samp>&rsquo;. (Default)
  44851. </p>
  44852. </dd>
  44853. <dt>&lsquo;<samp class="samp">native</samp>&rsquo;</dt>
  44854. <dd><p>Applied to raw image contents in its native RGB colorspace (non-linear
  44855. light), before conversion to the output color space.
  44856. </p>
  44857. </dd>
  44858. <dt>&lsquo;<samp class="samp">normalized</samp>&rsquo;</dt>
  44859. <dd><p>Applied to the normalized RGB image contents, in linear light, before
  44860. conversion to the output color space.
  44861. </p>
  44862. </dd>
  44863. <dt>&lsquo;<samp class="samp">conversion</samp>&rsquo;</dt>
  44864. <dd><p>Fully replaces the conversion from the image color space to the output
  44865. color space. If such a LUT is present, it has the highest priority, and
  44866. overrides any ICC profiles, as well as options related to tone mapping
  44867. and output colorimetry (<samp class="option">color_primaries</samp>, <samp class="option">color_trc</samp>).
  44868. </p>
  44869. </dd>
  44870. </dl>
  44871. </dd>
  44872. <dt><samp class="option">extra_opts</samp></dt>
  44873. <dd><p>Pass extra libplacebo internal configuration options. These can be specified
  44874. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  44875. shows how to configure a custom filter kernel (&quot;EWA LanczosSharp&quot;) and use it
  44876. to double the input image resolution:
  44877. </p>
  44878. <div class="example">
  44879. <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;
  44880. </pre></div>
  44881. </dd>
  44882. <dt><samp class="option">shader_cache</samp></dt>
  44883. <dd><p>File path of a cache directory that libplacebo will use to store and load
  44884. cached shader objects. This cache is not cleaned up automatically. If the
  44885. path does not end in a directory separator, the generated filenames will be
  44886. effectively prefixed by the last path component. All directories must already
  44887. exist.
  44888. </p>
  44889. <div class="example">
  44890. <pre class="example-preformatted">-vf &quot;libplacebo=shader_cache=/tmp/pl-shader-&quot;
  44891. </pre></div>
  44892. </dd>
  44893. <dt><samp class="option">colorspace</samp></dt>
  44894. <dt><samp class="option">color_primaries</samp></dt>
  44895. <dt><samp class="option">color_trc</samp></dt>
  44896. <dt><samp class="option">range</samp></dt>
  44897. <dt><samp class="option">chroma_location</samp></dt>
  44898. <dd><p>Configure the colorspace that output frames will be delivered in. The default
  44899. value of <code class="code">auto</code> outputs frames in the same format as the input frames,
  44900. leading to no change. For any other value, conversion will be performed.
  44901. </p>
  44902. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values.
  44903. </p>
  44904. </dd>
  44905. <dt><samp class="option">alpha_mode</samp></dt>
  44906. <dd><p>Choose the desired output alpha mode, when the output format has an alpha
  44907. channel. See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values.
  44908. </p>
  44909. </dd>
  44910. <dt><samp class="option">apply_filmgrain</samp></dt>
  44911. <dd><p>Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip
  44912. it from the output. Enabled by default.
  44913. </p>
  44914. </dd>
  44915. <dt><samp class="option">apply_dolbyvision</samp></dt>
  44916. <dd><p>Apply Dolby Vision RPU metadata if present in source frames, and strip it from
  44917. the output. Enabled by default. Note that Dolby Vision will always output
  44918. BT.2020+PQ, overriding the usual input frame metadata. These will also be
  44919. picked as the values of <code class="code">auto</code> for the respective frame output options.
  44920. </p></dd>
  44921. </dl>
  44922. <p>In addition to the expression constants documented for the <a class="ref" href="#scale">scale</a> filter,
  44923. 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>,
  44924. <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
  44925. also contain the following constants:
  44926. </p>
  44927. <dl class="table">
  44928. <dt><samp class="option">in_idx, idx</samp></dt>
  44929. <dd><p>The (0-based) numeric index of the currently active input stream.
  44930. </p></dd>
  44931. <dt><samp class="option">crop_w, cw</samp></dt>
  44932. <dt><samp class="option">crop_h, ch</samp></dt>
  44933. <dd><p>The computed values of <samp class="option">crop_w</samp> and <samp class="option">crop_h</samp>.
  44934. </p>
  44935. </dd>
  44936. <dt><samp class="option">pos_w, pw</samp></dt>
  44937. <dt><samp class="option">pos_h, ph</samp></dt>
  44938. <dd><p>The computed values of <samp class="option">pos_w</samp> and <samp class="option">pos_h</samp>.
  44939. </p>
  44940. </dd>
  44941. <dt><samp class="option">in_t, t</samp></dt>
  44942. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  44943. </p>
  44944. </dd>
  44945. <dt><samp class="option">out_t, ot</samp></dt>
  44946. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  44947. </p>
  44948. </dd>
  44949. <dt><samp class="option">n</samp></dt>
  44950. <dd><p>The input frame number, starting with 0.
  44951. </p></dd>
  44952. </dl>
  44953. <a name="Scaling"></a>
  44954. <h4 class="subsubsection">39.143.1.2 Scaling<span class="pull-right"><a class="anchor hidden-xs" href="#Scaling" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaling" aria-hidden="true">TOC</a></span></h4>
  44955. <p>The options in this section control how libplacebo performs upscaling and (if
  44956. necessary) downscaling. Note that libplacebo will always internally operate on
  44957. 4:4:4 content, so any sub-sampled chroma formats such as <code class="code">yuv420p</code> will
  44958. necessarily be upsampled and downsampled as part of the rendering process. That
  44959. means scaling might be in effect even if the source and destination resolution
  44960. are the same.
  44961. </p><dl class="table">
  44962. <dt><samp class="option">upscaler</samp></dt>
  44963. <dt><samp class="option">downscaler</samp></dt>
  44964. <dd><p>Configure the filter kernel used for upscaling and downscaling. The respective
  44965. defaults are <code class="code">spline36</code> and <code class="code">mitchell</code>. For a full list of possible
  44966. values, pass <code class="code">help</code> to these options. The most important values are:
  44967. </p><dl class="table">
  44968. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  44969. <dd><p>Forces the use of built-in GPU texture sampling (typically bilinear). Extremely
  44970. fast but poor quality, especially when downscaling.
  44971. </p>
  44972. </dd>
  44973. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  44974. <dd><p>Bilinear interpolation. Can generally be done for free on GPUs, except when
  44975. doing so would lead to aliasing. Fast and low quality.
  44976. </p>
  44977. </dd>
  44978. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  44979. <dd><p>Nearest-neighbour interpolation. Sharp but highly aliasing.
  44980. </p>
  44981. </dd>
  44982. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  44983. <dd><p>Algorithm that looks visually similar to nearest-neighbour interpolation but
  44984. tries to preserve pixel aspect ratio. Good for pixel art, since it results in
  44985. minimal distortion of the artistic appearance.
  44986. </p>
  44987. </dd>
  44988. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  44989. <dd><p>Standard sinc-sinc interpolation kernel.
  44990. </p>
  44991. </dd>
  44992. <dt>&lsquo;<samp class="samp">spline36</samp>&rsquo;</dt>
  44993. <dd><p>Cubic spline approximation of lanczos. No difference in performance, but has
  44994. very slightly less ringing.
  44995. </p>
  44996. </dd>
  44997. <dt>&lsquo;<samp class="samp">ewa_lanczos</samp>&rsquo;</dt>
  44998. <dd><p>Elliptically weighted average version of lanczos, based on a jinc-jinc kernel.
  44999. This is also popularly referred to as just &quot;Jinc scaling&quot;. Slow but very high
  45000. quality.
  45001. </p>
  45002. </dd>
  45003. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  45004. <dd><p>Gaussian kernel. Has certain ideal mathematical properties, but subjectively
  45005. very blurry.
  45006. </p>
  45007. </dd>
  45008. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  45009. <dd><p>Cubic BC spline with parameters recommended by Mitchell and Netravali. Very
  45010. little ringing.
  45011. </p></dd>
  45012. </dl>
  45013. </dd>
  45014. <dt><samp class="option">frame_mixer</samp></dt>
  45015. <dd><p>Controls the kernel used for mixing frames temporally. The default value is
  45016. <code class="code">none</code>, which disables frame mixing. For a full list of possible values,
  45017. pass <code class="code">help</code> to this option. The most important values are:
  45018. </p><dl class="table">
  45019. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  45020. <dd><p>Disables frame mixing, giving a result equivalent to &quot;nearest neighbour&quot;
  45021. semantics.
  45022. </p>
  45023. </dd>
  45024. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  45025. <dd><p>Oversamples the input video to create a &quot;Smooth Motion&quot;-type effect: if an
  45026. output frame would exactly fall on the transition between two video frames, it
  45027. is blended according to the relative overlap. This is the recommended option
  45028. whenever preserving the original subjective appearance is desired.
  45029. </p>
  45030. </dd>
  45031. <dt>&lsquo;<samp class="samp">mitchell_clamp</samp>&rsquo;</dt>
  45032. <dd><p>Larger filter kernel that smoothly interpolates multiple frames in a manner
  45033. designed to eliminate ringing and other artefacts as much as possible. This is
  45034. the recommended option wherever maximum visual smoothness is desired.
  45035. </p>
  45036. </dd>
  45037. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  45038. <dd><p>Linear blend/fade between frames. Especially useful for constructing e.g.
  45039. slideshows.
  45040. </p></dd>
  45041. </dl>
  45042. </dd>
  45043. <dt><samp class="option">antiringing</samp></dt>
  45044. <dd><p>Enables anti-ringing (for non-EWA filters). The value (between <code class="code">0.0</code> and
  45045. <code class="code">1.0</code>) configures the strength of the anti-ringing algorithm. May increase
  45046. aliasing if set too high. Disabled by default.
  45047. </p>
  45048. </dd>
  45049. <dt><samp class="option">sigmoid</samp></dt>
  45050. <dd><p>Enable sigmoidal compression during upscaling. Reduces ringing slightly.
  45051. Enabled by default.
  45052. </p></dd>
  45053. </dl>
  45054. <a name="Deinterlacing"></a>
  45055. <h4 class="subsubsection">39.143.1.3 Deinterlacing<span class="pull-right"><a class="anchor hidden-xs" href="#Deinterlacing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Deinterlacing" aria-hidden="true">TOC</a></span></h4>
  45056. <p>Deinterlacing is automatically supported when frames are tagged as interlaced,
  45057. however frames are not deinterlaced unless a deinterlacing algorithm is chosen.
  45058. </p><dl class="table">
  45059. <dt><samp class="option">deinterlace</samp></dt>
  45060. <dd><p>The the deinterlacing algorithm to use.
  45061. </p><dl class="table">
  45062. <dt>&lsquo;<samp class="samp">weave</samp>&rsquo;</dt>
  45063. <dd><p>No deinterlacing, weave fields together into a single frame. This is the default.
  45064. </p></dd>
  45065. <dt>&lsquo;<samp class="samp">bob</samp>&rsquo;</dt>
  45066. <dd><p>Naive bob deinterlacing, simply repeat each field line twice.
  45067. </p></dd>
  45068. <dt>&lsquo;<samp class="samp">yadif</samp>&rsquo;</dt>
  45069. <dd><p>Yet another deinterlacing filter. See the <a class="ref" href="#yadif">yadif</a> filter for more details.
  45070. </p></dd>
  45071. <dt>&lsquo;<samp class="samp">bwdif</samp>&rsquo;</dt>
  45072. <dd><p>Bob weaver deinterlacing filter. See the <a class="ref" href="#bwdif">bwdif</a> filter for more details.
  45073. </p></dd>
  45074. </dl>
  45075. </dd>
  45076. <dt><samp class="option">skip_spatial_check</samp></dt>
  45077. <dd><p>Skip the spatial deinterlacing check when using <code class="code">yadif</code> deinterlacing.
  45078. </p>
  45079. </dd>
  45080. <dt><samp class="option">send_fields</samp></dt>
  45081. <dd><p>Output a frame for each field, rather than for each frame. Note that this will
  45082. always double the tagged output frame rate, even if the input does not contain
  45083. any interlaced frames. Disabled by default.
  45084. </p></dd>
  45085. </dl>
  45086. <a name="Debanding"></a>
  45087. <h4 class="subsubsection">39.143.1.4 Debanding<span class="pull-right"><a class="anchor hidden-xs" href="#Debanding" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Debanding" aria-hidden="true">TOC</a></span></h4>
  45088. <p>Libplacebo comes with a built-in debanding filter that is good at counteracting
  45089. many common sources of banding and blocking. Turning this on is highly
  45090. recommended whenever quality is desired.
  45091. </p><dl class="table">
  45092. <dt><samp class="option">deband</samp></dt>
  45093. <dd><p>Enable (fast) debanding algorithm. Disabled by default.
  45094. </p>
  45095. </dd>
  45096. <dt><samp class="option">deband_iterations</samp></dt>
  45097. <dd><p>Number of deband iterations of the debanding algorithm. Each iteration is
  45098. performed with progressively increased radius (and diminished threshold).
  45099. Recommended values are in the range <code class="code">1</code> to <code class="code">4</code>. Defaults to <code class="code">1</code>.
  45100. </p>
  45101. </dd>
  45102. <dt><samp class="option">deband_threshold</samp></dt>
  45103. <dd><p>Debanding filter strength. Higher numbers lead to more aggressive debanding.
  45104. Defaults to <code class="code">4.0</code>.
  45105. </p>
  45106. </dd>
  45107. <dt><samp class="option">deband_radius</samp></dt>
  45108. <dd><p>Debanding filter radius. A higher radius is better for slow gradients, while
  45109. a lower radius is better for steep gradients. Defaults to <code class="code">16.0</code>.
  45110. </p>
  45111. </dd>
  45112. <dt><samp class="option">deband_grain</samp></dt>
  45113. <dd><p>Amount of extra output grain to add. Helps hide imperfections. Defaults to
  45114. <code class="code">6.0</code>.
  45115. </p></dd>
  45116. </dl>
  45117. <a name="Color-adjustment"></a>
  45118. <h4 class="subsubsection">39.143.1.5 Color adjustment<span class="pull-right"><a class="anchor hidden-xs" href="#Color-adjustment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Color-adjustment" aria-hidden="true">TOC</a></span></h4>
  45119. <p>A collection of subjective color controls. Not very rigorous, so the exact
  45120. effect will vary somewhat depending on the input primaries and colorspace.
  45121. </p><dl class="table">
  45122. <dt><samp class="option">brightness</samp></dt>
  45123. <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>.
  45124. </p>
  45125. </dd>
  45126. <dt><samp class="option">contrast</samp></dt>
  45127. <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>.
  45128. </p>
  45129. </dd>
  45130. <dt><samp class="option">saturation</samp></dt>
  45131. <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>.
  45132. </p>
  45133. </dd>
  45134. <dt><samp class="option">hue</samp></dt>
  45135. <dd><p>Hue shift in radians, between <code class="code">-3.14</code> and <code class="code">3.14</code>. Defaults to
  45136. <code class="code">0.0</code>. This will rotate the UV subvector, defaulting to BT.709
  45137. coefficients for RGB inputs.
  45138. </p>
  45139. </dd>
  45140. <dt><samp class="option">gamma</samp></dt>
  45141. <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>.
  45142. </p>
  45143. </dd>
  45144. <dt><samp class="option">temperature</samp></dt>
  45145. <dd><p>Color temperature adjustment. Lower values make the output warmer/redder,
  45146. down to <code class="code">1667</code>, while higher values make the output cooler/bluer, up to
  45147. <code class="code">25000</code>. Defaults to <code class="code">6500</code> (neutral white).
  45148. </p>
  45149. </dd>
  45150. <dt><samp class="option">cones</samp></dt>
  45151. <dd><p>Cone model to use for color blindness simulation. Accepts any combination of
  45152. <code class="code">l</code>, <code class="code">m</code> and <code class="code">s</code>. Here are some examples:
  45153. </p><dl class="table">
  45154. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  45155. <dd><p>Deuteranomaly / deuteranopia (affecting 3%-4% of the population)
  45156. </p></dd>
  45157. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  45158. <dd><p>Protanomaly / protanopia (affecting 1%-2% of the population)
  45159. </p></dd>
  45160. <dt>&lsquo;<samp class="samp">l+m</samp>&rsquo;</dt>
  45161. <dd><p>Monochromacy (very rare)
  45162. </p></dd>
  45163. <dt>&lsquo;<samp class="samp">l+m+s</samp>&rsquo;</dt>
  45164. <dd><p>Achromatopsy (complete loss of daytime vision, extremely rare)
  45165. </p></dd>
  45166. </dl>
  45167. </dd>
  45168. <dt><samp class="option">cone-strength</samp></dt>
  45169. <dd><p>Gain factor for the cones specified by <code class="code">cones</code>, between <code class="code">0.0</code> and
  45170. <code class="code">10.0</code>. A value of <code class="code">1.0</code> results in no change to color vision. A
  45171. value of <code class="code">0.0</code> (the default) simulates complete loss of those cones. Values
  45172. above <code class="code">1.0</code> result in exaggerating the differences between cones, which
  45173. may help compensate for reduced color vision.
  45174. </p></dd>
  45175. </dl>
  45176. <a name="Peak-detection"></a>
  45177. <h4 class="subsubsection">39.143.1.6 Peak detection<span class="pull-right"><a class="anchor hidden-xs" href="#Peak-detection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Peak-detection" aria-hidden="true">TOC</a></span></h4>
  45178. <p>To help deal with sources that only have static HDR10 metadata (or no tagging
  45179. whatsoever), libplacebo uses its own internal frame analysis compute shader to
  45180. analyze source frames and adapt the tone mapping function in realtime. If this
  45181. is too slow, or if exactly reproducible frame-perfect results are needed, it&rsquo;s
  45182. recommended to turn this feature off.
  45183. </p><dl class="table">
  45184. <dt><samp class="option">peak_detect</samp></dt>
  45185. <dd><p>Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of
  45186. dynamic detection from the input. Note that the detected values do not get
  45187. written back to the output frames, they merely guide the internal tone mapping
  45188. process. Enabled by default.
  45189. </p>
  45190. </dd>
  45191. <dt><samp class="option">smoothing_period</samp></dt>
  45192. <dd><p>Peak detection smoothing period, between <code class="code">0.0</code> and <code class="code">1000.0</code>. Higher
  45193. values result in peak detection becoming less responsive to changes in the
  45194. input. Defaults to <code class="code">100.0</code>.
  45195. </p>
  45196. </dd>
  45197. <dt><samp class="option">scene_threshold_low</samp></dt>
  45198. <dt><samp class="option">scene_threshold_high</samp></dt>
  45199. <dd><p>Lower and upper thresholds for scene change detection. Expressed in a
  45200. logarithmic scale between <code class="code">0.0</code> and <code class="code">100.0</code>. Default to <code class="code">5.5</code>
  45201. and <code class="code">10.0</code>, respectively. Setting either to a negative value disables
  45202. this functionality.
  45203. </p>
  45204. </dd>
  45205. <dt><samp class="option">percentile</samp></dt>
  45206. <dd><p>Which percentile of the frame brightness histogram to use as the source peak
  45207. for tone-mapping. Defaults to <code class="code">99.995</code>, a fairly conservative value.
  45208. Setting this to <code class="code">100.0</code> disables frame histogram measurement and instead
  45209. uses the true peak brightness for tone-mapping.
  45210. </p></dd>
  45211. </dl>
  45212. <a name="Tone-mapping"></a>
  45213. <h4 class="subsubsection">39.143.1.7 Tone mapping<span class="pull-right"><a class="anchor hidden-xs" href="#Tone-mapping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Tone-mapping" aria-hidden="true">TOC</a></span></h4>
  45214. <p>The options in this section control how libplacebo performs tone-mapping and
  45215. gamut-mapping when dealing with mismatches between wide-gamut or HDR content.
  45216. In general, libplacebo relies on accurate source tagging and mastering display
  45217. gamut information to produce the best results.
  45218. </p><dl class="table">
  45219. <dt><samp class="option">gamut_mode</samp></dt>
  45220. <dd><p>How to handle out-of-gamut colors that can occur as a result of colorimetric
  45221. gamut mapping.
  45222. </p><dl class="table">
  45223. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  45224. <dd><p>Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but
  45225. extremely fast.
  45226. </p></dd>
  45227. <dt>&lsquo;<samp class="samp">perceptual</samp>&rsquo;</dt>
  45228. <dd><p>Perceptually soft-clip colors to the gamut volume. This is the default.
  45229. </p></dd>
  45230. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  45231. <dd><p>Relative colorimetric hard-clip. Similar to <code class="code">perceptual</code> but without
  45232. the soft knee.
  45233. </p></dd>
  45234. <dt>&lsquo;<samp class="samp">saturation</samp>&rsquo;</dt>
  45235. <dd><p>Saturation mapping, maps primaries directly to primaries in RGB space.
  45236. Not recommended except for artificial computer graphics for which a bright,
  45237. saturated display is desired.
  45238. </p></dd>
  45239. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  45240. <dd><p>Absolute colorimetric hard-clip. Performs no adjustment of the white point.
  45241. </p></dd>
  45242. <dt>&lsquo;<samp class="samp">desaturate</samp>&rsquo;</dt>
  45243. <dd><p>Hard-desaturates out-of-gamut colors towards white, while preserving the
  45244. luminance. Has a tendency to distort the visual appearance of bright objects.
  45245. </p></dd>
  45246. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  45247. <dd><p>Linearly reduces content brightness to preserves saturated details, followed by
  45248. clipping the remaining out-of-gamut colors.
  45249. </p></dd>
  45250. <dt>&lsquo;<samp class="samp">warn</samp>&rsquo;</dt>
  45251. <dd><p>Highlight out-of-gamut pixels (by inverting/marking them).
  45252. </p></dd>
  45253. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  45254. <dd><p>Linearly reduces chromaticity of the entire image to make it fit within the
  45255. target color volume. Be careful when using this on BT.2020 sources without
  45256. proper mastering metadata, as doing so will lead to excessive desaturation.
  45257. </p></dd>
  45258. </dl>
  45259. </dd>
  45260. <dt><samp class="option">tonemapping</samp></dt>
  45261. <dd><p>Tone-mapping algorithm to use. Available values are:
  45262. </p><dl class="table">
  45263. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  45264. <dd><p>Automatic selection based on internal heuristics. This is the default.
  45265. </p></dd>
  45266. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  45267. <dd><p>Performs no tone-mapping, just clips out-of-range colors. Retains perfect color
  45268. accuracy for in-range colors but completely destroys out-of-range information.
  45269. Does not perform any black point adaptation. Not configurable.
  45270. </p></dd>
  45271. <dt>&lsquo;<samp class="samp">st2094-40</samp>&rsquo;</dt>
  45272. <dd><p>EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+
  45273. dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used
  45274. is adjusted based on the ratio between the targeted and actual display peak
  45275. luminances.
  45276. </p></dd>
  45277. <dt>&lsquo;<samp class="samp">st2094-10</samp>&rsquo;</dt>
  45278. <dd><p>EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal
  45279. average luminance in addition to the maximum/minimum. The configurable contrast
  45280. parameter influences the slope of the linear output segment, defaulting to
  45281. <code class="code">1.0</code> for no increase/decrease in contrast. Note that this does not
  45282. currently include the subjective gain/offset/gamma controls defined in Annex
  45283. B.3.
  45284. </p></dd>
  45285. <dt>&lsquo;<samp class="samp">bt.2390</samp>&rsquo;</dt>
  45286. <dd><p>EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear
  45287. segment. The knee point offset is configurable. Note that this parameter
  45288. defaults to <code class="code">1.0</code>, rather than the value of <code class="code">0.5</code> from the ITU-R
  45289. spec.
  45290. </p></dd>
  45291. <dt>&lsquo;<samp class="samp">bt.2446a</samp>&rsquo;</dt>
  45292. <dd><p>EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR
  45293. sources. Can be used for both forward and inverse tone mapping. Not
  45294. configurable.
  45295. </p></dd>
  45296. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  45297. <dd><p>Simple spline consisting of two polynomials, joined by a single pivot point.
  45298. The parameter gives the pivot point (in PQ space), defaulting to <code class="code">0.30</code>.
  45299. Can be used for both forward and inverse tone mapping.
  45300. </p></dd>
  45301. <dt>&lsquo;<samp class="samp">reinhard</samp>&rsquo;</dt>
  45302. <dd><p>Simple non-linear, global tone mapping algorithm. The parameter specifies the
  45303. local contrast coefficient at the display peak. Essentially, a parameter of
  45304. <code class="code">0.5</code> implies that the reference white will be about half as bright as
  45305. when clipping. Defaults to <code class="code">0.5</code>, which results in the simplest
  45306. formulation of this function.
  45307. </p></dd>
  45308. <dt>&lsquo;<samp class="samp">mobius</samp>&rsquo;</dt>
  45309. <dd><p>Generalization of the reinhard tone mapping algorithm to support an additional
  45310. linear slope near black. The tone mapping parameter indicates the trade-off
  45311. between the linear section and the non-linear section. Essentially, for a given
  45312. parameter <var class="var">x</var>, every color value below <var class="var">x</var> will be mapped linearly,
  45313. while higher values get non-linearly tone-mapped. Values near <code class="code">1.0</code> make
  45314. this curve behave like <code class="code">clip</code>, while values near <code class="code">0.0</code> make this
  45315. curve behave like <code class="code">reinhard</code>. The default value is <code class="code">0.3</code>, which
  45316. provides a good balance between colorimetric accuracy and preserving
  45317. out-of-gamut details.
  45318. </p></dd>
  45319. <dt>&lsquo;<samp class="samp">hable</samp>&rsquo;</dt>
  45320. <dd><p>Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in
  45321. Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak.
  45322. Popularized by its use in video games with HDR rendering. Preserves both dark
  45323. and bright details very well, but comes with the drawback of changing the
  45324. average brightness quite significantly. This is sort of similar to
  45325. <code class="code">reinhard</code> with parameter <code class="code">0.24</code>.
  45326. </p></dd>
  45327. <dt>&lsquo;<samp class="samp">gamma</samp>&rsquo;</dt>
  45328. <dd><p>Fits a gamma (power) function to transfer between the source and target color
  45329. spaces, effectively resulting in a perceptual hard-knee joining two roughly
  45330. linear sections. This preserves details at all scales fairly accurately, but
  45331. can result in an image with a muted or dull appearance. The parameter is used
  45332. as the cutoff point, defaulting to <code class="code">0.5</code>.
  45333. </p></dd>
  45334. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  45335. <dd><p>Linearly stretches the input range to the output range, in PQ space. This will
  45336. preserve all details accurately, but results in a significantly different
  45337. average brightness. Can be used for inverse tone-mapping in addition to regular
  45338. tone-mapping. The parameter can be used as an additional linear gain
  45339. coefficient (defaulting to <code class="code">1.0</code>).
  45340. </p></dd>
  45341. </dl>
  45342. </dd>
  45343. <dt><samp class="option">tonemapping_param</samp></dt>
  45344. <dd><p>For tunable tone mapping functions, this parameter can be used to fine-tune the
  45345. curve behavior. Refer to the documentation of <code class="code">tonemapping</code>. The default
  45346. value of <code class="code">0.0</code> is replaced by the curve&rsquo;s preferred default setting.
  45347. </p>
  45348. </dd>
  45349. <dt><samp class="option">inverse_tonemapping</samp></dt>
  45350. <dd><p>If enabled, this filter will also attempt stretching SDR signals to fill HDR
  45351. output color volumes. Disabled by default.
  45352. </p>
  45353. </dd>
  45354. <dt><samp class="option">tonemapping_lut_size</samp></dt>
  45355. <dd><p>Size of the tone-mapping LUT, between <code class="code">2</code> and <code class="code">1024</code>. Defaults to
  45356. <code class="code">256</code>. Note that this figure is squared when combined with
  45357. <code class="code">peak_detect</code>.
  45358. </p>
  45359. </dd>
  45360. <dt><samp class="option">contrast_recovery</samp></dt>
  45361. <dd><p>Contrast recovery strength. If set to a value above <code class="code">0.0</code>, the source
  45362. image will be divided into high-frequency and low-frequency components, and a
  45363. portion of the high-frequency image is added back onto the tone-mapped output.
  45364. May cause excessive ringing artifacts for some HDR sources, but can improve the
  45365. subjective sharpness and detail left over in the image after tone-mapping.
  45366. Defaults to <code class="code">0.30</code>.
  45367. </p>
  45368. </dd>
  45369. <dt><samp class="option">contrast_smoothness</samp></dt>
  45370. <dd><p>Contrast recovery lowpass kernel size. Defaults to <code class="code">3.5</code>. Increasing or
  45371. decreasing this will affect the visual appearance substantially. Has no effect
  45372. when <code class="code">contrast_recovery</code> is disabled.
  45373. </p></dd>
  45374. </dl>
  45375. <a name="Dithering"></a>
  45376. <h4 class="subsubsection">39.143.1.8 Dithering<span class="pull-right"><a class="anchor hidden-xs" href="#Dithering" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Dithering" aria-hidden="true">TOC</a></span></h4>
  45377. <p>By default, libplacebo will dither whenever necessary, which includes rendering
  45378. to any integer format below 16-bit precision. It&rsquo;s recommended to always leave
  45379. this on, since not doing so may result in visible banding in the output, even
  45380. if the <code class="code">debanding</code> filter is enabled. If maximum performance is needed,
  45381. use <code class="code">ordered_fixed</code> instead of disabling dithering.
  45382. </p><dl class="table">
  45383. <dt><samp class="option">dithering</samp></dt>
  45384. <dd><p>Dithering method to use. Accepts the following values:
  45385. </p><dl class="table">
  45386. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  45387. <dd><p>Disables dithering completely. May result in visible banding.
  45388. </p></dd>
  45389. <dt>&lsquo;<samp class="samp">blue</samp>&rsquo;</dt>
  45390. <dd><p>Dither with pseudo-blue noise. This is the default.
  45391. </p></dd>
  45392. <dt>&lsquo;<samp class="samp">ordered</samp>&rsquo;</dt>
  45393. <dd><p>Tunable ordered dither pattern.
  45394. </p></dd>
  45395. <dt>&lsquo;<samp class="samp">ordered_fixed</samp>&rsquo;</dt>
  45396. <dd><p>Faster ordered dither with a fixed size of <code class="code">6</code>. Texture-less.
  45397. </p></dd>
  45398. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  45399. <dd><p>Dither with white noise. Texture-less.
  45400. </p></dd>
  45401. </dl>
  45402. </dd>
  45403. <dt><samp class="option">dither_lut_size</samp></dt>
  45404. <dd><p>Dither LUT size, as log base2 between <code class="code">1</code> and <code class="code">8</code>. Defaults to
  45405. <code class="code">6</code>, corresponding to a LUT size of <code class="code">64x64</code>.
  45406. </p>
  45407. </dd>
  45408. <dt><samp class="option">dither_temporal</samp></dt>
  45409. <dd><p>Enables temporal dithering. Disabled by default.
  45410. </p></dd>
  45411. </dl>
  45412. <a name="Custom-shaders"></a>
  45413. <h4 class="subsubsection">39.143.1.9 Custom shaders<span class="pull-right"><a class="anchor hidden-xs" href="#Custom-shaders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Custom-shaders" aria-hidden="true">TOC</a></span></h4>
  45414. <p>libplacebo supports a number of custom shaders based on the mpv .hook GLSL
  45415. syntax. A collection of such shaders can be found here:
  45416. <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>
  45417. </p>
  45418. <p>A full description of the mpv shader format is beyond the scope of this
  45419. section, but a summary can be found here:
  45420. <a class="url" href="https://mpv.io/manual/master/#options-glsl-shader">https://mpv.io/manual/master/#options-glsl-shader</a>
  45421. </p><dl class="table">
  45422. <dt><samp class="option">custom_shader_path</samp></dt>
  45423. <dd><p>Specifies a path to a custom shader file to load at runtime.
  45424. </p>
  45425. </dd>
  45426. <dt><samp class="option">custom_shader_bin</samp></dt>
  45427. <dd><p>Specifies a complete custom shader as a raw string.
  45428. </p></dd>
  45429. </dl>
  45430. <a name="Debugging-_002f-performance"></a>
  45431. <h4 class="subsubsection">39.143.1.10 Debugging / performance<span class="pull-right"><a class="anchor hidden-xs" href="#Debugging-_002f-performance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Debugging-_002f-performance" aria-hidden="true">TOC</a></span></h4>
  45432. <p>All of the options in this section default off. They may be of assistance when
  45433. attempting to squeeze the maximum performance at the cost of quality.
  45434. </p><dl class="table">
  45435. <dt><samp class="option">skip_aa</samp></dt>
  45436. <dd><p>Disable anti-aliasing when downscaling.
  45437. </p>
  45438. </dd>
  45439. <dt><samp class="option">disable_linear</samp></dt>
  45440. <dd><p>Disable linear light scaling.
  45441. </p>
  45442. </dd>
  45443. <dt><samp class="option">disable_builtin</samp></dt>
  45444. <dd><p>Disable built-in GPU sampling (forces LUT).
  45445. </p>
  45446. </dd>
  45447. <dt><samp class="option">disable_fbos</samp></dt>
  45448. <dd><p>Forcibly disable FBOs, resulting in loss of almost all functionality, but
  45449. offering the maximum possible speed.
  45450. </p></dd>
  45451. </dl>
  45452. <a name="Commands-105"></a>
  45453. <h4 class="subsection">39.143.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-105" aria-hidden="true">TOC</a></span></h4>
  45454. <p>This filter supports almost all of the above options as <a class="ref" href="#commands">commands</a>.
  45455. </p>
  45456. <a name="Examples-136"></a>
  45457. <h4 class="subsection">39.143.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-136" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-136" aria-hidden="true">TOC</a></span></h4>
  45458. <ul class="itemize mark-bullet">
  45459. <li>Tone-map input to standard gamut BT.709 output:
  45460. <div class="example">
  45461. <pre class="example-preformatted">libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
  45462. </pre></div>
  45463. </li><li>Rescale input to fit into standard 1080p, with high quality scaling:
  45464. <div class="example">
  45465. <pre class="example-preformatted">libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
  45466. </pre></div>
  45467. </li><li>Interpolate low FPS / VFR input to smoothed constant 60 fps output:
  45468. <div class="example">
  45469. <pre class="example-preformatted">libplacebo=fps=60:frame_mixer=mitchell_clamp
  45470. </pre></div>
  45471. </li><li>Convert input to standard sRGB JPEG:
  45472. <div class="example">
  45473. <pre class="example-preformatted">libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
  45474. </pre></div>
  45475. </li><li>Use higher quality debanding settings:
  45476. <div class="example">
  45477. <pre class="example-preformatted">libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
  45478. </pre></div>
  45479. </li><li>Run this filter on the CPU, on systems with Mesa installed (and with the most
  45480. expensive options disabled):
  45481. <div class="example">
  45482. <pre class="example-preformatted">ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
  45483. </pre></div>
  45484. </li><li>Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of
  45485. doing it with this filter. Note that this is only a gain if the frames are
  45486. either already on the GPU, or if you&rsquo;re using libplacebo for other purposes,
  45487. since otherwise the VRAM roundtrip will more than offset any expected speedup.
  45488. <div class="example">
  45489. <pre class="example-preformatted">ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
  45490. </pre></div>
  45491. </li><li>Interop with VAAPI hwdec to avoid round-tripping through RAM:
  45492. <div class="example">
  45493. <pre class="example-preformatted">ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
  45494. </pre></div>
  45495. </li></ul>
  45496. <a class="anchor" id="libvmaf"></a><a name="libvmaf-1"></a>
  45497. <h3 class="section">39.144 libvmaf<span class="pull-right"><a class="anchor hidden-xs" href="#libvmaf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvmaf-1" aria-hidden="true">TOC</a></span></h3>
  45498. <p>Calculate the VMAF (Video Multi-Method Assessment Fusion) score for a
  45499. reference/distorted pair of input videos.
  45500. </p>
  45501. <p>The first input is the distorted video, and the second input is the reference video.
  45502. </p>
  45503. <p>The obtained VMAF score is printed through the logging system.
  45504. </p>
  45505. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  45506. After installing the library it can be enabled using:
  45507. <code class="code">./configure --enable-libvmaf</code>.
  45508. </p>
  45509. <p>The filter has following options:
  45510. </p>
  45511. <dl class="table">
  45512. <dt><samp class="option">model</samp></dt>
  45513. <dd><p>A &lsquo;|&lsquo; delimited list of vmaf models. Each model can be configured with a number of parameters.
  45514. Default value: <code class="code">&quot;version=vmaf_v0.6.1&quot;</code>
  45515. </p>
  45516. </dd>
  45517. <dt><samp class="option">feature</samp></dt>
  45518. <dd><p>A &lsquo;|&lsquo; delimited list of features. Each feature can be configured with a number of parameters.
  45519. </p>
  45520. </dd>
  45521. <dt><samp class="option">log_path</samp></dt>
  45522. <dd><p>Set the file path to be used to store log files.
  45523. </p>
  45524. </dd>
  45525. <dt><samp class="option">log_fmt</samp></dt>
  45526. <dd><p>Set the format of the log file (xml, json, csv, or sub).
  45527. </p>
  45528. </dd>
  45529. <dt><samp class="option">pool</samp></dt>
  45530. <dd><p>Set the pool method to be used for computing vmaf.
  45531. Options are <code class="code">min</code>, <code class="code">harmonic_mean</code> or <code class="code">mean</code> (default).
  45532. </p>
  45533. </dd>
  45534. <dt><samp class="option">n_threads</samp></dt>
  45535. <dd><p>Set number of threads to be used when initializing libvmaf.
  45536. Default value: <code class="code">0</code>, no threads.
  45537. </p>
  45538. </dd>
  45539. <dt><samp class="option">n_subsample</samp></dt>
  45540. <dd><p>Set frame subsampling interval to be used.
  45541. </p></dd>
  45542. </dl>
  45543. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  45544. </p>
  45545. <a name="Examples-137"></a>
  45546. <h4 class="subsection">39.144.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-137" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-137" aria-hidden="true">TOC</a></span></h4>
  45547. <ul class="itemize mark-bullet">
  45548. <li>In the examples below, a distorted video <samp class="file">distorted.mpg</samp> is
  45549. compared with a reference file <samp class="file">reference.mpg</samp>.
  45550. </li><li>Basic usage:
  45551. <div class="example">
  45552. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
  45553. </pre></div>
  45554. </li><li>Example with multiple models:
  45555. <div class="example">
  45556. <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 -
  45557. </pre></div>
  45558. </li><li>Example with multiple additional features:
  45559. <div class="example">
  45560. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
  45561. </pre></div>
  45562. </li><li>Example with options and different containers:
  45563. <div class="example">
  45564. <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 -
  45565. </pre></div>
  45566. </li></ul>
  45567. <a name="libvmaf_005fcuda"></a>
  45568. <h3 class="section">39.145 libvmaf_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#libvmaf_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvmaf_005fcuda" aria-hidden="true">TOC</a></span></h3>
  45569. <p>This is the CUDA variant of the <a class="ref" href="#libvmaf">libvmaf</a> filter. It only accepts CUDA frames.
  45570. </p>
  45571. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  45572. After installing the library it can be enabled using:
  45573. <code class="code">./configure --enable-nonfree --enable-ffnvcodec --enable-libvmaf</code>.
  45574. </p>
  45575. <a name="Examples-138"></a>
  45576. <h4 class="subsection">39.145.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-138" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-138" aria-hidden="true">TOC</a></span></h4>
  45577. <ul class="itemize mark-bullet">
  45578. <li>Basic usage showing CUVID hardware decoding and CUDA scaling with <a class="ref" href="#scale_005fcuda">scale_cuda</a>:
  45579. <div class="example">
  45580. <pre class="example-preformatted">ffmpeg \
  45581. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i dis.obu \
  45582. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i ref.obu \
  45583. -filter_complex &quot;
  45584. [0:v]scale_cuda=format=yuv420p[dis]; \
  45585. [1:v]scale_cuda=format=yuv420p[ref]; \
  45586. [dis][ref]libvmaf_cuda=log_fmt=json:log_path=output.json
  45587. &quot; \
  45588. -f null -
  45589. </pre></div>
  45590. </li></ul>
  45591. <a name="limitdiff"></a>
  45592. <h3 class="section">39.146 limitdiff<span class="pull-right"><a class="anchor hidden-xs" href="#limitdiff" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-limitdiff" aria-hidden="true">TOC</a></span></h3>
  45593. <p>Apply limited difference filter using second and optionally third video stream.
  45594. </p>
  45595. <p>The filter accepts the following options:
  45596. </p>
  45597. <dl class="table">
  45598. <dt><samp class="option">threshold</samp></dt>
  45599. <dd><p>Set the threshold to use when allowing certain differences between video streams.
  45600. Any absolute difference value lower or exact than this threshold will pick pixel components from
  45601. first video stream.
  45602. </p>
  45603. </dd>
  45604. <dt><samp class="option">elasticity</samp></dt>
  45605. <dd><p>Set the elasticity of soft thresholding when processing video streams.
  45606. This value multiplied with first one sets second threshold.
  45607. Any absolute difference value greater or exact than second threshold will pick pixel components
  45608. from second video stream. For values between those two threshold
  45609. linear interpolation between first and second video stream will be used.
  45610. </p>
  45611. </dd>
  45612. <dt><samp class="option">reference</samp></dt>
  45613. <dd><p>Enable the reference (third) video stream processing. By default is disabled.
  45614. If set, this video stream will be used for calculating absolute difference with first video
  45615. stream.
  45616. </p>
  45617. </dd>
  45618. <dt><samp class="option">planes</samp></dt>
  45619. <dd><p>Specify which planes will be processed. Defaults to all available.
  45620. </p></dd>
  45621. </dl>
  45622. <a name="Commands-106"></a>
  45623. <h4 class="subsection">39.146.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-106" aria-hidden="true">TOC</a></span></h4>
  45624. <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;.
  45625. </p>
  45626. <a name="limiter"></a>
  45627. <h3 class="section">39.147 limiter<span class="pull-right"><a class="anchor hidden-xs" href="#limiter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-limiter" aria-hidden="true">TOC</a></span></h3>
  45628. <p>Limits the pixel components values to the specified range [min, max].
  45629. </p>
  45630. <p>The filter accepts the following options:
  45631. </p>
  45632. <dl class="table">
  45633. <dt><samp class="option">min</samp></dt>
  45634. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  45635. </p>
  45636. </dd>
  45637. <dt><samp class="option">max</samp></dt>
  45638. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  45639. </p>
  45640. </dd>
  45641. <dt><samp class="option">planes</samp></dt>
  45642. <dd><p>Specify which planes will be processed. Defaults to all available.
  45643. </p></dd>
  45644. </dl>
  45645. <a name="Commands-107"></a>
  45646. <h4 class="subsection">39.147.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-107" aria-hidden="true">TOC</a></span></h4>
  45647. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  45648. </p>
  45649. <a name="loop"></a>
  45650. <h3 class="section">39.148 loop<span class="pull-right"><a class="anchor hidden-xs" href="#loop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-loop" aria-hidden="true">TOC</a></span></h3>
  45651. <p>Loop video frames.
  45652. </p>
  45653. <p>The filter accepts the following options:
  45654. </p>
  45655. <dl class="table">
  45656. <dt><samp class="option">loop</samp></dt>
  45657. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  45658. Default is 0.
  45659. </p>
  45660. </dd>
  45661. <dt><samp class="option">size</samp></dt>
  45662. <dd><p>Set maximal size in number of frames. Default is 0.
  45663. </p>
  45664. </dd>
  45665. <dt><samp class="option">start</samp></dt>
  45666. <dd><p>Set first frame of loop. Default is 0.
  45667. </p>
  45668. </dd>
  45669. <dt><samp class="option">time</samp></dt>
  45670. <dd><p>Set the time of loop start in seconds.
  45671. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  45672. </p></dd>
  45673. </dl>
  45674. <a name="Examples-139"></a>
  45675. <h4 class="subsection">39.148.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-139" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-139" aria-hidden="true">TOC</a></span></h4>
  45676. <ul class="itemize mark-bullet">
  45677. <li>Loop single first frame infinitely:
  45678. <div class="example">
  45679. <pre class="example-preformatted">loop=loop=-1:size=1:start=0
  45680. </pre></div>
  45681. </li><li>Loop single first frame 10 times:
  45682. <div class="example">
  45683. <pre class="example-preformatted">loop=loop=10:size=1:start=0
  45684. </pre></div>
  45685. </li><li>Loop 10 first frames 5 times:
  45686. <div class="example">
  45687. <pre class="example-preformatted">loop=loop=5:size=10:start=0
  45688. </pre></div>
  45689. </li></ul>
  45690. <a name="lut1d"></a>
  45691. <h3 class="section">39.149 lut1d<span class="pull-right"><a class="anchor hidden-xs" href="#lut1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut1d" aria-hidden="true">TOC</a></span></h3>
  45692. <p>Apply a 1D LUT to an input video.
  45693. </p>
  45694. <p>The filter accepts the following options:
  45695. </p>
  45696. <dl class="table">
  45697. <dt><samp class="option">file</samp></dt>
  45698. <dd><p>Set the 1D LUT file name.
  45699. </p>
  45700. <p>Currently supported formats:
  45701. </p><dl class="table">
  45702. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  45703. <dd><p>Iridas
  45704. </p></dd>
  45705. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  45706. <dd><p>cineSpace
  45707. </p></dd>
  45708. </dl>
  45709. </dd>
  45710. <dt><samp class="option">interp</samp></dt>
  45711. <dd><p>Select interpolation mode.
  45712. </p>
  45713. <p>Available values are:
  45714. </p>
  45715. <dl class="table">
  45716. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  45717. <dd><p>Use values from the nearest defined point.
  45718. </p></dd>
  45719. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  45720. <dd><p>Interpolate values using the linear interpolation.
  45721. </p></dd>
  45722. <dt>&lsquo;<samp class="samp">cosine</samp>&rsquo;</dt>
  45723. <dd><p>Interpolate values using the cosine interpolation.
  45724. </p></dd>
  45725. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  45726. <dd><p>Interpolate values using the cubic interpolation.
  45727. </p></dd>
  45728. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  45729. <dd><p>Interpolate values using the spline interpolation.
  45730. </p></dd>
  45731. </dl>
  45732. </dd>
  45733. </dl>
  45734. <a name="Commands-108"></a>
  45735. <h4 class="subsection">39.149.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-108" aria-hidden="true">TOC</a></span></h4>
  45736. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  45737. </p>
  45738. <a class="anchor" id="lut3d"></a><a name="lut3d-1"></a>
  45739. <h3 class="section">39.150 lut3d<span class="pull-right"><a class="anchor hidden-xs" href="#lut3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut3d-1" aria-hidden="true">TOC</a></span></h3>
  45740. <p>Apply a 3D LUT to an input video.
  45741. </p>
  45742. <p>The filter accepts the following options:
  45743. </p>
  45744. <dl class="table">
  45745. <dt><samp class="option">file</samp></dt>
  45746. <dd><p>Set the 3D LUT file name.
  45747. </p>
  45748. <p>Currently supported formats:
  45749. </p><dl class="table">
  45750. <dt>&lsquo;<samp class="samp">3dl</samp>&rsquo;</dt>
  45751. <dd><p>AfterEffects
  45752. </p></dd>
  45753. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  45754. <dd><p>Iridas
  45755. </p></dd>
  45756. <dt>&lsquo;<samp class="samp">dat</samp>&rsquo;</dt>
  45757. <dd><p>DaVinci
  45758. </p></dd>
  45759. <dt>&lsquo;<samp class="samp">m3d</samp>&rsquo;</dt>
  45760. <dd><p>Pandora
  45761. </p></dd>
  45762. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  45763. <dd><p>cineSpace
  45764. </p></dd>
  45765. </dl>
  45766. </dd>
  45767. <dt><samp class="option">interp</samp></dt>
  45768. <dd><p>Select interpolation mode.
  45769. </p>
  45770. <p>Available values are:
  45771. </p>
  45772. <dl class="table">
  45773. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  45774. <dd><p>Use values from the nearest defined point.
  45775. </p></dd>
  45776. <dt>&lsquo;<samp class="samp">trilinear</samp>&rsquo;</dt>
  45777. <dd><p>Interpolate values using the 8 points defining a cube.
  45778. </p></dd>
  45779. <dt>&lsquo;<samp class="samp">tetrahedral</samp>&rsquo;</dt>
  45780. <dd><p>Interpolate values using a tetrahedron.
  45781. </p></dd>
  45782. <dt>&lsquo;<samp class="samp">pyramid</samp>&rsquo;</dt>
  45783. <dd><p>Interpolate values using a pyramid.
  45784. </p></dd>
  45785. <dt>&lsquo;<samp class="samp">prism</samp>&rsquo;</dt>
  45786. <dd><p>Interpolate values using a prism.
  45787. </p></dd>
  45788. </dl>
  45789. </dd>
  45790. </dl>
  45791. <a name="Commands-109"></a>
  45792. <h4 class="subsection">39.150.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-109" aria-hidden="true">TOC</a></span></h4>
  45793. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  45794. </p>
  45795. <a name="lumakey"></a>
  45796. <h3 class="section">39.151 lumakey<span class="pull-right"><a class="anchor hidden-xs" href="#lumakey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lumakey" aria-hidden="true">TOC</a></span></h3>
  45797. <p>Turn certain luma values into transparency.
  45798. </p>
  45799. <p>The filter accepts the following options:
  45800. </p>
  45801. <dl class="table">
  45802. <dt><samp class="option">threshold</samp></dt>
  45803. <dd><p>Set the luma which will be used as base for transparency.
  45804. Default value is <code class="code">0</code>.
  45805. </p>
  45806. </dd>
  45807. <dt><samp class="option">tolerance</samp></dt>
  45808. <dd><p>Set the range of luma values to be keyed out.
  45809. Default value is <code class="code">0.01</code>.
  45810. </p>
  45811. </dd>
  45812. <dt><samp class="option">softness</samp></dt>
  45813. <dd><p>Set the range of softness. Default value is <code class="code">0</code>.
  45814. Use this to control gradual transition from zero to full transparency.
  45815. </p></dd>
  45816. </dl>
  45817. <a name="Commands-110"></a>
  45818. <h4 class="subsection">39.151.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-110" aria-hidden="true">TOC</a></span></h4>
  45819. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  45820. The command accepts the same syntax of the corresponding option.
  45821. </p>
  45822. <p>If the specified expression is not valid, it is kept at its current
  45823. value.
  45824. </p>
  45825. <a class="anchor" id="lutrgb"></a><a class="anchor" id="lutyuv"></a><a class="anchor" id="lut"></a><a name="lut_002c-lutrgb_002c-lutyuv"></a>
  45826. <h3 class="section">39.152 lut, lutrgb, lutyuv<span class="pull-right"><a class="anchor hidden-xs" href="#lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">TOC</a></span></h3>
  45827. <p>Compute a look-up table for binding each pixel component input value
  45828. to an output value, and apply it to the input video.
  45829. </p>
  45830. <p><var class="var">lutyuv</var> applies a lookup table to a YUV input video, <var class="var">lutrgb</var>
  45831. to an RGB input video.
  45832. </p>
  45833. <p>These filters accept the following parameters:
  45834. </p><dl class="table">
  45835. <dt><samp class="option">c0</samp></dt>
  45836. <dd><p>set first pixel component expression
  45837. </p></dd>
  45838. <dt><samp class="option">c1</samp></dt>
  45839. <dd><p>set second pixel component expression
  45840. </p></dd>
  45841. <dt><samp class="option">c2</samp></dt>
  45842. <dd><p>set third pixel component expression
  45843. </p></dd>
  45844. <dt><samp class="option">c3</samp></dt>
  45845. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  45846. </p>
  45847. </dd>
  45848. <dt><samp class="option">r</samp></dt>
  45849. <dd><p>set red component expression
  45850. </p></dd>
  45851. <dt><samp class="option">g</samp></dt>
  45852. <dd><p>set green component expression
  45853. </p></dd>
  45854. <dt><samp class="option">b</samp></dt>
  45855. <dd><p>set blue component expression
  45856. </p></dd>
  45857. <dt><samp class="option">a</samp></dt>
  45858. <dd><p>alpha component expression
  45859. </p>
  45860. </dd>
  45861. <dt><samp class="option">y</samp></dt>
  45862. <dd><p>set Y/luma component expression
  45863. </p></dd>
  45864. <dt><samp class="option">u</samp></dt>
  45865. <dd><p>set U/Cb component expression
  45866. </p></dd>
  45867. <dt><samp class="option">v</samp></dt>
  45868. <dd><p>set V/Cr component expression
  45869. </p></dd>
  45870. </dl>
  45871. <p>Each of them specifies the expression to use for computing the lookup table for
  45872. the corresponding pixel component values.
  45873. </p>
  45874. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  45875. format in input.
  45876. </p>
  45877. <p>The <var class="var">lut</var> filter requires either YUV or RGB pixel formats in input,
  45878. <var class="var">lutrgb</var> requires RGB pixel formats in input, and <var class="var">lutyuv</var> requires YUV.
  45879. </p>
  45880. <p>The expressions can contain the following constants and functions:
  45881. </p>
  45882. <dl class="table">
  45883. <dt><samp class="option">w</samp></dt>
  45884. <dt><samp class="option">h</samp></dt>
  45885. <dd><p>The input width and height.
  45886. </p>
  45887. </dd>
  45888. <dt><samp class="option">val</samp></dt>
  45889. <dd><p>The input value for the pixel component.
  45890. </p>
  45891. </dd>
  45892. <dt><samp class="option">clipval</samp></dt>
  45893. <dd><p>The input value, clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range.
  45894. </p>
  45895. </dd>
  45896. <dt><samp class="option">maxval</samp></dt>
  45897. <dd><p>The maximum value for the pixel component.
  45898. </p>
  45899. </dd>
  45900. <dt><samp class="option">minval</samp></dt>
  45901. <dd><p>The minimum value for the pixel component.
  45902. </p>
  45903. </dd>
  45904. <dt><samp class="option">negval</samp></dt>
  45905. <dd><p>The negated value for the pixel component value, clipped to the
  45906. <var class="var">minval</var>-<var class="var">maxval</var> range; it corresponds to the expression
  45907. &quot;maxval-clipval+minval&quot;.
  45908. </p>
  45909. </dd>
  45910. <dt><samp class="option">clip(val)</samp></dt>
  45911. <dd><p>The computed value in <var class="var">val</var>, clipped to the
  45912. <var class="var">minval</var>-<var class="var">maxval</var> range.
  45913. </p>
  45914. </dd>
  45915. <dt><samp class="option">gammaval(gamma)</samp></dt>
  45916. <dd><p>The computed gamma correction value of the pixel component value,
  45917. clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range. It corresponds to the
  45918. expression
  45919. &quot;pow((clipval-minval)/(maxval-minval)\,<var class="var">gamma</var>)*(maxval-minval)+minval&quot;
  45920. </p>
  45921. </dd>
  45922. </dl>
  45923. <p>All expressions default to &quot;clipval&quot;.
  45924. </p>
  45925. <a name="Commands-111"></a>
  45926. <h4 class="subsection">39.152.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-111" aria-hidden="true">TOC</a></span></h4>
  45927. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  45928. </p>
  45929. <a name="Examples-140"></a>
  45930. <h4 class="subsection">39.152.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-140" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-140" aria-hidden="true">TOC</a></span></h4>
  45931. <ul class="itemize mark-bullet">
  45932. <li>Negate input video:
  45933. <div class="example">
  45934. <pre class="example-preformatted">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  45935. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  45936. </pre></div>
  45937. <p>The above is the same as:
  45938. </p><div class="example">
  45939. <pre class="example-preformatted">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  45940. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  45941. </pre></div>
  45942. </li><li>Negate luma:
  45943. <div class="example">
  45944. <pre class="example-preformatted">lutyuv=y=negval
  45945. </pre></div>
  45946. </li><li>Remove chroma components, turning the video into a graytone image:
  45947. <div class="example">
  45948. <pre class="example-preformatted">lutyuv=&quot;u=128:v=128&quot;
  45949. </pre></div>
  45950. </li><li>Apply a luma burning effect:
  45951. <div class="example">
  45952. <pre class="example-preformatted">lutyuv=&quot;y=2*val&quot;
  45953. </pre></div>
  45954. </li><li>Remove green and blue components:
  45955. <div class="example">
  45956. <pre class="example-preformatted">lutrgb=&quot;g=0:b=0&quot;
  45957. </pre></div>
  45958. </li><li>Set a constant alpha channel value on input:
  45959. <div class="example">
  45960. <pre class="example-preformatted">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  45961. </pre></div>
  45962. </li><li>Correct luma gamma by a factor of 0.5:
  45963. <div class="example">
  45964. <pre class="example-preformatted">lutyuv=y=gammaval(0.5)
  45965. </pre></div>
  45966. </li><li>Discard least significant bits of luma:
  45967. <div class="example">
  45968. <pre class="example-preformatted">lutyuv=y='bitand(val, 128+64+32)'
  45969. </pre></div>
  45970. </li><li>Technicolor like effect:
  45971. <div class="example">
  45972. <pre class="example-preformatted">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  45973. </pre></div>
  45974. </li></ul>
  45975. <a name="lut2_002c-tlut2"></a>
  45976. <h3 class="section">39.153 lut2, tlut2<span class="pull-right"><a class="anchor hidden-xs" href="#lut2_002c-tlut2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut2_002c-tlut2" aria-hidden="true">TOC</a></span></h3>
  45977. <p>The <code class="code">lut2</code> filter takes two input streams and outputs one
  45978. stream.
  45979. </p>
  45980. <p>The <code class="code">tlut2</code> (time lut2) filter takes two consecutive frames
  45981. from one single stream.
  45982. </p>
  45983. <p>This filter accepts the following parameters:
  45984. </p><dl class="table">
  45985. <dt><samp class="option">c0</samp></dt>
  45986. <dd><p>set first pixel component expression
  45987. </p></dd>
  45988. <dt><samp class="option">c1</samp></dt>
  45989. <dd><p>set second pixel component expression
  45990. </p></dd>
  45991. <dt><samp class="option">c2</samp></dt>
  45992. <dd><p>set third pixel component expression
  45993. </p></dd>
  45994. <dt><samp class="option">c3</samp></dt>
  45995. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  45996. </p>
  45997. </dd>
  45998. <dt><samp class="option">d</samp></dt>
  45999. <dd><p>set output bit depth, only available for <code class="code">lut2</code> filter. By default is 0,
  46000. which means bit depth is automatically picked from first input format.
  46001. </p></dd>
  46002. </dl>
  46003. <p>The <code class="code">lut2</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  46004. </p>
  46005. <p>Each of them specifies the expression to use for computing the lookup table for
  46006. the corresponding pixel component values.
  46007. </p>
  46008. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  46009. format in inputs.
  46010. </p>
  46011. <p>The expressions can contain the following constants:
  46012. </p>
  46013. <dl class="table">
  46014. <dt><samp class="option">w</samp></dt>
  46015. <dt><samp class="option">h</samp></dt>
  46016. <dd><p>The input width and height.
  46017. </p>
  46018. </dd>
  46019. <dt><samp class="option">x</samp></dt>
  46020. <dd><p>The first input value for the pixel component.
  46021. </p>
  46022. </dd>
  46023. <dt><samp class="option">y</samp></dt>
  46024. <dd><p>The second input value for the pixel component.
  46025. </p>
  46026. </dd>
  46027. <dt><samp class="option">bdx</samp></dt>
  46028. <dd><p>The first input video bit depth.
  46029. </p>
  46030. </dd>
  46031. <dt><samp class="option">bdy</samp></dt>
  46032. <dd><p>The second input video bit depth.
  46033. </p></dd>
  46034. </dl>
  46035. <p>All expressions default to &quot;x&quot;.
  46036. </p>
  46037. <a name="Commands-112"></a>
  46038. <h4 class="subsection">39.153.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-112" aria-hidden="true">TOC</a></span></h4>
  46039. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a> except option <code class="code">d</code>.
  46040. </p>
  46041. <a name="Examples-141"></a>
  46042. <h4 class="subsection">39.153.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-141" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-141" aria-hidden="true">TOC</a></span></h4>
  46043. <ul class="itemize mark-bullet">
  46044. <li>Highlight differences between two RGB video streams:
  46045. <div class="example">
  46046. <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)'
  46047. </pre></div>
  46048. </li><li>Highlight differences between two YUV video streams:
  46049. <div class="example">
  46050. <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)'
  46051. </pre></div>
  46052. </li><li>Show max difference between two video streams:
  46053. <div class="example">
  46054. <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)))'
  46055. </pre></div>
  46056. </li></ul>
  46057. <a name="maskedclamp"></a>
  46058. <h3 class="section">39.154 maskedclamp<span class="pull-right"><a class="anchor hidden-xs" href="#maskedclamp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedclamp" aria-hidden="true">TOC</a></span></h3>
  46059. <p>Clamp the first input stream with the second input and third input stream.
  46060. </p>
  46061. <p>Returns the value of first stream to be between second input
  46062. stream - <code class="code">undershoot</code> and third input stream + <code class="code">overshoot</code>.
  46063. </p>
  46064. <p>This filter accepts the following options:
  46065. </p><dl class="table">
  46066. <dt><samp class="option">undershoot</samp></dt>
  46067. <dd><p>Default value is <code class="code">0</code>.
  46068. </p>
  46069. </dd>
  46070. <dt><samp class="option">overshoot</samp></dt>
  46071. <dd><p>Default value is <code class="code">0</code>.
  46072. </p>
  46073. </dd>
  46074. <dt><samp class="option">planes</samp></dt>
  46075. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  46076. copied from first stream.
  46077. By default value 0xf, all planes will be processed.
  46078. </p></dd>
  46079. </dl>
  46080. <a name="Commands-113"></a>
  46081. <h4 class="subsection">39.154.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-113" aria-hidden="true">TOC</a></span></h4>
  46082. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46083. </p>
  46084. <a name="maskedmax"></a>
  46085. <h3 class="section">39.155 maskedmax<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmax" aria-hidden="true">TOC</a></span></h3>
  46086. <p>Merge the second and third input stream into output stream using absolute differences
  46087. between second input stream and first input stream and absolute difference between
  46088. third input stream and first input stream. The picked value will be from second input
  46089. stream if second absolute difference is greater than first one or from third input stream
  46090. otherwise.
  46091. </p>
  46092. <p>This filter accepts the following options:
  46093. </p><dl class="table">
  46094. <dt><samp class="option">planes</samp></dt>
  46095. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  46096. copied from first stream.
  46097. By default value 0xf, all planes will be processed.
  46098. </p></dd>
  46099. </dl>
  46100. <a name="Commands-114"></a>
  46101. <h4 class="subsection">39.155.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-114" aria-hidden="true">TOC</a></span></h4>
  46102. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46103. </p>
  46104. <a name="maskedmerge"></a>
  46105. <h3 class="section">39.156 maskedmerge<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmerge" aria-hidden="true">TOC</a></span></h3>
  46106. <p>Merge the first input stream with the second input stream using per pixel
  46107. weights in the third input stream.
  46108. </p>
  46109. <p>A value of 0 in the third stream pixel component means that pixel component
  46110. from first stream is returned unchanged, while maximum value (eg. 255 for
  46111. 8-bit videos) means that pixel component from second stream is returned
  46112. unchanged. Intermediate values define the amount of merging between both
  46113. input stream&rsquo;s pixel components.
  46114. </p>
  46115. <p>This filter accepts the following options:
  46116. </p><dl class="table">
  46117. <dt><samp class="option">planes</samp></dt>
  46118. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  46119. copied from first stream.
  46120. By default value 0xf, all planes will be processed.
  46121. </p></dd>
  46122. </dl>
  46123. <a name="Commands-115"></a>
  46124. <h4 class="subsection">39.156.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-115" aria-hidden="true">TOC</a></span></h4>
  46125. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46126. </p>
  46127. <a name="maskedmin"></a>
  46128. <h3 class="section">39.157 maskedmin<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmin" aria-hidden="true">TOC</a></span></h3>
  46129. <p>Merge the second and third input stream into output stream using absolute differences
  46130. between second input stream and first input stream and absolute difference between
  46131. third input stream and first input stream. The picked value will be from second input
  46132. stream if second absolute difference is less than first one or from third input stream
  46133. otherwise.
  46134. </p>
  46135. <p>This filter accepts the following options:
  46136. </p><dl class="table">
  46137. <dt><samp class="option">planes</samp></dt>
  46138. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  46139. copied from first stream.
  46140. By default value 0xf, all planes will be processed.
  46141. </p></dd>
  46142. </dl>
  46143. <a name="Commands-116"></a>
  46144. <h4 class="subsection">39.157.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-116" aria-hidden="true">TOC</a></span></h4>
  46145. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46146. </p>
  46147. <a name="maskedthreshold"></a>
  46148. <h3 class="section">39.158 maskedthreshold<span class="pull-right"><a class="anchor hidden-xs" href="#maskedthreshold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedthreshold" aria-hidden="true">TOC</a></span></h3>
  46149. <p>Pick pixels comparing absolute difference of two video streams with fixed
  46150. threshold.
  46151. </p>
  46152. <p>If absolute difference between pixel component of first and second video
  46153. stream is equal or lower than user supplied threshold than pixel component
  46154. from first video stream is picked, otherwise pixel component from second
  46155. video stream is picked.
  46156. </p>
  46157. <p>This filter accepts the following options:
  46158. </p><dl class="table">
  46159. <dt><samp class="option">threshold</samp></dt>
  46160. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  46161. video streams.
  46162. </p>
  46163. </dd>
  46164. <dt><samp class="option">planes</samp></dt>
  46165. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  46166. copied from second stream.
  46167. By default value 0xf, all planes will be processed.
  46168. </p>
  46169. </dd>
  46170. <dt><samp class="option">mode</samp></dt>
  46171. <dd><p>Set mode of filter operation. Can be <code class="code">abs</code> or <code class="code">diff</code>.
  46172. Default is <code class="code">abs</code>.
  46173. </p></dd>
  46174. </dl>
  46175. <a name="Commands-117"></a>
  46176. <h4 class="subsection">39.158.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-117" aria-hidden="true">TOC</a></span></h4>
  46177. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46178. </p>
  46179. <a name="maskfun"></a>
  46180. <h3 class="section">39.159 maskfun<span class="pull-right"><a class="anchor hidden-xs" href="#maskfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskfun" aria-hidden="true">TOC</a></span></h3>
  46181. <p>Create mask from input video.
  46182. </p>
  46183. <p>For example it is useful to create motion masks after <code class="code">tblend</code> filter.
  46184. </p>
  46185. <p>This filter accepts the following options:
  46186. </p>
  46187. <dl class="table">
  46188. <dt><samp class="option">low</samp></dt>
  46189. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  46190. </p>
  46191. </dd>
  46192. <dt><samp class="option">high</samp></dt>
  46193. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  46194. allowed for current pixel format.
  46195. </p>
  46196. </dd>
  46197. <dt><samp class="option">planes</samp></dt>
  46198. <dd><p>Set planes to filter, by default all available planes are filtered.
  46199. </p>
  46200. </dd>
  46201. <dt><samp class="option">fill</samp></dt>
  46202. <dd><p>Fill all frame pixels with this value.
  46203. </p>
  46204. </dd>
  46205. <dt><samp class="option">sum</samp></dt>
  46206. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  46207. average, output frame will be completely filled with value set by <var class="var">fill</var> option.
  46208. Typically useful for scene changes when used in combination with <code class="code">tblend</code> filter.
  46209. </p></dd>
  46210. </dl>
  46211. <a name="Commands-118"></a>
  46212. <h4 class="subsection">39.159.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-118" aria-hidden="true">TOC</a></span></h4>
  46213. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46214. </p>
  46215. <a name="mcdeint"></a>
  46216. <h3 class="section">39.160 mcdeint<span class="pull-right"><a class="anchor hidden-xs" href="#mcdeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcdeint" aria-hidden="true">TOC</a></span></h3>
  46217. <p>Apply motion-compensation deinterlacing.
  46218. </p>
  46219. <p>It needs one field per frame as input and must thus be used together
  46220. with yadif=1/3 or equivalent.
  46221. </p>
  46222. <p>This filter accepts the following options:
  46223. </p><dl class="table">
  46224. <dt><samp class="option">mode</samp></dt>
  46225. <dd><p>Set the deinterlacing mode.
  46226. </p>
  46227. <p>It accepts one of the following values:
  46228. </p><dl class="table">
  46229. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  46230. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  46231. <dt>&lsquo;<samp class="samp">slow</samp>&rsquo;</dt>
  46232. <dd><p>use iterative motion estimation
  46233. </p></dd>
  46234. <dt>&lsquo;<samp class="samp">extra_slow</samp>&rsquo;</dt>
  46235. <dd><p>like &lsquo;<samp class="samp">slow</samp>&rsquo;, but use multiple reference frames.
  46236. </p></dd>
  46237. </dl>
  46238. <p>Default value is &lsquo;<samp class="samp">fast</samp>&rsquo;.
  46239. </p>
  46240. </dd>
  46241. <dt><samp class="option">parity</samp></dt>
  46242. <dd><p>Set the picture field parity assumed for the input video. It must be
  46243. one of the following values:
  46244. </p>
  46245. <dl class="table">
  46246. <dt>&lsquo;<samp class="samp">0, tff</samp>&rsquo;</dt>
  46247. <dd><p>assume top field first
  46248. </p></dd>
  46249. <dt>&lsquo;<samp class="samp">1, bff</samp>&rsquo;</dt>
  46250. <dd><p>assume bottom field first
  46251. </p></dd>
  46252. </dl>
  46253. <p>Default value is &lsquo;<samp class="samp">bff</samp>&rsquo;.
  46254. </p>
  46255. </dd>
  46256. <dt><samp class="option">qp</samp></dt>
  46257. <dd><p>Set per-block quantization parameter (QP) used by the internal
  46258. encoder.
  46259. </p>
  46260. <p>Higher values should result in a smoother motion vector field but less
  46261. optimal individual vectors. Default value is 1.
  46262. </p></dd>
  46263. </dl>
  46264. <a name="median"></a>
  46265. <h3 class="section">39.161 median<span class="pull-right"><a class="anchor hidden-xs" href="#median" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-median" aria-hidden="true">TOC</a></span></h3>
  46266. <p>Pick median pixel from certain rectangle defined by radius.
  46267. </p>
  46268. <p>This filter accepts the following options:
  46269. </p>
  46270. <dl class="table">
  46271. <dt><samp class="option">radius</samp></dt>
  46272. <dd><p>Set horizontal radius size. Default value is <code class="code">1</code>.
  46273. Allowed range is integer from 1 to 127.
  46274. </p>
  46275. </dd>
  46276. <dt><samp class="option">planes</samp></dt>
  46277. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  46278. </p>
  46279. </dd>
  46280. <dt><samp class="option">radiusV</samp></dt>
  46281. <dd><p>Set vertical radius size. Default value is <code class="code">0</code>.
  46282. Allowed range is integer from 0 to 127.
  46283. If it is 0, value will be picked from horizontal <code class="code">radius</code> option.
  46284. </p>
  46285. </dd>
  46286. <dt><samp class="option">percentile</samp></dt>
  46287. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  46288. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  46289. minimum values, and <code class="code">1</code> maximum values.
  46290. </p></dd>
  46291. </dl>
  46292. <a name="Commands-119"></a>
  46293. <h4 class="subsection">39.161.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-119" aria-hidden="true">TOC</a></span></h4>
  46294. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  46295. The command accepts the same syntax of the corresponding option.
  46296. </p>
  46297. <p>If the specified expression is not valid, it is kept at its current
  46298. value.
  46299. </p>
  46300. <a name="mergeplanes"></a>
  46301. <h3 class="section">39.162 mergeplanes<span class="pull-right"><a class="anchor hidden-xs" href="#mergeplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mergeplanes" aria-hidden="true">TOC</a></span></h3>
  46302. <p>Merge color channel components from several video streams.
  46303. </p>
  46304. <p>The filter accepts up to 4 input streams, and merge selected input
  46305. planes to the output video.
  46306. </p>
  46307. <p>This filter accepts the following options:
  46308. </p><dl class="table">
  46309. <dt><samp class="option">mapping</samp></dt>
  46310. <dd><p>Set input to output plane mapping. Default is <code class="code">0</code>.
  46311. </p>
  46312. <p>The mappings is specified as a bitmap. It should be specified as a
  46313. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  46314. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  46315. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  46316. corresponding input to use (from 0 to 3). The rest of the mappings is
  46317. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  46318. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  46319. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  46320. </p>
  46321. </dd>
  46322. <dt><samp class="option">format</samp></dt>
  46323. <dd><p>Set output pixel format. Default is <code class="code">yuva444p</code>.
  46324. </p>
  46325. </dd>
  46326. <dt><samp class="option">map0s</samp></dt>
  46327. <dt><samp class="option">map1s</samp></dt>
  46328. <dt><samp class="option">map2s</samp></dt>
  46329. <dt><samp class="option">map3s</samp></dt>
  46330. <dd><p>Set input to output stream mapping for output Nth plane. Default is <code class="code">0</code>.
  46331. </p>
  46332. </dd>
  46333. <dt><samp class="option">map0p</samp></dt>
  46334. <dt><samp class="option">map1p</samp></dt>
  46335. <dt><samp class="option">map2p</samp></dt>
  46336. <dt><samp class="option">map3p</samp></dt>
  46337. <dd><p>Set input to output plane mapping for output Nth plane. Default is <code class="code">0</code>.
  46338. </p></dd>
  46339. </dl>
  46340. <a name="Examples-142"></a>
  46341. <h4 class="subsection">39.162.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-142" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-142" aria-hidden="true">TOC</a></span></h4>
  46342. <ul class="itemize mark-bullet">
  46343. <li>Merge three gray video streams of same width and height into single video stream:
  46344. <div class="example">
  46345. <pre class="example-preformatted">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  46346. </pre></div>
  46347. </li><li>Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  46348. <div class="example">
  46349. <pre class="example-preformatted">[a0][a1]mergeplanes=0x00010210:yuva444p
  46350. </pre></div>
  46351. </li><li>Swap Y and A plane in yuva444p stream:
  46352. <div class="example">
  46353. <pre class="example-preformatted">format=yuva444p,mergeplanes=0x03010200:yuva444p
  46354. </pre></div>
  46355. </li><li>Swap U and V plane in yuv420p stream:
  46356. <div class="example">
  46357. <pre class="example-preformatted">format=yuv420p,mergeplanes=0x000201:yuv420p
  46358. </pre></div>
  46359. </li><li>Cast a rgb24 clip to yuv444p:
  46360. <div class="example">
  46361. <pre class="example-preformatted">format=rgb24,mergeplanes=0x000102:yuv444p
  46362. </pre></div>
  46363. </li></ul>
  46364. <a name="mestimate"></a>
  46365. <h3 class="section">39.163 mestimate<span class="pull-right"><a class="anchor hidden-xs" href="#mestimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mestimate" aria-hidden="true">TOC</a></span></h3>
  46366. <p>Estimate and export motion vectors using block matching algorithms.
  46367. Motion vectors are stored in frame side data to be used by other filters.
  46368. </p>
  46369. <p>This filter accepts the following options:
  46370. </p><dl class="table">
  46371. <dt><samp class="option">method</samp></dt>
  46372. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  46373. </p>
  46374. <dl class="table">
  46375. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  46376. <dd><p>Exhaustive search algorithm.
  46377. </p></dd>
  46378. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  46379. <dd><p>Three step search algorithm.
  46380. </p></dd>
  46381. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  46382. <dd><p>Two dimensional logarithmic search algorithm.
  46383. </p></dd>
  46384. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  46385. <dd><p>New three step search algorithm.
  46386. </p></dd>
  46387. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  46388. <dd><p>Four step search algorithm.
  46389. </p></dd>
  46390. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  46391. <dd><p>Diamond search algorithm.
  46392. </p></dd>
  46393. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  46394. <dd><p>Hexagon-based search algorithm.
  46395. </p></dd>
  46396. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  46397. <dd><p>Enhanced predictive zonal search algorithm.
  46398. </p></dd>
  46399. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  46400. <dd><p>Uneven multi-hexagon search algorithm.
  46401. </p></dd>
  46402. </dl>
  46403. <p>Default value is &lsquo;<samp class="samp">esa</samp>&rsquo;.
  46404. </p>
  46405. </dd>
  46406. <dt><samp class="option">mb_size</samp></dt>
  46407. <dd><p>Macroblock size. Default <code class="code">16</code>.
  46408. </p>
  46409. </dd>
  46410. <dt><samp class="option">search_param</samp></dt>
  46411. <dd><p>Search parameter. Default <code class="code">7</code>.
  46412. </p></dd>
  46413. </dl>
  46414. <a name="midequalizer"></a>
  46415. <h3 class="section">39.164 midequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#midequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-midequalizer" aria-hidden="true">TOC</a></span></h3>
  46416. <p>Apply Midway Image Equalization effect using two video streams.
  46417. </p>
  46418. <p>Midway Image Equalization adjusts a pair of images to have the same
  46419. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  46420. useful for e.g. matching exposures from a pair of stereo cameras.
  46421. </p>
  46422. <p>This filter has two inputs and one output, which must be of same pixel format, but
  46423. may be of different sizes. The output of filter is first input adjusted with
  46424. midway histogram of both inputs.
  46425. </p>
  46426. <p>This filter accepts the following option:
  46427. </p>
  46428. <dl class="table">
  46429. <dt><samp class="option">planes</samp></dt>
  46430. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  46431. </p></dd>
  46432. </dl>
  46433. <a name="minterpolate"></a>
  46434. <h3 class="section">39.165 minterpolate<span class="pull-right"><a class="anchor hidden-xs" href="#minterpolate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-minterpolate" aria-hidden="true">TOC</a></span></h3>
  46435. <p>Convert the video to specified frame rate using motion interpolation.
  46436. </p>
  46437. <p>This filter accepts the following options:
  46438. </p><dl class="table">
  46439. <dt><samp class="option">fps</samp></dt>
  46440. <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>.
  46441. </p>
  46442. </dd>
  46443. <dt><samp class="option">mi_mode</samp></dt>
  46444. <dd><p>Motion interpolation mode. Following values are accepted:
  46445. </p><dl class="table">
  46446. <dt>&lsquo;<samp class="samp">dup</samp>&rsquo;</dt>
  46447. <dd><p>Duplicate previous or next frame for interpolating new ones.
  46448. </p></dd>
  46449. <dt>&lsquo;<samp class="samp">blend</samp>&rsquo;</dt>
  46450. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  46451. </p></dd>
  46452. <dt>&lsquo;<samp class="samp">mci</samp>&rsquo;</dt>
  46453. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  46454. </p>
  46455. <dl class="table">
  46456. <dt>&lsquo;<samp class="samp">mc_mode</samp>&rsquo;</dt>
  46457. <dd><p>Motion compensation mode. Following values are accepted:
  46458. </p><dl class="table">
  46459. <dt>&lsquo;<samp class="samp">obmc</samp>&rsquo;</dt>
  46460. <dd><p>Overlapped block motion compensation.
  46461. </p></dd>
  46462. <dt>&lsquo;<samp class="samp">aobmc</samp>&rsquo;</dt>
  46463. <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.
  46464. </p></dd>
  46465. </dl>
  46466. <p>Default mode is &lsquo;<samp class="samp">obmc</samp>&rsquo;.
  46467. </p>
  46468. </dd>
  46469. <dt>&lsquo;<samp class="samp">me_mode</samp>&rsquo;</dt>
  46470. <dd><p>Motion estimation mode. Following values are accepted:
  46471. </p><dl class="table">
  46472. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  46473. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  46474. </p></dd>
  46475. <dt>&lsquo;<samp class="samp">bilat</samp>&rsquo;</dt>
  46476. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  46477. </p></dd>
  46478. </dl>
  46479. <p>Default mode is &lsquo;<samp class="samp">bilat</samp>&rsquo;.
  46480. </p>
  46481. </dd>
  46482. <dt>&lsquo;<samp class="samp">me</samp>&rsquo;</dt>
  46483. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  46484. </p><dl class="table">
  46485. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  46486. <dd><p>Exhaustive search algorithm.
  46487. </p></dd>
  46488. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  46489. <dd><p>Three step search algorithm.
  46490. </p></dd>
  46491. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  46492. <dd><p>Two dimensional logarithmic search algorithm.
  46493. </p></dd>
  46494. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  46495. <dd><p>New three step search algorithm.
  46496. </p></dd>
  46497. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  46498. <dd><p>Four step search algorithm.
  46499. </p></dd>
  46500. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  46501. <dd><p>Diamond search algorithm.
  46502. </p></dd>
  46503. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  46504. <dd><p>Hexagon-based search algorithm.
  46505. </p></dd>
  46506. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  46507. <dd><p>Enhanced predictive zonal search algorithm.
  46508. </p></dd>
  46509. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  46510. <dd><p>Uneven multi-hexagon search algorithm.
  46511. </p></dd>
  46512. </dl>
  46513. <p>Default algorithm is &lsquo;<samp class="samp">epzs</samp>&rsquo;.
  46514. </p>
  46515. </dd>
  46516. <dt>&lsquo;<samp class="samp">mb_size</samp>&rsquo;</dt>
  46517. <dd><p>Macroblock size. Default <code class="code">16</code>.
  46518. </p>
  46519. </dd>
  46520. <dt>&lsquo;<samp class="samp">search_param</samp>&rsquo;</dt>
  46521. <dd><p>Motion estimation search parameter. Default <code class="code">32</code>.
  46522. </p>
  46523. </dd>
  46524. <dt>&lsquo;<samp class="samp">vsbmc</samp>&rsquo;</dt>
  46525. <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).
  46526. </p></dd>
  46527. </dl>
  46528. </dd>
  46529. </dl>
  46530. </dd>
  46531. <dt><samp class="option">scd</samp></dt>
  46532. <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:
  46533. </p><dl class="table">
  46534. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  46535. <dd><p>Disable scene change detection.
  46536. </p></dd>
  46537. <dt>&lsquo;<samp class="samp">fdiff</samp>&rsquo;</dt>
  46538. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var class="var">scd_threshold</var> scene change is detected.
  46539. </p></dd>
  46540. </dl>
  46541. <p>Default method is &lsquo;<samp class="samp">fdiff</samp>&rsquo;.
  46542. </p>
  46543. </dd>
  46544. <dt><samp class="option">scd_threshold</samp></dt>
  46545. <dd><p>Scene change detection threshold. Default is <code class="code">10.</code>.
  46546. </p></dd>
  46547. </dl>
  46548. <a name="mix"></a>
  46549. <h3 class="section">39.166 mix<span class="pull-right"><a class="anchor hidden-xs" href="#mix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mix" aria-hidden="true">TOC</a></span></h3>
  46550. <p>Mix several video input streams into one video stream.
  46551. </p>
  46552. <p>A description of the accepted options follows.
  46553. </p>
  46554. <dl class="table">
  46555. <dt><samp class="option">inputs</samp></dt>
  46556. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  46557. </p>
  46558. </dd>
  46559. <dt><samp class="option">weights</samp></dt>
  46560. <dd><p>Specify weight of each input video stream as sequence.
  46561. Each weight is separated by space. If number of weights
  46562. is smaller than number of <var class="var">frames</var> last specified
  46563. weight will be used for all remaining unset weights.
  46564. </p>
  46565. </dd>
  46566. <dt><samp class="option">scale</samp></dt>
  46567. <dd><p>Specify scale, if it is set it will be multiplied with sum
  46568. of each weight multiplied with pixel values to give final destination
  46569. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  46570. </p>
  46571. </dd>
  46572. <dt><samp class="option">planes</samp></dt>
  46573. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  46574. </p>
  46575. </dd>
  46576. <dt><samp class="option">duration</samp></dt>
  46577. <dd><p>Specify how end of stream is determined.
  46578. </p><dl class="table">
  46579. <dt>&lsquo;<samp class="samp">longest</samp>&rsquo;</dt>
  46580. <dd><p>The duration of the longest input. (default)
  46581. </p>
  46582. </dd>
  46583. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  46584. <dd><p>The duration of the shortest input.
  46585. </p>
  46586. </dd>
  46587. <dt>&lsquo;<samp class="samp">first</samp>&rsquo;</dt>
  46588. <dd><p>The duration of the first input.
  46589. </p></dd>
  46590. </dl>
  46591. </dd>
  46592. </dl>
  46593. <a name="Commands-120"></a>
  46594. <h4 class="subsection">39.166.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-120" aria-hidden="true">TOC</a></span></h4>
  46595. <p>This filter supports the following commands:
  46596. </p><dl class="table">
  46597. <dt><samp class="option">weights</samp></dt>
  46598. <dt><samp class="option">scale</samp></dt>
  46599. <dt><samp class="option">planes</samp></dt>
  46600. <dd><p>Syntax is same as option with same name.
  46601. </p></dd>
  46602. </dl>
  46603. <a name="monochrome"></a>
  46604. <h3 class="section">39.167 monochrome<span class="pull-right"><a class="anchor hidden-xs" href="#monochrome" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-monochrome" aria-hidden="true">TOC</a></span></h3>
  46605. <p>Convert video to gray using custom color filter.
  46606. </p>
  46607. <p>A description of the accepted options follows.
  46608. </p>
  46609. <dl class="table">
  46610. <dt><samp class="option">cb</samp></dt>
  46611. <dd><p>Set the chroma blue spot. Allowed range is from -1 to 1.
  46612. Default value is 0.
  46613. </p>
  46614. </dd>
  46615. <dt><samp class="option">cr</samp></dt>
  46616. <dd><p>Set the chroma red spot. Allowed range is from -1 to 1.
  46617. Default value is 0.
  46618. </p>
  46619. </dd>
  46620. <dt><samp class="option">size</samp></dt>
  46621. <dd><p>Set the color filter size. Allowed range is from .1 to 10.
  46622. Default value is 1.
  46623. </p>
  46624. </dd>
  46625. <dt><samp class="option">high</samp></dt>
  46626. <dd><p>Set the highlights strength. Allowed range is from 0 to 1.
  46627. Default value is 0.
  46628. </p></dd>
  46629. </dl>
  46630. <a name="Commands-121"></a>
  46631. <h4 class="subsection">39.167.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-121" aria-hidden="true">TOC</a></span></h4>
  46632. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46633. </p>
  46634. <a name="morpho"></a>
  46635. <h3 class="section">39.168 morpho<span class="pull-right"><a class="anchor hidden-xs" href="#morpho" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-morpho" aria-hidden="true">TOC</a></span></h3>
  46636. <p>This filter allows to apply main morphological grayscale transforms,
  46637. erode and dilate with arbitrary structures set in second input stream.
  46638. </p>
  46639. <p>Unlike naive implementation and much slower performance in <a class="ref" href="#erosion">erosion</a>
  46640. and <a class="ref" href="#dilation">dilation</a> filters, when speed is critical <code class="code">morpho</code> filter
  46641. should be used instead.
  46642. </p>
  46643. <p>A description of accepted options follows,
  46644. </p>
  46645. <dl class="table">
  46646. <dt><samp class="option">mode</samp></dt>
  46647. <dd><p>Set morphological transform to apply, can be:
  46648. </p>
  46649. <dl class="table">
  46650. <dt>&lsquo;<samp class="samp">erode</samp>&rsquo;</dt>
  46651. <dt>&lsquo;<samp class="samp">dilate</samp>&rsquo;</dt>
  46652. <dt>&lsquo;<samp class="samp">open</samp>&rsquo;</dt>
  46653. <dt>&lsquo;<samp class="samp">close</samp>&rsquo;</dt>
  46654. <dt>&lsquo;<samp class="samp">gradient</samp>&rsquo;</dt>
  46655. <dt>&lsquo;<samp class="samp">tophat</samp>&rsquo;</dt>
  46656. <dt>&lsquo;<samp class="samp">blackhat</samp>&rsquo;</dt>
  46657. </dl>
  46658. <p>Default is <code class="code">erode</code>.
  46659. </p>
  46660. </dd>
  46661. <dt><samp class="option">planes</samp></dt>
  46662. <dd><p>Set planes to filter, by default all planes except alpha are filtered.
  46663. </p>
  46664. </dd>
  46665. <dt><samp class="option">structure</samp></dt>
  46666. <dd><p>Set which structure video frames will be processed from second input stream,
  46667. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  46668. </p></dd>
  46669. </dl>
  46670. <p>The <code class="code">morpho</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  46671. </p>
  46672. <a name="Commands-122"></a>
  46673. <h4 class="subsection">39.168.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-122" aria-hidden="true">TOC</a></span></h4>
  46674. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  46675. </p>
  46676. <a name="mpdecimate"></a>
  46677. <h3 class="section">39.169 mpdecimate<span class="pull-right"><a class="anchor hidden-xs" href="#mpdecimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpdecimate" aria-hidden="true">TOC</a></span></h3>
  46678. <p>Drop frames that do not differ greatly from the previous frame in
  46679. order to reduce frame rate.
  46680. </p>
  46681. <p>The main use of this filter is for very-low-bitrate encoding
  46682. (e.g. streaming over dialup modem), but it could in theory be used for
  46683. fixing movies that were inverse-telecined incorrectly.
  46684. </p>
  46685. <p>A description of the accepted options follows.
  46686. </p>
  46687. <dl class="table">
  46688. <dt><samp class="option">max</samp></dt>
  46689. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  46690. positive), or the minimum interval between dropped frames (if
  46691. negative). If the value is 0, the frame is dropped disregarding the
  46692. number of previous sequentially dropped frames.
  46693. </p>
  46694. <p>Default value is 0.
  46695. </p>
  46696. </dd>
  46697. <dt><samp class="option">keep</samp></dt>
  46698. <dd><p>Set the maximum number of consecutive similar frames to ignore before to start dropping them.
  46699. If the value is 0, the frame is dropped disregarding the
  46700. number of previous sequentially similar frames.
  46701. </p>
  46702. <p>Default value is 0.
  46703. </p>
  46704. </dd>
  46705. <dt><samp class="option">hi</samp></dt>
  46706. <dt><samp class="option">lo</samp></dt>
  46707. <dt><samp class="option">frac</samp></dt>
  46708. <dd><p>Set the dropping threshold values.
  46709. </p>
  46710. <p>Values for <samp class="option">hi</samp> and <samp class="option">lo</samp> are for 8x8 pixel blocks and
  46711. represent actual pixel value differences, so a threshold of 64
  46712. corresponds to 1 unit of difference for each pixel, or the same spread
  46713. out differently over the block.
  46714. </p>
  46715. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  46716. than a threshold of <samp class="option">hi</samp>, and if no more than <samp class="option">frac</samp> blocks (1
  46717. meaning the whole image) differ by more than a threshold of <samp class="option">lo</samp>.
  46718. </p>
  46719. <p>Default value for <samp class="option">hi</samp> is 64*12, default value for <samp class="option">lo</samp> is
  46720. 64*5, and default value for <samp class="option">frac</samp> is 0.33.
  46721. </p></dd>
  46722. </dl>
  46723. <a name="msad"></a>
  46724. <h3 class="section">39.170 msad<span class="pull-right"><a class="anchor hidden-xs" href="#msad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-msad" aria-hidden="true">TOC</a></span></h3>
  46725. <p>Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos.
  46726. </p>
  46727. <p>This filter takes two input videos.
  46728. </p>
  46729. <p>Both input videos must have the same resolution and pixel format for
  46730. this filter to work correctly. Also it assumes that both inputs
  46731. have the same number of frames, which are compared one by one.
  46732. </p>
  46733. <p>The obtained per component, average, min and max MSAD is printed through
  46734. the logging system.
  46735. </p>
  46736. <p>The filter stores the calculated MSAD of each frame in frame metadata.
  46737. </p>
  46738. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  46739. </p>
  46740. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  46741. with the reference file <samp class="file">ref.mpg</samp>.
  46742. </p>
  46743. <div class="example">
  46744. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
  46745. </pre></div>
  46746. <a name="multiply"></a>
  46747. <h3 class="section">39.171 multiply<span class="pull-right"><a class="anchor hidden-xs" href="#multiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-multiply" aria-hidden="true">TOC</a></span></h3>
  46748. <p>Multiply first video stream pixels values with second video stream pixels values.
  46749. </p>
  46750. <p>The filter accepts the following options:
  46751. </p>
  46752. <dl class="table">
  46753. <dt><samp class="option">scale</samp></dt>
  46754. <dd><p>Set the scale applied to second video stream. By default is <code class="code">1</code>.
  46755. Allowed range is from <code class="code">0</code> to <code class="code">9</code>.
  46756. </p>
  46757. </dd>
  46758. <dt><samp class="option">offset</samp></dt>
  46759. <dd><p>Set the offset applied to second video stream. By default is <code class="code">0.5</code>.
  46760. Allowed range is from <code class="code">-1</code> to <code class="code">1</code>.
  46761. </p>
  46762. </dd>
  46763. <dt><samp class="option">planes</samp></dt>
  46764. <dd><p>Specify planes from input video stream that will be processed.
  46765. By default all planes are processed.
  46766. </p></dd>
  46767. </dl>
  46768. <a name="Commands-123"></a>
  46769. <h4 class="subsection">39.171.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-123" aria-hidden="true">TOC</a></span></h4>
  46770. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  46771. </p>
  46772. <a name="negate"></a>
  46773. <h3 class="section">39.172 negate<span class="pull-right"><a class="anchor hidden-xs" href="#negate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-negate" aria-hidden="true">TOC</a></span></h3>
  46774. <p>Negate (invert) the input video.
  46775. </p>
  46776. <p>It accepts the following option:
  46777. </p>
  46778. <dl class="table">
  46779. <dt><samp class="option">components</samp></dt>
  46780. <dd><p>Set components to negate.
  46781. </p>
  46782. <p>Available values for components are:
  46783. </p><dl class="table">
  46784. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  46785. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  46786. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  46787. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  46788. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  46789. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  46790. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  46791. </dl>
  46792. </dd>
  46793. <dt><samp class="option">negate_alpha</samp></dt>
  46794. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  46795. </p></dd>
  46796. </dl>
  46797. <a name="Commands-124"></a>
  46798. <h4 class="subsection">39.172.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-124" aria-hidden="true">TOC</a></span></h4>
  46799. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  46800. </p>
  46801. <a class="anchor" id="nlmeans"></a><a name="nlmeans-1"></a>
  46802. <h3 class="section">39.173 nlmeans<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans-1" aria-hidden="true">TOC</a></span></h3>
  46803. <p>Denoise frames using Non-Local Means algorithm.
  46804. </p>
  46805. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  46806. context similarity is defined by comparing their surrounding patches of size
  46807. <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>
  46808. around the pixel.
  46809. </p>
  46810. <p>Note that the research area defines centers for patches, which means some
  46811. patches will be made of pixels outside that research area.
  46812. </p>
  46813. <p>The filter accepts the following options.
  46814. </p>
  46815. <dl class="table">
  46816. <dt><samp class="option">s</samp></dt>
  46817. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  46818. </p>
  46819. </dd>
  46820. <dt><samp class="option">p</samp></dt>
  46821. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  46822. </p>
  46823. </dd>
  46824. <dt><samp class="option">pc</samp></dt>
  46825. <dd><p>Same as <samp class="option">p</samp> but for chroma planes.
  46826. </p>
  46827. <p>The default value is <var class="var">0</var> and means automatic.
  46828. </p>
  46829. </dd>
  46830. <dt><samp class="option">r</samp></dt>
  46831. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  46832. </p>
  46833. </dd>
  46834. <dt><samp class="option">rc</samp></dt>
  46835. <dd><p>Same as <samp class="option">r</samp> but for chroma planes.
  46836. </p>
  46837. <p>The default value is <var class="var">0</var> and means automatic.
  46838. </p></dd>
  46839. </dl>
  46840. <a name="nnedi"></a>
  46841. <h3 class="section">39.174 nnedi<span class="pull-right"><a class="anchor hidden-xs" href="#nnedi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nnedi" aria-hidden="true">TOC</a></span></h3>
  46842. <p>Deinterlace video using neural network edge directed interpolation.
  46843. </p>
  46844. <p>This filter accepts the following options:
  46845. </p>
  46846. <dl class="table">
  46847. <dt><samp class="option">weights</samp></dt>
  46848. <dd><p>Mandatory option, without binary file filter can not work.
  46849. Currently file can be found here:
  46850. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  46851. </p>
  46852. </dd>
  46853. <dt><samp class="option">deint</samp></dt>
  46854. <dd><p>Set which frames to deinterlace, by default it is <code class="code">all</code>.
  46855. Can be <code class="code">all</code> or <code class="code">interlaced</code>.
  46856. </p>
  46857. </dd>
  46858. <dt><samp class="option">field</samp></dt>
  46859. <dd><p>Set mode of operation.
  46860. </p>
  46861. <p>Can be one of the following:
  46862. </p>
  46863. <dl class="table">
  46864. <dt>&lsquo;<samp class="samp">af</samp>&rsquo;</dt>
  46865. <dd><p>Use frame flags, both fields.
  46866. </p></dd>
  46867. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  46868. <dd><p>Use frame flags, single field.
  46869. </p></dd>
  46870. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  46871. <dd><p>Use top field only.
  46872. </p></dd>
  46873. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  46874. <dd><p>Use bottom field only.
  46875. </p></dd>
  46876. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  46877. <dd><p>Use both fields, top first.
  46878. </p></dd>
  46879. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  46880. <dd><p>Use both fields, bottom first.
  46881. </p></dd>
  46882. </dl>
  46883. </dd>
  46884. <dt><samp class="option">planes</samp></dt>
  46885. <dd><p>Set which planes to process, by default filter process all frames.
  46886. </p>
  46887. </dd>
  46888. <dt><samp class="option">nsize</samp></dt>
  46889. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  46890. network.
  46891. </p>
  46892. <p>Can be one of the following:
  46893. </p>
  46894. <dl class="table">
  46895. <dt>&lsquo;<samp class="samp">s8x6</samp>&rsquo;</dt>
  46896. <dt>&lsquo;<samp class="samp">s16x6</samp>&rsquo;</dt>
  46897. <dt>&lsquo;<samp class="samp">s32x6</samp>&rsquo;</dt>
  46898. <dt>&lsquo;<samp class="samp">s48x6</samp>&rsquo;</dt>
  46899. <dt>&lsquo;<samp class="samp">s8x4</samp>&rsquo;</dt>
  46900. <dt>&lsquo;<samp class="samp">s16x4</samp>&rsquo;</dt>
  46901. <dt>&lsquo;<samp class="samp">s32x4</samp>&rsquo;</dt>
  46902. </dl>
  46903. </dd>
  46904. <dt><samp class="option">nns</samp></dt>
  46905. <dd><p>Set the number of neurons in predictor neural network.
  46906. Can be one of the following:
  46907. </p>
  46908. <dl class="table">
  46909. <dt>&lsquo;<samp class="samp">n16</samp>&rsquo;</dt>
  46910. <dt>&lsquo;<samp class="samp">n32</samp>&rsquo;</dt>
  46911. <dt>&lsquo;<samp class="samp">n64</samp>&rsquo;</dt>
  46912. <dt>&lsquo;<samp class="samp">n128</samp>&rsquo;</dt>
  46913. <dt>&lsquo;<samp class="samp">n256</samp>&rsquo;</dt>
  46914. </dl>
  46915. </dd>
  46916. <dt><samp class="option">qual</samp></dt>
  46917. <dd><p>Controls the number of different neural network predictions that are blended
  46918. together to compute the final output value. Can be <code class="code">fast</code>, default or
  46919. <code class="code">slow</code>.
  46920. </p>
  46921. </dd>
  46922. <dt><samp class="option">etype</samp></dt>
  46923. <dd><p>Set which set of weights to use in the predictor.
  46924. Can be one of the following:
  46925. </p>
  46926. <dl class="table">
  46927. <dt>&lsquo;<samp class="samp">a, abs</samp>&rsquo;</dt>
  46928. <dd><p>weights trained to minimize absolute error
  46929. </p></dd>
  46930. <dt>&lsquo;<samp class="samp">s, mse</samp>&rsquo;</dt>
  46931. <dd><p>weights trained to minimize squared error
  46932. </p></dd>
  46933. </dl>
  46934. </dd>
  46935. <dt><samp class="option">pscrn</samp></dt>
  46936. <dd><p>Controls whether or not the prescreener neural network is used to decide
  46937. which pixels should be processed by the predictor neural network and which
  46938. can be handled by simple cubic interpolation.
  46939. The prescreener is trained to know whether cubic interpolation will be
  46940. sufficient for a pixel or whether it should be predicted by the predictor nn.
  46941. The computational complexity of the prescreener nn is much less than that of
  46942. the predictor nn. Since most pixels can be handled by cubic interpolation,
  46943. using the prescreener generally results in much faster processing.
  46944. The prescreener is pretty accurate, so the difference between using it and not
  46945. using it is almost always unnoticeable.
  46946. </p>
  46947. <p>Can be one of the following:
  46948. </p>
  46949. <dl class="table">
  46950. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  46951. <dt>&lsquo;<samp class="samp">original</samp>&rsquo;</dt>
  46952. <dt>&lsquo;<samp class="samp">new</samp>&rsquo;</dt>
  46953. <dt>&lsquo;<samp class="samp">new2</samp>&rsquo;</dt>
  46954. <dt>&lsquo;<samp class="samp">new3</samp>&rsquo;</dt>
  46955. </dl>
  46956. <p>Default is <code class="code">new</code>.
  46957. </p></dd>
  46958. </dl>
  46959. <a name="Commands-125"></a>
  46960. <h4 class="subsection">39.174.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-125" aria-hidden="true">TOC</a></span></h4>
  46961. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">weights</var> option.
  46962. </p>
  46963. <a name="noformat"></a>
  46964. <h3 class="section">39.175 noformat<span class="pull-right"><a class="anchor hidden-xs" href="#noformat" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noformat" aria-hidden="true">TOC</a></span></h3>
  46965. <p>Force libavfilter not to use any of the specified pixel formats for the
  46966. input to the next filter.
  46967. </p>
  46968. <p>It accepts the following parameters:
  46969. </p><dl class="table">
  46970. <dt><samp class="option">pix_fmts</samp></dt>
  46971. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  46972. pix_fmts=yuv420p|monow|rgb24&quot;.
  46973. </p>
  46974. </dd>
  46975. </dl>
  46976. <a name="Examples-143"></a>
  46977. <h4 class="subsection">39.175.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-143" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-143" aria-hidden="true">TOC</a></span></h4>
  46978. <ul class="itemize mark-bullet">
  46979. <li>Force libavfilter to use a format different from <var class="var">yuv420p</var> for the
  46980. input to the vflip filter:
  46981. <div class="example">
  46982. <pre class="example-preformatted">noformat=pix_fmts=yuv420p,vflip
  46983. </pre></div>
  46984. </li><li>Convert the input video to any of the formats not contained in the list:
  46985. <div class="example">
  46986. <pre class="example-preformatted">noformat=yuv420p|yuv444p|yuv410p
  46987. </pre></div>
  46988. </li></ul>
  46989. <a name="noise-1"></a>
  46990. <h3 class="section">39.176 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise-1" aria-hidden="true">TOC</a></span></h3>
  46991. <p>Add noise on video input frame.
  46992. </p>
  46993. <p>The filter accepts the following options:
  46994. </p>
  46995. <dl class="table">
  46996. <dt><samp class="option">all_seed</samp></dt>
  46997. <dt><samp class="option">c0_seed</samp></dt>
  46998. <dt><samp class="option">c1_seed</samp></dt>
  46999. <dt><samp class="option">c2_seed</samp></dt>
  47000. <dt><samp class="option">c3_seed</samp></dt>
  47001. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  47002. of <var class="var">all_seed</var>. Default value is <code class="code">123457</code>.
  47003. </p>
  47004. </dd>
  47005. <dt><samp class="option">all_strength, alls</samp></dt>
  47006. <dt><samp class="option">c0_strength, c0s</samp></dt>
  47007. <dt><samp class="option">c1_strength, c1s</samp></dt>
  47008. <dt><samp class="option">c2_strength, c2s</samp></dt>
  47009. <dt><samp class="option">c3_strength, c3s</samp></dt>
  47010. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  47011. <var class="var">all_strength</var>. Default value is <code class="code">0</code>. Allowed range is [0, 100].
  47012. </p>
  47013. </dd>
  47014. <dt><samp class="option">all_flags, allf</samp></dt>
  47015. <dt><samp class="option">c0_flags, c0f</samp></dt>
  47016. <dt><samp class="option">c1_flags, c1f</samp></dt>
  47017. <dt><samp class="option">c2_flags, c2f</samp></dt>
  47018. <dt><samp class="option">c3_flags, c3f</samp></dt>
  47019. <dd><p>Set pixel component flags or set flags for all components if <var class="var">all_flags</var>.
  47020. Available values for component flags are:
  47021. </p><dl class="table">
  47022. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  47023. <dd><p>averaged temporal noise (smoother)
  47024. </p></dd>
  47025. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  47026. <dd><p>mix random noise with a (semi)regular pattern
  47027. </p></dd>
  47028. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  47029. <dd><p>temporal noise (noise pattern changes between frames)
  47030. </p></dd>
  47031. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  47032. <dd><p>uniform noise (gaussian otherwise)
  47033. </p></dd>
  47034. </dl>
  47035. </dd>
  47036. </dl>
  47037. <a name="Examples-144"></a>
  47038. <h4 class="subsection">39.176.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-144" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-144" aria-hidden="true">TOC</a></span></h4>
  47039. <p>Add temporal and uniform noise to input video:
  47040. </p><div class="example">
  47041. <pre class="example-preformatted">noise=alls=20:allf=t+u
  47042. </pre></div>
  47043. <a name="normalize"></a>
  47044. <h3 class="section">39.177 normalize<span class="pull-right"><a class="anchor hidden-xs" href="#normalize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-normalize" aria-hidden="true">TOC</a></span></h3>
  47045. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  47046. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  47047. </p>
  47048. <p>For each channel of each frame, the filter computes the input range and maps
  47049. it linearly to the user-specified output range. The output range defaults
  47050. to the full dynamic range from pure black to pure white.
  47051. </p>
  47052. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  47053. changes in brightness) caused when small dark or bright objects enter or leave
  47054. the scene. This is similar to the auto-exposure (automatic gain control) on a
  47055. video camera, and, like a video camera, it may cause a period of over- or
  47056. under-exposure of the video.
  47057. </p>
  47058. <p>The R,G,B channels can be normalized independently, which may cause some
  47059. color shifting, or linked together as a single channel, which prevents
  47060. color shifting. Linked normalization preserves hue. Independent normalization
  47061. does not, so it can be used to remove some color casts. Independent and linked
  47062. normalization can be combined in any ratio.
  47063. </p>
  47064. <p>The normalize filter accepts the following options:
  47065. </p>
  47066. <dl class="table">
  47067. <dt><samp class="option">blackpt</samp></dt>
  47068. <dt><samp class="option">whitept</samp></dt>
  47069. <dd><p>Colors which define the output range. The minimum input value is mapped to
  47070. the <var class="var">blackpt</var>. The maximum input value is mapped to the <var class="var">whitept</var>.
  47071. The defaults are black and white respectively. Specifying white for
  47072. <var class="var">blackpt</var> and black for <var class="var">whitept</var> will give color-inverted,
  47073. normalized video. Shades of grey can be used to reduce the dynamic range
  47074. (contrast). Specifying saturated colors here can create some interesting
  47075. effects.
  47076. </p>
  47077. </dd>
  47078. <dt><samp class="option">smoothing</samp></dt>
  47079. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  47080. of each channel is smoothed using a rolling average over the current frame
  47081. and the <var class="var">smoothing</var> previous frames. The default is 0 (no temporal
  47082. smoothing).
  47083. </p>
  47084. </dd>
  47085. <dt><samp class="option">independence</samp></dt>
  47086. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  47087. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  47088. independent. Defaults to 1.0 (fully independent).
  47089. </p>
  47090. </dd>
  47091. <dt><samp class="option">strength</samp></dt>
  47092. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  47093. expensive no-op. Defaults to 1.0 (full strength).
  47094. </p>
  47095. </dd>
  47096. </dl>
  47097. <a name="Commands-126"></a>
  47098. <h4 class="subsection">39.177.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-126" aria-hidden="true">TOC</a></span></h4>
  47099. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">smoothing</var> option.
  47100. The command accepts the same syntax of the corresponding option.
  47101. </p>
  47102. <p>If the specified expression is not valid, it is kept at its current
  47103. value.
  47104. </p>
  47105. <a name="Examples-145"></a>
  47106. <h4 class="subsection">39.177.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-145" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-145" aria-hidden="true">TOC</a></span></h4>
  47107. <p>Stretch video contrast to use the full dynamic range, with no temporal
  47108. smoothing; may flicker depending on the source content:
  47109. </p><div class="example">
  47110. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=0
  47111. </pre></div>
  47112. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  47113. reduced, depending on the source content:
  47114. </p><div class="example">
  47115. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50
  47116. </pre></div>
  47117. <p>As above, but with hue-preserving linked channel normalization:
  47118. </p><div class="example">
  47119. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  47120. </pre></div>
  47121. <p>As above, but with half strength:
  47122. </p><div class="example">
  47123. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  47124. </pre></div>
  47125. <p>Map the darkest input color to red, the brightest input color to cyan:
  47126. </p><div class="example">
  47127. <pre class="example-preformatted">normalize=blackpt=red:whitept=cyan
  47128. </pre></div>
  47129. <a name="null-2"></a>
  47130. <h3 class="section">39.178 null<span class="pull-right"><a class="anchor hidden-xs" href="#null-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null-2" aria-hidden="true">TOC</a></span></h3>
  47131. <p>Pass the video source unchanged to the output.
  47132. </p>
  47133. <a name="ocr"></a>
  47134. <h3 class="section">39.179 ocr<span class="pull-right"><a class="anchor hidden-xs" href="#ocr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocr" aria-hidden="true">TOC</a></span></h3>
  47135. <p>Optical Character Recognition
  47136. </p>
  47137. <p>This filter uses Tesseract for optical character recognition. To enable
  47138. compilation of this filter, you need to configure FFmpeg with
  47139. <code class="code">--enable-libtesseract</code>.
  47140. </p>
  47141. <p>It accepts the following options:
  47142. </p>
  47143. <dl class="table">
  47144. <dt><samp class="option">datapath</samp></dt>
  47145. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  47146. set at installation.
  47147. </p>
  47148. </dd>
  47149. <dt><samp class="option">language</samp></dt>
  47150. <dd><p>Set language, default is &quot;eng&quot;.
  47151. </p>
  47152. </dd>
  47153. <dt><samp class="option">whitelist</samp></dt>
  47154. <dd><p>Set character whitelist.
  47155. </p>
  47156. </dd>
  47157. <dt><samp class="option">blacklist</samp></dt>
  47158. <dd><p>Set character blacklist.
  47159. </p></dd>
  47160. </dl>
  47161. <p>The filter exports recognized text as the frame metadata <code class="code">lavfi.ocr.text</code>.
  47162. The filter exports confidence of recognized words as the frame metadata <code class="code">lavfi.ocr.confidence</code>.
  47163. </p>
  47164. <a name="ocv"></a>
  47165. <h3 class="section">39.180 ocv<span class="pull-right"><a class="anchor hidden-xs" href="#ocv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocv" aria-hidden="true">TOC</a></span></h3>
  47166. <p>Apply a video transform using libopencv.
  47167. </p>
  47168. <p>To enable this filter, install the libopencv library and headers and
  47169. configure FFmpeg with <code class="code">--enable-libopencv</code>.
  47170. </p>
  47171. <p>It accepts the following parameters:
  47172. </p>
  47173. <dl class="table">
  47174. <dt><samp class="option">filter_name</samp></dt>
  47175. <dd><p>The name of the libopencv filter to apply.
  47176. </p>
  47177. </dd>
  47178. <dt><samp class="option">filter_params</samp></dt>
  47179. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  47180. values are assumed.
  47181. </p>
  47182. </dd>
  47183. </dl>
  47184. <p>Refer to the official libopencv documentation for more precise
  47185. information:
  47186. <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>
  47187. </p>
  47188. <p>Several libopencv filters are supported; see the following subsections.
  47189. </p>
  47190. <a class="anchor" id="dilate"></a><a name="dilate-1"></a>
  47191. <h4 class="subsection">39.180.1 dilate<span class="pull-right"><a class="anchor hidden-xs" href="#dilate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilate-1" aria-hidden="true">TOC</a></span></h4>
  47192. <p>Dilate an image by using a specific structuring element.
  47193. It corresponds to the libopencv function <code class="code">cvDilate</code>.
  47194. </p>
  47195. <p>It accepts the parameters: <var class="var">struct_el</var>|<var class="var">nb_iterations</var>.
  47196. </p>
  47197. <p><var class="var">struct_el</var> represents a structuring element, and has the syntax:
  47198. <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>
  47199. </p>
  47200. <p><var class="var">cols</var> and <var class="var">rows</var> represent the number of columns and rows of
  47201. the structuring element, <var class="var">anchor_x</var> and <var class="var">anchor_y</var> the anchor
  47202. point, and <var class="var">shape</var> the shape for the structuring element. <var class="var">shape</var>
  47203. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  47204. </p>
  47205. <p>If the value for <var class="var">shape</var> is &quot;custom&quot;, it must be followed by a
  47206. string of the form &quot;=<var class="var">filename</var>&quot;. The file with name
  47207. <var class="var">filename</var> is assumed to represent a binary image, with each
  47208. printable character corresponding to a bright pixel. When a custom
  47209. <var class="var">shape</var> is used, <var class="var">cols</var> and <var class="var">rows</var> are ignored, the number
  47210. or columns and rows of the read file are assumed instead.
  47211. </p>
  47212. <p>The default value for <var class="var">struct_el</var> is &quot;3x3+0x0/rect&quot;.
  47213. </p>
  47214. <p><var class="var">nb_iterations</var> specifies the number of times the transform is
  47215. applied to the image, and defaults to 1.
  47216. </p>
  47217. <p>Some examples:
  47218. </p><div class="example">
  47219. <pre class="example-preformatted"># Use the default values
  47220. ocv=dilate
  47221. # Dilate using a structuring element with a 5x5 cross, iterating two times
  47222. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  47223. # Read the shape from the file diamond.shape, iterating two times.
  47224. # The file diamond.shape may contain a pattern of characters like this
  47225. # *
  47226. # ***
  47227. # *****
  47228. # ***
  47229. # *
  47230. # The specified columns and rows are ignored
  47231. # but the anchor point coordinates are not
  47232. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  47233. </pre></div>
  47234. <a name="erode"></a>
  47235. <h4 class="subsection">39.180.2 erode<span class="pull-right"><a class="anchor hidden-xs" href="#erode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erode" aria-hidden="true">TOC</a></span></h4>
  47236. <p>Erode an image by using a specific structuring element.
  47237. It corresponds to the libopencv function <code class="code">cvErode</code>.
  47238. </p>
  47239. <p>It accepts the parameters: <var class="var">struct_el</var>:<var class="var">nb_iterations</var>,
  47240. with the same syntax and semantics as the <a class="ref" href="#dilate">dilate</a> filter.
  47241. </p>
  47242. <a name="smooth"></a>
  47243. <h4 class="subsection">39.180.3 smooth<span class="pull-right"><a class="anchor hidden-xs" href="#smooth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smooth" aria-hidden="true">TOC</a></span></h4>
  47244. <p>Smooth the input video.
  47245. </p>
  47246. <p>The filter takes the following parameters:
  47247. <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>.
  47248. </p>
  47249. <p><var class="var">type</var> is the type of smooth filter to apply, and must be one of
  47250. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  47251. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  47252. </p>
  47253. <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>
  47254. depends on the smooth type. <var class="var">param1</var> and
  47255. <var class="var">param2</var> accept integer positive values or 0. <var class="var">param3</var> and
  47256. <var class="var">param4</var> accept floating point values.
  47257. </p>
  47258. <p>The default value for <var class="var">param1</var> is 3. The default value for the
  47259. other parameters is 0.
  47260. </p>
  47261. <p>These parameters correspond to the parameters assigned to the
  47262. libopencv function <code class="code">cvSmooth</code>.
  47263. </p>
  47264. <a name="oscilloscope"></a>
  47265. <h3 class="section">39.181 oscilloscope<span class="pull-right"><a class="anchor hidden-xs" href="#oscilloscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oscilloscope" aria-hidden="true">TOC</a></span></h3>
  47266. <p>2D Video Oscilloscope.
  47267. </p>
  47268. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  47269. </p>
  47270. <p>It accepts the following parameters:
  47271. </p>
  47272. <dl class="table">
  47273. <dt><samp class="option">x</samp></dt>
  47274. <dd><p>Set scope center x position.
  47275. </p>
  47276. </dd>
  47277. <dt><samp class="option">y</samp></dt>
  47278. <dd><p>Set scope center y position.
  47279. </p>
  47280. </dd>
  47281. <dt><samp class="option">s</samp></dt>
  47282. <dd><p>Set scope size, relative to frame diagonal.
  47283. </p>
  47284. </dd>
  47285. <dt><samp class="option">t</samp></dt>
  47286. <dd><p>Set scope tilt/rotation.
  47287. </p>
  47288. </dd>
  47289. <dt><samp class="option">o</samp></dt>
  47290. <dd><p>Set trace opacity.
  47291. </p>
  47292. </dd>
  47293. <dt><samp class="option">tx</samp></dt>
  47294. <dd><p>Set trace center x position.
  47295. </p>
  47296. </dd>
  47297. <dt><samp class="option">ty</samp></dt>
  47298. <dd><p>Set trace center y position.
  47299. </p>
  47300. </dd>
  47301. <dt><samp class="option">tw</samp></dt>
  47302. <dd><p>Set trace width, relative to width of frame.
  47303. </p>
  47304. </dd>
  47305. <dt><samp class="option">th</samp></dt>
  47306. <dd><p>Set trace height, relative to height of frame.
  47307. </p>
  47308. </dd>
  47309. <dt><samp class="option">c</samp></dt>
  47310. <dd><p>Set which components to trace. By default it traces first three components.
  47311. </p>
  47312. </dd>
  47313. <dt><samp class="option">g</samp></dt>
  47314. <dd><p>Draw trace grid. By default is enabled.
  47315. </p>
  47316. </dd>
  47317. <dt><samp class="option">st</samp></dt>
  47318. <dd><p>Draw some statistics. By default is enabled.
  47319. </p>
  47320. </dd>
  47321. <dt><samp class="option">sc</samp></dt>
  47322. <dd><p>Draw scope. By default is enabled.
  47323. </p></dd>
  47324. </dl>
  47325. <a name="Commands-127"></a>
  47326. <h4 class="subsection">39.181.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-127" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-127" aria-hidden="true">TOC</a></span></h4>
  47327. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  47328. The command accepts the same syntax of the corresponding option.
  47329. </p>
  47330. <p>If the specified expression is not valid, it is kept at its current
  47331. value.
  47332. </p>
  47333. <a name="Examples-146"></a>
  47334. <h4 class="subsection">39.181.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-146" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-146" aria-hidden="true">TOC</a></span></h4>
  47335. <ul class="itemize mark-bullet">
  47336. <li>Inspect full first row of video frame.
  47337. <div class="example">
  47338. <pre class="example-preformatted">oscilloscope=x=0.5:y=0:s=1
  47339. </pre></div>
  47340. </li><li>Inspect full last row of video frame.
  47341. <div class="example">
  47342. <pre class="example-preformatted">oscilloscope=x=0.5:y=1:s=1
  47343. </pre></div>
  47344. </li><li>Inspect full 5th line of video frame of height 1080.
  47345. <div class="example">
  47346. <pre class="example-preformatted">oscilloscope=x=0.5:y=5/1080:s=1
  47347. </pre></div>
  47348. </li><li>Inspect full last column of video frame.
  47349. <div class="example">
  47350. <pre class="example-preformatted">oscilloscope=x=1:y=0.5:s=1:t=1
  47351. </pre></div>
  47352. </li></ul>
  47353. <a class="anchor" id="overlay"></a><a name="overlay-1"></a>
  47354. <h3 class="section">39.182 overlay<span class="pull-right"><a class="anchor hidden-xs" href="#overlay-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay-1" aria-hidden="true">TOC</a></span></h3>
  47355. <p>Overlay one video on top of another.
  47356. </p>
  47357. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  47358. video on which the second input is overlaid.
  47359. </p>
  47360. <p>It accepts the following parameters:
  47361. </p>
  47362. <p>A description of the accepted options follows.
  47363. </p>
  47364. <dl class="table">
  47365. <dt><samp class="option">x</samp></dt>
  47366. <dt><samp class="option">y</samp></dt>
  47367. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  47368. on the main video. Default value is &quot;0&quot; for both expressions. In case
  47369. the expression is invalid, it is set to a huge value (meaning that the
  47370. overlay will not be displayed within the output visible area).
  47371. </p>
  47372. </dd>
  47373. <dt><samp class="option">eof_action</samp></dt>
  47374. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  47375. </p>
  47376. </dd>
  47377. <dt><samp class="option">eval</samp></dt>
  47378. <dd><p>Set when the expressions for <samp class="option">x</samp>, and <samp class="option">y</samp> are evaluated.
  47379. </p>
  47380. <p>It accepts the following values:
  47381. </p><dl class="table">
  47382. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  47383. <dd><p>only evaluate expressions once during the filter initialization or
  47384. when a command is processed
  47385. </p>
  47386. </dd>
  47387. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  47388. <dd><p>evaluate expressions for each incoming frame
  47389. </p></dd>
  47390. </dl>
  47391. <p>Default value is &lsquo;<samp class="samp">frame</samp>&rsquo;.
  47392. </p>
  47393. </dd>
  47394. <dt><samp class="option">shortest</samp></dt>
  47395. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  47396. </p>
  47397. </dd>
  47398. <dt><samp class="option">format</samp></dt>
  47399. <dd><p>Set the format for the output video.
  47400. </p>
  47401. <p>It accepts the following values:
  47402. </p><dl class="table">
  47403. <dt>&lsquo;<samp class="samp">yuv420</samp>&rsquo;</dt>
  47404. <dd><p>force YUV 4:2:0 8-bit planar output
  47405. </p>
  47406. </dd>
  47407. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  47408. <dd><p>force YUV 4:2:0 10-bit planar output
  47409. </p>
  47410. </dd>
  47411. <dt>&lsquo;<samp class="samp">yuv422</samp>&rsquo;</dt>
  47412. <dd><p>force YUV 4:2:2 8-bit planar output
  47413. </p>
  47414. </dd>
  47415. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  47416. <dd><p>force YUV 4:2:2 10-bit planar output
  47417. </p>
  47418. </dd>
  47419. <dt>&lsquo;<samp class="samp">yuv444</samp>&rsquo;</dt>
  47420. <dd><p>force YUV 4:4:4 8-bit planar output
  47421. </p>
  47422. </dd>
  47423. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  47424. <dd><p>force YUV 4:4:4 10-bit planar output
  47425. </p>
  47426. </dd>
  47427. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  47428. <dd><p>force RGB 8-bit packed output
  47429. </p>
  47430. </dd>
  47431. <dt>&lsquo;<samp class="samp">gbrp</samp>&rsquo;</dt>
  47432. <dd><p>force RGB 8-bit planar output
  47433. </p>
  47434. </dd>
  47435. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  47436. <dd><p>automatically pick format
  47437. </p></dd>
  47438. </dl>
  47439. <p>Default value is &lsquo;<samp class="samp">yuv420</samp>&rsquo;.
  47440. </p>
  47441. </dd>
  47442. <dt><samp class="option">repeatlast</samp></dt>
  47443. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  47444. </p>
  47445. </dd>
  47446. <dt><samp class="option">alpha</samp></dt>
  47447. <dd><p>Set format of alpha of the overlaid video, it can be <var class="var">straight</var> or
  47448. <var class="var">premultiplied</var>, or <var class="var">auto</var> to choose the alpha mode automatically.
  47449. Default is <var class="var">auto</var>.
  47450. </p></dd>
  47451. </dl>
  47452. <p>The <samp class="option">x</samp>, and <samp class="option">y</samp> expressions can contain the following
  47453. parameters.
  47454. </p>
  47455. <dl class="table">
  47456. <dt><samp class="option">main_w, W</samp></dt>
  47457. <dt><samp class="option">main_h, H</samp></dt>
  47458. <dd><p>The main input width and height.
  47459. </p>
  47460. </dd>
  47461. <dt><samp class="option">overlay_w, w</samp></dt>
  47462. <dt><samp class="option">overlay_h, h</samp></dt>
  47463. <dd><p>The overlay input width and height.
  47464. </p>
  47465. </dd>
  47466. <dt><samp class="option">x</samp></dt>
  47467. <dt><samp class="option">y</samp></dt>
  47468. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  47469. each new frame.
  47470. </p>
  47471. </dd>
  47472. <dt><samp class="option">hsub</samp></dt>
  47473. <dt><samp class="option">vsub</samp></dt>
  47474. <dd><p>horizontal and vertical chroma subsample values of the output
  47475. format. For example for the pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and
  47476. <var class="var">vsub</var> is 1.
  47477. </p>
  47478. </dd>
  47479. <dt><samp class="option">n</samp></dt>
  47480. <dd><p>the number of input frame, starting from 0
  47481. </p>
  47482. </dd>
  47483. <dt><samp class="option">pos</samp></dt>
  47484. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  47485. do not use
  47486. </p>
  47487. </dd>
  47488. <dt><samp class="option">t</samp></dt>
  47489. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  47490. </p>
  47491. </dd>
  47492. </dl>
  47493. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  47494. </p>
  47495. <p>Note that the <var class="var">n</var>, <var class="var">t</var> variables are available only
  47496. when evaluation is done <em class="emph">per frame</em>, and will evaluate to NAN
  47497. when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">init</samp>&rsquo;.
  47498. </p>
  47499. <p>Be aware that frames are taken from each input video in timestamp
  47500. order, hence, if their initial timestamps differ, it is a good idea
  47501. to pass the two inputs through a <var class="var">setpts=PTS-STARTPTS</var> filter to
  47502. have them begin in the same zero timestamp, as the example for
  47503. the <var class="var">movie</var> filter does.
  47504. </p>
  47505. <p>You can chain together more overlays but you should test the
  47506. efficiency of such approach.
  47507. </p>
  47508. <a name="Commands-128"></a>
  47509. <h4 class="subsection">39.182.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-128" aria-hidden="true">TOC</a></span></h4>
  47510. <p>This filter supports the following commands:
  47511. </p><dl class="table">
  47512. <dt><samp class="option">x</samp></dt>
  47513. <dt><samp class="option">y</samp></dt>
  47514. <dd><p>Modify the x and y of the overlay input.
  47515. The command accepts the same syntax of the corresponding option.
  47516. </p>
  47517. <p>If the specified expression is not valid, it is kept at its current
  47518. value.
  47519. </p></dd>
  47520. </dl>
  47521. <a name="Examples-147"></a>
  47522. <h4 class="subsection">39.182.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-147" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-147" aria-hidden="true">TOC</a></span></h4>
  47523. <ul class="itemize mark-bullet">
  47524. <li>Draw the overlay at 10 pixels from the bottom right corner of the main
  47525. video:
  47526. <div class="example">
  47527. <pre class="example-preformatted">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  47528. </pre></div>
  47529. <p>Using named options the example above becomes:
  47530. </p><div class="example">
  47531. <pre class="example-preformatted">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  47532. </pre></div>
  47533. </li><li>Insert a transparent PNG logo in the bottom left corner of the input,
  47534. using the <code class="command">ffmpeg</code> tool with the <code class="code">-filter_complex</code> option:
  47535. <div class="example">
  47536. <pre class="example-preformatted">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  47537. </pre></div>
  47538. </li><li>Insert 2 different transparent PNG logos (second logo on bottom
  47539. right corner) using the <code class="command">ffmpeg</code> tool:
  47540. <div class="example">
  47541. <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
  47542. </pre></div>
  47543. </li><li>Add a transparent color layer on top of the main video; <code class="code">WxH</code>
  47544. must specify the size of the main input to the overlay filter:
  47545. <div class="example">
  47546. <pre class="example-preformatted">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  47547. </pre></div>
  47548. </li><li>Play an original video and a filtered version (here with the deshake
  47549. filter) side by side using the <code class="command">ffplay</code> tool:
  47550. <div class="example">
  47551. <pre class="example-preformatted">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  47552. </pre></div>
  47553. <p>The above command is the same as:
  47554. </p><div class="example">
  47555. <pre class="example-preformatted">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  47556. </pre></div>
  47557. </li><li>Make a sliding overlay appearing from the left to the right top part of the
  47558. screen starting since time 2:
  47559. <div class="example">
  47560. <pre class="example-preformatted">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  47561. </pre></div>
  47562. </li><li>Compose output by putting two input videos side to side:
  47563. <div class="example">
  47564. <pre class="example-preformatted">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  47565. nullsrc=size=200x100 [background];
  47566. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  47567. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  47568. [background][left] overlay=shortest=1 [background+left];
  47569. [background+left][right] overlay=shortest=1:x=100 [left+right]
  47570. &quot;
  47571. </pre></div>
  47572. </li><li>Mask 10-20 seconds of a video by applying the delogo filter to a section
  47573. <div class="example">
  47574. <pre class="example-preformatted">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  47575. -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]'
  47576. masked.avi
  47577. </pre></div>
  47578. </li><li>Chain several overlays in cascade:
  47579. <div class="example">
  47580. <pre class="example-preformatted">nullsrc=s=200x200 [bg];
  47581. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  47582. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  47583. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  47584. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  47585. [in3] null, [mid2] overlay=100:100 [out0]
  47586. </pre></div>
  47587. </li></ul>
  47588. <a name="owdenoise"></a>
  47589. <h3 class="section">39.183 owdenoise<span class="pull-right"><a class="anchor hidden-xs" href="#owdenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-owdenoise" aria-hidden="true">TOC</a></span></h3>
  47590. <p>Apply Overcomplete Wavelet denoiser.
  47591. </p>
  47592. <p>The filter accepts the following options:
  47593. </p>
  47594. <dl class="table">
  47595. <dt><samp class="option">depth</samp></dt>
  47596. <dd><p>Set depth.
  47597. </p>
  47598. <p>Larger depth values will denoise lower frequency components more, but
  47599. slow down filtering.
  47600. </p>
  47601. <p>Must be an int in the range 8-16, default is <code class="code">8</code>.
  47602. </p>
  47603. </dd>
  47604. <dt><samp class="option">luma_strength, ls</samp></dt>
  47605. <dd><p>Set luma strength.
  47606. </p>
  47607. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  47608. </p>
  47609. </dd>
  47610. <dt><samp class="option">chroma_strength, cs</samp></dt>
  47611. <dd><p>Set chroma strength.
  47612. </p>
  47613. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  47614. </p></dd>
  47615. </dl>
  47616. <a class="anchor" id="pad"></a><a name="pad-1"></a>
  47617. <h3 class="section">39.184 pad<span class="pull-right"><a class="anchor hidden-xs" href="#pad-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad-1" aria-hidden="true">TOC</a></span></h3>
  47618. <p>Add paddings to the input image, and place the original input at the
  47619. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  47620. </p>
  47621. <p>It accepts the following parameters:
  47622. </p>
  47623. <dl class="table">
  47624. <dt><samp class="option">width, w</samp></dt>
  47625. <dt><samp class="option">height, h</samp></dt>
  47626. <dd><p>Specify an expression for the size of the output image with the
  47627. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  47628. corresponding input size is used for the output.
  47629. </p>
  47630. <p>The <var class="var">width</var> expression can reference the value set by the
  47631. <var class="var">height</var> expression, and vice versa.
  47632. </p>
  47633. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  47634. </p>
  47635. </dd>
  47636. <dt><samp class="option">x</samp></dt>
  47637. <dt><samp class="option">y</samp></dt>
  47638. <dd><p>Specify the offsets to place the input image at within the padded area,
  47639. with respect to the top/left border of the output image.
  47640. </p>
  47641. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  47642. expression, and vice versa.
  47643. </p>
  47644. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  47645. </p>
  47646. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  47647. so the input image is centered on the padded area.
  47648. </p>
  47649. </dd>
  47650. <dt><samp class="option">color</samp></dt>
  47651. <dd><p>Specify the color of the padded area. For the syntax of this option,
  47652. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  47653. manual</a>.
  47654. </p>
  47655. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  47656. </p>
  47657. </dd>
  47658. <dt><samp class="option">eval</samp></dt>
  47659. <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.
  47660. </p>
  47661. <p>It accepts the following values:
  47662. </p>
  47663. <dl class="table">
  47664. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  47665. <dd><p>Only evaluate expressions once during the filter initialization or when
  47666. a command is processed.
  47667. </p>
  47668. </dd>
  47669. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  47670. <dd><p>Evaluate expressions for each incoming frame.
  47671. </p>
  47672. </dd>
  47673. </dl>
  47674. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  47675. </p>
  47676. </dd>
  47677. <dt><samp class="option">aspect</samp></dt>
  47678. <dd><p>Pad to aspect instead to a resolution.
  47679. </p>
  47680. </dd>
  47681. </dl>
  47682. <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>
  47683. options are expressions containing the following constants:
  47684. </p>
  47685. <dl class="table">
  47686. <dt><samp class="option">in_w</samp></dt>
  47687. <dt><samp class="option">in_h</samp></dt>
  47688. <dd><p>The input video width and height.
  47689. </p>
  47690. </dd>
  47691. <dt><samp class="option">iw</samp></dt>
  47692. <dt><samp class="option">ih</samp></dt>
  47693. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  47694. </p>
  47695. </dd>
  47696. <dt><samp class="option">out_w</samp></dt>
  47697. <dt><samp class="option">out_h</samp></dt>
  47698. <dd><p>The output width and height (the size of the padded area), as
  47699. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  47700. </p>
  47701. </dd>
  47702. <dt><samp class="option">ow</samp></dt>
  47703. <dt><samp class="option">oh</samp></dt>
  47704. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  47705. </p>
  47706. </dd>
  47707. <dt><samp class="option">x</samp></dt>
  47708. <dt><samp class="option">y</samp></dt>
  47709. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  47710. expressions, or NAN if not yet specified.
  47711. </p>
  47712. </dd>
  47713. <dt><samp class="option">a</samp></dt>
  47714. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  47715. </p>
  47716. </dd>
  47717. <dt><samp class="option">sar</samp></dt>
  47718. <dd><p>input sample aspect ratio
  47719. </p>
  47720. </dd>
  47721. <dt><samp class="option">dar</samp></dt>
  47722. <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>
  47723. </p>
  47724. </dd>
  47725. <dt><samp class="option">hsub</samp></dt>
  47726. <dt><samp class="option">vsub</samp></dt>
  47727. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  47728. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  47729. </p></dd>
  47730. </dl>
  47731. <a name="Examples-148"></a>
  47732. <h4 class="subsection">39.184.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-148" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-148" aria-hidden="true">TOC</a></span></h4>
  47733. <ul class="itemize mark-bullet">
  47734. <li>Add paddings with the color &quot;violet&quot; to the input video. The output video
  47735. size is 640x480, and the top-left corner of the input video is placed at
  47736. column 0, row 40
  47737. <div class="example">
  47738. <pre class="example-preformatted">pad=640:480:0:40:violet
  47739. </pre></div>
  47740. <p>The example above is equivalent to the following command:
  47741. </p><div class="example">
  47742. <pre class="example-preformatted">pad=width=640:height=480:x=0:y=40:color=violet
  47743. </pre></div>
  47744. </li><li>Pad the input to get an output with dimensions increased by 3/2,
  47745. and put the input video at the center of the padded area:
  47746. <div class="example">
  47747. <pre class="example-preformatted">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  47748. </pre></div>
  47749. </li><li>Pad the input to get a squared output with size equal to the maximum
  47750. value between the input width and height, and put the input video at
  47751. the center of the padded area:
  47752. <div class="example">
  47753. <pre class="example-preformatted">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  47754. </pre></div>
  47755. </li><li>Pad the input to get a final w/h ratio of 16:9:
  47756. <div class="example">
  47757. <pre class="example-preformatted">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  47758. </pre></div>
  47759. </li><li>In case of anamorphic video, in order to set the output display aspect
  47760. correctly, it is necessary to use <var class="var">sar</var> in the expression,
  47761. according to the relation:
  47762. <div class="example">
  47763. <pre class="example-preformatted">(ih * X / ih) * sar = output_dar
  47764. X = output_dar / sar
  47765. </pre></div>
  47766. <p>Thus the previous example needs to be modified to:
  47767. </p><div class="example">
  47768. <pre class="example-preformatted">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  47769. </pre></div>
  47770. </li><li>Double the output size and put the input video in the bottom-right
  47771. corner of the output padded area:
  47772. <div class="example">
  47773. <pre class="example-preformatted">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  47774. </pre></div>
  47775. </li></ul>
  47776. <a class="anchor" id="palettegen"></a><a name="palettegen-1"></a>
  47777. <h3 class="section">39.185 palettegen<span class="pull-right"><a class="anchor hidden-xs" href="#palettegen-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-palettegen-1" aria-hidden="true">TOC</a></span></h3>
  47778. <p>Generate one palette for a whole video stream.
  47779. </p>
  47780. <p>It accepts the following options:
  47781. </p>
  47782. <dl class="table">
  47783. <dt><samp class="option">max_colors</samp></dt>
  47784. <dd><p>Set the maximum number of colors to quantize in the palette.
  47785. Note: the palette will still contain 256 colors; the unused palette entries
  47786. will be black.
  47787. </p>
  47788. </dd>
  47789. <dt><samp class="option">reserve_transparent</samp></dt>
  47790. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  47791. transparency. Reserving the transparency color is useful for GIF optimization.
  47792. If not set, the maximum of colors in the palette will be 256. You probably want
  47793. to disable this option for a standalone image.
  47794. Set by default.
  47795. </p>
  47796. </dd>
  47797. <dt><samp class="option">transparency_color</samp></dt>
  47798. <dd><p>Set the color that will be used as background for transparency.
  47799. </p>
  47800. </dd>
  47801. <dt><samp class="option">stats_mode</samp></dt>
  47802. <dd><p>Set statistics mode.
  47803. </p>
  47804. <p>It accepts the following values:
  47805. </p><dl class="table">
  47806. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  47807. <dd><p>Compute full frame histograms.
  47808. </p></dd>
  47809. <dt>&lsquo;<samp class="samp">diff</samp>&rsquo;</dt>
  47810. <dd><p>Compute histograms only for the part that differs from previous frame. This
  47811. might be relevant to give more importance to the moving part of your input if
  47812. the background is static.
  47813. </p></dd>
  47814. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  47815. <dd><p>Compute new histogram for each frame.
  47816. </p></dd>
  47817. </dl>
  47818. <p>Default value is <var class="var">full</var>.
  47819. </p></dd>
  47820. </dl>
  47821. <p>The filter also exports the frame metadata <code class="code">lavfi.color_quant_ratio</code>
  47822. (<code class="code">nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  47823. color quantization of the palette. This information is also visible at
  47824. <var class="var">info</var> logging level.
  47825. </p>
  47826. <a name="Examples-149"></a>
  47827. <h4 class="subsection">39.185.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-149" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-149" aria-hidden="true">TOC</a></span></h4>
  47828. <ul class="itemize mark-bullet">
  47829. <li>Generate a representative palette of a given video using <code class="command">ffmpeg</code>:
  47830. <div class="example">
  47831. <pre class="example-preformatted">ffmpeg -i input.mkv -vf palettegen palette.png
  47832. </pre></div>
  47833. </li></ul>
  47834. <a name="paletteuse"></a>
  47835. <h3 class="section">39.186 paletteuse<span class="pull-right"><a class="anchor hidden-xs" href="#paletteuse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-paletteuse" aria-hidden="true">TOC</a></span></h3>
  47836. <p>Use a palette to downsample an input video stream.
  47837. </p>
  47838. <p>The filter takes two inputs: one video stream and a palette. The palette must
  47839. be a 256 pixels image.
  47840. </p>
  47841. <p>It accepts the following options:
  47842. </p>
  47843. <dl class="table">
  47844. <dt><samp class="option">dither</samp></dt>
  47845. <dd><p>Select dithering mode. Available algorithms are:
  47846. </p><dl class="table">
  47847. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  47848. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  47849. </p></dd>
  47850. <dt>&lsquo;<samp class="samp">heckbert</samp>&rsquo;</dt>
  47851. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  47852. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  47853. reference.
  47854. </p></dd>
  47855. <dt>&lsquo;<samp class="samp">floyd_steinberg</samp>&rsquo;</dt>
  47856. <dd><p>Floyd and Steingberg dithering (error diffusion)
  47857. </p></dd>
  47858. <dt>&lsquo;<samp class="samp">sierra2</samp>&rsquo;</dt>
  47859. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  47860. </p></dd>
  47861. <dt>&lsquo;<samp class="samp">sierra2_4a</samp>&rsquo;</dt>
  47862. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  47863. </p></dd>
  47864. <dt>&lsquo;<samp class="samp">sierra3</samp>&rsquo;</dt>
  47865. <dd><p>Frankie Sierra dithering v3 (error diffusion)
  47866. </p></dd>
  47867. <dt>&lsquo;<samp class="samp">burkes</samp>&rsquo;</dt>
  47868. <dd><p>Burkes dithering (error diffusion)
  47869. </p></dd>
  47870. <dt>&lsquo;<samp class="samp">atkinson</samp>&rsquo;</dt>
  47871. <dd><p>Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion)
  47872. </p></dd>
  47873. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  47874. <dd><p>Disable dithering.
  47875. </p></dd>
  47876. </dl>
  47877. <p>Default is <var class="var">sierra2_4a</var>.
  47878. </p>
  47879. </dd>
  47880. <dt><samp class="option">bayer_scale</samp></dt>
  47881. <dd><p>When <var class="var">bayer</var> dithering is selected, this option defines the scale of the
  47882. pattern (how much the crosshatch pattern is visible). A low value means more
  47883. visible pattern for less banding, and higher value means less visible pattern
  47884. at the cost of more banding.
  47885. </p>
  47886. <p>The option must be an integer value in the range [0,5]. Default is <var class="var">2</var>.
  47887. </p>
  47888. </dd>
  47889. <dt><samp class="option">diff_mode</samp></dt>
  47890. <dd><p>If set, define the zone to process
  47891. </p>
  47892. <dl class="table">
  47893. <dt>&lsquo;<samp class="samp">rectangle</samp>&rsquo;</dt>
  47894. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  47895. cropping/offsetting compression mechanism. This option can be useful for speed
  47896. if only a part of the image is changing, and has use cases such as limiting the
  47897. scope of the error diffusal <samp class="option">dither</samp> to the rectangle that bounds the
  47898. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  47899. much, and as a result less moving noise and better GIF compression).
  47900. </p></dd>
  47901. </dl>
  47902. <p>Default is <var class="var">none</var>.
  47903. </p>
  47904. </dd>
  47905. <dt><samp class="option">new</samp></dt>
  47906. <dd><p>Take new palette for each output frame.
  47907. </p>
  47908. </dd>
  47909. <dt><samp class="option">alpha_threshold</samp></dt>
  47910. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  47911. will be treated as completely opaque, and values below this threshold will be
  47912. treated as completely transparent.
  47913. </p>
  47914. <p>The option must be an integer value in the range [0,255]. Default is <var class="var">128</var>.
  47915. </p></dd>
  47916. </dl>
  47917. <a name="Examples-150"></a>
  47918. <h4 class="subsection">39.186.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-150" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-150" aria-hidden="true">TOC</a></span></h4>
  47919. <ul class="itemize mark-bullet">
  47920. <li>Use a palette (generated for example with <a class="ref" href="#palettegen">palettegen</a>) to encode a GIF
  47921. using <code class="command">ffmpeg</code>:
  47922. <div class="example">
  47923. <pre class="example-preformatted">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  47924. </pre></div>
  47925. </li></ul>
  47926. <a name="perspective"></a>
  47927. <h3 class="section">39.187 perspective<span class="pull-right"><a class="anchor hidden-xs" href="#perspective" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perspective" aria-hidden="true">TOC</a></span></h3>
  47928. <p>Correct perspective of video not recorded perpendicular to the screen.
  47929. </p>
  47930. <p>A description of the accepted parameters follows.
  47931. </p>
  47932. <dl class="table">
  47933. <dt><samp class="option">x0</samp></dt>
  47934. <dt><samp class="option">y0</samp></dt>
  47935. <dt><samp class="option">x1</samp></dt>
  47936. <dt><samp class="option">y1</samp></dt>
  47937. <dt><samp class="option">x2</samp></dt>
  47938. <dt><samp class="option">y2</samp></dt>
  47939. <dt><samp class="option">x3</samp></dt>
  47940. <dt><samp class="option">y3</samp></dt>
  47941. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  47942. Default values are <code class="code">0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  47943. If the <code class="code">sense</code> option is set to <code class="code">source</code>, then the specified points will be sent
  47944. to the corners of the destination. If the <code class="code">sense</code> option is set to <code class="code">destination</code>,
  47945. then the corners of the source will be sent to the specified coordinates.
  47946. </p>
  47947. <p>The expressions can use the following variables:
  47948. </p>
  47949. <dl class="table">
  47950. <dt><samp class="option">W</samp></dt>
  47951. <dt><samp class="option">H</samp></dt>
  47952. <dd><p>the width and height of video frame.
  47953. </p></dd>
  47954. <dt><samp class="option">in</samp></dt>
  47955. <dd><p>Input frame count.
  47956. </p></dd>
  47957. <dt><samp class="option">on</samp></dt>
  47958. <dd><p>Output frame count.
  47959. </p></dd>
  47960. </dl>
  47961. </dd>
  47962. <dt><samp class="option">interpolation</samp></dt>
  47963. <dd><p>Set interpolation for perspective correction.
  47964. </p>
  47965. <p>It accepts the following values:
  47966. </p><dl class="table">
  47967. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  47968. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  47969. </dl>
  47970. <p>Default value is &lsquo;<samp class="samp">linear</samp>&rsquo;.
  47971. </p>
  47972. </dd>
  47973. <dt><samp class="option">sense</samp></dt>
  47974. <dd><p>Set interpretation of coordinate options.
  47975. </p>
  47976. <p>It accepts the following values:
  47977. </p><dl class="table">
  47978. <dt>&lsquo;<samp class="samp">0, source</samp>&rsquo;</dt>
  47979. <dd>
  47980. <p>Send point in the source specified by the given coordinates to
  47981. the corners of the destination.
  47982. </p>
  47983. </dd>
  47984. <dt>&lsquo;<samp class="samp">1, destination</samp>&rsquo;</dt>
  47985. <dd>
  47986. <p>Send the corners of the source to the point in the destination specified
  47987. by the given coordinates.
  47988. </p>
  47989. <p>Default value is &lsquo;<samp class="samp">source</samp>&rsquo;.
  47990. </p></dd>
  47991. </dl>
  47992. </dd>
  47993. <dt><samp class="option">eval</samp></dt>
  47994. <dd><p>Set when the expressions for coordinates <samp class="option">x0,y0,...x3,y3</samp> are evaluated.
  47995. </p>
  47996. <p>It accepts the following values:
  47997. </p><dl class="table">
  47998. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  47999. <dd><p>only evaluate expressions once during the filter initialization or
  48000. when a command is processed
  48001. </p>
  48002. </dd>
  48003. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  48004. <dd><p>evaluate expressions for each incoming frame
  48005. </p></dd>
  48006. </dl>
  48007. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  48008. </p></dd>
  48009. </dl>
  48010. <a name="phase"></a>
  48011. <h3 class="section">39.188 phase<span class="pull-right"><a class="anchor hidden-xs" href="#phase" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phase" aria-hidden="true">TOC</a></span></h3>
  48012. <p>Delay interlaced video by one field time so that the field order changes.
  48013. </p>
  48014. <p>The intended use is to fix PAL movies that have been captured with the
  48015. opposite field order to the film-to-video transfer.
  48016. </p>
  48017. <p>A description of the accepted parameters follows.
  48018. </p>
  48019. <dl class="table">
  48020. <dt><samp class="option">mode</samp></dt>
  48021. <dd><p>Set phase mode.
  48022. </p>
  48023. <p>It accepts the following values:
  48024. </p><dl class="table">
  48025. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  48026. <dd><p>Capture field order top-first, transfer bottom-first.
  48027. Filter will delay the bottom field.
  48028. </p>
  48029. </dd>
  48030. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  48031. <dd><p>Capture field order bottom-first, transfer top-first.
  48032. Filter will delay the top field.
  48033. </p>
  48034. </dd>
  48035. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  48036. <dd><p>Capture and transfer with the same field order. This mode only exists
  48037. for the documentation of the other options to refer to, but if you
  48038. actually select it, the filter will faithfully do nothing.
  48039. </p>
  48040. </dd>
  48041. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  48042. <dd><p>Capture field order determined automatically by field flags, transfer
  48043. opposite.
  48044. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">b</samp>&rsquo; modes on a frame by frame
  48045. basis using field flags. If no field information is available,
  48046. then this works just like &lsquo;<samp class="samp">u</samp>&rsquo;.
  48047. </p>
  48048. </dd>
  48049. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  48050. <dd><p>Capture unknown or varying, transfer opposite.
  48051. 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
  48052. analyzing the images and selecting the alternative that produces best
  48053. match between the fields.
  48054. </p>
  48055. </dd>
  48056. <dt>&lsquo;<samp class="samp">T</samp>&rsquo;</dt>
  48057. <dd><p>Capture top-first, transfer unknown or varying.
  48058. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  48059. </p>
  48060. </dd>
  48061. <dt>&lsquo;<samp class="samp">B</samp>&rsquo;</dt>
  48062. <dd><p>Capture bottom-first, transfer unknown or varying.
  48063. Filter selects among &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  48064. </p>
  48065. </dd>
  48066. <dt>&lsquo;<samp class="samp">A</samp>&rsquo;</dt>
  48067. <dd><p>Capture determined by field flags, transfer unknown or varying.
  48068. 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
  48069. image analysis. If no field information is available, then this works just
  48070. like &lsquo;<samp class="samp">U</samp>&rsquo;. This is the default mode.
  48071. </p>
  48072. </dd>
  48073. <dt>&lsquo;<samp class="samp">U</samp>&rsquo;</dt>
  48074. <dd><p>Both capture and transfer unknown or varying.
  48075. 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.
  48076. </p></dd>
  48077. </dl>
  48078. </dd>
  48079. </dl>
  48080. <a name="Commands-129"></a>
  48081. <h4 class="subsection">39.188.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-129" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-129" aria-hidden="true">TOC</a></span></h4>
  48082. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  48083. </p>
  48084. <a name="photosensitivity"></a>
  48085. <h3 class="section">39.189 photosensitivity<span class="pull-right"><a class="anchor hidden-xs" href="#photosensitivity" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-photosensitivity" aria-hidden="true">TOC</a></span></h3>
  48086. <p>Reduce various flashes in video, so to help users with epilepsy.
  48087. </p>
  48088. <p>It accepts the following options:
  48089. </p><dl class="table">
  48090. <dt><samp class="option">frames, f</samp></dt>
  48091. <dd><p>Set how many frames to use when filtering. Default is 30.
  48092. </p>
  48093. </dd>
  48094. <dt><samp class="option">threshold, t</samp></dt>
  48095. <dd><p>Set detection threshold factor. Default is 1.
  48096. Lower is stricter.
  48097. </p>
  48098. </dd>
  48099. <dt><samp class="option">skip</samp></dt>
  48100. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  48101. Allowed range is from 1 to 1024.
  48102. </p>
  48103. </dd>
  48104. <dt><samp class="option">bypass</samp></dt>
  48105. <dd><p>Leave frames unchanged. Default is disabled.
  48106. </p></dd>
  48107. </dl>
  48108. <a name="pixdesctest"></a>
  48109. <h3 class="section">39.190 pixdesctest<span class="pull-right"><a class="anchor hidden-xs" href="#pixdesctest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixdesctest" aria-hidden="true">TOC</a></span></h3>
  48110. <p>Pixel format descriptor test filter, mainly useful for internal
  48111. testing. The output video should be equal to the input video.
  48112. </p>
  48113. <p>For example:
  48114. </p><div class="example">
  48115. <pre class="example-preformatted">format=monow, pixdesctest
  48116. </pre></div>
  48117. <p>can be used to test the monowhite pixel format descriptor definition.
  48118. </p>
  48119. <a name="pixelize"></a>
  48120. <h3 class="section">39.191 pixelize<span class="pull-right"><a class="anchor hidden-xs" href="#pixelize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixelize" aria-hidden="true">TOC</a></span></h3>
  48121. <p>Apply pixelization to video stream.
  48122. </p>
  48123. <p>The filter accepts the following options:
  48124. </p><dl class="table">
  48125. <dt><samp class="option">width, w</samp></dt>
  48126. <dt><samp class="option">height, h</samp></dt>
  48127. <dd><p>Set block dimensions that will be used for pixelization.
  48128. Default value is <code class="code">16</code>.
  48129. </p>
  48130. </dd>
  48131. <dt><samp class="option">mode, m</samp></dt>
  48132. <dd><p>Set the mode of pixelization used.
  48133. </p>
  48134. <p>Possible values are:
  48135. </p><dl class="table">
  48136. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  48137. <dt>&lsquo;<samp class="samp">min</samp>&rsquo;</dt>
  48138. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  48139. </dl>
  48140. <p>Default value is <code class="code">avg</code>.
  48141. </p>
  48142. </dd>
  48143. <dt><samp class="option">planes, p</samp></dt>
  48144. <dd><p>Set what planes to filter. Default is to filter all planes.
  48145. </p></dd>
  48146. </dl>
  48147. <a name="Commands-130"></a>
  48148. <h4 class="subsection">39.191.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-130" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-130" aria-hidden="true">TOC</a></span></h4>
  48149. <p>This filter supports all options as <a class="ref" href="#commands">commands</a>.
  48150. </p>
  48151. <a name="pixscope"></a>
  48152. <h3 class="section">39.192 pixscope<span class="pull-right"><a class="anchor hidden-xs" href="#pixscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixscope" aria-hidden="true">TOC</a></span></h3>
  48153. <p>Display sample values of color channels. Mainly useful for checking color
  48154. and levels. Minimum supported resolution is 640x480.
  48155. </p>
  48156. <p>The filters accept the following options:
  48157. </p>
  48158. <dl class="table">
  48159. <dt><samp class="option">x</samp></dt>
  48160. <dd><p>Set scope X position, relative offset on X axis.
  48161. </p>
  48162. </dd>
  48163. <dt><samp class="option">y</samp></dt>
  48164. <dd><p>Set scope Y position, relative offset on Y axis.
  48165. </p>
  48166. </dd>
  48167. <dt><samp class="option">w</samp></dt>
  48168. <dd><p>Set scope width.
  48169. </p>
  48170. </dd>
  48171. <dt><samp class="option">h</samp></dt>
  48172. <dd><p>Set scope height.
  48173. </p>
  48174. </dd>
  48175. <dt><samp class="option">o</samp></dt>
  48176. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  48177. </p>
  48178. </dd>
  48179. <dt><samp class="option">wx</samp></dt>
  48180. <dd><p>Set window X position, relative offset on X axis.
  48181. </p>
  48182. </dd>
  48183. <dt><samp class="option">wy</samp></dt>
  48184. <dd><p>Set window Y position, relative offset on Y axis.
  48185. </p></dd>
  48186. </dl>
  48187. <a name="Commands-131"></a>
  48188. <h4 class="subsection">39.192.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-131" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-131" aria-hidden="true">TOC</a></span></h4>
  48189. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  48190. </p>
  48191. <a name="pp7"></a>
  48192. <h3 class="section">39.193 pp7<span class="pull-right"><a class="anchor hidden-xs" href="#pp7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pp7" aria-hidden="true">TOC</a></span></h3>
  48193. <p>Apply Postprocessing filter 7. It is variant of the <a class="ref" href="#spp">spp</a> filter,
  48194. similar to spp = 6 with 7 point DCT, where only the center sample is
  48195. used after IDCT.
  48196. </p>
  48197. <p>The filter accepts the following options:
  48198. </p>
  48199. <dl class="table">
  48200. <dt><samp class="option">qp</samp></dt>
  48201. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  48202. 0 to 63. If not set, the filter will use the QP from the video stream
  48203. (if available).
  48204. </p>
  48205. </dd>
  48206. <dt><samp class="option">mode</samp></dt>
  48207. <dd><p>Set thresholding mode. Available modes are:
  48208. </p>
  48209. <dl class="table">
  48210. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  48211. <dd><p>Set hard thresholding.
  48212. </p></dd>
  48213. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  48214. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  48215. </p></dd>
  48216. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  48217. <dd><p>Set medium thresholding (good results, default).
  48218. </p></dd>
  48219. </dl>
  48220. </dd>
  48221. </dl>
  48222. <a name="premultiply"></a>
  48223. <h3 class="section">39.194 premultiply<span class="pull-right"><a class="anchor hidden-xs" href="#premultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-premultiply" aria-hidden="true">TOC</a></span></h3>
  48224. <p>Apply alpha premultiply effect to input video stream using first plane
  48225. of second stream as alpha.
  48226. </p>
  48227. <p>Both streams must have same dimensions and same pixel format.
  48228. </p>
  48229. <p>The filter accepts the following option:
  48230. </p>
  48231. <dl class="table">
  48232. <dt><samp class="option">planes</samp></dt>
  48233. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  48234. By default value 0xf, all planes will be processed.
  48235. </p>
  48236. </dd>
  48237. <dt><samp class="option">inplace</samp></dt>
  48238. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  48239. </p></dd>
  48240. </dl>
  48241. <a name="premultiply_005fdynamic"></a>
  48242. <h3 class="section">39.195 premultiply_dynamic<span class="pull-right"><a class="anchor hidden-xs" href="#premultiply_005fdynamic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-premultiply_005fdynamic" aria-hidden="true">TOC</a></span></h3>
  48243. <p>Dynamically premultiply or unpremultiply the input video stream as needed,
  48244. to match the requirements of the downstream filter graph. This is roughly
  48245. equivalent to either <code class="code">premultiply:inplace=yes</code> or
  48246. <code class="code">unpremultiply:inplace=yes</code>, or otherwise a noop.
  48247. </p>
  48248. <p>The filter accepts the following option:
  48249. </p>
  48250. <dl class="table">
  48251. <dt><samp class="option">planes</samp></dt>
  48252. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  48253. By default value 0xf, all planes will be processed.
  48254. </p></dd>
  48255. </dl>
  48256. <a name="prewitt"></a>
  48257. <h3 class="section">39.196 prewitt<span class="pull-right"><a class="anchor hidden-xs" href="#prewitt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prewitt" aria-hidden="true">TOC</a></span></h3>
  48258. <p>Apply prewitt operator to input video stream.
  48259. </p>
  48260. <p>The filter accepts the following option:
  48261. </p>
  48262. <dl class="table">
  48263. <dt><samp class="option">planes</samp></dt>
  48264. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  48265. By default value 0xf, all planes will be processed.
  48266. </p>
  48267. </dd>
  48268. <dt><samp class="option">scale</samp></dt>
  48269. <dd><p>Set value which will be multiplied with filtered result.
  48270. </p>
  48271. </dd>
  48272. <dt><samp class="option">delta</samp></dt>
  48273. <dd><p>Set value which will be added to filtered result.
  48274. </p></dd>
  48275. </dl>
  48276. <a name="Commands-132"></a>
  48277. <h4 class="subsection">39.196.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-132" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-132" aria-hidden="true">TOC</a></span></h4>
  48278. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  48279. </p>
  48280. <a name="pseudocolor"></a>
  48281. <h3 class="section">39.197 pseudocolor<span class="pull-right"><a class="anchor hidden-xs" href="#pseudocolor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pseudocolor" aria-hidden="true">TOC</a></span></h3>
  48282. <p>Alter frame colors in video with pseudocolors.
  48283. </p>
  48284. <p>This filter accepts the following options:
  48285. </p>
  48286. <dl class="table">
  48287. <dt><samp class="option">c0</samp></dt>
  48288. <dd><p>set pixel first component expression
  48289. </p>
  48290. </dd>
  48291. <dt><samp class="option">c1</samp></dt>
  48292. <dd><p>set pixel second component expression
  48293. </p>
  48294. </dd>
  48295. <dt><samp class="option">c2</samp></dt>
  48296. <dd><p>set pixel third component expression
  48297. </p>
  48298. </dd>
  48299. <dt><samp class="option">c3</samp></dt>
  48300. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  48301. </p>
  48302. </dd>
  48303. <dt><samp class="option">index, i</samp></dt>
  48304. <dd><p>set component to use as base for altering colors
  48305. </p>
  48306. </dd>
  48307. <dt><samp class="option">preset, p</samp></dt>
  48308. <dd><p>Pick one of built-in LUTs. By default is set to none.
  48309. </p>
  48310. <p>Available LUTs:
  48311. </p><dl class="table">
  48312. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  48313. <dt>&lsquo;<samp class="samp">inferno</samp>&rsquo;</dt>
  48314. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  48315. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  48316. <dt>&lsquo;<samp class="samp">turbo</samp>&rsquo;</dt>
  48317. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  48318. <dt>&lsquo;<samp class="samp">range1</samp>&rsquo;</dt>
  48319. <dt>&lsquo;<samp class="samp">range2</samp>&rsquo;</dt>
  48320. <dt>&lsquo;<samp class="samp">shadows</samp>&rsquo;</dt>
  48321. <dt>&lsquo;<samp class="samp">highlights</samp>&rsquo;</dt>
  48322. <dt>&lsquo;<samp class="samp">solar</samp>&rsquo;</dt>
  48323. <dt>&lsquo;<samp class="samp">nominal</samp>&rsquo;</dt>
  48324. <dt>&lsquo;<samp class="samp">preferred</samp>&rsquo;</dt>
  48325. <dt>&lsquo;<samp class="samp">total</samp>&rsquo;</dt>
  48326. <dt>&lsquo;<samp class="samp">spectral</samp>&rsquo;</dt>
  48327. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  48328. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  48329. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  48330. <dt>&lsquo;<samp class="samp">blues</samp>&rsquo;</dt>
  48331. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  48332. <dt>&lsquo;<samp class="samp">helix</samp>&rsquo;</dt>
  48333. </dl>
  48334. </dd>
  48335. <dt><samp class="option">opacity</samp></dt>
  48336. <dd><p>Set opacity of output colors. Allowed range is from 0 to 1.
  48337. Default value is set to 1.
  48338. </p></dd>
  48339. </dl>
  48340. <p>Each of the expression options specifies the expression to use for computing
  48341. the lookup table for the corresponding pixel component values.
  48342. </p>
  48343. <p>The expressions can contain the following constants and functions:
  48344. </p>
  48345. <dl class="table">
  48346. <dt><samp class="option">w</samp></dt>
  48347. <dt><samp class="option">h</samp></dt>
  48348. <dd><p>The input width and height.
  48349. </p>
  48350. </dd>
  48351. <dt><samp class="option">val</samp></dt>
  48352. <dd><p>The input value for the pixel component.
  48353. </p>
  48354. </dd>
  48355. <dt><samp class="option">ymin, umin, vmin, amin</samp></dt>
  48356. <dd><p>The minimum allowed component value.
  48357. </p>
  48358. </dd>
  48359. <dt><samp class="option">ymax, umax, vmax, amax</samp></dt>
  48360. <dd><p>The maximum allowed component value.
  48361. </p></dd>
  48362. </dl>
  48363. <p>All expressions default to &quot;val&quot;.
  48364. </p>
  48365. <a name="Commands-133"></a>
  48366. <h4 class="subsection">39.197.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-133" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-133" aria-hidden="true">TOC</a></span></h4>
  48367. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  48368. </p>
  48369. <a name="Examples-151"></a>
  48370. <h4 class="subsection">39.197.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-151" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-151" aria-hidden="true">TOC</a></span></h4>
  48371. <ul class="itemize mark-bullet">
  48372. <li>Change too high luma values to gradient:
  48373. <div class="example">
  48374. <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;
  48375. </pre></div>
  48376. </li></ul>
  48377. <a class="anchor" id="psnr"></a><a name="psnr-1"></a>
  48378. <h3 class="section">39.198 psnr<span class="pull-right"><a class="anchor hidden-xs" href="#psnr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-psnr-1" aria-hidden="true">TOC</a></span></h3>
  48379. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  48380. Ratio) between two input videos.
  48381. </p>
  48382. <p>This filter takes in input two input videos, the first input is
  48383. considered the &quot;main&quot; source and is passed unchanged to the
  48384. output. The second input is used as a &quot;reference&quot; video for computing
  48385. the PSNR.
  48386. </p>
  48387. <p>Both video inputs must have the same resolution and pixel format for
  48388. this filter to work correctly. Also it assumes that both inputs
  48389. have the same number of frames, which are compared one by one.
  48390. </p>
  48391. <p>The obtained average PSNR is printed through the logging system.
  48392. </p>
  48393. <p>The filter stores the accumulated MSE (mean squared error) of each
  48394. frame, and at the end of the processing it is averaged across all frames
  48395. equally, and the following formula is applied to obtain the PSNR:
  48396. </p>
  48397. <div class="example">
  48398. <pre class="example-preformatted">PSNR = 10*log10(MAX^2/MSE)
  48399. </pre></div>
  48400. <p>Where MAX is the average of the maximum values of each component of the
  48401. image.
  48402. </p>
  48403. <p>The description of the accepted parameters follows.
  48404. </p>
  48405. <dl class="table">
  48406. <dt><samp class="option">stats_file, f</samp></dt>
  48407. <dd><p>If specified the filter will use the named file to save the PSNR of
  48408. each individual frame. When filename equals &quot;-&quot; the data is sent to
  48409. standard output.
  48410. </p>
  48411. </dd>
  48412. <dt><samp class="option">stats_version</samp></dt>
  48413. <dd><p>Specifies which version of the stats file format to use. Details of
  48414. each format are written below.
  48415. Default value is 1.
  48416. </p>
  48417. </dd>
  48418. <dt><samp class="option">output_max</samp></dt>
  48419. <dd><p>Determines whether the max value is output to the stats log.
  48420. Default value is 0.
  48421. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  48422. the filter will return an error.
  48423. </p></dd>
  48424. </dl>
  48425. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  48426. </p>
  48427. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  48428. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  48429. couple of frames.
  48430. </p>
  48431. <p>If a <var class="var">stats_version</var> greater than 1 is specified, a header line precedes
  48432. the list of per-frame-pair stats, with key value pairs following the frame
  48433. format with the following parameters:
  48434. </p>
  48435. <dl class="table">
  48436. <dt><samp class="option">psnr_log_version</samp></dt>
  48437. <dd><p>The version of the log file format. Will match <var class="var">stats_version</var>.
  48438. </p>
  48439. </dd>
  48440. <dt><samp class="option">fields</samp></dt>
  48441. <dd><p>A comma separated list of the per-frame-pair parameters included in
  48442. the log.
  48443. </p></dd>
  48444. </dl>
  48445. <p>A description of each shown per-frame-pair parameter follows:
  48446. </p>
  48447. <dl class="table">
  48448. <dt><samp class="option">n</samp></dt>
  48449. <dd><p>sequential number of the input frame, starting from 1
  48450. </p>
  48451. </dd>
  48452. <dt><samp class="option">mse_avg</samp></dt>
  48453. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  48454. frames, averaged over all the image components.
  48455. </p>
  48456. </dd>
  48457. <dt><samp class="option">mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp></dt>
  48458. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  48459. frames for the component specified by the suffix.
  48460. </p>
  48461. </dd>
  48462. <dt><samp class="option">psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp></dt>
  48463. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  48464. specified by the suffix.
  48465. </p>
  48466. </dd>
  48467. <dt><samp class="option">max_avg, max_y, max_u, max_v</samp></dt>
  48468. <dd><p>Maximum allowed value for each channel, and average over all
  48469. channels.
  48470. </p></dd>
  48471. </dl>
  48472. <a name="Examples-152"></a>
  48473. <h4 class="subsection">39.198.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-152" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-152" aria-hidden="true">TOC</a></span></h4>
  48474. <ul class="itemize mark-bullet">
  48475. <li>For example:
  48476. <div class="example">
  48477. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  48478. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  48479. </pre></div>
  48480. <p>On this example the input file being processed is compared with the
  48481. reference file <samp class="file">ref_movie.mpg</samp>. The PSNR of each individual frame
  48482. is stored in <samp class="file">stats.log</samp>.
  48483. </p>
  48484. </li><li>Another example with different containers:
  48485. <div class="example">
  48486. <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 -
  48487. </pre></div>
  48488. </li></ul>
  48489. <a class="anchor" id="pullup"></a><a name="pullup-1"></a>
  48490. <h3 class="section">39.199 pullup<span class="pull-right"><a class="anchor hidden-xs" href="#pullup-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pullup-1" aria-hidden="true">TOC</a></span></h3>
  48491. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  48492. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  48493. content.
  48494. </p>
  48495. <p>The pullup filter is designed to take advantage of future context in making
  48496. its decisions. This filter is stateless in the sense that it does not lock
  48497. onto a pattern to follow, but it instead looks forward to the following
  48498. fields in order to identify matches and rebuild progressive frames.
  48499. </p>
  48500. <p>To produce content with an even framerate, insert the fps filter after
  48501. pullup, use <code class="code">fps=24000/1001</code> if the input frame rate is 29.97fps,
  48502. <code class="code">fps=24</code> for 30fps and the (rare) telecined 25fps input.
  48503. </p>
  48504. <p>The filter accepts the following options:
  48505. </p>
  48506. <dl class="table">
  48507. <dt><samp class="option">jl</samp></dt>
  48508. <dt><samp class="option">jr</samp></dt>
  48509. <dt><samp class="option">jt</samp></dt>
  48510. <dt><samp class="option">jb</samp></dt>
  48511. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  48512. bottom of the image, respectively. Left and right are in units of 8 pixels,
  48513. while top and bottom are in units of 2 lines.
  48514. The default is 8 pixels on each side.
  48515. </p>
  48516. </dd>
  48517. <dt><samp class="option">sb</samp></dt>
  48518. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  48519. filter generating an occasional mismatched frame, but it may also cause an
  48520. excessive number of frames to be dropped during high motion sequences.
  48521. Conversely, setting it to -1 will make filter match fields more easily.
  48522. This may help processing of video where there is slight blurring between
  48523. the fields, but may also cause there to be interlaced frames in the output.
  48524. Default value is <code class="code">0</code>.
  48525. </p>
  48526. </dd>
  48527. <dt><samp class="option">mp</samp></dt>
  48528. <dd><p>Set the metric plane to use. It accepts the following values:
  48529. </p><dl class="table">
  48530. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  48531. <dd><p>Use luma plane.
  48532. </p>
  48533. </dd>
  48534. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  48535. <dd><p>Use chroma blue plane.
  48536. </p>
  48537. </dd>
  48538. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  48539. <dd><p>Use chroma red plane.
  48540. </p></dd>
  48541. </dl>
  48542. <p>This option may be set to use chroma plane instead of the default luma plane
  48543. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  48544. source material, but more likely will decrease accuracy, especially if there
  48545. is chroma noise (rainbow effect) or any grayscale video.
  48546. The main purpose of setting <samp class="option">mp</samp> to a chroma plane is to reduce CPU
  48547. load and make pullup usable in realtime on slow machines.
  48548. </p></dd>
  48549. </dl>
  48550. <p>For best results (without duplicated frames in the output file) it is
  48551. necessary to change the output frame rate. For example, to inverse
  48552. telecine NTSC input:
  48553. </p><div class="example">
  48554. <pre class="example-preformatted">ffmpeg -i input -vf pullup -r 24000/1001 ...
  48555. </pre></div>
  48556. <a name="qp"></a>
  48557. <h3 class="section">39.200 qp<span class="pull-right"><a class="anchor hidden-xs" href="#qp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qp" aria-hidden="true">TOC</a></span></h3>
  48558. <p>Change video quantization parameters (QP).
  48559. </p>
  48560. <p>The filter accepts the following option:
  48561. </p>
  48562. <dl class="table">
  48563. <dt><samp class="option">qp</samp></dt>
  48564. <dd><p>Set expression for quantization parameter.
  48565. </p></dd>
  48566. </dl>
  48567. <p>The expression is evaluated through the eval API and can contain, among others,
  48568. the following constants:
  48569. </p>
  48570. <dl class="table">
  48571. <dt><var class="var">known</var></dt>
  48572. <dd><p>1 if index is not 129, 0 otherwise.
  48573. </p>
  48574. </dd>
  48575. <dt><var class="var">qp</var></dt>
  48576. <dd><p>Sequential index starting from -129 to 128.
  48577. </p></dd>
  48578. </dl>
  48579. <a name="Examples-153"></a>
  48580. <h4 class="subsection">39.200.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-153" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-153" aria-hidden="true">TOC</a></span></h4>
  48581. <ul class="itemize mark-bullet">
  48582. <li>Some equation like:
  48583. <div class="example">
  48584. <pre class="example-preformatted">qp=2+2*sin(PI*qp)
  48585. </pre></div>
  48586. </li></ul>
  48587. <a name="qrencode"></a>
  48588. <h3 class="section">39.201 qrencode<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode" aria-hidden="true">TOC</a></span></h3>
  48589. <p>Generate a QR code using the libqrencode library (see
  48590. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>), and overlay it on top of the current
  48591. frame.
  48592. </p>
  48593. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  48594. <code class="code">--enable-libqrencode</code>.
  48595. </p>
  48596. <p>The QR code is generated from the provided text or text pattern. The
  48597. corresponding QR code is scaled and overlaid into the video output according to
  48598. the specified options.
  48599. </p>
  48600. <p>In case no text is specified, no QR code is overlaied.
  48601. </p>
  48602. <p>This filter accepts the following options:
  48603. </p>
  48604. <dl class="table">
  48605. <dt><samp class="option">qrcode_width, q</samp></dt>
  48606. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  48607. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  48608. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  48609. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  48610. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  48611. there is no padding.
  48612. </p>
  48613. <p>These expressions are evaluated for each new frame.
  48614. </p>
  48615. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  48616. </p>
  48617. </dd>
  48618. <dt><samp class="option">x</samp></dt>
  48619. <dt><samp class="option">y</samp></dt>
  48620. <dd><p>Specify an expression for positioning the padded QR code top-left corner. The
  48621. <var class="var">x</var> expression can reference the value set by the <var class="var">y</var> expression, and
  48622. vice.
  48623. </p>
  48624. <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
  48625. is placed in the top left corner of the input.
  48626. </p>
  48627. <p>These expressions are evaluated for each new frame.
  48628. </p>
  48629. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  48630. </p>
  48631. </dd>
  48632. <dt><samp class="option">case_sensitive, cs</samp></dt>
  48633. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  48634. default. This can be disabled to reduce the QR encoding size.
  48635. </p>
  48636. </dd>
  48637. <dt><samp class="option">level, l</samp></dt>
  48638. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  48639. the encoding size will increase but the code will be more robust to corruption.
  48640. Lower level is <var class="var">L</var>.
  48641. </p>
  48642. <p>It accepts the following values:
  48643. </p><dl class="table">
  48644. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  48645. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  48646. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  48647. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  48648. </dl>
  48649. </dd>
  48650. <dt><samp class="option">expansion</samp></dt>
  48651. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  48652. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  48653. section below for details.
  48654. </p>
  48655. </dd>
  48656. <dt><samp class="option">text</samp></dt>
  48657. <dt><samp class="option">textfile</samp></dt>
  48658. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  48659. (just an empty colored frame).
  48660. </p>
  48661. <p>In case expansion is enabled, the text is treated as a text template, using the
  48662. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  48663. Text expansion</a> section below for details.
  48664. </p>
  48665. </dd>
  48666. <dt><samp class="option">background_color, bc</samp></dt>
  48667. <dt><samp class="option">foreground_color, fc</samp></dt>
  48668. <dd><p>Set the QR code and background color. The default value of
  48669. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  48670. is &quot;white&quot;.
  48671. </p>
  48672. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  48673. section in the ffmpeg-utils manual</a>.
  48674. </p></dd>
  48675. </dl>
  48676. <a class="anchor" id="qrencode_005fexpressions"></a><a name="qrencode-Expressions"></a>
  48677. <h4 class="subsection">39.201.1 qrencode Expressions<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode-Expressions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode-Expressions" aria-hidden="true">TOC</a></span></h4>
  48678. <p>The expressions set by the options contain the following constants and functions.
  48679. </p>
  48680. <dl class="table">
  48681. <dt><samp class="option">dar</samp></dt>
  48682. <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>
  48683. </p>
  48684. </dd>
  48685. <dt><samp class="option">duration</samp></dt>
  48686. <dd><p>the current frame&rsquo;s duration, in seconds
  48687. </p>
  48688. </dd>
  48689. <dt><samp class="option">hsub</samp></dt>
  48690. <dt><samp class="option">vsub</samp></dt>
  48691. <dd><p>horizontal and vertical chroma subsample values. For example for the
  48692. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  48693. </p>
  48694. </dd>
  48695. <dt><samp class="option">main_h, H</samp></dt>
  48696. <dd><p>the input height
  48697. </p>
  48698. </dd>
  48699. <dt><samp class="option">main_w, W</samp></dt>
  48700. <dd><p>the input width
  48701. </p>
  48702. </dd>
  48703. <dt><samp class="option">n</samp></dt>
  48704. <dd><p>the number of input frame, starting from 0
  48705. </p>
  48706. </dd>
  48707. <dt><samp class="option">pict_type</samp></dt>
  48708. <dd><p>a number representing the picture type
  48709. </p>
  48710. </dd>
  48711. <dt><samp class="option">qr_w, w</samp></dt>
  48712. <dd><p>the width of the encoded QR code
  48713. </p>
  48714. </dd>
  48715. <dt><samp class="option">rendered_qr_w, q</samp></dt>
  48716. <dt><samp class="option">rendered_padded_qr_w, Q</samp></dt>
  48717. <dd><p>the width of the rendered QR code, without and without padding.
  48718. </p>
  48719. <p>These parameters allow the <var class="var">q</var> and <var class="var">Q</var> expressions to refer to each
  48720. other, so you can for example specify <code class="code">q=3/4*Q</code>.
  48721. </p>
  48722. </dd>
  48723. <dt><samp class="option">rand(min, max)</samp></dt>
  48724. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  48725. </p>
  48726. </dd>
  48727. <dt><samp class="option">sar</samp></dt>
  48728. <dd><p>the input sample aspect ratio
  48729. </p>
  48730. </dd>
  48731. <dt><samp class="option">t</samp></dt>
  48732. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  48733. </p>
  48734. </dd>
  48735. <dt><samp class="option">x</samp></dt>
  48736. <dt><samp class="option">y</samp></dt>
  48737. <dd><p>the x and y offset coordinates where the text is drawn.
  48738. </p>
  48739. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer to each
  48740. other, so you can for example specify <code class="code">y=x/dar</code>.
  48741. </p></dd>
  48742. </dl>
  48743. <a class="anchor" id="qrencode_005ftext_005fexpansion"></a><a name="qrencode-Text-expansion"></a>
  48744. <h4 class="subsection">39.201.2 qrencode Text expansion<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode-Text-expansion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode-Text-expansion" aria-hidden="true">TOC</a></span></h4>
  48745. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  48746. </p>
  48747. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  48748. the following expansion mechanism is used.
  48749. </p>
  48750. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  48751. the second character.
  48752. </p>
  48753. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  48754. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  48755. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  48756. they should be escaped.
  48757. </p>
  48758. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  48759. option in the filter argument string and as the filter argument in the
  48760. filtergraph description, and possibly also for the shell, that makes up to four
  48761. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  48762. these problems.
  48763. </p>
  48764. <p>The following functions are available:
  48765. </p>
  48766. <dl class="table">
  48767. <dt><code class="command">n, frame_num</code></dt>
  48768. <dd><p>return the frame number
  48769. </p>
  48770. </dd>
  48771. <dt><code class="command">pts</code></dt>
  48772. <dd><p>Return the presentation timestamp of the current frame.
  48773. </p>
  48774. <p>It can take up to two arguments.
  48775. </p>
  48776. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code> for
  48777. seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands for a
  48778. formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  48779. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  48780. <code class="code">localtime</code> stands for the timestamp of the frame formatted as local time
  48781. zone time. If the format is set to <code class="code">hms24hh</code>, the time is formatted in 24h
  48782. format (00-23).
  48783. </p>
  48784. <p>The second argument is an offset added to the timestamp.
  48785. </p>
  48786. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third argument may
  48787. be supplied: a <code class="code">strftime</code> C function format string. By default,
  48788. <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  48789. </p>
  48790. </dd>
  48791. <dt><code class="command">expr, e</code></dt>
  48792. <dd><p>Evaluate the expression&rsquo;s value and output as a double.
  48793. </p>
  48794. <p>It must take one argument specifying the expression to be evaluated, accepting
  48795. the constants and functions defined in <a class="ref" href="#qrencode_005fexpressions">qrencode_expressions</a>.
  48796. </p>
  48797. </dd>
  48798. <dt><code class="command">expr_formatted, ef</code></dt>
  48799. <dd><p>Evaluate the expression&rsquo;s value and output as a formatted string.
  48800. </p>
  48801. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  48802. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  48803. &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
  48804. <code class="code">printf</code> function.
  48805. The third parameter is optional and sets the number of positions taken by the output.
  48806. It can be used to add padding with zeros from the left.
  48807. </p>
  48808. </dd>
  48809. <dt><code class="command">gmtime</code></dt>
  48810. <dd><p>The time at which the filter is running, expressed in UTC.
  48811. It can accept an argument: a <code class="code">strftime</code> C function format string.
  48812. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  48813. which prints fractions of the second with optionally specified number of digits.
  48814. </p>
  48815. </dd>
  48816. <dt><code class="command">localtime</code></dt>
  48817. <dd><p>The time at which the filter is running, expressed in the local time zone.
  48818. It can accept an argument: a <code class="code">strftime</code> C function format string.
  48819. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  48820. which prints fractions of the second with optionally specified number of digits.
  48821. </p>
  48822. </dd>
  48823. <dt><code class="command">metadata</code></dt>
  48824. <dd><p>Frame metadata. Takes one or two arguments.
  48825. </p>
  48826. <p>The first argument is mandatory and specifies the metadata key.
  48827. </p>
  48828. <p>The second argument is optional and specifies a default value, used when the
  48829. metadata key is not found or empty.
  48830. </p>
  48831. <p>Available metadata can be identified by inspecting entries starting with TAG
  48832. included within each frame section printed by running <code class="code">ffprobe
  48833. -show_frames</code>.
  48834. </p>
  48835. <p>String metadata generated in filters leading to the qrencode filter are also
  48836. available.
  48837. </p>
  48838. </dd>
  48839. <dt><code class="command">rand(min, max)</code></dt>
  48840. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  48841. </p></dd>
  48842. </dl>
  48843. <a name="Examples-154"></a>
  48844. <h4 class="subsection">39.201.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-154" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-154" aria-hidden="true">TOC</a></span></h4>
  48845. <ul class="itemize mark-bullet">
  48846. <li>Generate a QR code encoding the specified text with the default size, overalaid
  48847. in the top left corner of the input video, with the default size:
  48848. <div class="example">
  48849. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org
  48850. </pre></div>
  48851. </li><li>Same as below, but select blue on pink colors:
  48852. <div class="example">
  48853. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:bc=pink@0.5:fc=blue
  48854. </pre></div>
  48855. </li><li>Place the QR code in the bottom right corner of the input video:
  48856. <div class="example">
  48857. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:x=W-Q:y=H-Q
  48858. </pre></div>
  48859. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  48860. 4/3 of the QR code width:
  48861. <div class="example">
  48862. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=200:Q=4/3*q
  48863. </pre></div>
  48864. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  48865. code width 3/4 of the padded width:
  48866. <div class="example">
  48867. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:Q=200:q=3/4*Q
  48868. </pre></div>
  48869. </li><li>Make the QR code a fraction of the input video width:
  48870. <div class="example">
  48871. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=W/5
  48872. </pre></div>
  48873. </li><li>Generate a QR code encoding the frame number:
  48874. <div class="example">
  48875. <pre class="example-preformatted">qrencode=text=%{n}
  48876. </pre></div>
  48877. </li><li>Generate a QR code encoding the GMT timestamp:
  48878. <div class="example">
  48879. <pre class="example-preformatted">qrencode=text=%{gmtime}
  48880. </pre></div>
  48881. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  48882. <div class="example">
  48883. <pre class="example-preformatted">qrencode=text=%{pts}
  48884. </pre></div>
  48885. </li></ul>
  48886. <a name="quirc"></a>
  48887. <h3 class="section">39.202 quirc<span class="pull-right"><a class="anchor hidden-xs" href="#quirc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-quirc" aria-hidden="true">TOC</a></span></h3>
  48888. <p>Identify and decode a QR code using the libquirc library (see
  48889. <a class="url" href="https://github.com/dlbeer/quirc/">https://github.com/dlbeer/quirc/</a>), and print the identified QR codes
  48890. positions and payload as metadata.
  48891. </p>
  48892. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  48893. <code class="code">--enable-libquirc</code>.
  48894. </p>
  48895. <p>For each found QR code in the input video, some metadata entries are added with
  48896. the prefix <var class="var">lavfi.quirc.N</var>, where <var class="var">N</var> is the index, starting from 0,
  48897. associated to the QR code.
  48898. </p>
  48899. <p>A description of each metadata value follows:
  48900. </p>
  48901. <dl class="table">
  48902. <dt><samp class="option">lavfi.quirc.count</samp></dt>
  48903. <dd><p>the number of found QR codes, it is not set in case none was found
  48904. </p>
  48905. </dd>
  48906. <dt><samp class="option">lavfi.quirc.N.corner.M.x</samp></dt>
  48907. <dt><samp class="option">lavfi.quirc.N.coreer.M.y</samp></dt>
  48908. <dd><p>the x/y positions of the four corners of the square containing the QR code,
  48909. where <var class="var">M</var> is the index of the corner starting from 0
  48910. </p>
  48911. </dd>
  48912. <dt><samp class="option">lavfi.quirc.N.payload</samp></dt>
  48913. <dd><p>the payload of the QR code
  48914. </p></dd>
  48915. </dl>
  48916. <a name="random"></a>
  48917. <h3 class="section">39.203 random<span class="pull-right"><a class="anchor hidden-xs" href="#random" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-random" aria-hidden="true">TOC</a></span></h3>
  48918. <p>Flush video frames from internal cache of frames into a random order.
  48919. No frame is discarded.
  48920. Inspired by <a class="ref" href="#frei0r">frei0r</a> nervous filter.
  48921. </p>
  48922. <dl class="table">
  48923. <dt><samp class="option">frames</samp></dt>
  48924. <dd><p>Set size in number of frames of internal cache, in range from <code class="code">2</code> to
  48925. <code class="code">512</code>. Default is <code class="code">30</code>.
  48926. </p>
  48927. </dd>
  48928. <dt><samp class="option">seed</samp></dt>
  48929. <dd><p>Set seed for random number generator, must be an integer included between
  48930. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  48931. less than <code class="code">0</code>, the filter will try to use a good random seed on a
  48932. best effort basis.
  48933. </p></dd>
  48934. </dl>
  48935. <a name="readeia608"></a>
  48936. <h3 class="section">39.204 readeia608<span class="pull-right"><a class="anchor hidden-xs" href="#readeia608" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-readeia608" aria-hidden="true">TOC</a></span></h3>
  48937. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  48938. </p>
  48939. <p>This filter adds frame metadata for <code class="code">lavfi.readeia608.X.cc</code> and
  48940. <code class="code">lavfi.readeia608.X.line</code>, where <code class="code">X</code> is the number of the identified line
  48941. with EIA-608 data (starting from 0). A description of each metadata value follows:
  48942. </p>
  48943. <dl class="table">
  48944. <dt><samp class="option">lavfi.readeia608.X.cc</samp></dt>
  48945. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  48946. </p>
  48947. </dd>
  48948. <dt><samp class="option">lavfi.readeia608.X.line</samp></dt>
  48949. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  48950. </p></dd>
  48951. </dl>
  48952. <p>This filter accepts the following options:
  48953. </p>
  48954. <dl class="table">
  48955. <dt><samp class="option">scan_min</samp></dt>
  48956. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code class="code">0</code>.
  48957. </p>
  48958. </dd>
  48959. <dt><samp class="option">scan_max</samp></dt>
  48960. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code class="code">29</code>.
  48961. </p>
  48962. </dd>
  48963. <dt><samp class="option">spw</samp></dt>
  48964. <dd><p>Set the ratio of width reserved for sync code detection.
  48965. Default is <code class="code">0.27</code>. Allowed range is <code class="code">[0.1 - 0.7]</code>.
  48966. </p>
  48967. </dd>
  48968. <dt><samp class="option">chp</samp></dt>
  48969. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  48970. <code class="code">0x00</code> for that character. Default is false.
  48971. </p>
  48972. </dd>
  48973. <dt><samp class="option">lp</samp></dt>
  48974. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  48975. </p></dd>
  48976. </dl>
  48977. <a name="Commands-134"></a>
  48978. <h4 class="subsection">39.204.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-134" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-134" aria-hidden="true">TOC</a></span></h4>
  48979. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  48980. </p>
  48981. <a name="Examples-155"></a>
  48982. <h4 class="subsection">39.204.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-155" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-155" aria-hidden="true">TOC</a></span></h4>
  48983. <ul class="itemize mark-bullet">
  48984. <li>Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  48985. <div class="example">
  48986. <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
  48987. </pre></div>
  48988. </li></ul>
  48989. <a name="readvitc"></a>
  48990. <h3 class="section">39.205 readvitc<span class="pull-right"><a class="anchor hidden-xs" href="#readvitc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-readvitc" aria-hidden="true">TOC</a></span></h3>
  48991. <p>Read vertical interval timecode (VITC) information from the top lines of a
  48992. video frame.
  48993. </p>
  48994. <p>The filter adds frame metadata key <code class="code">lavfi.readvitc.tc_str</code> with the
  48995. timecode value, if a valid timecode has been detected. Further metadata key
  48996. <code class="code">lavfi.readvitc.found</code> is set to 0/1 depending on whether
  48997. timecode data has been found or not.
  48998. </p>
  48999. <p>This filter accepts the following options:
  49000. </p>
  49001. <dl class="table">
  49002. <dt><samp class="option">scan_max</samp></dt>
  49003. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  49004. <code class="code">-1</code> the full video frame is scanned. Default is <code class="code">45</code>.
  49005. </p>
  49006. </dd>
  49007. <dt><samp class="option">thr_b</samp></dt>
  49008. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  49009. default value is <code class="code">0.2</code>. The value must be equal or less than <code class="code">thr_w</code>.
  49010. </p>
  49011. </dd>
  49012. <dt><samp class="option">thr_w</samp></dt>
  49013. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  49014. default value is <code class="code">0.6</code>. The value must be equal or greater than <code class="code">thr_b</code>.
  49015. </p></dd>
  49016. </dl>
  49017. <a name="Examples-156"></a>
  49018. <h4 class="subsection">39.205.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-156" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-156" aria-hidden="true">TOC</a></span></h4>
  49019. <ul class="itemize mark-bullet">
  49020. <li>Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  49021. draw <code class="code">--:--:--:--</code> as a placeholder:
  49022. <div class="example">
  49023. <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'
  49024. </pre></div>
  49025. </li></ul>
  49026. <a name="remap"></a>
  49027. <h3 class="section">39.206 remap<span class="pull-right"><a class="anchor hidden-xs" href="#remap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remap" aria-hidden="true">TOC</a></span></h3>
  49028. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  49029. </p>
  49030. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  49031. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  49032. value for pixel will be used for destination pixel.
  49033. </p>
  49034. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  49035. will have Xmap/Ymap video stream dimensions.
  49036. Xmap and Ymap input video streams are 16bit depth, single channel.
  49037. </p>
  49038. <dl class="table">
  49039. <dt><samp class="option">format</samp></dt>
  49040. <dd><p>Specify pixel format of output from this filter. Can be <code class="code">color</code> or <code class="code">gray</code>.
  49041. Default is <code class="code">color</code>.
  49042. </p>
  49043. </dd>
  49044. <dt><samp class="option">fill</samp></dt>
  49045. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  49046. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  49047. manual</a>. Default color is <code class="code">black</code>.
  49048. </p></dd>
  49049. </dl>
  49050. <a name="removegrain"></a>
  49051. <h3 class="section">39.207 removegrain<span class="pull-right"><a class="anchor hidden-xs" href="#removegrain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removegrain" aria-hidden="true">TOC</a></span></h3>
  49052. <p>The removegrain filter is a spatial denoiser for progressive video.
  49053. </p>
  49054. <dl class="table">
  49055. <dt><samp class="option">m0</samp></dt>
  49056. <dd><p>Set mode for the first plane.
  49057. </p>
  49058. </dd>
  49059. <dt><samp class="option">m1</samp></dt>
  49060. <dd><p>Set mode for the second plane.
  49061. </p>
  49062. </dd>
  49063. <dt><samp class="option">m2</samp></dt>
  49064. <dd><p>Set mode for the third plane.
  49065. </p>
  49066. </dd>
  49067. <dt><samp class="option">m3</samp></dt>
  49068. <dd><p>Set mode for the fourth plane.
  49069. </p></dd>
  49070. </dl>
  49071. <p>Range of mode is from 0 to 24. Description of each mode follows:
  49072. </p>
  49073. <dl class="table">
  49074. <dt><var class="var">0</var></dt>
  49075. <dd><p>Leave input plane unchanged. Default.
  49076. </p>
  49077. </dd>
  49078. <dt><var class="var">1</var></dt>
  49079. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  49080. </p>
  49081. </dd>
  49082. <dt><var class="var">2</var></dt>
  49083. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  49084. </p>
  49085. </dd>
  49086. <dt><var class="var">3</var></dt>
  49087. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  49088. </p>
  49089. </dd>
  49090. <dt><var class="var">4</var></dt>
  49091. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  49092. This is equivalent to a median filter.
  49093. </p>
  49094. </dd>
  49095. <dt><var class="var">5</var></dt>
  49096. <dd><p>Line-sensitive clipping giving the minimal change.
  49097. </p>
  49098. </dd>
  49099. <dt><var class="var">6</var></dt>
  49100. <dd><p>Line-sensitive clipping, intermediate.
  49101. </p>
  49102. </dd>
  49103. <dt><var class="var">7</var></dt>
  49104. <dd><p>Line-sensitive clipping, intermediate.
  49105. </p>
  49106. </dd>
  49107. <dt><var class="var">8</var></dt>
  49108. <dd><p>Line-sensitive clipping, intermediate.
  49109. </p>
  49110. </dd>
  49111. <dt><var class="var">9</var></dt>
  49112. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  49113. </p>
  49114. </dd>
  49115. <dt><var class="var">10</var></dt>
  49116. <dd><p>Replaces the target pixel with the closest neighbour.
  49117. </p>
  49118. </dd>
  49119. <dt><var class="var">11</var></dt>
  49120. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  49121. </p>
  49122. </dd>
  49123. <dt><var class="var">12</var></dt>
  49124. <dd><p>Same as mode 11.
  49125. </p>
  49126. </dd>
  49127. <dt><var class="var">13</var></dt>
  49128. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  49129. pixels are the closest.
  49130. </p>
  49131. </dd>
  49132. <dt><var class="var">14</var></dt>
  49133. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  49134. pixels are the closest.
  49135. </p>
  49136. </dd>
  49137. <dt><var class="var">15</var></dt>
  49138. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  49139. interpolation formula.
  49140. </p>
  49141. </dd>
  49142. <dt><var class="var">16</var></dt>
  49143. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  49144. interpolation formula.
  49145. </p>
  49146. </dd>
  49147. <dt><var class="var">17</var></dt>
  49148. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  49149. minimum of each pair of opposite neighbour pixels.
  49150. </p>
  49151. </dd>
  49152. <dt><var class="var">18</var></dt>
  49153. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  49154. the current pixel is minimal.
  49155. </p>
  49156. </dd>
  49157. <dt><var class="var">19</var></dt>
  49158. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  49159. </p>
  49160. </dd>
  49161. <dt><var class="var">20</var></dt>
  49162. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  49163. </p>
  49164. </dd>
  49165. <dt><var class="var">21</var></dt>
  49166. <dd><p>Clips pixels using the averages of opposite neighbour.
  49167. </p>
  49168. </dd>
  49169. <dt><var class="var">22</var></dt>
  49170. <dd><p>Same as mode 21 but simpler and faster.
  49171. </p>
  49172. </dd>
  49173. <dt><var class="var">23</var></dt>
  49174. <dd><p>Small edge and halo removal, but reputed useless.
  49175. </p>
  49176. </dd>
  49177. <dt><var class="var">24</var></dt>
  49178. <dd><p>Similar as 23.
  49179. </p></dd>
  49180. </dl>
  49181. <a name="removelogo"></a>
  49182. <h3 class="section">39.208 removelogo<span class="pull-right"><a class="anchor hidden-xs" href="#removelogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removelogo" aria-hidden="true">TOC</a></span></h3>
  49183. <p>Suppress a TV station logo, using an image file to determine which
  49184. pixels comprise the logo. It works by filling in the pixels that
  49185. comprise the logo with neighboring pixels.
  49186. </p>
  49187. <p>The filter accepts the following options:
  49188. </p>
  49189. <dl class="table">
  49190. <dt><samp class="option">filename, f</samp></dt>
  49191. <dd><p>Set the filter bitmap file, which can be any image format supported by
  49192. libavformat. The width and height of the image file must match those of the
  49193. video stream being processed.
  49194. </p></dd>
  49195. </dl>
  49196. <p>Pixels in the provided bitmap image with a value of zero are not
  49197. considered part of the logo, non-zero pixels are considered part of
  49198. the logo. If you use white (255) for the logo and black (0) for the
  49199. rest, you will be safe. For making the filter bitmap, it is
  49200. recommended to take a screen capture of a black frame with the logo
  49201. visible, and then using a threshold filter followed by the erode
  49202. filter once or twice.
  49203. </p>
  49204. <p>If needed, little splotches can be fixed manually. Remember that if
  49205. logo pixels are not covered, the filter quality will be much
  49206. reduced. Marking too many pixels as part of the logo does not hurt as
  49207. much, but it will increase the amount of blurring needed to cover over
  49208. the image and will destroy more information than necessary, and extra
  49209. pixels will slow things down on a large logo.
  49210. </p>
  49211. <a name="repeatfields"></a>
  49212. <h3 class="section">39.209 repeatfields<span class="pull-right"><a class="anchor hidden-xs" href="#repeatfields" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-repeatfields" aria-hidden="true">TOC</a></span></h3>
  49213. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  49214. fields based on its value.
  49215. </p>
  49216. <a name="reverse"></a>
  49217. <h3 class="section">39.210 reverse<span class="pull-right"><a class="anchor hidden-xs" href="#reverse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-reverse" aria-hidden="true">TOC</a></span></h3>
  49218. <p>Reverse a video clip.
  49219. </p>
  49220. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  49221. is suggested.
  49222. </p>
  49223. <a name="Examples-157"></a>
  49224. <h4 class="subsection">39.210.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-157" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-157" aria-hidden="true">TOC</a></span></h4>
  49225. <ul class="itemize mark-bullet">
  49226. <li>Take the first 5 seconds of a clip, and reverse it.
  49227. <div class="example">
  49228. <pre class="example-preformatted">trim=end=5,reverse
  49229. </pre></div>
  49230. </li></ul>
  49231. <a name="rgbashift"></a>
  49232. <h3 class="section">39.211 rgbashift<span class="pull-right"><a class="anchor hidden-xs" href="#rgbashift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rgbashift" aria-hidden="true">TOC</a></span></h3>
  49233. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  49234. </p>
  49235. <p>The filter accepts the following options:
  49236. </p><dl class="table">
  49237. <dt><samp class="option">rh</samp></dt>
  49238. <dd><p>Set amount to shift red horizontally.
  49239. </p></dd>
  49240. <dt><samp class="option">rv</samp></dt>
  49241. <dd><p>Set amount to shift red vertically.
  49242. </p></dd>
  49243. <dt><samp class="option">gh</samp></dt>
  49244. <dd><p>Set amount to shift green horizontally.
  49245. </p></dd>
  49246. <dt><samp class="option">gv</samp></dt>
  49247. <dd><p>Set amount to shift green vertically.
  49248. </p></dd>
  49249. <dt><samp class="option">bh</samp></dt>
  49250. <dd><p>Set amount to shift blue horizontally.
  49251. </p></dd>
  49252. <dt><samp class="option">bv</samp></dt>
  49253. <dd><p>Set amount to shift blue vertically.
  49254. </p></dd>
  49255. <dt><samp class="option">ah</samp></dt>
  49256. <dd><p>Set amount to shift alpha horizontally.
  49257. </p></dd>
  49258. <dt><samp class="option">av</samp></dt>
  49259. <dd><p>Set amount to shift alpha vertically.
  49260. </p></dd>
  49261. <dt><samp class="option">edge</samp></dt>
  49262. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  49263. </p></dd>
  49264. </dl>
  49265. <a name="Commands-135"></a>
  49266. <h4 class="subsection">39.211.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-135" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-135" aria-hidden="true">TOC</a></span></h4>
  49267. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  49268. </p>
  49269. <a name="roberts"></a>
  49270. <h3 class="section">39.212 roberts<span class="pull-right"><a class="anchor hidden-xs" href="#roberts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-roberts" aria-hidden="true">TOC</a></span></h3>
  49271. <p>Apply roberts cross operator to input video stream.
  49272. </p>
  49273. <p>The filter accepts the following option:
  49274. </p>
  49275. <dl class="table">
  49276. <dt><samp class="option">planes</samp></dt>
  49277. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  49278. By default value 0xf, all planes will be processed.
  49279. </p>
  49280. </dd>
  49281. <dt><samp class="option">scale</samp></dt>
  49282. <dd><p>Set value which will be multiplied with filtered result.
  49283. </p>
  49284. </dd>
  49285. <dt><samp class="option">delta</samp></dt>
  49286. <dd><p>Set value which will be added to filtered result.
  49287. </p></dd>
  49288. </dl>
  49289. <a name="Commands-136"></a>
  49290. <h4 class="subsection">39.212.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-136" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-136" aria-hidden="true">TOC</a></span></h4>
  49291. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  49292. </p>
  49293. <a name="rotate"></a>
  49294. <h3 class="section">39.213 rotate<span class="pull-right"><a class="anchor hidden-xs" href="#rotate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rotate" aria-hidden="true">TOC</a></span></h3>
  49295. <p>Rotate video by an arbitrary angle expressed in radians.
  49296. </p>
  49297. <p>The filter accepts the following options:
  49298. </p>
  49299. <p>A description of the optional parameters follows.
  49300. </p><dl class="table">
  49301. <dt><samp class="option">angle, a</samp></dt>
  49302. <dd><p>Set an expression for the angle by which to rotate the input video
  49303. clockwise, expressed as a number of radians. A negative value will
  49304. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  49305. </p>
  49306. <p>This expression is evaluated for each frame.
  49307. </p>
  49308. </dd>
  49309. <dt><samp class="option">out_w, ow</samp></dt>
  49310. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  49311. This expression is evaluated just once during configuration.
  49312. </p>
  49313. </dd>
  49314. <dt><samp class="option">out_h, oh</samp></dt>
  49315. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  49316. This expression is evaluated just once during configuration.
  49317. </p>
  49318. </dd>
  49319. <dt><samp class="option">bilinear</samp></dt>
  49320. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  49321. it. Default value is 1.
  49322. </p>
  49323. </dd>
  49324. <dt><samp class="option">fillcolor, c</samp></dt>
  49325. <dd><p>Set the color used to fill the output area not covered by the rotated
  49326. image. For the general syntax of this option, check the
  49327. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  49328. If the special value &quot;none&quot; is selected then no
  49329. background is printed (useful for example if the background is never shown).
  49330. </p>
  49331. <p>Default value is &quot;black&quot;.
  49332. </p></dd>
  49333. </dl>
  49334. <p>The expressions for the angle and the output size can contain the
  49335. following constants and functions:
  49336. </p>
  49337. <dl class="table">
  49338. <dt><samp class="option">n</samp></dt>
  49339. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  49340. before the first frame is filtered.
  49341. </p>
  49342. </dd>
  49343. <dt><samp class="option">t</samp></dt>
  49344. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  49345. configured. It is always NAN before the first frame is filtered.
  49346. </p>
  49347. </dd>
  49348. <dt><samp class="option">hsub</samp></dt>
  49349. <dt><samp class="option">vsub</samp></dt>
  49350. <dd><p>horizontal and vertical chroma subsample values. For example for the
  49351. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  49352. </p>
  49353. </dd>
  49354. <dt><samp class="option">in_w, iw</samp></dt>
  49355. <dt><samp class="option">in_h, ih</samp></dt>
  49356. <dd><p>the input video width and height
  49357. </p>
  49358. </dd>
  49359. <dt><samp class="option">out_w, ow</samp></dt>
  49360. <dt><samp class="option">out_h, oh</samp></dt>
  49361. <dd><p>the output width and height, that is the size of the padded area as
  49362. specified by the <var class="var">width</var> and <var class="var">height</var> expressions
  49363. </p>
  49364. </dd>
  49365. <dt><samp class="option">rotw(a)</samp></dt>
  49366. <dt><samp class="option">roth(a)</samp></dt>
  49367. <dd><p>the minimal width/height required for completely containing the input
  49368. video rotated by <var class="var">a</var> radians.
  49369. </p>
  49370. <p>These are only available when computing the <samp class="option">out_w</samp> and
  49371. <samp class="option">out_h</samp> expressions.
  49372. </p></dd>
  49373. </dl>
  49374. <a name="Examples-158"></a>
  49375. <h4 class="subsection">39.213.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-158" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-158" aria-hidden="true">TOC</a></span></h4>
  49376. <ul class="itemize mark-bullet">
  49377. <li>Rotate the input by PI/6 radians clockwise:
  49378. <div class="example">
  49379. <pre class="example-preformatted">rotate=PI/6
  49380. </pre></div>
  49381. </li><li>Rotate the input by PI/6 radians counter-clockwise:
  49382. <div class="example">
  49383. <pre class="example-preformatted">rotate=-PI/6
  49384. </pre></div>
  49385. </li><li>Rotate the input by 45 degrees clockwise:
  49386. <div class="example">
  49387. <pre class="example-preformatted">rotate=45*PI/180
  49388. </pre></div>
  49389. </li><li>Apply a constant rotation with period T, starting from an angle of PI/3:
  49390. <div class="example">
  49391. <pre class="example-preformatted">rotate=PI/3+2*PI*t/T
  49392. </pre></div>
  49393. </li><li>Make the input video rotation oscillating with a period of T
  49394. seconds and an amplitude of A radians:
  49395. <div class="example">
  49396. <pre class="example-preformatted">rotate=A*sin(2*PI/T*t)
  49397. </pre></div>
  49398. </li><li>Rotate the video, output size is chosen so that the whole rotating
  49399. input video is always completely contained in the output:
  49400. <div class="example">
  49401. <pre class="example-preformatted">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  49402. </pre></div>
  49403. </li><li>Rotate the video, reduce the output size so that no background is ever
  49404. shown:
  49405. <div class="example">
  49406. <pre class="example-preformatted">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  49407. </pre></div>
  49408. </li></ul>
  49409. <a name="Commands-137"></a>
  49410. <h4 class="subsection">39.213.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-137" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-137" aria-hidden="true">TOC</a></span></h4>
  49411. <p>The filter supports the following commands:
  49412. </p>
  49413. <dl class="table">
  49414. <dt><samp class="option">a, angle</samp></dt>
  49415. <dd><p>Set the angle expression.
  49416. The command accepts the same syntax of the corresponding option.
  49417. </p>
  49418. <p>If the specified expression is not valid, it is kept at its current
  49419. value.
  49420. </p></dd>
  49421. </dl>
  49422. <a name="sab"></a>
  49423. <h3 class="section">39.214 sab<span class="pull-right"><a class="anchor hidden-xs" href="#sab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sab" aria-hidden="true">TOC</a></span></h3>
  49424. <p>Apply Shape Adaptive Blur.
  49425. </p>
  49426. <p>The filter accepts the following options:
  49427. </p>
  49428. <dl class="table">
  49429. <dt><samp class="option">luma_radius, lr</samp></dt>
  49430. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  49431. value is 1.0. A greater value will result in a more blurred image, and
  49432. in slower processing.
  49433. </p>
  49434. </dd>
  49435. <dt><samp class="option">luma_pre_filter_radius, lpfr</samp></dt>
  49436. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  49437. value is 1.0.
  49438. </p>
  49439. </dd>
  49440. <dt><samp class="option">luma_strength, ls</samp></dt>
  49441. <dd><p>Set luma maximum difference between pixels to still be considered, must
  49442. be a value in the 0.1-100.0 range, default value is 1.0.
  49443. </p>
  49444. </dd>
  49445. <dt><samp class="option">chroma_radius, cr</samp></dt>
  49446. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  49447. greater value will result in a more blurred image, and in slower
  49448. processing.
  49449. </p>
  49450. </dd>
  49451. <dt><samp class="option">chroma_pre_filter_radius, cpfr</samp></dt>
  49452. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  49453. </p>
  49454. </dd>
  49455. <dt><samp class="option">chroma_strength, cs</samp></dt>
  49456. <dd><p>Set chroma maximum difference between pixels to still be considered,
  49457. must be a value in the -0.9-100.0 range.
  49458. </p></dd>
  49459. </dl>
  49460. <p>Each chroma option value, if not explicitly specified, is set to the
  49461. corresponding luma option value.
  49462. </p>
  49463. <a class="anchor" id="scale"></a><a name="scale-1"></a>
  49464. <h3 class="section">39.215 scale<span class="pull-right"><a class="anchor hidden-xs" href="#scale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale-1" aria-hidden="true">TOC</a></span></h3>
  49465. <p>Scale (resize) the input video, using the libswscale library.
  49466. </p>
  49467. <p>The scale filter forces the output display aspect ratio to be the same
  49468. of the input, by changing the output sample aspect ratio.
  49469. </p>
  49470. <p>If the input image format is different from the format requested by
  49471. the next filter, the scale filter will convert the input to the
  49472. requested format.
  49473. </p>
  49474. <a name="Options-122"></a>
  49475. <h4 class="subsection">39.215.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-122" aria-hidden="true">TOC</a></span></h4>
  49476. <p>The filter accepts the following options, any of the options supported
  49477. by the libswscale scaler, as well as any of the <a class="ref" href="#framesync">framesync</a> options.
  49478. </p>
  49479. <p>See <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#scaler_005foptions">the ffmpeg-scaler manual</a> for
  49480. the complete list of scaler options.
  49481. </p>
  49482. <dl class="table">
  49483. <dt><samp class="option">width, w</samp></dt>
  49484. <dt><samp class="option">height, h</samp></dt>
  49485. <dd><p>Set the output video dimension expression. Default value is the input
  49486. dimension.
  49487. </p>
  49488. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  49489. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  49490. is used for the output.
  49491. </p>
  49492. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  49493. will use a value that maintains the aspect ratio of the input image,
  49494. calculated from the other specified dimension. After that it will,
  49495. however, make sure that the calculated dimension is divisible by n and
  49496. adjust the value if necessary.
  49497. </p>
  49498. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  49499. both values being set to 0 as previously detailed.
  49500. </p>
  49501. <p>See below for the list of accepted constants for use in the dimension
  49502. expression.
  49503. </p>
  49504. </dd>
  49505. <dt><samp class="option">eval</samp></dt>
  49506. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  49507. </p>
  49508. <dl class="table">
  49509. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  49510. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  49511. </p>
  49512. </dd>
  49513. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  49514. <dd><p>Evaluate expressions for each incoming frame.
  49515. </p>
  49516. </dd>
  49517. </dl>
  49518. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  49519. </p>
  49520. </dd>
  49521. <dt><samp class="option">interl</samp></dt>
  49522. <dd><p>Set the interlacing mode. It accepts the following values:
  49523. </p>
  49524. <dl class="table">
  49525. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  49526. <dd><p>Force interlaced aware scaling.
  49527. </p>
  49528. </dd>
  49529. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  49530. <dd><p>Do not apply interlaced scaling.
  49531. </p>
  49532. </dd>
  49533. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  49534. <dd><p>Select interlaced aware scaling depending on whether the source frames
  49535. are flagged as interlaced or not.
  49536. </p></dd>
  49537. </dl>
  49538. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  49539. </p>
  49540. </dd>
  49541. <dt><samp class="option">flags</samp></dt>
  49542. <dd><p>Set libswscale scaling flags. See
  49543. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fflags">the ffmpeg-scaler manual</a> for the
  49544. complete list of values. If not explicitly specified the filter applies
  49545. the default flags.
  49546. </p>
  49547. </dd>
  49548. <dt><samp class="option">param0, param1</samp></dt>
  49549. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  49550. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fparams">the ffmpeg-scaler manual</a> for the
  49551. complete documentation. If not explicitly specified the filter applies
  49552. empty parameters.
  49553. </p>
  49554. </dd>
  49555. <dt><samp class="option">intent</samp></dt>
  49556. <dd><p>Set the ICC rendering intent to use when transforming between different color
  49557. spaces. It accepts the following values:
  49558. </p>
  49559. <dl class="table">
  49560. <dt>&lsquo;<samp class="samp">perceptual</samp>&rsquo;</dt>
  49561. <dd><p>Use a perceptually guided tone and gamut mapping curve. The exact details of
  49562. the mapping used may change at any time and should not be relied on as stable.
  49563. This intent is recommended for final viewing of image/video content in typical
  49564. viewing settings.
  49565. </p>
  49566. </dd>
  49567. <dt>&lsquo;<samp class="samp">relative_colorimetric</samp>&rsquo;</dt>
  49568. <dd><p>Statically clip out-of-gamut colors using a colorimetric clipping curve which
  49569. attempts to find the colorimetrically least dissimilar in-gamut color. This
  49570. intent performs white point adaptation and black point adaptation. This is
  49571. the default. This intent is recommended wherever faithful color reproduction
  49572. is of the utmost importance, even at the cost of clipping.
  49573. </p>
  49574. </dd>
  49575. <dt>&lsquo;<samp class="samp">absolute_colorimetric</samp>&rsquo;</dt>
  49576. <dd><p>Hard clip out-of-gamut colors with no attempt at white or black point
  49577. reproduction. This intent will reproduce in-gamut colors 1:1 on the output
  49578. display as they would appear on the reference display, assuming the output
  49579. display is appropriately calibrated.
  49580. </p>
  49581. </dd>
  49582. <dt>&lsquo;<samp class="samp">saturation</samp>&rsquo;</dt>
  49583. <dd><p>Performs saturation mapping - that is, stretches the input color volume
  49584. directly onto the output color volume, in non-linear fashion that preserves the
  49585. original signal appearance as much as possible. This intent is recommended for
  49586. signal content evaluation, as it will not lead to any clipping. It is roughly
  49587. analogous to not performing any color mapping, although it still takes into
  49588. account the mastering display primaries and any differences in encoding TRC.
  49589. </p></dd>
  49590. </dl>
  49591. </dd>
  49592. <dt><samp class="option">size, s</samp></dt>
  49593. <dd><p>Set the video size. For the syntax of this option, check the
  49594. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49595. </p>
  49596. </dd>
  49597. <dt><samp class="option">in_color_matrix</samp></dt>
  49598. <dt><samp class="option">out_color_matrix</samp></dt>
  49599. <dd><p>Set in/output YCbCr color space type.
  49600. </p>
  49601. <p>This allows the autodetected value to be overridden as well as allows forcing
  49602. a specific value used for the output and encoder.
  49603. </p>
  49604. <p>If not specified, the color space type depends on the pixel format.
  49605. </p>
  49606. <p>Possible values:
  49607. </p>
  49608. <dl class="table">
  49609. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  49610. <dd><p>Choose automatically.
  49611. </p>
  49612. </dd>
  49613. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  49614. <dd><p>Format conforming to International Telecommunication Union (ITU)
  49615. Recommendation BT.709.
  49616. </p>
  49617. </dd>
  49618. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  49619. <dd><p>Set color space conforming to the United States Federal Communications
  49620. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  49621. </p>
  49622. </dd>
  49623. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  49624. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  49625. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  49626. <dd><p>Set color space conforming to:
  49627. </p>
  49628. <ul class="itemize mark-bullet">
  49629. <li>ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  49630. </li><li>ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  49631. </li><li>Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  49632. </li></ul>
  49633. </dd>
  49634. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  49635. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  49636. </p>
  49637. </dd>
  49638. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  49639. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  49640. </p></dd>
  49641. </dl>
  49642. </dd>
  49643. <dt><samp class="option">in_range</samp></dt>
  49644. <dt><samp class="option">out_range</samp></dt>
  49645. <dd><p>Set in/output YCbCr sample range.
  49646. </p>
  49647. <p>This allows the autodetected value to be overridden as well as allows forcing
  49648. a specific value used for the output and encoder. If not specified, the
  49649. range depends on the pixel format. Possible values:
  49650. </p>
  49651. <dl class="table">
  49652. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  49653. <dd><p>Choose automatically.
  49654. </p>
  49655. </dd>
  49656. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  49657. <dd><p>Set full range (0-255 in case of 8-bit luma).
  49658. </p>
  49659. </dd>
  49660. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  49661. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  49662. </p></dd>
  49663. </dl>
  49664. </dd>
  49665. <dt><samp class="option">in_chroma_loc</samp></dt>
  49666. <dt><samp class="option">out_chroma_loc</samp></dt>
  49667. <dd><p>Set in/output chroma sample location. If not specified, center-sited chroma
  49668. is used by default. Possible values:
  49669. </p>
  49670. <dl class="table">
  49671. <dt>&lsquo;<samp class="samp">auto, unknown</samp>&rsquo;</dt>
  49672. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  49673. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  49674. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  49675. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  49676. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  49677. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  49678. </dl>
  49679. </dd>
  49680. <dt><samp class="option">in_primaries</samp></dt>
  49681. <dt><samp class="option">out_primaries</samp></dt>
  49682. <dd><p>Set in/output RGB primaries.
  49683. </p>
  49684. <p>This allows the autodetected value to be overridden as well as allows forcing
  49685. a specific value used for the output and encoder. Possible values:
  49686. </p>
  49687. <dl class="table">
  49688. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  49689. <dd><p>Choose automatically. This is the default.
  49690. </p>
  49691. </dd>
  49692. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  49693. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  49694. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  49695. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  49696. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  49697. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  49698. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  49699. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  49700. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  49701. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  49702. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  49703. <dt>&lsquo;<samp class="samp">ebu3213</samp>&rsquo;</dt>
  49704. </dl>
  49705. </dd>
  49706. <dt><samp class="option">in_transfer</samp></dt>
  49707. <dt><samp class="option">out_transfer</samp></dt>
  49708. <dd><p>Set in/output transfer response curve (TRC).
  49709. </p>
  49710. <p>This allows the autodetected value to be overridden as well as allows forcing
  49711. a specific value used for the output and encoder. Possible values:
  49712. </p>
  49713. <dl class="table">
  49714. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  49715. <dd><p>Choose automatically. This is the default.
  49716. </p>
  49717. </dd>
  49718. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  49719. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  49720. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  49721. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  49722. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  49723. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  49724. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  49725. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  49726. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  49727. <dt>&lsquo;<samp class="samp">srgb</samp>&rsquo;</dt>
  49728. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  49729. <dt>&lsquo;<samp class="samp">xvycc</samp>&rsquo;</dt>
  49730. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  49731. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  49732. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  49733. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  49734. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  49735. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  49736. </dl>
  49737. </dd>
  49738. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  49739. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  49740. keep the original aspect ratio. Possible values:
  49741. </p>
  49742. <dl class="table">
  49743. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  49744. <dd><p>Scale the video as specified and disable this feature.
  49745. </p>
  49746. </dd>
  49747. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  49748. <dd><p>The output video dimensions will automatically be decreased if needed.
  49749. </p>
  49750. </dd>
  49751. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  49752. <dd><p>The output video dimensions will automatically be increased if needed.
  49753. </p>
  49754. </dd>
  49755. </dl>
  49756. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  49757. maximum allowed resolution, you can use this to limit the output video to
  49758. that, while retaining the aspect ratio. For example, device A allows
  49759. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  49760. decrease) and specifying 1280x720 to the command line makes the output
  49761. 1280x533.
  49762. </p>
  49763. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  49764. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  49765. to work.
  49766. </p>
  49767. </dd>
  49768. <dt><samp class="option">force_divisible_by</samp></dt>
  49769. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  49770. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  49771. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  49772. </p>
  49773. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  49774. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  49775. may be slightly modified.
  49776. </p>
  49777. <p>This option can be handy if you need to have a video fit within or exceed
  49778. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  49779. encoder restrictions on width or height divisibility.
  49780. </p>
  49781. </dd>
  49782. <dt><samp class="option">reset_sar</samp></dt>
  49783. <dd><p>Enabling this option leads to the output SAR being reset to 1.
  49784. Additionally, if the user requests proportional scaling either
  49785. through the width or height expressions, e.g. <code class="code">w=-4:h=360</code> or <code class="code">w=iw/2:h=-1</code>
  49786. or by enabling <code class="code">force_original_aspect_ratio</code>, then the input DAR is taken into
  49787. account and the output is scaled to produce square pixels.
  49788. Default is false.
  49789. </p>
  49790. </dd>
  49791. </dl>
  49792. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  49793. containing the following constants:
  49794. </p>
  49795. <dl class="table">
  49796. <dt><var class="var">in_w</var></dt>
  49797. <dt><var class="var">in_h</var></dt>
  49798. <dd><p>The input width and height
  49799. </p>
  49800. </dd>
  49801. <dt><var class="var">iw</var></dt>
  49802. <dt><var class="var">ih</var></dt>
  49803. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  49804. </p>
  49805. </dd>
  49806. <dt><var class="var">out_w</var></dt>
  49807. <dt><var class="var">out_h</var></dt>
  49808. <dd><p>The output (scaled) width and height
  49809. </p>
  49810. </dd>
  49811. <dt><var class="var">ow</var></dt>
  49812. <dt><var class="var">oh</var></dt>
  49813. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  49814. </p>
  49815. </dd>
  49816. <dt><var class="var">a</var></dt>
  49817. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  49818. </p>
  49819. </dd>
  49820. <dt><var class="var">sar</var></dt>
  49821. <dd><p>input sample aspect ratio
  49822. </p>
  49823. </dd>
  49824. <dt><var class="var">dar</var></dt>
  49825. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  49826. </p>
  49827. </dd>
  49828. <dt><var class="var">hsub</var></dt>
  49829. <dt><var class="var">vsub</var></dt>
  49830. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  49831. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  49832. </p>
  49833. </dd>
  49834. <dt><var class="var">ohsub</var></dt>
  49835. <dt><var class="var">ovsub</var></dt>
  49836. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  49837. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  49838. </p>
  49839. </dd>
  49840. <dt><var class="var">n</var></dt>
  49841. <dd><p>The (sequential) number of the input frame, starting from 0.
  49842. Only available with <code class="code">eval=frame</code>.
  49843. </p>
  49844. </dd>
  49845. <dt><var class="var">t</var></dt>
  49846. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  49847. seconds. Only available with <code class="code">eval=frame</code>.
  49848. </p>
  49849. </dd>
  49850. <dt><var class="var">pos</var></dt>
  49851. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  49852. this information is unavailable and/or meaningless (for example in case of synthetic video).
  49853. Only available with <code class="code">eval=frame</code>.
  49854. Deprecated, do not use.
  49855. </p>
  49856. </dd>
  49857. <dt><var class="var">ref_w, rw</var></dt>
  49858. <dt><var class="var">ref_h, rh</var></dt>
  49859. <dt><var class="var">ref_a</var></dt>
  49860. <dt><var class="var">ref_dar, rdar</var></dt>
  49861. <dt><var class="var">ref_n</var></dt>
  49862. <dt><var class="var">ref_t</var></dt>
  49863. <dt><var class="var">ref_pos</var></dt>
  49864. <dd><p>Eqvuialent to the above, but for a second reference input. If any of these
  49865. variables are present, this filter accepts two inputs.
  49866. </p></dd>
  49867. </dl>
  49868. <a name="Examples-159"></a>
  49869. <h4 class="subsection">39.215.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-159" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-159" aria-hidden="true">TOC</a></span></h4>
  49870. <ul class="itemize mark-bullet">
  49871. <li>Scale the input video to a size of 200x100
  49872. <div class="example">
  49873. <pre class="example-preformatted">scale=w=200:h=100
  49874. </pre></div>
  49875. <p>This is equivalent to:
  49876. </p><div class="example">
  49877. <pre class="example-preformatted">scale=200:100
  49878. </pre></div>
  49879. <p>or:
  49880. </p><div class="example">
  49881. <pre class="example-preformatted">scale=200x100
  49882. </pre></div>
  49883. </li><li>Specify a size abbreviation for the output size:
  49884. <div class="example">
  49885. <pre class="example-preformatted">scale=qcif
  49886. </pre></div>
  49887. <p>which can also be written as:
  49888. </p><div class="example">
  49889. <pre class="example-preformatted">scale=size=qcif
  49890. </pre></div>
  49891. </li><li>Scale the input to 2x:
  49892. <div class="example">
  49893. <pre class="example-preformatted">scale=w=2*iw:h=2*ih
  49894. </pre></div>
  49895. </li><li>The above is the same as:
  49896. <div class="example">
  49897. <pre class="example-preformatted">scale=2*in_w:2*in_h
  49898. </pre></div>
  49899. </li><li>Scale the input to 2x with forced interlaced scaling:
  49900. <div class="example">
  49901. <pre class="example-preformatted">scale=2*iw:2*ih:interl=1
  49902. </pre></div>
  49903. </li><li>Scale the input to half size:
  49904. <div class="example">
  49905. <pre class="example-preformatted">scale=w=iw/2:h=ih/2
  49906. </pre></div>
  49907. </li><li>Increase the width, and set the height to the same size:
  49908. <div class="example">
  49909. <pre class="example-preformatted">scale=3/2*iw:ow
  49910. </pre></div>
  49911. </li><li>Seek Greek harmony:
  49912. <div class="example">
  49913. <pre class="example-preformatted">scale=iw:1/PHI*iw
  49914. scale=ih*PHI:ih
  49915. </pre></div>
  49916. </li><li>Increase the height, and set the width to 3/2 of the height:
  49917. <div class="example">
  49918. <pre class="example-preformatted">scale=w=3/2*oh:h=3/5*ih
  49919. </pre></div>
  49920. </li><li>Increase the size, making the size a multiple of the chroma
  49921. subsample values:
  49922. <div class="example">
  49923. <pre class="example-preformatted">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  49924. </pre></div>
  49925. </li><li>Increase the width to a maximum of 500 pixels,
  49926. keeping the same aspect ratio as the input:
  49927. <div class="example">
  49928. <pre class="example-preformatted">scale=w='min(500\, iw*3/2):h=-1'
  49929. </pre></div>
  49930. </li><li>Make pixels square by combining scale and setsar:
  49931. <div class="example">
  49932. <pre class="example-preformatted">scale='trunc(ih*dar):ih',setsar=1/1
  49933. </pre></div>
  49934. </li><li>Make pixels square using reset_sar,
  49935. making sure the resulting resolution is even (required by some codecs):
  49936. <div class="example">
  49937. <pre class="example-preformatted">scale='-2:ih-mod(ih,2):reset_sar=1'
  49938. </pre></div>
  49939. </li><li>Scale to target exactly, however reset SAR to 1:
  49940. <div class="example">
  49941. <pre class="example-preformatted">scale='400:300:reset_sar=1'
  49942. </pre></div>
  49943. </li><li>Scale to even dimensions that fit within 400x300, preserving input SAR:
  49944. <div class="example">
  49945. <pre class="example-preformatted">scale='400:300:force_original_aspect_ratio=decrease:force_divisible_by=2'
  49946. </pre></div>
  49947. </li><li>Scale to produce square pixels with even dimensions that fit within 400x300:
  49948. <div class="example">
  49949. <pre class="example-preformatted">scale='400:300:force_original_aspect_ratio=decrease:force_divisible_by=2:reset_sar=1'
  49950. </pre></div>
  49951. </li><li>Scale a subtitle stream (sub) to match the main video (main) in size before
  49952. overlaying. (&quot;scale2ref&quot;)
  49953. <div class="example">
  49954. <pre class="example-preformatted">'[main]split[a][b]; [ref][a]scale=rw:rh[c]; [b][c]overlay'
  49955. </pre></div>
  49956. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display
  49957. aspect ratio.
  49958. <div class="example">
  49959. <pre class="example-preformatted">[logo-in][video-in]scale=w=oh*dar:h=rh/10[logo-out]
  49960. </pre></div>
  49961. </li></ul>
  49962. <a name="Commands-138"></a>
  49963. <h4 class="subsection">39.215.3 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-138" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-138" aria-hidden="true">TOC</a></span></h4>
  49964. <p>This filter supports the following commands:
  49965. </p><dl class="table">
  49966. <dt><samp class="option">width, w</samp></dt>
  49967. <dt><samp class="option">height, h</samp></dt>
  49968. <dd><p>Set the output video dimension expression.
  49969. The command accepts the same syntax of the corresponding option.
  49970. </p>
  49971. <p>If the specified expression is not valid, it is kept at its current
  49972. value.
  49973. </p></dd>
  49974. </dl>
  49975. <a name="scharr"></a>
  49976. <h3 class="section">39.216 scharr<span class="pull-right"><a class="anchor hidden-xs" href="#scharr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scharr" aria-hidden="true">TOC</a></span></h3>
  49977. <p>Apply scharr operator to input video stream.
  49978. </p>
  49979. <p>The filter accepts the following option:
  49980. </p>
  49981. <dl class="table">
  49982. <dt><samp class="option">planes</samp></dt>
  49983. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  49984. By default value 0xf, all planes will be processed.
  49985. </p>
  49986. </dd>
  49987. <dt><samp class="option">scale</samp></dt>
  49988. <dd><p>Set value which will be multiplied with filtered result.
  49989. </p>
  49990. </dd>
  49991. <dt><samp class="option">delta</samp></dt>
  49992. <dd><p>Set value which will be added to filtered result.
  49993. </p></dd>
  49994. </dl>
  49995. <a name="Commands-139"></a>
  49996. <h4 class="subsection">39.216.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-139" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-139" aria-hidden="true">TOC</a></span></h4>
  49997. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  49998. </p>
  49999. <a name="scroll"></a>
  50000. <h3 class="section">39.217 scroll<span class="pull-right"><a class="anchor hidden-xs" href="#scroll" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scroll" aria-hidden="true">TOC</a></span></h3>
  50001. <p>Scroll input video horizontally and/or vertically by constant speed.
  50002. </p>
  50003. <p>The filter accepts the following options:
  50004. </p><dl class="table">
  50005. <dt><samp class="option">horizontal, h</samp></dt>
  50006. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  50007. Negative values changes scrolling direction.
  50008. </p>
  50009. </dd>
  50010. <dt><samp class="option">vertical, v</samp></dt>
  50011. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  50012. Negative values changes scrolling direction.
  50013. </p>
  50014. </dd>
  50015. <dt><samp class="option">hpos</samp></dt>
  50016. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  50017. </p>
  50018. </dd>
  50019. <dt><samp class="option">vpos</samp></dt>
  50020. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  50021. </p></dd>
  50022. </dl>
  50023. <a name="Commands-140"></a>
  50024. <h4 class="subsection">39.217.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-140" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-140" aria-hidden="true">TOC</a></span></h4>
  50025. <p>This filter supports the following <a class="ref" href="#commands">commands</a>:
  50026. </p><dl class="table">
  50027. <dt><samp class="option">horizontal, h</samp></dt>
  50028. <dd><p>Set the horizontal scrolling speed.
  50029. </p></dd>
  50030. <dt><samp class="option">vertical, v</samp></dt>
  50031. <dd><p>Set the vertical scrolling speed.
  50032. </p></dd>
  50033. </dl>
  50034. <a class="anchor" id="scdet"></a><a name="scdet-1"></a>
  50035. <h3 class="section">39.218 scdet<span class="pull-right"><a class="anchor hidden-xs" href="#scdet-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scdet-1" aria-hidden="true">TOC</a></span></h3>
  50036. <p>Detect video scene change.
  50037. </p>
  50038. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  50039. forward the frame to the next filter, so they can use these metadata to detect
  50040. scene change or others.
  50041. </p>
  50042. <p>In addition, this filter logs a message and sets frame metadata when it detects
  50043. a scene change by <samp class="option">threshold</samp>.
  50044. </p>
  50045. <p><code class="code">lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  50046. </p>
  50047. <p><code class="code">lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  50048. to detect scene change.
  50049. </p>
  50050. <p><code class="code">lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  50051. detect scene change with <samp class="option">threshold</samp>.
  50052. </p>
  50053. <p>The filter accepts the following options:
  50054. </p>
  50055. <dl class="table">
  50056. <dt><samp class="option">threshold, t</samp></dt>
  50057. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  50058. values are in the <code class="code">[8.0, 14.0]</code> range. The range for <samp class="option">threshold</samp> is
  50059. <code class="code">[0., 100.]</code>.
  50060. </p>
  50061. <p>Default value is <code class="code">10.</code>.
  50062. </p>
  50063. </dd>
  50064. <dt><samp class="option">sc_pass, s</samp></dt>
  50065. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code class="code">0</code>
  50066. You can enable it if you want to get snapshot of scene change frames only.
  50067. </p></dd>
  50068. </dl>
  50069. <a class="anchor" id="selectivecolor"></a><a name="selectivecolor-1"></a>
  50070. <h3 class="section">39.219 selectivecolor<span class="pull-right"><a class="anchor hidden-xs" href="#selectivecolor-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-selectivecolor-1" aria-hidden="true">TOC</a></span></h3>
  50071. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  50072. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  50073. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  50074. </p>
  50075. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  50076. </p>
  50077. <p>The filter accepts the following options:
  50078. </p>
  50079. <dl class="table">
  50080. <dt><samp class="option">correction_method</samp></dt>
  50081. <dd><p>Select color correction method.
  50082. </p>
  50083. <p>Available values are:
  50084. </p><dl class="table">
  50085. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  50086. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  50087. component value).
  50088. </p></dd>
  50089. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  50090. <dd><p>Specified adjustments are relative to the original component value.
  50091. </p></dd>
  50092. </dl>
  50093. <p>Default is <code class="code">absolute</code>.
  50094. </p></dd>
  50095. <dt><samp class="option">reds</samp></dt>
  50096. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  50097. </p></dd>
  50098. <dt><samp class="option">yellows</samp></dt>
  50099. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  50100. </p></dd>
  50101. <dt><samp class="option">greens</samp></dt>
  50102. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  50103. </p></dd>
  50104. <dt><samp class="option">cyans</samp></dt>
  50105. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  50106. </p></dd>
  50107. <dt><samp class="option">blues</samp></dt>
  50108. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  50109. </p></dd>
  50110. <dt><samp class="option">magentas</samp></dt>
  50111. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  50112. </p></dd>
  50113. <dt><samp class="option">whites</samp></dt>
  50114. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  50115. </p></dd>
  50116. <dt><samp class="option">neutrals</samp></dt>
  50117. <dd><p>Adjustments for all pixels except pure black and pure white
  50118. </p></dd>
  50119. <dt><samp class="option">blacks</samp></dt>
  50120. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  50121. </p></dd>
  50122. <dt><samp class="option">psfile</samp></dt>
  50123. <dd><p>Specify a Photoshop selective color file (<code class="code">.asv</code>) to import the settings from.
  50124. </p></dd>
  50125. </dl>
  50126. <p>All the adjustment settings (<samp class="option">reds</samp>, <samp class="option">yellows</samp>, ...) accept up to
  50127. 4 space separated floating point adjustment values in the [-1,1] range,
  50128. respectively to adjust the amount of cyan, magenta, yellow and black for the
  50129. pixels of its range.
  50130. </p>
  50131. <a name="Examples-160"></a>
  50132. <h4 class="subsection">39.219.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-160" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-160" aria-hidden="true">TOC</a></span></h4>
  50133. <ul class="itemize mark-bullet">
  50134. <li>Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  50135. increase magenta by 27% in blue areas:
  50136. <div class="example">
  50137. <pre class="example-preformatted">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  50138. </pre></div>
  50139. </li><li>Use a Photoshop selective color preset:
  50140. <div class="example">
  50141. <pre class="example-preformatted">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  50142. </pre></div>
  50143. </li></ul>
  50144. <a class="anchor" id="separatefields"></a><a name="separatefields-1"></a>
  50145. <h3 class="section">39.220 separatefields<span class="pull-right"><a class="anchor hidden-xs" href="#separatefields-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-separatefields-1" aria-hidden="true">TOC</a></span></h3>
  50146. <p>The <code class="code">separatefields</code> takes a frame-based video input and splits
  50147. each frame into its components fields, producing a new half height clip
  50148. with twice the frame rate and twice the frame count.
  50149. </p>
  50150. <p>This filter use field-dominance information in frame to decide which
  50151. of each pair of fields to place first in the output.
  50152. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">separatefields</code> filter.
  50153. </p>
  50154. <a name="setdar_002c-setsar"></a>
  50155. <h3 class="section">39.221 setdar, setsar<span class="pull-right"><a class="anchor hidden-xs" href="#setdar_002c-setsar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setdar_002c-setsar" aria-hidden="true">TOC</a></span></h3>
  50156. <p>The <code class="code">setdar</code> filter sets the Display Aspect Ratio for the filter
  50157. output video.
  50158. </p>
  50159. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  50160. Ratio, according to the following equation:
  50161. </p><div class="example">
  50162. <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>
  50163. </pre></div>
  50164. <p>Keep in mind that the <code class="code">setdar</code> filter does not modify the pixel
  50165. dimensions of the video frame. Also, the display aspect ratio set by
  50166. this filter may be changed by later filters in the filterchain,
  50167. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  50168. applied.
  50169. </p>
  50170. <p>The <code class="code">setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  50171. the filter output video.
  50172. </p>
  50173. <p>Note that as a consequence of the application of this filter, the
  50174. output display aspect ratio will change according to the equation
  50175. above.
  50176. </p>
  50177. <p>Keep in mind that the sample aspect ratio set by the <code class="code">setsar</code>
  50178. filter may be changed by later filters in the filterchain, e.g. if
  50179. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  50180. </p>
  50181. <p>It accepts the following parameters:
  50182. </p>
  50183. <dl class="table">
  50184. <dt><samp class="option">r, ratio, dar (<code class="code">setdar</code> only), sar (<code class="code">setsar</code> only)</samp></dt>
  50185. <dd><p>Set the aspect ratio used by the filter.
  50186. </p>
  50187. <p>The parameter can be a floating point number string, or an expression. If the
  50188. parameter is not specified, the value &quot;0&quot; is assumed, meaning that the same
  50189. input value is used.
  50190. </p>
  50191. </dd>
  50192. <dt><samp class="option">max</samp></dt>
  50193. <dd><p>Set the maximum integer value to use for expressing numerator and
  50194. denominator when reducing the expressed aspect ratio to a rational.
  50195. Default value is <code class="code">100</code>.
  50196. </p>
  50197. </dd>
  50198. </dl>
  50199. <p>The parameter <var class="var">sar</var> is an expression containing the following constants:
  50200. </p>
  50201. <dl class="table">
  50202. <dt><samp class="option">w, h</samp></dt>
  50203. <dd><p>The input width and height.
  50204. </p>
  50205. </dd>
  50206. <dt><samp class="option">a</samp></dt>
  50207. <dd><p>Same as <var class="var">w</var> / <var class="var">h</var>.
  50208. </p>
  50209. </dd>
  50210. <dt><samp class="option">sar</samp></dt>
  50211. <dd><p>The input sample aspect ratio.
  50212. </p>
  50213. </dd>
  50214. <dt><samp class="option">dar</samp></dt>
  50215. <dd><p>The input display aspect ratio. It is the same as
  50216. (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  50217. </p>
  50218. </dd>
  50219. <dt><samp class="option">hsub, vsub</samp></dt>
  50220. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  50221. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  50222. </p></dd>
  50223. </dl>
  50224. <a name="Examples-161"></a>
  50225. <h4 class="subsection">39.221.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-161" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-161" aria-hidden="true">TOC</a></span></h4>
  50226. <ul class="itemize mark-bullet">
  50227. <li>To change the display aspect ratio to 16:9, specify one of the following:
  50228. <div class="example">
  50229. <pre class="example-preformatted">setdar=dar=1.77777
  50230. setdar=dar=16/9
  50231. </pre></div>
  50232. </li><li>To change the sample aspect ratio to 10:11, specify:
  50233. <div class="example">
  50234. <pre class="example-preformatted">setsar=sar=10/11
  50235. </pre></div>
  50236. </li><li>To set a display aspect ratio of 16:9, and specify a maximum integer value of
  50237. 1000 in the aspect ratio reduction, use the command:
  50238. <div class="example">
  50239. <pre class="example-preformatted">setdar=ratio=16/9:max=1000
  50240. </pre></div>
  50241. </li></ul>
  50242. <a class="anchor" id="setfield"></a><a name="setfield-1"></a>
  50243. <h3 class="section">39.222 setfield<span class="pull-right"><a class="anchor hidden-xs" href="#setfield-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setfield-1" aria-hidden="true">TOC</a></span></h3>
  50244. <p>Force field for the output video frame.
  50245. </p>
  50246. <p>The <code class="code">setfield</code> filter marks the interlace type field for the
  50247. output frames. It does not change the input frame, but only sets the
  50248. corresponding property, which affects how the frame is treated by
  50249. following filters (e.g. <code class="code">fieldorder</code> or <code class="code">yadif</code>).
  50250. </p>
  50251. <p>The filter accepts the following options:
  50252. </p>
  50253. <dl class="table">
  50254. <dt><samp class="option">mode</samp></dt>
  50255. <dd><p>Available values are:
  50256. </p>
  50257. <dl class="table">
  50258. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  50259. <dd><p>Keep the same field property.
  50260. </p>
  50261. </dd>
  50262. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  50263. <dd><p>Mark the frame as bottom-field-first.
  50264. </p>
  50265. </dd>
  50266. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  50267. <dd><p>Mark the frame as top-field-first.
  50268. </p>
  50269. </dd>
  50270. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  50271. <dd><p>Mark the frame as progressive.
  50272. </p></dd>
  50273. </dl>
  50274. </dd>
  50275. </dl>
  50276. <a class="anchor" id="setparams"></a><a name="setparams-1"></a>
  50277. <h3 class="section">39.223 setparams<span class="pull-right"><a class="anchor hidden-xs" href="#setparams-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setparams-1" aria-hidden="true">TOC</a></span></h3>
  50278. <p>Force frame parameter for the output video frame.
  50279. </p>
  50280. <p>The <code class="code">setparams</code> filter marks interlace and color range for the
  50281. output frames. It does not change the input frame, but only sets the
  50282. corresponding property, which affects how the frame is treated by
  50283. filters/encoders.
  50284. </p>
  50285. <dl class="table">
  50286. <dt><samp class="option">field_mode</samp></dt>
  50287. <dd><p>Available values are:
  50288. </p>
  50289. <dl class="table">
  50290. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  50291. <dd><p>Keep the same field property (default).
  50292. </p>
  50293. </dd>
  50294. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  50295. <dd><p>Mark the frame as bottom-field-first.
  50296. </p>
  50297. </dd>
  50298. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  50299. <dd><p>Mark the frame as top-field-first.
  50300. </p>
  50301. </dd>
  50302. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  50303. <dd><p>Mark the frame as progressive.
  50304. </p></dd>
  50305. </dl>
  50306. </dd>
  50307. <dt><samp class="option">range</samp></dt>
  50308. <dd><p>Available values are:
  50309. </p>
  50310. <dl class="table">
  50311. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  50312. <dd><p>Keep the same color range property (default).
  50313. </p>
  50314. </dd>
  50315. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  50316. <dd><p>Mark the frame as unspecified color range.
  50317. </p>
  50318. </dd>
  50319. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  50320. <dd><p>Mark the frame as limited range.
  50321. </p>
  50322. </dd>
  50323. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  50324. <dd><p>Mark the frame as full range.
  50325. </p></dd>
  50326. </dl>
  50327. </dd>
  50328. <dt><samp class="option">color_primaries</samp></dt>
  50329. <dd><p>Set the color primaries.
  50330. Available values are:
  50331. </p>
  50332. <dl class="table">
  50333. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  50334. <dd><p>Keep the same color primaries property (default).
  50335. </p>
  50336. </dd>
  50337. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  50338. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  50339. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  50340. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  50341. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  50342. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  50343. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  50344. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  50345. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  50346. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  50347. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  50348. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  50349. </dl>
  50350. </dd>
  50351. <dt><samp class="option">color_trc</samp></dt>
  50352. <dd><p>Set the color transfer.
  50353. Available values are:
  50354. </p>
  50355. <dl class="table">
  50356. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  50357. <dd><p>Keep the same color trc property (default).
  50358. </p>
  50359. </dd>
  50360. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  50361. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  50362. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  50363. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  50364. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  50365. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  50366. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  50367. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  50368. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  50369. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  50370. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  50371. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  50372. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  50373. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  50374. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  50375. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  50376. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  50377. </dl>
  50378. </dd>
  50379. <dt><samp class="option">colorspace</samp></dt>
  50380. <dd><p>Set the colorspace.
  50381. Available values are:
  50382. </p>
  50383. <dl class="table">
  50384. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  50385. <dd><p>Keep the same colorspace property (default).
  50386. </p>
  50387. </dd>
  50388. <dt>&lsquo;<samp class="samp">gbr</samp>&rsquo;</dt>
  50389. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  50390. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  50391. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  50392. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  50393. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  50394. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  50395. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  50396. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  50397. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  50398. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  50399. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  50400. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  50401. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  50402. </dl>
  50403. </dd>
  50404. <dt><samp class="option">chroma_location</samp></dt>
  50405. <dd><p>Set the chroma sample location.
  50406. Available values are:
  50407. </p>
  50408. <dl class="table">
  50409. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  50410. <dd><p>Keep the same chroma location (default).
  50411. </p>
  50412. </dd>
  50413. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  50414. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  50415. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  50416. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  50417. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  50418. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  50419. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  50420. </dl>
  50421. </dd>
  50422. <dt><samp class="option">alpha_mode</samp></dt>
  50423. <dd><p>Set the alpha moda.
  50424. Available values are:
  50425. </p>
  50426. <dl class="table">
  50427. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  50428. <dd><p>Keep the same alpha mode (default).
  50429. </p>
  50430. </dd>
  50431. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  50432. <dt>&lsquo;<samp class="samp">premultiplied</samp>&rsquo;</dt>
  50433. <dt>&lsquo;<samp class="samp">straight</samp>&rsquo;</dt>
  50434. </dl>
  50435. </dd>
  50436. </dl>
  50437. <a name="shear"></a>
  50438. <h3 class="section">39.224 shear<span class="pull-right"><a class="anchor hidden-xs" href="#shear" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shear" aria-hidden="true">TOC</a></span></h3>
  50439. <p>Apply shear transform to input video.
  50440. </p>
  50441. <p>This filter supports the following options:
  50442. </p>
  50443. <dl class="table">
  50444. <dt><samp class="option">shx</samp></dt>
  50445. <dd><p>Shear factor in X-direction. Default value is 0.
  50446. Allowed range is from -2 to 2.
  50447. </p>
  50448. </dd>
  50449. <dt><samp class="option">shy</samp></dt>
  50450. <dd><p>Shear factor in Y-direction. Default value is 0.
  50451. Allowed range is from -2 to 2.
  50452. </p>
  50453. </dd>
  50454. <dt><samp class="option">fillcolor, c</samp></dt>
  50455. <dd><p>Set the color used to fill the output area not covered by the transformed
  50456. video. For the general syntax of this option, check the
  50457. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  50458. If the special value &quot;none&quot; is selected then no
  50459. background is printed (useful for example if the background is never shown).
  50460. </p>
  50461. <p>Default value is &quot;black&quot;.
  50462. </p>
  50463. </dd>
  50464. <dt><samp class="option">interp</samp></dt>
  50465. <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>.
  50466. </p></dd>
  50467. </dl>
  50468. <a name="Commands-141"></a>
  50469. <h4 class="subsection">39.224.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-141" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-141" aria-hidden="true">TOC</a></span></h4>
  50470. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  50471. </p>
  50472. <a name="showinfo-1"></a>
  50473. <h3 class="section">39.225 showinfo<span class="pull-right"><a class="anchor hidden-xs" href="#showinfo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showinfo-1" aria-hidden="true">TOC</a></span></h3>
  50474. <p>Show a line containing various information for each input video frame.
  50475. The input video is not modified.
  50476. </p>
  50477. <p>This filter supports the following options:
  50478. </p>
  50479. <dl class="table">
  50480. <dt><samp class="option">checksum</samp></dt>
  50481. <dd><p>Calculate checksums of each plane. By default enabled.
  50482. </p>
  50483. </dd>
  50484. <dt><samp class="option">udu_sei_as_ascii</samp></dt>
  50485. <dd><p>Try to print user data unregistered SEI as ascii character when possible,
  50486. in hex format otherwise.
  50487. </p></dd>
  50488. </dl>
  50489. <p>The shown line contains a sequence of key/value pairs of the form
  50490. <var class="var">key</var>:<var class="var">value</var>.
  50491. </p>
  50492. <p>The following values are shown in the output:
  50493. </p>
  50494. <dl class="table">
  50495. <dt><samp class="option">n</samp></dt>
  50496. <dd><p>The (sequential) number of the input frame, starting from 0.
  50497. </p>
  50498. </dd>
  50499. <dt><samp class="option">pts</samp></dt>
  50500. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  50501. time base units. The time base unit depends on the filter input pad.
  50502. </p>
  50503. </dd>
  50504. <dt><samp class="option">pts_time</samp></dt>
  50505. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  50506. seconds.
  50507. </p>
  50508. </dd>
  50509. <dt><samp class="option">fmt</samp></dt>
  50510. <dd><p>The pixel format name.
  50511. </p>
  50512. </dd>
  50513. <dt><samp class="option">sar</samp></dt>
  50514. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  50515. <var class="var">num</var>/<var class="var">den</var>.
  50516. </p>
  50517. </dd>
  50518. <dt><samp class="option">s</samp></dt>
  50519. <dd><p>The size of the input frame. For the syntax of this option, check the
  50520. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  50521. </p>
  50522. </dd>
  50523. <dt><samp class="option">i</samp></dt>
  50524. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  50525. for bottom field first).
  50526. </p>
  50527. </dd>
  50528. <dt><samp class="option">iskey</samp></dt>
  50529. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  50530. </p>
  50531. </dd>
  50532. <dt><samp class="option">type</samp></dt>
  50533. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  50534. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  50535. Also refer to the documentation of the <code class="code">AVPictureType</code> enum and of
  50536. the <code class="code">av_get_picture_type_char</code> function defined in
  50537. <samp class="file">libavutil/avutil.h</samp>.
  50538. </p>
  50539. </dd>
  50540. <dt><samp class="option">checksum</samp></dt>
  50541. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  50542. </p>
  50543. </dd>
  50544. <dt><samp class="option">plane_checksum</samp></dt>
  50545. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  50546. 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;.
  50547. </p>
  50548. </dd>
  50549. <dt><samp class="option">mean</samp></dt>
  50550. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  50551. &quot;[<var class="var">mean0</var> <var class="var">mean1</var> <var class="var">mean2</var> <var class="var">mean3</var>]&quot;.
  50552. </p>
  50553. </dd>
  50554. <dt><samp class="option">stdev</samp></dt>
  50555. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  50556. 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;.
  50557. </p>
  50558. </dd>
  50559. </dl>
  50560. <a name="showpalette"></a>
  50561. <h3 class="section">39.226 showpalette<span class="pull-right"><a class="anchor hidden-xs" href="#showpalette" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showpalette" aria-hidden="true">TOC</a></span></h3>
  50562. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  50563. <var class="var">pal8</var> pixel format frames.
  50564. </p>
  50565. <p>It accepts the following option:
  50566. </p>
  50567. <dl class="table">
  50568. <dt><samp class="option">s</samp></dt>
  50569. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  50570. <code class="code">30</code> (for a <code class="code">30x30</code> pixel box).
  50571. </p></dd>
  50572. </dl>
  50573. <a name="shuffleframes"></a>
  50574. <h3 class="section">39.227 shuffleframes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleframes" aria-hidden="true">TOC</a></span></h3>
  50575. <p>Reorder and/or duplicate and/or drop video frames.
  50576. </p>
  50577. <p>It accepts the following parameters:
  50578. </p>
  50579. <dl class="table">
  50580. <dt><samp class="option">mapping</samp></dt>
  50581. <dd><p>Set the destination indexes of input frames.
  50582. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  50583. frames. Number of indexes also sets maximal value that each index may have.
  50584. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  50585. </p></dd>
  50586. </dl>
  50587. <p>The first frame has the index 0. The default is to keep the input unchanged.
  50588. </p>
  50589. <a name="Examples-162"></a>
  50590. <h4 class="subsection">39.227.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-162" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-162" aria-hidden="true">TOC</a></span></h4>
  50591. <ul class="itemize mark-bullet">
  50592. <li>Swap second and third frame of every three frames of the input:
  50593. <div class="example">
  50594. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  50595. </pre></div>
  50596. </li><li>Swap 10th and 1st frame of every ten frames of the input:
  50597. <div class="example">
  50598. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  50599. </pre></div>
  50600. </li></ul>
  50601. <a name="shufflepixels"></a>
  50602. <h3 class="section">39.228 shufflepixels<span class="pull-right"><a class="anchor hidden-xs" href="#shufflepixels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shufflepixels" aria-hidden="true">TOC</a></span></h3>
  50603. <p>Reorder pixels in video frames.
  50604. </p>
  50605. <p>This filter accepts the following options:
  50606. </p>
  50607. <dl class="table">
  50608. <dt><samp class="option">direction, d</samp></dt>
  50609. <dd><p>Set shuffle direction. Can be forward or inverse direction.
  50610. Default direction is forward.
  50611. </p>
  50612. </dd>
  50613. <dt><samp class="option">mode, m</samp></dt>
  50614. <dd><p>Set shuffle mode. Can be horizontal, vertical or block mode.
  50615. </p>
  50616. </dd>
  50617. <dt><samp class="option">width, w</samp></dt>
  50618. <dt><samp class="option">height, h</samp></dt>
  50619. <dd><p>Set shuffle block_size. In case of horizontal shuffle mode only width
  50620. part of size is used, and in case of vertical shuffle mode only height
  50621. part of size is used.
  50622. </p>
  50623. </dd>
  50624. <dt><samp class="option">seed, s</samp></dt>
  50625. <dd><p>Set random seed used with shuffling pixels. Mainly useful to set to be able
  50626. to reverse filtering process to get original input.
  50627. For example, to reverse forward shuffle you need to use same parameters
  50628. and exact same seed and to set direction to inverse.
  50629. </p></dd>
  50630. </dl>
  50631. <a name="shuffleplanes"></a>
  50632. <h3 class="section">39.229 shuffleplanes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleplanes" aria-hidden="true">TOC</a></span></h3>
  50633. <p>Reorder and/or duplicate video planes.
  50634. </p>
  50635. <p>It accepts the following parameters:
  50636. </p>
  50637. <dl class="table">
  50638. <dt><samp class="option">map0</samp></dt>
  50639. <dd><p>The index of the input plane to be used as the first output plane.
  50640. </p>
  50641. </dd>
  50642. <dt><samp class="option">map1</samp></dt>
  50643. <dd><p>The index of the input plane to be used as the second output plane.
  50644. </p>
  50645. </dd>
  50646. <dt><samp class="option">map2</samp></dt>
  50647. <dd><p>The index of the input plane to be used as the third output plane.
  50648. </p>
  50649. </dd>
  50650. <dt><samp class="option">map3</samp></dt>
  50651. <dd><p>The index of the input plane to be used as the fourth output plane.
  50652. </p>
  50653. </dd>
  50654. </dl>
  50655. <p>The first plane has the index 0. The default is to keep the input unchanged.
  50656. </p>
  50657. <a name="Examples-163"></a>
  50658. <h4 class="subsection">39.229.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-163" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-163" aria-hidden="true">TOC</a></span></h4>
  50659. <ul class="itemize mark-bullet">
  50660. <li>Swap the second and third planes of the input:
  50661. <div class="example">
  50662. <pre class="example-preformatted">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  50663. </pre></div>
  50664. </li></ul>
  50665. <a class="anchor" id="signalstats"></a><a name="signalstats-1"></a>
  50666. <h3 class="section">39.230 signalstats<span class="pull-right"><a class="anchor hidden-xs" href="#signalstats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signalstats-1" aria-hidden="true">TOC</a></span></h3>
  50667. <p>Evaluate various visual metrics that assist in determining issues associated
  50668. with the digitization of analog video media.
  50669. </p>
  50670. <p>By default the filter will log these metadata values:
  50671. </p>
  50672. <dl class="table">
  50673. <dt><samp class="option">YMIN</samp></dt>
  50674. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  50675. range of [0-255].
  50676. </p>
  50677. </dd>
  50678. <dt><samp class="option">YLOW</samp></dt>
  50679. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  50680. range of [0-255].
  50681. </p>
  50682. </dd>
  50683. <dt><samp class="option">YAVG</samp></dt>
  50684. <dd><p>Display the average Y value within the input frame. Expressed in range of
  50685. [0-255].
  50686. </p>
  50687. </dd>
  50688. <dt><samp class="option">YHIGH</samp></dt>
  50689. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  50690. range of [0-255].
  50691. </p>
  50692. </dd>
  50693. <dt><samp class="option">YMAX</samp></dt>
  50694. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  50695. range of [0-255].
  50696. </p>
  50697. </dd>
  50698. <dt><samp class="option">UMIN</samp></dt>
  50699. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  50700. range of [0-255].
  50701. </p>
  50702. </dd>
  50703. <dt><samp class="option">ULOW</samp></dt>
  50704. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  50705. range of [0-255].
  50706. </p>
  50707. </dd>
  50708. <dt><samp class="option">UAVG</samp></dt>
  50709. <dd><p>Display the average U value within the input frame. Expressed in range of
  50710. [0-255].
  50711. </p>
  50712. </dd>
  50713. <dt><samp class="option">UHIGH</samp></dt>
  50714. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  50715. range of [0-255].
  50716. </p>
  50717. </dd>
  50718. <dt><samp class="option">UMAX</samp></dt>
  50719. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  50720. range of [0-255].
  50721. </p>
  50722. </dd>
  50723. <dt><samp class="option">VMIN</samp></dt>
  50724. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  50725. range of [0-255].
  50726. </p>
  50727. </dd>
  50728. <dt><samp class="option">VLOW</samp></dt>
  50729. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  50730. range of [0-255].
  50731. </p>
  50732. </dd>
  50733. <dt><samp class="option">VAVG</samp></dt>
  50734. <dd><p>Display the average V value within the input frame. Expressed in range of
  50735. [0-255].
  50736. </p>
  50737. </dd>
  50738. <dt><samp class="option">VHIGH</samp></dt>
  50739. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  50740. range of [0-255].
  50741. </p>
  50742. </dd>
  50743. <dt><samp class="option">VMAX</samp></dt>
  50744. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  50745. range of [0-255].
  50746. </p>
  50747. </dd>
  50748. <dt><samp class="option">SATMIN</samp></dt>
  50749. <dd><p>Display the minimal saturation value contained within the input frame.
  50750. Expressed in range of [0-~181.02].
  50751. </p>
  50752. </dd>
  50753. <dt><samp class="option">SATLOW</samp></dt>
  50754. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  50755. Expressed in range of [0-~181.02].
  50756. </p>
  50757. </dd>
  50758. <dt><samp class="option">SATAVG</samp></dt>
  50759. <dd><p>Display the average saturation value within the input frame. Expressed in range
  50760. of [0-~181.02].
  50761. </p>
  50762. </dd>
  50763. <dt><samp class="option">SATHIGH</samp></dt>
  50764. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  50765. Expressed in range of [0-~181.02].
  50766. </p>
  50767. </dd>
  50768. <dt><samp class="option">SATMAX</samp></dt>
  50769. <dd><p>Display the maximum saturation value contained within the input frame.
  50770. Expressed in range of [0-~181.02].
  50771. </p>
  50772. </dd>
  50773. <dt><samp class="option">HUEMED</samp></dt>
  50774. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  50775. [0-360].
  50776. </p>
  50777. </dd>
  50778. <dt><samp class="option">HUEAVG</samp></dt>
  50779. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  50780. [0-360].
  50781. </p>
  50782. </dd>
  50783. <dt><samp class="option">YDIF</samp></dt>
  50784. <dd><p>Display the average of sample value difference between all values of the Y
  50785. plane in the current frame and corresponding values of the previous input frame.
  50786. Expressed in range of [0-255].
  50787. </p>
  50788. </dd>
  50789. <dt><samp class="option">UDIF</samp></dt>
  50790. <dd><p>Display the average of sample value difference between all values of the U
  50791. plane in the current frame and corresponding values of the previous input frame.
  50792. Expressed in range of [0-255].
  50793. </p>
  50794. </dd>
  50795. <dt><samp class="option">VDIF</samp></dt>
  50796. <dd><p>Display the average of sample value difference between all values of the V
  50797. plane in the current frame and corresponding values of the previous input frame.
  50798. Expressed in range of [0-255].
  50799. </p>
  50800. </dd>
  50801. <dt><samp class="option">YBITDEPTH</samp></dt>
  50802. <dd><p>Display bit depth of Y plane in current frame.
  50803. Expressed in range of [0-16].
  50804. </p>
  50805. </dd>
  50806. <dt><samp class="option">UBITDEPTH</samp></dt>
  50807. <dd><p>Display bit depth of U plane in current frame.
  50808. Expressed in range of [0-16].
  50809. </p>
  50810. </dd>
  50811. <dt><samp class="option">VBITDEPTH</samp></dt>
  50812. <dd><p>Display bit depth of V plane in current frame.
  50813. Expressed in range of [0-16].
  50814. </p></dd>
  50815. </dl>
  50816. <p>The filter accepts the following options:
  50817. </p>
  50818. <dl class="table">
  50819. <dt><samp class="option">stat</samp></dt>
  50820. <dt><samp class="option">out</samp></dt>
  50821. <dd>
  50822. <p><samp class="option">stat</samp> specify an additional form of image analysis.
  50823. <samp class="option">out</samp> output video with the specified type of pixel highlighted.
  50824. </p>
  50825. <p>Both options accept the following values:
  50826. </p>
  50827. <dl class="table">
  50828. <dt>&lsquo;<samp class="samp">tout</samp>&rsquo;</dt>
  50829. <dd><p>Identify <var class="var">temporal outliers</var> pixels. A <var class="var">temporal outlier</var> is a pixel
  50830. unlike the neighboring pixels of the same field. Examples of temporal outliers
  50831. include the results of video dropouts, head clogs, or tape tracking issues.
  50832. </p>
  50833. </dd>
  50834. <dt>&lsquo;<samp class="samp">vrep</samp>&rsquo;</dt>
  50835. <dd><p>Identify <var class="var">vertical line repetition</var>. Vertical line repetition includes
  50836. similar rows of pixels within a frame. In born-digital video vertical line
  50837. repetition is common, but this pattern is uncommon in video digitized from an
  50838. analog source. When it occurs in video that results from the digitization of an
  50839. analog source it can indicate concealment from a dropout compensator.
  50840. </p>
  50841. </dd>
  50842. <dt>&lsquo;<samp class="samp">brng</samp>&rsquo;</dt>
  50843. <dd><p>Identify pixels that fall outside of legal broadcast range.
  50844. </p></dd>
  50845. </dl>
  50846. </dd>
  50847. <dt><samp class="option">color, c</samp></dt>
  50848. <dd><p>Set the highlight color for the <samp class="option">out</samp> option. The default color is
  50849. yellow.
  50850. </p></dd>
  50851. </dl>
  50852. <a name="Examples-164"></a>
  50853. <h4 class="subsection">39.230.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-164" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-164" aria-hidden="true">TOC</a></span></h4>
  50854. <ul class="itemize mark-bullet">
  50855. <li>Output data of various video metrics:
  50856. <div class="example">
  50857. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  50858. </pre></div>
  50859. </li><li>Output specific data about the minimum and maximum values of the Y plane per frame:
  50860. <div class="example">
  50861. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  50862. </pre></div>
  50863. </li><li>Playback video while highlighting pixels that are outside of broadcast range in red.
  50864. <div class="example">
  50865. <pre class="example-preformatted">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  50866. </pre></div>
  50867. </li><li>Playback video with signalstats metadata drawn over the frame.
  50868. <div class="example">
  50869. <pre class="example-preformatted">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  50870. </pre></div>
  50871. <p>The contents of signalstat_drawtext.txt used in the command are:
  50872. </p><div class="example">
  50873. <pre class="example-preformatted">time %{pts:hms}
  50874. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  50875. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  50876. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  50877. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  50878. </pre></div>
  50879. </li></ul>
  50880. <a class="anchor" id="signature"></a><a name="signature-1"></a>
  50881. <h3 class="section">39.231 signature<span class="pull-right"><a class="anchor hidden-xs" href="#signature-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signature-1" aria-hidden="true">TOC</a></span></h3>
  50882. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  50883. input. In this case the matching between the inputs can be calculated additionally.
  50884. The filter always passes through the first input. The signature of each stream can
  50885. be written into a file.
  50886. </p>
  50887. <p>It accepts the following options:
  50888. </p>
  50889. <dl class="table">
  50890. <dt><samp class="option">detectmode</samp></dt>
  50891. <dd><p>Enable or disable the matching process.
  50892. </p>
  50893. <p>Available values are:
  50894. </p>
  50895. <dl class="table">
  50896. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  50897. <dd><p>Disable the calculation of a matching (default).
  50898. </p></dd>
  50899. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  50900. <dd><p>Calculate the matching for the whole video and output whether the whole video
  50901. matches or only parts.
  50902. </p></dd>
  50903. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  50904. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  50905. some cases.
  50906. </p></dd>
  50907. </dl>
  50908. </dd>
  50909. <dt><samp class="option">nb_inputs</samp></dt>
  50910. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  50911. Default value is 1.
  50912. </p>
  50913. </dd>
  50914. <dt><samp class="option">filename</samp></dt>
  50915. <dd><p>Set the path to which the output is written. If there is more than one input,
  50916. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  50917. integer), that will be replaced with the input number. If no filename is
  50918. specified, no output will be written. This is the default.
  50919. </p>
  50920. </dd>
  50921. <dt><samp class="option">format</samp></dt>
  50922. <dd><p>Choose the output format.
  50923. </p>
  50924. <p>Available values are:
  50925. </p>
  50926. <dl class="table">
  50927. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  50928. <dd><p>Use the specified binary representation (default).
  50929. </p></dd>
  50930. <dt>&lsquo;<samp class="samp">xml</samp>&rsquo;</dt>
  50931. <dd><p>Use the specified xml representation.
  50932. </p></dd>
  50933. </dl>
  50934. </dd>
  50935. <dt><samp class="option">th_d</samp></dt>
  50936. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  50937. greater than zero. The default value is 9000.
  50938. </p>
  50939. </dd>
  50940. <dt><samp class="option">th_dc</samp></dt>
  50941. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  50942. greater than zero. The default value is 60000.
  50943. </p>
  50944. </dd>
  50945. <dt><samp class="option">th_xh</samp></dt>
  50946. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  50947. greater than zero. The default value is 116.
  50948. </p>
  50949. </dd>
  50950. <dt><samp class="option">th_di</samp></dt>
  50951. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  50952. sequence. The option value must be a non negative integer value.
  50953. The default value is 0.
  50954. </p>
  50955. </dd>
  50956. <dt><samp class="option">th_it</samp></dt>
  50957. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  50958. The option value must be a double value between 0 and 1. The default value is 0.5.
  50959. </p></dd>
  50960. </dl>
  50961. <a name="Examples-165"></a>
  50962. <h4 class="subsection">39.231.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-165" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-165" aria-hidden="true">TOC</a></span></h4>
  50963. <ul class="itemize mark-bullet">
  50964. <li>To calculate the signature of an input video and store it in signature.bin:
  50965. <div class="example">
  50966. <pre class="example-preformatted">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  50967. </pre></div>
  50968. </li><li>To detect whether two videos match and store the signatures in XML format in
  50969. signature0.xml and signature1.xml:
  50970. <div class="example">
  50971. <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 -
  50972. </pre></div>
  50973. </li></ul>
  50974. <a class="anchor" id="siti"></a><a name="siti-1"></a>
  50975. <h3 class="section">39.232 siti<span class="pull-right"><a class="anchor hidden-xs" href="#siti-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-siti-1" aria-hidden="true">TOC</a></span></h3>
  50976. <p>Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video,
  50977. as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods
  50978. 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>.
  50979. Note that this is a legacy implementation that corresponds to a superseded recommendation.
  50980. 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>
  50981. </p>
  50982. <p>It accepts the following option:
  50983. </p>
  50984. <dl class="table">
  50985. <dt><samp class="option">print_summary</samp></dt>
  50986. <dd><p>If set to 1, Summary statistics will be printed to the console. Default 0.
  50987. </p></dd>
  50988. </dl>
  50989. <a name="Examples-166"></a>
  50990. <h4 class="subsection">39.232.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-166" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-166" aria-hidden="true">TOC</a></span></h4>
  50991. <ul class="itemize mark-bullet">
  50992. <li>To calculate SI/TI metrics and print summary:
  50993. <div class="example">
  50994. <pre class="example-preformatted">ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
  50995. </pre></div>
  50996. </li></ul>
  50997. <a class="anchor" id="smartblur"></a><a name="smartblur-1"></a>
  50998. <h3 class="section">39.233 smartblur<span class="pull-right"><a class="anchor hidden-xs" href="#smartblur-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smartblur-1" aria-hidden="true">TOC</a></span></h3>
  50999. <p>Blur the input video without impacting the outlines.
  51000. </p>
  51001. <p>It accepts the following options:
  51002. </p>
  51003. <dl class="table">
  51004. <dt><samp class="option">luma_radius, lr</samp></dt>
  51005. <dd><p>Set the luma radius. The option value must be a float number in
  51006. the range [0.1,5.0] that specifies the variance of the gaussian filter
  51007. used to blur the image (slower if larger). Default value is 1.0.
  51008. </p>
  51009. </dd>
  51010. <dt><samp class="option">luma_strength, ls</samp></dt>
  51011. <dd><p>Set the luma strength. The option value must be a float number
  51012. in the range [-1.0,1.0] that configures the blurring. A value included
  51013. in [0.0,1.0] will blur the image whereas a value included in
  51014. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  51015. </p>
  51016. </dd>
  51017. <dt><samp class="option">luma_threshold, lt</samp></dt>
  51018. <dd><p>Set the luma threshold used as a coefficient to determine
  51019. whether a pixel should be blurred or not. The option value must be an
  51020. integer in the range [-30,30]. A value of 0 will filter all the image,
  51021. a value included in [0,30] will filter flat areas and a value included
  51022. in [-30,0] will filter edges. Default value is 0.
  51023. </p>
  51024. </dd>
  51025. <dt><samp class="option">chroma_radius, cr</samp></dt>
  51026. <dd><p>Set the chroma radius. The option value must be a float number in
  51027. the range [0.1,5.0] that specifies the variance of the gaussian filter
  51028. used to blur the image (slower if larger). Default value is <samp class="option">luma_radius</samp>.
  51029. </p>
  51030. </dd>
  51031. <dt><samp class="option">chroma_strength, cs</samp></dt>
  51032. <dd><p>Set the chroma strength. The option value must be a float number
  51033. in the range [-1.0,1.0] that configures the blurring. A value included
  51034. in [0.0,1.0] will blur the image whereas a value included in
  51035. [-1.0,0.0] will sharpen the image. Default value is <samp class="option">luma_strength</samp>.
  51036. </p>
  51037. </dd>
  51038. <dt><samp class="option">chroma_threshold, ct</samp></dt>
  51039. <dd><p>Set the chroma threshold used as a coefficient to determine
  51040. whether a pixel should be blurred or not. The option value must be an
  51041. integer in the range [-30,30]. A value of 0 will filter all the image,
  51042. a value included in [0,30] will filter flat areas and a value included
  51043. in [-30,0] will filter edges. Default value is <samp class="option">luma_threshold</samp>.
  51044. </p>
  51045. </dd>
  51046. <dt><samp class="option">alpha_radius, ar</samp></dt>
  51047. <dd><p>Set the alpha radius. The option value must be a float number in
  51048. the range [0.1,5.0] that specifies the variance of the gaussian filter
  51049. used to blur the image (slower if larger). Default value is <samp class="option">luma_radius</samp>.
  51050. </p>
  51051. </dd>
  51052. <dt><samp class="option">alpha_strength, as</samp></dt>
  51053. <dd><p>Set the alpha strength. The option value must be a float number
  51054. in the range [-1.0,1.0] that configures the blurring. A value included
  51055. in [0.0,1.0] will blur the image whereas a value included in
  51056. [-1.0,0.0] will sharpen the image. Default value is <samp class="option">luma_strength</samp>.
  51057. </p>
  51058. </dd>
  51059. <dt><samp class="option">alpha_threshold, at</samp></dt>
  51060. <dd><p>Set the alpha threshold used as a coefficient to determine
  51061. whether a pixel should be blurred or not. The option value must be an
  51062. integer in the range [-30,30]. A value of 0 will filter all the image,
  51063. a value included in [0,30] will filter flat areas and a value included
  51064. in [-30,0] will filter edges. Default value is <samp class="option">luma_threshold</samp>.
  51065. </p></dd>
  51066. </dl>
  51067. <p>If a chroma or alpha option is not explicitly set, the corresponding luma value
  51068. is set.
  51069. </p>
  51070. <a name="sobel"></a>
  51071. <h3 class="section">39.234 sobel<span class="pull-right"><a class="anchor hidden-xs" href="#sobel" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sobel" aria-hidden="true">TOC</a></span></h3>
  51072. <p>Apply sobel operator to input video stream.
  51073. </p>
  51074. <p>The filter accepts the following option:
  51075. </p>
  51076. <dl class="table">
  51077. <dt><samp class="option">planes</samp></dt>
  51078. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  51079. By default value 0xf, all planes will be processed.
  51080. </p>
  51081. </dd>
  51082. <dt><samp class="option">scale</samp></dt>
  51083. <dd><p>Set value which will be multiplied with filtered result.
  51084. </p>
  51085. </dd>
  51086. <dt><samp class="option">delta</samp></dt>
  51087. <dd><p>Set value which will be added to filtered result.
  51088. </p></dd>
  51089. </dl>
  51090. <a name="Commands-142"></a>
  51091. <h4 class="subsection">39.234.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-142" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-142" aria-hidden="true">TOC</a></span></h4>
  51092. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  51093. </p>
  51094. <a class="anchor" id="spp"></a><a name="spp-1"></a>
  51095. <h3 class="section">39.235 spp<span class="pull-right"><a class="anchor hidden-xs" href="#spp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spp-1" aria-hidden="true">TOC</a></span></h3>
  51096. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  51097. at several (or - in the case of <samp class="option">quality</samp> level <code class="code">6</code> - all) shifts
  51098. and average the results.
  51099. </p>
  51100. <p>The filter accepts the following options:
  51101. </p>
  51102. <dl class="table">
  51103. <dt><samp class="option">quality</samp></dt>
  51104. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  51105. an integer in the range 0-6. If set to <code class="code">0</code>, the filter will have no
  51106. effect. A value of <code class="code">6</code> means the higher quality. For each increment of
  51107. that value the speed drops by a factor of approximately 2. Default value is
  51108. <code class="code">3</code>.
  51109. </p>
  51110. </dd>
  51111. <dt><samp class="option">qp</samp></dt>
  51112. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  51113. from the video stream (if available).
  51114. </p>
  51115. </dd>
  51116. <dt><samp class="option">mode</samp></dt>
  51117. <dd><p>Set thresholding mode. Available modes are:
  51118. </p>
  51119. <dl class="table">
  51120. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  51121. <dd><p>Set hard thresholding (default).
  51122. </p></dd>
  51123. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  51124. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  51125. </p></dd>
  51126. </dl>
  51127. </dd>
  51128. <dt><samp class="option">use_bframe_qp</samp></dt>
  51129. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  51130. option may cause flicker since the B-Frames have often larger QP. Default is
  51131. <code class="code">0</code> (not enabled).
  51132. </p></dd>
  51133. </dl>
  51134. <a name="Commands-143"></a>
  51135. <h4 class="subsection">39.235.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-143" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-143" aria-hidden="true">TOC</a></span></h4>
  51136. <p>This filter supports the following commands:
  51137. </p><dl class="table">
  51138. <dt><samp class="option">quality, level</samp></dt>
  51139. <dd><p>Set quality level. The value <code class="code">max</code> can be used to set the maximum level,
  51140. currently <code class="code">6</code>.
  51141. </p></dd>
  51142. </dl>
  51143. <a class="anchor" id="sr"></a><a name="sr-1"></a>
  51144. <h3 class="section">39.236 sr<span class="pull-right"><a class="anchor hidden-xs" href="#sr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sr-1" aria-hidden="true">TOC</a></span></h3>
  51145. <p>Scale the input by applying one of the super-resolution methods based on
  51146. convolutional neural networks. Supported models:
  51147. </p>
  51148. <ul class="itemize mark-bullet">
  51149. <li>Super-Resolution Convolutional Neural Network model (SRCNN).
  51150. See <a class="url" href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  51151. </li><li>Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  51152. See <a class="url" href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  51153. </li></ul>
  51154. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  51155. <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
  51156. is at <a class="url" href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  51157. </p>
  51158. <p>The filter accepts the following options:
  51159. </p>
  51160. <dl class="table">
  51161. <dt><samp class="option">dnn_backend</samp></dt>
  51162. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  51163. the following values:
  51164. </p>
  51165. <dl class="table">
  51166. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  51167. <dd><p>TensorFlow backend. To enable this backend you
  51168. need to install the TensorFlow for C library (see
  51169. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  51170. <code class="code">--enable-libtensorflow</code>
  51171. </p></dd>
  51172. </dl>
  51173. </dd>
  51174. <dt><samp class="option">model</samp></dt>
  51175. <dd><p>Set path to model file specifying network architecture and its parameters.
  51176. Note that different backends use different file formats. TensorFlow, OpenVINO backend
  51177. can load files for only its format.
  51178. </p>
  51179. </dd>
  51180. <dt><samp class="option">scale_factor</samp></dt>
  51181. <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>.
  51182. Default value is <code class="code">2</code>. Scale factor is necessary for SRCNN model, because it accepts
  51183. input upscaled using bicubic upscaling with proper scale factor.
  51184. </p></dd>
  51185. </dl>
  51186. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  51187. </p>
  51188. <a class="anchor" id="sr_005famf"></a><a name="sr_005famf-1"></a>
  51189. <h3 class="section">39.237 sr_amf<span class="pull-right"><a class="anchor hidden-xs" href="#sr_005famf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sr_005famf-1" aria-hidden="true">TOC</a></span></h3>
  51190. <p>Upscale (size increasing) for the input video using AMD Advanced Media Framework library for hardware acceleration.
  51191. Use advanced algorithms for upscaling with higher output quality.
  51192. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  51193. </p>
  51194. <p>The filter accepts the following options:
  51195. </p><dl class="table">
  51196. <dt><samp class="option">w</samp></dt>
  51197. <dt><samp class="option">h</samp></dt>
  51198. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  51199. </p>
  51200. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  51201. </p>
  51202. </dd>
  51203. <dt><samp class="option">algorithm</samp></dt>
  51204. <dd><p>Sets the algorithm used for scaling:
  51205. </p>
  51206. <dl class="table">
  51207. <dt><var class="var">bilinear</var></dt>
  51208. <dd><p>Bilinear
  51209. </p>
  51210. </dd>
  51211. <dt><var class="var">bicubic</var></dt>
  51212. <dd><p>Bicubic
  51213. </p>
  51214. </dd>
  51215. <dt><var class="var">sr1-0</var></dt>
  51216. <dd><p>Video SR1.0
  51217. This is a default value
  51218. </p>
  51219. </dd>
  51220. <dt><var class="var">point</var></dt>
  51221. <dd><p>Point
  51222. </p>
  51223. </dd>
  51224. <dt><var class="var">sr1-1</var></dt>
  51225. <dd><p>Video SR1.1
  51226. </p>
  51227. </dd>
  51228. </dl>
  51229. </dd>
  51230. <dt><samp class="option">sharpness</samp></dt>
  51231. <dd><p>Control hq scaler sharpening. The value is a float in the range of [0.0, 2.0]
  51232. </p>
  51233. </dd>
  51234. <dt><samp class="option">format</samp></dt>
  51235. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  51236. pixel format is used.
  51237. </p>
  51238. </dd>
  51239. <dt><samp class="option">keep-ratio</samp></dt>
  51240. <dd><p>Force the scaler to keep the aspect ratio of the input image when the output size has a different aspect ratio.
  51241. Default value is false.
  51242. </p>
  51243. </dd>
  51244. <dt><samp class="option">fill</samp></dt>
  51245. <dd><p>Specifies whether the output image outside the region of interest,
  51246. which does not fill the entire output surface should be filled with a solid color.
  51247. </p>
  51248. </dd>
  51249. </dl>
  51250. <a name="Examples-167"></a>
  51251. <h4 class="subsection">39.237.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-167" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-167" aria-hidden="true">TOC</a></span></h4>
  51252. <ul class="itemize mark-bullet">
  51253. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  51254. <div class="example">
  51255. <pre class="example-preformatted">sr_amf=-2:720:format=yuv420p
  51256. </pre></div>
  51257. </li><li>Upscale to 4K with algorithm video SR1.1.
  51258. <div class="example">
  51259. <pre class="example-preformatted">sr_amf=4096:2160:algorithm=sr1-1
  51260. </pre></div>
  51261. </li></ul>
  51262. <a name="ssim"></a>
  51263. <h3 class="section">39.238 ssim<span class="pull-right"><a class="anchor hidden-xs" href="#ssim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ssim" aria-hidden="true">TOC</a></span></h3>
  51264. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  51265. </p>
  51266. <p>This filter takes in input two input videos, the first input is
  51267. considered the &quot;main&quot; source and is passed unchanged to the
  51268. output. The second input is used as a &quot;reference&quot; video for computing
  51269. the SSIM.
  51270. </p>
  51271. <p>Both video inputs must have the same resolution and pixel format for
  51272. this filter to work correctly. Also it assumes that both inputs
  51273. have the same number of frames, which are compared one by one.
  51274. </p>
  51275. <p>The filter stores the calculated SSIM of each frame.
  51276. </p>
  51277. <p>The description of the accepted parameters follows.
  51278. </p>
  51279. <dl class="table">
  51280. <dt><samp class="option">stats_file, f</samp></dt>
  51281. <dd><p>If specified the filter will use the named file to save the SSIM of
  51282. each individual frame. When filename equals &quot;-&quot; the data is sent to
  51283. standard output.
  51284. </p></dd>
  51285. </dl>
  51286. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  51287. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  51288. couple of frames.
  51289. </p>
  51290. <p>A description of each shown parameter follows:
  51291. </p>
  51292. <dl class="table">
  51293. <dt><samp class="option">n</samp></dt>
  51294. <dd><p>sequential number of the input frame, starting from 1
  51295. </p>
  51296. </dd>
  51297. <dt><samp class="option">Y, U, V, R, G, B</samp></dt>
  51298. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  51299. </p>
  51300. </dd>
  51301. <dt><samp class="option">All</samp></dt>
  51302. <dd><p>SSIM of the compared frames for the whole frame.
  51303. </p>
  51304. </dd>
  51305. <dt><samp class="option">dB</samp></dt>
  51306. <dd><p>Same as above but in dB representation.
  51307. </p></dd>
  51308. </dl>
  51309. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  51310. </p>
  51311. <a name="Examples-168"></a>
  51312. <h4 class="subsection">39.238.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-168" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-168" aria-hidden="true">TOC</a></span></h4>
  51313. <ul class="itemize mark-bullet">
  51314. <li>For example:
  51315. <div class="example">
  51316. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  51317. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  51318. </pre></div>
  51319. <p>On this example the input file being processed is compared with the
  51320. reference file <samp class="file">ref_movie.mpg</samp>. The SSIM of each individual frame
  51321. is stored in <samp class="file">stats.log</samp>.
  51322. </p>
  51323. </li><li>Another example with both psnr and ssim at same time:
  51324. <div class="example">
  51325. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  51326. </pre></div>
  51327. </li><li>Another example with different containers:
  51328. <div class="example">
  51329. <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 -
  51330. </pre></div>
  51331. </li></ul>
  51332. <a name="stereo3d"></a>
  51333. <h3 class="section">39.239 stereo3d<span class="pull-right"><a class="anchor hidden-xs" href="#stereo3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereo3d" aria-hidden="true">TOC</a></span></h3>
  51334. <p>Convert between different stereoscopic image formats.
  51335. </p>
  51336. <p>The filters accept the following options:
  51337. </p>
  51338. <dl class="table">
  51339. <dt><samp class="option">in</samp></dt>
  51340. <dd><p>Set stereoscopic image format of input.
  51341. </p>
  51342. <p>Available values for input image formats are:
  51343. </p><dl class="table">
  51344. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  51345. <dd><p>side by side parallel (left eye left, right eye right)
  51346. </p>
  51347. </dd>
  51348. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  51349. <dd><p>side by side crosseye (right eye left, left eye right)
  51350. </p>
  51351. </dd>
  51352. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  51353. <dd><p>side by side parallel with half width resolution
  51354. (left eye left, right eye right)
  51355. </p>
  51356. </dd>
  51357. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  51358. <dd><p>side by side crosseye with half width resolution
  51359. (right eye left, left eye right)
  51360. </p>
  51361. </dd>
  51362. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  51363. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  51364. <dd><p>above-below (left eye above, right eye below)
  51365. </p>
  51366. </dd>
  51367. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  51368. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  51369. <dd><p>above-below (right eye above, left eye below)
  51370. </p>
  51371. </dd>
  51372. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  51373. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  51374. <dd><p>above-below with half height resolution
  51375. (left eye above, right eye below)
  51376. </p>
  51377. </dd>
  51378. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  51379. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  51380. <dd><p>above-below with half height resolution
  51381. (right eye above, left eye below)
  51382. </p>
  51383. </dd>
  51384. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  51385. <dd><p>alternating frames (left eye first, right eye second)
  51386. </p>
  51387. </dd>
  51388. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  51389. <dd><p>alternating frames (right eye first, left eye second)
  51390. </p>
  51391. </dd>
  51392. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  51393. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  51394. </p>
  51395. </dd>
  51396. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  51397. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  51398. </p>
  51399. </dd>
  51400. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  51401. <dd><p>interleaved columns, left eye first
  51402. </p>
  51403. </dd>
  51404. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  51405. <dd><p>interleaved columns, right eye first
  51406. </p>
  51407. <p>Default value is &lsquo;<samp class="samp">sbsl</samp>&rsquo;.
  51408. </p></dd>
  51409. </dl>
  51410. </dd>
  51411. <dt><samp class="option">out</samp></dt>
  51412. <dd><p>Set stereoscopic image format of output.
  51413. </p>
  51414. <dl class="table">
  51415. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  51416. <dd><p>side by side parallel (left eye left, right eye right)
  51417. </p>
  51418. </dd>
  51419. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  51420. <dd><p>side by side crosseye (right eye left, left eye right)
  51421. </p>
  51422. </dd>
  51423. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  51424. <dd><p>side by side parallel with half width resolution
  51425. (left eye left, right eye right)
  51426. </p>
  51427. </dd>
  51428. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  51429. <dd><p>side by side crosseye with half width resolution
  51430. (right eye left, left eye right)
  51431. </p>
  51432. </dd>
  51433. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  51434. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  51435. <dd><p>above-below (left eye above, right eye below)
  51436. </p>
  51437. </dd>
  51438. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  51439. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  51440. <dd><p>above-below (right eye above, left eye below)
  51441. </p>
  51442. </dd>
  51443. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  51444. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  51445. <dd><p>above-below with half height resolution
  51446. (left eye above, right eye below)
  51447. </p>
  51448. </dd>
  51449. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  51450. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  51451. <dd><p>above-below with half height resolution
  51452. (right eye above, left eye below)
  51453. </p>
  51454. </dd>
  51455. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  51456. <dd><p>alternating frames (left eye first, right eye second)
  51457. </p>
  51458. </dd>
  51459. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  51460. <dd><p>alternating frames (right eye first, left eye second)
  51461. </p>
  51462. </dd>
  51463. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  51464. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  51465. </p>
  51466. </dd>
  51467. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  51468. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  51469. </p>
  51470. </dd>
  51471. <dt>&lsquo;<samp class="samp">arbg</samp>&rsquo;</dt>
  51472. <dd><p>anaglyph red/blue gray
  51473. (red filter on left eye, blue filter on right eye)
  51474. </p>
  51475. </dd>
  51476. <dt>&lsquo;<samp class="samp">argg</samp>&rsquo;</dt>
  51477. <dd><p>anaglyph red/green gray
  51478. (red filter on left eye, green filter on right eye)
  51479. </p>
  51480. </dd>
  51481. <dt>&lsquo;<samp class="samp">arcg</samp>&rsquo;</dt>
  51482. <dd><p>anaglyph red/cyan gray
  51483. (red filter on left eye, cyan filter on right eye)
  51484. </p>
  51485. </dd>
  51486. <dt>&lsquo;<samp class="samp">arch</samp>&rsquo;</dt>
  51487. <dd><p>anaglyph red/cyan half colored
  51488. (red filter on left eye, cyan filter on right eye)
  51489. </p>
  51490. </dd>
  51491. <dt>&lsquo;<samp class="samp">arcc</samp>&rsquo;</dt>
  51492. <dd><p>anaglyph red/cyan color
  51493. (red filter on left eye, cyan filter on right eye)
  51494. </p>
  51495. </dd>
  51496. <dt>&lsquo;<samp class="samp">arcd</samp>&rsquo;</dt>
  51497. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  51498. (red filter on left eye, cyan filter on right eye)
  51499. </p>
  51500. </dd>
  51501. <dt>&lsquo;<samp class="samp">agmg</samp>&rsquo;</dt>
  51502. <dd><p>anaglyph green/magenta gray
  51503. (green filter on left eye, magenta filter on right eye)
  51504. </p>
  51505. </dd>
  51506. <dt>&lsquo;<samp class="samp">agmh</samp>&rsquo;</dt>
  51507. <dd><p>anaglyph green/magenta half colored
  51508. (green filter on left eye, magenta filter on right eye)
  51509. </p>
  51510. </dd>
  51511. <dt>&lsquo;<samp class="samp">agmc</samp>&rsquo;</dt>
  51512. <dd><p>anaglyph green/magenta colored
  51513. (green filter on left eye, magenta filter on right eye)
  51514. </p>
  51515. </dd>
  51516. <dt>&lsquo;<samp class="samp">agmd</samp>&rsquo;</dt>
  51517. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  51518. (green filter on left eye, magenta filter on right eye)
  51519. </p>
  51520. </dd>
  51521. <dt>&lsquo;<samp class="samp">aybg</samp>&rsquo;</dt>
  51522. <dd><p>anaglyph yellow/blue gray
  51523. (yellow filter on left eye, blue filter on right eye)
  51524. </p>
  51525. </dd>
  51526. <dt>&lsquo;<samp class="samp">aybh</samp>&rsquo;</dt>
  51527. <dd><p>anaglyph yellow/blue half colored
  51528. (yellow filter on left eye, blue filter on right eye)
  51529. </p>
  51530. </dd>
  51531. <dt>&lsquo;<samp class="samp">aybc</samp>&rsquo;</dt>
  51532. <dd><p>anaglyph yellow/blue colored
  51533. (yellow filter on left eye, blue filter on right eye)
  51534. </p>
  51535. </dd>
  51536. <dt>&lsquo;<samp class="samp">aybd</samp>&rsquo;</dt>
  51537. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  51538. (yellow filter on left eye, blue filter on right eye)
  51539. </p>
  51540. </dd>
  51541. <dt>&lsquo;<samp class="samp">ml</samp>&rsquo;</dt>
  51542. <dd><p>mono output (left eye only)
  51543. </p>
  51544. </dd>
  51545. <dt>&lsquo;<samp class="samp">mr</samp>&rsquo;</dt>
  51546. <dd><p>mono output (right eye only)
  51547. </p>
  51548. </dd>
  51549. <dt>&lsquo;<samp class="samp">chl</samp>&rsquo;</dt>
  51550. <dd><p>checkerboard, left eye first
  51551. </p>
  51552. </dd>
  51553. <dt>&lsquo;<samp class="samp">chr</samp>&rsquo;</dt>
  51554. <dd><p>checkerboard, right eye first
  51555. </p>
  51556. </dd>
  51557. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  51558. <dd><p>interleaved columns, left eye first
  51559. </p>
  51560. </dd>
  51561. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  51562. <dd><p>interleaved columns, right eye first
  51563. </p>
  51564. </dd>
  51565. <dt>&lsquo;<samp class="samp">hdmi</samp>&rsquo;</dt>
  51566. <dd><p>HDMI frame pack
  51567. </p></dd>
  51568. </dl>
  51569. <p>Default value is &lsquo;<samp class="samp">arcd</samp>&rsquo;.
  51570. </p></dd>
  51571. </dl>
  51572. <a name="Examples-169"></a>
  51573. <h4 class="subsection">39.239.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-169" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-169" aria-hidden="true">TOC</a></span></h4>
  51574. <ul class="itemize mark-bullet">
  51575. <li>Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  51576. <div class="example">
  51577. <pre class="example-preformatted">stereo3d=sbsl:aybd
  51578. </pre></div>
  51579. </li><li>Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  51580. <div class="example">
  51581. <pre class="example-preformatted">stereo3d=abl:sbsr
  51582. </pre></div>
  51583. </li></ul>
  51584. <a name="streamselect_002c-astreamselect"></a>
  51585. <h3 class="section">39.240 streamselect, astreamselect<span class="pull-right"><a class="anchor hidden-xs" href="#streamselect_002c-astreamselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-streamselect_002c-astreamselect" aria-hidden="true">TOC</a></span></h3>
  51586. <p>Select video or audio streams.
  51587. </p>
  51588. <p>The filter accepts the following options:
  51589. </p>
  51590. <dl class="table">
  51591. <dt><samp class="option">inputs</samp></dt>
  51592. <dd><p>Set number of inputs. Default is 2.
  51593. </p>
  51594. </dd>
  51595. <dt><samp class="option">map</samp></dt>
  51596. <dd><p>Set input indexes to remap to outputs.
  51597. </p></dd>
  51598. </dl>
  51599. <a name="Commands-144"></a>
  51600. <h4 class="subsection">39.240.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-144" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-144" aria-hidden="true">TOC</a></span></h4>
  51601. <p>The <code class="code">streamselect</code> and <code class="code">astreamselect</code> filter supports the following
  51602. commands:
  51603. </p>
  51604. <dl class="table">
  51605. <dt><samp class="option">map</samp></dt>
  51606. <dd><p>Set input indexes to remap to outputs.
  51607. </p></dd>
  51608. </dl>
  51609. <a name="Examples-170"></a>
  51610. <h4 class="subsection">39.240.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-170" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-170" aria-hidden="true">TOC</a></span></h4>
  51611. <ul class="itemize mark-bullet">
  51612. <li>Select first 5 seconds 1st stream and rest of time 2nd stream:
  51613. <div class="example">
  51614. <pre class="example-preformatted">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  51615. </pre></div>
  51616. </li><li>Same as above, but for audio:
  51617. <div class="example">
  51618. <pre class="example-preformatted">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  51619. </pre></div>
  51620. </li></ul>
  51621. <a class="anchor" id="subtitles"></a><a name="subtitles-1"></a>
  51622. <h3 class="section">39.241 subtitles<span class="pull-right"><a class="anchor hidden-xs" href="#subtitles-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subtitles-1" aria-hidden="true">TOC</a></span></h3>
  51623. <p>Draw subtitles on top of input video using the libass library.
  51624. </p>
  51625. <p>To enable compilation of this filter you need to configure FFmpeg with
  51626. <code class="code">--enable-libass</code>. This filter also requires a build with libavcodec and
  51627. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  51628. Alpha) subtitles format.
  51629. </p>
  51630. <p>The filter accepts the following options:
  51631. </p>
  51632. <dl class="table">
  51633. <dt><samp class="option">filename, f</samp></dt>
  51634. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  51635. </p>
  51636. </dd>
  51637. <dt><samp class="option">original_size</samp></dt>
  51638. <dd><p>Specify the size of the original video, the video for which the ASS file
  51639. was composed. For the syntax of this option, check the
  51640. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  51641. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  51642. correctly scale the fonts if the aspect ratio has been changed.
  51643. </p>
  51644. </dd>
  51645. <dt><samp class="option">fontsdir</samp></dt>
  51646. <dd><p>Set a directory path containing fonts that can be used by the filter.
  51647. These fonts will be used in addition to whatever the font provider uses.
  51648. </p>
  51649. </dd>
  51650. <dt><samp class="option">alpha</samp></dt>
  51651. <dd><p>Process alpha channel, by default alpha channel is untouched.
  51652. </p>
  51653. </dd>
  51654. <dt><samp class="option">charenc</samp></dt>
  51655. <dd><p>Set subtitles input character encoding. <code class="code">subtitles</code> filter only. Only
  51656. useful if not UTF-8.
  51657. </p>
  51658. </dd>
  51659. <dt><samp class="option">stream_index, si</samp></dt>
  51660. <dd><p>Set subtitles stream index. <code class="code">subtitles</code> filter only.
  51661. </p>
  51662. </dd>
  51663. <dt><samp class="option">force_style</samp></dt>
  51664. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  51665. string containing ASS style format <code class="code">KEY=VALUE</code> couples separated by &quot;,&quot;.
  51666. </p>
  51667. </dd>
  51668. <dt><samp class="option">wrap_unicode</samp></dt>
  51669. <dd><p>Break lines according to the Unicode Line Breaking Algorithm. Availability requires
  51670. at least libass release 0.17.0 (or LIBASS_VERSION 0x01600010), <em class="emph">and</em> libass must
  51671. have been built with libunibreak.
  51672. </p>
  51673. <p>The option is enabled by default except for native ASS.
  51674. </p></dd>
  51675. </dl>
  51676. <p>If the first key is not specified, it is assumed that the first value
  51677. specifies the <samp class="option">filename</samp>.
  51678. </p>
  51679. <p>For example, to render the file <samp class="file">sub.srt</samp> on top of the input
  51680. video, use the command:
  51681. </p><div class="example">
  51682. <pre class="example-preformatted">subtitles=sub.srt
  51683. </pre></div>
  51684. <p>which is equivalent to:
  51685. </p><div class="example">
  51686. <pre class="example-preformatted">subtitles=filename=sub.srt
  51687. </pre></div>
  51688. <p>To render the default subtitles stream from file <samp class="file">video.mkv</samp>, use:
  51689. </p><div class="example">
  51690. <pre class="example-preformatted">subtitles=video.mkv
  51691. </pre></div>
  51692. <p>To render the second subtitles stream from that file, use:
  51693. </p><div class="example">
  51694. <pre class="example-preformatted">subtitles=video.mkv:si=1
  51695. </pre></div>
  51696. <p>To make the subtitles stream from <samp class="file">sub.srt</samp> appear in 80% transparent blue
  51697. <code class="code">DejaVu Serif</code>, use:
  51698. </p><div class="example">
  51699. <pre class="example-preformatted">subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  51700. </pre></div>
  51701. <a name="super2xsai"></a>
  51702. <h3 class="section">39.242 super2xsai<span class="pull-right"><a class="anchor hidden-xs" href="#super2xsai" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-super2xsai" aria-hidden="true">TOC</a></span></h3>
  51703. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  51704. Interpolate) pixel art scaling algorithm.
  51705. </p>
  51706. <p>Useful for enlarging pixel art images without reducing sharpness.
  51707. </p>
  51708. <a name="swaprect"></a>
  51709. <h3 class="section">39.243 swaprect<span class="pull-right"><a class="anchor hidden-xs" href="#swaprect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swaprect" aria-hidden="true">TOC</a></span></h3>
  51710. <p>Swap two rectangular objects in video.
  51711. </p>
  51712. <p>This filter accepts the following options:
  51713. </p>
  51714. <dl class="table">
  51715. <dt><samp class="option">w</samp></dt>
  51716. <dd><p>Set object width.
  51717. </p>
  51718. </dd>
  51719. <dt><samp class="option">h</samp></dt>
  51720. <dd><p>Set object height.
  51721. </p>
  51722. </dd>
  51723. <dt><samp class="option">x1</samp></dt>
  51724. <dd><p>Set 1st rect x coordinate.
  51725. </p>
  51726. </dd>
  51727. <dt><samp class="option">y1</samp></dt>
  51728. <dd><p>Set 1st rect y coordinate.
  51729. </p>
  51730. </dd>
  51731. <dt><samp class="option">x2</samp></dt>
  51732. <dd><p>Set 2nd rect x coordinate.
  51733. </p>
  51734. </dd>
  51735. <dt><samp class="option">y2</samp></dt>
  51736. <dd><p>Set 2nd rect y coordinate.
  51737. </p>
  51738. <p>All expressions are evaluated once for each frame.
  51739. </p></dd>
  51740. </dl>
  51741. <p>The all options are expressions containing the following constants:
  51742. </p>
  51743. <dl class="table">
  51744. <dt><samp class="option">w</samp></dt>
  51745. <dt><samp class="option">h</samp></dt>
  51746. <dd><p>The input width and height.
  51747. </p>
  51748. </dd>
  51749. <dt><samp class="option">a</samp></dt>
  51750. <dd><p>same as <var class="var">w</var> / <var class="var">h</var>
  51751. </p>
  51752. </dd>
  51753. <dt><samp class="option">sar</samp></dt>
  51754. <dd><p>input sample aspect ratio
  51755. </p>
  51756. </dd>
  51757. <dt><samp class="option">dar</samp></dt>
  51758. <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>
  51759. </p>
  51760. </dd>
  51761. <dt><samp class="option">n</samp></dt>
  51762. <dd><p>The number of the input frame, starting from 0.
  51763. </p>
  51764. </dd>
  51765. <dt><samp class="option">t</samp></dt>
  51766. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  51767. </p>
  51768. </dd>
  51769. <dt><samp class="option">pos</samp></dt>
  51770. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  51771. do not use
  51772. </p></dd>
  51773. </dl>
  51774. <a name="Commands-145"></a>
  51775. <h4 class="subsection">39.243.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-145" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-145" aria-hidden="true">TOC</a></span></h4>
  51776. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  51777. </p>
  51778. <a name="swapuv"></a>
  51779. <h3 class="section">39.244 swapuv<span class="pull-right"><a class="anchor hidden-xs" href="#swapuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swapuv" aria-hidden="true">TOC</a></span></h3>
  51780. <p>Swap U &amp; V plane.
  51781. </p>
  51782. <a name="tblend"></a>
  51783. <h3 class="section">39.245 tblend<span class="pull-right"><a class="anchor hidden-xs" href="#tblend" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tblend" aria-hidden="true">TOC</a></span></h3>
  51784. <p>Blend successive video frames.
  51785. </p>
  51786. <p>See <a class="ref" href="#blend">blend</a>
  51787. </p>
  51788. <a name="telecine"></a>
  51789. <h3 class="section">39.246 telecine<span class="pull-right"><a class="anchor hidden-xs" href="#telecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-telecine" aria-hidden="true">TOC</a></span></h3>
  51790. <p>Apply telecine process to the video.
  51791. </p>
  51792. <p>This filter accepts the following options:
  51793. </p>
  51794. <dl class="table">
  51795. <dt><samp class="option">first_field</samp></dt>
  51796. <dd><dl class="table">
  51797. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  51798. <dd><p>top field first
  51799. </p></dd>
  51800. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  51801. <dd><p>bottom field first
  51802. The default value is <code class="code">top</code>.
  51803. </p></dd>
  51804. </dl>
  51805. </dd>
  51806. <dt><samp class="option">pattern</samp></dt>
  51807. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  51808. The default value is <code class="code">23</code>.
  51809. </p></dd>
  51810. </dl>
  51811. <div class="example">
  51812. <pre class="example-preformatted">Some typical patterns:
  51813. NTSC output (30i):
  51814. 27.5p: 32222
  51815. 24p: 23 (classic)
  51816. 24p: 2332 (preferred)
  51817. 20p: 33
  51818. 18p: 334
  51819. 16p: 3444
  51820. PAL output (25i):
  51821. 27.5p: 12222
  51822. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  51823. 16.67p: 33
  51824. 16p: 33333334
  51825. </pre></div>
  51826. <a name="thistogram"></a>
  51827. <h3 class="section">39.247 thistogram<span class="pull-right"><a class="anchor hidden-xs" href="#thistogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thistogram" aria-hidden="true">TOC</a></span></h3>
  51828. <p>Compute and draw a color distribution histogram for the input video across time.
  51829. </p>
  51830. <p>Unlike <a class="ref" href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  51831. at certain time, this filter shows also past histograms of number of frames defined
  51832. by <code class="code">width</code> option.
  51833. </p>
  51834. <p>The computed histogram is a representation of the color component
  51835. distribution in an image.
  51836. </p>
  51837. <p>The filter accepts the following options:
  51838. </p>
  51839. <dl class="table">
  51840. <dt><samp class="option">width, w</samp></dt>
  51841. <dd><p>Set width of single color component output. Default value is <code class="code">0</code>.
  51842. Value of <code class="code">0</code> means width will be picked from input video.
  51843. This also set number of passed histograms to keep.
  51844. Allowed range is [0, 8192].
  51845. </p>
  51846. </dd>
  51847. <dt><samp class="option">display_mode, d</samp></dt>
  51848. <dd><p>Set display mode.
  51849. It accepts the following values:
  51850. </p><dl class="table">
  51851. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  51852. <dd><p>Per color component graphs are placed below each other.
  51853. </p>
  51854. </dd>
  51855. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  51856. <dd><p>Per color component graphs are placed side by side.
  51857. </p>
  51858. </dd>
  51859. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  51860. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  51861. that the graphs representing color components are superimposed directly
  51862. over one another.
  51863. </p></dd>
  51864. </dl>
  51865. <p>Default is <code class="code">stack</code>.
  51866. </p>
  51867. </dd>
  51868. <dt><samp class="option">levels_mode, m</samp></dt>
  51869. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  51870. Default is <code class="code">linear</code>.
  51871. </p>
  51872. </dd>
  51873. <dt><samp class="option">components, c</samp></dt>
  51874. <dd><p>Set what color components to display.
  51875. Default is <code class="code">7</code>.
  51876. </p>
  51877. </dd>
  51878. <dt><samp class="option">bgopacity, b</samp></dt>
  51879. <dd><p>Set background opacity. Default is <code class="code">0.9</code>.
  51880. </p>
  51881. </dd>
  51882. <dt><samp class="option">envelope, e</samp></dt>
  51883. <dd><p>Show envelope. Default is disabled.
  51884. </p>
  51885. </dd>
  51886. <dt><samp class="option">ecolor, ec</samp></dt>
  51887. <dd><p>Set envelope color. Default is <code class="code">gold</code>.
  51888. </p>
  51889. </dd>
  51890. <dt><samp class="option">slide</samp></dt>
  51891. <dd><p>Set slide mode.
  51892. </p>
  51893. <p>Available values for slide is:
  51894. </p><dl class="table">
  51895. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  51896. <dd><p>Draw new frame when right border is reached.
  51897. </p>
  51898. </dd>
  51899. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  51900. <dd><p>Replace old columns with new ones.
  51901. </p>
  51902. </dd>
  51903. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  51904. <dd><p>Scroll from right to left.
  51905. </p>
  51906. </dd>
  51907. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  51908. <dd><p>Scroll from left to right.
  51909. </p>
  51910. </dd>
  51911. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  51912. <dd><p>Draw single picture.
  51913. </p></dd>
  51914. </dl>
  51915. <p>Default is <code class="code">replace</code>.
  51916. </p></dd>
  51917. </dl>
  51918. <a name="threshold"></a>
  51919. <h3 class="section">39.248 threshold<span class="pull-right"><a class="anchor hidden-xs" href="#threshold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-threshold" aria-hidden="true">TOC</a></span></h3>
  51920. <p>Apply threshold effect to video stream.
  51921. </p>
  51922. <p>This filter needs four video streams to perform thresholding.
  51923. First stream is stream we are filtering.
  51924. Second stream is holding threshold values, third stream is holding min values,
  51925. and last, fourth stream is holding max values.
  51926. </p>
  51927. <p>The filter accepts the following option:
  51928. </p>
  51929. <dl class="table">
  51930. <dt><samp class="option">planes</samp></dt>
  51931. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  51932. By default value 0xf, all planes will be processed.
  51933. </p></dd>
  51934. </dl>
  51935. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  51936. of pixel component from 2nd threshold stream, third stream value will picked,
  51937. otherwise fourth stream pixel component value will be picked.
  51938. </p>
  51939. <p>Using color source filter one can perform various types of thresholding:
  51940. </p>
  51941. <a name="Commands-146"></a>
  51942. <h4 class="subsection">39.248.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-146" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-146" aria-hidden="true">TOC</a></span></h4>
  51943. <p>This filter supports the all options as <a class="ref" href="#commands">commands</a>.
  51944. </p>
  51945. <a name="Examples-171"></a>
  51946. <h4 class="subsection">39.248.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-171" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-171" aria-hidden="true">TOC</a></span></h4>
  51947. <ul class="itemize mark-bullet">
  51948. <li>Binary threshold, using gray color as threshold:
  51949. <div class="example">
  51950. <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
  51951. </pre></div>
  51952. </li><li>Inverted binary threshold, using gray color as threshold:
  51953. <div class="example">
  51954. <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
  51955. </pre></div>
  51956. </li><li>Truncate binary threshold, using gray color as threshold:
  51957. <div class="example">
  51958. <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
  51959. </pre></div>
  51960. </li><li>Threshold to zero, using gray color as threshold:
  51961. <div class="example">
  51962. <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
  51963. </pre></div>
  51964. </li><li>Inverted threshold to zero, using gray color as threshold:
  51965. <div class="example">
  51966. <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
  51967. </pre></div>
  51968. </li></ul>
  51969. <a name="thumbnail"></a>
  51970. <h3 class="section">39.249 thumbnail<span class="pull-right"><a class="anchor hidden-xs" href="#thumbnail" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thumbnail" aria-hidden="true">TOC</a></span></h3>
  51971. <p>Select the most representative frame in a given sequence of consecutive frames.
  51972. </p>
  51973. <p>The filter accepts the following options:
  51974. </p>
  51975. <dl class="table">
  51976. <dt><samp class="option">n</samp></dt>
  51977. <dd><p>Set the frames batch size to analyze; in a set of <var class="var">n</var> frames, the filter
  51978. will pick one of them, and then handle the next batch of <var class="var">n</var> frames until
  51979. the end. Default is <code class="code">100</code>.
  51980. </p>
  51981. </dd>
  51982. <dt><samp class="option">log</samp></dt>
  51983. <dd><p>Set the log level to display picked frame stats.
  51984. Default is <code class="code">info</code>.
  51985. </p></dd>
  51986. </dl>
  51987. <p>Since the filter keeps track of the whole frames sequence, a bigger <var class="var">n</var>
  51988. value will result in a higher memory usage, so a high value is not recommended.
  51989. </p>
  51990. <a name="Examples-172"></a>
  51991. <h4 class="subsection">39.249.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-172" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-172" aria-hidden="true">TOC</a></span></h4>
  51992. <ul class="itemize mark-bullet">
  51993. <li>Extract one picture each 50 frames:
  51994. <div class="example">
  51995. <pre class="example-preformatted">thumbnail=50
  51996. </pre></div>
  51997. </li><li>Complete example of a thumbnail creation with <code class="command">ffmpeg</code>:
  51998. <div class="example">
  51999. <pre class="example-preformatted">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  52000. </pre></div>
  52001. </li></ul>
  52002. <a class="anchor" id="tile"></a><a name="tile-1"></a>
  52003. <h3 class="section">39.250 tile<span class="pull-right"><a class="anchor hidden-xs" href="#tile-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tile-1" aria-hidden="true">TOC</a></span></h3>
  52004. <p>Tile several successive frames together.
  52005. </p>
  52006. <p>The <a class="ref" href="#untile">untile</a> filter can do the reverse.
  52007. </p>
  52008. <p>The filter accepts the following options:
  52009. </p>
  52010. <dl class="table">
  52011. <dt><samp class="option">layout</samp></dt>
  52012. <dd><p>Set the grid size in the form <code class="code">COLUMNSxROWS</code>. Range is up to UINT_MAX cells.
  52013. Default is <code class="code">6x5</code>.
  52014. </p>
  52015. </dd>
  52016. <dt><samp class="option">nb_frames</samp></dt>
  52017. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  52018. 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
  52019. the area will be used.
  52020. </p>
  52021. </dd>
  52022. <dt><samp class="option">margin</samp></dt>
  52023. <dd><p>Set the outer border margin in pixels. Range is 0 to 1024. Default is <code class="code">0</code>.
  52024. </p>
  52025. </dd>
  52026. <dt><samp class="option">padding</samp></dt>
  52027. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  52028. more advanced padding options (such as having different values for the edges),
  52029. refer to the pad video filter. Range is 0 to 1024. Default is <code class="code">0</code>.
  52030. </p>
  52031. </dd>
  52032. <dt><samp class="option">color</samp></dt>
  52033. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  52034. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  52035. The default value of <var class="var">color</var> is &quot;black&quot;.
  52036. </p>
  52037. </dd>
  52038. <dt><samp class="option">overlap</samp></dt>
  52039. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  52040. 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>.
  52041. </p>
  52042. </dd>
  52043. <dt><samp class="option">init_padding</samp></dt>
  52044. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  52045. This controls how soon will one get first output frame.
  52046. 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>.
  52047. </p></dd>
  52048. </dl>
  52049. <a name="Examples-173"></a>
  52050. <h4 class="subsection">39.250.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-173" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-173" aria-hidden="true">TOC</a></span></h4>
  52051. <ul class="itemize mark-bullet">
  52052. <li>Produce 8x8 PNG tiles of all keyframes (<samp class="option">-skip_frame nokey</samp>) in a movie:
  52053. <div class="example">
  52054. <pre class="example-preformatted">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  52055. </pre></div>
  52056. <p>The <samp class="option">-vsync 0</samp> is necessary to prevent <code class="command">ffmpeg</code> from
  52057. duplicating each output frame to accommodate the originally detected frame
  52058. rate.
  52059. </p>
  52060. </li><li>Display <code class="code">5</code> pictures in an area of <code class="code">3x2</code> frames,
  52061. with <code class="code">7</code> pixels between them, and <code class="code">2</code> pixels of initial margin, using
  52062. mixed flat and named options:
  52063. <div class="example">
  52064. <pre class="example-preformatted">tile=3x2:nb_frames=5:padding=7:margin=2
  52065. </pre></div>
  52066. </li></ul>
  52067. <a name="tiltandshift"></a>
  52068. <h3 class="section">39.251 tiltandshift<span class="pull-right"><a class="anchor hidden-xs" href="#tiltandshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tiltandshift" aria-hidden="true">TOC</a></span></h3>
  52069. <p>Apply tilt-and-shift effect.
  52070. </p>
  52071. <p>What happens when you invert time and space?
  52072. </p>
  52073. <p>Normally a video is composed of several frames that represent a different
  52074. instant of time and shows a scene that evolves in the space captured by the
  52075. frame. This filter is the antipode of that concept, taking inspiration from
  52076. tilt and shift photography.
  52077. </p>
  52078. <p>A filtered frame contains the whole timeline of events composing the sequence,
  52079. and this is obtained by placing a slice of pixels from each frame into a single
  52080. one. However, since there are no infinite-width frames, this is done up the
  52081. width of the input frame, and a video is recomposed by shifting away one
  52082. column for each subsequent frame. In order to map space to time, the filter
  52083. tilts each input frame as well, so that motion is preserved. This is accomplished
  52084. by progressively selecting a different column from each input frame.
  52085. </p>
  52086. <p>The end result is a sort of inverted parallax, so that far away objects move
  52087. much faster that the ones in the front. The ideal conditions for this video
  52088. effect are when there is either very little motion and the background is static,
  52089. or when there is a lot of motion and a very wide depth of field (e.g. wide
  52090. panorama, while moving on a train).
  52091. </p>
  52092. <p>The filter accepts the following parameters:
  52093. </p>
  52094. <dl class="table">
  52095. <dt><samp class="option">tilt</samp></dt>
  52096. <dd><p>Tilt video while shifting (default). When unset, video will be sliding a
  52097. static image, composed of the first column of each frame.
  52098. </p>
  52099. </dd>
  52100. <dt><samp class="option">start</samp></dt>
  52101. <dd><p>What to do at the start of filtering (see below).
  52102. </p>
  52103. </dd>
  52104. <dt><samp class="option">end</samp></dt>
  52105. <dd><p>What to do at the end of filtering (see below).
  52106. </p>
  52107. </dd>
  52108. <dt><samp class="option">hold</samp></dt>
  52109. <dd><p>How many columns should pass through before start of filtering.
  52110. </p>
  52111. </dd>
  52112. <dt><samp class="option">pad</samp></dt>
  52113. <dd><p>How many columns should be inserted before end of filtering.
  52114. </p>
  52115. </dd>
  52116. </dl>
  52117. <p>Normally the filter shifts and tilts from the very first frame, and stops when
  52118. the last one is received. However, before filtering starts, normal video may
  52119. be preserved, so that the effect is slowly shifted in its place. Similarly,
  52120. the last video frame may be reconstructed at the end. Alternatively it is
  52121. possible to just start and end with black.
  52122. </p>
  52123. <dl class="table">
  52124. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  52125. <dd><p>Filtering starts immediately and ends when the last frame is received.
  52126. </p>
  52127. </dd>
  52128. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  52129. <dd><p>The first frames or the very last frame are kept intact during processing.
  52130. </p>
  52131. </dd>
  52132. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  52133. <dd><p>Black is padded at the beginning or at the end of filtering.
  52134. </p>
  52135. </dd>
  52136. </dl>
  52137. <a name="tinterlace"></a>
  52138. <h3 class="section">39.252 tinterlace<span class="pull-right"><a class="anchor hidden-xs" href="#tinterlace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tinterlace" aria-hidden="true">TOC</a></span></h3>
  52139. <p>Perform various types of temporal field interlacing.
  52140. </p>
  52141. <p>Frames are counted starting from 1, so the first input frame is
  52142. considered odd.
  52143. </p>
  52144. <p>The filter accepts the following options:
  52145. </p>
  52146. <dl class="table">
  52147. <dt><samp class="option">mode</samp></dt>
  52148. <dd><p>Specify the mode of the interlacing. This option can also be specified
  52149. as a value alone. See below for a list of values for this option.
  52150. </p>
  52151. <p>Available values are:
  52152. </p>
  52153. <dl class="table">
  52154. <dt>&lsquo;<samp class="samp">merge, 0</samp>&rsquo;</dt>
  52155. <dd><p>Move odd frames into the upper field, even into the lower field,
  52156. generating a double height frame at half frame rate.
  52157. </p><div class="example">
  52158. <pre class="example-preformatted"> ------&gt; time
  52159. Input:
  52160. Frame 1 Frame 2 Frame 3 Frame 4
  52161. 11111 22222 33333 44444
  52162. 11111 22222 33333 44444
  52163. 11111 22222 33333 44444
  52164. 11111 22222 33333 44444
  52165. Output:
  52166. 11111 33333
  52167. 22222 44444
  52168. 11111 33333
  52169. 22222 44444
  52170. 11111 33333
  52171. 22222 44444
  52172. 11111 33333
  52173. 22222 44444
  52174. </pre></div>
  52175. </dd>
  52176. <dt>&lsquo;<samp class="samp">drop_even, 1</samp>&rsquo;</dt>
  52177. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  52178. unchanged height at half frame rate.
  52179. </p>
  52180. <div class="example">
  52181. <pre class="example-preformatted"> ------&gt; time
  52182. Input:
  52183. Frame 1 Frame 2 Frame 3 Frame 4
  52184. 11111 22222 33333 44444
  52185. 11111 22222 33333 44444
  52186. 11111 22222 33333 44444
  52187. 11111 22222 33333 44444
  52188. Output:
  52189. 11111 33333
  52190. 11111 33333
  52191. 11111 33333
  52192. 11111 33333
  52193. </pre></div>
  52194. </dd>
  52195. <dt>&lsquo;<samp class="samp">drop_odd, 2</samp>&rsquo;</dt>
  52196. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  52197. unchanged height at half frame rate.
  52198. </p>
  52199. <div class="example">
  52200. <pre class="example-preformatted"> ------&gt; time
  52201. Input:
  52202. Frame 1 Frame 2 Frame 3 Frame 4
  52203. 11111 22222 33333 44444
  52204. 11111 22222 33333 44444
  52205. 11111 22222 33333 44444
  52206. 11111 22222 33333 44444
  52207. Output:
  52208. 22222 44444
  52209. 22222 44444
  52210. 22222 44444
  52211. 22222 44444
  52212. </pre></div>
  52213. </dd>
  52214. <dt>&lsquo;<samp class="samp">pad, 3</samp>&rsquo;</dt>
  52215. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  52216. generating a frame with double height at the same input frame rate.
  52217. </p>
  52218. <div class="example">
  52219. <pre class="example-preformatted"> ------&gt; time
  52220. Input:
  52221. Frame 1 Frame 2 Frame 3 Frame 4
  52222. 11111 22222 33333 44444
  52223. 11111 22222 33333 44444
  52224. 11111 22222 33333 44444
  52225. 11111 22222 33333 44444
  52226. Output:
  52227. 11111 ..... 33333 .....
  52228. ..... 22222 ..... 44444
  52229. 11111 ..... 33333 .....
  52230. ..... 22222 ..... 44444
  52231. 11111 ..... 33333 .....
  52232. ..... 22222 ..... 44444
  52233. 11111 ..... 33333 .....
  52234. ..... 22222 ..... 44444
  52235. </pre></div>
  52236. </dd>
  52237. <dt>&lsquo;<samp class="samp">interleave_top, 4</samp>&rsquo;</dt>
  52238. <dd><p>Interleave the upper field from odd frames with the lower field from
  52239. even frames, generating a frame with unchanged height at half frame rate.
  52240. </p>
  52241. <div class="example">
  52242. <pre class="example-preformatted"> ------&gt; time
  52243. Input:
  52244. Frame 1 Frame 2 Frame 3 Frame 4
  52245. 11111&lt;- 22222 33333&lt;- 44444
  52246. 11111 22222&lt;- 33333 44444&lt;-
  52247. 11111&lt;- 22222 33333&lt;- 44444
  52248. 11111 22222&lt;- 33333 44444&lt;-
  52249. Output:
  52250. 11111 33333
  52251. 22222 44444
  52252. 11111 33333
  52253. 22222 44444
  52254. </pre></div>
  52255. </dd>
  52256. <dt>&lsquo;<samp class="samp">interleave_bottom, 5</samp>&rsquo;</dt>
  52257. <dd><p>Interleave the lower field from odd frames with the upper field from
  52258. even frames, generating a frame with unchanged height at half frame rate.
  52259. </p>
  52260. <div class="example">
  52261. <pre class="example-preformatted"> ------&gt; time
  52262. Input:
  52263. Frame 1 Frame 2 Frame 3 Frame 4
  52264. 11111 22222&lt;- 33333 44444&lt;-
  52265. 11111&lt;- 22222 33333&lt;- 44444
  52266. 11111 22222&lt;- 33333 44444&lt;-
  52267. 11111&lt;- 22222 33333&lt;- 44444
  52268. Output:
  52269. 22222 44444
  52270. 11111 33333
  52271. 22222 44444
  52272. 11111 33333
  52273. </pre></div>
  52274. </dd>
  52275. <dt>&lsquo;<samp class="samp">interlacex2, 6</samp>&rsquo;</dt>
  52276. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  52277. containing the second temporal field from the previous input frame and
  52278. the first temporal field from the next input frame. This mode relies on
  52279. the top_field_first flag. Useful for interlaced video displays with no
  52280. field synchronisation.
  52281. </p>
  52282. <div class="example">
  52283. <pre class="example-preformatted"> ------&gt; time
  52284. Input:
  52285. Frame 1 Frame 2 Frame 3 Frame 4
  52286. 11111 22222 33333 44444
  52287. 11111 22222 33333 44444
  52288. 11111 22222 33333 44444
  52289. 11111 22222 33333 44444
  52290. Output:
  52291. 11111 22222 22222 33333 33333 44444 44444
  52292. 11111 11111 22222 22222 33333 33333 44444
  52293. 11111 22222 22222 33333 33333 44444 44444
  52294. 11111 11111 22222 22222 33333 33333 44444
  52295. </pre></div>
  52296. </dd>
  52297. <dt>&lsquo;<samp class="samp">mergex2, 7</samp>&rsquo;</dt>
  52298. <dd><p>Move odd frames into the upper field, even into the lower field,
  52299. generating a double height frame at same frame rate.
  52300. </p>
  52301. <div class="example">
  52302. <pre class="example-preformatted"> ------&gt; time
  52303. Input:
  52304. Frame 1 Frame 2 Frame 3 Frame 4
  52305. 11111 22222 33333 44444
  52306. 11111 22222 33333 44444
  52307. 11111 22222 33333 44444
  52308. 11111 22222 33333 44444
  52309. Output:
  52310. 11111 33333 33333 55555
  52311. 22222 22222 44444 44444
  52312. 11111 33333 33333 55555
  52313. 22222 22222 44444 44444
  52314. 11111 33333 33333 55555
  52315. 22222 22222 44444 44444
  52316. 11111 33333 33333 55555
  52317. 22222 22222 44444 44444
  52318. </pre></div>
  52319. </dd>
  52320. </dl>
  52321. <p>Numeric values are deprecated but are accepted for backward
  52322. compatibility reasons.
  52323. </p>
  52324. <p>Default mode is <code class="code">merge</code>.
  52325. </p>
  52326. </dd>
  52327. <dt><samp class="option">flags</samp></dt>
  52328. <dd><p>Specify flags influencing the filter process.
  52329. </p>
  52330. <p>Available value for <var class="var">flags</var> is:
  52331. </p>
  52332. <dl class="table">
  52333. <dt><samp class="option">low_pass_filter, vlpf</samp></dt>
  52334. <dd><p>Enable linear vertical low-pass filtering in the filter.
  52335. Vertical low-pass filtering is required when creating an interlaced
  52336. destination from a progressive source which contains high-frequency
  52337. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  52338. patterning.
  52339. </p>
  52340. </dd>
  52341. <dt><samp class="option">complex_filter, cvlpf</samp></dt>
  52342. <dd><p>Enable complex vertical low-pass filtering.
  52343. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  52344. patterning but better retain detail and subjective sharpness impression.
  52345. </p>
  52346. </dd>
  52347. <dt><samp class="option">bypass_il</samp></dt>
  52348. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  52349. </p></dd>
  52350. </dl>
  52351. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  52352. enabled for <samp class="option">mode</samp> <var class="var">interleave_top</var> and <var class="var">interleave_bottom</var>.
  52353. </p>
  52354. </dd>
  52355. </dl>
  52356. <a name="tmedian"></a>
  52357. <h3 class="section">39.253 tmedian<span class="pull-right"><a class="anchor hidden-xs" href="#tmedian" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmedian" aria-hidden="true">TOC</a></span></h3>
  52358. <p>Pick median pixels from several successive input video frames.
  52359. </p>
  52360. <p>The filter accepts the following options:
  52361. </p>
  52362. <dl class="table">
  52363. <dt><samp class="option">radius</samp></dt>
  52364. <dd><p>Set radius of median filter.
  52365. Default is 1. Allowed range is from 1 to 127.
  52366. </p>
  52367. </dd>
  52368. <dt><samp class="option">planes</samp></dt>
  52369. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  52370. </p>
  52371. </dd>
  52372. <dt><samp class="option">percentile</samp></dt>
  52373. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  52374. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  52375. minimum values, and <code class="code">1</code> maximum values.
  52376. </p></dd>
  52377. </dl>
  52378. <a name="Commands-147"></a>
  52379. <h4 class="subsection">39.253.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-147" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-147" aria-hidden="true">TOC</a></span></h4>
  52380. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">radius</code>.
  52381. </p>
  52382. <a name="tmidequalizer"></a>
  52383. <h3 class="section">39.254 tmidequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#tmidequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmidequalizer" aria-hidden="true">TOC</a></span></h3>
  52384. <p>Apply Temporal Midway Video Equalization effect.
  52385. </p>
  52386. <p>Midway Video Equalization adjusts a sequence of video frames to have the same
  52387. histograms, while maintaining their dynamics as much as possible. It&rsquo;s
  52388. useful for e.g. matching exposures from a video frames sequence.
  52389. </p>
  52390. <p>This filter accepts the following option:
  52391. </p>
  52392. <dl class="table">
  52393. <dt><samp class="option">radius</samp></dt>
  52394. <dd><p>Set filtering radius. Default is <code class="code">5</code>. Allowed range is from 1 to 127.
  52395. </p>
  52396. </dd>
  52397. <dt><samp class="option">sigma</samp></dt>
  52398. <dd><p>Set filtering sigma. Default is <code class="code">0.5</code>. This controls strength of filtering.
  52399. Setting this option to 0 effectively does nothing.
  52400. </p>
  52401. </dd>
  52402. <dt><samp class="option">planes</samp></dt>
  52403. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  52404. </p></dd>
  52405. </dl>
  52406. <a name="tmix"></a>
  52407. <h3 class="section">39.255 tmix<span class="pull-right"><a class="anchor hidden-xs" href="#tmix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmix" aria-hidden="true">TOC</a></span></h3>
  52408. <p>Mix successive video frames.
  52409. </p>
  52410. <p>A description of the accepted options follows.
  52411. </p>
  52412. <dl class="table">
  52413. <dt><samp class="option">frames</samp></dt>
  52414. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  52415. </p>
  52416. </dd>
  52417. <dt><samp class="option">weights</samp></dt>
  52418. <dd><p>Specify weight of each input video frame.
  52419. Each weight is separated by space. If number of weights is smaller than
  52420. number of <var class="var">frames</var> last specified weight will be used for all remaining
  52421. unset weights.
  52422. </p>
  52423. </dd>
  52424. <dt><samp class="option">scale</samp></dt>
  52425. <dd><p>Specify scale, if it is set it will be multiplied with sum
  52426. of each weight multiplied with pixel values to give final destination
  52427. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  52428. </p>
  52429. </dd>
  52430. <dt><samp class="option">planes</samp></dt>
  52431. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  52432. </p></dd>
  52433. </dl>
  52434. <a name="Examples-174"></a>
  52435. <h4 class="subsection">39.255.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-174" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-174" aria-hidden="true">TOC</a></span></h4>
  52436. <ul class="itemize mark-bullet">
  52437. <li>Average 7 successive frames:
  52438. <div class="example">
  52439. <pre class="example-preformatted">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  52440. </pre></div>
  52441. </li><li>Apply simple temporal convolution:
  52442. <div class="example">
  52443. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  52444. </pre></div>
  52445. </li><li>Similar as above but only showing temporal differences:
  52446. <div class="example">
  52447. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  52448. </pre></div>
  52449. </li></ul>
  52450. <a name="Commands-148"></a>
  52451. <h4 class="subsection">39.255.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-148" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-148" aria-hidden="true">TOC</a></span></h4>
  52452. <p>This filter supports the following commands:
  52453. </p><dl class="table">
  52454. <dt><samp class="option">weights</samp></dt>
  52455. <dt><samp class="option">scale</samp></dt>
  52456. <dt><samp class="option">planes</samp></dt>
  52457. <dd><p>Syntax is same as option with same name.
  52458. </p></dd>
  52459. </dl>
  52460. <a class="anchor" id="tonemap"></a><a name="tonemap-1"></a>
  52461. <h3 class="section">39.256 tonemap<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap-1" aria-hidden="true">TOC</a></span></h3>
  52462. <p>Tone map colors from different dynamic ranges.
  52463. </p>
  52464. <p>This filter expects data in single precision floating point, as it needs to
  52465. operate on (and can output) out-of-range values. Another filter, such as
  52466. <a class="ref" href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  52467. </p>
  52468. <p>The tonemapping algorithms implemented only work on linear light, so input
  52469. data should be linearized beforehand (and possibly correctly tagged).
  52470. </p>
  52471. <div class="example">
  52472. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  52473. </pre></div>
  52474. <a name="Options-123"></a>
  52475. <h4 class="subsection">39.256.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-123" aria-hidden="true">TOC</a></span></h4>
  52476. <p>The filter accepts the following options.
  52477. </p>
  52478. <dl class="table">
  52479. <dt><samp class="option">tonemap</samp></dt>
  52480. <dd><p>Set the tone map algorithm to use.
  52481. </p>
  52482. <p>Possible values are:
  52483. </p><dl class="table">
  52484. <dt><var class="var">none</var></dt>
  52485. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  52486. </p>
  52487. </dd>
  52488. <dt><var class="var">clip</var></dt>
  52489. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  52490. in-range values, while distorting out-of-range values.
  52491. </p>
  52492. </dd>
  52493. <dt><var class="var">linear</var></dt>
  52494. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  52495. </p>
  52496. </dd>
  52497. <dt><var class="var">gamma</var></dt>
  52498. <dd><p>Fit a logarithmic transfer between the tone curves.
  52499. </p>
  52500. </dd>
  52501. <dt><var class="var">reinhard</var></dt>
  52502. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  52503. contrast, which results in flattening details and degrading color accuracy.
  52504. </p>
  52505. </dd>
  52506. <dt><var class="var">hable</var></dt>
  52507. <dd><p>Preserve both dark and bright details better than <var class="var">reinhard</var>, at the cost
  52508. of slightly darkening everything. Use it when detail preservation is more
  52509. important than color and brightness accuracy.
  52510. </p>
  52511. </dd>
  52512. <dt><var class="var">mobius</var></dt>
  52513. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  52514. in-range material as much as possible. Use it when color accuracy is more
  52515. important than detail preservation.
  52516. </p></dd>
  52517. </dl>
  52518. <p>Default is none.
  52519. </p>
  52520. </dd>
  52521. <dt><samp class="option">param</samp></dt>
  52522. <dd><p>Tune the tone mapping algorithm.
  52523. </p>
  52524. <p>This affects the following algorithms:
  52525. </p><dl class="table">
  52526. <dt><var class="var">none</var></dt>
  52527. <dd><p>Ignored.
  52528. </p>
  52529. </dd>
  52530. <dt><var class="var">linear</var></dt>
  52531. <dd><p>Specifies the scale factor to use while stretching.
  52532. Default to 1.0.
  52533. </p>
  52534. </dd>
  52535. <dt><var class="var">gamma</var></dt>
  52536. <dd><p>Specifies the exponent of the function.
  52537. Default to 1.8.
  52538. </p>
  52539. </dd>
  52540. <dt><var class="var">clip</var></dt>
  52541. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  52542. Default to 1.0.
  52543. </p>
  52544. </dd>
  52545. <dt><var class="var">reinhard</var></dt>
  52546. <dd><p>Specify the local contrast coefficient at the display peak.
  52547. Default to 0.5, which means that in-gamut values will be about half as bright
  52548. as when clipping.
  52549. </p>
  52550. </dd>
  52551. <dt><var class="var">hable</var></dt>
  52552. <dd><p>Ignored.
  52553. </p>
  52554. </dd>
  52555. <dt><var class="var">mobius</var></dt>
  52556. <dd><p>Specify the transition point from linear to mobius transform. Every value
  52557. below this point is guaranteed to be mapped 1:1. The higher the value, the
  52558. more accurate the result will be, at the cost of losing bright details.
  52559. Default to 0.3, which due to the steep initial slope still preserves in-range
  52560. colors fairly accurately.
  52561. </p></dd>
  52562. </dl>
  52563. </dd>
  52564. <dt><samp class="option">desat</samp></dt>
  52565. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  52566. higher the parameter, the more color information will be preserved. This
  52567. setting helps prevent unnaturally blown-out colors for super-highlights, by
  52568. (smoothly) turning into white instead. This makes images feel more natural,
  52569. at the cost of reducing information about out-of-range colors.
  52570. </p>
  52571. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  52572. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  52573. </p>
  52574. <p>This option works only if the input frame has a supported color tag.
  52575. </p>
  52576. </dd>
  52577. <dt><samp class="option">peak</samp></dt>
  52578. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  52579. embedded peak information in display metadata is not reliable or when tone
  52580. mapping from a lower range to a higher range.
  52581. </p></dd>
  52582. </dl>
  52583. <a name="tpad"></a>
  52584. <h3 class="section">39.257 tpad<span class="pull-right"><a class="anchor hidden-xs" href="#tpad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tpad" aria-hidden="true">TOC</a></span></h3>
  52585. <p>Temporarily pad video frames.
  52586. </p>
  52587. <p>The filter accepts the following options:
  52588. </p>
  52589. <dl class="table">
  52590. <dt><samp class="option">start</samp></dt>
  52591. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  52592. </p>
  52593. </dd>
  52594. <dt><samp class="option">stop</samp></dt>
  52595. <dd><p>Specify number of padding frames after input video stream.
  52596. Set to -1 to pad indefinitely. Default is 0.
  52597. </p>
  52598. </dd>
  52599. <dt><samp class="option">start_mode</samp></dt>
  52600. <dd><p>Set kind of frames added to beginning of stream.
  52601. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  52602. With <var class="var">add</var> frames of solid-color are added.
  52603. With <var class="var">clone</var> frames are clones of first frame.
  52604. Default is <var class="var">add</var>.
  52605. </p>
  52606. </dd>
  52607. <dt><samp class="option">stop_mode</samp></dt>
  52608. <dd><p>Set kind of frames added to end of stream.
  52609. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  52610. With <var class="var">add</var> frames of solid-color are added.
  52611. With <var class="var">clone</var> frames are clones of last frame.
  52612. Default is <var class="var">add</var>.
  52613. </p>
  52614. </dd>
  52615. <dt><samp class="option">start_duration, stop_duration</samp></dt>
  52616. <dd><p>Specify the duration of the start/stop delay. See
  52617. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  52618. for the accepted syntax.
  52619. These options override <var class="var">start</var> and <var class="var">stop</var>. Default is 0.
  52620. </p>
  52621. </dd>
  52622. <dt><samp class="option">color</samp></dt>
  52623. <dd><p>Specify the color of the padded area. For the syntax of this option,
  52624. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  52625. manual</a>.
  52626. </p>
  52627. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  52628. </p></dd>
  52629. </dl>
  52630. <a class="anchor" id="transpose"></a><a name="transpose-1"></a>
  52631. <h3 class="section">39.258 transpose<span class="pull-right"><a class="anchor hidden-xs" href="#transpose-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose-1" aria-hidden="true">TOC</a></span></h3>
  52632. <p>Transpose rows with columns in the input video and optionally flip it.
  52633. </p>
  52634. <p>It accepts the following parameters:
  52635. </p>
  52636. <dl class="table">
  52637. <dt><samp class="option">dir</samp></dt>
  52638. <dd><p>Specify the transposition direction.
  52639. </p>
  52640. <p>Can assume the following values:
  52641. </p><dl class="table">
  52642. <dt>&lsquo;<samp class="samp">0, 4, cclock_flip</samp>&rsquo;</dt>
  52643. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  52644. </p><div class="example">
  52645. <pre class="example-preformatted">L.R L.l
  52646. . . -&gt; . .
  52647. l.r R.r
  52648. </pre></div>
  52649. </dd>
  52650. <dt>&lsquo;<samp class="samp">1, 5, clock</samp>&rsquo;</dt>
  52651. <dd><p>Rotate by 90 degrees clockwise, that is:
  52652. </p><div class="example">
  52653. <pre class="example-preformatted">L.R l.L
  52654. . . -&gt; . .
  52655. l.r r.R
  52656. </pre></div>
  52657. </dd>
  52658. <dt>&lsquo;<samp class="samp">2, 6, cclock</samp>&rsquo;</dt>
  52659. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  52660. </p><div class="example">
  52661. <pre class="example-preformatted">L.R R.r
  52662. . . -&gt; . .
  52663. l.r L.l
  52664. </pre></div>
  52665. </dd>
  52666. <dt>&lsquo;<samp class="samp">3, 7, clock_flip</samp>&rsquo;</dt>
  52667. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  52668. </p><div class="example">
  52669. <pre class="example-preformatted">L.R r.R
  52670. . . -&gt; . .
  52671. l.r l.L
  52672. </pre></div>
  52673. </dd>
  52674. </dl>
  52675. <p>For values between 4-7, the transposition is only done if the input
  52676. video geometry is portrait and not landscape. These values are
  52677. deprecated, the <code class="code">passthrough</code> option should be used instead.
  52678. </p>
  52679. <p>Numerical values are deprecated, and should be dropped in favor of
  52680. symbolic constants.
  52681. </p>
  52682. </dd>
  52683. <dt><samp class="option">passthrough</samp></dt>
  52684. <dd><p>Do not apply the transposition if the input geometry matches the one
  52685. specified by the specified value. It accepts the following values:
  52686. </p><dl class="table">
  52687. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  52688. <dd><p>Always apply transposition.
  52689. </p></dd>
  52690. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  52691. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  52692. </p></dd>
  52693. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  52694. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  52695. </p></dd>
  52696. </dl>
  52697. <p>Default value is <code class="code">none</code>.
  52698. </p></dd>
  52699. </dl>
  52700. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  52701. layout:
  52702. </p><div class="example">
  52703. <pre class="example-preformatted">transpose=dir=1:passthrough=portrait
  52704. </pre></div>
  52705. <p>The command above can also be specified as:
  52706. </p><div class="example">
  52707. <pre class="example-preformatted">transpose=1:portrait
  52708. </pre></div>
  52709. <a name="trim"></a>
  52710. <h3 class="section">39.259 trim<span class="pull-right"><a class="anchor hidden-xs" href="#trim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trim" aria-hidden="true">TOC</a></span></h3>
  52711. <p>Trim the input so that the output contains one continuous subpart of the input.
  52712. </p>
  52713. <p>It accepts the following parameters:
  52714. </p><dl class="table">
  52715. <dt><samp class="option">start</samp></dt>
  52716. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  52717. timestamp <var class="var">start</var> will be the first frame in the output.
  52718. </p>
  52719. </dd>
  52720. <dt><samp class="option">end</samp></dt>
  52721. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  52722. immediately preceding the one with the timestamp <var class="var">end</var> will be the last
  52723. frame in the output.
  52724. </p>
  52725. </dd>
  52726. <dt><samp class="option">start_pts</samp></dt>
  52727. <dd><p>This is the same as <var class="var">start</var>, except this option sets the start timestamp
  52728. in timebase units instead of seconds.
  52729. </p>
  52730. </dd>
  52731. <dt><samp class="option">end_pts</samp></dt>
  52732. <dd><p>This is the same as <var class="var">end</var>, except this option sets the end timestamp
  52733. in timebase units instead of seconds.
  52734. </p>
  52735. </dd>
  52736. <dt><samp class="option">duration</samp></dt>
  52737. <dd><p>The maximum duration of the output in seconds.
  52738. </p>
  52739. </dd>
  52740. <dt><samp class="option">start_frame</samp></dt>
  52741. <dd><p>The number of the first frame that should be passed to the output.
  52742. </p>
  52743. </dd>
  52744. <dt><samp class="option">end_frame</samp></dt>
  52745. <dd><p>The number of the first frame that should be dropped.
  52746. </p></dd>
  52747. </dl>
  52748. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  52749. duration specifications; see
  52750. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  52751. for the accepted syntax.
  52752. </p>
  52753. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  52754. option look at the frame timestamp, while the _frame variants simply count the
  52755. frames that pass through the filter. Also note that this filter does not modify
  52756. the timestamps. If you wish for the output timestamps to start at zero, insert a
  52757. setpts filter after the trim filter.
  52758. </p>
  52759. <p>If multiple start or end options are set, this filter tries to be greedy and
  52760. keep all the frames that match at least one of the specified constraints. To keep
  52761. only the part that matches all the constraints at once, chain multiple trim
  52762. filters.
  52763. </p>
  52764. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  52765. just the end values to keep everything before the specified time.
  52766. </p>
  52767. <p>Examples:
  52768. </p><ul class="itemize mark-bullet">
  52769. <li>Drop everything except the second minute of input:
  52770. <div class="example">
  52771. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=60:120
  52772. </pre></div>
  52773. </li><li>Keep only the first second:
  52774. <div class="example">
  52775. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=duration=1
  52776. </pre></div>
  52777. </li></ul>
  52778. <a name="unpremultiply"></a>
  52779. <h3 class="section">39.260 unpremultiply<span class="pull-right"><a class="anchor hidden-xs" href="#unpremultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unpremultiply" aria-hidden="true">TOC</a></span></h3>
  52780. <p>Apply alpha unpremultiply effect to input video stream using first plane
  52781. of second stream as alpha.
  52782. </p>
  52783. <p>Both streams must have same dimensions and same pixel format.
  52784. </p>
  52785. <p>The filter accepts the following option:
  52786. </p>
  52787. <dl class="table">
  52788. <dt><samp class="option">planes</samp></dt>
  52789. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  52790. By default value 0xf, all planes will be processed.
  52791. </p>
  52792. <p>If the format has 1 or 2 components, then luma is bit 0.
  52793. If the format has 3 or 4 components:
  52794. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  52795. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  52796. If present, the alpha channel is always the last bit.
  52797. </p>
  52798. </dd>
  52799. <dt><samp class="option">inplace</samp></dt>
  52800. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  52801. </p></dd>
  52802. </dl>
  52803. <a class="anchor" id="unsharp"></a><a name="unsharp-1"></a>
  52804. <h3 class="section">39.261 unsharp<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp-1" aria-hidden="true">TOC</a></span></h3>
  52805. <p>Sharpen or blur the input video.
  52806. </p>
  52807. <p>It accepts the following parameters:
  52808. </p>
  52809. <dl class="table">
  52810. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  52811. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  52812. 3 and 23. The default value is 5.
  52813. </p>
  52814. </dd>
  52815. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  52816. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  52817. and 23. The default value is 5.
  52818. </p>
  52819. </dd>
  52820. <dt><samp class="option">luma_amount, la</samp></dt>
  52821. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  52822. values lay between -1.5 and 1.5.
  52823. </p>
  52824. <p>Negative values will blur the input video, while positive values will
  52825. sharpen it, a value of zero will disable the effect.
  52826. </p>
  52827. <p>Default value is 1.0.
  52828. </p>
  52829. </dd>
  52830. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  52831. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  52832. between 3 and 23. The default value is 5.
  52833. </p>
  52834. </dd>
  52835. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  52836. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  52837. between 3 and 23. The default value is 5.
  52838. </p>
  52839. </dd>
  52840. <dt><samp class="option">chroma_amount, ca</samp></dt>
  52841. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  52842. values lay between -1.5 and 1.5.
  52843. </p>
  52844. <p>Negative values will blur the input video, while positive values will
  52845. sharpen it, a value of zero will disable the effect.
  52846. </p>
  52847. <p>Default value is 0.0.
  52848. </p>
  52849. </dd>
  52850. <dt><samp class="option">alpha_msize_x, ax</samp></dt>
  52851. <dd><p>Set the alpha matrix horizontal size. It must be an odd integer
  52852. between 3 and 23. The default value is 5.
  52853. </p>
  52854. </dd>
  52855. <dt><samp class="option">alpha_msize_y, ay</samp></dt>
  52856. <dd><p>Set the alpha matrix vertical size. It must be an odd integer
  52857. between 3 and 23. The default value is 5.
  52858. </p>
  52859. </dd>
  52860. <dt><samp class="option">alpha_amount, aa</samp></dt>
  52861. <dd><p>Set the alpha effect strength. It must be a floating point number, reasonable
  52862. values lay between -1.5 and 1.5.
  52863. </p>
  52864. <p>Negative values will blur the input video, while positive values will
  52865. sharpen it, a value of zero will disable the effect.
  52866. </p>
  52867. <p>Default value is 0.0.
  52868. </p>
  52869. </dd>
  52870. </dl>
  52871. <p>All parameters are optional and default to the equivalent of the
  52872. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  52873. </p>
  52874. <a name="Examples-175"></a>
  52875. <h4 class="subsection">39.261.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-175" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-175" aria-hidden="true">TOC</a></span></h4>
  52876. <ul class="itemize mark-bullet">
  52877. <li>Apply strong luma sharpen effect:
  52878. <div class="example">
  52879. <pre class="example-preformatted">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  52880. </pre></div>
  52881. </li><li>Apply a strong blur of both luma and chroma parameters:
  52882. <div class="example">
  52883. <pre class="example-preformatted">unsharp=7:7:-2:7:7:-2
  52884. </pre></div>
  52885. </li></ul>
  52886. <a class="anchor" id="untile"></a><a name="untile-1"></a>
  52887. <h3 class="section">39.262 untile<span class="pull-right"><a class="anchor hidden-xs" href="#untile-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-untile-1" aria-hidden="true">TOC</a></span></h3>
  52888. <p>Decompose a video made of tiled images into the individual images.
  52889. </p>
  52890. <p>The frame rate of the output video is the frame rate of the input video
  52891. multiplied by the number of tiles.
  52892. </p>
  52893. <p>This filter does the reverse of <a class="ref" href="#tile">tile</a>.
  52894. </p>
  52895. <p>The filter accepts the following options:
  52896. </p>
  52897. <dl class="table">
  52898. <dt><samp class="option">layout</samp></dt>
  52899. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  52900. this option, check the
  52901. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  52902. </p></dd>
  52903. </dl>
  52904. <a name="Examples-176"></a>
  52905. <h4 class="subsection">39.262.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-176" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-176" aria-hidden="true">TOC</a></span></h4>
  52906. <ul class="itemize mark-bullet">
  52907. <li>Produce a 1-second video from a still image file made of 25 frames stacked
  52908. vertically, like an analogic film reel:
  52909. <div class="example">
  52910. <pre class="example-preformatted">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  52911. </pre></div>
  52912. </li></ul>
  52913. <a name="uspp"></a>
  52914. <h3 class="section">39.263 uspp<span class="pull-right"><a class="anchor hidden-xs" href="#uspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-uspp" aria-hidden="true">TOC</a></span></h3>
  52915. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  52916. the image at several (or - in the case of <samp class="option">quality</samp> level <code class="code">8</code> - all)
  52917. shifts and average the results.
  52918. </p>
  52919. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  52920. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  52921. DCT similar to MJPEG.
  52922. </p>
  52923. <p>This filter is not available in ffmpeg versions between 5.0 and 6.0.
  52924. </p>
  52925. <p>The filter accepts the following options:
  52926. </p>
  52927. <dl class="table">
  52928. <dt><samp class="option">quality</samp></dt>
  52929. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  52930. an integer in the range 0-8. If set to <code class="code">0</code>, the filter will have no
  52931. effect. A value of <code class="code">8</code> means the higher quality. For each increment of
  52932. that value the speed drops by a factor of approximately 2. Default value is
  52933. <code class="code">3</code>.
  52934. </p>
  52935. </dd>
  52936. <dt><samp class="option">qp</samp></dt>
  52937. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  52938. from the video stream (if available).
  52939. </p>
  52940. </dd>
  52941. <dt><samp class="option">codec</samp></dt>
  52942. <dd><p>Use specified codec instead of snow.
  52943. </p></dd>
  52944. </dl>
  52945. <a name="v360"></a>
  52946. <h3 class="section">39.264 v360<span class="pull-right"><a class="anchor hidden-xs" href="#v360" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v360" aria-hidden="true">TOC</a></span></h3>
  52947. <p>Convert 360 videos between various formats.
  52948. </p>
  52949. <p>The filter accepts the following options:
  52950. </p>
  52951. <dl class="table">
  52952. <dt><samp class="option">input</samp></dt>
  52953. <dt><samp class="option">output</samp></dt>
  52954. <dd><p>Set format of the input/output video.
  52955. </p>
  52956. <p>Available formats:
  52957. </p>
  52958. <dl class="table">
  52959. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  52960. <dt>&lsquo;<samp class="samp">equirect</samp>&rsquo;</dt>
  52961. <dd><p>Equirectangular projection.
  52962. </p>
  52963. </dd>
  52964. <dt>&lsquo;<samp class="samp">c3x2</samp>&rsquo;</dt>
  52965. <dt>&lsquo;<samp class="samp">c6x1</samp>&rsquo;</dt>
  52966. <dt>&lsquo;<samp class="samp">c1x6</samp>&rsquo;</dt>
  52967. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  52968. </p>
  52969. <p>Format specific options:
  52970. </p>
  52971. <dl class="table">
  52972. <dt><samp class="option">in_pad</samp></dt>
  52973. <dt><samp class="option">out_pad</samp></dt>
  52974. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  52975. </p>
  52976. <p>Example values:
  52977. </p><dl class="table">
  52978. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  52979. <dd><p>No padding.
  52980. </p></dd>
  52981. <dt>&lsquo;<samp class="samp">0.01</samp>&rsquo;</dt>
  52982. <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)
  52983. </p></dd>
  52984. </dl>
  52985. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>.
  52986. Maximum value is <b class="b">&lsquo;<samp class="samp">0.1</samp>&rsquo;</b>.
  52987. </p>
  52988. </dd>
  52989. <dt><samp class="option">fin_pad</samp></dt>
  52990. <dt><samp class="option">fout_pad</samp></dt>
  52991. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  52992. </p>
  52993. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  52994. </p>
  52995. </dd>
  52996. <dt><samp class="option">in_forder</samp></dt>
  52997. <dt><samp class="option">out_forder</samp></dt>
  52998. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  52999. </p>
  53000. <p>Designation of directions:
  53001. </p><dl class="table">
  53002. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  53003. <dd><p>right
  53004. </p></dd>
  53005. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  53006. <dd><p>left
  53007. </p></dd>
  53008. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  53009. <dd><p>up
  53010. </p></dd>
  53011. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  53012. <dd><p>down
  53013. </p></dd>
  53014. <dt>&lsquo;<samp class="samp">f</samp>&rsquo;</dt>
  53015. <dd><p>forward
  53016. </p></dd>
  53017. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  53018. <dd><p>back
  53019. </p></dd>
  53020. </dl>
  53021. <p>Default value is <b class="b">&lsquo;<samp class="samp">rludfb</samp>&rsquo;</b>.
  53022. </p>
  53023. </dd>
  53024. <dt><samp class="option">in_frot</samp></dt>
  53025. <dt><samp class="option">out_frot</samp></dt>
  53026. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  53027. </p>
  53028. <p>Designation of angles:
  53029. </p><dl class="table">
  53030. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  53031. <dd><p>0 degrees clockwise
  53032. </p></dd>
  53033. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  53034. <dd><p>90 degrees clockwise
  53035. </p></dd>
  53036. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  53037. <dd><p>180 degrees clockwise
  53038. </p></dd>
  53039. <dt>&lsquo;<samp class="samp">3</samp>&rsquo;</dt>
  53040. <dd><p>270 degrees clockwise
  53041. </p></dd>
  53042. </dl>
  53043. <p>Default value is <b class="b">&lsquo;<samp class="samp">000000</samp>&rsquo;</b>.
  53044. </p></dd>
  53045. </dl>
  53046. </dd>
  53047. <dt>&lsquo;<samp class="samp">eac</samp>&rsquo;</dt>
  53048. <dd><p>Equi-Angular Cubemap.
  53049. </p>
  53050. </dd>
  53051. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  53052. <dt>&lsquo;<samp class="samp">gnomonic</samp>&rsquo;</dt>
  53053. <dt>&lsquo;<samp class="samp">rectilinear</samp>&rsquo;</dt>
  53054. <dd><p>Regular video.
  53055. </p>
  53056. <p>Format specific options:
  53057. </p><dl class="table">
  53058. <dt><samp class="option">h_fov</samp></dt>
  53059. <dt><samp class="option">v_fov</samp></dt>
  53060. <dt><samp class="option">d_fov</samp></dt>
  53061. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  53062. </p>
  53063. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53064. </p>
  53065. </dd>
  53066. <dt><samp class="option">ih_fov</samp></dt>
  53067. <dt><samp class="option">iv_fov</samp></dt>
  53068. <dt><samp class="option">id_fov</samp></dt>
  53069. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  53070. </p>
  53071. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53072. </p></dd>
  53073. </dl>
  53074. </dd>
  53075. <dt>&lsquo;<samp class="samp">dfisheye</samp>&rsquo;</dt>
  53076. <dd><p>Dual fisheye.
  53077. </p>
  53078. <p>Format specific options:
  53079. </p><dl class="table">
  53080. <dt><samp class="option">h_fov</samp></dt>
  53081. <dt><samp class="option">v_fov</samp></dt>
  53082. <dt><samp class="option">d_fov</samp></dt>
  53083. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  53084. </p>
  53085. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53086. </p>
  53087. </dd>
  53088. <dt><samp class="option">ih_fov</samp></dt>
  53089. <dt><samp class="option">iv_fov</samp></dt>
  53090. <dt><samp class="option">id_fov</samp></dt>
  53091. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  53092. </p>
  53093. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53094. </p></dd>
  53095. </dl>
  53096. </dd>
  53097. <dt>&lsquo;<samp class="samp">barrel</samp>&rsquo;</dt>
  53098. <dt>&lsquo;<samp class="samp">fb</samp>&rsquo;</dt>
  53099. <dt>&lsquo;<samp class="samp">barrelsplit</samp>&rsquo;</dt>
  53100. <dd><p>Facebook&rsquo;s 360 formats.
  53101. </p>
  53102. </dd>
  53103. <dt>&lsquo;<samp class="samp">sg</samp>&rsquo;</dt>
  53104. <dd><p>Stereographic format.
  53105. </p>
  53106. <p>Format specific options:
  53107. </p><dl class="table">
  53108. <dt><samp class="option">h_fov</samp></dt>
  53109. <dt><samp class="option">v_fov</samp></dt>
  53110. <dt><samp class="option">d_fov</samp></dt>
  53111. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  53112. </p>
  53113. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53114. </p>
  53115. </dd>
  53116. <dt><samp class="option">ih_fov</samp></dt>
  53117. <dt><samp class="option">iv_fov</samp></dt>
  53118. <dt><samp class="option">id_fov</samp></dt>
  53119. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  53120. </p>
  53121. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53122. </p></dd>
  53123. </dl>
  53124. </dd>
  53125. <dt>&lsquo;<samp class="samp">mercator</samp>&rsquo;</dt>
  53126. <dd><p>Mercator format.
  53127. </p>
  53128. </dd>
  53129. <dt>&lsquo;<samp class="samp">ball</samp>&rsquo;</dt>
  53130. <dd><p>Ball format, gives significant distortion toward the back.
  53131. </p>
  53132. </dd>
  53133. <dt>&lsquo;<samp class="samp">hammer</samp>&rsquo;</dt>
  53134. <dd><p>Hammer-Aitoff map projection format.
  53135. </p>
  53136. </dd>
  53137. <dt>&lsquo;<samp class="samp">sinusoidal</samp>&rsquo;</dt>
  53138. <dd><p>Sinusoidal map projection format.
  53139. </p>
  53140. </dd>
  53141. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  53142. <dd><p>Fisheye projection.
  53143. </p>
  53144. <p>Format specific options:
  53145. </p><dl class="table">
  53146. <dt><samp class="option">h_fov</samp></dt>
  53147. <dt><samp class="option">v_fov</samp></dt>
  53148. <dt><samp class="option">d_fov</samp></dt>
  53149. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  53150. </p>
  53151. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53152. </p>
  53153. </dd>
  53154. <dt><samp class="option">ih_fov</samp></dt>
  53155. <dt><samp class="option">iv_fov</samp></dt>
  53156. <dt><samp class="option">id_fov</samp></dt>
  53157. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  53158. </p>
  53159. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53160. </p></dd>
  53161. </dl>
  53162. </dd>
  53163. <dt>&lsquo;<samp class="samp">pannini</samp>&rsquo;</dt>
  53164. <dd><p>Pannini projection.
  53165. </p>
  53166. <p>Format specific options:
  53167. </p><dl class="table">
  53168. <dt><samp class="option">h_fov</samp></dt>
  53169. <dd><p>Set output pannini parameter.
  53170. </p>
  53171. </dd>
  53172. <dt><samp class="option">ih_fov</samp></dt>
  53173. <dd><p>Set input pannini parameter.
  53174. </p></dd>
  53175. </dl>
  53176. </dd>
  53177. <dt>&lsquo;<samp class="samp">cylindrical</samp>&rsquo;</dt>
  53178. <dd><p>Cylindrical projection.
  53179. </p>
  53180. <p>Format specific options:
  53181. </p><dl class="table">
  53182. <dt><samp class="option">h_fov</samp></dt>
  53183. <dt><samp class="option">v_fov</samp></dt>
  53184. <dt><samp class="option">d_fov</samp></dt>
  53185. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  53186. </p>
  53187. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53188. </p>
  53189. </dd>
  53190. <dt><samp class="option">ih_fov</samp></dt>
  53191. <dt><samp class="option">iv_fov</samp></dt>
  53192. <dt><samp class="option">id_fov</samp></dt>
  53193. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  53194. </p>
  53195. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53196. </p></dd>
  53197. </dl>
  53198. </dd>
  53199. <dt>&lsquo;<samp class="samp">perspective</samp>&rsquo;</dt>
  53200. <dd><p>Perspective projection. <i class="i">(output only)</i>
  53201. </p>
  53202. <p>Format specific options:
  53203. </p><dl class="table">
  53204. <dt><samp class="option">v_fov</samp></dt>
  53205. <dd><p>Set perspective parameter.
  53206. </p></dd>
  53207. </dl>
  53208. </dd>
  53209. <dt>&lsquo;<samp class="samp">tetrahedron</samp>&rsquo;</dt>
  53210. <dd><p>Tetrahedron projection.
  53211. </p>
  53212. </dd>
  53213. <dt>&lsquo;<samp class="samp">tsp</samp>&rsquo;</dt>
  53214. <dd><p>Truncated square pyramid projection.
  53215. </p>
  53216. </dd>
  53217. <dt>&lsquo;<samp class="samp">he</samp>&rsquo;</dt>
  53218. <dt>&lsquo;<samp class="samp">hequirect</samp>&rsquo;</dt>
  53219. <dd><p>Half equirectangular projection.
  53220. </p>
  53221. </dd>
  53222. <dt>&lsquo;<samp class="samp">equisolid</samp>&rsquo;</dt>
  53223. <dd><p>Equisolid format.
  53224. </p>
  53225. <p>Format specific options:
  53226. </p><dl class="table">
  53227. <dt><samp class="option">h_fov</samp></dt>
  53228. <dt><samp class="option">v_fov</samp></dt>
  53229. <dt><samp class="option">d_fov</samp></dt>
  53230. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  53231. </p>
  53232. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53233. </p>
  53234. </dd>
  53235. <dt><samp class="option">ih_fov</samp></dt>
  53236. <dt><samp class="option">iv_fov</samp></dt>
  53237. <dt><samp class="option">id_fov</samp></dt>
  53238. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  53239. </p>
  53240. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53241. </p></dd>
  53242. </dl>
  53243. </dd>
  53244. <dt>&lsquo;<samp class="samp">og</samp>&rsquo;</dt>
  53245. <dd><p>Orthographic format.
  53246. </p>
  53247. <p>Format specific options:
  53248. </p><dl class="table">
  53249. <dt><samp class="option">h_fov</samp></dt>
  53250. <dt><samp class="option">v_fov</samp></dt>
  53251. <dt><samp class="option">d_fov</samp></dt>
  53252. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  53253. </p>
  53254. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53255. </p>
  53256. </dd>
  53257. <dt><samp class="option">ih_fov</samp></dt>
  53258. <dt><samp class="option">iv_fov</samp></dt>
  53259. <dt><samp class="option">id_fov</samp></dt>
  53260. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  53261. </p>
  53262. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  53263. </p></dd>
  53264. </dl>
  53265. </dd>
  53266. <dt>&lsquo;<samp class="samp">octahedron</samp>&rsquo;</dt>
  53267. <dd><p>Octahedron projection.
  53268. </p>
  53269. </dd>
  53270. <dt>&lsquo;<samp class="samp">cylindricalea</samp>&rsquo;</dt>
  53271. <dd><p>Cylindrical Equal Area projection.
  53272. </p></dd>
  53273. </dl>
  53274. </dd>
  53275. <dt><samp class="option">interp</samp></dt>
  53276. <dd><p>Set interpolation method.<br>
  53277. <i class="i">Note: more complex interpolation methods require much more memory to run.</i>
  53278. </p>
  53279. <p>Available methods:
  53280. </p>
  53281. <dl class="table">
  53282. <dt>&lsquo;<samp class="samp">near</samp>&rsquo;</dt>
  53283. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  53284. <dd><p>Nearest neighbour.
  53285. </p></dd>
  53286. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  53287. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  53288. <dd><p>Bilinear interpolation.
  53289. </p></dd>
  53290. <dt>&lsquo;<samp class="samp">lagrange9</samp>&rsquo;</dt>
  53291. <dd><p>Lagrange9 interpolation.
  53292. </p></dd>
  53293. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  53294. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  53295. <dd><p>Bicubic interpolation.
  53296. </p></dd>
  53297. <dt>&lsquo;<samp class="samp">lanc</samp>&rsquo;</dt>
  53298. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  53299. <dd><p>Lanczos interpolation.
  53300. </p></dd>
  53301. <dt>&lsquo;<samp class="samp">sp16</samp>&rsquo;</dt>
  53302. <dt>&lsquo;<samp class="samp">spline16</samp>&rsquo;</dt>
  53303. <dd><p>Spline16 interpolation.
  53304. </p></dd>
  53305. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  53306. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  53307. <dd><p>Gaussian interpolation.
  53308. </p></dd>
  53309. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  53310. <dd><p>Mitchell interpolation.
  53311. </p></dd>
  53312. </dl>
  53313. <p>Default value is <b class="b">&lsquo;<samp class="samp">line</samp>&rsquo;</b>.
  53314. </p>
  53315. </dd>
  53316. <dt><samp class="option">w</samp></dt>
  53317. <dt><samp class="option">h</samp></dt>
  53318. <dd><p>Set the output video resolution.
  53319. </p>
  53320. <p>Default resolution depends on formats.
  53321. </p>
  53322. </dd>
  53323. <dt><samp class="option">in_stereo</samp></dt>
  53324. <dt><samp class="option">out_stereo</samp></dt>
  53325. <dd><p>Set the input/output stereo format.
  53326. </p>
  53327. <dl class="table">
  53328. <dt>&lsquo;<samp class="samp">2d</samp>&rsquo;</dt>
  53329. <dd><p>2D mono
  53330. </p></dd>
  53331. <dt>&lsquo;<samp class="samp">sbs</samp>&rsquo;</dt>
  53332. <dd><p>Side by side
  53333. </p></dd>
  53334. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  53335. <dd><p>Top bottom
  53336. </p></dd>
  53337. </dl>
  53338. <p>Default value is <b class="b">&lsquo;<samp class="samp">2d</samp>&rsquo;</b> for input and output format.
  53339. </p>
  53340. </dd>
  53341. <dt><samp class="option">yaw</samp></dt>
  53342. <dt><samp class="option">pitch</samp></dt>
  53343. <dt><samp class="option">roll</samp></dt>
  53344. <dd><p>Set rotation for the output video. Values in degrees.
  53345. </p>
  53346. </dd>
  53347. <dt><samp class="option">rorder</samp></dt>
  53348. <dd><p>Set rotation order for the output video. Choose one item for each position.
  53349. </p>
  53350. <dl class="table">
  53351. <dt>&lsquo;<samp class="samp">y, Y</samp>&rsquo;</dt>
  53352. <dd><p>yaw
  53353. </p></dd>
  53354. <dt>&lsquo;<samp class="samp">p, P</samp>&rsquo;</dt>
  53355. <dd><p>pitch
  53356. </p></dd>
  53357. <dt>&lsquo;<samp class="samp">r, R</samp>&rsquo;</dt>
  53358. <dd><p>roll
  53359. </p></dd>
  53360. </dl>
  53361. <p>Default value is <b class="b">&lsquo;<samp class="samp">ypr</samp>&rsquo;</b>.
  53362. </p>
  53363. </dd>
  53364. <dt><samp class="option">h_flip</samp></dt>
  53365. <dt><samp class="option">v_flip</samp></dt>
  53366. <dt><samp class="option">d_flip</samp></dt>
  53367. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  53368. </p>
  53369. </dd>
  53370. <dt><samp class="option">ih_flip</samp></dt>
  53371. <dt><samp class="option">iv_flip</samp></dt>
  53372. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  53373. </p>
  53374. </dd>
  53375. <dt><samp class="option">in_trans</samp></dt>
  53376. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  53377. </p>
  53378. </dd>
  53379. <dt><samp class="option">out_trans</samp></dt>
  53380. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  53381. </p>
  53382. </dd>
  53383. <dt><samp class="option">h_offset</samp></dt>
  53384. <dt><samp class="option">v_offset</samp></dt>
  53385. <dd><p>Set output horizontal/vertical off-axis offset. Default is set to 0.
  53386. Allowed range is from -1 to 1.
  53387. </p>
  53388. </dd>
  53389. <dt><samp class="option">alpha_mask</samp></dt>
  53390. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  53391. </p>
  53392. </dd>
  53393. <dt><samp class="option">reset_rot</samp></dt>
  53394. <dd><p>Reset rotation of output video. Boolean value, by default disabled.
  53395. </p></dd>
  53396. </dl>
  53397. <a name="Examples-177"></a>
  53398. <h4 class="subsection">39.264.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-177" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-177" aria-hidden="true">TOC</a></span></h4>
  53399. <ul class="itemize mark-bullet">
  53400. <li>Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  53401. <div class="example">
  53402. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  53403. </pre></div>
  53404. </li><li>Extract back view of Equi-Angular Cubemap:
  53405. <div class="example">
  53406. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  53407. </pre></div>
  53408. </li><li>Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  53409. <div class="example">
  53410. <pre class="example-preformatted">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  53411. </pre></div>
  53412. </li></ul>
  53413. <a name="Commands-149"></a>
  53414. <h4 class="subsection">39.264.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-149" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-149" aria-hidden="true">TOC</a></span></h4>
  53415. <p>This filter supports subset of above options as <a class="ref" href="#commands">commands</a>.
  53416. </p>
  53417. <a name="vaguedenoiser"></a>
  53418. <h3 class="section">39.265 vaguedenoiser<span class="pull-right"><a class="anchor hidden-xs" href="#vaguedenoiser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vaguedenoiser" aria-hidden="true">TOC</a></span></h3>
  53419. <p>Apply a wavelet based denoiser.
  53420. </p>
  53421. <p>It transforms each frame from the video input into the wavelet domain,
  53422. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  53423. the obtained coefficients. It does an inverse wavelet transform after.
  53424. Due to wavelet properties, it should give a nice smoothed result, and
  53425. reduced noise, without blurring picture features.
  53426. </p>
  53427. <p>This filter accepts the following options:
  53428. </p>
  53429. <dl class="table">
  53430. <dt><samp class="option">threshold</samp></dt>
  53431. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  53432. Hard thresholding can use a higher threshold than soft thresholding
  53433. before the video looks overfiltered. Default value is 2.
  53434. </p>
  53435. </dd>
  53436. <dt><samp class="option">method</samp></dt>
  53437. <dd><p>The filtering method the filter will use.
  53438. </p>
  53439. <p>It accepts the following values:
  53440. </p><dl class="table">
  53441. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  53442. <dd><p>All values under the threshold will be zeroed.
  53443. </p>
  53444. </dd>
  53445. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  53446. <dd><p>All values under the threshold will be zeroed. All values above will be
  53447. reduced by the threshold.
  53448. </p>
  53449. </dd>
  53450. <dt>&lsquo;<samp class="samp">garrote</samp>&rsquo;</dt>
  53451. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  53452. (less) hard thresholding.
  53453. </p></dd>
  53454. </dl>
  53455. <p>Default is garrote.
  53456. </p>
  53457. </dd>
  53458. <dt><samp class="option">nsteps</samp></dt>
  53459. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  53460. be decomposed beyond a particular point (typically, 8 for a 640x480
  53461. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  53462. </p>
  53463. </dd>
  53464. <dt><samp class="option">percent</samp></dt>
  53465. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  53466. </p>
  53467. </dd>
  53468. <dt><samp class="option">planes</samp></dt>
  53469. <dd><p>A list of the planes to process. By default all planes are processed.
  53470. </p>
  53471. </dd>
  53472. <dt><samp class="option">type</samp></dt>
  53473. <dd><p>The threshold type the filter will use.
  53474. </p>
  53475. <p>It accepts the following values:
  53476. </p><dl class="table">
  53477. <dt>&lsquo;<samp class="samp">universal</samp>&rsquo;</dt>
  53478. <dd><p>Threshold used is same for all decompositions.
  53479. </p>
  53480. </dd>
  53481. <dt>&lsquo;<samp class="samp">bayes</samp>&rsquo;</dt>
  53482. <dd><p>Threshold used depends also on each decomposition coefficients.
  53483. </p></dd>
  53484. </dl>
  53485. <p>Default is universal.
  53486. </p></dd>
  53487. </dl>
  53488. <a name="varblur"></a>
  53489. <h3 class="section">39.266 varblur<span class="pull-right"><a class="anchor hidden-xs" href="#varblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-varblur" aria-hidden="true">TOC</a></span></h3>
  53490. <p>Apply variable blur filter by using 2nd video stream to set blur radius.
  53491. The 2nd stream must have the same dimensions.
  53492. </p>
  53493. <p>This filter accepts the following options:
  53494. </p>
  53495. <dl class="table">
  53496. <dt><samp class="option">min_r</samp></dt>
  53497. <dd><p>Set min allowed radius. Allowed range is from 0 to 254. Default is 0.
  53498. </p></dd>
  53499. <dt><samp class="option">max_r</samp></dt>
  53500. <dd><p>Set max allowed radius. Allowed range is from 1 to 255. Default is 8.
  53501. </p></dd>
  53502. <dt><samp class="option">planes</samp></dt>
  53503. <dd><p>Set which planes to process. By default, all are used.
  53504. </p></dd>
  53505. </dl>
  53506. <p>The <code class="code">varblur</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  53507. </p>
  53508. <a name="Commands-150"></a>
  53509. <h4 class="subsection">39.266.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-150" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-150" aria-hidden="true">TOC</a></span></h4>
  53510. <p>This filter supports all the above options as <a class="ref" href="#commands">commands</a>.
  53511. </p>
  53512. <a name="vectorscope"></a>
  53513. <h3 class="section">39.267 vectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#vectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vectorscope" aria-hidden="true">TOC</a></span></h3>
  53514. <p>Display 2 color component values in the two dimensional graph (which is called
  53515. a vectorscope).
  53516. </p>
  53517. <p>This filter accepts the following options:
  53518. </p>
  53519. <dl class="table">
  53520. <dt><samp class="option">mode, m</samp></dt>
  53521. <dd><p>Set vectorscope mode.
  53522. </p>
  53523. <p>It accepts the following values:
  53524. </p><dl class="table">
  53525. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  53526. <dt>&lsquo;<samp class="samp">tint</samp>&rsquo;</dt>
  53527. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  53528. same component color value on location in graph. This is the default mode.
  53529. </p>
  53530. </dd>
  53531. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  53532. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  53533. present in video frame are drawn in gradient of 2 color components which are
  53534. set by option <code class="code">x</code> and <code class="code">y</code>. The 3rd color component is static.
  53535. </p>
  53536. </dd>
  53537. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  53538. <dd><p>Actual color components values present in video frame are displayed on graph.
  53539. </p>
  53540. </dd>
  53541. <dt>&lsquo;<samp class="samp">color3</samp>&rsquo;</dt>
  53542. <dd><p>Similar as color2 but higher frequency of same values <code class="code">x</code> and <code class="code">y</code>
  53543. on graph increases value of another color component, which is luminance by
  53544. default values of <code class="code">x</code> and <code class="code">y</code>.
  53545. </p>
  53546. </dd>
  53547. <dt>&lsquo;<samp class="samp">color4</samp>&rsquo;</dt>
  53548. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  53549. colors map to same position on graph then color with higher value of component
  53550. not present in graph is picked.
  53551. </p>
  53552. </dd>
  53553. <dt>&lsquo;<samp class="samp">color5</samp>&rsquo;</dt>
  53554. <dd><p>Gray values are displayed on graph. Similar to <code class="code">color</code> but with 3rd color
  53555. component picked from radial gradient.
  53556. </p></dd>
  53557. </dl>
  53558. </dd>
  53559. <dt><samp class="option">x</samp></dt>
  53560. <dd><p>Set which color component will be represented on X-axis. Default is <code class="code">1</code>.
  53561. </p>
  53562. </dd>
  53563. <dt><samp class="option">y</samp></dt>
  53564. <dd><p>Set which color component will be represented on Y-axis. Default is <code class="code">2</code>.
  53565. </p>
  53566. </dd>
  53567. <dt><samp class="option">intensity, i</samp></dt>
  53568. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  53569. of color component which represents frequency of (X, Y) location in graph.
  53570. </p>
  53571. </dd>
  53572. <dt><samp class="option">envelope, e</samp></dt>
  53573. <dd><dl class="table">
  53574. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  53575. <dd><p>No envelope, this is default.
  53576. </p>
  53577. </dd>
  53578. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  53579. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  53580. </p>
  53581. </dd>
  53582. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  53583. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  53584. can still spot out of range values without constantly looking at vectorscope.
  53585. </p>
  53586. </dd>
  53587. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  53588. <dd><p>Peak and instant envelope combined together.
  53589. </p></dd>
  53590. </dl>
  53591. </dd>
  53592. <dt><samp class="option">graticule, g</samp></dt>
  53593. <dd><p>Set what kind of graticule to draw.
  53594. </p><dl class="table">
  53595. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  53596. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  53597. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  53598. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  53599. </dl>
  53600. </dd>
  53601. <dt><samp class="option">opacity, o</samp></dt>
  53602. <dd><p>Set graticule opacity.
  53603. </p>
  53604. </dd>
  53605. <dt><samp class="option">flags, f</samp></dt>
  53606. <dd><p>Set graticule flags.
  53607. </p>
  53608. <dl class="table">
  53609. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  53610. <dd><p>Draw graticule for white point.
  53611. </p>
  53612. </dd>
  53613. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  53614. <dd><p>Draw graticule for black point.
  53615. </p>
  53616. </dd>
  53617. <dt>&lsquo;<samp class="samp">name</samp>&rsquo;</dt>
  53618. <dd><p>Draw color points short names.
  53619. </p></dd>
  53620. </dl>
  53621. </dd>
  53622. <dt><samp class="option">bgopacity, b</samp></dt>
  53623. <dd><p>Set background opacity.
  53624. </p>
  53625. </dd>
  53626. <dt><samp class="option">lthreshold, l</samp></dt>
  53627. <dd><p>Set low threshold for color component not represented on X or Y axis.
  53628. Values lower than this value will be ignored. Default is 0.
  53629. Note this value is multiplied with actual max possible value one pixel component
  53630. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  53631. is 0.1 * 255 = 25.
  53632. </p>
  53633. </dd>
  53634. <dt><samp class="option">hthreshold, h</samp></dt>
  53635. <dd><p>Set high threshold for color component not represented on X or Y axis.
  53636. Values higher than this value will be ignored. Default is 1.
  53637. Note this value is multiplied with actual max possible value one pixel component
  53638. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  53639. is 0.9 * 255 = 230.
  53640. </p>
  53641. </dd>
  53642. <dt><samp class="option">colorspace, c</samp></dt>
  53643. <dd><p>Set what kind of colorspace to use when drawing graticule.
  53644. </p><dl class="table">
  53645. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  53646. <dt>&lsquo;<samp class="samp">601</samp>&rsquo;</dt>
  53647. <dt>&lsquo;<samp class="samp">709</samp>&rsquo;</dt>
  53648. </dl>
  53649. <p>Default is auto.
  53650. </p>
  53651. </dd>
  53652. <dt><samp class="option">tint0, t0</samp></dt>
  53653. <dt><samp class="option">tint1, t1</samp></dt>
  53654. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  53655. This means no tint, and output will remain gray.
  53656. </p></dd>
  53657. </dl>
  53658. <a class="anchor" id="vidstabdetect"></a><a name="vidstabdetect-1"></a>
  53659. <h3 class="section">39.268 vidstabdetect<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabdetect-1" aria-hidden="true">TOC</a></span></h3>
  53660. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  53661. <a class="ref" href="#vidstabtransform">vidstabtransform</a> for pass 2.
  53662. </p>
  53663. <p>This filter generates a file with relative translation and rotation
  53664. transform information about subsequent frames, which is then used by
  53665. the <a class="ref" href="#vidstabtransform">vidstabtransform</a> filter.
  53666. </p>
  53667. <p>To enable compilation of this filter you need to configure FFmpeg with
  53668. <code class="code">--enable-libvidstab</code>.
  53669. </p>
  53670. <p>This filter accepts the following options:
  53671. </p>
  53672. <dl class="table">
  53673. <dt><samp class="option">result</samp></dt>
  53674. <dd><p>Set the path to the file used to write the transforms information.
  53675. Default value is <samp class="file">transforms.trf</samp>.
  53676. </p>
  53677. </dd>
  53678. <dt><samp class="option">shakiness</samp></dt>
  53679. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  53680. integer in the range 1-10, a value of 1 means little shakiness, a
  53681. value of 10 means strong shakiness. Default value is 5.
  53682. </p>
  53683. </dd>
  53684. <dt><samp class="option">accuracy</samp></dt>
  53685. <dd><p>Set the accuracy of the detection process. It must be a value in the
  53686. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  53687. accuracy. Default value is 15.
  53688. </p>
  53689. </dd>
  53690. <dt><samp class="option">stepsize</samp></dt>
  53691. <dd><p>Set stepsize of the search process. The region around minimum is
  53692. scanned with 1 pixel resolution. Default value is 6.
  53693. </p>
  53694. </dd>
  53695. <dt><samp class="option">mincontrast</samp></dt>
  53696. <dd><p>Set minimum contrast. Below this value a local measurement field is
  53697. discarded. Must be a floating point value in the range 0-1. Default
  53698. value is 0.3.
  53699. </p>
  53700. </dd>
  53701. <dt><samp class="option">tripod</samp></dt>
  53702. <dd><p>Set reference frame number for tripod mode.
  53703. </p>
  53704. <p>If enabled, the motion of the frames is compared to a reference frame
  53705. in the filtered stream, identified by the specified number. The idea
  53706. is to compensate all movements in a more-or-less static scene and keep
  53707. the camera view absolutely still.
  53708. </p>
  53709. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  53710. </p>
  53711. </dd>
  53712. <dt><samp class="option">show</samp></dt>
  53713. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  53714. integer in the range 0-2. Default value is 0, which disables any
  53715. visualization.
  53716. </p>
  53717. </dd>
  53718. <dt><samp class="option">fileformat</samp></dt>
  53719. <dd><p>Format for the transforms data file to be written.
  53720. Acceptable values are
  53721. </p>
  53722. <dl class="table">
  53723. <dt>&lsquo;<samp class="samp">ascii</samp>&rsquo;</dt>
  53724. <dd><p>Human-readable plain text
  53725. </p>
  53726. </dd>
  53727. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  53728. <dd><p>Binary format, roughly 40% smaller than <code class="code">ascii</code>. (<em class="emph">default</em>)
  53729. </p></dd>
  53730. </dl>
  53731. </dd>
  53732. </dl>
  53733. <a name="Examples-178"></a>
  53734. <h4 class="subsection">39.268.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-178" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-178" aria-hidden="true">TOC</a></span></h4>
  53735. <ul class="itemize mark-bullet">
  53736. <li>Use default values:
  53737. <div class="example">
  53738. <pre class="example-preformatted">vidstabdetect
  53739. </pre></div>
  53740. </li><li>Analyze strongly shaky movie and put the results in file
  53741. <samp class="file">mytransforms.trf</samp>:
  53742. <div class="example">
  53743. <pre class="example-preformatted">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  53744. </pre></div>
  53745. </li><li>Visualize the result of internal transformations in the resulting
  53746. video:
  53747. <div class="example">
  53748. <pre class="example-preformatted">vidstabdetect=show=1
  53749. </pre></div>
  53750. </li><li>Analyze a video with medium shakiness using <code class="command">ffmpeg</code>:
  53751. <div class="example">
  53752. <pre class="example-preformatted">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  53753. </pre></div>
  53754. </li></ul>
  53755. <a class="anchor" id="vidstabtransform"></a><a name="vidstabtransform-1"></a>
  53756. <h3 class="section">39.269 vidstabtransform<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabtransform-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabtransform-1" aria-hidden="true">TOC</a></span></h3>
  53757. <p>Video stabilization/deshaking: pass 2 of 2,
  53758. see <a class="ref" href="#vidstabdetect">vidstabdetect</a> for pass 1.
  53759. </p>
  53760. <p>Read a file with transform information for each frame and
  53761. apply/compensate them. Together with the <a class="ref" href="#vidstabdetect">vidstabdetect</a>
  53762. filter this can be used to deshake videos. See also
  53763. <a class="url" href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  53764. the <a class="ref" href="#unsharp">unsharp</a> filter, see below.
  53765. </p>
  53766. <p>To enable compilation of this filter you need to configure FFmpeg with
  53767. <code class="code">--enable-libvidstab</code>.
  53768. </p>
  53769. <a name="Options-124"></a>
  53770. <h4 class="subsection">39.269.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-124" aria-hidden="true">TOC</a></span></h4>
  53771. <dl class="table">
  53772. <dt><samp class="option">input</samp></dt>
  53773. <dd><p>Set path to the file used to read the transforms. Default value is
  53774. <samp class="file">transforms.trf</samp>.
  53775. </p>
  53776. </dd>
  53777. <dt><samp class="option">smoothing</samp></dt>
  53778. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  53779. camera movements. Default value is 10.
  53780. </p>
  53781. <p>For example a number of 10 means that 21 frames are used (10 in the
  53782. past and 10 in the future) to smoothen the motion in the video. A
  53783. larger value leads to a smoother video, but limits the acceleration of
  53784. the camera (pan/tilt movements). 0 is a special case where a static
  53785. camera is simulated.
  53786. </p>
  53787. </dd>
  53788. <dt><samp class="option">optalgo</samp></dt>
  53789. <dd><p>Set the camera path optimization algorithm.
  53790. </p>
  53791. <p>Accepted values are:
  53792. </p><dl class="table">
  53793. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  53794. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  53795. </p></dd>
  53796. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  53797. <dd><p>averaging on transformations
  53798. </p></dd>
  53799. </dl>
  53800. </dd>
  53801. <dt><samp class="option">maxshift</samp></dt>
  53802. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  53803. meaning no limit.
  53804. </p>
  53805. </dd>
  53806. <dt><samp class="option">maxangle</samp></dt>
  53807. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  53808. value is -1, meaning no limit.
  53809. </p>
  53810. </dd>
  53811. <dt><samp class="option">crop</samp></dt>
  53812. <dd><p>Specify how to deal with borders that may be visible due to movement
  53813. compensation.
  53814. </p>
  53815. <p>Available values are:
  53816. </p><dl class="table">
  53817. <dt>&lsquo;<samp class="samp">keep</samp>&rsquo;</dt>
  53818. <dd><p>keep image information from previous frame (default)
  53819. </p></dd>
  53820. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  53821. <dd><p>fill the border black
  53822. </p></dd>
  53823. </dl>
  53824. </dd>
  53825. <dt><samp class="option">invert</samp></dt>
  53826. <dd><p>Invert transforms if set to 1. Default value is 0.
  53827. </p>
  53828. </dd>
  53829. <dt><samp class="option">relative</samp></dt>
  53830. <dd><p>Consider transforms as relative to previous frame if set to 1,
  53831. absolute if set to 0. Default value is 0.
  53832. </p>
  53833. </dd>
  53834. <dt><samp class="option">zoom</samp></dt>
  53835. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  53836. effect, a negative value in a zoom-out effect. Default value is 0 (no
  53837. zoom).
  53838. </p>
  53839. </dd>
  53840. <dt><samp class="option">optzoom</samp></dt>
  53841. <dd><p>Set optimal zooming to avoid borders.
  53842. </p>
  53843. <p>Accepted values are:
  53844. </p><dl class="table">
  53845. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  53846. <dd><p>disabled
  53847. </p></dd>
  53848. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  53849. <dd><p>optimal static zoom value is determined (only very strong movements
  53850. will lead to visible borders) (default)
  53851. </p></dd>
  53852. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  53853. <dd><p>optimal adaptive zoom value is determined (no borders will be
  53854. visible), see <samp class="option">zoomspeed</samp>
  53855. </p></dd>
  53856. </dl>
  53857. <p>Note that the value given at zoom is added to the one calculated here.
  53858. </p>
  53859. </dd>
  53860. <dt><samp class="option">zoomspeed</samp></dt>
  53861. <dd><p>Set percent to zoom maximally each frame (enabled when
  53862. <samp class="option">optzoom</samp> is set to 2). Range is from 0 to 5, default value is
  53863. 0.25.
  53864. </p>
  53865. </dd>
  53866. <dt><samp class="option">interpol</samp></dt>
  53867. <dd><p>Specify type of interpolation.
  53868. </p>
  53869. <p>Available values are:
  53870. </p><dl class="table">
  53871. <dt>&lsquo;<samp class="samp">no</samp>&rsquo;</dt>
  53872. <dd><p>no interpolation
  53873. </p></dd>
  53874. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  53875. <dd><p>linear only horizontal
  53876. </p></dd>
  53877. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  53878. <dd><p>linear in both directions (default)
  53879. </p></dd>
  53880. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  53881. <dd><p>cubic in both directions (slow)
  53882. </p></dd>
  53883. </dl>
  53884. </dd>
  53885. <dt><samp class="option">tripod</samp></dt>
  53886. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  53887. <code class="code">relative=0:smoothing=0</code>. Default value is 0.
  53888. </p>
  53889. <p>Use also <code class="code">tripod</code> option of <a class="ref" href="#vidstabdetect">vidstabdetect</a>.
  53890. </p>
  53891. </dd>
  53892. <dt><samp class="option">debug</samp></dt>
  53893. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  53894. are written to the temporary file <samp class="file">global_motions.trf</samp>. Default
  53895. value is 0.
  53896. </p></dd>
  53897. </dl>
  53898. <a name="Examples-179"></a>
  53899. <h4 class="subsection">39.269.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-179" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-179" aria-hidden="true">TOC</a></span></h4>
  53900. <ul class="itemize mark-bullet">
  53901. <li>Use <code class="command">ffmpeg</code> for a typical stabilization with default values:
  53902. <div class="example">
  53903. <pre class="example-preformatted">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  53904. </pre></div>
  53905. <p>Note the use of the <a class="ref" href="#unsharp">unsharp</a> filter which is always recommended.
  53906. </p>
  53907. </li><li>Zoom in a bit more and load transform data from a given file:
  53908. <div class="example">
  53909. <pre class="example-preformatted">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  53910. </pre></div>
  53911. </li><li>Smoothen the video even more:
  53912. <div class="example">
  53913. <pre class="example-preformatted">vidstabtransform=smoothing=30
  53914. </pre></div>
  53915. </li></ul>
  53916. <a name="vflip"></a>
  53917. <h3 class="section">39.270 vflip<span class="pull-right"><a class="anchor hidden-xs" href="#vflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vflip" aria-hidden="true">TOC</a></span></h3>
  53918. <p>Flip the input video vertically.
  53919. </p>
  53920. <p>For example, to vertically flip a video with <code class="command">ffmpeg</code>:
  53921. </p><div class="example">
  53922. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  53923. </pre></div>
  53924. <a name="vfrdet"></a>
  53925. <h3 class="section">39.271 vfrdet<span class="pull-right"><a class="anchor hidden-xs" href="#vfrdet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfrdet" aria-hidden="true">TOC</a></span></h3>
  53926. <p>Detect variable frame rate video.
  53927. </p>
  53928. <p>This filter tries to detect if the input is variable or constant frame rate.
  53929. </p>
  53930. <p>At end it will output number of frames detected as having variable delta pts,
  53931. and ones with constant delta pts.
  53932. If there was frames with variable delta, than it will also show min, max and
  53933. average delta encountered.
  53934. </p>
  53935. <a name="vibrance"></a>
  53936. <h3 class="section">39.272 vibrance<span class="pull-right"><a class="anchor hidden-xs" href="#vibrance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vibrance" aria-hidden="true">TOC</a></span></h3>
  53937. <p>Boost or alter saturation.
  53938. </p>
  53939. <p>The filter accepts the following options:
  53940. </p><dl class="table">
  53941. <dt><samp class="option">intensity</samp></dt>
  53942. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  53943. Default is 0. Allowed range is from -2 to 2.
  53944. </p>
  53945. </dd>
  53946. <dt><samp class="option">rbal</samp></dt>
  53947. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  53948. </p>
  53949. </dd>
  53950. <dt><samp class="option">gbal</samp></dt>
  53951. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  53952. </p>
  53953. </dd>
  53954. <dt><samp class="option">bbal</samp></dt>
  53955. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  53956. </p>
  53957. </dd>
  53958. <dt><samp class="option">rlum</samp></dt>
  53959. <dd><p>Set the red luma coefficient.
  53960. </p>
  53961. </dd>
  53962. <dt><samp class="option">glum</samp></dt>
  53963. <dd><p>Set the green luma coefficient.
  53964. </p>
  53965. </dd>
  53966. <dt><samp class="option">blum</samp></dt>
  53967. <dd><p>Set the blue luma coefficient.
  53968. </p>
  53969. </dd>
  53970. <dt><samp class="option">alternate</samp></dt>
  53971. <dd><p>If <code class="code">intensity</code> is negative and this is set to 1, colors will change,
  53972. otherwise colors will be less saturated, more towards gray.
  53973. </p></dd>
  53974. </dl>
  53975. <a name="Commands-151"></a>
  53976. <h4 class="subsection">39.272.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-151" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-151" aria-hidden="true">TOC</a></span></h4>
  53977. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  53978. </p>
  53979. <a name="vif"></a>
  53980. <h3 class="section">39.273 vif<span class="pull-right"><a class="anchor hidden-xs" href="#vif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vif" aria-hidden="true">TOC</a></span></h3>
  53981. <p>Obtain the average VIF (Visual Information Fidelity) between two input videos.
  53982. </p>
  53983. <p>This filter takes two input videos.
  53984. </p>
  53985. <p>Both input videos must have the same resolution and pixel format for
  53986. this filter to work correctly. Also it assumes that both inputs
  53987. have the same number of frames, which are compared one by one.
  53988. </p>
  53989. <p>The obtained average VIF score is printed through the logging system.
  53990. </p>
  53991. <p>The filter stores the calculated VIF score of each frame.
  53992. </p>
  53993. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  53994. </p>
  53995. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  53996. with the reference file <samp class="file">ref.mpg</samp>.
  53997. </p>
  53998. <div class="example">
  53999. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
  54000. </pre></div>
  54001. <a class="anchor" id="vignette"></a><a name="vignette-1"></a>
  54002. <h3 class="section">39.274 vignette<span class="pull-right"><a class="anchor hidden-xs" href="#vignette-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vignette-1" aria-hidden="true">TOC</a></span></h3>
  54003. <p>Make or reverse a natural vignetting effect.
  54004. </p>
  54005. <p>The filter accepts the following options:
  54006. </p>
  54007. <dl class="table">
  54008. <dt><samp class="option">angle, a</samp></dt>
  54009. <dd><p>Set lens angle expression as a number of radians.
  54010. </p>
  54011. <p>The value is clipped in the <code class="code">[0,PI/2]</code> range.
  54012. </p>
  54013. <p>Default value: <code class="code">&quot;PI/5&quot;</code>
  54014. </p>
  54015. </dd>
  54016. <dt><samp class="option">x0</samp></dt>
  54017. <dt><samp class="option">y0</samp></dt>
  54018. <dd><p>Set center coordinates expressions. Respectively <code class="code">&quot;w/2&quot;</code> and <code class="code">&quot;h/2&quot;</code>
  54019. by default.
  54020. </p>
  54021. </dd>
  54022. <dt><samp class="option">mode</samp></dt>
  54023. <dd><p>Set forward/backward mode.
  54024. </p>
  54025. <p>Available modes are:
  54026. </p><dl class="table">
  54027. <dt>&lsquo;<samp class="samp">forward</samp>&rsquo;</dt>
  54028. <dd><p>The larger the distance from the central point, the darker the image becomes.
  54029. </p>
  54030. </dd>
  54031. <dt>&lsquo;<samp class="samp">backward</samp>&rsquo;</dt>
  54032. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  54033. This can be used to reverse a vignette effect, though there is no automatic
  54034. detection to extract the lens <samp class="option">angle</samp> and other settings (yet). It can
  54035. also be used to create a burning effect.
  54036. </p></dd>
  54037. </dl>
  54038. <p>Default value is &lsquo;<samp class="samp">forward</samp>&rsquo;.
  54039. </p>
  54040. </dd>
  54041. <dt><samp class="option">eval</samp></dt>
  54042. <dd><p>Set evaluation mode for the expressions (<samp class="option">angle</samp>, <samp class="option">x0</samp>, <samp class="option">y0</samp>).
  54043. </p>
  54044. <p>It accepts the following values:
  54045. </p><dl class="table">
  54046. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  54047. <dd><p>Evaluate expressions only once during the filter initialization.
  54048. </p>
  54049. </dd>
  54050. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  54051. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  54052. &lsquo;<samp class="samp">init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  54053. allows advanced dynamic expressions.
  54054. </p></dd>
  54055. </dl>
  54056. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  54057. </p>
  54058. </dd>
  54059. <dt><samp class="option">dither</samp></dt>
  54060. <dd><p>Set dithering to reduce the circular banding effects. Default is <code class="code">1</code>
  54061. (enabled).
  54062. </p>
  54063. </dd>
  54064. <dt><samp class="option">aspect</samp></dt>
  54065. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  54066. Setting this value to the SAR of the input will make a rectangular vignetting
  54067. following the dimensions of the video.
  54068. </p>
  54069. <p>Default is <code class="code">1/1</code>.
  54070. </p></dd>
  54071. </dl>
  54072. <a name="Expressions"></a>
  54073. <h4 class="subsection">39.274.1 Expressions<span class="pull-right"><a class="anchor hidden-xs" href="#Expressions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expressions" aria-hidden="true">TOC</a></span></h4>
  54074. <p>The <samp class="option">alpha</samp>, <samp class="option">x0</samp> and <samp class="option">y0</samp> expressions can contain the
  54075. following parameters.
  54076. </p>
  54077. <dl class="table">
  54078. <dt><samp class="option">w</samp></dt>
  54079. <dt><samp class="option">h</samp></dt>
  54080. <dd><p>input width and height
  54081. </p>
  54082. </dd>
  54083. <dt><samp class="option">n</samp></dt>
  54084. <dd><p>the number of input frame, starting from 0
  54085. </p>
  54086. </dd>
  54087. <dt><samp class="option">pts</samp></dt>
  54088. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  54089. <var class="var">TB</var> units, NAN if undefined
  54090. </p>
  54091. </dd>
  54092. <dt><samp class="option">r</samp></dt>
  54093. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  54094. </p>
  54095. </dd>
  54096. <dt><samp class="option">t</samp></dt>
  54097. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  54098. expressed in seconds, NAN if undefined
  54099. </p>
  54100. </dd>
  54101. <dt><samp class="option">tb</samp></dt>
  54102. <dd><p>time base of the input video
  54103. </p></dd>
  54104. </dl>
  54105. <a name="Examples-180"></a>
  54106. <h4 class="subsection">39.274.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-180" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-180" aria-hidden="true">TOC</a></span></h4>
  54107. <ul class="itemize mark-bullet">
  54108. <li>Apply simple strong vignetting effect:
  54109. <div class="example">
  54110. <pre class="example-preformatted">vignette=PI/4
  54111. </pre></div>
  54112. </li><li>Make a flickering vignetting:
  54113. <div class="example">
  54114. <pre class="example-preformatted">vignette='PI/4+random(1)*PI/50':eval=frame
  54115. </pre></div>
  54116. </li></ul>
  54117. <a name="vmafmotion"></a>
  54118. <h3 class="section">39.275 vmafmotion<span class="pull-right"><a class="anchor hidden-xs" href="#vmafmotion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vmafmotion" aria-hidden="true">TOC</a></span></h3>
  54119. <p>Obtain the average VMAF motion score of a video.
  54120. It is one of the component metrics of VMAF.
  54121. </p>
  54122. <p>The obtained average motion score is printed through the logging system.
  54123. </p>
  54124. <p>The filter accepts the following options:
  54125. </p>
  54126. <dl class="table">
  54127. <dt><samp class="option">stats_file</samp></dt>
  54128. <dd><p>If specified, the filter will use the named file to save the motion score of
  54129. each frame with respect to the previous frame.
  54130. When filename equals &quot;-&quot; the data is sent to standard output.
  54131. </p></dd>
  54132. </dl>
  54133. <p>Example:
  54134. </p><div class="example">
  54135. <pre class="example-preformatted">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  54136. </pre></div>
  54137. <a class="anchor" id="vpp_005famf"></a><a name="vpp_005famf-1"></a>
  54138. <h3 class="section">39.276 vpp_amf<span class="pull-right"><a class="anchor hidden-xs" href="#vpp_005famf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vpp_005famf-1" aria-hidden="true">TOC</a></span></h3>
  54139. <p>Scale (resize) and convert colorspace, transfer characteristics or color primaries for the input video, using AMD Advanced Media Framework library for hardware acceleration.
  54140. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  54141. </p>
  54142. <p>The filter accepts the following options:
  54143. </p><dl class="table">
  54144. <dt><samp class="option">w</samp></dt>
  54145. <dt><samp class="option">h</samp></dt>
  54146. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  54147. </p>
  54148. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  54149. </p>
  54150. </dd>
  54151. <dt><samp class="option">scale_type</samp></dt>
  54152. <dd><p>Sets the algorithm used for scaling:
  54153. </p>
  54154. <dl class="table">
  54155. <dt><var class="var">bilinear</var></dt>
  54156. <dd><p>Bilinear
  54157. </p>
  54158. <p>This is the default.
  54159. </p>
  54160. </dd>
  54161. <dt><var class="var">bicubic</var></dt>
  54162. <dd><p>Bicubic
  54163. </p>
  54164. </dd>
  54165. </dl>
  54166. </dd>
  54167. <dt><samp class="option">format</samp></dt>
  54168. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  54169. pixel format is used.
  54170. </p>
  54171. </dd>
  54172. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  54173. <dt><samp class="option">force_divisible_by</samp></dt>
  54174. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  54175. </p>
  54176. </dd>
  54177. <dt><samp class="option">reset_sar</samp></dt>
  54178. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  54179. </p>
  54180. <a class="anchor" id="color_005fprofile"></a></dd>
  54181. <dt><samp class="option">color_profile</samp></dt>
  54182. <dd><p>Specify all color properties at once.
  54183. </p>
  54184. <p>The accepted values are:
  54185. </p><dl class="table">
  54186. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  54187. <dd><p>BT.601
  54188. </p>
  54189. </dd>
  54190. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  54191. <dd><p>BT.709
  54192. </p>
  54193. </dd>
  54194. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  54195. <dd><p>BT.2020
  54196. </p>
  54197. </dd>
  54198. </dl>
  54199. </dd>
  54200. <dt><samp class="option">trc</samp></dt>
  54201. <dd><p>Specify output transfer characteristics.
  54202. </p>
  54203. <p>The accepted values are:
  54204. </p><dl class="table">
  54205. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  54206. <dd><p>BT.709
  54207. </p>
  54208. </dd>
  54209. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  54210. <dd><p>Constant gamma of 2.2
  54211. </p>
  54212. </dd>
  54213. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  54214. <dd><p>Constant gamma of 2.8
  54215. </p>
  54216. </dd>
  54217. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  54218. <dd><p>SMPTE-170M
  54219. </p>
  54220. </dd>
  54221. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  54222. <dd><p>SMPTE-240M
  54223. </p>
  54224. </dd>
  54225. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  54226. <dd><p>Linear
  54227. </p>
  54228. </dd>
  54229. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  54230. <dd><p>LOG
  54231. </p>
  54232. </dd>
  54233. <dt>&lsquo;<samp class="samp">log-sqrt</samp>&rsquo;</dt>
  54234. <dd><p>LOG_SQRT
  54235. </p>
  54236. </dd>
  54237. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  54238. <dd><p>iec61966-2-4
  54239. </p>
  54240. </dd>
  54241. <dt>&lsquo;<samp class="samp">bt1361-ecg</samp>&rsquo;</dt>
  54242. <dd><p>BT1361_ECG
  54243. </p>
  54244. </dd>
  54245. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  54246. <dd><p>iec61966-2-1
  54247. </p>
  54248. </dd>
  54249. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  54250. <dd><p>BT.2020 for 10-bits content
  54251. </p>
  54252. </dd>
  54253. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  54254. <dd><p>BT.2020 for 12-bits content
  54255. </p>
  54256. </dd>
  54257. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  54258. <dd><p>SMPTE2084
  54259. </p>
  54260. </dd>
  54261. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  54262. <dd><p>SMPTE428
  54263. </p>
  54264. </dd>
  54265. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  54266. <dd><p>ARIB_STD_B67
  54267. </p>
  54268. </dd>
  54269. </dl>
  54270. </dd>
  54271. <dt><samp class="option">primaries</samp></dt>
  54272. <dd><p>Specify output color primaries.
  54273. </p>
  54274. <p>The accepted values are:
  54275. </p><dl class="table">
  54276. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  54277. <dd><p>BT.709
  54278. </p>
  54279. </dd>
  54280. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  54281. <dd><p>BT.470M
  54282. </p>
  54283. </dd>
  54284. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  54285. <dd><p>BT.470BG or BT.601-6 625
  54286. </p>
  54287. </dd>
  54288. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  54289. <dd><p>SMPTE-170M or BT.601-6 525
  54290. </p>
  54291. </dd>
  54292. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  54293. <dd><p>SMPTE-240M
  54294. </p>
  54295. </dd>
  54296. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  54297. <dd><p>film
  54298. </p>
  54299. </dd>
  54300. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  54301. <dd><p>BT.2020
  54302. </p>
  54303. </dd>
  54304. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  54305. <dd><p>SMPTE-428
  54306. </p>
  54307. </dd>
  54308. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  54309. <dd><p>SMPTE-431
  54310. </p>
  54311. </dd>
  54312. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  54313. <dd><p>SMPTE-432
  54314. </p>
  54315. </dd>
  54316. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  54317. <dd><p>JEDEC P22 phosphors
  54318. </p>
  54319. </dd>
  54320. </dl>
  54321. </dd>
  54322. </dl>
  54323. <a name="Examples-181"></a>
  54324. <h4 class="subsection">39.276.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-181" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-181" aria-hidden="true">TOC</a></span></h4>
  54325. <ul class="itemize mark-bullet">
  54326. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  54327. <div class="example">
  54328. <pre class="example-preformatted">vpp_amf=-2:720:format=yuv420p
  54329. </pre></div>
  54330. </li><li>Upscale to 4K and change color profile to bt2020.
  54331. <div class="example">
  54332. <pre class="example-preformatted">vpp_amf=4096:2160:color_profile=bt2020
  54333. </pre></div>
  54334. </li></ul>
  54335. <a class="anchor" id="vstack"></a><a name="vstack-1"></a>
  54336. <h3 class="section">39.277 vstack<span class="pull-right"><a class="anchor hidden-xs" href="#vstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack-1" aria-hidden="true">TOC</a></span></h3>
  54337. <p>Stack input videos vertically.
  54338. </p>
  54339. <p>All streams must be of same pixel format and of same width.
  54340. </p>
  54341. <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
  54342. to create same output.
  54343. </p>
  54344. <p>The filter accepts the following options:
  54345. </p>
  54346. <dl class="table">
  54347. <dt><samp class="option">inputs</samp></dt>
  54348. <dd><p>Set number of input streams. Default is 2.
  54349. </p>
  54350. </dd>
  54351. <dt><samp class="option">shortest</samp></dt>
  54352. <dd><p>If set to 1, force the output to terminate when the shortest input
  54353. terminates. Default value is 0.
  54354. </p></dd>
  54355. </dl>
  54356. <a name="w3fdif"></a>
  54357. <h3 class="section">39.278 w3fdif<span class="pull-right"><a class="anchor hidden-xs" href="#w3fdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-w3fdif" aria-hidden="true">TOC</a></span></h3>
  54358. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  54359. Deinterlacing Filter&quot;).
  54360. </p>
  54361. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  54362. implemented based on the de-interlace algorithm written by Jim
  54363. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  54364. uses filter coefficients calculated by BBC R&amp;D.
  54365. </p>
  54366. <p>This filter uses field-dominance information in frame to decide which
  54367. of each pair of fields to place first in the output.
  54368. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">w3fdif</code> filter.
  54369. </p>
  54370. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  54371. and &quot;complex&quot;. Which set of filter coefficients is used can
  54372. be set by passing an optional parameter:
  54373. </p>
  54374. <dl class="table">
  54375. <dt><samp class="option">filter</samp></dt>
  54376. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  54377. </p>
  54378. <dl class="table">
  54379. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  54380. <dd><p>Simple filter coefficient set.
  54381. </p></dd>
  54382. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  54383. <dd><p>More-complex filter coefficient set.
  54384. </p></dd>
  54385. </dl>
  54386. <p>Default value is &lsquo;<samp class="samp">complex</samp>&rsquo;.
  54387. </p>
  54388. </dd>
  54389. <dt><samp class="option">mode</samp></dt>
  54390. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  54391. </p>
  54392. <dl class="table">
  54393. <dt><samp class="option">frame</samp></dt>
  54394. <dd><p>Output one frame for each frame.
  54395. </p></dd>
  54396. <dt><samp class="option">field</samp></dt>
  54397. <dd><p>Output one frame for each field.
  54398. </p></dd>
  54399. </dl>
  54400. <p>The default value is <code class="code">field</code>.
  54401. </p>
  54402. </dd>
  54403. <dt><samp class="option">parity</samp></dt>
  54404. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  54405. of the following values:
  54406. </p>
  54407. <dl class="table">
  54408. <dt><samp class="option">tff</samp></dt>
  54409. <dd><p>Assume the top field is first.
  54410. </p></dd>
  54411. <dt><samp class="option">bff</samp></dt>
  54412. <dd><p>Assume the bottom field is first.
  54413. </p></dd>
  54414. <dt><samp class="option">auto</samp></dt>
  54415. <dd><p>Enable automatic detection of field parity.
  54416. </p></dd>
  54417. </dl>
  54418. <p>The default value is <code class="code">auto</code>.
  54419. If the interlacing is unknown or the decoder does not export this information,
  54420. top field first will be assumed.
  54421. </p>
  54422. </dd>
  54423. <dt><samp class="option">deint</samp></dt>
  54424. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  54425. </p>
  54426. <dl class="table">
  54427. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  54428. <dd><p>Deinterlace all frames,
  54429. </p></dd>
  54430. <dt>&lsquo;<samp class="samp">interlaced</samp>&rsquo;</dt>
  54431. <dd><p>Only deinterlace frames marked as interlaced.
  54432. </p></dd>
  54433. </dl>
  54434. <p>Default value is &lsquo;<samp class="samp">all</samp>&rsquo;.
  54435. </p></dd>
  54436. </dl>
  54437. <a name="Commands-152"></a>
  54438. <h4 class="subsection">39.278.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-152" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-152" aria-hidden="true">TOC</a></span></h4>
  54439. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  54440. </p>
  54441. <a name="waveform"></a>
  54442. <h3 class="section">39.279 waveform<span class="pull-right"><a class="anchor hidden-xs" href="#waveform" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-waveform" aria-hidden="true">TOC</a></span></h3>
  54443. <p>Video waveform monitor.
  54444. </p>
  54445. <p>The waveform monitor plots color component intensity. By default luma
  54446. only. Each column of the waveform corresponds to a column of pixels in the
  54447. source video.
  54448. </p>
  54449. <p>It accepts the following options:
  54450. </p>
  54451. <dl class="table">
  54452. <dt><samp class="option">mode, m</samp></dt>
  54453. <dd><p>Can be either <code class="code">row</code>, or <code class="code">column</code>. Default is <code class="code">column</code>.
  54454. In row mode, the graph on the left side represents color component value 0 and
  54455. the right side represents value = 255. In column mode, the top side represents
  54456. color component value = 0 and bottom side represents value = 255.
  54457. </p>
  54458. </dd>
  54459. <dt><samp class="option">intensity, i</samp></dt>
  54460. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  54461. luminance are distributed across input rows/columns.
  54462. Default value is <code class="code">0.04</code>. Allowed range is [0, 1].
  54463. </p>
  54464. </dd>
  54465. <dt><samp class="option">mirror, r</samp></dt>
  54466. <dd><p>Set mirroring mode. <code class="code">0</code> means unmirrored, <code class="code">1</code> means mirrored.
  54467. In mirrored mode, higher values will be represented on the left
  54468. side for <code class="code">row</code> mode and at the top for <code class="code">column</code> mode. Default is
  54469. <code class="code">1</code> (mirrored).
  54470. </p>
  54471. </dd>
  54472. <dt><samp class="option">display, d</samp></dt>
  54473. <dd><p>Set display mode.
  54474. It accepts the following values:
  54475. </p><dl class="table">
  54476. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  54477. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  54478. that the graphs representing color components are superimposed directly
  54479. over one another.
  54480. </p>
  54481. <p>This display mode makes it easier to spot relative differences or similarities
  54482. in overlapping areas of the color components that are supposed to be identical,
  54483. such as neutral whites, grays, or blacks.
  54484. </p>
  54485. </dd>
  54486. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  54487. <dd><p>Display separate graph for the color components side by side in
  54488. <code class="code">row</code> mode or one below the other in <code class="code">column</code> mode.
  54489. </p>
  54490. </dd>
  54491. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  54492. <dd><p>Display separate graph for the color components side by side in
  54493. <code class="code">column</code> mode or one below the other in <code class="code">row</code> mode.
  54494. </p>
  54495. <p>Using this display mode makes it easy to spot color casts in the highlights
  54496. and shadows of an image, by comparing the contours of the top and the bottom
  54497. graphs of each waveform. Since whites, grays, and blacks are characterized
  54498. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  54499. should display three waveforms of roughly equal width/height. If not, the
  54500. correction is easy to perform by making level adjustments the three waveforms.
  54501. </p></dd>
  54502. </dl>
  54503. <p>Default is <code class="code">stack</code>.
  54504. </p>
  54505. </dd>
  54506. <dt><samp class="option">components, c</samp></dt>
  54507. <dd><p>Set which color components to display. Default is 1, which means only luma
  54508. or red color component if input is in RGB colorspace. If is set for example to
  54509. 7 it will display all 3 (if) available color components.
  54510. </p>
  54511. </dd>
  54512. <dt><samp class="option">envelope, e</samp></dt>
  54513. <dd><dl class="table">
  54514. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  54515. <dd><p>No envelope, this is default.
  54516. </p>
  54517. </dd>
  54518. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  54519. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  54520. visible even with small <code class="code">step</code> value.
  54521. </p>
  54522. </dd>
  54523. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  54524. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  54525. can still spot out of range values without constantly looking at waveforms.
  54526. </p>
  54527. </dd>
  54528. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  54529. <dd><p>Peak and instant envelope combined together.
  54530. </p></dd>
  54531. </dl>
  54532. </dd>
  54533. <dt><samp class="option">filter, f</samp></dt>
  54534. <dd><dl class="table">
  54535. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  54536. <dd><p>No filtering, this is default.
  54537. </p>
  54538. </dd>
  54539. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  54540. <dd><p>Luma and chroma combined together.
  54541. </p>
  54542. </dd>
  54543. <dt>&lsquo;<samp class="samp">aflat</samp>&rsquo;</dt>
  54544. <dd><p>Similar as above, but shows difference between blue and red chroma.
  54545. </p>
  54546. </dd>
  54547. <dt>&lsquo;<samp class="samp">xflat</samp>&rsquo;</dt>
  54548. <dd><p>Similar as above, but use different colors.
  54549. </p>
  54550. </dd>
  54551. <dt>&lsquo;<samp class="samp">yflat</samp>&rsquo;</dt>
  54552. <dd><p>Similar as above, but again with different colors.
  54553. </p>
  54554. </dd>
  54555. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  54556. <dd><p>Displays only chroma.
  54557. </p>
  54558. </dd>
  54559. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  54560. <dd><p>Displays actual color value on waveform.
  54561. </p>
  54562. </dd>
  54563. <dt>&lsquo;<samp class="samp">acolor</samp>&rsquo;</dt>
  54564. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  54565. </p></dd>
  54566. </dl>
  54567. </dd>
  54568. <dt><samp class="option">graticule, g</samp></dt>
  54569. <dd><p>Set which graticule to display.
  54570. </p>
  54571. <dl class="table">
  54572. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  54573. <dd><p>Do not display graticule.
  54574. </p>
  54575. </dd>
  54576. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  54577. <dd><p>Display green graticule showing legal broadcast ranges.
  54578. </p>
  54579. </dd>
  54580. <dt>&lsquo;<samp class="samp">orange</samp>&rsquo;</dt>
  54581. <dd><p>Display orange graticule showing legal broadcast ranges.
  54582. </p>
  54583. </dd>
  54584. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  54585. <dd><p>Display invert graticule showing legal broadcast ranges.
  54586. </p></dd>
  54587. </dl>
  54588. </dd>
  54589. <dt><samp class="option">opacity, o</samp></dt>
  54590. <dd><p>Set graticule opacity.
  54591. </p>
  54592. </dd>
  54593. <dt><samp class="option">flags, fl</samp></dt>
  54594. <dd><p>Set graticule flags.
  54595. </p>
  54596. <dl class="table">
  54597. <dt>&lsquo;<samp class="samp">numbers</samp>&rsquo;</dt>
  54598. <dd><p>Draw numbers above lines. By default enabled.
  54599. </p>
  54600. </dd>
  54601. <dt>&lsquo;<samp class="samp">dots</samp>&rsquo;</dt>
  54602. <dd><p>Draw dots instead of lines.
  54603. </p></dd>
  54604. </dl>
  54605. </dd>
  54606. <dt><samp class="option">scale, s</samp></dt>
  54607. <dd><p>Set scale used for displaying graticule.
  54608. </p>
  54609. <dl class="table">
  54610. <dt>&lsquo;<samp class="samp">digital</samp>&rsquo;</dt>
  54611. <dt>&lsquo;<samp class="samp">millivolts</samp>&rsquo;</dt>
  54612. <dt>&lsquo;<samp class="samp">ire</samp>&rsquo;</dt>
  54613. </dl>
  54614. <p>Default is digital.
  54615. </p>
  54616. </dd>
  54617. <dt><samp class="option">bgopacity, b</samp></dt>
  54618. <dd><p>Set background opacity.
  54619. </p>
  54620. </dd>
  54621. <dt><samp class="option">tint0, t0</samp></dt>
  54622. <dt><samp class="option">tint1, t1</samp></dt>
  54623. <dd><p>Set tint for output.
  54624. Only used with lowpass filter and when display is not overlay and input
  54625. pixel formats are not RGB.
  54626. </p>
  54627. </dd>
  54628. <dt><samp class="option">fitmode, fm</samp></dt>
  54629. <dd><p>Set sample aspect ratio of video output frames.
  54630. Can be used to configure waveform so it is not
  54631. stretched too much in one of directions.
  54632. </p>
  54633. <dl class="table">
  54634. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  54635. <dd><p>Set sample aspect ration to 1/1.
  54636. </p></dd>
  54637. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  54638. <dd><p>Set sample aspect ratio to match input size of video
  54639. </p></dd>
  54640. </dl>
  54641. <p>Default is &lsquo;<samp class="samp">none</samp>&rsquo;.
  54642. </p>
  54643. </dd>
  54644. <dt><samp class="option">input</samp></dt>
  54645. <dd><p>Set input formats for filter to pick from.
  54646. Can be &lsquo;<samp class="samp">all</samp>&rsquo;, for selecting from all available formats,
  54647. or &lsquo;<samp class="samp">first</samp>&rsquo;, for selecting first available format.
  54648. Default is &lsquo;<samp class="samp">first</samp>&rsquo;.
  54649. </p></dd>
  54650. </dl>
  54651. <a name="weave_002c-doubleweave"></a>
  54652. <h3 class="section">39.280 weave, doubleweave<span class="pull-right"><a class="anchor hidden-xs" href="#weave_002c-doubleweave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-weave_002c-doubleweave" aria-hidden="true">TOC</a></span></h3>
  54653. <p>The <code class="code">weave</code> takes a field-based video input and join
  54654. each two sequential fields into single frame, producing a new double
  54655. height clip with half the frame rate and half the frame count.
  54656. </p>
  54657. <p>The <code class="code">doubleweave</code> works same as <code class="code">weave</code> but without
  54658. halving frame rate and frame count.
  54659. </p>
  54660. <p>It accepts the following option:
  54661. </p>
  54662. <dl class="table">
  54663. <dt><samp class="option">first_field</samp></dt>
  54664. <dd><p>Set first field. Available values are:
  54665. </p>
  54666. <dl class="table">
  54667. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  54668. <dd><p>Set the frame as top-field-first.
  54669. </p>
  54670. </dd>
  54671. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  54672. <dd><p>Set the frame as bottom-field-first.
  54673. </p></dd>
  54674. </dl>
  54675. </dd>
  54676. </dl>
  54677. <a name="Examples-182"></a>
  54678. <h4 class="subsection">39.280.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-182" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-182" aria-hidden="true">TOC</a></span></h4>
  54679. <ul class="itemize mark-bullet">
  54680. <li>Interlace video using <a class="ref" href="#select">select</a> and <a class="ref" href="#separatefields">separatefields</a> filter:
  54681. <div class="example">
  54682. <pre class="example-preformatted">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  54683. </pre></div>
  54684. </li></ul>
  54685. <a name="xbr"></a>
  54686. <h3 class="section">39.281 xbr<span class="pull-right"><a class="anchor hidden-xs" href="#xbr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xbr" aria-hidden="true">TOC</a></span></h3>
  54687. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  54688. art. It follows a set of edge-detection rules, see
  54689. <a class="url" href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  54690. </p>
  54691. <p>It accepts the following option:
  54692. </p>
  54693. <dl class="table">
  54694. <dt><samp class="option">n</samp></dt>
  54695. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xBR</code>, <code class="code">3</code> for
  54696. <code class="code">3xBR</code> and <code class="code">4</code> for <code class="code">4xBR</code>.
  54697. Default is <code class="code">3</code>.
  54698. </p></dd>
  54699. </dl>
  54700. <a name="xcorrelate"></a>
  54701. <h3 class="section">39.282 xcorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#xcorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xcorrelate" aria-hidden="true">TOC</a></span></h3>
  54702. <p>Apply normalized cross-correlation between first and second input video stream.
  54703. </p>
  54704. <p>Second input video stream dimensions must be lower than first input video stream.
  54705. </p>
  54706. <p>The filter accepts the following options:
  54707. </p>
  54708. <dl class="table">
  54709. <dt><samp class="option">planes</samp></dt>
  54710. <dd><p>Set which planes to process.
  54711. </p>
  54712. </dd>
  54713. <dt><samp class="option">secondary</samp></dt>
  54714. <dd><p>Set which secondary video frames will be processed from second input video stream,
  54715. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  54716. </p></dd>
  54717. </dl>
  54718. <p>The <code class="code">xcorrelate</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  54719. </p>
  54720. <a name="xfade"></a>
  54721. <h3 class="section">39.283 xfade<span class="pull-right"><a class="anchor hidden-xs" href="#xfade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xfade" aria-hidden="true">TOC</a></span></h3>
  54722. <p>Apply cross fade from one input video stream to another input video stream.
  54723. The cross fade is applied for specified duration.
  54724. </p>
  54725. <p>Both inputs must be constant frame-rate and have the same resolution, pixel format,
  54726. frame rate and timebase.
  54727. </p>
  54728. <p>The filter accepts the following options:
  54729. </p>
  54730. <dl class="table">
  54731. <dt><samp class="option">transition</samp></dt>
  54732. <dd><p>Set one of available transition effects:
  54733. </p>
  54734. <dl class="table">
  54735. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  54736. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  54737. <dt>&lsquo;<samp class="samp">wipeleft</samp>&rsquo;</dt>
  54738. <dt>&lsquo;<samp class="samp">wiperight</samp>&rsquo;</dt>
  54739. <dt>&lsquo;<samp class="samp">wipeup</samp>&rsquo;</dt>
  54740. <dt>&lsquo;<samp class="samp">wipedown</samp>&rsquo;</dt>
  54741. <dt>&lsquo;<samp class="samp">slideleft</samp>&rsquo;</dt>
  54742. <dt>&lsquo;<samp class="samp">slideright</samp>&rsquo;</dt>
  54743. <dt>&lsquo;<samp class="samp">slideup</samp>&rsquo;</dt>
  54744. <dt>&lsquo;<samp class="samp">slidedown</samp>&rsquo;</dt>
  54745. <dt>&lsquo;<samp class="samp">circlecrop</samp>&rsquo;</dt>
  54746. <dt>&lsquo;<samp class="samp">rectcrop</samp>&rsquo;</dt>
  54747. <dt>&lsquo;<samp class="samp">distance</samp>&rsquo;</dt>
  54748. <dt>&lsquo;<samp class="samp">fadeblack</samp>&rsquo;</dt>
  54749. <dt>&lsquo;<samp class="samp">fadewhite</samp>&rsquo;</dt>
  54750. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  54751. <dt>&lsquo;<samp class="samp">smoothleft</samp>&rsquo;</dt>
  54752. <dt>&lsquo;<samp class="samp">smoothright</samp>&rsquo;</dt>
  54753. <dt>&lsquo;<samp class="samp">smoothup</samp>&rsquo;</dt>
  54754. <dt>&lsquo;<samp class="samp">smoothdown</samp>&rsquo;</dt>
  54755. <dt>&lsquo;<samp class="samp">circleopen</samp>&rsquo;</dt>
  54756. <dt>&lsquo;<samp class="samp">circleclose</samp>&rsquo;</dt>
  54757. <dt>&lsquo;<samp class="samp">vertopen</samp>&rsquo;</dt>
  54758. <dt>&lsquo;<samp class="samp">vertclose</samp>&rsquo;</dt>
  54759. <dt>&lsquo;<samp class="samp">horzopen</samp>&rsquo;</dt>
  54760. <dt>&lsquo;<samp class="samp">horzclose</samp>&rsquo;</dt>
  54761. <dt>&lsquo;<samp class="samp">dissolve</samp>&rsquo;</dt>
  54762. <dt>&lsquo;<samp class="samp">pixelize</samp>&rsquo;</dt>
  54763. <dt>&lsquo;<samp class="samp">diagtl</samp>&rsquo;</dt>
  54764. <dt>&lsquo;<samp class="samp">diagtr</samp>&rsquo;</dt>
  54765. <dt>&lsquo;<samp class="samp">diagbl</samp>&rsquo;</dt>
  54766. <dt>&lsquo;<samp class="samp">diagbr</samp>&rsquo;</dt>
  54767. <dt>&lsquo;<samp class="samp">hlslice</samp>&rsquo;</dt>
  54768. <dt>&lsquo;<samp class="samp">hrslice</samp>&rsquo;</dt>
  54769. <dt>&lsquo;<samp class="samp">vuslice</samp>&rsquo;</dt>
  54770. <dt>&lsquo;<samp class="samp">vdslice</samp>&rsquo;</dt>
  54771. <dt>&lsquo;<samp class="samp">hblur</samp>&rsquo;</dt>
  54772. <dt>&lsquo;<samp class="samp">fadegrays</samp>&rsquo;</dt>
  54773. <dt>&lsquo;<samp class="samp">wipetl</samp>&rsquo;</dt>
  54774. <dt>&lsquo;<samp class="samp">wipetr</samp>&rsquo;</dt>
  54775. <dt>&lsquo;<samp class="samp">wipebl</samp>&rsquo;</dt>
  54776. <dt>&lsquo;<samp class="samp">wipebr</samp>&rsquo;</dt>
  54777. <dt>&lsquo;<samp class="samp">squeezeh</samp>&rsquo;</dt>
  54778. <dt>&lsquo;<samp class="samp">squeezev</samp>&rsquo;</dt>
  54779. <dt>&lsquo;<samp class="samp">zoomin</samp>&rsquo;</dt>
  54780. <dt>&lsquo;<samp class="samp">fadefast</samp>&rsquo;</dt>
  54781. <dt>&lsquo;<samp class="samp">fadeslow</samp>&rsquo;</dt>
  54782. <dt>&lsquo;<samp class="samp">hlwind</samp>&rsquo;</dt>
  54783. <dt>&lsquo;<samp class="samp">hrwind</samp>&rsquo;</dt>
  54784. <dt>&lsquo;<samp class="samp">vuwind</samp>&rsquo;</dt>
  54785. <dt>&lsquo;<samp class="samp">vdwind</samp>&rsquo;</dt>
  54786. <dt>&lsquo;<samp class="samp">coverleft</samp>&rsquo;</dt>
  54787. <dt>&lsquo;<samp class="samp">coverright</samp>&rsquo;</dt>
  54788. <dt>&lsquo;<samp class="samp">coverup</samp>&rsquo;</dt>
  54789. <dt>&lsquo;<samp class="samp">coverdown</samp>&rsquo;</dt>
  54790. <dt>&lsquo;<samp class="samp">revealleft</samp>&rsquo;</dt>
  54791. <dt>&lsquo;<samp class="samp">revealright</samp>&rsquo;</dt>
  54792. <dt>&lsquo;<samp class="samp">revealup</samp>&rsquo;</dt>
  54793. <dt>&lsquo;<samp class="samp">revealdown</samp>&rsquo;</dt>
  54794. </dl>
  54795. <p>Default transition effect is fade.
  54796. </p>
  54797. </dd>
  54798. <dt><samp class="option">duration</samp></dt>
  54799. <dd><p>Set cross fade duration in seconds.
  54800. Range is 0 to 60 seconds.
  54801. Default duration is 1 second.
  54802. </p>
  54803. </dd>
  54804. <dt><samp class="option">offset</samp></dt>
  54805. <dd><p>Set cross fade start relative to first input stream in seconds.
  54806. Default offset is 0.
  54807. </p>
  54808. </dd>
  54809. <dt><samp class="option">expr</samp></dt>
  54810. <dd><p>Set expression for custom transition effect.
  54811. </p>
  54812. <p>The expressions can use the following variables and functions:
  54813. </p>
  54814. <dl class="table">
  54815. <dt><samp class="option">X</samp></dt>
  54816. <dt><samp class="option">Y</samp></dt>
  54817. <dd><p>The coordinates of the current sample.
  54818. </p>
  54819. </dd>
  54820. <dt><samp class="option">W</samp></dt>
  54821. <dt><samp class="option">H</samp></dt>
  54822. <dd><p>The width and height of the image.
  54823. </p>
  54824. </dd>
  54825. <dt><samp class="option">P</samp></dt>
  54826. <dd><p>Progress of transition effect.
  54827. </p>
  54828. </dd>
  54829. <dt><samp class="option">PLANE</samp></dt>
  54830. <dd><p>Currently processed plane.
  54831. </p>
  54832. </dd>
  54833. <dt><samp class="option">A</samp></dt>
  54834. <dd><p>Return value of first input at current location and plane.
  54835. </p>
  54836. </dd>
  54837. <dt><samp class="option">B</samp></dt>
  54838. <dd><p>Return value of second input at current location and plane.
  54839. </p>
  54840. </dd>
  54841. <dt><samp class="option">a0(x, y)</samp></dt>
  54842. <dt><samp class="option">a1(x, y)</samp></dt>
  54843. <dt><samp class="option">a2(x, y)</samp></dt>
  54844. <dt><samp class="option">a3(x, y)</samp></dt>
  54845. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  54846. first/second/third/fourth component of first input.
  54847. </p>
  54848. </dd>
  54849. <dt><samp class="option">b0(x, y)</samp></dt>
  54850. <dt><samp class="option">b1(x, y)</samp></dt>
  54851. <dt><samp class="option">b2(x, y)</samp></dt>
  54852. <dt><samp class="option">b3(x, y)</samp></dt>
  54853. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  54854. first/second/third/fourth component of second input.
  54855. </p></dd>
  54856. </dl>
  54857. </dd>
  54858. </dl>
  54859. <a name="Examples-183"></a>
  54860. <h4 class="subsection">39.283.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-183" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-183" aria-hidden="true">TOC</a></span></h4>
  54861. <ul class="itemize mark-bullet">
  54862. <li>Cross fade from one input video to another input video, with fade transition and duration of transition
  54863. of 2 seconds starting at offset of 5 seconds:
  54864. <div class="example">
  54865. <pre class="example-preformatted">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  54866. </pre></div>
  54867. </li></ul>
  54868. <a name="xmedian"></a>
  54869. <h3 class="section">39.284 xmedian<span class="pull-right"><a class="anchor hidden-xs" href="#xmedian" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xmedian" aria-hidden="true">TOC</a></span></h3>
  54870. <p>Pick median pixels from several input videos.
  54871. </p>
  54872. <p>The filter accepts the following options:
  54873. </p>
  54874. <dl class="table">
  54875. <dt><samp class="option">inputs</samp></dt>
  54876. <dd><p>Set number of inputs.
  54877. Default is 3. Allowed range is from 3 to 255.
  54878. If number of inputs is even number, than result will be mean value between two median values.
  54879. </p>
  54880. </dd>
  54881. <dt><samp class="option">planes</samp></dt>
  54882. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  54883. </p>
  54884. </dd>
  54885. <dt><samp class="option">percentile</samp></dt>
  54886. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  54887. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  54888. minimum values, and <code class="code">1</code> maximum values.
  54889. </p></dd>
  54890. </dl>
  54891. <a name="Commands-153"></a>
  54892. <h4 class="subsection">39.284.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-153" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-153" aria-hidden="true">TOC</a></span></h4>
  54893. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">inputs</code>.
  54894. </p>
  54895. <a class="anchor" id="xpsnr"></a><a name="xpsnr-1"></a>
  54896. <h3 class="section">39.285 xpsnr<span class="pull-right"><a class="anchor hidden-xs" href="#xpsnr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xpsnr-1" aria-hidden="true">TOC</a></span></h3>
  54897. <p>Obtain the average (across all input frames) and minimum (across all color plane averages)
  54898. eXtended Perceptually weighted peak Signal-to-Noise Ratio (XPSNR) between two input videos.
  54899. </p>
  54900. <p>The XPSNR is a low-complexity psychovisually motivated distortion measurement algorithm for
  54901. assessing the difference between two video streams or images. This is especially useful for
  54902. objectively quantifying the distortions caused by video and image codecs, as an alternative
  54903. to a formal subjective test. The logarithmic XPSNR output values are in a similar range as
  54904. those of traditional <a class="ref" href="#psnr">psnr</a> assessments but better reflect human impressions of visual
  54905. coding quality. More details on the XPSNR measure, which essentially represents a blockwise
  54906. weighted variant of the PSNR measure, can be found in the following freely available papers:
  54907. </p>
  54908. <ul class="itemize mark-bullet">
  54909. <li>C. R. Helmrich, M. Siekmann, S. Becker, S. Bosse, D. Marpe, and T. Wiegand, &quot;XPSNR: A
  54910. Low-Complexity Extension of the Perceptually Weighted Peak Signal-to-Noise Ratio for
  54911. High-Resolution Video Quality Assessment,&quot; in Proc. IEEE Int. Conf. Acoustics, Speech,
  54912. Sig. Process. (ICASSP), virt./online, May 2020. <a class="url" href="www.ecodis.de/xpsnr.htm">www.ecodis.de/xpsnr.htm</a>
  54913. </li><li>C. R. Helmrich, S. Bosse, H. Schwarz, D. Marpe, and T. Wiegand, &quot;A Study of the
  54914. Extended Perceptually Weighted Peak Signal-to-Noise Ratio (XPSNR) for Video Compression
  54915. with Different Resolutions and Bit Depths,&quot; ITU Journal: ICT Discoveries, vol. 3, no.
  54916. 1, pp. 65 - 72, May 2020. <a class="url" href="http://handle.itu.int/11.1002/pub/8153d78b-en">http://handle.itu.int/11.1002/pub/8153d78b-en</a>
  54917. </li></ul>
  54918. <p>When publishing the results of XPSNR assessments obtained using, e.g., this FFmpeg filter, a
  54919. reference to the above papers as a means of documentation is strongly encouraged. The filter
  54920. requires two input videos. The first input is considered a (usually not distorted) reference
  54921. source and is passed unchanged to the output, whereas the second input is a (distorted) test
  54922. signal. Except for the bit depth, these two video inputs must have the same pixel format. In
  54923. addition, for best performance, both compared input videos should be in YCbCr color format.
  54924. </p>
  54925. <p>The obtained overall XPSNR values mentioned above are printed through the logging system. In
  54926. case of input with multiple color planes, we suggest reporting of the minimum XPSNR average.
  54927. </p>
  54928. <p>The following parameter, which behaves like the one for the <a class="ref" href="#psnr">psnr</a> filter, is accepted:
  54929. </p>
  54930. <dl class="table">
  54931. <dt><samp class="option">stats_file, f</samp></dt>
  54932. <dd><p>If specified, the filter will use the named file to save the XPSNR value of each individual
  54933. frame and color plane. When the file name equals &quot;-&quot;, that data is sent to standard output.
  54934. </p></dd>
  54935. </dl>
  54936. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  54937. </p>
  54938. <a name="Examples-184"></a>
  54939. <h4 class="subsection">39.285.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-184" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-184" aria-hidden="true">TOC</a></span></h4>
  54940. <ul class="itemize mark-bullet">
  54941. <li>XPSNR analysis of two 1080p HD videos, ref_source.yuv and test_video.yuv, both at 24 frames
  54942. per second, with color format 4:2:0, bit depth 8, and output of a logfile named &quot;xpsnr.log&quot;:
  54943. <div class="example">
  54944. <pre class="example-preformatted">ffmpeg -s 1920x1080 -framerate 24 -pix_fmt yuv420p -i ref_source.yuv -s 1920x1080 -framerate
  54945. 24 -pix_fmt yuv420p -i test_video.yuv -lavfi xpsnr=&quot;stats_file=xpsnr.log&quot; -f null -
  54946. </pre></div>
  54947. </li><li>XPSNR analysis of two 2160p UHD videos, ref_source.yuv with bit depth 8 and test_video.yuv
  54948. with bit depth 10, both at 60 frames per second with color format 4:2:0, no logfile output:
  54949. <div class="example">
  54950. <pre class="example-preformatted">ffmpeg -s 3840x2160 -framerate 60 -pix_fmt yuv420p -i ref_source.yuv -s 3840x2160 -framerate
  54951. 60 -pix_fmt yuv420p10le -i test_video.yuv -lavfi xpsnr=&quot;stats_file=-&quot; -f null -
  54952. </pre></div>
  54953. </li></ul>
  54954. <a class="anchor" id="xstack"></a><a name="xstack-1"></a>
  54955. <h3 class="section">39.286 xstack<span class="pull-right"><a class="anchor hidden-xs" href="#xstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack-1" aria-hidden="true">TOC</a></span></h3>
  54956. <p>Stack video inputs into custom layout.
  54957. </p>
  54958. <p>All streams must be of same pixel format.
  54959. </p>
  54960. <p>The filter accepts the following options:
  54961. </p>
  54962. <dl class="table">
  54963. <dt><samp class="option">inputs</samp></dt>
  54964. <dd><p>Set number of input streams. Default is 2.
  54965. </p>
  54966. </dd>
  54967. <dt><samp class="option">layout</samp></dt>
  54968. <dd><p>Specify layout of inputs.
  54969. This option requires the desired layout configuration to be explicitly set by the user.
  54970. This sets position of each video input in output. Each input
  54971. is separated by &rsquo;|&rsquo;.
  54972. The first number represents the column, and the second number represents the row.
  54973. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  54974. where X is video input from which to take width or height.
  54975. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  54976. case values are summed together.
  54977. </p>
  54978. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  54979. the output video frame will be filled. Similarly, videos can overlap each
  54980. other if their position doesn&rsquo;t leave enough space for the full frame of
  54981. adjoining videos.
  54982. </p>
  54983. <p>For 2 inputs, a default layout of <code class="code">0_0|w0_0</code> (equivalent to
  54984. <code class="code">grid=2x1</code>) is set. In all other cases, a layout or a grid must be set by
  54985. the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  54986. Specifying both will result in an error.
  54987. </p>
  54988. </dd>
  54989. <dt><samp class="option">grid</samp></dt>
  54990. <dd><p>Specify a fixed size grid of inputs.
  54991. This option is used to create a fixed size grid of the input streams. Set the
  54992. grid size in the form <code class="code">COLUMNSxROWS</code>. There must be <code class="code">ROWS * COLUMNS</code>
  54993. input streams and they will be arranged as a grid with <code class="code">ROWS</code> rows and
  54994. <code class="code">COLUMNS</code> columns. When using this option, each input stream within a row
  54995. must have the same height and all the rows must have the same width.
  54996. </p>
  54997. <p>If <code class="code">grid</code> is set, then <code class="code">inputs</code> option is ignored and is implicitly
  54998. set to <code class="code">ROWS * COLUMNS</code>.
  54999. </p>
  55000. <p>For 2 inputs, a default grid of <code class="code">2x1</code> (equivalent to
  55001. <code class="code">layout=0_0|w0_0</code>) is set. In all other cases, a layout or a grid must be
  55002. set by the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  55003. Specifying both will result in an error.
  55004. </p>
  55005. </dd>
  55006. <dt><samp class="option">shortest</samp></dt>
  55007. <dd><p>If set to 1, force the output to terminate when the shortest input
  55008. terminates. Default value is 0.
  55009. </p>
  55010. </dd>
  55011. <dt><samp class="option">fill</samp></dt>
  55012. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  55013. By default fill is set to none, so it is disabled.
  55014. </p></dd>
  55015. </dl>
  55016. <a name="Examples-185"></a>
  55017. <h4 class="subsection">39.286.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-185" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-185" aria-hidden="true">TOC</a></span></h4>
  55018. <ul class="itemize mark-bullet">
  55019. <li>Display 4 inputs into 2x2 grid.
  55020. <p>Layout:
  55021. </p><div class="example">
  55022. <pre class="example-preformatted">input1(0, 0) | input3(w0, 0)
  55023. input2(0, h0) | input4(w0, h0)
  55024. </pre></div>
  55025. <div class="example">
  55026. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  55027. </pre></div>
  55028. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  55029. </p>
  55030. </li><li>Display 4 inputs into 1x4 grid.
  55031. <p>Layout:
  55032. </p><div class="example">
  55033. <pre class="example-preformatted">input1(0, 0)
  55034. input2(0, h0)
  55035. input3(0, h0+h1)
  55036. input4(0, h0+h1+h2)
  55037. </pre></div>
  55038. <div class="example">
  55039. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  55040. </pre></div>
  55041. <p>Note that if inputs are of different widths, unused space will appear.
  55042. </p>
  55043. </li><li>Display 9 inputs into 3x3 grid.
  55044. <p>Layout:
  55045. </p><div class="example">
  55046. <pre class="example-preformatted">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  55047. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  55048. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  55049. </pre></div>
  55050. <div class="example">
  55051. <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
  55052. </pre></div>
  55053. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  55054. </p>
  55055. </li><li>Display 16 inputs into 4x4 grid.
  55056. <p>Layout:
  55057. </p><div class="example">
  55058. <pre class="example-preformatted">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  55059. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  55060. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  55061. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  55062. </pre></div>
  55063. <div class="example">
  55064. <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|
  55065. 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
  55066. </pre></div>
  55067. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  55068. </p>
  55069. </li></ul>
  55070. <a class="anchor" id="yadif"></a><a name="yadif-1"></a>
  55071. <h3 class="section">39.287 yadif<span class="pull-right"><a class="anchor hidden-xs" href="#yadif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif-1" aria-hidden="true">TOC</a></span></h3>
  55072. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  55073. filter&quot;).
  55074. </p>
  55075. <p>It accepts the following parameters:
  55076. </p>
  55077. <dl class="table">
  55078. <dt><samp class="option">mode</samp></dt>
  55079. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  55080. </p>
  55081. <dl class="table">
  55082. <dt><samp class="option">0, send_frame</samp></dt>
  55083. <dd><p>Output one frame for each frame.
  55084. </p></dd>
  55085. <dt><samp class="option">1, send_field</samp></dt>
  55086. <dd><p>Output one frame for each field.
  55087. </p></dd>
  55088. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  55089. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  55090. </p></dd>
  55091. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  55092. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  55093. </p></dd>
  55094. </dl>
  55095. <p>The default value is <code class="code">send_frame</code>.
  55096. </p>
  55097. </dd>
  55098. <dt><samp class="option">parity</samp></dt>
  55099. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  55100. of the following values:
  55101. </p>
  55102. <dl class="table">
  55103. <dt><samp class="option">0, tff</samp></dt>
  55104. <dd><p>Assume the top field is first.
  55105. </p></dd>
  55106. <dt><samp class="option">1, bff</samp></dt>
  55107. <dd><p>Assume the bottom field is first.
  55108. </p></dd>
  55109. <dt><samp class="option">-1, auto</samp></dt>
  55110. <dd><p>Enable automatic detection of field parity.
  55111. </p></dd>
  55112. </dl>
  55113. <p>The default value is <code class="code">auto</code>.
  55114. If the interlacing is unknown or the decoder does not export this information,
  55115. top field first will be assumed.
  55116. </p>
  55117. </dd>
  55118. <dt><samp class="option">deint</samp></dt>
  55119. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  55120. values:
  55121. </p>
  55122. <dl class="table">
  55123. <dt><samp class="option">0, all</samp></dt>
  55124. <dd><p>Deinterlace all frames.
  55125. </p></dd>
  55126. <dt><samp class="option">1, interlaced</samp></dt>
  55127. <dd><p>Only deinterlace frames marked as interlaced.
  55128. </p></dd>
  55129. </dl>
  55130. <p>The default value is <code class="code">all</code>.
  55131. </p></dd>
  55132. </dl>
  55133. <a name="yaepblur"></a>
  55134. <h3 class="section">39.288 yaepblur<span class="pull-right"><a class="anchor hidden-xs" href="#yaepblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yaepblur" aria-hidden="true">TOC</a></span></h3>
  55135. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  55136. The algorithm is described in
  55137. &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;
  55138. </p>
  55139. <p>It accepts the following parameters:
  55140. </p>
  55141. <dl class="table">
  55142. <dt><samp class="option">radius, r</samp></dt>
  55143. <dd><p>Set the window radius. Default value is 3.
  55144. </p>
  55145. </dd>
  55146. <dt><samp class="option">planes, p</samp></dt>
  55147. <dd><p>Set which planes to filter. Default is only the first plane.
  55148. </p>
  55149. </dd>
  55150. <dt><samp class="option">sigma, s</samp></dt>
  55151. <dd><p>Set blur strength. Default value is 128.
  55152. </p></dd>
  55153. </dl>
  55154. <a name="Commands-154"></a>
  55155. <h4 class="subsection">39.288.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-154" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-154" aria-hidden="true">TOC</a></span></h4>
  55156. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  55157. </p>
  55158. <a name="zoompan"></a>
  55159. <h3 class="section">39.289 zoompan<span class="pull-right"><a class="anchor hidden-xs" href="#zoompan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zoompan" aria-hidden="true">TOC</a></span></h3>
  55160. <p>Apply Zoom &amp; Pan effect.
  55161. </p>
  55162. <p>This filter accepts the following options:
  55163. </p>
  55164. <dl class="table">
  55165. <dt><samp class="option">zoom, z</samp></dt>
  55166. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  55167. </p>
  55168. </dd>
  55169. <dt><samp class="option">x</samp></dt>
  55170. <dt><samp class="option">y</samp></dt>
  55171. <dd><p>Set the x and y expression. Default is 0.
  55172. </p>
  55173. </dd>
  55174. <dt><samp class="option">d</samp></dt>
  55175. <dd><p>Set the duration expression in number of frames.
  55176. This sets for how many number of frames effect will last for
  55177. single input image. Default is 90.
  55178. </p>
  55179. </dd>
  55180. <dt><samp class="option">s</samp></dt>
  55181. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  55182. </p>
  55183. </dd>
  55184. <dt><samp class="option">fps</samp></dt>
  55185. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  55186. </p></dd>
  55187. </dl>
  55188. <p>Each expression can contain the following constants:
  55189. </p>
  55190. <dl class="table">
  55191. <dt><samp class="option">in_w, iw</samp></dt>
  55192. <dd><p>Input width.
  55193. </p>
  55194. </dd>
  55195. <dt><samp class="option">in_h, ih</samp></dt>
  55196. <dd><p>Input height.
  55197. </p>
  55198. </dd>
  55199. <dt><samp class="option">out_w, ow</samp></dt>
  55200. <dd><p>Output width.
  55201. </p>
  55202. </dd>
  55203. <dt><samp class="option">out_h, oh</samp></dt>
  55204. <dd><p>Output height.
  55205. </p>
  55206. </dd>
  55207. <dt><samp class="option">in</samp></dt>
  55208. <dd><p>Input frame count.
  55209. </p>
  55210. </dd>
  55211. <dt><samp class="option">on</samp></dt>
  55212. <dd><p>Output frame count.
  55213. </p>
  55214. </dd>
  55215. <dt><samp class="option">in_time, it</samp></dt>
  55216. <dd><p>The input timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  55217. </p>
  55218. </dd>
  55219. <dt><samp class="option">out_time, time, ot</samp></dt>
  55220. <dd><p>The output timestamp expressed in seconds.
  55221. </p>
  55222. </dd>
  55223. <dt><samp class="option">x</samp></dt>
  55224. <dt><samp class="option">y</samp></dt>
  55225. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  55226. for current input frame.
  55227. </p>
  55228. </dd>
  55229. <dt><samp class="option">px</samp></dt>
  55230. <dt><samp class="option">py</samp></dt>
  55231. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  55232. not yet such frame (first input frame).
  55233. </p>
  55234. </dd>
  55235. <dt><samp class="option">zoom</samp></dt>
  55236. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  55237. </p>
  55238. </dd>
  55239. <dt><samp class="option">pzoom</samp></dt>
  55240. <dd><p>Last calculated zoom of last output frame of previous input frame.
  55241. </p>
  55242. </dd>
  55243. <dt><samp class="option">duration</samp></dt>
  55244. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  55245. for each input frame.
  55246. </p>
  55247. </dd>
  55248. <dt><samp class="option">pduration</samp></dt>
  55249. <dd><p>number of output frames created for previous input frame
  55250. </p>
  55251. </dd>
  55252. <dt><samp class="option">a</samp></dt>
  55253. <dd><p>Rational number: input width / input height
  55254. </p>
  55255. </dd>
  55256. <dt><samp class="option">sar</samp></dt>
  55257. <dd><p>sample aspect ratio
  55258. </p>
  55259. </dd>
  55260. <dt><samp class="option">dar</samp></dt>
  55261. <dd><p>display aspect ratio
  55262. </p>
  55263. </dd>
  55264. </dl>
  55265. <a name="Examples-186"></a>
  55266. <h4 class="subsection">39.289.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-186" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-186" aria-hidden="true">TOC</a></span></h4>
  55267. <ul class="itemize mark-bullet">
  55268. <li>Zoom in up to 1.5x and pan at same time to some spot near center of picture:
  55269. <div class="example">
  55270. <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
  55271. </pre></div>
  55272. </li><li>Zoom in up to 1.5x and pan always at center of picture:
  55273. <div class="example">
  55274. <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)'
  55275. </pre></div>
  55276. </li><li>Same as above but without pausing:
  55277. <div class="example">
  55278. <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)'
  55279. </pre></div>
  55280. </li><li>Zoom in 2x into center of picture only for the first second of the input video:
  55281. <div class="example">
  55282. <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)'
  55283. </pre></div>
  55284. </li></ul>
  55285. <a class="anchor" id="zscale"></a><a name="zscale-1"></a>
  55286. <h3 class="section">39.290 zscale<span class="pull-right"><a class="anchor hidden-xs" href="#zscale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zscale-1" aria-hidden="true">TOC</a></span></h3>
  55287. <p>Scale (resize) the input video, using the z.lib library:
  55288. <a class="url" href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  55289. filter, you need to configure FFmpeg with <code class="code">--enable-libzimg</code>.
  55290. </p>
  55291. <p>The zscale filter forces the output display aspect ratio to be the same
  55292. as the input, by changing the output sample aspect ratio.
  55293. </p>
  55294. <p>If the input image format is different from the format requested by
  55295. the next filter, the zscale filter will convert the input to the
  55296. requested format.
  55297. </p>
  55298. <a name="Options-125"></a>
  55299. <h4 class="subsection">39.290.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-125" aria-hidden="true">TOC</a></span></h4>
  55300. <p>The filter accepts the following options.
  55301. </p>
  55302. <dl class="table">
  55303. <dt><samp class="option">width, w</samp></dt>
  55304. <dt><samp class="option">height, h</samp></dt>
  55305. <dd><p>Set the output video dimension expression. Default value is the input
  55306. dimension.
  55307. </p>
  55308. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  55309. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  55310. is used for the output.
  55311. </p>
  55312. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  55313. will use a value that maintains the aspect ratio of the input image,
  55314. calculated from the other specified dimension. After that it will,
  55315. however, make sure that the calculated dimension is divisible by n and
  55316. adjust the value if necessary.
  55317. </p>
  55318. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  55319. both values being set to 0 as previously detailed.
  55320. </p>
  55321. <p>See below for the list of accepted constants for use in the dimension
  55322. expression.
  55323. </p>
  55324. </dd>
  55325. <dt><samp class="option">size, s</samp></dt>
  55326. <dd><p>Set the video size. For the syntax of this option, check the
  55327. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  55328. </p>
  55329. </dd>
  55330. <dt><samp class="option">dither, d</samp></dt>
  55331. <dd><p>Set the dither type.
  55332. </p>
  55333. <p>Possible values are:
  55334. </p><dl class="table">
  55335. <dt><var class="var">none</var></dt>
  55336. <dt><var class="var">ordered</var></dt>
  55337. <dt><var class="var">random</var></dt>
  55338. <dt><var class="var">error_diffusion</var></dt>
  55339. </dl>
  55340. <p>Default is none.
  55341. </p>
  55342. </dd>
  55343. <dt><samp class="option">filter, f</samp></dt>
  55344. <dd><p>Set the resize filter type.
  55345. </p>
  55346. <p>Possible values are:
  55347. </p><dl class="table">
  55348. <dt><var class="var">point</var></dt>
  55349. <dt><var class="var">bilinear</var></dt>
  55350. <dt><var class="var">bicubic</var></dt>
  55351. <dt><var class="var">spline16</var></dt>
  55352. <dt><var class="var">spline36</var></dt>
  55353. <dt><var class="var">spline64</var></dt>
  55354. <dt><var class="var">lanczos</var></dt>
  55355. </dl>
  55356. <p>Default is bilinear.
  55357. </p>
  55358. </dd>
  55359. <dt><samp class="option">range, r</samp></dt>
  55360. <dd><p>Set the color range.
  55361. </p>
  55362. <p>Possible values are:
  55363. </p><dl class="table">
  55364. <dt><var class="var">input</var></dt>
  55365. <dt><var class="var">limited</var></dt>
  55366. <dt><var class="var">full</var></dt>
  55367. </dl>
  55368. <p>Default is same as input.
  55369. </p>
  55370. </dd>
  55371. <dt><samp class="option">primaries, p</samp></dt>
  55372. <dd><p>Set the color primaries.
  55373. </p>
  55374. <p>Possible values are:
  55375. </p><dl class="table">
  55376. <dt><var class="var">input</var></dt>
  55377. <dt><var class="var">709</var></dt>
  55378. <dt><var class="var">unspecified</var></dt>
  55379. <dt><var class="var">170m</var></dt>
  55380. <dt><var class="var">240m</var></dt>
  55381. <dt><var class="var">2020</var></dt>
  55382. </dl>
  55383. <p>Default is same as input.
  55384. </p>
  55385. </dd>
  55386. <dt><samp class="option">transfer, t</samp></dt>
  55387. <dd><p>Set the transfer characteristics.
  55388. </p>
  55389. <p>Possible values are:
  55390. </p><dl class="table">
  55391. <dt><var class="var">input</var></dt>
  55392. <dt><var class="var">709</var></dt>
  55393. <dt><var class="var">unspecified</var></dt>
  55394. <dt><var class="var">601</var></dt>
  55395. <dt><var class="var">linear</var></dt>
  55396. <dt><var class="var">2020_10</var></dt>
  55397. <dt><var class="var">2020_12</var></dt>
  55398. <dt><var class="var">smpte2084</var></dt>
  55399. <dt><var class="var">iec61966-2-1</var></dt>
  55400. <dt><var class="var">arib-std-b67</var></dt>
  55401. </dl>
  55402. <p>Default is same as input.
  55403. </p>
  55404. </dd>
  55405. <dt><samp class="option">matrix, m</samp></dt>
  55406. <dd><p>Set the colorspace matrix.
  55407. </p>
  55408. <p>Possible value are:
  55409. </p><dl class="table">
  55410. <dt><var class="var">input</var></dt>
  55411. <dt><var class="var">709</var></dt>
  55412. <dt><var class="var">unspecified</var></dt>
  55413. <dt><var class="var">470bg</var></dt>
  55414. <dt><var class="var">170m</var></dt>
  55415. <dt><var class="var">2020_ncl</var></dt>
  55416. <dt><var class="var">2020_cl</var></dt>
  55417. </dl>
  55418. <p>Default is same as input.
  55419. </p>
  55420. </dd>
  55421. <dt><samp class="option">rangein, rin</samp></dt>
  55422. <dd><p>Set the input color range.
  55423. </p>
  55424. <p>Possible values are:
  55425. </p><dl class="table">
  55426. <dt><var class="var">input</var></dt>
  55427. <dt><var class="var">limited</var></dt>
  55428. <dt><var class="var">full</var></dt>
  55429. </dl>
  55430. <p>Default is same as input.
  55431. </p>
  55432. </dd>
  55433. <dt><samp class="option">primariesin, pin</samp></dt>
  55434. <dd><p>Set the input color primaries.
  55435. </p>
  55436. <p>Possible values are:
  55437. </p><dl class="table">
  55438. <dt><var class="var">input</var></dt>
  55439. <dt><var class="var">709</var></dt>
  55440. <dt><var class="var">unspecified</var></dt>
  55441. <dt><var class="var">170m</var></dt>
  55442. <dt><var class="var">240m</var></dt>
  55443. <dt><var class="var">2020</var></dt>
  55444. </dl>
  55445. <p>Default is same as input.
  55446. </p>
  55447. </dd>
  55448. <dt><samp class="option">transferin, tin</samp></dt>
  55449. <dd><p>Set the input transfer characteristics.
  55450. </p>
  55451. <p>Possible values are:
  55452. </p><dl class="table">
  55453. <dt><var class="var">input</var></dt>
  55454. <dt><var class="var">709</var></dt>
  55455. <dt><var class="var">unspecified</var></dt>
  55456. <dt><var class="var">601</var></dt>
  55457. <dt><var class="var">linear</var></dt>
  55458. <dt><var class="var">2020_10</var></dt>
  55459. <dt><var class="var">2020_12</var></dt>
  55460. </dl>
  55461. <p>Default is same as input.
  55462. </p>
  55463. </dd>
  55464. <dt><samp class="option">matrixin, min</samp></dt>
  55465. <dd><p>Set the input colorspace matrix.
  55466. </p>
  55467. <p>Possible value are:
  55468. </p><dl class="table">
  55469. <dt><var class="var">input</var></dt>
  55470. <dt><var class="var">709</var></dt>
  55471. <dt><var class="var">unspecified</var></dt>
  55472. <dt><var class="var">470bg</var></dt>
  55473. <dt><var class="var">170m</var></dt>
  55474. <dt><var class="var">2020_ncl</var></dt>
  55475. <dt><var class="var">2020_cl</var></dt>
  55476. </dl>
  55477. </dd>
  55478. <dt><samp class="option">chromal, c</samp></dt>
  55479. <dd><p>Set the output chroma location.
  55480. </p>
  55481. <p>Possible values are:
  55482. </p><dl class="table">
  55483. <dt><var class="var">input</var></dt>
  55484. <dt><var class="var">left</var></dt>
  55485. <dt><var class="var">center</var></dt>
  55486. <dt><var class="var">topleft</var></dt>
  55487. <dt><var class="var">top</var></dt>
  55488. <dt><var class="var">bottomleft</var></dt>
  55489. <dt><var class="var">bottom</var></dt>
  55490. </dl>
  55491. </dd>
  55492. <dt><samp class="option">chromalin, cin</samp></dt>
  55493. <dd><p>Set the input chroma location.
  55494. </p>
  55495. <p>Possible values are:
  55496. </p><dl class="table">
  55497. <dt><var class="var">input</var></dt>
  55498. <dt><var class="var">left</var></dt>
  55499. <dt><var class="var">center</var></dt>
  55500. <dt><var class="var">topleft</var></dt>
  55501. <dt><var class="var">top</var></dt>
  55502. <dt><var class="var">bottomleft</var></dt>
  55503. <dt><var class="var">bottom</var></dt>
  55504. </dl>
  55505. </dd>
  55506. <dt><samp class="option">npl</samp></dt>
  55507. <dd><p>Set the nominal peak luminance.
  55508. </p>
  55509. </dd>
  55510. <dt><samp class="option">param_a</samp></dt>
  55511. <dd><p>Parameter A for scaling filters. Parameter &quot;b&quot; for bicubic, and the number of
  55512. filter taps for lanczos.
  55513. </p>
  55514. </dd>
  55515. <dt><samp class="option">param_b</samp></dt>
  55516. <dd><p>Parameter B for scaling filters. Parameter &quot;c&quot; for bicubic.
  55517. </p></dd>
  55518. </dl>
  55519. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  55520. containing the following constants:
  55521. </p>
  55522. <dl class="table">
  55523. <dt><var class="var">in_w</var></dt>
  55524. <dt><var class="var">in_h</var></dt>
  55525. <dd><p>The input width and height
  55526. </p>
  55527. </dd>
  55528. <dt><var class="var">iw</var></dt>
  55529. <dt><var class="var">ih</var></dt>
  55530. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  55531. </p>
  55532. </dd>
  55533. <dt><var class="var">out_w</var></dt>
  55534. <dt><var class="var">out_h</var></dt>
  55535. <dd><p>The output (scaled) width and height
  55536. </p>
  55537. </dd>
  55538. <dt><var class="var">ow</var></dt>
  55539. <dt><var class="var">oh</var></dt>
  55540. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  55541. </p>
  55542. </dd>
  55543. <dt><var class="var">a</var></dt>
  55544. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  55545. </p>
  55546. </dd>
  55547. <dt><var class="var">sar</var></dt>
  55548. <dd><p>input sample aspect ratio
  55549. </p>
  55550. </dd>
  55551. <dt><var class="var">dar</var></dt>
  55552. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  55553. </p>
  55554. </dd>
  55555. <dt><var class="var">hsub</var></dt>
  55556. <dt><var class="var">vsub</var></dt>
  55557. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  55558. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  55559. </p>
  55560. </dd>
  55561. <dt><var class="var">ohsub</var></dt>
  55562. <dt><var class="var">ovsub</var></dt>
  55563. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  55564. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  55565. </p></dd>
  55566. </dl>
  55567. <a name="Commands-155"></a>
  55568. <h4 class="subsection">39.290.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-155" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-155" aria-hidden="true">TOC</a></span></h4>
  55569. <p>This filter supports the following commands:
  55570. </p><dl class="table">
  55571. <dt><samp class="option">width, w</samp></dt>
  55572. <dt><samp class="option">height, h</samp></dt>
  55573. <dd><p>Set the output video dimension expression.
  55574. The command accepts the same syntax of the corresponding option.
  55575. </p>
  55576. <p>If the specified expression is not valid, it is kept at its current
  55577. value.
  55578. </p></dd>
  55579. </dl>
  55580. <a name="CUDA-Video-Filters"></a>
  55581. <h2 class="chapter">40 CUDA Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  55582. <p>To enable CUDA and/or NPP filters please refer to configuration guidelines for <a class="ref" href="#CUDA">CUDA</a> and for <a class="ref" href="#CUDA-NPP">CUDA NPP</a> filters.
  55583. </p>
  55584. <p>Running CUDA filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  55585. </p><dl class="table">
  55586. <dt><samp class="option">-init_hw_device cuda[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  55587. <dd><p>Initialise a new hardware device of type <var class="var">cuda</var> called <var class="var">name</var>, using the
  55588. given device parameters.
  55589. </p>
  55590. </dd>
  55591. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  55592. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  55593. </p>
  55594. </dd>
  55595. </dl>
  55596. <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>
  55597. </p>
  55598. <ul class="itemize mark-bullet">
  55599. <li>Example of initializing second CUDA device on the system and running scale_cuda and bilateral_cuda filters.
  55600. <div class="example">
  55601. <pre class="example-preformatted">./ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -init_hw_device cuda:1 -filter_complex \
  55602. &quot;[0:v]scale_cuda=format=yuv444p[scaled_video];[scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0&quot; \
  55603. -an -sn -c:v h264_nvenc -cq 20 out.mp4
  55604. </pre></div>
  55605. </li></ul>
  55606. <p>Since CUDA filters operate exclusively on GPU memory, frame data must sometimes be uploaded (<a class="ref" href="#hwupload">hwupload</a>) to hardware surfaces associated with the appropriate CUDA device before processing, and downloaded (<a class="ref" href="#hwdownload">hwdownload</a>) back to normal memory afterward, if required. Whether <a class="ref" href="#hwupload">hwupload</a> or <a class="ref" href="#hwdownload">hwdownload</a> is necessary depends on the specific workflow:
  55607. </p>
  55608. <ul class="itemize mark-bullet">
  55609. <li>If the input frames are already in GPU memory (e.g., when using <code class="code">-hwaccel cuda</code> or <code class="code">-hwaccel_output_format cuda</code>), explicit use of <a class="ref" href="#hwupload">hwupload</a> is not needed, as the data is already in the appropriate memory space.
  55610. </li><li>If the input frames are in CPU memory (e.g., software-decoded frames or frames processed by CPU-based filters), it is necessary to use <a class="ref" href="#hwupload">hwupload</a> to transfer the data to GPU memory for CUDA processing.
  55611. </li><li>If the output of the CUDA filters needs to be further processed by software-based filters or saved in a format not supported by GPU-based encoders, <a class="ref" href="#hwdownload">hwdownload</a> is required to transfer the data back to CPU memory.
  55612. </li></ul>
  55613. <p>Note that <a class="ref" href="#hwupload">hwupload</a> uploads data to a surface with the same layout as the software frame, so it may be necessary to add a <a class="ref" href="#format">format</a> filter immediately before <a class="ref" href="#hwupload">hwupload</a> to ensure the input is in the correct format. Similarly, <a class="ref" href="#hwdownload">hwdownload</a> may not support all output formats, so an additional <a class="ref" href="#format">format</a> filter may need to be inserted immediately after <a class="ref" href="#hwdownload">hwdownload</a> in the filter graph to ensure compatibility.
  55614. </p>
  55615. <a class="anchor" id="CUDA"></a><a name="CUDA-1"></a>
  55616. <h3 class="section">40.1 CUDA<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-1" aria-hidden="true">TOC</a></span></h3>
  55617. <p>Below is a description of the currently available Nvidia CUDA video filters.
  55618. </p>
  55619. <p>Prerequisites:
  55620. </p><ul class="itemize mark-bullet">
  55621. <li>Install Nvidia CUDA Toolkit
  55622. </li></ul>
  55623. <p>Note: If FFmpeg detects the Nvidia CUDA Toolkit during configuration, it will enable CUDA filters automatically without requiring any additional flags. If you want to explicitly enable them, use the following options:
  55624. </p>
  55625. <ul class="itemize mark-bullet">
  55626. <li>Configure FFmpeg with <code class="code">--enable-cuda-nvcc --enable-nonfree</code>.
  55627. </li><li>Configure FFmpeg with <code class="code">--enable-cuda-llvm</code>. Additional requirement: <code class="code">llvm</code> lib must be installed.
  55628. </li></ul>
  55629. <a name="bilateral_005fcuda"></a>
  55630. <h4 class="subsection">40.1.1 bilateral_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#bilateral_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bilateral_005fcuda" aria-hidden="true">TOC</a></span></h4>
  55631. <p>CUDA accelerated bilateral filter, an edge preserving filter.
  55632. This filter is mathematically accurate thanks to the use of GPU acceleration.
  55633. For best output quality, use one to one chroma subsampling, i.e. yuv444p format.
  55634. </p>
  55635. <p>The filter accepts the following options:
  55636. </p><dl class="table">
  55637. <dt><samp class="option">sigmaS</samp></dt>
  55638. <dd><p>Set sigma of gaussian function to calculate spatial weight, also called sigma space.
  55639. Allowed range is 0.1 to 512. Default is 0.1.
  55640. </p>
  55641. </dd>
  55642. <dt><samp class="option">sigmaR</samp></dt>
  55643. <dd><p>Set sigma of gaussian function to calculate color range weight, also called sigma color.
  55644. Allowed range is 0.1 to 512. Default is 0.1.
  55645. </p>
  55646. </dd>
  55647. <dt><samp class="option">window_size</samp></dt>
  55648. <dd><p>Set window size of the bilateral function to determine the number of neighbours to loop on.
  55649. If the number entered is even, one will be added automatically.
  55650. Allowed range is 1 to 255. Default is 1.
  55651. </p></dd>
  55652. </dl>
  55653. <a name="Examples-187"></a>
  55654. <h4 class="subsubsection">40.1.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-187" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-187" aria-hidden="true">TOC</a></span></h4>
  55655. <ul class="itemize mark-bullet">
  55656. <li>Apply the bilateral filter on a video.
  55657. <div class="example">
  55658. <pre class="example-preformatted">./ffmpeg -v verbose \
  55659. -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 \
  55660. -init_hw_device cuda \
  55661. -filter_complex \
  55662. &quot; \
  55663. [0:v]scale_cuda=format=yuv444p[scaled_video];
  55664. [scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0&quot; \
  55665. -an -sn -c:v h264_nvenc -cq 20 out.mp4
  55666. </pre></div>
  55667. </li></ul>
  55668. <a name="bwdif_005fcuda"></a>
  55669. <h4 class="subsection">40.1.2 bwdif_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif_005fcuda" aria-hidden="true">TOC</a></span></h4>
  55670. <p>Deinterlace the input video using the <a class="ref" href="#bwdif">bwdif</a> algorithm, but implemented
  55671. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  55672. and/or nvenc.
  55673. </p>
  55674. <p>It accepts the following parameters:
  55675. </p>
  55676. <dl class="table">
  55677. <dt><samp class="option">mode</samp></dt>
  55678. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  55679. </p>
  55680. <dl class="table">
  55681. <dt><samp class="option">0, send_frame</samp></dt>
  55682. <dd><p>Output one frame for each frame.
  55683. </p></dd>
  55684. <dt><samp class="option">1, send_field</samp></dt>
  55685. <dd><p>Output one frame for each field.
  55686. </p></dd>
  55687. </dl>
  55688. <p>The default value is <code class="code">send_field</code>.
  55689. </p>
  55690. </dd>
  55691. <dt><samp class="option">parity</samp></dt>
  55692. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  55693. of the following values:
  55694. </p>
  55695. <dl class="table">
  55696. <dt><samp class="option">0, tff</samp></dt>
  55697. <dd><p>Assume the top field is first.
  55698. </p></dd>
  55699. <dt><samp class="option">1, bff</samp></dt>
  55700. <dd><p>Assume the bottom field is first.
  55701. </p></dd>
  55702. <dt><samp class="option">-1, auto</samp></dt>
  55703. <dd><p>Enable automatic detection of field parity.
  55704. </p></dd>
  55705. </dl>
  55706. <p>The default value is <code class="code">auto</code>.
  55707. If the interlacing is unknown or the decoder does not export this information,
  55708. top field first will be assumed.
  55709. </p>
  55710. </dd>
  55711. <dt><samp class="option">deint</samp></dt>
  55712. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  55713. values:
  55714. </p>
  55715. <dl class="table">
  55716. <dt><samp class="option">0, all</samp></dt>
  55717. <dd><p>Deinterlace all frames.
  55718. </p></dd>
  55719. <dt><samp class="option">1, interlaced</samp></dt>
  55720. <dd><p>Only deinterlace frames marked as interlaced.
  55721. </p></dd>
  55722. </dl>
  55723. <p>The default value is <code class="code">all</code>.
  55724. </p></dd>
  55725. </dl>
  55726. <a name="chromakey_005fcuda"></a>
  55727. <h4 class="subsection">40.1.3 chromakey_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#chromakey_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromakey_005fcuda" aria-hidden="true">TOC</a></span></h4>
  55728. <p>CUDA accelerated YUV colorspace color/chroma keying.
  55729. </p>
  55730. <p>This filter works like normal chromakey filter but operates on CUDA frames.
  55731. for more details and parameters see <a class="ref" href="#chromakey">chromakey</a>.
  55732. </p>
  55733. <a name="Examples-188"></a>
  55734. <h4 class="subsubsection">40.1.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-188" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-188" aria-hidden="true">TOC</a></span></h4>
  55735. <ul class="itemize mark-bullet">
  55736. <li>Make all the green pixels in the input video transparent and use it as an overlay for another video:
  55737. <div class="example">
  55738. <pre class="example-preformatted">./ffmpeg \
  55739. -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4 \
  55740. -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
  55741. -init_hw_device cuda \
  55742. -filter_complex \
  55743. &quot; \
  55744. [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
  55745. [1:v]scale_cuda=format=yuv420p[base]; \
  55746. [base][overlay_video]overlay_cuda&quot; \
  55747. -an -sn -c:v h264_nvenc -cq 20 output.mp4
  55748. </pre></div>
  55749. </li><li>Process two software sources, explicitly uploading the frames:
  55750. <div class="example">
  55751. <pre class="example-preformatted">./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
  55752. -f lavfi -i color=size=800x600:color=white,format=yuv420p \
  55753. -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
  55754. -filter_complex \
  55755. &quot; \
  55756. [0]hwupload[under]; \
  55757. [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
  55758. [under][over]overlay_cuda&quot; \
  55759. -c:v hevc_nvenc -cq 18 -preset slow output.mp4
  55760. </pre></div>
  55761. </li></ul>
  55762. <a name="colorspace_005fcuda"></a>
  55763. <h4 class="subsection">40.1.4 colorspace_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#colorspace_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorspace_005fcuda" aria-hidden="true">TOC</a></span></h4>
  55764. <p>CUDA accelerated implementation of the colorspace filter.
  55765. </p>
  55766. <p>It is by no means feature complete compared to the software colorspace filter,
  55767. and at the current time only supports color range conversion between jpeg/full
  55768. and mpeg/limited range.
  55769. </p>
  55770. <p>The filter accepts the following options:
  55771. </p>
  55772. <dl class="table">
  55773. <dt><samp class="option">range</samp></dt>
  55774. <dd><p>Specify output color range.
  55775. </p>
  55776. <p>The accepted values are:
  55777. </p><dl class="table">
  55778. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  55779. <dd><p>TV (restricted) range
  55780. </p>
  55781. </dd>
  55782. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  55783. <dd><p>MPEG (restricted) range
  55784. </p>
  55785. </dd>
  55786. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  55787. <dd><p>PC (full) range
  55788. </p>
  55789. </dd>
  55790. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  55791. <dd><p>JPEG (full) range
  55792. </p>
  55793. </dd>
  55794. </dl>
  55795. </dd>
  55796. </dl>
  55797. <a class="anchor" id="overlay_005fcuda"></a><a name="overlay_005fcuda-1"></a>
  55798. <h4 class="subsection">40.1.5 overlay_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  55799. <p>Overlay one video on top of another.
  55800. </p>
  55801. <p>This is the CUDA variant of the <a class="ref" href="#overlay">overlay</a> filter.
  55802. It only accepts CUDA frames. The underlying input pixel formats have to match.
  55803. </p>
  55804. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  55805. video on which the second input is overlaid.
  55806. </p>
  55807. <p>It accepts the following parameters:
  55808. </p>
  55809. <dl class="table">
  55810. <dt><samp class="option">x</samp></dt>
  55811. <dt><samp class="option">y</samp></dt>
  55812. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  55813. on the main video.
  55814. </p>
  55815. <p>They can contain the following parameters:
  55816. </p>
  55817. <dl class="table">
  55818. <dt><samp class="option">main_w, W</samp></dt>
  55819. <dt><samp class="option">main_h, H</samp></dt>
  55820. <dd><p>The main input width and height.
  55821. </p>
  55822. </dd>
  55823. <dt><samp class="option">overlay_w, w</samp></dt>
  55824. <dt><samp class="option">overlay_h, h</samp></dt>
  55825. <dd><p>The overlay input width and height.
  55826. </p>
  55827. </dd>
  55828. <dt><samp class="option">x</samp></dt>
  55829. <dt><samp class="option">y</samp></dt>
  55830. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  55831. each new frame.
  55832. </p>
  55833. </dd>
  55834. <dt><samp class="option">n</samp></dt>
  55835. <dd><p>The ordinal index of the main input frame, starting from 0.
  55836. </p>
  55837. </dd>
  55838. <dt><samp class="option">pos</samp></dt>
  55839. <dd><p>The byte offset position in the file of the main input frame, NAN if unknown.
  55840. Deprecated, do not use.
  55841. </p>
  55842. </dd>
  55843. <dt><samp class="option">t</samp></dt>
  55844. <dd><p>The timestamp of the main input frame, expressed in seconds, NAN if unknown.
  55845. </p>
  55846. </dd>
  55847. </dl>
  55848. <p>Default value is &quot;0&quot; for both expressions.
  55849. </p>
  55850. </dd>
  55851. <dt><samp class="option">eval</samp></dt>
  55852. <dd><p>Set when the expressions for <samp class="option">x</samp> and <samp class="option">y</samp> are evaluated.
  55853. </p>
  55854. <p>It accepts the following values:
  55855. </p><dl class="table">
  55856. <dt><samp class="option">init</samp></dt>
  55857. <dd><p>Evaluate expressions once during filter initialization or
  55858. when a command is processed.
  55859. </p>
  55860. </dd>
  55861. <dt><samp class="option">frame</samp></dt>
  55862. <dd><p>Evaluate expressions for each incoming frame
  55863. </p></dd>
  55864. </dl>
  55865. <p>Default value is <samp class="option">frame</samp>.
  55866. </p>
  55867. </dd>
  55868. <dt><samp class="option">eof_action</samp></dt>
  55869. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  55870. </p>
  55871. </dd>
  55872. <dt><samp class="option">shortest</samp></dt>
  55873. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  55874. </p>
  55875. </dd>
  55876. <dt><samp class="option">repeatlast</samp></dt>
  55877. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  55878. </p>
  55879. </dd>
  55880. </dl>
  55881. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  55882. </p>
  55883. <a class="anchor" id="pad_005fcuda"></a><a name="pad_005fcuda-1"></a>
  55884. <h4 class="subsection">40.1.6 pad_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  55885. <p>Add paddings to an input video stream using CUDA.
  55886. </p>
  55887. <p>This filter is the CUDA-accelerated version of the <a class="ref" href="#pad">pad</a> filter. It accepts the same options and expressions and provides the same core functionality.
  55888. For a detailed description of available options, please see the documentation for the <a class="ref" href="#pad">pad</a> filter.
  55889. </p>
  55890. <a name="Examples-189"></a>
  55891. <h4 class="subsubsection">40.1.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-189" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-189" aria-hidden="true">TOC</a></span></h4>
  55892. <ul class="itemize mark-bullet">
  55893. <li>Add a 200-pixel black border to all sides of a video frame:
  55894. <div class="example">
  55895. <pre class="example-preformatted">ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;pad_cuda=w=iw+400:h=ih+400:x=200:y=200&quot; -c:v h264_nvenc out.mp4
  55896. </pre></div>
  55897. </li><li>Pad the input video to a 16:9 aspect ratio, filling with the color &quot;blue&quot;:
  55898. <div class="example">
  55899. <pre class="example-preformatted">ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;pad_cuda=w=ih*16/9/sar:h=ih:x=(ow-iw)/2:y=(oh-ih)/2:color=blue&quot; -c:v h264_nvenc out.mp4
  55900. </pre></div>
  55901. </li></ul>
  55902. <a class="anchor" id="scale_005fcuda"></a><a name="scale_005fcuda-1"></a>
  55903. <h4 class="subsection">40.1.7 scale_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  55904. <p>Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels.
  55905. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  55906. </p>
  55907. <p>The filter accepts the following options:
  55908. </p><dl class="table">
  55909. <dt><samp class="option">w</samp></dt>
  55910. <dt><samp class="option">h</samp></dt>
  55911. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  55912. </p>
  55913. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  55914. </p>
  55915. </dd>
  55916. <dt><samp class="option">interp_algo</samp></dt>
  55917. <dd><p>Sets the algorithm used for scaling:
  55918. </p>
  55919. <dl class="table">
  55920. <dt><var class="var">nearest</var></dt>
  55921. <dd><p>Nearest neighbour
  55922. </p>
  55923. <p>Used by default if input parameters match the desired output.
  55924. </p>
  55925. </dd>
  55926. <dt><var class="var">bilinear</var></dt>
  55927. <dd><p>Bilinear
  55928. </p>
  55929. </dd>
  55930. <dt><var class="var">bicubic</var></dt>
  55931. <dd><p>Bicubic
  55932. </p>
  55933. <p>This is the default.
  55934. </p>
  55935. </dd>
  55936. <dt><var class="var">lanczos</var></dt>
  55937. <dd><p>Lanczos
  55938. </p>
  55939. </dd>
  55940. </dl>
  55941. </dd>
  55942. <dt><samp class="option">format</samp></dt>
  55943. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  55944. pixel format is used.
  55945. </p>
  55946. <p>The filter does not support converting between YUV and RGB pixel formats.
  55947. </p>
  55948. </dd>
  55949. <dt><samp class="option">passthrough</samp></dt>
  55950. <dd><p>If set to 0, every frame is processed, even if no conversion is necessary.
  55951. This mode can be useful to use the filter as a buffer for a downstream
  55952. frame-consumer that exhausts the limited decoder frame pool.
  55953. </p>
  55954. <p>If set to 1, frames are passed through as-is if they match the desired output
  55955. parameters. This is the default behaviour.
  55956. </p>
  55957. </dd>
  55958. <dt><samp class="option">param</samp></dt>
  55959. <dd><p>Algorithm-Specific parameter.
  55960. </p>
  55961. <p>Affects the curves of the bicubic algorithm.
  55962. </p>
  55963. </dd>
  55964. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  55965. <dt><samp class="option">force_divisible_by</samp></dt>
  55966. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  55967. </p>
  55968. </dd>
  55969. <dt><samp class="option">reset_sar</samp></dt>
  55970. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  55971. </p>
  55972. </dd>
  55973. </dl>
  55974. <a name="Examples-190"></a>
  55975. <h4 class="subsubsection">40.1.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-190" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-190" aria-hidden="true">TOC</a></span></h4>
  55976. <ul class="itemize mark-bullet">
  55977. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  55978. <div class="example">
  55979. <pre class="example-preformatted">scale_cuda=-2:720:format=yuv420p
  55980. </pre></div>
  55981. </li><li>Upscale to 4K using nearest neighbour algorithm.
  55982. <div class="example">
  55983. <pre class="example-preformatted">scale_cuda=4096:2160:interp_algo=nearest
  55984. </pre></div>
  55985. </li><li>Don&rsquo;t do any conversion or scaling, but copy all input frames into newly allocated ones.
  55986. This can be useful to deal with a filter and encode chain that otherwise exhausts the
  55987. decoders frame pool.
  55988. <div class="example">
  55989. <pre class="example-preformatted">scale_cuda=passthrough=0
  55990. </pre></div>
  55991. </li></ul>
  55992. <a name="thumbnail_005fcuda"></a>
  55993. <h4 class="subsection">40.1.8 thumbnail_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#thumbnail_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thumbnail_005fcuda" aria-hidden="true">TOC</a></span></h4>
  55994. <p>Select the most representative frame in a given sequence of consecutive frames using CUDA.
  55995. </p>
  55996. <p>The filter accepts the following options:
  55997. </p>
  55998. <dl class="table">
  55999. <dt><samp class="option">n</samp></dt>
  56000. <dd><p>Set the frames batch size to analyze; in a set of <var class="var">n</var> frames, the filter
  56001. will pick one of them, and then handle the next batch of <var class="var">n</var> frames until
  56002. the end. Default is <code class="code">100</code>.
  56003. </p></dd>
  56004. </dl>
  56005. <p>Since the filter keeps track of the whole frames sequence, a bigger <var class="var">n</var>
  56006. value will result in a higher memory usage, so a high value is not recommended.
  56007. </p>
  56008. <a name="Example-11"></a>
  56009. <h4 class="subsubsection">40.1.8.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-11" aria-hidden="true">TOC</a></span></h4>
  56010. <ul class="itemize mark-bullet">
  56011. <li>Thumbnails are extracted from every <var class="var">n</var>=150-frame batch, selecting one per batch. Chosen frames are then scaled with <a class="ref" href="#scale_005fcuda">scale_cuda</a>.
  56012. <div class="example">
  56013. <pre class="example-preformatted">./ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i ./input.mp4 -vf &quot;thumbnail_cuda=150,scale_cuda=1920:1080,hwdownload,format=nv12&quot; ./output/out%03d.png
  56014. </pre></div>
  56015. </li></ul>
  56016. <a name="yadif_005fcuda"></a>
  56017. <h4 class="subsection">40.1.9 yadif_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#yadif_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif_005fcuda" aria-hidden="true">TOC</a></span></h4>
  56018. <p>Deinterlace the input video using the <a class="ref" href="#yadif">yadif</a> algorithm, but implemented
  56019. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  56020. and/or nvenc.
  56021. </p>
  56022. <p>It accepts the following parameters:
  56023. </p>
  56024. <dl class="table">
  56025. <dt><samp class="option">mode</samp></dt>
  56026. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  56027. </p>
  56028. <dl class="table">
  56029. <dt><samp class="option">0, send_frame</samp></dt>
  56030. <dd><p>Output one frame for each frame.
  56031. </p></dd>
  56032. <dt><samp class="option">1, send_field</samp></dt>
  56033. <dd><p>Output one frame for each field.
  56034. </p></dd>
  56035. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  56036. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  56037. </p></dd>
  56038. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  56039. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  56040. </p></dd>
  56041. </dl>
  56042. <p>The default value is <code class="code">send_frame</code>.
  56043. </p>
  56044. </dd>
  56045. <dt><samp class="option">parity</samp></dt>
  56046. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  56047. of the following values:
  56048. </p>
  56049. <dl class="table">
  56050. <dt><samp class="option">0, tff</samp></dt>
  56051. <dd><p>Assume the top field is first.
  56052. </p></dd>
  56053. <dt><samp class="option">1, bff</samp></dt>
  56054. <dd><p>Assume the bottom field is first.
  56055. </p></dd>
  56056. <dt><samp class="option">-1, auto</samp></dt>
  56057. <dd><p>Enable automatic detection of field parity.
  56058. </p></dd>
  56059. </dl>
  56060. <p>The default value is <code class="code">auto</code>.
  56061. If the interlacing is unknown or the decoder does not export this information,
  56062. top field first will be assumed.
  56063. </p>
  56064. </dd>
  56065. <dt><samp class="option">deint</samp></dt>
  56066. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  56067. values:
  56068. </p>
  56069. <dl class="table">
  56070. <dt><samp class="option">0, all</samp></dt>
  56071. <dd><p>Deinterlace all frames.
  56072. </p></dd>
  56073. <dt><samp class="option">1, interlaced</samp></dt>
  56074. <dd><p>Only deinterlace frames marked as interlaced.
  56075. </p></dd>
  56076. </dl>
  56077. <p>The default value is <code class="code">all</code>.
  56078. </p></dd>
  56079. </dl>
  56080. <a class="anchor" id="CUDA-NPP"></a><a name="CUDA-NPP-1"></a>
  56081. <h3 class="section">40.2 CUDA NPP<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-NPP-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-NPP-1" aria-hidden="true">TOC</a></span></h3>
  56082. <p>Below is a description of the currently available NVIDIA Performance Primitives (libnpp) video filters.
  56083. </p>
  56084. <p>Prerequisites:
  56085. </p><ul class="itemize mark-bullet">
  56086. <li>Install Nvidia CUDA Toolkit
  56087. </li><li>Install libnpp
  56088. </li></ul>
  56089. <p>To enable CUDA NPP filters:
  56090. </p>
  56091. <ul class="itemize mark-bullet">
  56092. <li>Configure FFmpeg with <code class="code">--enable-nonfree --enable-libnpp</code>.
  56093. </li></ul>
  56094. <a class="anchor" id="scale_005fnpp"></a><a name="scale_005fnpp-1"></a>
  56095. <h4 class="subsection">40.2.1 scale_npp<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fnpp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fnpp-1" aria-hidden="true">TOC</a></span></h4>
  56096. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  56097. format conversion on CUDA video frames. Setting the output width and height
  56098. works in the same way as for the <var class="var">scale</var> filter.
  56099. </p>
  56100. <p>The following additional options are accepted:
  56101. </p><dl class="table">
  56102. <dt><samp class="option">format</samp></dt>
  56103. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  56104. default), the input format will be kept. Note that automatic format negotiation
  56105. and conversion is not yet supported for hardware frames
  56106. </p>
  56107. </dd>
  56108. <dt><samp class="option">interp_algo</samp></dt>
  56109. <dd><p>The interpolation algorithm used for resizing. One of the following:
  56110. </p><dl class="table">
  56111. <dt><samp class="option">nn</samp></dt>
  56112. <dd><p>Nearest neighbour.
  56113. </p>
  56114. </dd>
  56115. <dt><samp class="option">linear</samp></dt>
  56116. <dt><samp class="option">cubic</samp></dt>
  56117. <dt><samp class="option">cubic2p_bspline</samp></dt>
  56118. <dd><p>2-parameter cubic (B=1, C=0)
  56119. </p>
  56120. </dd>
  56121. <dt><samp class="option">cubic2p_catmullrom</samp></dt>
  56122. <dd><p>2-parameter cubic (B=0, C=1/2)
  56123. </p>
  56124. </dd>
  56125. <dt><samp class="option">cubic2p_b05c03</samp></dt>
  56126. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  56127. </p>
  56128. </dd>
  56129. <dt><samp class="option">super</samp></dt>
  56130. <dd><p>Supersampling
  56131. </p>
  56132. </dd>
  56133. <dt><samp class="option">lanczos</samp></dt>
  56134. </dl>
  56135. </dd>
  56136. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  56137. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  56138. keep the original aspect ratio. Possible values:
  56139. </p>
  56140. <dl class="table">
  56141. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  56142. <dd><p>Scale the video as specified and disable this feature.
  56143. </p>
  56144. </dd>
  56145. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  56146. <dd><p>The output video dimensions will automatically be decreased if needed.
  56147. </p>
  56148. </dd>
  56149. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  56150. <dd><p>The output video dimensions will automatically be increased if needed.
  56151. </p>
  56152. </dd>
  56153. </dl>
  56154. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  56155. maximum allowed resolution, you can use this to limit the output video to
  56156. that, while retaining the aspect ratio. For example, device A allows
  56157. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  56158. decrease) and specifying 1280x720 to the command line makes the output
  56159. 1280x533.
  56160. </p>
  56161. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  56162. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  56163. to work.
  56164. </p>
  56165. </dd>
  56166. <dt><samp class="option">force_divisible_by</samp></dt>
  56167. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  56168. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  56169. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  56170. </p>
  56171. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  56172. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  56173. may be slightly modified.
  56174. </p>
  56175. <p>This option can be handy if you need to have a video fit within or exceed
  56176. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  56177. encoder restrictions on width or height divisibility.
  56178. </p>
  56179. </dd>
  56180. <dt><samp class="option">reset_sar</samp></dt>
  56181. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  56182. </p>
  56183. </dd>
  56184. <dt><samp class="option">eval</samp></dt>
  56185. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  56186. </p>
  56187. <dl class="table">
  56188. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  56189. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  56190. </p>
  56191. </dd>
  56192. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  56193. <dd><p>Evaluate expressions for each incoming frame.
  56194. </p>
  56195. </dd>
  56196. </dl>
  56197. </dd>
  56198. </dl>
  56199. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  56200. containing the following constants:
  56201. </p>
  56202. <dl class="table">
  56203. <dt><var class="var">in_w</var></dt>
  56204. <dt><var class="var">in_h</var></dt>
  56205. <dd><p>The input width and height
  56206. </p>
  56207. </dd>
  56208. <dt><var class="var">iw</var></dt>
  56209. <dt><var class="var">ih</var></dt>
  56210. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  56211. </p>
  56212. </dd>
  56213. <dt><var class="var">out_w</var></dt>
  56214. <dt><var class="var">out_h</var></dt>
  56215. <dd><p>The output (scaled) width and height
  56216. </p>
  56217. </dd>
  56218. <dt><var class="var">ow</var></dt>
  56219. <dt><var class="var">oh</var></dt>
  56220. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  56221. </p>
  56222. </dd>
  56223. <dt><var class="var">a</var></dt>
  56224. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  56225. </p>
  56226. </dd>
  56227. <dt><var class="var">sar</var></dt>
  56228. <dd><p>input sample aspect ratio
  56229. </p>
  56230. </dd>
  56231. <dt><var class="var">dar</var></dt>
  56232. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  56233. </p>
  56234. </dd>
  56235. <dt><var class="var">n</var></dt>
  56236. <dd><p>The (sequential) number of the input frame, starting from 0.
  56237. Only available with <code class="code">eval=frame</code>.
  56238. </p>
  56239. </dd>
  56240. <dt><var class="var">t</var></dt>
  56241. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  56242. seconds. Only available with <code class="code">eval=frame</code>.
  56243. </p>
  56244. </dd>
  56245. <dt><var class="var">pos</var></dt>
  56246. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  56247. this information is unavailable and/or meaningless (for example in case of synthetic video).
  56248. Only available with <code class="code">eval=frame</code>.
  56249. Deprecated, do not use.
  56250. </p></dd>
  56251. </dl>
  56252. <a name="scale2ref_005fnpp"></a>
  56253. <h4 class="subsection">40.2.2 scale2ref_npp<span class="pull-right"><a class="anchor hidden-xs" href="#scale2ref_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale2ref_005fnpp" aria-hidden="true">TOC</a></span></h4>
  56254. <p>Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input
  56255. video, based on a reference video.
  56256. </p>
  56257. <p>See the <a class="ref" href="#scale_005fnpp">scale_npp</a> filter for available options, scale2ref_npp supports the same
  56258. but uses the reference video instead of the main input as basis. scale2ref_npp
  56259. also supports the following additional constants for the <samp class="option">w</samp> and
  56260. <samp class="option">h</samp> options:
  56261. </p>
  56262. <dl class="table">
  56263. <dt><var class="var">main_w</var></dt>
  56264. <dt><var class="var">main_h</var></dt>
  56265. <dd><p>The main input video&rsquo;s width and height
  56266. </p>
  56267. </dd>
  56268. <dt><var class="var">main_a</var></dt>
  56269. <dd><p>The same as <var class="var">main_w</var> / <var class="var">main_h</var>
  56270. </p>
  56271. </dd>
  56272. <dt><var class="var">main_sar</var></dt>
  56273. <dd><p>The main input video&rsquo;s sample aspect ratio
  56274. </p>
  56275. </dd>
  56276. <dt><var class="var">main_dar, mdar</var></dt>
  56277. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  56278. <code class="code">(main_w / main_h) * main_sar</code>.
  56279. </p>
  56280. </dd>
  56281. <dt><var class="var">main_n</var></dt>
  56282. <dd><p>The (sequential) number of the main input frame, starting from 0.
  56283. Only available with <code class="code">eval=frame</code>.
  56284. </p>
  56285. </dd>
  56286. <dt><var class="var">main_t</var></dt>
  56287. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  56288. seconds. Only available with <code class="code">eval=frame</code>.
  56289. </p>
  56290. </dd>
  56291. <dt><var class="var">main_pos</var></dt>
  56292. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  56293. this information is unavailable and/or meaningless (for example in case of synthetic video).
  56294. Only available with <code class="code">eval=frame</code>.
  56295. </p></dd>
  56296. </dl>
  56297. <a name="Examples-191"></a>
  56298. <h4 class="subsubsection">40.2.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-191" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-191" aria-hidden="true">TOC</a></span></h4>
  56299. <ul class="itemize mark-bullet">
  56300. <li>Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  56301. <div class="example">
  56302. <pre class="example-preformatted">'scale2ref_npp[b][a];[a][b]overlay_cuda'
  56303. </pre></div>
  56304. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  56305. <div class="example">
  56306. <pre class="example-preformatted">[logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
  56307. </pre></div>
  56308. </li></ul>
  56309. <a name="sharpen_005fnpp"></a>
  56310. <h4 class="subsection">40.2.3 sharpen_npp<span class="pull-right"><a class="anchor hidden-xs" href="#sharpen_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sharpen_005fnpp" aria-hidden="true">TOC</a></span></h4>
  56311. <p>Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with
  56312. border control.
  56313. </p>
  56314. <p>The following additional options are accepted:
  56315. </p><dl class="table">
  56316. <dt><samp class="option">border_type</samp></dt>
  56317. <dd><p>Type of sampling to be used ad frame borders. One of the following:
  56318. </p><dl class="table">
  56319. <dt><samp class="option">replicate</samp></dt>
  56320. <dd><p>Replicate pixel values.
  56321. </p>
  56322. </dd>
  56323. </dl>
  56324. </dd>
  56325. </dl>
  56326. <a name="transpose_005fnpp"></a>
  56327. <h4 class="subsection">40.2.4 transpose_npp<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fnpp" aria-hidden="true">TOC</a></span></h4>
  56328. <p>Transpose rows with columns in the input video and optionally flip it.
  56329. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  56330. </p>
  56331. <p>It accepts the following parameters:
  56332. </p>
  56333. <dl class="table">
  56334. <dt><samp class="option">dir</samp></dt>
  56335. <dd><p>Specify the transposition direction.
  56336. </p>
  56337. <p>Can assume the following values:
  56338. </p><dl class="table">
  56339. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  56340. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  56341. </p>
  56342. </dd>
  56343. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  56344. <dd><p>Rotate by 90 degrees clockwise.
  56345. </p>
  56346. </dd>
  56347. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  56348. <dd><p>Rotate by 90 degrees counterclockwise.
  56349. </p>
  56350. </dd>
  56351. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  56352. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  56353. </p></dd>
  56354. </dl>
  56355. </dd>
  56356. <dt><samp class="option">passthrough</samp></dt>
  56357. <dd><p>Do not apply the transposition if the input geometry matches the one
  56358. specified by the specified value. It accepts the following values:
  56359. </p><dl class="table">
  56360. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  56361. <dd><p>Always apply transposition. (default)
  56362. </p></dd>
  56363. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  56364. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  56365. </p></dd>
  56366. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  56367. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  56368. </p></dd>
  56369. </dl>
  56370. </dd>
  56371. </dl>
  56372. <a name="OpenCL-Video-Filters"></a>
  56373. <h2 class="chapter">41 OpenCL Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCL-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCL-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  56374. <p>Below is a description of the currently available OpenCL video filters.
  56375. </p>
  56376. <p>To enable compilation of these filters you need to configure FFmpeg with
  56377. <code class="code">--enable-opencl</code>.
  56378. </p>
  56379. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  56380. </p><dl class="table">
  56381. <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>
  56382. <dd><p>Initialise a new hardware device of type <var class="var">opencl</var> called <var class="var">name</var>, using the
  56383. given device parameters.
  56384. </p>
  56385. </dd>
  56386. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  56387. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  56388. </p>
  56389. </dd>
  56390. </dl>
  56391. <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>
  56392. </p>
  56393. <ul class="itemize mark-bullet">
  56394. <li>Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  56395. <div class="example">
  56396. <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
  56397. </pre></div>
  56398. </li></ul>
  56399. <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.
  56400. </p>
  56401. <a name="avgblur_005fopencl"></a>
  56402. <h3 class="section">41.1 avgblur_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56403. <p>Apply average blur filter.
  56404. </p>
  56405. <p>The filter accepts the following options:
  56406. </p>
  56407. <dl class="table">
  56408. <dt><samp class="option">sizeX</samp></dt>
  56409. <dd><p>Set horizontal radius size.
  56410. Range is <code class="code">[1, 1024]</code> and default value is <code class="code">1</code>.
  56411. </p>
  56412. </dd>
  56413. <dt><samp class="option">planes</samp></dt>
  56414. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  56415. </p>
  56416. </dd>
  56417. <dt><samp class="option">sizeY</samp></dt>
  56418. <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.
  56419. </p></dd>
  56420. </dl>
  56421. <a name="Example-12"></a>
  56422. <h4 class="subsection">41.1.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-12" aria-hidden="true">TOC</a></span></h4>
  56423. <ul class="itemize mark-bullet">
  56424. <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.
  56425. <div class="example">
  56426. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  56427. </pre></div>
  56428. </li></ul>
  56429. <a name="boxblur_005fopencl"></a>
  56430. <h3 class="section">41.2 boxblur_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56431. <p>Apply a boxblur algorithm to the input video.
  56432. </p>
  56433. <p>It accepts the following parameters:
  56434. </p>
  56435. <dl class="table">
  56436. <dt><samp class="option">luma_radius, lr</samp></dt>
  56437. <dt><samp class="option">luma_power, lp</samp></dt>
  56438. <dt><samp class="option">chroma_radius, cr</samp></dt>
  56439. <dt><samp class="option">chroma_power, cp</samp></dt>
  56440. <dt><samp class="option">alpha_radius, ar</samp></dt>
  56441. <dt><samp class="option">alpha_power, ap</samp></dt>
  56442. </dl>
  56443. <p>A description of the accepted options follows.
  56444. </p>
  56445. <dl class="table">
  56446. <dt><samp class="option">luma_radius, lr</samp></dt>
  56447. <dt><samp class="option">chroma_radius, cr</samp></dt>
  56448. <dt><samp class="option">alpha_radius, ar</samp></dt>
  56449. <dd><p>Set an expression for the box radius in pixels used for blurring the
  56450. corresponding input plane.
  56451. </p>
  56452. <p>The radius value must be a non-negative number, and must not be
  56453. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  56454. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  56455. planes.
  56456. </p>
  56457. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  56458. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  56459. corresponding value set for <samp class="option">luma_radius</samp>.
  56460. </p>
  56461. <p>The expressions can contain the following constants:
  56462. </p><dl class="table">
  56463. <dt><samp class="option">w</samp></dt>
  56464. <dt><samp class="option">h</samp></dt>
  56465. <dd><p>The input width and height in pixels.
  56466. </p>
  56467. </dd>
  56468. <dt><samp class="option">cw</samp></dt>
  56469. <dt><samp class="option">ch</samp></dt>
  56470. <dd><p>The input chroma image width and height in pixels.
  56471. </p>
  56472. </dd>
  56473. <dt><samp class="option">hsub</samp></dt>
  56474. <dt><samp class="option">vsub</samp></dt>
  56475. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  56476. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  56477. </p></dd>
  56478. </dl>
  56479. </dd>
  56480. <dt><samp class="option">luma_power, lp</samp></dt>
  56481. <dt><samp class="option">chroma_power, cp</samp></dt>
  56482. <dt><samp class="option">alpha_power, ap</samp></dt>
  56483. <dd><p>Specify how many times the boxblur filter is applied to the
  56484. corresponding plane.
  56485. </p>
  56486. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  56487. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  56488. corresponding value set for <samp class="option">luma_power</samp>.
  56489. </p>
  56490. <p>A value of 0 will disable the effect.
  56491. </p></dd>
  56492. </dl>
  56493. <a name="Examples-192"></a>
  56494. <h4 class="subsection">41.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-192" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-192" aria-hidden="true">TOC</a></span></h4>
  56495. <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.
  56496. </p>
  56497. <ul class="itemize mark-bullet">
  56498. <li>Apply a boxblur filter with the luma, chroma, and alpha radius
  56499. 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.
  56500. <div class="example">
  56501. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  56502. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  56503. </pre></div>
  56504. </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.
  56505. <p>For the luma plane, a 2x2 box radius will be run once.
  56506. </p>
  56507. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  56508. </p>
  56509. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  56510. </p><div class="example">
  56511. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  56512. </pre></div>
  56513. </li></ul>
  56514. <a name="colorkey_005fopencl"></a>
  56515. <h3 class="section">41.3 colorkey_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#colorkey_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorkey_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56516. <p>RGB colorspace color keying.
  56517. </p>
  56518. <p>The filter accepts the following options:
  56519. </p>
  56520. <dl class="table">
  56521. <dt><samp class="option">color</samp></dt>
  56522. <dd><p>The color which will be replaced with transparency.
  56523. </p>
  56524. </dd>
  56525. <dt><samp class="option">similarity</samp></dt>
  56526. <dd><p>Similarity percentage with the key color.
  56527. </p>
  56528. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  56529. </p>
  56530. </dd>
  56531. <dt><samp class="option">blend</samp></dt>
  56532. <dd><p>Blend percentage.
  56533. </p>
  56534. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  56535. </p>
  56536. <p>Higher values result in semi-transparent pixels, with a higher transparency
  56537. the more similar the pixels color is to the key color.
  56538. </p></dd>
  56539. </dl>
  56540. <a name="Examples-193"></a>
  56541. <h4 class="subsection">41.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-193" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-193" aria-hidden="true">TOC</a></span></h4>
  56542. <ul class="itemize mark-bullet">
  56543. <li>Make every semi-green pixel in the input transparent with some slight blending:
  56544. <div class="example">
  56545. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  56546. </pre></div>
  56547. </li></ul>
  56548. <a name="convolution_005fopencl"></a>
  56549. <h3 class="section">41.4 convolution_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#convolution_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolution_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56550. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  56551. </p>
  56552. <p>The filter accepts the following options:
  56553. </p>
  56554. <dl class="table">
  56555. <dt><samp class="option">0m</samp></dt>
  56556. <dt><samp class="option">1m</samp></dt>
  56557. <dt><samp class="option">2m</samp></dt>
  56558. <dt><samp class="option">3m</samp></dt>
  56559. <dd><p>Set matrix for each plane.
  56560. Matrix is sequence of 9, 25 or 49 signed numbers.
  56561. Default value for each plane is <code class="code">0 0 0 0 1 0 0 0 0</code>.
  56562. </p>
  56563. </dd>
  56564. <dt><samp class="option">0rdiv</samp></dt>
  56565. <dt><samp class="option">1rdiv</samp></dt>
  56566. <dt><samp class="option">2rdiv</samp></dt>
  56567. <dt><samp class="option">3rdiv</samp></dt>
  56568. <dd><p>Set multiplier for calculated value for each plane.
  56569. If unset or 0, it will be sum of all matrix elements.
  56570. 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>.
  56571. </p>
  56572. </dd>
  56573. <dt><samp class="option">0bias</samp></dt>
  56574. <dt><samp class="option">1bias</samp></dt>
  56575. <dt><samp class="option">2bias</samp></dt>
  56576. <dt><samp class="option">3bias</samp></dt>
  56577. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  56578. Useful for making the overall image brighter or darker.
  56579. 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>.
  56580. </p>
  56581. </dd>
  56582. </dl>
  56583. <a name="Examples-194"></a>
  56584. <h4 class="subsection">41.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-194" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-194" aria-hidden="true">TOC</a></span></h4>
  56585. <ul class="itemize mark-bullet">
  56586. <li>Apply sharpen:
  56587. <div class="example">
  56588. <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
  56589. </pre></div>
  56590. </li><li>Apply blur:
  56591. <div class="example">
  56592. <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
  56593. </pre></div>
  56594. </li><li>Apply edge enhance:
  56595. <div class="example">
  56596. <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
  56597. </pre></div>
  56598. </li><li>Apply edge detect:
  56599. <div class="example">
  56600. <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
  56601. </pre></div>
  56602. </li><li>Apply laplacian edge detector which includes diagonals:
  56603. <div class="example">
  56604. <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
  56605. </pre></div>
  56606. </li><li>Apply emboss:
  56607. <div class="example">
  56608. <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
  56609. </pre></div>
  56610. </li></ul>
  56611. <a name="erosion_005fopencl"></a>
  56612. <h3 class="section">41.5 erosion_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#erosion_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56613. <p>Apply erosion effect to the video.
  56614. </p>
  56615. <p>This filter replaces the pixel by the local(3x3) minimum.
  56616. </p>
  56617. <p>It accepts the following options:
  56618. </p>
  56619. <dl class="table">
  56620. <dt><samp class="option">threshold0</samp></dt>
  56621. <dt><samp class="option">threshold1</samp></dt>
  56622. <dt><samp class="option">threshold2</samp></dt>
  56623. <dt><samp class="option">threshold3</samp></dt>
  56624. <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>.
  56625. If <code class="code">0</code>, plane will remain unchanged.
  56626. </p>
  56627. </dd>
  56628. <dt><samp class="option">coordinates</samp></dt>
  56629. <dd><p>Flag which specifies the pixel to refer to.
  56630. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  56631. </p>
  56632. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  56633. </p>
  56634. <p>1 2 3
  56635. </p>
  56636. <p>4 x 5
  56637. </p>
  56638. <p>6 7 8
  56639. </p></dd>
  56640. </dl>
  56641. <a name="Example-13"></a>
  56642. <h4 class="subsection">41.5.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-13" aria-hidden="true">TOC</a></span></h4>
  56643. <ul class="itemize mark-bullet">
  56644. <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.
  56645. <div class="example">
  56646. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  56647. </pre></div>
  56648. </li></ul>
  56649. <a name="deshake_005fopencl"></a>
  56650. <h3 class="section">41.6 deshake_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#deshake_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56651. <p>Feature-point based video stabilization filter.
  56652. </p>
  56653. <p>The filter accepts the following options:
  56654. </p>
  56655. <dl class="table">
  56656. <dt><samp class="option">tripod</samp></dt>
  56657. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code class="code">0</code>.
  56658. </p>
  56659. </dd>
  56660. <dt><samp class="option">debug</samp></dt>
  56661. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  56662. </p>
  56663. <p>Note that in order to see console debug output you will also need to pass <code class="code">-v verbose</code> to ffmpeg.
  56664. </p>
  56665. <p>Viewing point matches in the output video is only supported for RGB input.
  56666. </p>
  56667. <p>Defaults to <code class="code">0</code>.
  56668. </p>
  56669. </dd>
  56670. <dt><samp class="option">adaptive_crop</samp></dt>
  56671. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  56672. </p>
  56673. <p>Defaults to <code class="code">1</code>.
  56674. </p>
  56675. </dd>
  56676. <dt><samp class="option">refine_features</samp></dt>
  56677. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  56678. </p>
  56679. <p>This can be turned off for a slight performance gain at the cost of precision.
  56680. </p>
  56681. <p>Defaults to <code class="code">1</code>.
  56682. </p>
  56683. </dd>
  56684. <dt><samp class="option">smooth_strength</samp></dt>
  56685. <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>.
  56686. </p>
  56687. <p><code class="code">1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  56688. </p>
  56689. <p><code class="code">0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  56690. </p>
  56691. <p>Defaults to <code class="code">0.0</code>.
  56692. </p>
  56693. </dd>
  56694. <dt><samp class="option">smooth_window_multiplier</samp></dt>
  56695. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  56696. </p>
  56697. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  56698. </p>
  56699. <p>Acceptable values range from <code class="code">0.1</code> to <code class="code">10.0</code>.
  56700. </p>
  56701. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  56702. potentially improving smoothness, but also increase latency and memory usage.
  56703. </p>
  56704. <p>Defaults to <code class="code">2.0</code>.
  56705. </p>
  56706. </dd>
  56707. </dl>
  56708. <a name="Examples-195"></a>
  56709. <h4 class="subsection">41.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-195" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-195" aria-hidden="true">TOC</a></span></h4>
  56710. <ul class="itemize mark-bullet">
  56711. <li>Stabilize a video with a fixed, medium smoothing strength:
  56712. <div class="example">
  56713. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  56714. </pre></div>
  56715. </li><li>Stabilize a video with debugging (both in console and in rendered video):
  56716. <div class="example">
  56717. <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
  56718. </pre></div>
  56719. </li></ul>
  56720. <a name="dilation_005fopencl"></a>
  56721. <h3 class="section">41.7 dilation_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#dilation_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56722. <p>Apply dilation effect to the video.
  56723. </p>
  56724. <p>This filter replaces the pixel by the local(3x3) maximum.
  56725. </p>
  56726. <p>It accepts the following options:
  56727. </p>
  56728. <dl class="table">
  56729. <dt><samp class="option">threshold0</samp></dt>
  56730. <dt><samp class="option">threshold1</samp></dt>
  56731. <dt><samp class="option">threshold2</samp></dt>
  56732. <dt><samp class="option">threshold3</samp></dt>
  56733. <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>.
  56734. If <code class="code">0</code>, plane will remain unchanged.
  56735. </p>
  56736. </dd>
  56737. <dt><samp class="option">coordinates</samp></dt>
  56738. <dd><p>Flag which specifies the pixel to refer to.
  56739. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  56740. </p>
  56741. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  56742. </p>
  56743. <p>1 2 3
  56744. </p>
  56745. <p>4 x 5
  56746. </p>
  56747. <p>6 7 8
  56748. </p></dd>
  56749. </dl>
  56750. <a name="Example-14"></a>
  56751. <h4 class="subsection">41.7.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-14" aria-hidden="true">TOC</a></span></h4>
  56752. <ul class="itemize mark-bullet">
  56753. <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.
  56754. <div class="example">
  56755. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  56756. </pre></div>
  56757. </li></ul>
  56758. <a class="anchor" id="nlmeans_005fopencl"></a><a name="nlmeans_005fopencl-1"></a>
  56759. <h3 class="section">41.8 nlmeans_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans_005fopencl-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans_005fopencl-1" aria-hidden="true">TOC</a></span></h3>
  56760. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a class="ref" href="#nlmeans">nlmeans</a>.
  56761. </p>
  56762. <a name="overlay_005fopencl"></a>
  56763. <h3 class="section">41.9 overlay_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56764. <p>Overlay one video on top of another.
  56765. </p>
  56766. <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.
  56767. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  56768. </p>
  56769. <p>The filter accepts the following options:
  56770. </p>
  56771. <dl class="table">
  56772. <dt><samp class="option">x</samp></dt>
  56773. <dd><p>Set the x coordinate of the overlaid video on the main video.
  56774. Default value is <code class="code">0</code>.
  56775. </p>
  56776. </dd>
  56777. <dt><samp class="option">y</samp></dt>
  56778. <dd><p>Set the y coordinate of the overlaid video on the main video.
  56779. Default value is <code class="code">0</code>.
  56780. </p>
  56781. </dd>
  56782. </dl>
  56783. <a name="Examples-196"></a>
  56784. <h4 class="subsection">41.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-196" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-196" aria-hidden="true">TOC</a></span></h4>
  56785. <ul class="itemize mark-bullet">
  56786. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  56787. <div class="example">
  56788. <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
  56789. </pre></div>
  56790. </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.
  56791. <div class="example">
  56792. <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
  56793. </pre></div>
  56794. </li></ul>
  56795. <a name="pad_005fopencl"></a>
  56796. <h3 class="section">41.10 pad_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56797. <p>Add paddings to the input image, and place the original input at the
  56798. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  56799. </p>
  56800. <p>It accepts the following options:
  56801. </p>
  56802. <dl class="table">
  56803. <dt><samp class="option">width, w</samp></dt>
  56804. <dt><samp class="option">height, h</samp></dt>
  56805. <dd><p>Specify an expression for the size of the output image with the
  56806. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  56807. corresponding input size is used for the output.
  56808. </p>
  56809. <p>The <var class="var">width</var> expression can reference the value set by the
  56810. <var class="var">height</var> expression, and vice versa.
  56811. </p>
  56812. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  56813. </p>
  56814. </dd>
  56815. <dt><samp class="option">x</samp></dt>
  56816. <dt><samp class="option">y</samp></dt>
  56817. <dd><p>Specify the offsets to place the input image at within the padded area,
  56818. with respect to the top/left border of the output image.
  56819. </p>
  56820. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  56821. expression, and vice versa.
  56822. </p>
  56823. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  56824. </p>
  56825. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  56826. so the input image is centered on the padded area.
  56827. </p>
  56828. </dd>
  56829. <dt><samp class="option">color</samp></dt>
  56830. <dd><p>Specify the color of the padded area. For the syntax of this option,
  56831. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  56832. manual</a>.
  56833. </p>
  56834. </dd>
  56835. <dt><samp class="option">aspect</samp></dt>
  56836. <dd><p>Pad to an aspect instead to a resolution.
  56837. </p></dd>
  56838. </dl>
  56839. <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>
  56840. options are expressions containing the following constants:
  56841. </p>
  56842. <dl class="table">
  56843. <dt><samp class="option">in_w</samp></dt>
  56844. <dt><samp class="option">in_h</samp></dt>
  56845. <dd><p>The input video width and height.
  56846. </p>
  56847. </dd>
  56848. <dt><samp class="option">iw</samp></dt>
  56849. <dt><samp class="option">ih</samp></dt>
  56850. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  56851. </p>
  56852. </dd>
  56853. <dt><samp class="option">out_w</samp></dt>
  56854. <dt><samp class="option">out_h</samp></dt>
  56855. <dd><p>The output width and height (the size of the padded area), as
  56856. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  56857. </p>
  56858. </dd>
  56859. <dt><samp class="option">ow</samp></dt>
  56860. <dt><samp class="option">oh</samp></dt>
  56861. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  56862. </p>
  56863. </dd>
  56864. <dt><samp class="option">x</samp></dt>
  56865. <dt><samp class="option">y</samp></dt>
  56866. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  56867. expressions, or NAN if not yet specified.
  56868. </p>
  56869. </dd>
  56870. <dt><samp class="option">a</samp></dt>
  56871. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  56872. </p>
  56873. </dd>
  56874. <dt><samp class="option">sar</samp></dt>
  56875. <dd><p>input sample aspect ratio
  56876. </p>
  56877. </dd>
  56878. <dt><samp class="option">dar</samp></dt>
  56879. <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>
  56880. </p></dd>
  56881. </dl>
  56882. <a name="prewitt_005fopencl"></a>
  56883. <h3 class="section">41.11 prewitt_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#prewitt_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prewitt_005fopencl" aria-hidden="true">TOC</a></span></h3>
  56884. <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.
  56885. </p>
  56886. <p>The filter accepts the following option:
  56887. </p>
  56888. <dl class="table">
  56889. <dt><samp class="option">planes</samp></dt>
  56890. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  56891. </p>
  56892. </dd>
  56893. <dt><samp class="option">scale</samp></dt>
  56894. <dd><p>Set value which will be multiplied with filtered result.
  56895. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  56896. </p>
  56897. </dd>
  56898. <dt><samp class="option">delta</samp></dt>
  56899. <dd><p>Set value which will be added to filtered result.
  56900. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  56901. </p></dd>
  56902. </dl>
  56903. <a name="Example-15"></a>
  56904. <h4 class="subsection">41.11.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-15" aria-hidden="true">TOC</a></span></h4>
  56905. <ul class="itemize mark-bullet">
  56906. <li>Apply the Prewitt operator with scale set to 2 and delta set to 10.
  56907. <div class="example">
  56908. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  56909. </pre></div>
  56910. </li></ul>
  56911. <a class="anchor" id="program_005fopencl"></a><a name="program_005fopencl-1"></a>
  56912. <h3 class="section">41.12 program_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#program_005fopencl-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-program_005fopencl-1" aria-hidden="true">TOC</a></span></h3>
  56913. <p>Filter video using an OpenCL program.
  56914. </p>
  56915. <dl class="table">
  56916. <dt><samp class="option">source</samp></dt>
  56917. <dd><p>OpenCL program source file.
  56918. </p>
  56919. </dd>
  56920. <dt><samp class="option">kernel</samp></dt>
  56921. <dd><p>Kernel name in program.
  56922. </p>
  56923. </dd>
  56924. <dt><samp class="option">inputs</samp></dt>
  56925. <dd><p>Number of inputs to the filter. Defaults to 1.
  56926. </p>
  56927. </dd>
  56928. <dt><samp class="option">size, s</samp></dt>
  56929. <dd><p>Size of output frames. Defaults to the same as the first input.
  56930. </p>
  56931. </dd>
  56932. </dl>
  56933. <p>The <code class="code">program_opencl</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  56934. </p>
  56935. <p>The program source file must contain a kernel function with the given name,
  56936. which will be run once for each plane of the output. Each run on a plane
  56937. gets enqueued as a separate 2D global NDRange with one work-item for each
  56938. pixel to be generated. The global ID offset for each work-item is therefore
  56939. the coordinates of a pixel in the destination image.
  56940. </p>
  56941. <p>The kernel function needs to take the following arguments:
  56942. </p><ul class="itemize mark-bullet">
  56943. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  56944. <p>This image will become the output; the kernel should write all of it.
  56945. </p></li><li>Frame index, <var class="var">unsigned int</var>.
  56946. <p>This is a counter starting from zero and increasing by one for each frame.
  56947. </p></li><li>Source images, <var class="var">__read_only image2d_t</var>.
  56948. <p>These are the most recent images on each input. The kernel may read from
  56949. them to generate the output, but they can&rsquo;t be written to.
  56950. </p></li></ul>
  56951. <p>Example programs:
  56952. </p>
  56953. <ul class="itemize mark-bullet">
  56954. <li>Copy the input to the output (output must be the same size as the input).
  56955. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  56956. unsigned int index,
  56957. __read_only image2d_t source)
  56958. {
  56959. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  56960. int2 location = (int2)(get_global_id(0), get_global_id(1));
  56961. float4 value = read_imagef(source, sampler, location);
  56962. write_imagef(destination, location, value);
  56963. }
  56964. </pre>
  56965. </li><li>Apply a simple transformation, rotating the input by an amount increasing
  56966. with the index counter. Pixel values are linearly interpolated by the
  56967. sampler, and the output need not have the same dimensions as the input.
  56968. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  56969. unsigned int index,
  56970. __read_only image2d_t src)
  56971. {
  56972. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  56973. CLK_FILTER_LINEAR);
  56974. float angle = (float)index / 100.0f;
  56975. float2 dst_dim = convert_float2(get_image_dim(dst));
  56976. float2 src_dim = convert_float2(get_image_dim(src));
  56977. float2 dst_cen = dst_dim / 2.0f;
  56978. float2 src_cen = src_dim / 2.0f;
  56979. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  56980. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  56981. float2 src_pos = {
  56982. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  56983. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  56984. };
  56985. src_pos = src_pos * src_dim / dst_dim;
  56986. float2 src_loc = src_pos + src_cen;
  56987. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  56988. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  56989. write_imagef(dst, dst_loc, 0.5f);
  56990. else
  56991. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  56992. }
  56993. </pre>
  56994. </li><li>Blend two inputs together, with the amount of each input used varying
  56995. with the index counter.
  56996. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  56997. unsigned int index,
  56998. __read_only image2d_t src1,
  56999. __read_only image2d_t src2)
  57000. {
  57001. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  57002. CLK_FILTER_LINEAR);
  57003. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  57004. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  57005. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  57006. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  57007. float4 val1 = read_imagef(src1, sampler, src1_loc);
  57008. float4 val2 = read_imagef(src2, sampler, src2_loc);
  57009. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  57010. }
  57011. </pre>
  57012. </li></ul>
  57013. <a name="remap_005fopencl"></a>
  57014. <h3 class="section">41.13 remap_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#remap_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remap_005fopencl" aria-hidden="true">TOC</a></span></h3>
  57015. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  57016. </p>
  57017. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  57018. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  57019. value for pixel will be used for destination pixel.
  57020. </p>
  57021. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  57022. will have Xmap/Ymap video stream dimensions.
  57023. Xmap and Ymap input video streams are 32bit float pixel format, single channel.
  57024. </p>
  57025. <dl class="table">
  57026. <dt><samp class="option">interp</samp></dt>
  57027. <dd><p>Specify interpolation used for remapping of pixels.
  57028. Allowed values are <code class="code">near</code> and <code class="code">linear</code>.
  57029. Default value is <code class="code">linear</code>.
  57030. </p>
  57031. </dd>
  57032. <dt><samp class="option">fill</samp></dt>
  57033. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  57034. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  57035. manual</a>. Default color is <code class="code">black</code>.
  57036. </p></dd>
  57037. </dl>
  57038. <a name="roberts_005fopencl"></a>
  57039. <h3 class="section">41.14 roberts_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#roberts_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-roberts_005fopencl" aria-hidden="true">TOC</a></span></h3>
  57040. <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.
  57041. </p>
  57042. <p>The filter accepts the following option:
  57043. </p>
  57044. <dl class="table">
  57045. <dt><samp class="option">planes</samp></dt>
  57046. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  57047. </p>
  57048. </dd>
  57049. <dt><samp class="option">scale</samp></dt>
  57050. <dd><p>Set value which will be multiplied with filtered result.
  57051. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  57052. </p>
  57053. </dd>
  57054. <dt><samp class="option">delta</samp></dt>
  57055. <dd><p>Set value which will be added to filtered result.
  57056. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  57057. </p></dd>
  57058. </dl>
  57059. <a name="Example-16"></a>
  57060. <h4 class="subsection">41.14.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-16" aria-hidden="true">TOC</a></span></h4>
  57061. <ul class="itemize mark-bullet">
  57062. <li>Apply the Roberts cross operator with scale set to 2 and delta set to 10
  57063. <div class="example">
  57064. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  57065. </pre></div>
  57066. </li></ul>
  57067. <a name="sobel_005fopencl"></a>
  57068. <h3 class="section">41.15 sobel_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#sobel_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sobel_005fopencl" aria-hidden="true">TOC</a></span></h3>
  57069. <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.
  57070. </p>
  57071. <p>The filter accepts the following option:
  57072. </p>
  57073. <dl class="table">
  57074. <dt><samp class="option">planes</samp></dt>
  57075. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  57076. </p>
  57077. </dd>
  57078. <dt><samp class="option">scale</samp></dt>
  57079. <dd><p>Set value which will be multiplied with filtered result.
  57080. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  57081. </p>
  57082. </dd>
  57083. <dt><samp class="option">delta</samp></dt>
  57084. <dd><p>Set value which will be added to filtered result.
  57085. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  57086. </p></dd>
  57087. </dl>
  57088. <a name="Example-17"></a>
  57089. <h4 class="subsection">41.15.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-17" aria-hidden="true">TOC</a></span></h4>
  57090. <ul class="itemize mark-bullet">
  57091. <li>Apply sobel operator with scale set to 2 and delta set to 10
  57092. <div class="example">
  57093. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  57094. </pre></div>
  57095. </li></ul>
  57096. <a name="tonemap_005fopencl"></a>
  57097. <h3 class="section">41.16 tonemap_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap_005fopencl" aria-hidden="true">TOC</a></span></h3>
  57098. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  57099. </p>
  57100. <p>It accepts the following parameters:
  57101. </p>
  57102. <dl class="table">
  57103. <dt><samp class="option">tonemap</samp></dt>
  57104. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a class="ref" href="#tonemap">tonemap</a>.
  57105. </p>
  57106. </dd>
  57107. <dt><samp class="option">param</samp></dt>
  57108. <dd><p>Tune the tone mapping algorithm. same as param option in <a class="ref" href="#tonemap">tonemap</a>.
  57109. </p>
  57110. </dd>
  57111. <dt><samp class="option">desat</samp></dt>
  57112. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  57113. higher the parameter, the more color information will be preserved. This
  57114. setting helps prevent unnaturally blown-out colors for super-highlights, by
  57115. (smoothly) turning into white instead. This makes images feel more natural,
  57116. at the cost of reducing information about out-of-range colors.
  57117. </p>
  57118. <p>The default value is 0.5, and the algorithm here is a little different from
  57119. the cpu version tonemap currently. A setting of 0.0 disables this option.
  57120. </p>
  57121. </dd>
  57122. <dt><samp class="option">threshold</samp></dt>
  57123. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  57124. is used to detect whether the scene has changed or not. If the distance between
  57125. the current frame average brightness and the current running average exceeds
  57126. a threshold value, we would re-calculate scene average and peak brightness.
  57127. The default value is 0.2.
  57128. </p>
  57129. </dd>
  57130. <dt><samp class="option">format</samp></dt>
  57131. <dd><p>Specify the output pixel format.
  57132. </p>
  57133. <p>Currently supported formats are:
  57134. </p><dl class="table">
  57135. <dt><var class="var">p010</var></dt>
  57136. <dt><var class="var">nv12</var></dt>
  57137. </dl>
  57138. </dd>
  57139. <dt><samp class="option">range, r</samp></dt>
  57140. <dd><p>Set the output color range.
  57141. </p>
  57142. <p>Possible values are:
  57143. </p><dl class="table">
  57144. <dt><var class="var">tv/mpeg</var></dt>
  57145. <dt><var class="var">pc/jpeg</var></dt>
  57146. </dl>
  57147. <p>Default is same as input.
  57148. </p>
  57149. </dd>
  57150. <dt><samp class="option">primaries, p</samp></dt>
  57151. <dd><p>Set the output color primaries.
  57152. </p>
  57153. <p>Possible values are:
  57154. </p><dl class="table">
  57155. <dt><var class="var">bt709</var></dt>
  57156. <dt><var class="var">bt2020</var></dt>
  57157. </dl>
  57158. <p>Default is same as input.
  57159. </p>
  57160. </dd>
  57161. <dt><samp class="option">transfer, t</samp></dt>
  57162. <dd><p>Set the output transfer characteristics.
  57163. </p>
  57164. <p>Possible values are:
  57165. </p><dl class="table">
  57166. <dt><var class="var">bt709</var></dt>
  57167. <dt><var class="var">bt2020</var></dt>
  57168. </dl>
  57169. <p>Default is bt709.
  57170. </p>
  57171. </dd>
  57172. <dt><samp class="option">matrix, m</samp></dt>
  57173. <dd><p>Set the output colorspace matrix.
  57174. </p>
  57175. <p>Possible value are:
  57176. </p><dl class="table">
  57177. <dt><var class="var">bt709</var></dt>
  57178. <dt><var class="var">bt2020</var></dt>
  57179. </dl>
  57180. <p>Default is same as input.
  57181. </p>
  57182. </dd>
  57183. </dl>
  57184. <a name="Example-18"></a>
  57185. <h4 class="subsection">41.16.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-18" aria-hidden="true">TOC</a></span></h4>
  57186. <ul class="itemize mark-bullet">
  57187. <li>Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  57188. <div class="example">
  57189. <pre class="example-preformatted">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  57190. </pre></div>
  57191. </li></ul>
  57192. <a name="unsharp_005fopencl"></a>
  57193. <h3 class="section">41.17 unsharp_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp_005fopencl" aria-hidden="true">TOC</a></span></h3>
  57194. <p>Sharpen or blur the input video.
  57195. </p>
  57196. <p>It accepts the following parameters:
  57197. </p>
  57198. <dl class="table">
  57199. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  57200. <dd><p>Set the luma matrix horizontal size.
  57201. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  57202. </p>
  57203. </dd>
  57204. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  57205. <dd><p>Set the luma matrix vertical size.
  57206. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  57207. </p>
  57208. </dd>
  57209. <dt><samp class="option">luma_amount, la</samp></dt>
  57210. <dd><p>Set the luma effect strength.
  57211. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">1.0</code>.
  57212. </p>
  57213. <p>Negative values will blur the input video, while positive values will
  57214. sharpen it, a value of zero will disable the effect.
  57215. </p>
  57216. </dd>
  57217. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  57218. <dd><p>Set the chroma matrix horizontal size.
  57219. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  57220. </p>
  57221. </dd>
  57222. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  57223. <dd><p>Set the chroma matrix vertical size.
  57224. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  57225. </p>
  57226. </dd>
  57227. <dt><samp class="option">chroma_amount, ca</samp></dt>
  57228. <dd><p>Set the chroma effect strength.
  57229. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">0.0</code>.
  57230. </p>
  57231. <p>Negative values will blur the input video, while positive values will
  57232. sharpen it, a value of zero will disable the effect.
  57233. </p>
  57234. </dd>
  57235. </dl>
  57236. <p>All parameters are optional and default to the equivalent of the
  57237. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  57238. </p>
  57239. <a name="Examples-197"></a>
  57240. <h4 class="subsection">41.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-197" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-197" aria-hidden="true">TOC</a></span></h4>
  57241. <ul class="itemize mark-bullet">
  57242. <li>Apply strong luma sharpen effect:
  57243. <div class="example">
  57244. <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
  57245. </pre></div>
  57246. </li><li>Apply a strong blur of both luma and chroma parameters:
  57247. <div class="example">
  57248. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  57249. </pre></div>
  57250. </li></ul>
  57251. <a name="xfade_005fopencl"></a>
  57252. <h3 class="section">41.18 xfade_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#xfade_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xfade_005fopencl" aria-hidden="true">TOC</a></span></h3>
  57253. <p>Cross fade two videos with custom transition effect by using OpenCL.
  57254. </p>
  57255. <p>It accepts the following options:
  57256. </p>
  57257. <dl class="table">
  57258. <dt><samp class="option">transition</samp></dt>
  57259. <dd><p>Set one of possible transition effects.
  57260. </p>
  57261. <dl class="table">
  57262. <dt><samp class="option">custom</samp></dt>
  57263. <dd><p>Select custom transition effect, the actual transition description
  57264. will be picked from source and kernel options.
  57265. </p>
  57266. </dd>
  57267. <dt><samp class="option">fade</samp></dt>
  57268. <dt><samp class="option">wipeleft</samp></dt>
  57269. <dt><samp class="option">wiperight</samp></dt>
  57270. <dt><samp class="option">wipeup</samp></dt>
  57271. <dt><samp class="option">wipedown</samp></dt>
  57272. <dt><samp class="option">slideleft</samp></dt>
  57273. <dt><samp class="option">slideright</samp></dt>
  57274. <dt><samp class="option">slideup</samp></dt>
  57275. <dt><samp class="option">slidedown</samp></dt>
  57276. <dd>
  57277. <p>Default transition is fade.
  57278. </p></dd>
  57279. </dl>
  57280. </dd>
  57281. <dt><samp class="option">source</samp></dt>
  57282. <dd><p>OpenCL program source file for custom transition.
  57283. </p>
  57284. </dd>
  57285. <dt><samp class="option">kernel</samp></dt>
  57286. <dd><p>Set name of kernel to use for custom transition from program source file.
  57287. </p>
  57288. </dd>
  57289. <dt><samp class="option">duration</samp></dt>
  57290. <dd><p>Set duration of video transition.
  57291. </p>
  57292. </dd>
  57293. <dt><samp class="option">offset</samp></dt>
  57294. <dd><p>Set time of start of transition relative to first video.
  57295. </p></dd>
  57296. </dl>
  57297. <p>The program source file must contain a kernel function with the given name,
  57298. which will be run once for each plane of the output. Each run on a plane
  57299. gets enqueued as a separate 2D global NDRange with one work-item for each
  57300. pixel to be generated. The global ID offset for each work-item is therefore
  57301. the coordinates of a pixel in the destination image.
  57302. </p>
  57303. <p>The kernel function needs to take the following arguments:
  57304. </p><ul class="itemize mark-bullet">
  57305. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  57306. <p>This image will become the output; the kernel should write all of it.
  57307. </p>
  57308. </li><li>First Source image, <var class="var">__read_only image2d_t</var>.
  57309. Second Source image, <var class="var">__read_only image2d_t</var>.
  57310. <p>These are the most recent images on each input. The kernel may read from
  57311. them to generate the output, but they can&rsquo;t be written to.
  57312. </p>
  57313. </li><li>Transition progress, <var class="var">float</var>. This value is always between 0 and 1 inclusive.
  57314. </li></ul>
  57315. <p>Example programs:
  57316. </p>
  57317. <ul class="itemize mark-bullet">
  57318. <li>Apply dots curtain transition effect:
  57319. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  57320. __read_only image2d_t src1,
  57321. __read_only image2d_t src2,
  57322. float progress)
  57323. {
  57324. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  57325. CLK_FILTER_LINEAR);
  57326. int2 p = (int2)(get_global_id(0), get_global_id(1));
  57327. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  57328. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  57329. rp = rp / dim;
  57330. float2 dots = (float2)(20.0, 20.0);
  57331. float2 center = (float2)(0,0);
  57332. float2 unused;
  57333. float4 val1 = read_imagef(src1, sampler, p);
  57334. float4 val2 = read_imagef(src2, sampler, p);
  57335. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  57336. write_imagef(dst, p, next ? val1 : val2);
  57337. }
  57338. </pre>
  57339. </li></ul>
  57340. <a name="VAAPI-Video-Filters"></a>
  57341. <h2 class="chapter">42 VAAPI Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#VAAPI-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VAAPI-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  57342. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  57343. </p>
  57344. <p>To enable compilation of these filters you need to configure FFmpeg with
  57345. <code class="code">--enable-vaapi</code>.
  57346. </p>
  57347. <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>
  57348. </p>
  57349. <a name="overlay_005fvaapi"></a>
  57350. <h3 class="section">42.1 overlay_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  57351. <p>Overlay one video on the top of another.
  57352. </p>
  57353. <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.
  57354. </p>
  57355. <p>The filter accepts the following options:
  57356. </p>
  57357. <dl class="table">
  57358. <dt><samp class="option">x</samp></dt>
  57359. <dt><samp class="option">y</samp></dt>
  57360. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  57361. on the main video.
  57362. </p>
  57363. <p>Default value is &quot;0&quot; for both expressions.
  57364. </p>
  57365. </dd>
  57366. <dt><samp class="option">w</samp></dt>
  57367. <dt><samp class="option">h</samp></dt>
  57368. <dd><p>Set expressions for the width and height the overlaid video
  57369. on the main video.
  57370. </p>
  57371. <p>Default values are &rsquo;overlay_iw&rsquo; for &rsquo;w&rsquo; and &rsquo;overlay_ih*w/overlay_iw&rsquo; for &rsquo;h&rsquo;.
  57372. </p>
  57373. <p>The expressions can contain the following parameters:
  57374. </p>
  57375. <dl class="table">
  57376. <dt><samp class="option">main_w, W</samp></dt>
  57377. <dt><samp class="option">main_h, H</samp></dt>
  57378. <dd><p>The main input width and height.
  57379. </p>
  57380. </dd>
  57381. <dt><samp class="option">overlay_iw</samp></dt>
  57382. <dt><samp class="option">overlay_ih</samp></dt>
  57383. <dd><p>The overlay input width and height.
  57384. </p>
  57385. </dd>
  57386. <dt><samp class="option">overlay_w, w</samp></dt>
  57387. <dt><samp class="option">overlay_h, h</samp></dt>
  57388. <dd><p>The overlay output width and height.
  57389. </p>
  57390. </dd>
  57391. <dt><samp class="option">overlay_x, x</samp></dt>
  57392. <dt><samp class="option">overlay_y, y</samp></dt>
  57393. <dd><p>Position of the overlay layer inside of main
  57394. </p>
  57395. </dd>
  57396. </dl>
  57397. </dd>
  57398. <dt><samp class="option">alpha</samp></dt>
  57399. <dd><p>Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
  57400. Higher value means lower transparency.
  57401. Default value is <code class="code">1.0</code>.
  57402. </p>
  57403. </dd>
  57404. <dt><samp class="option">eof_action</samp></dt>
  57405. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  57406. </p>
  57407. </dd>
  57408. <dt><samp class="option">shortest</samp></dt>
  57409. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  57410. </p>
  57411. </dd>
  57412. <dt><samp class="option">repeatlast</samp></dt>
  57413. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  57414. </p>
  57415. </dd>
  57416. </dl>
  57417. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  57418. </p><a name="Examples-198"></a>
  57419. <h4 class="subsection">42.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-198" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-198" aria-hidden="true">TOC</a></span></h4>
  57420. <ul class="itemize mark-bullet">
  57421. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format.
  57422. <div class="example">
  57423. <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
  57424. </pre></div>
  57425. </li><li>Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video.
  57426. The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  57427. <div class="example">
  57428. <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
  57429. </pre></div>
  57430. </li></ul>
  57431. <a name="tonemap_005fvaapi"></a>
  57432. <h3 class="section">42.2 tonemap_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  57433. <p>Perform HDR-to-SDR or HDR-to-HDR tone-mapping.
  57434. It currently only accepts HDR10 as input.
  57435. </p>
  57436. <p>It accepts the following parameters:
  57437. </p>
  57438. <dl class="table">
  57439. <dt><samp class="option">format</samp></dt>
  57440. <dd><p>Specify the output pixel format.
  57441. </p>
  57442. <p>Default is nv12 for HDR-to-SDR tone-mapping and p010 for HDR-to-HDR
  57443. tone-mapping.
  57444. </p>
  57445. </dd>
  57446. <dt><samp class="option">primaries, p</samp></dt>
  57447. <dd><p>Set the output color primaries.
  57448. </p>
  57449. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  57450. tone-mapping.
  57451. </p>
  57452. </dd>
  57453. <dt><samp class="option">transfer, t</samp></dt>
  57454. <dd><p>Set the output transfer characteristics.
  57455. </p>
  57456. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  57457. tone-mapping.
  57458. </p>
  57459. </dd>
  57460. <dt><samp class="option">matrix, m</samp></dt>
  57461. <dd><p>Set the output colorspace matrix.
  57462. </p>
  57463. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  57464. tone-mapping.
  57465. </p>
  57466. </dd>
  57467. <dt><samp class="option">display</samp></dt>
  57468. <dd><p>Set the output mastering display colour volume. It is given by a &rsquo;|&rsquo;-separated
  57469. list of two values, two values are space separated. It set display primaries
  57470. x &amp; y in G, B, R order, then white point x &amp; y, the nominal minimum &amp; maximum
  57471. display luminances.
  57472. </p>
  57473. <p>HDR-to-HDR tone-mapping will be performed when this option is set.
  57474. </p>
  57475. </dd>
  57476. <dt><samp class="option">light</samp></dt>
  57477. <dd><p>Set the output content light level information. It accepts 2 space-separated
  57478. values, the first input is the maximum light level and the second input is
  57479. the maximum average light level.
  57480. </p>
  57481. <p>It is ignored for HDR-to-SDR tone-mapping, and optional for HDR-to-HDR
  57482. tone-mapping.
  57483. </p>
  57484. </dd>
  57485. </dl>
  57486. <a name="Example-19"></a>
  57487. <h4 class="subsection">42.2.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-19" aria-hidden="true">TOC</a></span></h4>
  57488. <ul class="itemize mark-bullet">
  57489. <li>Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  57490. <div class="example">
  57491. <pre class="example-preformatted">tonemap_vaapi=format=p010:t=bt2020-10
  57492. </pre></div>
  57493. </li><li>Convert HDR video to HDR video
  57494. <div class="example">
  57495. <pre class="example-preformatted">tonemap_vaapi=display=7500\ 3000|34000\ 16000|13250\ 34500|15635\ 16450|500\ 10000000
  57496. </pre></div>
  57497. </li></ul>
  57498. <a name="hstack_005fvaapi"></a>
  57499. <h3 class="section">42.3 hstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#hstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  57500. <p>Stack input videos horizontally.
  57501. </p>
  57502. <p>This is the VA-API variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  57503. have different height, this filter will scale down/up each input stream while
  57504. keeping the original aspect.
  57505. </p>
  57506. <p>It accepts the following options:
  57507. </p>
  57508. <dl class="table">
  57509. <dt><samp class="option">inputs</samp></dt>
  57510. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  57511. </p>
  57512. </dd>
  57513. <dt><samp class="option">shortest</samp></dt>
  57514. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  57515. </p>
  57516. </dd>
  57517. <dt><samp class="option">height</samp></dt>
  57518. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  57519. height of the first input stream. Default value is 0.
  57520. </p></dd>
  57521. </dl>
  57522. <a name="vstack_005fvaapi"></a>
  57523. <h3 class="section">42.4 vstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#vstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  57524. <p>Stack input videos vertically.
  57525. </p>
  57526. <p>This is the VA-API variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  57527. have different width, this filter will scale down/up each input stream while
  57528. keeping the original aspect.
  57529. </p>
  57530. <p>It accepts the following options:
  57531. </p>
  57532. <dl class="table">
  57533. <dt><samp class="option">inputs</samp></dt>
  57534. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  57535. </p>
  57536. </dd>
  57537. <dt><samp class="option">shortest</samp></dt>
  57538. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  57539. </p>
  57540. </dd>
  57541. <dt><samp class="option">width</samp></dt>
  57542. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  57543. width of the first input stream. Default value is 0.
  57544. </p></dd>
  57545. </dl>
  57546. <a name="xstack_005fvaapi"></a>
  57547. <h3 class="section">42.5 xstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#xstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  57548. <p>Stack video inputs into custom layout.
  57549. </p>
  57550. <p>This is the VA-API variant of the <a class="ref" href="#xstack">xstack</a> filter, each input stream may
  57551. have different size, this filter will scale down/up each input stream to the
  57552. given output size, or the size of the first input stream.
  57553. </p>
  57554. <p>It accepts the following options:
  57555. </p>
  57556. <dl class="table">
  57557. <dt><samp class="option">inputs</samp></dt>
  57558. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  57559. </p>
  57560. </dd>
  57561. <dt><samp class="option">shortest</samp></dt>
  57562. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  57563. </p>
  57564. </dd>
  57565. <dt><samp class="option">layout</samp></dt>
  57566. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  57567. Moreover, this permits the user to supply output size for each input stream.
  57568. </p><div class="example">
  57569. <pre class="example-preformatted">xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  57570. </pre></div>
  57571. </dd>
  57572. <dt><samp class="option">grid</samp></dt>
  57573. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  57574. </p>
  57575. </dd>
  57576. <dt><samp class="option">grid_tile_size</samp></dt>
  57577. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  57578. is not set, this filter will set output size by default to the size of the
  57579. first input stream. For the syntax of this option, check the
  57580. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  57581. </p>
  57582. </dd>
  57583. <dt><samp class="option">fill</samp></dt>
  57584. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  57585. </p></dd>
  57586. </dl>
  57587. <a name="pad_005fvaapi"></a>
  57588. <h3 class="section">42.6 pad_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  57589. <p>Add paddings to the input image, and place the original input at the
  57590. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  57591. </p>
  57592. <p>It accepts the following options:
  57593. </p>
  57594. <dl class="table">
  57595. <dt><samp class="option">width, w</samp></dt>
  57596. <dt><samp class="option">height, h</samp></dt>
  57597. <dd><p>Specify an expression for the size of the output image with the
  57598. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  57599. corresponding input size is used for the output.
  57600. </p>
  57601. <p>The <var class="var">width</var> expression can reference the value set by the
  57602. <var class="var">height</var> expression, and vice versa.
  57603. </p>
  57604. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  57605. </p>
  57606. </dd>
  57607. <dt><samp class="option">x</samp></dt>
  57608. <dt><samp class="option">y</samp></dt>
  57609. <dd><p>Specify the offsets to place the input image at within the padded area,
  57610. with respect to the top/left border of the output image.
  57611. </p>
  57612. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  57613. expression, and vice versa.
  57614. </p>
  57615. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  57616. </p>
  57617. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  57618. so the input image is centered on the padded area.
  57619. </p>
  57620. </dd>
  57621. <dt><samp class="option">color</samp></dt>
  57622. <dd><p>Specify the color of the padded area. For the syntax of this option,
  57623. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  57624. manual</a>.
  57625. </p>
  57626. </dd>
  57627. <dt><samp class="option">aspect</samp></dt>
  57628. <dd><p>Pad to an aspect instead to a resolution.
  57629. </p></dd>
  57630. </dl>
  57631. <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>
  57632. options are expressions containing the following constants:
  57633. </p>
  57634. <dl class="table">
  57635. <dt><samp class="option">in_w</samp></dt>
  57636. <dt><samp class="option">in_h</samp></dt>
  57637. <dd><p>The input video width and height.
  57638. </p>
  57639. </dd>
  57640. <dt><samp class="option">iw</samp></dt>
  57641. <dt><samp class="option">ih</samp></dt>
  57642. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  57643. </p>
  57644. </dd>
  57645. <dt><samp class="option">out_w</samp></dt>
  57646. <dt><samp class="option">out_h</samp></dt>
  57647. <dd><p>The output width and height (the size of the padded area), as
  57648. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  57649. </p>
  57650. </dd>
  57651. <dt><samp class="option">ow</samp></dt>
  57652. <dt><samp class="option">oh</samp></dt>
  57653. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  57654. </p>
  57655. </dd>
  57656. <dt><samp class="option">x</samp></dt>
  57657. <dt><samp class="option">y</samp></dt>
  57658. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  57659. expressions, or NAN if not yet specified.
  57660. </p>
  57661. </dd>
  57662. <dt><samp class="option">a</samp></dt>
  57663. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  57664. </p>
  57665. </dd>
  57666. <dt><samp class="option">sar</samp></dt>
  57667. <dd><p>input sample aspect ratio
  57668. </p>
  57669. </dd>
  57670. <dt><samp class="option">dar</samp></dt>
  57671. <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>
  57672. </p></dd>
  57673. </dl>
  57674. <a name="drawbox_005fvaapi"></a>
  57675. <h3 class="section">42.7 drawbox_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#drawbox_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawbox_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  57676. <p>Draw a colored box on the input image.
  57677. </p>
  57678. <p>It accepts the following parameters:
  57679. </p>
  57680. <dl class="table">
  57681. <dt><samp class="option">x</samp></dt>
  57682. <dt><samp class="option">y</samp></dt>
  57683. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  57684. </p>
  57685. </dd>
  57686. <dt><samp class="option">width, w</samp></dt>
  57687. <dt><samp class="option">height, h</samp></dt>
  57688. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  57689. the input width and height. It defaults to 0.
  57690. </p>
  57691. </dd>
  57692. <dt><samp class="option">color, c</samp></dt>
  57693. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  57694. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  57695. </p>
  57696. </dd>
  57697. <dt><samp class="option">thickness, t</samp></dt>
  57698. <dd><p>The expression which sets the thickness of the box edge.
  57699. A value of <code class="code">fill</code> will create a filled box. Default value is <code class="code">3</code>.
  57700. </p>
  57701. <p>See below for the list of accepted constants.
  57702. </p>
  57703. </dd>
  57704. <dt><samp class="option">replace</samp></dt>
  57705. <dd><p>With value <code class="code">1</code>, the pixels of the painted box will overwrite the video&rsquo;s color and alpha pixels.
  57706. Default is <code class="code">0</code>, which composites the box onto the input video.
  57707. </p></dd>
  57708. </dl>
  57709. <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
  57710. following constants:
  57711. </p>
  57712. <dl class="table">
  57713. <dt><samp class="option">in_h, ih</samp></dt>
  57714. <dt><samp class="option">in_w, iw</samp></dt>
  57715. <dd><p>The input width and height.
  57716. </p>
  57717. </dd>
  57718. <dt><samp class="option">x</samp></dt>
  57719. <dt><samp class="option">y</samp></dt>
  57720. <dd><p>The x and y offset coordinates where the box is drawn.
  57721. </p>
  57722. </dd>
  57723. <dt><samp class="option">w</samp></dt>
  57724. <dt><samp class="option">h</samp></dt>
  57725. <dd><p>The width and height of the drawn box.
  57726. </p>
  57727. </dd>
  57728. <dt><samp class="option">t</samp></dt>
  57729. <dd><p>The thickness of the drawn box.
  57730. </p>
  57731. </dd>
  57732. </dl>
  57733. <a name="Examples-199"></a>
  57734. <h4 class="subsection">42.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-199" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-199" aria-hidden="true">TOC</a></span></h4>
  57735. <ul class="itemize mark-bullet">
  57736. <li>Draw a black box around the edge of the input image:
  57737. <div class="example">
  57738. <pre class="example-preformatted">drawbox
  57739. </pre></div>
  57740. </li><li>Draw a box with color red and an opacity of 50%:
  57741. <div class="example">
  57742. <pre class="example-preformatted">drawbox=10:20:200:60:red@0.5
  57743. </pre></div>
  57744. <p>The previous example can be specified as:
  57745. </p><div class="example">
  57746. <pre class="example-preformatted">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  57747. </pre></div>
  57748. </li><li>Fill the box with pink color:
  57749. <div class="example">
  57750. <pre class="example-preformatted">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  57751. </pre></div>
  57752. </li><li>Draw a 2-pixel red 2.40:1 mask:
  57753. <div class="example">
  57754. <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
  57755. </pre></div>
  57756. </li></ul>
  57757. <a name="VideoToolbox-Video-Filters"></a>
  57758. <h2 class="chapter">43 VideoToolbox Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#VideoToolbox-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VideoToolbox-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  57759. <p>Below is a description of the currently available VideoToolbox video filters.
  57760. </p>
  57761. <p>VideoToolbox filter depends on VideoToolbox framework, and is auto detected
  57762. when building ffmpeg for an Apple platform such as macOS. Add
  57763. <code class="code">--enable-videotoolbox</code> to configure if autodetect is disabled.
  57764. </p>
  57765. <a name="scale_005fvt"></a>
  57766. <h3 class="section">43.1 scale_vt<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fvt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fvt" aria-hidden="true">TOC</a></span></h3>
  57767. <p>Scale and convert the color parameters using VTPixelTransferSession.
  57768. </p>
  57769. <p>The filter accepts the following options:
  57770. </p><dl class="table">
  57771. <dt><samp class="option">w</samp></dt>
  57772. <dt><samp class="option">h</samp></dt>
  57773. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  57774. </p>
  57775. </dd>
  57776. <dt><samp class="option">color_matrix</samp></dt>
  57777. <dd><p>Set the output colorspace matrix.
  57778. </p>
  57779. </dd>
  57780. <dt><samp class="option">color_primaries</samp></dt>
  57781. <dd><p>Set the output color primaries.
  57782. </p>
  57783. </dd>
  57784. <dt><samp class="option">color_transfer</samp></dt>
  57785. <dd><p>Set the output transfer characteristics.
  57786. </p>
  57787. </dd>
  57788. </dl>
  57789. <a name="Examples-200"></a>
  57790. <h4 class="subsection">43.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-200" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-200" aria-hidden="true">TOC</a></span></h4>
  57791. <ul class="itemize mark-bullet">
  57792. <li>Perform HDR to SDR conversion, and scale to half size of input
  57793. <div class="example">
  57794. <pre class="example-preformatted">ffmpeg -hwaccel videotoolbox \
  57795. -hwaccel_output_format videotoolbox_vld \
  57796. -i hdr.mov \
  57797. -c:v hevc_videotoolbox \
  57798. -profile:v main \
  57799. -b:v 3M \
  57800. -vf scale_vt=w=iw/2:h=ih/2:color_matrix=bt709:color_primaries=bt709:color_transfer=bt709 \
  57801. -c:a copy \
  57802. -tag:v hvc1 \
  57803. sdr.mp4
  57804. </pre></div>
  57805. </li></ul>
  57806. <a name="transpose_005fvt"></a>
  57807. <h3 class="section">43.2 transpose_vt<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fvt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fvt" aria-hidden="true">TOC</a></span></h3>
  57808. <p>Transpose rows with columns in the input video and optionally flip it.
  57809. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  57810. </p>
  57811. <p>It accepts the following parameters:
  57812. </p>
  57813. <dl class="table">
  57814. <dt><samp class="option">dir</samp></dt>
  57815. <dd><p>Specify the transposition direction.
  57816. </p>
  57817. <p>Can assume the following values:
  57818. </p><dl class="table">
  57819. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  57820. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  57821. </p>
  57822. </dd>
  57823. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  57824. <dd><p>Rotate by 90 degrees clockwise.
  57825. </p>
  57826. </dd>
  57827. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  57828. <dd><p>Rotate by 90 degrees counterclockwise.
  57829. </p>
  57830. </dd>
  57831. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  57832. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  57833. </p>
  57834. </dd>
  57835. <dt>&lsquo;<samp class="samp">hflip</samp>&rsquo;</dt>
  57836. <dd><p>Flip the input video horizontally.
  57837. </p>
  57838. </dd>
  57839. <dt>&lsquo;<samp class="samp">vflip</samp>&rsquo;</dt>
  57840. <dd><p>Flip the input video vertically.
  57841. </p>
  57842. </dd>
  57843. </dl>
  57844. </dd>
  57845. <dt><samp class="option">passthrough</samp></dt>
  57846. <dd><p>Do not apply the transposition if the input geometry matches the one
  57847. specified by the specified value. It accepts the following values:
  57848. </p><dl class="table">
  57849. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  57850. <dd><p>Always apply transposition. (default)
  57851. </p></dd>
  57852. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  57853. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  57854. </p></dd>
  57855. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  57856. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  57857. </p></dd>
  57858. </dl>
  57859. </dd>
  57860. </dl>
  57861. <a name="Vulkan-Video-Filters"></a>
  57862. <h2 class="chapter">44 Vulkan Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Vulkan-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Vulkan-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  57863. <p>Below is a description of the currently available Vulkan video filters.
  57864. </p>
  57865. <p>To enable compilation of these filters you need to configure FFmpeg with
  57866. <code class="code">--enable-vulkan</code> and either <code class="code">--enable-libglslang</code> or <code class="code">--enable-libshaderc</code>.
  57867. </p>
  57868. <p>Running Vulkan filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  57869. </p><dl class="table">
  57870. <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>
  57871. <dd><p>Initialise a new hardware device of type <var class="var">vulkan</var> called <var class="var">name</var>, using the
  57872. given device parameters and options in <var class="var">key=value</var>. The following options
  57873. are supported:
  57874. </p>
  57875. <dl class="table">
  57876. <dt><samp class="option">debug</samp></dt>
  57877. <dd><p>Switches validation layers on if set to 1.
  57878. </p>
  57879. </dd>
  57880. <dt><samp class="option">linear_images</samp></dt>
  57881. <dd><p>Allocates linear images. Does not apply to decoding.
  57882. </p>
  57883. </dd>
  57884. <dt><samp class="option">disable_multiplane</samp></dt>
  57885. <dd><p>Disables multiplane images. Does not apply to decoding.
  57886. </p>
  57887. </dd>
  57888. <dt><samp class="option">avoid_host_import</samp></dt>
  57889. <dd><p>Avoids the use of dynamic host memory imports, in favor of a regular memcpy()
  57890. into a previously mapped buffer.
  57891. </p></dd>
  57892. </dl>
  57893. </dd>
  57894. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  57895. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  57896. </p>
  57897. </dd>
  57898. </dl>
  57899. <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>
  57900. </p>
  57901. <ul class="itemize mark-bullet">
  57902. <li>Example of choosing the first device and running nlmeans_vulkan filter with default parameters on it.
  57903. <div class="example">
  57904. <pre class="example-preformatted">-init_hw_device vulkan=vk:0 -filter_hw_device vk -i INPUT -vf &quot;hwupload,nlmeans_vulkan,hwdownload&quot; OUTPUT
  57905. </pre></div>
  57906. </li></ul>
  57907. <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.
  57908. </p>
  57909. <a name="avgblur_005fvulkan"></a>
  57910. <h3 class="section">44.1 avgblur_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  57911. <p>Apply an average blur filter, implemented on the GPU using Vulkan.
  57912. </p>
  57913. <p>The filter accepts the following options:
  57914. </p>
  57915. <dl class="table">
  57916. <dt><samp class="option">sizeX</samp></dt>
  57917. <dd><p>Set horizontal radius size.
  57918. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  57919. </p>
  57920. </dd>
  57921. <dt><samp class="option">sizeY</samp></dt>
  57922. <dd><p>Set vertical radius size. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  57923. </p>
  57924. </dd>
  57925. <dt><samp class="option">planes</samp></dt>
  57926. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  57927. </p></dd>
  57928. </dl>
  57929. <a name="blend_005fvulkan"></a>
  57930. <h3 class="section">44.2 blend_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#blend_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blend_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  57931. <p>Blend two Vulkan frames into each other.
  57932. </p>
  57933. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  57934. stream, the first input is the &quot;top&quot; layer and second input is
  57935. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  57936. </p>
  57937. <p>A description of the accepted options follows.
  57938. </p>
  57939. <dl class="table">
  57940. <dt><samp class="option">c0_mode</samp></dt>
  57941. <dt><samp class="option">c1_mode</samp></dt>
  57942. <dt><samp class="option">c2_mode</samp></dt>
  57943. <dt><samp class="option">c3_mode</samp></dt>
  57944. <dt><samp class="option">all_mode</samp></dt>
  57945. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  57946. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  57947. </p>
  57948. <p>Available values for component modes are:
  57949. </p><dl class="table">
  57950. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  57951. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  57952. </dl>
  57953. </dd>
  57954. </dl>
  57955. <a name="bwdif_005fvulkan"></a>
  57956. <h3 class="section">44.3 bwdif_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  57957. <p>Deinterlacer using <a class="ref" href="#bwdif">bwdif</a>, the &quot;Bob Weaver Deinterlacing Filter&quot; algorithm, implemented
  57958. on the GPU using Vulkan.
  57959. </p>
  57960. <p>It accepts the following parameters:
  57961. </p>
  57962. <dl class="table">
  57963. <dt><samp class="option">mode</samp></dt>
  57964. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  57965. </p>
  57966. <dl class="table">
  57967. <dt><samp class="option">0, send_frame</samp></dt>
  57968. <dd><p>Output one frame for each frame.
  57969. </p></dd>
  57970. <dt><samp class="option">1, send_field</samp></dt>
  57971. <dd><p>Output one frame for each field.
  57972. </p></dd>
  57973. </dl>
  57974. <p>The default value is <code class="code">send_field</code>.
  57975. </p>
  57976. </dd>
  57977. <dt><samp class="option">parity</samp></dt>
  57978. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  57979. of the following values:
  57980. </p>
  57981. <dl class="table">
  57982. <dt><samp class="option">0, tff</samp></dt>
  57983. <dd><p>Assume the top field is first.
  57984. </p></dd>
  57985. <dt><samp class="option">1, bff</samp></dt>
  57986. <dd><p>Assume the bottom field is first.
  57987. </p></dd>
  57988. <dt><samp class="option">-1, auto</samp></dt>
  57989. <dd><p>Enable automatic detection of field parity.
  57990. </p></dd>
  57991. </dl>
  57992. <p>The default value is <code class="code">auto</code>.
  57993. If the interlacing is unknown or the decoder does not export this information,
  57994. top field first will be assumed.
  57995. </p>
  57996. </dd>
  57997. <dt><samp class="option">deint</samp></dt>
  57998. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  57999. values:
  58000. </p>
  58001. <dl class="table">
  58002. <dt><samp class="option">0, all</samp></dt>
  58003. <dd><p>Deinterlace all frames.
  58004. </p></dd>
  58005. <dt><samp class="option">1, interlaced</samp></dt>
  58006. <dd><p>Only deinterlace frames marked as interlaced.
  58007. </p></dd>
  58008. </dl>
  58009. <p>The default value is <code class="code">all</code>.
  58010. </p></dd>
  58011. </dl>
  58012. <a name="chromaber_005fvulkan"></a>
  58013. <h3 class="section">44.4 chromaber_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#chromaber_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromaber_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58014. <p>Apply an effect that emulates chromatic aberration. Works best with RGB inputs,
  58015. but provides a similar effect with YCbCr inputs too.
  58016. </p>
  58017. <dl class="table">
  58018. <dt><samp class="option">dist_x</samp></dt>
  58019. <dd><p>Horizontal displacement multiplier. Each chroma pixel&rsquo;s position will be multiplied
  58020. by this amount, starting from the center of the image. Default is <code class="code">0</code>.
  58021. </p>
  58022. </dd>
  58023. <dt><samp class="option">dist_y</samp></dt>
  58024. <dd><p>Similarly, this sets the vertical displacement multiplier. Default is <code class="code">0</code>.
  58025. </p>
  58026. </dd>
  58027. </dl>
  58028. <a name="color_005fvulkan"></a>
  58029. <h3 class="section">44.5 color_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#color_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-color_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58030. <p>Video source that creates a Vulkan frame of a solid color.
  58031. Useful for benchmarking, or overlaying.
  58032. </p>
  58033. <p>It accepts the following parameters:
  58034. </p>
  58035. <dl class="table">
  58036. <dt><samp class="option">color</samp></dt>
  58037. <dd><p>The color to use. Either a name, or a hexadecimal value.
  58038. The default value is <code class="code">black</code>.
  58039. </p>
  58040. </dd>
  58041. <dt><samp class="option">size</samp></dt>
  58042. <dd><p>The size of the output frame. Default value is <code class="code">1920x1080</code>.
  58043. </p>
  58044. </dd>
  58045. <dt><samp class="option">rate</samp></dt>
  58046. <dd><p>The framerate to output at. Default value is <code class="code">60</code> frames per second.
  58047. </p>
  58048. </dd>
  58049. <dt><samp class="option">duration</samp></dt>
  58050. <dd><p>The video duration. Default value is <code class="code">-0.000001</code>.
  58051. </p>
  58052. </dd>
  58053. <dt><samp class="option">sar</samp></dt>
  58054. <dd><p>The video signal aspect ratio. Default value is <code class="code">1/1</code>.
  58055. </p>
  58056. </dd>
  58057. <dt><samp class="option">format</samp></dt>
  58058. <dd><p>The pixel format of the output Vulkan frames. Default value is <code class="code">yuv444p</code>.
  58059. </p>
  58060. </dd>
  58061. <dt><samp class="option">out_range</samp></dt>
  58062. <dd><p>Set the output YCbCr sample range.
  58063. </p>
  58064. <p>This allows the autodetected value to be overridden as well as allows forcing
  58065. a specific value used for the output and encoder. If not specified, the
  58066. range depends on the pixel format. Possible values:
  58067. </p>
  58068. <dl class="table">
  58069. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  58070. <dd><p>Choose automatically.
  58071. </p>
  58072. </dd>
  58073. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  58074. <dd><p>Set full range (0-255 in case of 8-bit luma).
  58075. </p>
  58076. </dd>
  58077. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  58078. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  58079. </p></dd>
  58080. </dl>
  58081. </dd>
  58082. </dl>
  58083. <a name="vflip_005fvulkan"></a>
  58084. <h3 class="section">44.6 vflip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#vflip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vflip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58085. <p>Flips an image vertically.
  58086. </p>
  58087. <a name="hflip_005fvulkan"></a>
  58088. <h3 class="section">44.7 hflip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#hflip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hflip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58089. <p>Flips an image horizontally.
  58090. </p>
  58091. <a name="flip_005fvulkan"></a>
  58092. <h3 class="section">44.8 flip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#flip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58093. <p>Flips an image along both the vertical and horizontal axis.
  58094. </p>
  58095. <a name="gblur_005fvulkan"></a>
  58096. <h3 class="section">44.9 gblur_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#gblur_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gblur_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58097. <p>Apply Gaussian blur filter on Vulkan frames.
  58098. </p>
  58099. <p>The filter accepts the following options:
  58100. </p>
  58101. <dl class="table">
  58102. <dt><samp class="option">sigma</samp></dt>
  58103. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  58104. </p>
  58105. </dd>
  58106. <dt><samp class="option">sigmaV</samp></dt>
  58107. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  58108. Default is <code class="code">-1</code>.
  58109. </p>
  58110. </dd>
  58111. <dt><samp class="option">planes</samp></dt>
  58112. <dd><p>Set which planes to filter. By default all planes are filtered.
  58113. </p>
  58114. </dd>
  58115. <dt><samp class="option">size</samp></dt>
  58116. <dd><p>Set the kernel size along the horizontal axis. Default is <code class="code">19</code>.
  58117. </p>
  58118. </dd>
  58119. <dt><samp class="option">sizeV</samp></dt>
  58120. <dd><p>Set the kernel size along the vertical axis. Default is <code class="code">0</code>,
  58121. which sets to use the same value as <var class="var">size</var>.
  58122. </p>
  58123. </dd>
  58124. </dl>
  58125. <a name="nlmeans_005fvulkan"></a>
  58126. <h3 class="section">44.10 nlmeans_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58127. <p>Denoise frames using Non-Local Means algorithm, implemented on the GPU using
  58128. Vulkan.
  58129. Supports more pixel formats than <a class="ref" href="#nlmeans">nlmeans</a> or <a class="ref" href="#nlmeans_005fopencl">nlmeans_opencl</a>, including
  58130. alpha channel support.
  58131. </p>
  58132. <p>The filter accepts the following options.
  58133. </p>
  58134. <dl class="table">
  58135. <dt><samp class="option">s</samp></dt>
  58136. <dd><p>Set denoising strength for all components. Default is 1.0. Must be in range [0.0, 100.0].
  58137. </p>
  58138. </dd>
  58139. <dt><samp class="option">p</samp></dt>
  58140. <dd><p>Set patch size for all planes. Default is 7. Must be odd number in range [0, 99].
  58141. </p>
  58142. </dd>
  58143. <dt><samp class="option">r</samp></dt>
  58144. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  58145. </p>
  58146. </dd>
  58147. <dt><samp class="option">t</samp></dt>
  58148. <dd><p>Set parallelism. Default is 8. Must be a number in the range [1, 64].
  58149. Larger values will use more VRAM but may not result in greater speed.
  58150. The optimal value is hardware and input dependent.
  58151. </p>
  58152. </dd>
  58153. <dt><samp class="option">s0</samp></dt>
  58154. <dt><samp class="option">s1</samp></dt>
  58155. <dt><samp class="option">s2</samp></dt>
  58156. <dt><samp class="option">s3</samp></dt>
  58157. <dd><p>Set denoising strength for a specific component. Default is <var class="var">1.0</var>, equal to <samp class="option">s</samp>.
  58158. Must be in range [0.0, 100.0]. 0.0 disables denoising in that component.
  58159. </p>
  58160. </dd>
  58161. <dt><samp class="option">p0</samp></dt>
  58162. <dt><samp class="option">p1</samp></dt>
  58163. <dt><samp class="option">p2</samp></dt>
  58164. <dt><samp class="option">p3</samp></dt>
  58165. <dd><p>Set patch size for a specific component. Default is <var class="var">7</var>, equal to <samp class="option">p</samp>.
  58166. Must be odd number in range [0, 99].
  58167. </p>
  58168. </dd>
  58169. </dl>
  58170. <a name="overlay_005fvulkan"></a>
  58171. <h3 class="section">44.11 overlay_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58172. <p>Overlay one video on top of another.
  58173. </p>
  58174. <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.
  58175. This filter requires all inputs to use the same pixel format. So, format conversion may be needed.
  58176. </p>
  58177. <p>The filter accepts the following options:
  58178. </p>
  58179. <dl class="table">
  58180. <dt><samp class="option">x</samp></dt>
  58181. <dd><p>Set the x coordinate of the overlaid video on the main video.
  58182. Default value is <code class="code">0</code>.
  58183. </p>
  58184. </dd>
  58185. <dt><samp class="option">y</samp></dt>
  58186. <dd><p>Set the y coordinate of the overlaid video on the main video.
  58187. Default value is <code class="code">0</code>.
  58188. </p>
  58189. </dd>
  58190. </dl>
  58191. <a name="transpose_005fvulkan"></a>
  58192. <h3 class="section">44.12 transpose_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  58193. <p>Transpose rows with columns in the input video and optionally flip it.
  58194. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  58195. </p>
  58196. <p>It accepts the following parameters:
  58197. </p>
  58198. <dl class="table">
  58199. <dt><samp class="option">dir</samp></dt>
  58200. <dd><p>Specify the transposition direction.
  58201. </p>
  58202. <p>Can assume the following values:
  58203. </p><dl class="table">
  58204. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  58205. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  58206. </p>
  58207. </dd>
  58208. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  58209. <dd><p>Rotate by 90 degrees clockwise.
  58210. </p>
  58211. </dd>
  58212. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  58213. <dd><p>Rotate by 90 degrees counterclockwise.
  58214. </p>
  58215. </dd>
  58216. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  58217. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  58218. </p></dd>
  58219. </dl>
  58220. </dd>
  58221. <dt><samp class="option">passthrough</samp></dt>
  58222. <dd><p>Do not apply the transposition if the input geometry matches the one
  58223. specified by the specified value. It accepts the following values:
  58224. </p><dl class="table">
  58225. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  58226. <dd><p>Always apply transposition. (default)
  58227. </p></dd>
  58228. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  58229. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  58230. </p></dd>
  58231. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  58232. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  58233. </p></dd>
  58234. </dl>
  58235. </dd>
  58236. </dl>
  58237. <a name="QSV-Video-Filters"></a>
  58238. <h2 class="chapter">45 QSV Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#QSV-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-QSV-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  58239. <p>Below is a description of the currently available QSV video filters.
  58240. </p>
  58241. <p>To enable compilation of these filters you need to configure FFmpeg with
  58242. <code class="code">--enable-libmfx</code> or <code class="code">--enable-libvpl</code>.
  58243. </p>
  58244. <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>
  58245. </p>
  58246. <a name="hstack_005fqsv"></a>
  58247. <h3 class="section">45.1 hstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#hstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  58248. <p>Stack input videos horizontally.
  58249. </p>
  58250. <p>This is the QSV variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  58251. have different height, this filter will scale down/up each input stream while
  58252. keeping the original aspect.
  58253. </p>
  58254. <p>It accepts the following options:
  58255. </p>
  58256. <dl class="table">
  58257. <dt><samp class="option">inputs</samp></dt>
  58258. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  58259. </p>
  58260. </dd>
  58261. <dt><samp class="option">shortest</samp></dt>
  58262. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  58263. </p>
  58264. </dd>
  58265. <dt><samp class="option">height</samp></dt>
  58266. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  58267. height of the first input stream. Default value is 0.
  58268. </p></dd>
  58269. </dl>
  58270. <a name="vstack_005fqsv"></a>
  58271. <h3 class="section">45.2 vstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#vstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  58272. <p>Stack input videos vertically.
  58273. </p>
  58274. <p>This is the QSV variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  58275. have different width, this filter will scale down/up each input stream while
  58276. keeping the original aspect.
  58277. </p>
  58278. <p>It accepts the following options:
  58279. </p>
  58280. <dl class="table">
  58281. <dt><samp class="option">inputs</samp></dt>
  58282. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  58283. </p>
  58284. </dd>
  58285. <dt><samp class="option">shortest</samp></dt>
  58286. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  58287. </p>
  58288. </dd>
  58289. <dt><samp class="option">width</samp></dt>
  58290. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  58291. width of the first input stream. Default value is 0.
  58292. </p></dd>
  58293. </dl>
  58294. <a name="xstack_005fqsv"></a>
  58295. <h3 class="section">45.3 xstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#xstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  58296. <p>Stack video inputs into custom layout.
  58297. </p>
  58298. <p>This is the QSV variant of the <a class="ref" href="#xstack">xstack</a> filter.
  58299. </p>
  58300. <p>It accepts the following options:
  58301. </p>
  58302. <dl class="table">
  58303. <dt><samp class="option">inputs</samp></dt>
  58304. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58305. </p>
  58306. </dd>
  58307. <dt><samp class="option">shortest</samp></dt>
  58308. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58309. </p>
  58310. </dd>
  58311. <dt><samp class="option">layout</samp></dt>
  58312. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58313. Moreover, this permits the user to supply output size for each input stream.
  58314. </p><div class="example">
  58315. <pre class="example-preformatted">xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  58316. </pre></div>
  58317. </dd>
  58318. <dt><samp class="option">grid</samp></dt>
  58319. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58320. </p>
  58321. </dd>
  58322. <dt><samp class="option">grid_tile_size</samp></dt>
  58323. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  58324. is not set, this filter will set output size by default to the size of the
  58325. first input stream. For the syntax of this option, check the
  58326. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  58327. </p>
  58328. </dd>
  58329. <dt><samp class="option">fill</samp></dt>
  58330. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58331. </p></dd>
  58332. </dl>
  58333. <a name="Video-Sources"></a>
  58334. <h2 class="chapter">46 Video Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sources" aria-hidden="true">TOC</a></span></h2>
  58335. <p>Below is a description of the currently available video sources.
  58336. </p>
  58337. <a name="buffer"></a>
  58338. <h3 class="section">46.1 buffer<span class="pull-right"><a class="anchor hidden-xs" href="#buffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffer" aria-hidden="true">TOC</a></span></h3>
  58339. <p>Buffer video frames, and make them available to the filter chain.
  58340. </p>
  58341. <p>This source is mainly intended for a programmatic use, in particular
  58342. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  58343. </p>
  58344. <p>It accepts the following parameters:
  58345. </p>
  58346. <dl class="table">
  58347. <dt><samp class="option">video_size</samp></dt>
  58348. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  58349. syntax of this option, check the
  58350. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  58351. </p>
  58352. </dd>
  58353. <dt><samp class="option">width</samp></dt>
  58354. <dd><p>The input video width.
  58355. </p>
  58356. </dd>
  58357. <dt><samp class="option">height</samp></dt>
  58358. <dd><p>The input video height.
  58359. </p>
  58360. </dd>
  58361. <dt><samp class="option">pix_fmt</samp></dt>
  58362. <dd><p>A string representing the pixel format of the buffered video frames.
  58363. It may be a number corresponding to a pixel format, or a pixel format
  58364. name.
  58365. </p>
  58366. </dd>
  58367. <dt><samp class="option">time_base</samp></dt>
  58368. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  58369. </p>
  58370. </dd>
  58371. <dt><samp class="option">frame_rate</samp></dt>
  58372. <dd><p>Specify the frame rate expected for the video stream.
  58373. </p>
  58374. </dd>
  58375. <dt><samp class="option">colorspace</samp></dt>
  58376. <dd><p>A string representing the color space of the buffered video frames.
  58377. It may be a number corresponding to a color space, or a color space
  58378. name.
  58379. </p>
  58380. </dd>
  58381. <dt><samp class="option">range</samp></dt>
  58382. <dd><p>A string representing the color range of the buffered video frames.
  58383. It may be a number corresponding to a color range, or a color range
  58384. name.
  58385. </p>
  58386. </dd>
  58387. <dt><samp class="option">alpha_mode</samp></dt>
  58388. <dd><p>A string representing the alpha mode of the buffered video frames.
  58389. It may be a number corresponding to an alpha mode, or an alpha mode
  58390. name.
  58391. </p>
  58392. </dd>
  58393. <dt><samp class="option">pixel_aspect, sar</samp></dt>
  58394. <dd><p>The sample (pixel) aspect ratio of the input video.
  58395. </p>
  58396. </dd>
  58397. <dt><samp class="option">hw_frames_ctx</samp></dt>
  58398. <dd><p>When using a hardware pixel format, this should be a reference to an
  58399. AVHWFramesContext describing input frames.
  58400. </p></dd>
  58401. </dl>
  58402. <p>For example:
  58403. </p><div class="example">
  58404. <pre class="example-preformatted">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  58405. </pre></div>
  58406. <p>will instruct the source to accept video frames with size 320x240 and
  58407. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  58408. square pixels (1:1 sample aspect ratio).
  58409. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  58410. (check the enum AVPixelFormat definition in <samp class="file">libavutil/pixfmt.h</samp>),
  58411. this example corresponds to:
  58412. </p><div class="example">
  58413. <pre class="example-preformatted">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  58414. </pre></div>
  58415. <p>Alternatively, the options can be specified as a flat string, but this
  58416. syntax is deprecated:
  58417. </p>
  58418. <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>
  58419. </p>
  58420. <a name="cellauto"></a>
  58421. <h3 class="section">46.2 cellauto<span class="pull-right"><a class="anchor hidden-xs" href="#cellauto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cellauto" aria-hidden="true">TOC</a></span></h3>
  58422. <p>Create a pattern generated by an elementary cellular automaton.
  58423. </p>
  58424. <p>The initial state of the cellular automaton can be defined through the
  58425. <samp class="option">filename</samp> and <samp class="option">pattern</samp> options. If such options are
  58426. not specified an initial state is created randomly.
  58427. </p>
  58428. <p>At each new frame a new row in the video is filled with the result of
  58429. the cellular automaton next generation. The behavior when the whole
  58430. frame is filled is defined by the <samp class="option">scroll</samp> option.
  58431. </p>
  58432. <p>This source accepts the following options:
  58433. </p>
  58434. <dl class="table">
  58435. <dt><samp class="option">filename, f</samp></dt>
  58436. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  58437. the specified file.
  58438. In the file, each non-whitespace character is considered an alive
  58439. cell, a newline will terminate the row, and further characters in the
  58440. file will be ignored.
  58441. </p>
  58442. </dd>
  58443. <dt><samp class="option">pattern, p</samp></dt>
  58444. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  58445. the specified string.
  58446. </p>
  58447. <p>Each non-whitespace character in the string is considered an alive
  58448. cell, a newline will terminate the row, and further characters in the
  58449. string will be ignored.
  58450. </p>
  58451. </dd>
  58452. <dt><samp class="option">rate, r</samp></dt>
  58453. <dd><p>Set the video rate, that is the number of frames generated per second.
  58454. Default is 25.
  58455. </p>
  58456. </dd>
  58457. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  58458. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  58459. is a floating point number value ranging from 0 to 1, defaults to
  58460. 1/PHI.
  58461. </p>
  58462. <p>This option is ignored when a file or a pattern is specified.
  58463. </p>
  58464. </dd>
  58465. <dt><samp class="option">random_seed, seed</samp></dt>
  58466. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  58467. included between 0 and UINT32_MAX. If not specified, or if explicitly
  58468. set to -1, the filter will try to use a good random seed on a best
  58469. effort basis.
  58470. </p>
  58471. </dd>
  58472. <dt><samp class="option">rule</samp></dt>
  58473. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  58474. Default value is 110.
  58475. </p>
  58476. </dd>
  58477. <dt><samp class="option">size, s</samp></dt>
  58478. <dd><p>Set the size of the output video. For the syntax of this option, check the
  58479. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  58480. </p>
  58481. <p>If <samp class="option">filename</samp> or <samp class="option">pattern</samp> is specified, the size is set
  58482. by default to the width of the specified initial state row, and the
  58483. height is set to <var class="var">width</var> * PHI.
  58484. </p>
  58485. <p>If <samp class="option">size</samp> is set, it must contain the width of the specified
  58486. pattern string, and the specified pattern will be centered in the
  58487. larger row.
  58488. </p>
  58489. <p>If a filename or a pattern string is not specified, the size value
  58490. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  58491. </p>
  58492. </dd>
  58493. <dt><samp class="option">scroll</samp></dt>
  58494. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  58495. have been already filled. If set to 0, the new generated row will be
  58496. written over the top row just after the bottom row is filled.
  58497. Defaults to 1.
  58498. </p>
  58499. </dd>
  58500. <dt><samp class="option">start_full, full</samp></dt>
  58501. <dd><p>If set to 1, completely fill the output with generated rows before
  58502. outputting the first frame.
  58503. This is the default behavior, for disabling set the value to 0.
  58504. </p>
  58505. </dd>
  58506. <dt><samp class="option">stitch</samp></dt>
  58507. <dd><p>If set to 1, stitch the left and right row edges together.
  58508. This is the default behavior, for disabling set the value to 0.
  58509. </p></dd>
  58510. </dl>
  58511. <a name="Examples-201"></a>
  58512. <h4 class="subsection">46.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-201" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-201" aria-hidden="true">TOC</a></span></h4>
  58513. <ul class="itemize mark-bullet">
  58514. <li>Read the initial state from <samp class="file">pattern</samp>, and specify an output of
  58515. size 200x400.
  58516. <div class="example">
  58517. <pre class="example-preformatted">cellauto=f=pattern:s=200x400
  58518. </pre></div>
  58519. </li><li>Generate a random initial row with a width of 200 cells, with a fill
  58520. ratio of 2/3:
  58521. <div class="example">
  58522. <pre class="example-preformatted">cellauto=ratio=2/3:s=200x200
  58523. </pre></div>
  58524. </li><li>Create a pattern generated by rule 18 starting by a single alive cell
  58525. centered on an initial row with width 100:
  58526. <div class="example">
  58527. <pre class="example-preformatted">cellauto=p=@:s=100x400:full=0:rule=18
  58528. </pre></div>
  58529. </li><li>Specify a more elaborated initial pattern:
  58530. <div class="example">
  58531. <pre class="example-preformatted">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  58532. </pre></div>
  58533. </li></ul>
  58534. <a class="anchor" id="coreimagesrc"></a><a name="coreimagesrc-1"></a>
  58535. <h3 class="section">46.3 coreimagesrc<span class="pull-right"><a class="anchor hidden-xs" href="#coreimagesrc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-coreimagesrc-1" aria-hidden="true">TOC</a></span></h3>
  58536. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  58537. </p>
  58538. <p>This video source is a specialized version of the <a class="ref" href="#coreimage">coreimage</a> video filter.
  58539. Use a core image generator at the beginning of the applied filterchain to
  58540. generate the content.
  58541. </p>
  58542. <p>The coreimagesrc video source accepts the following options:
  58543. </p><dl class="table">
  58544. <dt><samp class="option">list_generators</samp></dt>
  58545. <dd><p>List all available generators along with all their respective options as well as
  58546. possible minimum and maximum values along with the default values.
  58547. </p><div class="example">
  58548. <pre class="example-preformatted">list_generators=true
  58549. </pre></div>
  58550. </dd>
  58551. <dt><samp class="option">size, s</samp></dt>
  58552. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  58553. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  58554. The default value is <code class="code">320x240</code>.
  58555. </p>
  58556. </dd>
  58557. <dt><samp class="option">rate, r</samp></dt>
  58558. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  58559. generated per second. It has to be a string in the format
  58560. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  58561. number or a valid video frame rate abbreviation. The default value is
  58562. &quot;25&quot;.
  58563. </p>
  58564. </dd>
  58565. <dt><samp class="option">sar</samp></dt>
  58566. <dd><p>Set the sample aspect ratio of the sourced video.
  58567. </p>
  58568. </dd>
  58569. <dt><samp class="option">duration, d</samp></dt>
  58570. <dd><p>Set the duration of the sourced video. See
  58571. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  58572. for the accepted syntax.
  58573. </p>
  58574. <p>If not specified, or the expressed duration is negative, the video is
  58575. supposed to be generated forever.
  58576. </p></dd>
  58577. </dl>
  58578. <p>Additionally, all options of the <a class="ref" href="#coreimage">coreimage</a> video filter are accepted.
  58579. A complete filterchain can be used for further processing of the
  58580. generated input without CPU-HOST transfer. See <a class="ref" href="#coreimage">coreimage</a> documentation
  58581. and examples for details.
  58582. </p>
  58583. <a name="Examples-202"></a>
  58584. <h4 class="subsection">46.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-202" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-202" aria-hidden="true">TOC</a></span></h4>
  58585. <ul class="itemize mark-bullet">
  58586. <li>Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  58587. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  58588. <div class="example">
  58589. <pre class="example-preformatted">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  58590. </pre></div>
  58591. <p>This example is equivalent to the QRCode example of <a class="ref" href="#coreimage">coreimage</a> without the
  58592. need for a nullsrc video source.
  58593. </p></li></ul>
  58594. <a name="ddagrab"></a>
  58595. <h3 class="section">46.4 ddagrab<span class="pull-right"><a class="anchor hidden-xs" href="#ddagrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ddagrab" aria-hidden="true">TOC</a></span></h3>
  58596. <p>Captures the Windows Desktop via Desktop Duplication API.
  58597. </p>
  58598. <p>The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding
  58599. or processing. So an explicit <a class="ref" href="#hwdownload">hwdownload</a> is needed for any kind of
  58600. software processing.
  58601. </p>
  58602. <p>It accepts the following options:
  58603. </p>
  58604. <dl class="table">
  58605. <dt><samp class="option">output_idx</samp></dt>
  58606. <dd><p>DXGI Output Index to capture.
  58607. </p>
  58608. <p>Usually corresponds to the index Windows has given the screen minus one,
  58609. so it&rsquo;s starting at 0.
  58610. </p>
  58611. <p>Defaults to output 0.
  58612. </p>
  58613. </dd>
  58614. <dt><samp class="option">draw_mouse</samp></dt>
  58615. <dd><p>Whether to draw the mouse cursor.
  58616. </p>
  58617. <p>Defaults to true.
  58618. </p>
  58619. <p>Only affects hardware cursors. If a game or application renders its own cursor,
  58620. it&rsquo;ll always be captured.
  58621. </p>
  58622. </dd>
  58623. <dt><samp class="option">framerate</samp></dt>
  58624. <dd><p>Maximum framerate at which the desktop will be captured - the interval between
  58625. successive frames will not be smaller than the inverse of the framerate. When
  58626. <var class="var">dup_frames</var> is true (the default) and the desktop is not being updated
  58627. often enough, the filter will duplicate a previous frame. Note that there is no
  58628. background buffering going on, so when the filter is not polled often enough
  58629. then the actual inter-frame interval may be significantly larger.
  58630. </p>
  58631. <p>Defaults to 30 FPS.
  58632. </p>
  58633. </dd>
  58634. <dt><samp class="option">video_size</samp></dt>
  58635. <dd><p>Specify the size of the captured video.
  58636. </p>
  58637. <p>Defaults to the full size of the screen.
  58638. </p>
  58639. <p>Cropped from the bottom/right if smaller than screen size.
  58640. </p>
  58641. </dd>
  58642. <dt><samp class="option">offset_x</samp></dt>
  58643. <dd><p>Horizontal offset of the captured video.
  58644. </p>
  58645. </dd>
  58646. <dt><samp class="option">offset_y</samp></dt>
  58647. <dd><p>Vertical offset of the captured video.
  58648. </p>
  58649. </dd>
  58650. <dt><samp class="option">output_fmt</samp></dt>
  58651. <dd><p>Desired filter output format.
  58652. Defaults to 8 Bit BGRA.
  58653. </p>
  58654. <p>It accepts the following values:
  58655. </p><dl class="table">
  58656. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  58657. <dd><p>Passes all supported output formats to DDA and returns what DDA decides to use.
  58658. </p></dd>
  58659. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  58660. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  58661. <dd><p>8 Bit formats always work, and DDA will convert to them if necessary.
  58662. </p></dd>
  58663. <dt>&lsquo;<samp class="samp">10bit</samp>&rsquo;</dt>
  58664. <dt>&lsquo;<samp class="samp">x2bgr10</samp>&rsquo;</dt>
  58665. <dd><p>Filter initialization will fail if 10 bit format is requested but unavailable.
  58666. </p></dd>
  58667. </dl>
  58668. </dd>
  58669. <dt><samp class="option">dup_frames</samp></dt>
  58670. <dd><p>When this option is set to true (the default), the filter will duplicate frames
  58671. when the desktop has not been updated in order to maintain approximately
  58672. constant target framerate. When this option is set to false, the filter will
  58673. wait for the desktop to be updated (inter-frame intervals may vary significantly
  58674. in this case).
  58675. </p>
  58676. </dd>
  58677. </dl>
  58678. <a name="Examples-203"></a>
  58679. <h4 class="subsection">46.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-203" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-203" aria-hidden="true">TOC</a></span></h4>
  58680. <p>Capture primary screen and encode using nvenc:
  58681. </p><div class="example">
  58682. <pre class="example-preformatted">ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
  58683. </pre></div>
  58684. <p>You can also skip the lavfi device and directly use the filter.
  58685. Also demonstrates downloading the frame and encoding with libx264.
  58686. Explicit output format specification is required in this case:
  58687. </p><div class="example">
  58688. <pre class="example-preformatted">ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
  58689. </pre></div>
  58690. <p>If you want to capture only a subsection of the desktop, this can be achieved
  58691. by specifying a smaller size and its offsets into the screen:
  58692. </p><div class="example">
  58693. <pre class="example-preformatted">ddagrab=video_size=800x600:offset_x=100:offset_y=100
  58694. </pre></div>
  58695. <a name="gfxcapture"></a>
  58696. <h3 class="section">46.5 gfxcapture<span class="pull-right"><a class="anchor hidden-xs" href="#gfxcapture" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gfxcapture" aria-hidden="true">TOC</a></span></h3>
  58697. <p>Capture windows or monitors using Windows.Graphics.Capture API.
  58698. </p>
  58699. <p>This source provides low overhead capture of application windows or entire monitors.
  58700. The filter outputs hardware frames in <code class="code">d3d11</code> format; use <code class="code">hwdownload,format=</code>
  58701. if system memory frames are required.
  58702. </p>
  58703. <p>The window to be captured can be selected via regular expressions on its title,
  58704. class name or backing executable name, by explicit native handles, or by monitor
  58705. index or explicit native handle. A window must match all provided expressions to be
  58706. selected. The first matching window will be picked, in whatever order Windows
  58707. returns them.
  58708. </p>
  58709. <p>Explicit handles (<samp class="option">hwnd</samp>, <samp class="option">hmonitor</samp>) override pattern or index
  58710. based selection. If neither handles nor a monitor index are given, the first
  58711. window matching the provided regular expressions is captured.
  58712. </p>
  58713. <p>This source does NOT hold a stable FPS. It returns frames at whatever rate the compositor
  58714. provides them, only capped by the <samp class="option">max_framerate</samp>.
  58715. If you need a stable rate, you need to add an fps filter to drop/duplicate frames as needed.
  58716. </p>
  58717. <p>If the capture source disappears mid-capture (window closed, monitor disconnected), the filter will return EOF.
  58718. </p>
  58719. <p>This source accepts the following options:
  58720. </p><dl class="table">
  58721. <dt><samp class="option">window_title</samp></dt>
  58722. <dd><p>ECMAScript regular expression matched against the window title. Supports a
  58723. PCRE style <code class="code">(?i)</code> prefix for case-insensitive matching.
  58724. </p>
  58725. </dd>
  58726. <dt><samp class="option">window_class</samp></dt>
  58727. <dd><p>As <samp class="option">window_title</samp>, but matched against the window class name.
  58728. </p>
  58729. </dd>
  58730. <dt><samp class="option">window_exe</samp></dt>
  58731. <dd><p>As <samp class="option">window_title</samp>, but matched against the executable file name of the
  58732. window&rsquo;s process.
  58733. </p>
  58734. </dd>
  58735. <dt><samp class="option">monitor_idx</samp></dt>
  58736. <dd><p>Zero-based index of the monitor to capture.
  58737. </p>
  58738. <p>Can also be set to <code class="code">window</code> to capture the monitor the selected window
  58739. is displayed on at filter initialization time.
  58740. </p>
  58741. </dd>
  58742. <dt><samp class="option">hwnd</samp></dt>
  58743. <dd><p>Explicit native window handle (HWND).
  58744. </p>
  58745. </dd>
  58746. <dt><samp class="option">hmonitor</samp></dt>
  58747. <dd><p>Explicit native monitor handle (HMONITOR).
  58748. </p>
  58749. </dd>
  58750. <dt><samp class="option">capture_cursor</samp></dt>
  58751. <dd><p>Capture the mouse cursor. Enabled by default.
  58752. </p>
  58753. </dd>
  58754. <dt><samp class="option">capture_border</samp></dt>
  58755. <dd><p>Capture the full area of the window, including its window decorarions/border.
  58756. Disabled by default.
  58757. </p>
  58758. </dd>
  58759. <dt><samp class="option">display_border</samp></dt>
  58760. <dd><p>Draw a yellow highlight border around the captured window. Disabled by default.
  58761. </p>
  58762. </dd>
  58763. <dt><samp class="option">max_framerate</samp></dt>
  58764. <dd><p>Maximum capture frame rate. Accepts a video rate (e.g. <code class="code">30</code>, <code class="code">60/1</code>,
  58765. <code class="code">24000/1001</code>). The default is <code class="code">60</code> FPS.
  58766. The actual rate is the rate at which the compositor renders the window/monitor,
  58767. capped by this option.
  58768. </p>
  58769. </dd>
  58770. <dt><samp class="option">width</samp></dt>
  58771. <dd><p>Force the output canvas width. If zero (default) the initial captured source
  58772. width is used. If a negative number is provided, the width will be rounded
  58773. down to the next multiple of that number.
  58774. </p>
  58775. <p>See <samp class="option">resize_mode</samp>.
  58776. </p>
  58777. </dd>
  58778. <dt><samp class="option">height</samp></dt>
  58779. <dd><p>Force the output canvas height. If zero (default) the initial captured source
  58780. height is used. If a negative number is provided, the height will be rounded
  58781. down to the next multiple of that number.
  58782. </p>
  58783. <p>See <samp class="option">resize_mode</samp>.
  58784. </p>
  58785. </dd>
  58786. <dt><samp class="option">crop_left</samp></dt>
  58787. <dd><p>Crop this many pixels from the left side of the captured frames.
  58788. </p>
  58789. </dd>
  58790. <dt><samp class="option">crop_top</samp></dt>
  58791. <dd><p>Crop this many pixels from the left side of the captured frames.
  58792. </p>
  58793. </dd>
  58794. <dt><samp class="option">crop_right</samp></dt>
  58795. <dd><p>Crop this many pixels from the left side of the captured frames.
  58796. </p>
  58797. </dd>
  58798. <dt><samp class="option">crop_bottom</samp></dt>
  58799. <dd><p>Crop this many pixels from the left side of the captured frames.
  58800. </p>
  58801. </dd>
  58802. <dt><samp class="option">premultiplied</samp></dt>
  58803. <dd><p>If set to 1, return frames with premultiplied alpha. Default is 0 (straight
  58804. alpha).
  58805. </p>
  58806. </dd>
  58807. <dt><samp class="option">resize_mode</samp></dt>
  58808. <dd><p>Defines how the captured content is fitted into the output canvas size.
  58809. Possible values:
  58810. </p><dl class="table">
  58811. <dt>&lsquo;<samp class="samp">crop</samp>&rsquo;</dt>
  58812. <dd><p>Crop (or pad with black) to the canvas size. (default)
  58813. </p></dd>
  58814. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  58815. <dd><p>Scale the source to fill the canvas, potentially altering aspect ratio.
  58816. </p></dd>
  58817. <dt>&lsquo;<samp class="samp">scale_aspect</samp>&rsquo;</dt>
  58818. <dd><p>Scale the source to fit inside the canvas while preserving aspect ratio.
  58819. Remaining area is filled with black.
  58820. </p></dd>
  58821. </dl>
  58822. </dd>
  58823. <dt><samp class="option">scale_mode</samp></dt>
  58824. <dd><p>Scaling algorithm used when resizing is required.
  58825. </p>
  58826. <p>Possible values:
  58827. </p><dl class="table">
  58828. <dt>&lsquo;<samp class="samp">point</samp>&rsquo;</dt>
  58829. <dd><p>Nearest neighbour (pixelated) scaling.
  58830. </p></dd>
  58831. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  58832. <dd><p>Bilinear filtering. (default)
  58833. </p></dd>
  58834. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  58835. <dd><p>Bicubic filtering. Potentially more blurry, but fewer scaling artifacts depending on contents.
  58836. </p></dd>
  58837. </dl>
  58838. </dd>
  58839. <dt><samp class="option">output_fmt</samp></dt>
  58840. <dd><p>Desired output pixel format inside the D3D11 hardware frames.
  58841. </p>
  58842. <p>Possible values:
  58843. </p><dl class="table">
  58844. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  58845. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  58846. <dd><p>8 bit BGRA output (default)
  58847. </p></dd>
  58848. <dt>&lsquo;<samp class="samp">x2bgr10</samp>&rsquo;</dt>
  58849. <dt>&lsquo;<samp class="samp">10bit</samp>&rsquo;</dt>
  58850. <dd><p>10 bit BGR output
  58851. </p></dd>
  58852. <dt>&lsquo;<samp class="samp">rgbaf16</samp>&rsquo;</dt>
  58853. <dt>&lsquo;<samp class="samp">16bit</samp>&rsquo;</dt>
  58854. <dd><p>16bit float RGBA output
  58855. </p></dd>
  58856. </dl>
  58857. </dd>
  58858. </dl>
  58859. <a name="Examples-204"></a>
  58860. <h4 class="subsection">46.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-204" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-204" aria-hidden="true">TOC</a></span></h4>
  58861. <ul class="itemize mark-bullet">
  58862. <li>Capture a window by title (case-insensitive) at a maximum of 60 fps:
  58863. <div class="example">
  58864. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=window_title='(?i)My Application':max_framerate=60,hwdownload,format=bgra,format=yuv420p -c:v libx264 -crf 15 capture.mp4
  58865. </pre></div>
  58866. </li><li>Capture monitor 1 at native refresh, 10bit color depth, scale to 1920x1080 preserving aspect:
  58867. <div class="example">
  58868. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=monitor_idx=1:width=1920:height=1080:resize_mode=scale_aspect:output_fmt=10bit -c:v hevc_nvenc -cq 15 capture.mp4
  58869. </pre></div>
  58870. </li><li>Capture a window by executable name, draw border, force point scaling, fixed 60 fps:
  58871. <div class="example">
  58872. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=window_exe='^firefox.exe$':display_border=1:scale_mode=point,fps=60 -rc qvbr -qvbr_quality_level 15 -c:v h264_amf capture.mp4
  58873. </pre></div>
  58874. </li></ul>
  58875. <a name="gradients"></a>
  58876. <h3 class="section">46.6 gradients<span class="pull-right"><a class="anchor hidden-xs" href="#gradients" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradients" aria-hidden="true">TOC</a></span></h3>
  58877. <p>Generate several gradients.
  58878. </p>
  58879. <dl class="table">
  58880. <dt><samp class="option">size, s</samp></dt>
  58881. <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
  58882. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  58883. </p>
  58884. </dd>
  58885. <dt><samp class="option">rate, r</samp></dt>
  58886. <dd><p>Set frame rate, expressed as number of frames per second. Default
  58887. value is &quot;25&quot;.
  58888. </p>
  58889. </dd>
  58890. <dt><samp class="option">c0, c1, c2, c3, c4, c5, c6, c7</samp></dt>
  58891. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  58892. </p>
  58893. </dd>
  58894. <dt><samp class="option">x0, y0, y0, y1</samp></dt>
  58895. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  58896. are picked.
  58897. </p>
  58898. </dd>
  58899. <dt><samp class="option">nb_colors, n</samp></dt>
  58900. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  58901. </p>
  58902. </dd>
  58903. <dt><samp class="option">seed</samp></dt>
  58904. <dd><p>Set seed for picking gradient line points.
  58905. </p>
  58906. </dd>
  58907. <dt><samp class="option">duration, d</samp></dt>
  58908. <dd><p>Set the duration of the sourced video. See
  58909. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  58910. for the accepted syntax.
  58911. </p>
  58912. <p>If not specified, or the expressed duration is negative, the video is
  58913. supposed to be generated forever.
  58914. </p>
  58915. </dd>
  58916. <dt><samp class="option">speed</samp></dt>
  58917. <dd><p>Set speed of gradients rotation.
  58918. </p>
  58919. </dd>
  58920. <dt><samp class="option">type, t</samp></dt>
  58921. <dd><p>Set type of gradients.
  58922. Available values are:
  58923. </p><dl class="table">
  58924. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  58925. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  58926. <dt>&lsquo;<samp class="samp">circular</samp>&rsquo;</dt>
  58927. <dt>&lsquo;<samp class="samp">spiral</samp>&rsquo;</dt>
  58928. <dt>&lsquo;<samp class="samp">square</samp>&rsquo;</dt>
  58929. </dl>
  58930. <p>Default type is <var class="var">linear</var>.
  58931. </p></dd>
  58932. </dl>
  58933. <a name="Commands-156"></a>
  58934. <h4 class="subsection">46.6.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-156" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-156" aria-hidden="true">TOC</a></span></h4>
  58935. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  58936. </p>
  58937. <a name="mandelbrot"></a>
  58938. <h3 class="section">46.7 mandelbrot<span class="pull-right"><a class="anchor hidden-xs" href="#mandelbrot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mandelbrot" aria-hidden="true">TOC</a></span></h3>
  58939. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  58940. point specified with <var class="var">start_x</var> and <var class="var">start_y</var>.
  58941. </p>
  58942. <p>This source accepts the following options:
  58943. </p>
  58944. <dl class="table">
  58945. <dt><samp class="option">end_pts</samp></dt>
  58946. <dd><p>Set the terminal pts value. Default value is 400.
  58947. </p>
  58948. </dd>
  58949. <dt><samp class="option">end_scale</samp></dt>
  58950. <dd><p>Set the terminal scale value.
  58951. Must be a floating point value. Default value is 0.3.
  58952. </p>
  58953. </dd>
  58954. <dt><samp class="option">inner</samp></dt>
  58955. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  58956. Mandelbrot fractal internal region.
  58957. </p>
  58958. <p>It shall assume one of the following values:
  58959. </p><dl class="table">
  58960. <dt><samp class="option">black</samp></dt>
  58961. <dd><p>Set black mode.
  58962. </p></dd>
  58963. <dt><samp class="option">convergence</samp></dt>
  58964. <dd><p>Show time until convergence.
  58965. </p></dd>
  58966. <dt><samp class="option">mincol</samp></dt>
  58967. <dd><p>Set color based on point closest to the origin of the iterations.
  58968. </p></dd>
  58969. <dt><samp class="option">period</samp></dt>
  58970. <dd><p>Set period mode.
  58971. </p></dd>
  58972. </dl>
  58973. <p>Default value is <var class="var">mincol</var>.
  58974. </p>
  58975. </dd>
  58976. <dt><samp class="option">bailout</samp></dt>
  58977. <dd><p>Set the bailout value. Default value is 10.0.
  58978. </p>
  58979. </dd>
  58980. <dt><samp class="option">maxiter</samp></dt>
  58981. <dd><p>Set the maximum of iterations performed by the rendering
  58982. algorithm. Default value is 7189.
  58983. </p>
  58984. </dd>
  58985. <dt><samp class="option">outer</samp></dt>
  58986. <dd><p>Set outer coloring mode.
  58987. It shall assume one of following values:
  58988. </p><dl class="table">
  58989. <dt><samp class="option">iteration_count</samp></dt>
  58990. <dd><p>Set iteration count mode.
  58991. </p></dd>
  58992. <dt><samp class="option">normalized_iteration_count</samp></dt>
  58993. <dd><p>set normalized iteration count mode.
  58994. </p></dd>
  58995. </dl>
  58996. <p>Default value is <var class="var">normalized_iteration_count</var>.
  58997. </p>
  58998. </dd>
  58999. <dt><samp class="option">rate, r</samp></dt>
  59000. <dd><p>Set frame rate, expressed as number of frames per second. Default
  59001. value is &quot;25&quot;.
  59002. </p>
  59003. </dd>
  59004. <dt><samp class="option">size, s</samp></dt>
  59005. <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
  59006. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  59007. </p>
  59008. </dd>
  59009. <dt><samp class="option">start_scale</samp></dt>
  59010. <dd><p>Set the initial scale value. Default value is 3.0.
  59011. </p>
  59012. </dd>
  59013. <dt><samp class="option">start_x</samp></dt>
  59014. <dd><p>Set the initial x position. Must be a floating point value between
  59015. -100 and 100. Default value is -0.743643887037158704752191506114774.
  59016. </p>
  59017. </dd>
  59018. <dt><samp class="option">start_y</samp></dt>
  59019. <dd><p>Set the initial y position. Must be a floating point value between
  59020. -100 and 100. Default value is -0.131825904205311970493132056385139.
  59021. </p></dd>
  59022. </dl>
  59023. <a name="mptestsrc"></a>
  59024. <h3 class="section">46.8 mptestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#mptestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mptestsrc" aria-hidden="true">TOC</a></span></h3>
  59025. <p>Generate various test patterns, as generated by the MPlayer test filter.
  59026. </p>
  59027. <p>The size of the generated video is fixed, and is 512x512.
  59028. This source is useful in particular for testing encoding features.
  59029. </p>
  59030. <p>This source accepts the following options:
  59031. </p>
  59032. <dl class="table">
  59033. <dt><samp class="option">rate, r</samp></dt>
  59034. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  59035. generated per second. It has to be a string in the format
  59036. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  59037. number or a valid video frame rate abbreviation. The default value is
  59038. &quot;25&quot;.
  59039. </p>
  59040. </dd>
  59041. <dt><samp class="option">duration, d</samp></dt>
  59042. <dd><p>Set the duration of the sourced video. See
  59043. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  59044. for the accepted syntax.
  59045. </p>
  59046. <p>If not specified, or the expressed duration is negative, the video is
  59047. supposed to be generated forever.
  59048. </p>
  59049. </dd>
  59050. <dt><samp class="option">test, t</samp></dt>
  59051. <dd>
  59052. <p>Set the number or the name of the test to perform. Supported tests are:
  59053. </p><dl class="table">
  59054. <dt><samp class="option">dc_luma</samp></dt>
  59055. <dt><samp class="option">dc_chroma</samp></dt>
  59056. <dt><samp class="option">freq_luma</samp></dt>
  59057. <dt><samp class="option">freq_chroma</samp></dt>
  59058. <dt><samp class="option">amp_luma</samp></dt>
  59059. <dt><samp class="option">amp_chroma</samp></dt>
  59060. <dt><samp class="option">cbp</samp></dt>
  59061. <dt><samp class="option">mv</samp></dt>
  59062. <dt><samp class="option">ring1</samp></dt>
  59063. <dt><samp class="option">ring2</samp></dt>
  59064. <dt><samp class="option">all</samp></dt>
  59065. <dt><samp class="option">max_frames, m</samp></dt>
  59066. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  59067. </p>
  59068. </dd>
  59069. </dl>
  59070. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  59071. </p></dd>
  59072. </dl>
  59073. <p>Some examples:
  59074. </p><div class="example">
  59075. <pre class="example-preformatted">mptestsrc=t=dc_luma
  59076. </pre></div>
  59077. <p>will generate a &quot;dc_luma&quot; test pattern.
  59078. </p>
  59079. <a name="frei0r_005fsrc"></a>
  59080. <h3 class="section">46.9 frei0r_src<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r_005fsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r_005fsrc" aria-hidden="true">TOC</a></span></h3>
  59081. <p>Provide a frei0r source.
  59082. </p>
  59083. <p>To enable compilation of this filter you need to install the frei0r
  59084. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  59085. </p>
  59086. <p>This source accepts the following parameters:
  59087. </p>
  59088. <dl class="table">
  59089. <dt><samp class="option">size</samp></dt>
  59090. <dd><p>The size of the video to generate. For the syntax of this option, check the
  59091. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59092. </p>
  59093. </dd>
  59094. <dt><samp class="option">framerate</samp></dt>
  59095. <dd><p>The framerate of the generated video. It may be a string of the form
  59096. <var class="var">num</var>/<var class="var">den</var> or a frame rate abbreviation.
  59097. </p>
  59098. </dd>
  59099. <dt><samp class="option">filter_name</samp></dt>
  59100. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  59101. how to set the parameters, read the <a class="ref" href="#frei0r">frei0r</a> section in the video filters
  59102. documentation.
  59103. </p>
  59104. </dd>
  59105. <dt><samp class="option">filter_params</samp></dt>
  59106. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  59107. </p>
  59108. </dd>
  59109. </dl>
  59110. <p>For example, to generate a frei0r partik0l source with size 200x200
  59111. and frame rate 10 which is overlaid on the overlay filter main input:
  59112. </p><div class="example">
  59113. <pre class="example-preformatted">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  59114. </pre></div>
  59115. <a name="life"></a>
  59116. <h3 class="section">46.10 life<span class="pull-right"><a class="anchor hidden-xs" href="#life" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-life" aria-hidden="true">TOC</a></span></h3>
  59117. <p>Generate a life pattern.
  59118. </p>
  59119. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  59120. </p>
  59121. <p>The sourced input represents a life grid, each pixel represents a cell
  59122. which can be in one of two possible states, alive or dead. Every cell
  59123. interacts with its eight neighbours, which are the cells that are
  59124. horizontally, vertically, or diagonally adjacent.
  59125. </p>
  59126. <p>At each interaction the grid evolves according to the adopted rule,
  59127. which specifies the number of neighbor alive cells which will make a
  59128. cell stay alive or born. The <samp class="option">rule</samp> option allows one to specify
  59129. the rule to adopt.
  59130. </p>
  59131. <p>This source accepts the following options:
  59132. </p>
  59133. <dl class="table">
  59134. <dt><samp class="option">filename, f</samp></dt>
  59135. <dd><p>Set the file from which to read the initial grid state. In the file,
  59136. each non-whitespace character is considered an alive cell, and newline
  59137. is used to delimit the end of each row.
  59138. </p>
  59139. <p>If this option is not specified, the initial grid is generated
  59140. randomly.
  59141. </p>
  59142. </dd>
  59143. <dt><samp class="option">rate, r</samp></dt>
  59144. <dd><p>Set the video rate, that is the number of frames generated per second.
  59145. Default is 25.
  59146. </p>
  59147. </dd>
  59148. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  59149. <dd><p>Set the random fill ratio for the initial random grid. It is a
  59150. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  59151. It is ignored when a file is specified.
  59152. </p>
  59153. </dd>
  59154. <dt><samp class="option">random_seed, seed</samp></dt>
  59155. <dd><p>Set the seed for filling the initial random grid, must be an integer
  59156. included between 0 and UINT32_MAX. If not specified, or if explicitly
  59157. set to -1, the filter will try to use a good random seed on a best
  59158. effort basis.
  59159. </p>
  59160. </dd>
  59161. <dt><samp class="option">rule</samp></dt>
  59162. <dd><p>Set the life rule.
  59163. </p>
  59164. <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;,
  59165. where <var class="var">NS</var> and <var class="var">NB</var> are sequences of numbers in the range 0-8,
  59166. <var class="var">NS</var> specifies the number of alive neighbor cells which make a
  59167. live cell stay alive, and <var class="var">NB</var> the number of alive neighbor cells
  59168. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  59169. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  59170. </p>
  59171. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  59172. high order bits are used to encode the next cell state if it is alive
  59173. for each number of neighbor alive cells, the low order bits specify
  59174. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  59175. higher number of neighbor cells.
  59176. For example the number 6153 = <code class="code">(12&lt;&lt;9)+9</code> specifies a stay alive
  59177. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  59178. </p>
  59179. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  59180. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  59181. cells, and will born a new cell if there are three alive cells around
  59182. a dead cell.
  59183. </p>
  59184. </dd>
  59185. <dt><samp class="option">size, s</samp></dt>
  59186. <dd><p>Set the size of the output video. For the syntax of this option, check the
  59187. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59188. </p>
  59189. <p>If <samp class="option">filename</samp> is specified, the size is set by default to the
  59190. same size of the input file. If <samp class="option">size</samp> is set, it must contain
  59191. the size specified in the input file, and the initial grid defined in
  59192. that file is centered in the larger resulting area.
  59193. </p>
  59194. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  59195. (used for a randomly generated initial grid).
  59196. </p>
  59197. </dd>
  59198. <dt><samp class="option">stitch</samp></dt>
  59199. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  59200. top and bottom edges also. Defaults to 1.
  59201. </p>
  59202. </dd>
  59203. <dt><samp class="option">mold</samp></dt>
  59204. <dd><p>Set cell mold speed. If set, a dead cell will go from <samp class="option">death_color</samp> to
  59205. <samp class="option">mold_color</samp> with a step of <samp class="option">mold</samp>. <samp class="option">mold</samp> can have a
  59206. value from 0 to 255.
  59207. </p>
  59208. </dd>
  59209. <dt><samp class="option">life_color</samp></dt>
  59210. <dd><p>Set the color of living (or new born) cells.
  59211. </p>
  59212. </dd>
  59213. <dt><samp class="option">death_color</samp></dt>
  59214. <dd><p>Set the color of dead cells. If <samp class="option">mold</samp> is set, this is the first color
  59215. used to represent a dead cell.
  59216. </p>
  59217. </dd>
  59218. <dt><samp class="option">mold_color</samp></dt>
  59219. <dd><p>Set mold color, for definitely dead and moldy cells.
  59220. </p>
  59221. <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
  59222. ffmpeg-utils manual</a>.
  59223. </p></dd>
  59224. </dl>
  59225. <a name="Examples-205"></a>
  59226. <h4 class="subsection">46.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-205" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-205" aria-hidden="true">TOC</a></span></h4>
  59227. <ul class="itemize mark-bullet">
  59228. <li>Read a grid from <samp class="file">pattern</samp>, and center it on a grid of size
  59229. 300x300 pixels:
  59230. <div class="example">
  59231. <pre class="example-preformatted">life=f=pattern:s=300x300
  59232. </pre></div>
  59233. </li><li>Generate a random grid of size 200x200, with a fill ratio of 2/3:
  59234. <div class="example">
  59235. <pre class="example-preformatted">life=ratio=2/3:s=200x200
  59236. </pre></div>
  59237. </li><li>Specify a custom rule for evolving a randomly generated grid:
  59238. <div class="example">
  59239. <pre class="example-preformatted">life=rule=S14/B34
  59240. </pre></div>
  59241. </li><li>Full example with slow death effect (mold) using <code class="command">ffplay</code>:
  59242. <div class="example">
  59243. <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
  59244. </pre></div>
  59245. </li></ul>
  59246. <a name="perlin"></a>
  59247. <h3 class="section">46.11 perlin<span class="pull-right"><a class="anchor hidden-xs" href="#perlin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perlin" aria-hidden="true">TOC</a></span></h3>
  59248. <p>Generate Perlin noise.
  59249. </p>
  59250. <p>Perlin noise is a kind of noise with local continuity in space. This
  59251. can be used to generate patterns with continuity in space and time,
  59252. e.g. to simulate smoke, fluids, or terrain.
  59253. </p>
  59254. <p>In case more than one octave is specified through the <samp class="option">octaves</samp>
  59255. option, Perlin noise is generated as a sum of components, each one
  59256. with doubled frequency. In this case the <samp class="option">persistence</samp> option
  59257. specify the ratio of the amplitude with respect to the previous
  59258. component. More octave components enable to specify more high
  59259. frequency details in the generated noise (e.g. small size variations
  59260. due to boulders in a generated terrain).
  59261. </p>
  59262. <a name="Options-126"></a>
  59263. <h4 class="subsection">46.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-126" aria-hidden="true">TOC</a></span></h4>
  59264. <dl class="table">
  59265. <dt><samp class="option">size, s</samp></dt>
  59266. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  59267. syntax of this option, check the
  59268. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59269. Default value is <code class="code">320x240</code>.
  59270. </p>
  59271. </dd>
  59272. <dt><samp class="option">rate, r</samp></dt>
  59273. <dd><p>Specify the frame rate expected for the video stream, expressed as a
  59274. number of frames per second. Default value is <code class="code">25</code>.
  59275. </p>
  59276. </dd>
  59277. <dt><samp class="option">octaves</samp></dt>
  59278. <dd><p>Specify the total number of components making up the noise, each one
  59279. with doubled frequency. Default value is <code class="code">1</code>.
  59280. </p>
  59281. </dd>
  59282. <dt><samp class="option">persistence</samp></dt>
  59283. <dd><p>Set the ratio used to compute the amplitude of the next octave
  59284. component with respect to the previous component amplitude. Default
  59285. value is <code class="code">1</code>.
  59286. </p>
  59287. </dd>
  59288. <dt><samp class="option">xscale</samp></dt>
  59289. <dt><samp class="option">yscale</samp></dt>
  59290. <dd><p>Define a scale factor used to multiple the x, y coordinates. This can
  59291. be useful to define an effect with a pattern stretched along the x or
  59292. y axis. Default value is <code class="code">1</code>.
  59293. </p>
  59294. </dd>
  59295. <dt><samp class="option">tscale</samp></dt>
  59296. <dd><p>Define a scale factor used to multiple the time coordinate. This can
  59297. be useful to change the time variation speed. Default value is <code class="code">1</code>.
  59298. </p>
  59299. </dd>
  59300. <dt><samp class="option">random_mode</samp></dt>
  59301. <dd><p>Set random mode used to compute initial pattern.
  59302. </p>
  59303. <p>Supported values are:
  59304. </p><dl class="table">
  59305. <dt><samp class="option">random</samp></dt>
  59306. <dd><p>Compute and use random seed.
  59307. </p>
  59308. </dd>
  59309. <dt><samp class="option">ken</samp></dt>
  59310. <dd><p>Use the predefined initial pattern defined by Ken Perlin in the
  59311. original article, can be useful to compare the output with other
  59312. sources.
  59313. </p>
  59314. </dd>
  59315. <dt><samp class="option">seed</samp></dt>
  59316. <dd><p>Use the value specified by <samp class="option">random_seed</samp> option.
  59317. </p></dd>
  59318. </dl>
  59319. <p>Default value is <code class="code">random</code>.
  59320. </p>
  59321. </dd>
  59322. <dt><samp class="option">random_seed, seed</samp></dt>
  59323. <dd><p>When <samp class="option">random_mode</samp> is set to <var class="var">random_seed</var>, use this value
  59324. to compute the initial pattern. Default value is <code class="code">0</code>.
  59325. </p></dd>
  59326. </dl>
  59327. <a name="Examples-206"></a>
  59328. <h4 class="subsection">46.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-206" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-206" aria-hidden="true">TOC</a></span></h4>
  59329. <ul class="itemize mark-bullet">
  59330. <li>Generate single component:
  59331. <div class="example">
  59332. <pre class="example-preformatted">perlin
  59333. </pre></div>
  59334. </li><li>Use Perlin noise with 7 components, each one with a halved contribution
  59335. to total amplitude:
  59336. <div class="example">
  59337. <pre class="example-preformatted">perlin=octaves=7:persistence=0.5
  59338. </pre></div>
  59339. </li><li>Chain Perlin noise with the <a class="ref" href="#lutyuv">lutyuv</a> to generate a black&amp;white
  59340. effect:
  59341. <div class="example">
  59342. <pre class="example-preformatted">perlin=octaves=3:tscale=0.3,lutyuv=y='if(lt(val\,128)\,255\,0)'
  59343. </pre></div>
  59344. </li><li>Stretch noise along the y axis, and convert gray level to red-only
  59345. signal:
  59346. <div class="example">
  59347. <pre class="example-preformatted">perlin=octaves=7:tscale=0.4:yscale=0.3,lutrgb=r=val:b=0:g=0
  59348. </pre></div>
  59349. </li></ul>
  59350. <a name="qrencodesrc"></a>
  59351. <h3 class="section">46.12 qrencodesrc<span class="pull-right"><a class="anchor hidden-xs" href="#qrencodesrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencodesrc" aria-hidden="true">TOC</a></span></h3>
  59352. <p>Generate a QR code using the libqrencode library (see
  59353. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>).
  59354. </p>
  59355. <p>To enable the compilation of this source, you need to configure FFmpeg with
  59356. <code class="code">--enable-libqrencode</code>.
  59357. </p>
  59358. <p>The QR code is generated from the provided text or text pattern. The
  59359. corresponding QR code is scaled and put in the video output according to the
  59360. specified output size options.
  59361. </p>
  59362. <p>In case no text is specified, the QR code is not generated, but an empty colored
  59363. output is returned instead.
  59364. </p>
  59365. <p>This source accepts the following options:
  59366. </p>
  59367. <dl class="table">
  59368. <dt><samp class="option">qrcode_width, q</samp></dt>
  59369. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  59370. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  59371. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  59372. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  59373. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  59374. there is no padding.
  59375. </p>
  59376. <p>These expressions are evaluated only once, when initializing the source.
  59377. See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  59378. </p>
  59379. <p>Note that some of the constants are missing for the source (for example the
  59380. <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
  59381. expression for each frame rather than at initialization time.
  59382. </p>
  59383. </dd>
  59384. <dt><samp class="option">rate, r</samp></dt>
  59385. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  59386. generated per second. It has to be a string in the format
  59387. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  59388. number or a valid video frame rate abbreviation. The default value is
  59389. &quot;25&quot;.
  59390. </p>
  59391. </dd>
  59392. <dt><samp class="option">case_sensitive, cs</samp></dt>
  59393. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  59394. default. This can be disabled to reduce the QR encoding size.
  59395. </p>
  59396. </dd>
  59397. <dt><samp class="option">level, l</samp></dt>
  59398. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  59399. the encoding size will increase but the code will be more robust to corruption.
  59400. Lower level is <var class="var">L</var>.
  59401. </p>
  59402. <p>It accepts the following values:
  59403. </p><dl class="table">
  59404. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  59405. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  59406. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  59407. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  59408. </dl>
  59409. </dd>
  59410. <dt><samp class="option">expansion</samp></dt>
  59411. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  59412. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  59413. section for details.
  59414. </p>
  59415. </dd>
  59416. <dt><samp class="option">text</samp></dt>
  59417. <dt><samp class="option">textfile</samp></dt>
  59418. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  59419. (just an empty colored frame).
  59420. </p>
  59421. <p>In case expansion is enabled, the text is treated as a text template, using the
  59422. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  59423. Text expansion</a> section for details.
  59424. </p>
  59425. </dd>
  59426. <dt><samp class="option">background_color, bc</samp></dt>
  59427. <dt><samp class="option">foreground_color, fc</samp></dt>
  59428. <dd><p>Set the QR code and background color. The default value of
  59429. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  59430. is &quot;white&quot;.
  59431. </p>
  59432. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  59433. section in the ffmpeg-utils manual</a>.
  59434. </p></dd>
  59435. </dl>
  59436. <a name="Examples-207"></a>
  59437. <h4 class="subsection">46.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-207" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-207" aria-hidden="true">TOC</a></span></h4>
  59438. <ul class="itemize mark-bullet">
  59439. <li>Generate a QR code encoding the specified text with the default size:
  59440. <div class="example">
  59441. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org
  59442. </pre></div>
  59443. </li><li>Same as below, but select blue on pink colors:
  59444. <div class="example">
  59445. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:bc=pink:fc=blue
  59446. </pre></div>
  59447. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  59448. 4/3 of the QR code width:
  59449. <div class="example">
  59450. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:q=200:Q=4/3*q
  59451. </pre></div>
  59452. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  59453. code width 3/4 of the padded width:
  59454. <div class="example">
  59455. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:Q=200:q=3/4*Q
  59456. </pre></div>
  59457. </li><li>Generate a QR code encoding the frame number:
  59458. <div class="example">
  59459. <pre class="example-preformatted">qrencodesrc=text=%{n}
  59460. </pre></div>
  59461. </li><li>Generate a QR code encoding the GMT timestamp:
  59462. <div class="example">
  59463. <pre class="example-preformatted">qrencodesrc=text=%{gmtime}
  59464. </pre></div>
  59465. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  59466. <div class="example">
  59467. <pre class="example-preformatted">qrencodesrc=text=%{pts}
  59468. </pre></div>
  59469. </li></ul>
  59470. <a class="anchor" id="allrgb"></a><a class="anchor" id="allyuv"></a><a class="anchor" id="color"></a><a class="anchor" id="colorchart"></a><a class="anchor" id="colorspectrum"></a><a class="anchor" id="haldclutsrc"></a><a class="anchor" id="nullsrc"></a><a class="anchor" id="pal75bars"></a><a class="anchor" id="pal100bars"></a><a class="anchor" id="rgbtestsrc"></a><a class="anchor" id="smptebars"></a><a class="anchor" id="smptehdbars"></a><a class="anchor" id="testsrc"></a><a class="anchor" id="testsrc2"></a><a class="anchor" id="yuvtestsrc"></a><a name="allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc"></a>
  59471. <h3 class="section">46.13 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" aria-hidden="true">TOC</a></span></h3>
  59472. <p>The <code class="code">allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  59473. </p>
  59474. <p>The <code class="code">allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  59475. </p>
  59476. <p>The <code class="code">color</code> source provides an uniformly colored input.
  59477. </p>
  59478. <p>The <code class="code">colorchart</code> source provides a colors checker chart.
  59479. </p>
  59480. <p>The <code class="code">colorspectrum</code> source provides a color spectrum input.
  59481. </p>
  59482. <p>The <code class="code">haldclutsrc</code> source provides an identity Hald CLUT. See also
  59483. <a class="ref" href="#haldclut">haldclut</a> filter.
  59484. </p>
  59485. <p>The <code class="code">nullsrc</code> source returns unprocessed video frames. It is
  59486. mainly useful to be employed in analysis / debugging tools, or as the
  59487. source for filters which ignore the input data.
  59488. </p>
  59489. <p>The <code class="code">pal75bars</code> source generates a color bars pattern, based on
  59490. EBU PAL recommendations with 75% color levels.
  59491. </p>
  59492. <p>The <code class="code">pal100bars</code> source generates a color bars pattern, based on
  59493. EBU PAL recommendations with 100% color levels.
  59494. </p>
  59495. <p>The <code class="code">rgbtestsrc</code> source generates an RGB test pattern useful for
  59496. detecting RGB vs BGR issues. You should see a red, green and blue
  59497. stripe from top to bottom.
  59498. </p>
  59499. <p>The <code class="code">smptebars</code> source generates a color bars pattern, based on
  59500. the SMPTE Engineering Guideline EG 1-1990.
  59501. </p>
  59502. <p>The <code class="code">smptehdbars</code> source generates a color bars pattern, based on
  59503. the SMPTE RP 219-2002.
  59504. </p>
  59505. <p>The <code class="code">testsrc</code> source generates a test video pattern, showing a
  59506. color pattern, a scrolling gradient and a timestamp. This is mainly
  59507. intended for testing purposes.
  59508. </p>
  59509. <p>The <code class="code">testsrc2</code> source is similar to testsrc, but supports more
  59510. pixel formats instead of just <code class="code">rgb24</code>. This allows using it as an
  59511. input for other tests without requiring a format conversion.
  59512. </p>
  59513. <p>The <code class="code">yuvtestsrc</code> source generates an YUV test pattern. You should
  59514. see a y, cb and cr stripe from top to bottom.
  59515. </p>
  59516. <p>The sources accept the following parameters:
  59517. </p>
  59518. <dl class="table">
  59519. <dt><samp class="option">level</samp></dt>
  59520. <dd><p>Specify the level of the Hald CLUT, only available in the <code class="code">haldclutsrc</code>
  59521. 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>
  59522. pixels to be used as identity matrix for 3D lookup tables. Each component is
  59523. coded on a <code class="code">1/(N*N)</code> scale.
  59524. </p>
  59525. </dd>
  59526. <dt><samp class="option">color, c</samp></dt>
  59527. <dd><p>Specify the color of the source, only available in the <code class="code">color</code>
  59528. source. For the syntax of this option, check the
  59529. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  59530. </p>
  59531. </dd>
  59532. <dt><samp class="option">size, s</samp></dt>
  59533. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  59534. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59535. The default value is <code class="code">320x240</code>.
  59536. </p>
  59537. <p>This option is not available with the <code class="code">allrgb</code>, <code class="code">allyuv</code>, and
  59538. <code class="code">haldclutsrc</code> filters.
  59539. </p>
  59540. </dd>
  59541. <dt><samp class="option">rate, r</samp></dt>
  59542. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  59543. generated per second. It has to be a string in the format
  59544. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  59545. number or a valid video frame rate abbreviation. The default value is
  59546. &quot;25&quot;.
  59547. </p>
  59548. </dd>
  59549. <dt><samp class="option">duration, d</samp></dt>
  59550. <dd><p>Set the duration of the sourced video. See
  59551. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  59552. for the accepted syntax.
  59553. </p>
  59554. <p>If not specified, or the expressed duration is negative, the video is
  59555. supposed to be generated forever.
  59556. </p>
  59557. <p>Since the frame rate is used as time base, all frames including the last one
  59558. will have their full duration. If the specified duration is not a multiple
  59559. of the frame duration, it will be rounded up.
  59560. </p>
  59561. </dd>
  59562. <dt><samp class="option">sar</samp></dt>
  59563. <dd><p>Set the sample aspect ratio of the sourced video.
  59564. </p>
  59565. </dd>
  59566. <dt><samp class="option">alpha</samp></dt>
  59567. <dd><p>Specify the alpha (opacity) of the background, only available in the
  59568. <code class="code">testsrc2</code> source. The value must be between 0 (fully transparent) and
  59569. 255 (fully opaque, the default).
  59570. </p>
  59571. </dd>
  59572. <dt><samp class="option">decimals, n</samp></dt>
  59573. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  59574. <code class="code">testsrc</code> source.
  59575. </p>
  59576. <p>The displayed timestamp value will correspond to the original
  59577. timestamp value multiplied by the power of 10 of the specified
  59578. value. Default value is 0.
  59579. </p>
  59580. </dd>
  59581. <dt><samp class="option">type</samp></dt>
  59582. <dd><p>Set the type of the color spectrum, only available in the
  59583. <code class="code">colorspectrum</code> source. Can be one of the following:
  59584. </p>
  59585. <dl class="table">
  59586. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  59587. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  59588. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  59589. </dl>
  59590. </dd>
  59591. <dt><samp class="option">patch_size</samp></dt>
  59592. <dd><p>Set patch size of single color patch, only available in the
  59593. <code class="code">colorchart</code> source. Default is <code class="code">64x64</code>.
  59594. </p>
  59595. </dd>
  59596. <dt><samp class="option">preset</samp></dt>
  59597. <dd><p>Set colorchecker colors preset, only available in the
  59598. <code class="code">colorchart</code> source.
  59599. </p>
  59600. <p>Available values are:
  59601. </p><dl class="table">
  59602. <dt>&lsquo;<samp class="samp">reference</samp>&rsquo;</dt>
  59603. <dt>&lsquo;<samp class="samp">skintones</samp>&rsquo;</dt>
  59604. </dl>
  59605. <p>Default value is <code class="code">reference</code>.
  59606. </p></dd>
  59607. </dl>
  59608. <a name="Examples-208"></a>
  59609. <h4 class="subsection">46.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-208" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-208" aria-hidden="true">TOC</a></span></h4>
  59610. <ul class="itemize mark-bullet">
  59611. <li>Generate a video with a duration of 5.3 seconds, with size
  59612. 176x144 and a frame rate of 10 frames per second:
  59613. <div class="example">
  59614. <pre class="example-preformatted">testsrc=duration=5.3:size=qcif:rate=10
  59615. </pre></div>
  59616. </li><li>The following graph description will generate a red source
  59617. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  59618. frames per second:
  59619. <div class="example">
  59620. <pre class="example-preformatted">color=c=red@0.2:s=qcif:r=10
  59621. </pre></div>
  59622. </li><li>If the input content is to be ignored, <code class="code">nullsrc</code> can be used. The
  59623. following command generates noise in the luma plane by employing
  59624. the <code class="code">geq</code> filter:
  59625. <div class="example">
  59626. <pre class="example-preformatted">nullsrc=s=256x256, geq=random(1)*255:128:128
  59627. </pre></div>
  59628. </li></ul>
  59629. <a name="Commands-157"></a>
  59630. <h4 class="subsection">46.13.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-157" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-157" aria-hidden="true">TOC</a></span></h4>
  59631. <p>The <code class="code">color</code> source supports the following commands:
  59632. </p>
  59633. <dl class="table">
  59634. <dt><samp class="option">c, color</samp></dt>
  59635. <dd><p>Set the color of the created image. Accepts the same syntax of the
  59636. corresponding <samp class="option">color</samp> option.
  59637. </p></dd>
  59638. </dl>
  59639. <a name="openclsrc"></a>
  59640. <h3 class="section">46.14 openclsrc<span class="pull-right"><a class="anchor hidden-xs" href="#openclsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openclsrc" aria-hidden="true">TOC</a></span></h3>
  59641. <p>Generate video using an OpenCL program.
  59642. </p>
  59643. <dl class="table">
  59644. <dt><samp class="option">source</samp></dt>
  59645. <dd><p>OpenCL program source file.
  59646. </p>
  59647. </dd>
  59648. <dt><samp class="option">kernel</samp></dt>
  59649. <dd><p>Kernel name in program.
  59650. </p>
  59651. </dd>
  59652. <dt><samp class="option">size, s</samp></dt>
  59653. <dd><p>Size of frames to generate. This must be set.
  59654. </p>
  59655. </dd>
  59656. <dt><samp class="option">format</samp></dt>
  59657. <dd><p>Pixel format to use for the generated frames. This must be set.
  59658. </p>
  59659. </dd>
  59660. <dt><samp class="option">rate, r</samp></dt>
  59661. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  59662. </p>
  59663. </dd>
  59664. </dl>
  59665. <p>For details of how the program loading works, see the <a class="ref" href="#program_005fopencl">program_opencl</a>
  59666. filter.
  59667. </p>
  59668. <p>Example programs:
  59669. </p>
  59670. <ul class="itemize mark-bullet">
  59671. <li>Generate a colour ramp by setting pixel values from the position of the pixel
  59672. in the output image. (Note that this will work with all pixel formats, but
  59673. the generated output will not be the same.)
  59674. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  59675. unsigned int index)
  59676. {
  59677. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  59678. float4 val;
  59679. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  59680. write_imagef(dst, loc, val);
  59681. }
  59682. </pre>
  59683. </li><li>Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  59684. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  59685. unsigned int index)
  59686. {
  59687. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  59688. float4 value = 0.0f;
  59689. int x = loc.x + index;
  59690. int y = loc.y + index;
  59691. while (x &gt; 0 || y &gt; 0) {
  59692. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  59693. value = 1.0f;
  59694. break;
  59695. }
  59696. x /= 3;
  59697. y /= 3;
  59698. }
  59699. write_imagef(dst, loc, value);
  59700. }
  59701. </pre>
  59702. </li></ul>
  59703. <a name="sierpinski"></a>
  59704. <h3 class="section">46.15 sierpinski<span class="pull-right"><a class="anchor hidden-xs" href="#sierpinski" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sierpinski" aria-hidden="true">TOC</a></span></h3>
  59705. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  59706. </p>
  59707. <p>This source accepts the following options:
  59708. </p>
  59709. <dl class="table">
  59710. <dt><samp class="option">size, s</samp></dt>
  59711. <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
  59712. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  59713. </p>
  59714. </dd>
  59715. <dt><samp class="option">rate, r</samp></dt>
  59716. <dd><p>Set frame rate, expressed as number of frames per second. Default
  59717. value is &quot;25&quot;.
  59718. </p>
  59719. </dd>
  59720. <dt><samp class="option">seed</samp></dt>
  59721. <dd><p>Set seed which is used for random panning.
  59722. </p>
  59723. </dd>
  59724. <dt><samp class="option">jump</samp></dt>
  59725. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  59726. </p>
  59727. </dd>
  59728. <dt><samp class="option">type</samp></dt>
  59729. <dd><p>Set fractal type, can be default <code class="code">carpet</code> or <code class="code">triangle</code>.
  59730. </p></dd>
  59731. </dl>
  59732. <a name="zoneplate"></a>
  59733. <h3 class="section">46.16 zoneplate<span class="pull-right"><a class="anchor hidden-xs" href="#zoneplate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zoneplate" aria-hidden="true">TOC</a></span></h3>
  59734. <p>Generate a zoneplate test video pattern.
  59735. </p>
  59736. <p>This source accepts the following options:
  59737. </p>
  59738. <dl class="table">
  59739. <dt><samp class="option">size, s</samp></dt>
  59740. <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
  59741. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;320x240&quot;.
  59742. </p>
  59743. </dd>
  59744. <dt><samp class="option">rate, r</samp></dt>
  59745. <dd><p>Set frame rate, expressed as number of frames per second. Default
  59746. value is &quot;25&quot;.
  59747. </p>
  59748. </dd>
  59749. <dt><samp class="option">duration, d</samp></dt>
  59750. <dd><p>Set the duration of the sourced video. See
  59751. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  59752. for the accepted syntax.
  59753. </p>
  59754. <p>If not specified, or the expressed duration is negative, the video is
  59755. supposed to be generated forever.
  59756. </p>
  59757. </dd>
  59758. <dt><samp class="option">sar</samp></dt>
  59759. <dd><p>Set the sample aspect ratio of the sourced video.
  59760. </p>
  59761. </dd>
  59762. <dt><samp class="option">precision</samp></dt>
  59763. <dd><p>Set precision in bits for look-up table for sine calculations. Default value is 10.
  59764. Allowed range is from 4 to 16.
  59765. </p>
  59766. </dd>
  59767. <dt><samp class="option">xo</samp></dt>
  59768. <dd><p>Set horizontal axis offset for output signal. Default value is 0.
  59769. </p>
  59770. </dd>
  59771. <dt><samp class="option">yo</samp></dt>
  59772. <dd><p>Set vertical axis offset for output signal. Default value is 0.
  59773. </p>
  59774. </dd>
  59775. <dt><samp class="option">to</samp></dt>
  59776. <dd><p>Set time axis offset for output signal. Default value is 0.
  59777. </p>
  59778. </dd>
  59779. <dt><samp class="option">k0</samp></dt>
  59780. <dd><p>Set 0-order, constant added to signal phase. Default value is 0.
  59781. </p>
  59782. </dd>
  59783. <dt><samp class="option">kx</samp></dt>
  59784. <dd><p>Set 1-order, phase factor multiplier for horizontal axis. Default value is 0.
  59785. </p>
  59786. </dd>
  59787. <dt><samp class="option">ky</samp></dt>
  59788. <dd><p>Set 1-order, phase factor multiplier for vertical axis. Default value is 0.
  59789. </p>
  59790. </dd>
  59791. <dt><samp class="option">kt</samp></dt>
  59792. <dd><p>Set 1-order, phase factor multiplier for time axis. Default value is 0.
  59793. </p>
  59794. </dd>
  59795. <dt><samp class="option">kxt, kyt, kxy</samp></dt>
  59796. <dd><p>Set phase factor multipliers for combination of spatial and temporal axis.
  59797. Default value is 0.
  59798. </p>
  59799. </dd>
  59800. <dt><samp class="option">kx2</samp></dt>
  59801. <dd><p>Set 2-order, phase factor multiplier for horizontal axis. Default value is 0.
  59802. </p>
  59803. </dd>
  59804. <dt><samp class="option">ky2</samp></dt>
  59805. <dd><p>Set 2-order, phase factor multiplier for vertical axis. Default value is 0.
  59806. </p>
  59807. </dd>
  59808. <dt><samp class="option">kt2</samp></dt>
  59809. <dd><p>Set 2-order, phase factor multiplier for time axis. Default value is 0.
  59810. </p>
  59811. </dd>
  59812. <dt><samp class="option">ku</samp></dt>
  59813. <dd><p>Set the constant added to final phase to produce chroma-blue component of signal.
  59814. Default value is 0.
  59815. </p>
  59816. </dd>
  59817. <dt><samp class="option">kv</samp></dt>
  59818. <dd><p>Set the constant added to final phase to produce chroma-red component of signal.
  59819. Default value is 0.
  59820. </p></dd>
  59821. </dl>
  59822. <a name="Commands-158"></a>
  59823. <h4 class="subsection">46.16.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-158" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-158" aria-hidden="true">TOC</a></span></h4>
  59824. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  59825. </p>
  59826. <a name="Examples-209"></a>
  59827. <h4 class="subsection">46.16.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-209" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-209" aria-hidden="true">TOC</a></span></h4>
  59828. <ul class="itemize mark-bullet">
  59829. <li>Generate horizontal color sine sweep:
  59830. <div class="example">
  59831. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
  59832. </pre></div>
  59833. </li><li>Generate vertical color sine sweep:
  59834. <div class="example">
  59835. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
  59836. </pre></div>
  59837. </li><li>Generate circular zone-plate:
  59838. <div class="example">
  59839. <pre class="example-preformatted">zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
  59840. </pre></div>
  59841. </li></ul>
  59842. <a name="Video-Sinks"></a>
  59843. <h2 class="chapter">47 Video Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sinks" aria-hidden="true">TOC</a></span></h2>
  59844. <p>Below is a description of the currently available video sinks.
  59845. </p>
  59846. <a name="buffersink"></a>
  59847. <h3 class="section">47.1 buffersink<span class="pull-right"><a class="anchor hidden-xs" href="#buffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffersink" aria-hidden="true">TOC</a></span></h3>
  59848. <p>Buffer video frames, and make them available to the end of the filter
  59849. graph.
  59850. </p>
  59851. <p>This sink is mainly intended for programmatic use, in particular
  59852. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  59853. or the options system.
  59854. </p>
  59855. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  59856. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  59857. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  59858. </p>
  59859. <a name="nullsink"></a>
  59860. <h3 class="section">47.2 nullsink<span class="pull-right"><a class="anchor hidden-xs" href="#nullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nullsink" aria-hidden="true">TOC</a></span></h3>
  59861. <p>Null video sink: do absolutely nothing with the input video. It is
  59862. mainly useful as a template and for use in analysis / debugging
  59863. tools.
  59864. </p>
  59865. <a name="Multimedia-Filters"></a>
  59866. <h2 class="chapter">48 Multimedia Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Filters" aria-hidden="true">TOC</a></span></h2>
  59867. <p>Below is a description of the currently available multimedia filters.
  59868. </p>
  59869. <a name="a3dscope"></a>
  59870. <h3 class="section">48.1 a3dscope<span class="pull-right"><a class="anchor hidden-xs" href="#a3dscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-a3dscope" aria-hidden="true">TOC</a></span></h3>
  59871. <p>Convert input audio to 3d scope video output.
  59872. </p>
  59873. <p>The filter accepts the following options:
  59874. </p>
  59875. <dl class="table">
  59876. <dt><samp class="option">rate, r</samp></dt>
  59877. <dd><p>Set frame rate, expressed as number of frames per second. Default
  59878. value is &quot;25&quot;.
  59879. </p>
  59880. </dd>
  59881. <dt><samp class="option">size, s</samp></dt>
  59882. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  59883. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59884. Default value is <code class="code">hd720</code>.
  59885. </p>
  59886. </dd>
  59887. <dt><samp class="option">fov</samp></dt>
  59888. <dd><p>Set the camera field of view. Default is 90 degrees.
  59889. Allowed range is from 40 to 150.
  59890. </p>
  59891. </dd>
  59892. <dt><samp class="option">roll</samp></dt>
  59893. <dd><p>Set the camera roll.
  59894. </p>
  59895. </dd>
  59896. <dt><samp class="option">pitch</samp></dt>
  59897. <dd><p>Set the camera pitch.
  59898. </p>
  59899. </dd>
  59900. <dt><samp class="option">yaw</samp></dt>
  59901. <dd><p>Set the camera yaw.
  59902. </p>
  59903. </dd>
  59904. <dt><samp class="option">xzoom</samp></dt>
  59905. <dd><p>Set the camera zoom on X-axis.
  59906. </p>
  59907. </dd>
  59908. <dt><samp class="option">yzoom</samp></dt>
  59909. <dd><p>Set the camera zoom on Y-axis.
  59910. </p>
  59911. </dd>
  59912. <dt><samp class="option">zzoom</samp></dt>
  59913. <dd><p>Set the camera zoom on Z-axis.
  59914. </p>
  59915. </dd>
  59916. <dt><samp class="option">xpos</samp></dt>
  59917. <dd><p>Set the camera position on X-axis.
  59918. </p>
  59919. </dd>
  59920. <dt><samp class="option">ypos</samp></dt>
  59921. <dd><p>Set the camera position on Y-axis.
  59922. </p>
  59923. </dd>
  59924. <dt><samp class="option">zpos</samp></dt>
  59925. <dd><p>Set the camera position on Z-axis.
  59926. </p>
  59927. </dd>
  59928. <dt><samp class="option">length</samp></dt>
  59929. <dd><p>Set the length of displayed audio waves in number of frames.
  59930. </p></dd>
  59931. </dl>
  59932. <a name="Commands-159"></a>
  59933. <h4 class="subsection">48.1.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-159" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-159" aria-hidden="true">TOC</a></span></h4>
  59934. <p>Filter supports the some above options as <a class="ref" href="#commands">commands</a>.
  59935. </p>
  59936. <a name="abitscope"></a>
  59937. <h3 class="section">48.2 abitscope<span class="pull-right"><a class="anchor hidden-xs" href="#abitscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abitscope" aria-hidden="true">TOC</a></span></h3>
  59938. <p>Convert input audio to a video output, displaying the audio bit scope.
  59939. </p>
  59940. <p>The filter accepts the following options:
  59941. </p>
  59942. <dl class="table">
  59943. <dt><samp class="option">rate, r</samp></dt>
  59944. <dd><p>Set frame rate, expressed as number of frames per second. Default
  59945. value is &quot;25&quot;.
  59946. </p>
  59947. </dd>
  59948. <dt><samp class="option">size, s</samp></dt>
  59949. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  59950. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59951. Default value is <code class="code">1024x256</code>.
  59952. </p>
  59953. </dd>
  59954. <dt><samp class="option">colors</samp></dt>
  59955. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  59956. draw channels. Unrecognized or missing colors will be replaced
  59957. by white color.
  59958. </p>
  59959. </dd>
  59960. <dt><samp class="option">mode, m</samp></dt>
  59961. <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>.
  59962. </p></dd>
  59963. </dl>
  59964. <a name="adrawgraph"></a>
  59965. <h3 class="section">48.3 adrawgraph<span class="pull-right"><a class="anchor hidden-xs" href="#adrawgraph" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adrawgraph" aria-hidden="true">TOC</a></span></h3>
  59966. <p>Draw a graph using input audio metadata.
  59967. </p>
  59968. <p>See <a class="ref" href="#drawgraph">drawgraph</a>
  59969. </p>
  59970. <a name="agraphmonitor"></a>
  59971. <h3 class="section">48.4 agraphmonitor<span class="pull-right"><a class="anchor hidden-xs" href="#agraphmonitor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-agraphmonitor" aria-hidden="true">TOC</a></span></h3>
  59972. <p>See <a class="ref" href="#graphmonitor">graphmonitor</a>.
  59973. </p>
  59974. <a name="ahistogram"></a>
  59975. <h3 class="section">48.5 ahistogram<span class="pull-right"><a class="anchor hidden-xs" href="#ahistogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ahistogram" aria-hidden="true">TOC</a></span></h3>
  59976. <p>Convert input audio to a video output, displaying the volume histogram.
  59977. </p>
  59978. <p>The filter accepts the following options:
  59979. </p>
  59980. <dl class="table">
  59981. <dt><samp class="option">dmode</samp></dt>
  59982. <dd><p>Specify how histogram is calculated.
  59983. </p>
  59984. <p>It accepts the following values:
  59985. </p><dl class="table">
  59986. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  59987. <dd><p>Use single histogram for all channels.
  59988. </p></dd>
  59989. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  59990. <dd><p>Use separate histogram for each channel.
  59991. </p></dd>
  59992. </dl>
  59993. <p>Default is <code class="code">single</code>.
  59994. </p>
  59995. </dd>
  59996. <dt><samp class="option">rate, r</samp></dt>
  59997. <dd><p>Set frame rate, expressed as number of frames per second. Default
  59998. value is &quot;25&quot;.
  59999. </p>
  60000. </dd>
  60001. <dt><samp class="option">size, s</samp></dt>
  60002. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  60003. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60004. Default value is <code class="code">hd720</code>.
  60005. </p>
  60006. </dd>
  60007. <dt><samp class="option">scale</samp></dt>
  60008. <dd><p>Set display scale.
  60009. </p>
  60010. <p>It accepts the following values:
  60011. </p><dl class="table">
  60012. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  60013. <dd><p>logarithmic
  60014. </p></dd>
  60015. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  60016. <dd><p>square root
  60017. </p></dd>
  60018. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  60019. <dd><p>cubic root
  60020. </p></dd>
  60021. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  60022. <dd><p>linear
  60023. </p></dd>
  60024. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  60025. <dd><p>reverse logarithmic
  60026. </p></dd>
  60027. </dl>
  60028. <p>Default is <code class="code">log</code>.
  60029. </p>
  60030. </dd>
  60031. <dt><samp class="option">ascale</samp></dt>
  60032. <dd><p>Set amplitude scale.
  60033. </p>
  60034. <p>It accepts the following values:
  60035. </p><dl class="table">
  60036. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  60037. <dd><p>logarithmic
  60038. </p></dd>
  60039. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  60040. <dd><p>linear
  60041. </p></dd>
  60042. </dl>
  60043. <p>Default is <code class="code">log</code>.
  60044. </p>
  60045. </dd>
  60046. <dt><samp class="option">acount</samp></dt>
  60047. <dd><p>Set how much frames to accumulate in histogram.
  60048. Default is 1. Setting this to -1 accumulates all frames.
  60049. </p>
  60050. </dd>
  60051. <dt><samp class="option">rheight</samp></dt>
  60052. <dd><p>Set histogram ratio of window height.
  60053. </p>
  60054. </dd>
  60055. <dt><samp class="option">slide</samp></dt>
  60056. <dd><p>Set sonogram sliding.
  60057. </p>
  60058. <p>It accepts the following values:
  60059. </p><dl class="table">
  60060. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  60061. <dd><p>replace old rows with new ones.
  60062. </p></dd>
  60063. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  60064. <dd><p>scroll from top to bottom.
  60065. </p></dd>
  60066. </dl>
  60067. <p>Default is <code class="code">replace</code>.
  60068. </p>
  60069. </dd>
  60070. <dt><samp class="option">hmode</samp></dt>
  60071. <dd><p>Set histogram mode.
  60072. </p>
  60073. <p>It accepts the following values:
  60074. </p><dl class="table">
  60075. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  60076. <dd><p>Use absolute values of samples.
  60077. </p></dd>
  60078. <dt>&lsquo;<samp class="samp">sign</samp>&rsquo;</dt>
  60079. <dd><p>Use untouched values of samples.
  60080. </p></dd>
  60081. </dl>
  60082. <p>Default is <code class="code">abs</code>.
  60083. </p></dd>
  60084. </dl>
  60085. <a name="aphasemeter"></a>
  60086. <h3 class="section">48.6 aphasemeter<span class="pull-right"><a class="anchor hidden-xs" href="#aphasemeter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphasemeter" aria-hidden="true">TOC</a></span></h3>
  60087. <p>Measures phase of input audio, which is exported as metadata <code class="code">lavfi.aphasemeter.phase</code>,
  60088. representing mean phase of current audio frame. A video output can also be produced and is
  60089. enabled by default. The audio is passed through as first output.
  60090. </p>
  60091. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  60092. range <code class="code">[-1, 1]</code> where <code class="code">-1</code> means left and right channels are completely out of phase
  60093. and <code class="code">1</code> means channels are in phase.
  60094. </p>
  60095. <p>The filter accepts the following options, all related to its video output:
  60096. </p>
  60097. <dl class="table">
  60098. <dt><samp class="option">rate, r</samp></dt>
  60099. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  60100. </p>
  60101. </dd>
  60102. <dt><samp class="option">size, s</samp></dt>
  60103. <dd><p>Set the video size for the output. For the syntax of this option, check the
  60104. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60105. Default value is <code class="code">800x400</code>.
  60106. </p>
  60107. </dd>
  60108. <dt><samp class="option">rc</samp></dt>
  60109. <dt><samp class="option">gc</samp></dt>
  60110. <dt><samp class="option">bc</samp></dt>
  60111. <dd><p>Specify the red, green, blue contrast. Default values are <code class="code">2</code>,
  60112. <code class="code">7</code> and <code class="code">1</code>.
  60113. Allowed range is <code class="code">[0, 255]</code>.
  60114. </p>
  60115. </dd>
  60116. <dt><samp class="option">mpc</samp></dt>
  60117. <dd><p>Set color which will be used for drawing median phase. If color is
  60118. <code class="code">none</code> which is default, no median phase value will be drawn.
  60119. </p>
  60120. </dd>
  60121. <dt><samp class="option">video</samp></dt>
  60122. <dd><p>Enable video output. Default is enabled.
  60123. </p></dd>
  60124. </dl>
  60125. <a name="phasing-detection"></a>
  60126. <h4 class="subsection">48.6.1 phasing detection<span class="pull-right"><a class="anchor hidden-xs" href="#phasing-detection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phasing-detection" aria-hidden="true">TOC</a></span></h4>
  60127. <p>The filter also detects out of phase and mono sequences in stereo streams.
  60128. It logs the sequence start, end and duration when it lasts longer or as long as the minimum set.
  60129. </p>
  60130. <p>The filter accepts the following options for this detection:
  60131. </p>
  60132. <dl class="table">
  60133. <dt><samp class="option">phasing</samp></dt>
  60134. <dd><p>Enable mono and out of phase detection. Default is disabled.
  60135. </p>
  60136. </dd>
  60137. <dt><samp class="option">tolerance, t</samp></dt>
  60138. <dd><p>Set phase tolerance for mono detection, in amplitude ratio. Default is <code class="code">0</code>.
  60139. Allowed range is <code class="code">[0, 1]</code>.
  60140. </p>
  60141. </dd>
  60142. <dt><samp class="option">angle, a</samp></dt>
  60143. <dd><p>Set angle threshold for out of phase detection, in degree. Default is <code class="code">170</code>.
  60144. Allowed range is <code class="code">[90, 180]</code>.
  60145. </p>
  60146. </dd>
  60147. <dt><samp class="option">duration, d</samp></dt>
  60148. <dd><p>Set mono or out of phase duration until notification, expressed in seconds. Default is <code class="code">2</code>.
  60149. </p></dd>
  60150. </dl>
  60151. <a name="Examples-210"></a>
  60152. <h4 class="subsection">48.6.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-210" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-210" aria-hidden="true">TOC</a></span></h4>
  60153. <ul class="itemize mark-bullet">
  60154. <li>Complete example with <code class="command">ffmpeg</code> to detect 1 second of mono with 0.001 phase tolerance:
  60155. <div class="example">
  60156. <pre class="example-preformatted">ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
  60157. </pre></div>
  60158. </li></ul>
  60159. <a name="avectorscope"></a>
  60160. <h3 class="section">48.7 avectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#avectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avectorscope" aria-hidden="true">TOC</a></span></h3>
  60161. <p>Convert input audio to a video output, representing the audio vector
  60162. scope.
  60163. </p>
  60164. <p>The filter is used to measure the difference between channels of stereo
  60165. audio stream. A monaural signal, consisting of identical left and right
  60166. signal, results in straight vertical line. Any stereo separation is visible
  60167. as a deviation from this line, creating a Lissajous figure.
  60168. If the straight (or deviation from it) but horizontal line appears this
  60169. indicates that the left and right channels are out of phase.
  60170. </p>
  60171. <p>The filter accepts the following options:
  60172. </p>
  60173. <dl class="table">
  60174. <dt><samp class="option">mode, m</samp></dt>
  60175. <dd><p>Set the vectorscope mode.
  60176. </p>
  60177. <p>Available values are:
  60178. </p><dl class="table">
  60179. <dt>&lsquo;<samp class="samp">lissajous</samp>&rsquo;</dt>
  60180. <dd><p>Lissajous rotated by 45 degrees.
  60181. </p>
  60182. </dd>
  60183. <dt>&lsquo;<samp class="samp">lissajous_xy</samp>&rsquo;</dt>
  60184. <dd><p>Same as above but not rotated.
  60185. </p>
  60186. </dd>
  60187. <dt>&lsquo;<samp class="samp">polar</samp>&rsquo;</dt>
  60188. <dd><p>Shape resembling half of circle.
  60189. </p></dd>
  60190. </dl>
  60191. <p>Default value is &lsquo;<samp class="samp">lissajous</samp>&rsquo;.
  60192. </p>
  60193. </dd>
  60194. <dt><samp class="option">size, s</samp></dt>
  60195. <dd><p>Set the video size for the output. For the syntax of this option, check the
  60196. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60197. Default value is <code class="code">400x400</code>.
  60198. </p>
  60199. </dd>
  60200. <dt><samp class="option">rate, r</samp></dt>
  60201. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  60202. </p>
  60203. </dd>
  60204. <dt><samp class="option">rc</samp></dt>
  60205. <dt><samp class="option">gc</samp></dt>
  60206. <dt><samp class="option">bc</samp></dt>
  60207. <dt><samp class="option">ac</samp></dt>
  60208. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code class="code">40</code>,
  60209. <code class="code">160</code>, <code class="code">80</code> and <code class="code">255</code>.
  60210. Allowed range is <code class="code">[0, 255]</code>.
  60211. </p>
  60212. </dd>
  60213. <dt><samp class="option">rf</samp></dt>
  60214. <dt><samp class="option">gf</samp></dt>
  60215. <dt><samp class="option">bf</samp></dt>
  60216. <dt><samp class="option">af</samp></dt>
  60217. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code class="code">15</code>,
  60218. <code class="code">10</code>, <code class="code">5</code> and <code class="code">5</code>.
  60219. Allowed range is <code class="code">[0, 255]</code>.
  60220. </p>
  60221. </dd>
  60222. <dt><samp class="option">zoom</samp></dt>
  60223. <dd><p>Set the zoom factor. Default value is <code class="code">1</code>. Allowed range is <code class="code">[0, 10]</code>.
  60224. Values lower than <var class="var">1</var> will auto adjust zoom factor to maximal possible value.
  60225. </p>
  60226. </dd>
  60227. <dt><samp class="option">draw</samp></dt>
  60228. <dd><p>Set the vectorscope drawing mode.
  60229. </p>
  60230. <p>Available values are:
  60231. </p><dl class="table">
  60232. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  60233. <dd><p>Draw dot for each sample.
  60234. </p>
  60235. </dd>
  60236. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  60237. <dd><p>Draw line between previous and current sample.
  60238. </p>
  60239. </dd>
  60240. <dt>&lsquo;<samp class="samp">aaline</samp>&rsquo;</dt>
  60241. <dd><p>Draw anti-aliased line between previous and current sample.
  60242. </p></dd>
  60243. </dl>
  60244. <p>Default value is &lsquo;<samp class="samp">dot</samp>&rsquo;.
  60245. </p>
  60246. </dd>
  60247. <dt><samp class="option">scale</samp></dt>
  60248. <dd><p>Specify amplitude scale of audio samples.
  60249. </p>
  60250. <p>Available values are:
  60251. </p><dl class="table">
  60252. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  60253. <dd><p>Linear.
  60254. </p>
  60255. </dd>
  60256. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  60257. <dd><p>Square root.
  60258. </p>
  60259. </dd>
  60260. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  60261. <dd><p>Cubic root.
  60262. </p>
  60263. </dd>
  60264. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  60265. <dd><p>Logarithmic.
  60266. </p></dd>
  60267. </dl>
  60268. </dd>
  60269. <dt><samp class="option">swap</samp></dt>
  60270. <dd><p>Swap left channel axis with right channel axis.
  60271. </p>
  60272. </dd>
  60273. <dt><samp class="option">mirror</samp></dt>
  60274. <dd><p>Mirror axis.
  60275. </p>
  60276. <dl class="table">
  60277. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  60278. <dd><p>No mirror.
  60279. </p>
  60280. </dd>
  60281. <dt>&lsquo;<samp class="samp">x</samp>&rsquo;</dt>
  60282. <dd><p>Mirror only x axis.
  60283. </p>
  60284. </dd>
  60285. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  60286. <dd><p>Mirror only y axis.
  60287. </p>
  60288. </dd>
  60289. <dt>&lsquo;<samp class="samp">xy</samp>&rsquo;</dt>
  60290. <dd><p>Mirror both axis.
  60291. </p></dd>
  60292. </dl>
  60293. </dd>
  60294. </dl>
  60295. <a name="Examples-211"></a>
  60296. <h4 class="subsection">48.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-211" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-211" aria-hidden="true">TOC</a></span></h4>
  60297. <ul class="itemize mark-bullet">
  60298. <li>Complete example using <code class="command">ffplay</code>:
  60299. <div class="example">
  60300. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  60301. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  60302. </pre></div>
  60303. </li></ul>
  60304. <a name="Commands-160"></a>
  60305. <h4 class="subsection">48.7.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-160" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-160" aria-hidden="true">TOC</a></span></h4>
  60306. <p>This filter supports the all above options as commands except options <code class="code">size</code> and <code class="code">rate</code>.
  60307. </p>
  60308. <a name="bench_002c-abench"></a>
  60309. <h3 class="section">48.8 bench, abench<span class="pull-right"><a class="anchor hidden-xs" href="#bench_002c-abench" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bench_002c-abench" aria-hidden="true">TOC</a></span></h3>
  60310. <p>Benchmark part of a filtergraph.
  60311. </p>
  60312. <p>The filter accepts the following options:
  60313. </p>
  60314. <dl class="table">
  60315. <dt><samp class="option">action</samp></dt>
  60316. <dd><p>Start or stop a timer.
  60317. </p>
  60318. <p>Available values are:
  60319. </p><dl class="table">
  60320. <dt>&lsquo;<samp class="samp">start</samp>&rsquo;</dt>
  60321. <dd><p>Get the current time, set it as frame metadata (using the key
  60322. <code class="code">lavfi.bench.start_time</code>), and forward the frame to the next filter.
  60323. </p>
  60324. </dd>
  60325. <dt>&lsquo;<samp class="samp">stop</samp>&rsquo;</dt>
  60326. <dd><p>Get the current time and fetch the <code class="code">lavfi.bench.start_time</code> metadata from
  60327. the input frame metadata to get the time difference. Time difference, average,
  60328. maximum and minimum time (respectively <code class="code">t</code>, <code class="code">avg</code>, <code class="code">max</code> and
  60329. <code class="code">min</code>) are then printed. The timestamps are expressed in seconds.
  60330. </p></dd>
  60331. </dl>
  60332. </dd>
  60333. </dl>
  60334. <a name="Examples-212"></a>
  60335. <h4 class="subsection">48.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-212" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-212" aria-hidden="true">TOC</a></span></h4>
  60336. <ul class="itemize mark-bullet">
  60337. <li>Benchmark <a class="ref" href="#selectivecolor">selectivecolor</a> filter:
  60338. <div class="example">
  60339. <pre class="example-preformatted">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  60340. </pre></div>
  60341. </li></ul>
  60342. <a class="anchor" id="concat-filter"></a><a name="concat-3"></a>
  60343. <h3 class="section">48.9 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-3" aria-hidden="true">TOC</a></span></h3>
  60344. <p>Concatenate audio and video streams, joining them together one after the
  60345. other.
  60346. </p>
  60347. <p>The filter works on segments of synchronized video and audio streams. All
  60348. segments must have the same number of streams of each type, and that will
  60349. also be the number of streams at output.
  60350. </p>
  60351. <p>The filter accepts the following options:
  60352. </p>
  60353. <dl class="table">
  60354. <dt><samp class="option">n</samp></dt>
  60355. <dd><p>Set the number of segments. Default is 2.
  60356. </p>
  60357. </dd>
  60358. <dt><samp class="option">v</samp></dt>
  60359. <dd><p>Set the number of output video streams, that is also the number of video
  60360. streams in each segment. Default is 1.
  60361. </p>
  60362. </dd>
  60363. <dt><samp class="option">a</samp></dt>
  60364. <dd><p>Set the number of output audio streams, that is also the number of audio
  60365. streams in each segment. Default is 0.
  60366. </p>
  60367. </dd>
  60368. <dt><samp class="option">unsafe</samp></dt>
  60369. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  60370. </p>
  60371. </dd>
  60372. </dl>
  60373. <p>The filter has <var class="var">v</var>+<var class="var">a</var> outputs: first <var class="var">v</var> video outputs, then
  60374. <var class="var">a</var> audio outputs.
  60375. </p>
  60376. <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
  60377. segment, in the same order as the outputs, then the inputs for the second
  60378. segment, etc.
  60379. </p>
  60380. <p>Related streams do not always have exactly the same duration, for various
  60381. reasons including codec frame size or sloppy authoring. For that reason,
  60382. related synchronized streams (e.g. a video and its audio track) should be
  60383. concatenated at once. The concat filter will use the duration of the longest
  60384. stream in each segment (except the last one), and if necessary pad shorter
  60385. audio streams with silence.
  60386. </p>
  60387. <p>For this filter to work correctly, all segments must start at timestamp 0.
  60388. </p>
  60389. <p>All corresponding streams must have the same parameters in all segments; the
  60390. filtering system will automatically select a common pixel format for video
  60391. streams, and a common sample format, sample rate and channel layout for
  60392. audio streams, but other settings, such as resolution, must be converted
  60393. explicitly by the user.
  60394. </p>
  60395. <p>Different frame rates are acceptable but will result in variable frame rate
  60396. at output; be sure to configure the output file to handle it.
  60397. </p>
  60398. <a name="Examples-213"></a>
  60399. <h4 class="subsection">48.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-213" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-213" aria-hidden="true">TOC</a></span></h4>
  60400. <ul class="itemize mark-bullet">
  60401. <li>Concatenate an opening, an episode and an ending, all in bilingual version
  60402. (video in stream 0, audio in streams 1 and 2):
  60403. <div class="example">
  60404. <pre class="example-preformatted">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  60405. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  60406. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  60407. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  60408. </pre></div>
  60409. </li><li>Concatenate two parts, handling audio and video separately, using the
  60410. (a)movie sources, and adjusting the resolution:
  60411. <div class="example">
  60412. <pre class="example-preformatted">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  60413. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  60414. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  60415. </pre></div>
  60416. <p>Note that a desync will happen at the stitch if the audio and video streams
  60417. do not have exactly the same duration in the first file.
  60418. </p>
  60419. </li></ul>
  60420. <a name="Commands-161"></a>
  60421. <h4 class="subsection">48.9.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-161" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-161" aria-hidden="true">TOC</a></span></h4>
  60422. <p>This filter supports the following commands:
  60423. </p><dl class="table">
  60424. <dt><samp class="option">next</samp></dt>
  60425. <dd><p>Close the current segment and step to the next one
  60426. </p></dd>
  60427. </dl>
  60428. <a class="anchor" id="ebur128"></a><a name="ebur128-1"></a>
  60429. <h3 class="section">48.10 ebur128<span class="pull-right"><a class="anchor hidden-xs" href="#ebur128-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ebur128-1" aria-hidden="true">TOC</a></span></h3>
  60430. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  60431. level. By default, it logs a message at a frequency of 10Hz with the
  60432. Momentary loudness (identified by <code class="code">M</code>), Short-term loudness (<code class="code">S</code>),
  60433. Integrated loudness (<code class="code">I</code>) and Loudness Range (<code class="code">LRA</code>).
  60434. </p>
  60435. <p>The filter can only analyze streams which have
  60436. sample format is double-precision floating point. The input stream will be converted to
  60437. this specification, if needed. Users may need to insert aformat and/or aresample filters
  60438. after this filter to obtain the original parameters.
  60439. </p>
  60440. <p>The filter also has a video output (see the <var class="var">video</var> option) with a real
  60441. time graph to observe the loudness evolution. The graphic contains the logged
  60442. message mentioned above, so it is not printed anymore when this option is set,
  60443. unless the verbose logging is set. The main graphing area contains the
  60444. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  60445. the momentary loudness (400 milliseconds), but can optionally be configured
  60446. to instead display short-term loudness (see <var class="var">gauge</var>).
  60447. </p>
  60448. <p>The green area marks a +/- 1LU target range around the target loudness
  60449. (-23LUFS by default, unless modified through <var class="var">target</var>).
  60450. </p>
  60451. <p>More information about the Loudness Recommendation EBU R128 on
  60452. <a class="url" href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  60453. </p>
  60454. <p>The filter accepts the following options:
  60455. </p>
  60456. <dl class="table">
  60457. <dt><samp class="option">video</samp></dt>
  60458. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  60459. option is set or no. The video stream will be the first output stream if
  60460. activated. Default is <code class="code">0</code>.
  60461. </p>
  60462. </dd>
  60463. <dt><samp class="option">size</samp></dt>
  60464. <dd><p>Set the video size. This option is for video only. For the syntax of this
  60465. option, check the
  60466. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60467. Default and minimum resolution is <code class="code">640x480</code>.
  60468. </p>
  60469. </dd>
  60470. <dt><samp class="option">meter</samp></dt>
  60471. <dd><p>Set the EBU scale meter. Default is <code class="code">9</code>. Common values are <code class="code">9</code> and
  60472. <code class="code">18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  60473. other integer value between this range is allowed.
  60474. </p>
  60475. </dd>
  60476. <dt><samp class="option">metadata</samp></dt>
  60477. <dd><p>Set metadata injection. If set to <code class="code">1</code>, the audio input will be segmented
  60478. into 100ms output frames, each of them containing various loudness information
  60479. in metadata. All the metadata keys are prefixed with <code class="code">lavfi.r128.</code>.
  60480. </p>
  60481. <p>Default is <code class="code">0</code>.
  60482. </p>
  60483. </dd>
  60484. <dt><samp class="option">framelog</samp></dt>
  60485. <dd><p>Force the frame logging level.
  60486. </p>
  60487. <p>Available values are:
  60488. </p><dl class="table">
  60489. <dt>&lsquo;<samp class="samp">quiet</samp>&rsquo;</dt>
  60490. <dd><p>logging disabled
  60491. </p></dd>
  60492. <dt>&lsquo;<samp class="samp">info</samp>&rsquo;</dt>
  60493. <dd><p>information logging level
  60494. </p></dd>
  60495. <dt>&lsquo;<samp class="samp">verbose</samp>&rsquo;</dt>
  60496. <dd><p>verbose logging level
  60497. </p></dd>
  60498. </dl>
  60499. <p>By default, the logging level is set to <var class="var">info</var>. If the <samp class="option">video</samp> or
  60500. the <samp class="option">metadata</samp> options are set, it switches to <var class="var">verbose</var>.
  60501. </p>
  60502. </dd>
  60503. <dt><samp class="option">peak</samp></dt>
  60504. <dd><p>Set peak mode(s).
  60505. </p>
  60506. <p>Available modes can be cumulated (the option is a <code class="code">flag</code> type). Possible
  60507. values are:
  60508. </p><dl class="table">
  60509. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  60510. <dd><p>Disable any peak mode (default).
  60511. </p></dd>
  60512. <dt>&lsquo;<samp class="samp">sample</samp>&rsquo;</dt>
  60513. <dd><p>Enable sample-peak mode.
  60514. </p>
  60515. <p>Simple peak mode looking for the higher sample value. It logs a message
  60516. for sample-peak (identified by <code class="code">SPK</code>).
  60517. </p></dd>
  60518. <dt>&lsquo;<samp class="samp">true</samp>&rsquo;</dt>
  60519. <dd><p>Enable true-peak mode.
  60520. </p>
  60521. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  60522. stream for better peak accuracy. It logs a message for true-peak.
  60523. (identified by <code class="code">TPK</code>) and true-peak per frame (identified by <code class="code">FTPK</code>).
  60524. This mode requires a build with <code class="code">libswresample</code>.
  60525. </p></dd>
  60526. </dl>
  60527. </dd>
  60528. <dt><samp class="option">dualmono</samp></dt>
  60529. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  60530. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  60531. If set to <code class="code">true</code>, this option will compensate for this effect.
  60532. Multi-channel input files are not affected by this option.
  60533. </p>
  60534. </dd>
  60535. <dt><samp class="option">panlaw</samp></dt>
  60536. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  60537. This parameter is optional, and has a default value of -3.01dB.
  60538. </p>
  60539. </dd>
  60540. <dt><samp class="option">target</samp></dt>
  60541. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  60542. This parameter is optional and has a default value of -23LUFS as specified
  60543. by EBU R128. However, material published online may prefer a level of -16LUFS
  60544. (e.g. for use with podcasts or video platforms).
  60545. </p>
  60546. </dd>
  60547. <dt><samp class="option">gauge</samp></dt>
  60548. <dd><p>Set the value displayed by the gauge. Valid values are <code class="code">momentary</code> and s
  60549. <code class="code">shortterm</code>. By default the momentary value will be used, but in certain
  60550. scenarios it may be more useful to observe the short term value instead (e.g.
  60551. live mixing).
  60552. </p>
  60553. </dd>
  60554. <dt><samp class="option">scale</samp></dt>
  60555. <dd><p>Sets the display scale for the loudness. Valid parameters are <code class="code">absolute</code>
  60556. (in LUFS) or <code class="code">relative</code> (LU) relative to the target. This only affects the
  60557. video output, not the summary or continuous log output.
  60558. </p>
  60559. </dd>
  60560. <dt><samp class="option">integrated</samp></dt>
  60561. <dd><p>Read-only exported value for measured integrated loudness, in LUFS.
  60562. </p>
  60563. </dd>
  60564. <dt><samp class="option">range</samp></dt>
  60565. <dd><p>Read-only exported value for measured loudness range, in LU.
  60566. </p>
  60567. </dd>
  60568. <dt><samp class="option">lra_low</samp></dt>
  60569. <dd><p>Read-only exported value for measured LRA low, in LUFS.
  60570. </p>
  60571. </dd>
  60572. <dt><samp class="option">lra_high</samp></dt>
  60573. <dd><p>Read-only exported value for measured LRA high, in LUFS.
  60574. </p>
  60575. </dd>
  60576. <dt><samp class="option">sample_peak</samp></dt>
  60577. <dd><p>Read-only exported value for measured sample peak, in dBFS.
  60578. </p>
  60579. </dd>
  60580. <dt><samp class="option">true_peak</samp></dt>
  60581. <dd><p>Read-only exported value for measured true peak, in dBFS.
  60582. </p></dd>
  60583. </dl>
  60584. <a name="Examples-214"></a>
  60585. <h4 class="subsection">48.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-214" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-214" aria-hidden="true">TOC</a></span></h4>
  60586. <ul class="itemize mark-bullet">
  60587. <li>Real-time graph using <code class="command">ffplay</code>, with a EBU scale meter +18:
  60588. <div class="example">
  60589. <pre class="example-preformatted">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  60590. </pre></div>
  60591. </li><li>Run an analysis with <code class="command">ffmpeg</code>:
  60592. <div class="example">
  60593. <pre class="example-preformatted">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  60594. </pre></div>
  60595. </li></ul>
  60596. <a name="interleave_002c-ainterleave"></a>
  60597. <h3 class="section">48.11 interleave, ainterleave<span class="pull-right"><a class="anchor hidden-xs" href="#interleave_002c-ainterleave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interleave_002c-ainterleave" aria-hidden="true">TOC</a></span></h3>
  60598. <p>Temporally interleave frames from several inputs.
  60599. </p>
  60600. <p><code class="code">interleave</code> works with video inputs, <code class="code">ainterleave</code> with audio.
  60601. </p>
  60602. <p>These filters read frames from several inputs and send the oldest
  60603. queued frame to the output.
  60604. </p>
  60605. <p>Input streams must have well defined, monotonically increasing frame
  60606. timestamp values.
  60607. </p>
  60608. <p>In order to submit one frame to output, these filters need to enqueue
  60609. at least one frame for each input, so they cannot work in case one
  60610. input is not yet terminated and will not receive incoming frames.
  60611. </p>
  60612. <p>For example consider the case when one input is a <code class="code">select</code> filter
  60613. which always drops input frames. The <code class="code">interleave</code> filter will keep
  60614. reading from that input, but it will never be able to send new frames
  60615. to output until the input sends an end-of-stream signal.
  60616. </p>
  60617. <p>Also, depending on inputs synchronization, the filters will drop
  60618. frames in case one input receives more frames than the other ones, and
  60619. the queue is already filled.
  60620. </p>
  60621. <p>These filters accept the following options:
  60622. </p>
  60623. <dl class="table">
  60624. <dt><samp class="option">nb_inputs, n</samp></dt>
  60625. <dd><p>Set the number of different inputs, it is 2 by default.
  60626. </p>
  60627. </dd>
  60628. <dt><samp class="option">duration</samp></dt>
  60629. <dd><p>How to determine the end-of-stream.
  60630. </p>
  60631. <dl class="table">
  60632. <dt><samp class="option">longest</samp></dt>
  60633. <dd><p>The duration of the longest input. (default)
  60634. </p>
  60635. </dd>
  60636. <dt><samp class="option">shortest</samp></dt>
  60637. <dd><p>The duration of the shortest input.
  60638. </p>
  60639. </dd>
  60640. <dt><samp class="option">first</samp></dt>
  60641. <dd><p>The duration of the first input.
  60642. </p></dd>
  60643. </dl>
  60644. </dd>
  60645. </dl>
  60646. <a name="Examples-215"></a>
  60647. <h4 class="subsection">48.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-215" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-215" aria-hidden="true">TOC</a></span></h4>
  60648. <ul class="itemize mark-bullet">
  60649. <li>Interleave frames belonging to different streams using <code class="command">ffmpeg</code>:
  60650. <div class="example">
  60651. <pre class="example-preformatted">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  60652. </pre></div>
  60653. </li><li>Add flickering blur effect:
  60654. <div class="example">
  60655. <pre class="example-preformatted">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  60656. </pre></div>
  60657. </li></ul>
  60658. <a name="latency_002c-alatency"></a>
  60659. <h3 class="section">48.12 latency, alatency<span class="pull-right"><a class="anchor hidden-xs" href="#latency_002c-alatency" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-latency_002c-alatency" aria-hidden="true">TOC</a></span></h3>
  60660. <p>Measure filtering latency.
  60661. </p>
  60662. <p>Report previous filter filtering latency, delay in number of audio samples for audio filters
  60663. or number of video frames for video filters.
  60664. </p>
  60665. <p>On end of input stream, filter will report min and max measured latency for previous running filter
  60666. in filtergraph.
  60667. </p>
  60668. <a name="metadata_002c-ametadata"></a>
  60669. <h3 class="section">48.13 metadata, ametadata<span class="pull-right"><a class="anchor hidden-xs" href="#metadata_002c-ametadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-metadata_002c-ametadata" aria-hidden="true">TOC</a></span></h3>
  60670. <p>Manipulate frame metadata.
  60671. </p>
  60672. <p>This filter accepts the following options:
  60673. </p>
  60674. <dl class="table">
  60675. <dt><samp class="option">mode</samp></dt>
  60676. <dd><p>Set mode of operation of the filter.
  60677. </p>
  60678. <p>Can be one of the following:
  60679. </p>
  60680. <dl class="table">
  60681. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  60682. <dd><p>If both <code class="code">value</code> and <code class="code">key</code> is set, select frames
  60683. which have such metadata. If only <code class="code">key</code> is set, select
  60684. every frame that has such key in metadata.
  60685. </p>
  60686. </dd>
  60687. <dt>&lsquo;<samp class="samp">add</samp>&rsquo;</dt>
  60688. <dd><p>Add new metadata <code class="code">key</code> and <code class="code">value</code>. If key is already available
  60689. do nothing.
  60690. </p>
  60691. </dd>
  60692. <dt>&lsquo;<samp class="samp">modify</samp>&rsquo;</dt>
  60693. <dd><p>Modify value of already present key.
  60694. </p>
  60695. </dd>
  60696. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  60697. <dd><p>If <code class="code">value</code> is set, delete only keys that have such value.
  60698. Otherwise, delete key. If <code class="code">key</code> is not set, delete all metadata values in
  60699. the frame.
  60700. </p>
  60701. </dd>
  60702. <dt>&lsquo;<samp class="samp">print</samp>&rsquo;</dt>
  60703. <dd><p>Print key and its value if metadata was found. If <code class="code">key</code> is not set print all
  60704. metadata values available in frame.
  60705. </p></dd>
  60706. </dl>
  60707. </dd>
  60708. <dt><samp class="option">key</samp></dt>
  60709. <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>.
  60710. </p>
  60711. </dd>
  60712. <dt><samp class="option">value</samp></dt>
  60713. <dd><p>Set metadata value which will be used. This option is mandatory for
  60714. <code class="code">modify</code> and <code class="code">add</code> mode.
  60715. </p>
  60716. </dd>
  60717. <dt><samp class="option">function</samp></dt>
  60718. <dd><p>Which function to use when comparing metadata value and <code class="code">value</code>.
  60719. </p>
  60720. <p>Can be one of following:
  60721. </p>
  60722. <dl class="table">
  60723. <dt>&lsquo;<samp class="samp">same_str</samp>&rsquo;</dt>
  60724. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code class="code">value</code>.
  60725. </p>
  60726. </dd>
  60727. <dt>&lsquo;<samp class="samp">starts_with</samp>&rsquo;</dt>
  60728. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  60729. the <code class="code">value</code> option string.
  60730. </p>
  60731. </dd>
  60732. <dt>&lsquo;<samp class="samp">less</samp>&rsquo;</dt>
  60733. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code class="code">value</code>.
  60734. </p>
  60735. </dd>
  60736. <dt>&lsquo;<samp class="samp">equal</samp>&rsquo;</dt>
  60737. <dd><p>Values are interpreted as floats, returns true if <code class="code">value</code> is equal with metadata value.
  60738. </p>
  60739. </dd>
  60740. <dt>&lsquo;<samp class="samp">greater</samp>&rsquo;</dt>
  60741. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code class="code">value</code>.
  60742. </p>
  60743. </dd>
  60744. <dt>&lsquo;<samp class="samp">expr</samp>&rsquo;</dt>
  60745. <dd><p>Values are interpreted as floats, returns true if expression from option <code class="code">expr</code>
  60746. evaluates to true.
  60747. </p>
  60748. </dd>
  60749. <dt>&lsquo;<samp class="samp">ends_with</samp>&rsquo;</dt>
  60750. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  60751. the <code class="code">value</code> option string.
  60752. </p></dd>
  60753. </dl>
  60754. </dd>
  60755. <dt><samp class="option">expr</samp></dt>
  60756. <dd><p>Set expression which is used when <code class="code">function</code> is set to <code class="code">expr</code>.
  60757. The expression is evaluated through the eval API and can contain the following
  60758. constants:
  60759. </p>
  60760. <dl class="table">
  60761. <dt><samp class="option">VALUE1, FRAMEVAL</samp></dt>
  60762. <dd><p>Float representation of <code class="code">value</code> from metadata key.
  60763. </p>
  60764. </dd>
  60765. <dt><samp class="option">VALUE2, USERVAL</samp></dt>
  60766. <dd><p>Float representation of <code class="code">value</code> as supplied by user in <code class="code">value</code> option.
  60767. </p></dd>
  60768. </dl>
  60769. </dd>
  60770. <dt><samp class="option">file</samp></dt>
  60771. <dd><p>If specified in <code class="code">print</code> mode, output is written to the named file. Instead of
  60772. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  60773. for standard output. If <code class="code">file</code> option is not set, output is written to the log
  60774. with AV_LOG_INFO loglevel.
  60775. </p>
  60776. </dd>
  60777. <dt><samp class="option">direct</samp></dt>
  60778. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var class="var">file</var>.
  60779. </p>
  60780. </dd>
  60781. </dl>
  60782. <a name="Examples-216"></a>
  60783. <h4 class="subsection">48.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-216" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-216" aria-hidden="true">TOC</a></span></h4>
  60784. <ul class="itemize mark-bullet">
  60785. <li>Print all metadata values for frames with key <code class="code">lavfi.signalstats.YDIF</code> with values
  60786. between 0 and 1.
  60787. <div class="example">
  60788. <pre class="example-preformatted">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  60789. </pre></div>
  60790. </li><li>Print silencedetect output to file <samp class="file">metadata.txt</samp>.
  60791. <div class="example">
  60792. <pre class="example-preformatted">silencedetect,ametadata=mode=print:file=metadata.txt
  60793. </pre></div>
  60794. </li><li>Direct all metadata to a pipe with file descriptor 4.
  60795. <div class="example">
  60796. <pre class="example-preformatted">metadata=mode=print:file='pipe\:4'
  60797. </pre></div>
  60798. </li></ul>
  60799. <a name="perms_002c-aperms"></a>
  60800. <h3 class="section">48.14 perms, aperms<span class="pull-right"><a class="anchor hidden-xs" href="#perms_002c-aperms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perms_002c-aperms" aria-hidden="true">TOC</a></span></h3>
  60801. <p>Set read/write permissions for the output frames.
  60802. </p>
  60803. <p>These filters are mainly aimed at developers to test direct path in the
  60804. following filter in the filtergraph.
  60805. </p>
  60806. <p>The filters accept the following options:
  60807. </p>
  60808. <dl class="table">
  60809. <dt><samp class="option">mode</samp></dt>
  60810. <dd><p>Select the permissions mode.
  60811. </p>
  60812. <p>It accepts the following values:
  60813. </p><dl class="table">
  60814. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  60815. <dd><p>Do nothing. This is the default.
  60816. </p></dd>
  60817. <dt>&lsquo;<samp class="samp">ro</samp>&rsquo;</dt>
  60818. <dd><p>Set all the output frames read-only.
  60819. </p></dd>
  60820. <dt>&lsquo;<samp class="samp">rw</samp>&rsquo;</dt>
  60821. <dd><p>Set all the output frames directly writable.
  60822. </p></dd>
  60823. <dt>&lsquo;<samp class="samp">toggle</samp>&rsquo;</dt>
  60824. <dd><p>Make the frame read-only if writable, and writable if read-only.
  60825. </p></dd>
  60826. <dt>&lsquo;<samp class="samp">random</samp>&rsquo;</dt>
  60827. <dd><p>Set each output frame read-only or writable randomly.
  60828. </p></dd>
  60829. </dl>
  60830. </dd>
  60831. <dt><samp class="option">seed</samp></dt>
  60832. <dd><p>Set the seed for the <var class="var">random</var> mode, must be an integer included between
  60833. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  60834. <code class="code">-1</code>, the filter will try to use a good random seed on a best effort
  60835. basis.
  60836. </p></dd>
  60837. </dl>
  60838. <p>Note: in case of auto-inserted filter between the permission filter and the
  60839. following one, the permission might not be received as expected in that
  60840. following filter. Inserting a <a class="ref" href="#format">format</a> or <a class="ref" href="#aformat">aformat</a> filter before the
  60841. perms/aperms filter can avoid this problem.
  60842. </p>
  60843. <a name="realtime_002c-arealtime"></a>
  60844. <h3 class="section">48.15 realtime, arealtime<span class="pull-right"><a class="anchor hidden-xs" href="#realtime_002c-arealtime" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-realtime_002c-arealtime" aria-hidden="true">TOC</a></span></h3>
  60845. <p>Slow down filtering to match real time approximately.
  60846. </p>
  60847. <p>These filters will pause the filtering for a variable amount of time to
  60848. match the output rate with the input timestamps.
  60849. They are similar to the <samp class="option">re</samp> option to <code class="code">ffmpeg</code>.
  60850. </p>
  60851. <p>They accept the following options:
  60852. </p>
  60853. <dl class="table">
  60854. <dt><samp class="option">limit</samp></dt>
  60855. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  60856. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  60857. </p></dd>
  60858. <dt><samp class="option">speed</samp></dt>
  60859. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  60860. Values larger than 1.0 will result in faster than realtime processing,
  60861. smaller will slow processing down. The <var class="var">limit</var> is automatically adapted
  60862. accordingly. Default is 1.0.
  60863. </p>
  60864. <p>A processing speed faster than what is possible without these filters cannot
  60865. be achieved.
  60866. </p></dd>
  60867. </dl>
  60868. <a name="Commands-162"></a>
  60869. <h4 class="subsection">48.15.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-162" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-162" aria-hidden="true">TOC</a></span></h4>
  60870. <p>Both filters supports the all above options as <a class="ref" href="#commands">commands</a>.
  60871. </p>
  60872. <a name="segment_002c-asegment"></a>
  60873. <h3 class="section">48.16 segment, asegment<span class="pull-right"><a class="anchor hidden-xs" href="#segment_002c-asegment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-segment_002c-asegment" aria-hidden="true">TOC</a></span></h3>
  60874. <p>Split single input stream into multiple streams.
  60875. </p>
  60876. <p>This filter does opposite of concat filters.
  60877. </p>
  60878. <p><code class="code">segment</code> works on video frames, <code class="code">asegment</code> on audio samples.
  60879. </p>
  60880. <p>This filter accepts the following options:
  60881. </p>
  60882. <dl class="table">
  60883. <dt><samp class="option">timestamps</samp></dt>
  60884. <dd><p>Timestamps of output segments separated by &rsquo;|&rsquo;. The first segment will run
  60885. from the beginning of the input stream. The last segment will run until
  60886. the end of the input stream
  60887. </p>
  60888. </dd>
  60889. <dt><samp class="option">frames, samples</samp></dt>
  60890. <dd><p>Exact frame/sample count to split the segments.
  60891. </p></dd>
  60892. </dl>
  60893. <p>In all cases, prefixing an each segment with &rsquo;+&rsquo; will make it relative to the
  60894. previous segment.
  60895. </p>
  60896. <a name="Examples-217"></a>
  60897. <h4 class="subsection">48.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-217" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-217" aria-hidden="true">TOC</a></span></h4>
  60898. <ul class="itemize mark-bullet">
  60899. <li>Split input audio stream into three output audio streams, starting at start of input audio stream
  60900. and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd
  60901. output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream:
  60902. <div class="example">
  60903. <pre class="example-preformatted">asegment=timestamps=&quot;60|150&quot;
  60904. </pre></div>
  60905. </li></ul>
  60906. <a class="anchor" id="select"></a><a name="select_002c-aselect"></a>
  60907. <h3 class="section">48.17 select, aselect<span class="pull-right"><a class="anchor hidden-xs" href="#select_002c-aselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-select_002c-aselect" aria-hidden="true">TOC</a></span></h3>
  60908. <p>Select frames to pass in output.
  60909. </p>
  60910. <p>This filter accepts the following options:
  60911. </p>
  60912. <dl class="table">
  60913. <dt><samp class="option">expr, e</samp></dt>
  60914. <dd><p>Set expression, which is evaluated for each input frame.
  60915. </p>
  60916. <p>If the expression is evaluated to zero, the frame is discarded.
  60917. </p>
  60918. <p>If the evaluation result is negative or NaN, the frame is sent to the
  60919. first output; otherwise it is sent to the output with index
  60920. <code class="code">ceil(val)-1</code>, assuming that the input index starts from 0.
  60921. </p>
  60922. <p>For example a value of <code class="code">1.2</code> corresponds to the output with index
  60923. <code class="code">ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  60924. </p>
  60925. </dd>
  60926. <dt><samp class="option">outputs, n</samp></dt>
  60927. <dd><p>Set the number of outputs. The output to which to send the selected
  60928. frame is based on the result of the evaluation. Default value is 1.
  60929. </p></dd>
  60930. </dl>
  60931. <p>The expression can contain the following constants:
  60932. </p>
  60933. <dl class="table">
  60934. <dt><samp class="option">n</samp></dt>
  60935. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  60936. </p>
  60937. </dd>
  60938. <dt><samp class="option">selected_n</samp></dt>
  60939. <dd><p>The (sequential) number of the selected frame, starting from 0.
  60940. </p>
  60941. </dd>
  60942. <dt><samp class="option">prev_selected_n</samp></dt>
  60943. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  60944. </p>
  60945. </dd>
  60946. <dt><samp class="option">TB</samp></dt>
  60947. <dd><p>The timebase of the input timestamps.
  60948. </p>
  60949. </dd>
  60950. <dt><samp class="option">pts</samp></dt>
  60951. <dd><p>The PTS (Presentation TimeStamp) of the filtered frame,
  60952. expressed in <var class="var">TB</var> units. It&rsquo;s NAN if undefined.
  60953. </p>
  60954. </dd>
  60955. <dt><samp class="option">t</samp></dt>
  60956. <dd><p>The PTS of the filtered frame,
  60957. expressed in seconds. It&rsquo;s NAN if undefined.
  60958. </p>
  60959. </dd>
  60960. <dt><samp class="option">prev_pts</samp></dt>
  60961. <dd><p>The PTS of the previously filtered frame. It&rsquo;s NAN if undefined.
  60962. </p>
  60963. </dd>
  60964. <dt><samp class="option">prev_selected_pts</samp></dt>
  60965. <dd><p>The PTS of the last previously filtered frame. It&rsquo;s NAN if undefined.
  60966. </p>
  60967. </dd>
  60968. <dt><samp class="option">prev_selected_t</samp></dt>
  60969. <dd><p>The PTS of the last previously selected frame, expressed in seconds. It&rsquo;s NAN if undefined.
  60970. </p>
  60971. </dd>
  60972. <dt><samp class="option">start_pts</samp></dt>
  60973. <dd><p>The first PTS in the stream which is not NAN. It remains NAN if not found.
  60974. </p>
  60975. </dd>
  60976. <dt><samp class="option">start_t</samp></dt>
  60977. <dd><p>The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found.
  60978. </p>
  60979. </dd>
  60980. <dt><samp class="option">pict_type <em class="emph">(video only)</em></samp></dt>
  60981. <dd><p>The type of the filtered frame. It can assume one of the following
  60982. values:
  60983. </p><dl class="table">
  60984. <dt><samp class="option">I</samp></dt>
  60985. <dt><samp class="option">P</samp></dt>
  60986. <dt><samp class="option">B</samp></dt>
  60987. <dt><samp class="option">S</samp></dt>
  60988. <dt><samp class="option">SI</samp></dt>
  60989. <dt><samp class="option">SP</samp></dt>
  60990. <dt><samp class="option">BI</samp></dt>
  60991. </dl>
  60992. </dd>
  60993. <dt><samp class="option">interlace_type <em class="emph">(video only)</em></samp></dt>
  60994. <dd><p>The frame interlace type. It can assume one of the following values:
  60995. </p><dl class="table">
  60996. <dt><samp class="option">PROGRESSIVE</samp></dt>
  60997. <dd><p>The frame is progressive (not interlaced).
  60998. </p></dd>
  60999. <dt><samp class="option">TOPFIRST</samp></dt>
  61000. <dd><p>The frame is top-field-first.
  61001. </p></dd>
  61002. <dt><samp class="option">BOTTOMFIRST</samp></dt>
  61003. <dd><p>The frame is bottom-field-first.
  61004. </p></dd>
  61005. </dl>
  61006. </dd>
  61007. <dt><samp class="option">consumed_sample_n <em class="emph">(audio only)</em></samp></dt>
  61008. <dd><p>the number of selected samples before the current frame
  61009. </p>
  61010. </dd>
  61011. <dt><samp class="option">samples_n <em class="emph">(audio only)</em></samp></dt>
  61012. <dd><p>the number of samples in the current frame
  61013. </p>
  61014. </dd>
  61015. <dt><samp class="option">sample_rate <em class="emph">(audio only)</em></samp></dt>
  61016. <dd><p>the input sample rate
  61017. </p>
  61018. </dd>
  61019. <dt><samp class="option">key</samp></dt>
  61020. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  61021. </p>
  61022. </dd>
  61023. <dt><samp class="option">pos</samp></dt>
  61024. <dd><p>the position in the file of the filtered frame, -1 if the information
  61025. is not available (e.g. for synthetic video); deprecated, do not use
  61026. </p>
  61027. </dd>
  61028. <dt><samp class="option">scene <em class="emph">(video only)</em></samp></dt>
  61029. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  61030. probability for the current frame to introduce a new scene, while a higher
  61031. value means the current frame is more likely to be one (see the example below)
  61032. </p>
  61033. </dd>
  61034. <dt><samp class="option">concatdec_select</samp></dt>
  61035. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  61036. inpoint and an outpoint, but the output packets may not be entirely contained
  61037. in the selected interval. By using this variable, it is possible to skip frames
  61038. generated by the concat demuxer which are not exactly contained in the selected
  61039. interval.
  61040. </p>
  61041. <p>This works by comparing the frame pts against the <var class="var">lavf.concat.start_time</var>
  61042. and the <var class="var">lavf.concat.duration</var> packet metadata values which are also
  61043. present in the decoded frames.
  61044. </p>
  61045. <p>The <var class="var">concatdec_select</var> variable is -1 if the frame pts is at least
  61046. start_time and either the duration metadata is missing or the frame pts is less
  61047. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  61048. missing.
  61049. </p>
  61050. <p>That basically means that an input frame is selected if its pts is within the
  61051. interval set by the concat demuxer.
  61052. </p>
  61053. </dd>
  61054. <dt><samp class="option">iw <em class="emph">(video only)</em></samp></dt>
  61055. <dd><p>Represents the width of the input video frame.
  61056. </p>
  61057. </dd>
  61058. <dt><samp class="option">ih <em class="emph">(video only)</em></samp></dt>
  61059. <dd><p>Represents the height of the input video frame.
  61060. </p>
  61061. </dd>
  61062. <dt><samp class="option">view <em class="emph">(video only)</em></samp></dt>
  61063. <dd><p>View ID for multi-view video.
  61064. </p>
  61065. </dd>
  61066. </dl>
  61067. <p>The default value of the select expression is &quot;1&quot;.
  61068. </p>
  61069. <a name="Examples-218"></a>
  61070. <h4 class="subsection">48.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-218" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-218" aria-hidden="true">TOC</a></span></h4>
  61071. <ul class="itemize mark-bullet">
  61072. <li>Select all frames in input:
  61073. <div class="example">
  61074. <pre class="example-preformatted">select
  61075. </pre></div>
  61076. <p>The example above is the same as:
  61077. </p><div class="example">
  61078. <pre class="example-preformatted">select=1
  61079. </pre></div>
  61080. </li><li>Skip all frames:
  61081. <div class="example">
  61082. <pre class="example-preformatted">select=0
  61083. </pre></div>
  61084. </li><li>Select only I-frames:
  61085. <div class="example">
  61086. <pre class="example-preformatted">select='eq(pict_type\,I)'
  61087. </pre></div>
  61088. </li><li>Select one frame every 100:
  61089. <div class="example">
  61090. <pre class="example-preformatted">select='not(mod(n\,100))'
  61091. </pre></div>
  61092. </li><li>Select only frames contained in the 10-20 time interval:
  61093. <div class="example">
  61094. <pre class="example-preformatted">select=between(t\,10\,20)
  61095. </pre></div>
  61096. </li><li>Select only I-frames contained in the 10-20 time interval:
  61097. <div class="example">
  61098. <pre class="example-preformatted">select=between(t\,10\,20)*eq(pict_type\,I)
  61099. </pre></div>
  61100. </li><li>Select frames with a minimum distance of 10 seconds:
  61101. <div class="example">
  61102. <pre class="example-preformatted">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  61103. </pre></div>
  61104. </li><li>Use aselect to select only audio frames with samples number &gt; 100:
  61105. <div class="example">
  61106. <pre class="example-preformatted">aselect='gt(samples_n\,100)'
  61107. </pre></div>
  61108. </li><li>Create a mosaic of the first scenes:
  61109. <div class="example">
  61110. <pre class="example-preformatted">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  61111. </pre></div>
  61112. <p>Comparing <var class="var">scene</var> against a value between 0.3 and 0.5 is generally a sane
  61113. choice.
  61114. </p>
  61115. </li><li>Send even and odd frames to separate outputs, and compose them:
  61116. <div class="example">
  61117. <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
  61118. </pre></div>
  61119. </li><li>Select useful frames from an ffconcat file which is using inpoints and
  61120. outpoints but where the source files are not intra frame only.
  61121. <div class="example">
  61122. <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
  61123. </pre></div>
  61124. </li></ul>
  61125. <a name="sendcmd_002c-asendcmd"></a>
  61126. <h3 class="section">48.18 sendcmd, asendcmd<span class="pull-right"><a class="anchor hidden-xs" href="#sendcmd_002c-asendcmd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sendcmd_002c-asendcmd" aria-hidden="true">TOC</a></span></h3>
  61127. <p>Send commands to filters in the filtergraph.
  61128. </p>
  61129. <p>These filters read commands to be sent to other filters in the
  61130. filtergraph.
  61131. </p>
  61132. <p><code class="code">sendcmd</code> must be inserted between two video filters,
  61133. <code class="code">asendcmd</code> must be inserted between two audio filters, but apart
  61134. from that they act the same way.
  61135. </p>
  61136. <p>The specification of commands can be provided in the filter arguments
  61137. with the <var class="var">commands</var> option, or in a file specified by the
  61138. <var class="var">filename</var> option.
  61139. </p>
  61140. <p>These filters accept the following options:
  61141. </p><dl class="table">
  61142. <dt><samp class="option">commands, c</samp></dt>
  61143. <dd><p>Set the commands to be read and sent to the other filters.
  61144. </p></dd>
  61145. <dt><samp class="option">filename, f</samp></dt>
  61146. <dd><p>Set the filename of the commands to be read and sent to the other
  61147. filters.
  61148. </p></dd>
  61149. </dl>
  61150. <a name="Commands-syntax"></a>
  61151. <h4 class="subsection">48.18.1 Commands syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-syntax" aria-hidden="true">TOC</a></span></h4>
  61152. <p>A commands description consists of a sequence of interval
  61153. specifications, comprising a list of commands to be executed when a
  61154. particular event related to that interval occurs. The occurring event
  61155. is typically the current frame time entering or leaving a given time
  61156. interval.
  61157. </p>
  61158. <p>An interval is specified by the following syntax:
  61159. </p><div class="example">
  61160. <pre class="example-preformatted"><var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>;
  61161. </pre></div>
  61162. <p>The time interval is specified by the <var class="var">START</var> and <var class="var">END</var> times.
  61163. <var class="var">END</var> is optional and defaults to the maximum time.
  61164. </p>
  61165. <p>The current frame time is considered within the specified interval if
  61166. it is included in the interval [<var class="var">START</var>, <var class="var">END</var>), that is when
  61167. the time is greater or equal to <var class="var">START</var> and is lesser than
  61168. <var class="var">END</var>.
  61169. </p>
  61170. <p><var class="var">COMMANDS</var> consists of a sequence of one or more command
  61171. specifications, separated by &quot;,&quot;, relating to that interval. The
  61172. syntax of a command specification is given by:
  61173. </p><div class="example">
  61174. <pre class="example-preformatted">[<var class="var">FLAGS</var>] <var class="var">TARGET</var> <var class="var">COMMAND</var> <var class="var">ARG</var>
  61175. </pre></div>
  61176. <p><var class="var">FLAGS</var> is optional and specifies the type of events relating to
  61177. the time interval which enable sending the specified command, and must
  61178. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  61179. enclosed between &quot;[&quot; and &quot;]&quot;.
  61180. </p>
  61181. <p>The following flags are recognized:
  61182. </p><dl class="table">
  61183. <dt><samp class="option">enter</samp></dt>
  61184. <dd><p>The command is sent when the current frame timestamp enters the
  61185. specified interval. In other words, the command is sent when the
  61186. previous frame timestamp was not in the given interval, and the
  61187. current is.
  61188. </p>
  61189. </dd>
  61190. <dt><samp class="option">leave</samp></dt>
  61191. <dd><p>The command is sent when the current frame timestamp leaves the
  61192. specified interval. In other words, the command is sent when the
  61193. previous frame timestamp was in the given interval, and the
  61194. current is not.
  61195. </p>
  61196. </dd>
  61197. <dt><samp class="option">expr</samp></dt>
  61198. <dd><p>The command <var class="var">ARG</var> is interpreted as expression and result of
  61199. expression is passed as <var class="var">ARG</var>.
  61200. </p>
  61201. <p>The expression is evaluated through the eval API and can contain the following
  61202. constants:
  61203. </p>
  61204. <dl class="table">
  61205. <dt><samp class="option">POS</samp></dt>
  61206. <dd><p>Original position in the file of the frame, or undefined if undefined
  61207. for the current frame. Deprecated, do not use.
  61208. </p>
  61209. </dd>
  61210. <dt><samp class="option">PTS</samp></dt>
  61211. <dd><p>The presentation timestamp in input.
  61212. </p>
  61213. </dd>
  61214. <dt><samp class="option">N</samp></dt>
  61215. <dd><p>The count of the input frame for video or audio, starting from 0.
  61216. </p>
  61217. </dd>
  61218. <dt><samp class="option">T</samp></dt>
  61219. <dd><p>The time in seconds of the current frame.
  61220. </p>
  61221. </dd>
  61222. <dt><samp class="option">TS</samp></dt>
  61223. <dd><p>The start time in seconds of the current command interval.
  61224. </p>
  61225. </dd>
  61226. <dt><samp class="option">TE</samp></dt>
  61227. <dd><p>The end time in seconds of the current command interval.
  61228. </p>
  61229. </dd>
  61230. <dt><samp class="option">TI</samp></dt>
  61231. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  61232. </p>
  61233. </dd>
  61234. <dt><samp class="option">W</samp></dt>
  61235. <dd><p>The video frame width.
  61236. </p>
  61237. </dd>
  61238. <dt><samp class="option">H</samp></dt>
  61239. <dd><p>The video frame height.
  61240. </p></dd>
  61241. </dl>
  61242. </dd>
  61243. </dl>
  61244. <p>If <var class="var">FLAGS</var> is not specified, a default value of <code class="code">[enter]</code> is
  61245. assumed.
  61246. </p>
  61247. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  61248. the filter class or a specific filter instance name.
  61249. </p>
  61250. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  61251. </p>
  61252. <p><var class="var">ARG</var> is optional and specifies the optional list of argument for
  61253. the given <var class="var">COMMAND</var>.
  61254. </p>
  61255. <p>Between one interval specification and another, whitespaces, or
  61256. sequences of characters starting with <code class="code">#</code> until the end of line,
  61257. are ignored and can be used to annotate comments.
  61258. </p>
  61259. <p>A simplified BNF description of the commands specification syntax
  61260. follows:
  61261. </p><div class="example">
  61262. <pre class="example-preformatted"><var class="var">COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  61263. <var class="var">COMMAND_FLAGS</var> ::= <var class="var">COMMAND_FLAG</var> [(+|&quot;|&quot;)<var class="var">COMMAND_FLAG</var>]
  61264. <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>]
  61265. <var class="var">COMMANDS</var> ::= <var class="var">COMMAND</var> [,<var class="var">COMMANDS</var>]
  61266. <var class="var">INTERVAL</var> ::= <var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>
  61267. <var class="var">INTERVALS</var> ::= <var class="var">INTERVAL</var>[;<var class="var">INTERVALS</var>]
  61268. </pre></div>
  61269. <a name="Examples-219"></a>
  61270. <h4 class="subsection">48.18.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-219" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-219" aria-hidden="true">TOC</a></span></h4>
  61271. <ul class="itemize mark-bullet">
  61272. <li>Specify audio tempo change at second 4:
  61273. <div class="example">
  61274. <pre class="example-preformatted">asendcmd=c='4.0 atempo tempo 1.5',atempo
  61275. </pre></div>
  61276. </li><li>Target a specific filter instance:
  61277. <div class="example">
  61278. <pre class="example-preformatted">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  61279. </pre></div>
  61280. </li><li>Specify a list of drawtext and hue commands in a file.
  61281. <div class="example">
  61282. <pre class="example-preformatted"># show text in the interval 5-10
  61283. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  61284. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  61285. # desaturate the image in the interval 15-20
  61286. 15.0-20.0 [enter] hue s 0,
  61287. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  61288. [leave] hue s 1,
  61289. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  61290. # apply an exponential saturation fade-out effect, starting from time 25
  61291. 25 [enter] hue s exp(25-t)
  61292. </pre></div>
  61293. <p>A filtergraph allowing to read and process the above command list
  61294. stored in a file <samp class="file">test.cmd</samp>, can be specified with:
  61295. </p><div class="example">
  61296. <pre class="example-preformatted">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  61297. </pre></div>
  61298. </li></ul>
  61299. <a class="anchor" id="setpts"></a><a name="setpts_002c-asetpts"></a>
  61300. <h3 class="section">48.19 setpts, asetpts<span class="pull-right"><a class="anchor hidden-xs" href="#setpts_002c-asetpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setpts_002c-asetpts" aria-hidden="true">TOC</a></span></h3>
  61301. <p>Change the PTS (presentation timestamp) of the input frames.
  61302. </p>
  61303. <p><code class="code">setpts</code> works on video frames, <code class="code">asetpts</code> on audio frames.
  61304. </p>
  61305. <p>This filter accepts the following options:
  61306. </p>
  61307. <dl class="table">
  61308. <dt><samp class="option">expr</samp></dt>
  61309. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  61310. </p>
  61311. </dd>
  61312. <dt><samp class="option">strip_fps (<em class="emph">video only</em>)</samp></dt>
  61313. <dd><p>Boolean option which determines if the original framerate and frame duration
  61314. metadata is unset. If set to true, be advised that a sane frame rate should be
  61315. explicitly specified if output is sent to a constant frame rate muxer.
  61316. Default is <code class="code">false</code>.
  61317. </p>
  61318. </dd>
  61319. </dl>
  61320. <p>The expression is evaluated through the eval API and can contain the following
  61321. constants:
  61322. </p>
  61323. <dl class="table">
  61324. <dt><samp class="option">FRAME_RATE, FR</samp></dt>
  61325. <dd><p>frame rate, only defined for constant frame-rate video
  61326. </p>
  61327. </dd>
  61328. <dt><samp class="option">PTS</samp></dt>
  61329. <dd><p>The presentation timestamp in input
  61330. </p>
  61331. </dd>
  61332. <dt><samp class="option">N</samp></dt>
  61333. <dd><p>The count of the input frame for video or the number of consumed samples,
  61334. not including the current frame for audio, starting from 0.
  61335. </p>
  61336. </dd>
  61337. <dt><samp class="option">NB_CONSUMED_SAMPLES</samp></dt>
  61338. <dd><p>The number of consumed samples, not including the current frame (only
  61339. audio)
  61340. </p>
  61341. </dd>
  61342. <dt><samp class="option">NB_SAMPLES, S</samp></dt>
  61343. <dd><p>The number of samples in the current frame (only audio)
  61344. </p>
  61345. </dd>
  61346. <dt><samp class="option">SAMPLE_RATE, SR</samp></dt>
  61347. <dd><p>The audio sample rate.
  61348. </p>
  61349. </dd>
  61350. <dt><samp class="option">STARTPTS</samp></dt>
  61351. <dd><p>The PTS of the first frame.
  61352. </p>
  61353. </dd>
  61354. <dt><samp class="option">STARTT</samp></dt>
  61355. <dd><p>the time in seconds of the first frame
  61356. </p>
  61357. </dd>
  61358. <dt><samp class="option">INTERLACED</samp></dt>
  61359. <dd><p>State whether the current frame is interlaced.
  61360. </p>
  61361. </dd>
  61362. <dt><samp class="option">T</samp></dt>
  61363. <dd><p>the time in seconds of the current frame
  61364. </p>
  61365. </dd>
  61366. <dt><samp class="option">POS</samp></dt>
  61367. <dd><p>original position in the file of the frame, or undefined if undefined
  61368. for the current frame; deprecated, do not use
  61369. </p>
  61370. </dd>
  61371. <dt><samp class="option">PREV_INPTS</samp></dt>
  61372. <dd><p>The previous input PTS.
  61373. </p>
  61374. </dd>
  61375. <dt><samp class="option">PREV_INT</samp></dt>
  61376. <dd><p>previous input time in seconds
  61377. </p>
  61378. </dd>
  61379. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  61380. <dd><p>The previous output PTS.
  61381. </p>
  61382. </dd>
  61383. <dt><samp class="option">PREV_OUTT</samp></dt>
  61384. <dd><p>previous output time in seconds
  61385. </p>
  61386. </dd>
  61387. <dt><samp class="option">RTCTIME</samp></dt>
  61388. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  61389. instead.
  61390. </p>
  61391. </dd>
  61392. <dt><samp class="option">RTCSTART</samp></dt>
  61393. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  61394. </p>
  61395. </dd>
  61396. <dt><samp class="option">TB</samp></dt>
  61397. <dd><p>The timebase of the input timestamps.
  61398. </p>
  61399. </dd>
  61400. <dt><samp class="option">T_CHANGE</samp></dt>
  61401. <dd><p>Time of the first frame after command was applied or time of the first frame if no commands.
  61402. </p>
  61403. </dd>
  61404. </dl>
  61405. <a name="Examples-220"></a>
  61406. <h4 class="subsection">48.19.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-220" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-220" aria-hidden="true">TOC</a></span></h4>
  61407. <ul class="itemize mark-bullet">
  61408. <li>Start counting PTS from zero
  61409. <div class="example">
  61410. <pre class="example-preformatted">setpts=PTS-STARTPTS
  61411. </pre></div>
  61412. </li><li>Apply fast motion effect:
  61413. <div class="example">
  61414. <pre class="example-preformatted">setpts=0.5*PTS
  61415. </pre></div>
  61416. </li><li>Apply slow motion effect:
  61417. <div class="example">
  61418. <pre class="example-preformatted">setpts=2.0*PTS
  61419. </pre></div>
  61420. </li><li>Set fixed rate of 25 frames per second:
  61421. <div class="example">
  61422. <pre class="example-preformatted">setpts=N/(25*TB)
  61423. </pre></div>
  61424. </li><li>Apply a random jitter effect of +/-100 TB units:
  61425. <div class="example">
  61426. <pre class="example-preformatted">setpts=PTS+randomi(0, -100\,100)
  61427. </pre></div>
  61428. </li><li>Set fixed rate 25 fps with some jitter:
  61429. <div class="example">
  61430. <pre class="example-preformatted">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  61431. </pre></div>
  61432. </li><li>Apply an offset of 10 seconds to the input PTS:
  61433. <div class="example">
  61434. <pre class="example-preformatted">setpts=PTS+10/TB
  61435. </pre></div>
  61436. </li><li>Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  61437. <div class="example">
  61438. <pre class="example-preformatted">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  61439. </pre></div>
  61440. </li><li>Generate timestamps by counting samples:
  61441. <div class="example">
  61442. <pre class="example-preformatted">asetpts=N/SR/TB
  61443. </pre></div>
  61444. </li></ul>
  61445. <a name="Commands-163"></a>
  61446. <h4 class="subsection">48.19.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-163" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-163" aria-hidden="true">TOC</a></span></h4>
  61447. <p>Both filters support all above options as <a class="ref" href="#commands">commands</a>.
  61448. </p>
  61449. <a name="setrange"></a>
  61450. <h3 class="section">48.20 setrange<span class="pull-right"><a class="anchor hidden-xs" href="#setrange" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setrange" aria-hidden="true">TOC</a></span></h3>
  61451. <p>Force color range for the output video frame.
  61452. </p>
  61453. <p>The <code class="code">setrange</code> filter marks the color range property for the
  61454. output frames. It does not change the input frame, but only sets the
  61455. corresponding property, which affects how the frame is treated by
  61456. following filters.
  61457. </p>
  61458. <p>The filter accepts the following options:
  61459. </p>
  61460. <dl class="table">
  61461. <dt><samp class="option">range</samp></dt>
  61462. <dd><p>Available values are:
  61463. </p>
  61464. <dl class="table">
  61465. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  61466. <dd><p>Keep the same color range property.
  61467. </p>
  61468. </dd>
  61469. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  61470. <dd><p>Set the color range as unspecified.
  61471. </p>
  61472. </dd>
  61473. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  61474. <dd><p>Set the color range as limited.
  61475. </p>
  61476. </dd>
  61477. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  61478. <dd><p>Set the color range as full.
  61479. </p></dd>
  61480. </dl>
  61481. </dd>
  61482. </dl>
  61483. <a name="settb_002c-asettb"></a>
  61484. <h3 class="section">48.21 settb, asettb<span class="pull-right"><a class="anchor hidden-xs" href="#settb_002c-asettb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-settb_002c-asettb" aria-hidden="true">TOC</a></span></h3>
  61485. <p>Set the timebase to use for the output frames timestamps.
  61486. It is mainly useful for testing timebase configuration.
  61487. </p>
  61488. <p>It accepts the following parameters:
  61489. </p>
  61490. <dl class="table">
  61491. <dt><samp class="option">expr, tb</samp></dt>
  61492. <dd><p>The expression which is evaluated into the output timebase.
  61493. </p>
  61494. </dd>
  61495. </dl>
  61496. <p>The value for <samp class="option">tb</samp> is an arithmetic expression representing a
  61497. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  61498. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  61499. audio only). Default value is &quot;intb&quot;.
  61500. </p>
  61501. <a name="Examples-221"></a>
  61502. <h4 class="subsection">48.21.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-221" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-221" aria-hidden="true">TOC</a></span></h4>
  61503. <ul class="itemize mark-bullet">
  61504. <li>Set the timebase to 1/25:
  61505. <div class="example">
  61506. <pre class="example-preformatted">settb=expr=1/25
  61507. </pre></div>
  61508. </li><li>Set the timebase to 1/10:
  61509. <div class="example">
  61510. <pre class="example-preformatted">settb=expr=0.1
  61511. </pre></div>
  61512. </li><li>Set the timebase to 1001/1000:
  61513. <div class="example">
  61514. <pre class="example-preformatted">settb=1+0.001
  61515. </pre></div>
  61516. </li><li>Set the timebase to 2*intb:
  61517. <div class="example">
  61518. <pre class="example-preformatted">settb=2*intb
  61519. </pre></div>
  61520. </li><li>Set the default timebase value:
  61521. <div class="example">
  61522. <pre class="example-preformatted">settb=AVTB
  61523. </pre></div>
  61524. </li></ul>
  61525. <a name="showcqt"></a>
  61526. <h3 class="section">48.22 showcqt<span class="pull-right"><a class="anchor hidden-xs" href="#showcqt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showcqt" aria-hidden="true">TOC</a></span></h3>
  61527. <p>Convert input audio to a video output representing frequency spectrum
  61528. logarithmically using Brown-Puckette constant Q transform algorithm with
  61529. direct frequency domain coefficient calculation (but the transform itself
  61530. is not really constant Q, instead the Q factor is actually variable/clamped),
  61531. with musical tone scale, from E0 to D#10.
  61532. </p>
  61533. <p>The filter accepts the following options:
  61534. </p>
  61535. <dl class="table">
  61536. <dt><samp class="option">size, s</samp></dt>
  61537. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  61538. 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>.
  61539. Default value is <code class="code">1920x1080</code>.
  61540. </p>
  61541. </dd>
  61542. <dt><samp class="option">fps, rate, r</samp></dt>
  61543. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  61544. </p>
  61545. </dd>
  61546. <dt><samp class="option">bar_h</samp></dt>
  61547. <dd><p>Set the bargraph height. It must be even. Default value is <code class="code">-1</code> which
  61548. computes the bargraph height automatically.
  61549. </p>
  61550. </dd>
  61551. <dt><samp class="option">axis_h</samp></dt>
  61552. <dd><p>Set the axis height. It must be even. Default value is <code class="code">-1</code> which computes
  61553. the axis height automatically.
  61554. </p>
  61555. </dd>
  61556. <dt><samp class="option">sono_h</samp></dt>
  61557. <dd><p>Set the sonogram height. It must be even. Default value is <code class="code">-1</code> which
  61558. computes the sonogram height automatically.
  61559. </p>
  61560. </dd>
  61561. <dt><samp class="option">fullhd</samp></dt>
  61562. <dd><p>Set the fullhd resolution. This option is deprecated, use <var class="var">size</var>, <var class="var">s</var>
  61563. instead. Default value is <code class="code">1</code>.
  61564. </p>
  61565. </dd>
  61566. <dt><samp class="option">sono_v, volume</samp></dt>
  61567. <dd><p>Specify the sonogram volume expression. It can contain variables:
  61568. </p><dl class="table">
  61569. <dt><samp class="option">bar_v</samp></dt>
  61570. <dd><p>the <var class="var">bar_v</var> evaluated expression
  61571. </p></dd>
  61572. <dt><samp class="option">frequency, freq, f</samp></dt>
  61573. <dd><p>the frequency where it is evaluated
  61574. </p></dd>
  61575. <dt><samp class="option">timeclamp, tc</samp></dt>
  61576. <dd><p>the value of <var class="var">timeclamp</var> option
  61577. </p></dd>
  61578. </dl>
  61579. <p>and functions:
  61580. </p><dl class="table">
  61581. <dt><samp class="option">a_weighting(f)</samp></dt>
  61582. <dd><p>A-weighting of equal loudness
  61583. </p></dd>
  61584. <dt><samp class="option">b_weighting(f)</samp></dt>
  61585. <dd><p>B-weighting of equal loudness
  61586. </p></dd>
  61587. <dt><samp class="option">c_weighting(f)</samp></dt>
  61588. <dd><p>C-weighting of equal loudness.
  61589. </p></dd>
  61590. </dl>
  61591. <p>Default value is <code class="code">16</code>.
  61592. </p>
  61593. </dd>
  61594. <dt><samp class="option">bar_v, volume2</samp></dt>
  61595. <dd><p>Specify the bargraph volume expression. It can contain variables:
  61596. </p><dl class="table">
  61597. <dt><samp class="option">sono_v</samp></dt>
  61598. <dd><p>the <var class="var">sono_v</var> evaluated expression
  61599. </p></dd>
  61600. <dt><samp class="option">frequency, freq, f</samp></dt>
  61601. <dd><p>the frequency where it is evaluated
  61602. </p></dd>
  61603. <dt><samp class="option">timeclamp, tc</samp></dt>
  61604. <dd><p>the value of <var class="var">timeclamp</var> option
  61605. </p></dd>
  61606. </dl>
  61607. <p>and functions:
  61608. </p><dl class="table">
  61609. <dt><samp class="option">a_weighting(f)</samp></dt>
  61610. <dd><p>A-weighting of equal loudness
  61611. </p></dd>
  61612. <dt><samp class="option">b_weighting(f)</samp></dt>
  61613. <dd><p>B-weighting of equal loudness
  61614. </p></dd>
  61615. <dt><samp class="option">c_weighting(f)</samp></dt>
  61616. <dd><p>C-weighting of equal loudness.
  61617. </p></dd>
  61618. </dl>
  61619. <p>Default value is <code class="code">sono_v</code>.
  61620. </p>
  61621. </dd>
  61622. <dt><samp class="option">sono_g, gamma</samp></dt>
  61623. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  61624. higher gamma makes the spectrum having more range. Default value is <code class="code">3</code>.
  61625. Acceptable range is <code class="code">[1, 7]</code>.
  61626. </p>
  61627. </dd>
  61628. <dt><samp class="option">bar_g, gamma2</samp></dt>
  61629. <dd><p>Specify the bargraph gamma. Default value is <code class="code">1</code>. Acceptable range is
  61630. <code class="code">[1, 7]</code>.
  61631. </p>
  61632. </dd>
  61633. <dt><samp class="option">bar_t</samp></dt>
  61634. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  61635. Default value is <code class="code">1</code>. Acceptable range is <code class="code">[0, 1]</code>.
  61636. </p>
  61637. </dd>
  61638. <dt><samp class="option">timeclamp, tc</samp></dt>
  61639. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  61640. accuracy in time domain and frequency domain. If timeclamp is lower,
  61641. event in time domain is represented more accurately (such as fast bass drum),
  61642. otherwise event in frequency domain is represented more accurately
  61643. (such as bass guitar). Acceptable range is <code class="code">[0.002, 1]</code>. Default value is <code class="code">0.17</code>.
  61644. </p>
  61645. </dd>
  61646. <dt><samp class="option">attack</samp></dt>
  61647. <dd><p>Set attack time in seconds. The default is <code class="code">0</code> (disabled). Otherwise, it
  61648. limits future samples by applying asymmetric windowing in time domain, useful
  61649. when low latency is required. Accepted range is <code class="code">[0, 1]</code>.
  61650. </p>
  61651. </dd>
  61652. <dt><samp class="option">basefreq</samp></dt>
  61653. <dd><p>Specify the transform base frequency. Default value is <code class="code">20.01523126408007475</code>,
  61654. which is frequency 50 cents below E0. Acceptable range is <code class="code">[10, 100000]</code>.
  61655. </p>
  61656. </dd>
  61657. <dt><samp class="option">endfreq</samp></dt>
  61658. <dd><p>Specify the transform end frequency. Default value is <code class="code">20495.59681441799654</code>,
  61659. which is frequency 50 cents above D#10. Acceptable range is <code class="code">[10, 100000]</code>.
  61660. </p>
  61661. </dd>
  61662. <dt><samp class="option">coeffclamp</samp></dt>
  61663. <dd><p>This option is deprecated and ignored.
  61664. </p>
  61665. </dd>
  61666. <dt><samp class="option">tlength</samp></dt>
  61667. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  61668. trade-off between time domain and frequency domain at every frequency sample.
  61669. It can contain variables:
  61670. </p><dl class="table">
  61671. <dt><samp class="option">frequency, freq, f</samp></dt>
  61672. <dd><p>the frequency where it is evaluated
  61673. </p></dd>
  61674. <dt><samp class="option">timeclamp, tc</samp></dt>
  61675. <dd><p>the value of <var class="var">timeclamp</var> option.
  61676. </p></dd>
  61677. </dl>
  61678. <p>Default value is <code class="code">384*tc/(384+tc*f)</code>.
  61679. </p>
  61680. </dd>
  61681. <dt><samp class="option">count</samp></dt>
  61682. <dd><p>Specify the transform count for every video frame. Default value is <code class="code">6</code>.
  61683. Acceptable range is <code class="code">[1, 30]</code>.
  61684. </p>
  61685. </dd>
  61686. <dt><samp class="option">fcount</samp></dt>
  61687. <dd><p>Specify the transform count for every single pixel. Default value is <code class="code">0</code>,
  61688. which makes it computed automatically. Acceptable range is <code class="code">[0, 10]</code>.
  61689. </p>
  61690. </dd>
  61691. <dt><samp class="option">fontfile</samp></dt>
  61692. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  61693. use embedded font. Note that drawing with font file or embedded font is not
  61694. implemented with custom <var class="var">basefreq</var> and <var class="var">endfreq</var>, use <var class="var">axisfile</var>
  61695. option instead.
  61696. </p>
  61697. </dd>
  61698. <dt><samp class="option">font</samp></dt>
  61699. <dd><p>Specify fontconfig pattern. This has lower priority than <var class="var">fontfile</var>. The
  61700. <code class="code">:</code> in the pattern may be replaced by <code class="code">|</code> to avoid unnecessary
  61701. escaping.
  61702. </p>
  61703. </dd>
  61704. <dt><samp class="option">fontcolor</samp></dt>
  61705. <dd><p>Specify font color expression. This is arithmetic expression that should return
  61706. integer value 0xRRGGBB. It can contain variables:
  61707. </p><dl class="table">
  61708. <dt><samp class="option">frequency, freq, f</samp></dt>
  61709. <dd><p>the frequency where it is evaluated
  61710. </p></dd>
  61711. <dt><samp class="option">timeclamp, tc</samp></dt>
  61712. <dd><p>the value of <var class="var">timeclamp</var> option
  61713. </p></dd>
  61714. </dl>
  61715. <p>and functions:
  61716. </p><dl class="table">
  61717. <dt><samp class="option">midi(f)</samp></dt>
  61718. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  61719. </p></dd>
  61720. <dt><samp class="option">r(x), g(x), b(x)</samp></dt>
  61721. <dd><p>red, green, and blue value of intensity x.
  61722. </p></dd>
  61723. </dl>
  61724. <p>Default value is <code class="code">st(0, (midi(f)-59.5)/12);
  61725. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  61726. r(1-ld(1)) + b(ld(1))</code>.
  61727. </p>
  61728. </dd>
  61729. <dt><samp class="option">axisfile</samp></dt>
  61730. <dd><p>Specify image file to draw the axis. This option override <var class="var">fontfile</var> and
  61731. <var class="var">fontcolor</var> option.
  61732. </p>
  61733. </dd>
  61734. <dt><samp class="option">axis, text</samp></dt>
  61735. <dd><p>Enable/disable drawing text to the axis. If it is set to <code class="code">0</code>, drawing to
  61736. the axis is disabled, ignoring <var class="var">fontfile</var> and <var class="var">axisfile</var> option.
  61737. Default value is <code class="code">1</code>.
  61738. </p>
  61739. </dd>
  61740. <dt><samp class="option">csp</samp></dt>
  61741. <dd><p>Set colorspace. The accepted values are:
  61742. </p><dl class="table">
  61743. <dt>&lsquo;<samp class="samp">unspecified</samp>&rsquo;</dt>
  61744. <dd><p>Unspecified (default)
  61745. </p>
  61746. </dd>
  61747. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  61748. <dd><p>BT.709
  61749. </p>
  61750. </dd>
  61751. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  61752. <dd><p>FCC
  61753. </p>
  61754. </dd>
  61755. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  61756. <dd><p>BT.470BG or BT.601-6 625
  61757. </p>
  61758. </dd>
  61759. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  61760. <dd><p>SMPTE-170M or BT.601-6 525
  61761. </p>
  61762. </dd>
  61763. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  61764. <dd><p>SMPTE-240M
  61765. </p>
  61766. </dd>
  61767. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  61768. <dd><p>BT.2020 with non-constant luminance
  61769. </p>
  61770. </dd>
  61771. </dl>
  61772. </dd>
  61773. <dt><samp class="option">cscheme</samp></dt>
  61774. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  61775. <code class="code">left_r|left_g|left_b|right_r|right_g|right_b</code>.
  61776. The default is <code class="code">1|0.5|0|0|0.5|1</code>.
  61777. </p>
  61778. </dd>
  61779. </dl>
  61780. <a name="Examples-222"></a>
  61781. <h4 class="subsection">48.22.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-222" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-222" aria-hidden="true">TOC</a></span></h4>
  61782. <ul class="itemize mark-bullet">
  61783. <li>Playing audio while showing the spectrum:
  61784. <div class="example">
  61785. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  61786. </pre></div>
  61787. </li><li>Same as above, but with frame rate 30 fps:
  61788. <div class="example">
  61789. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  61790. </pre></div>
  61791. </li><li>Playing at 1280x720:
  61792. <div class="example">
  61793. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  61794. </pre></div>
  61795. </li><li>Disable sonogram display:
  61796. <div class="example">
  61797. <pre class="example-preformatted">sono_h=0
  61798. </pre></div>
  61799. </li><li>A1 and its harmonics: A1, A2, (near)E3, A3:
  61800. <div class="example">
  61801. <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),
  61802. asplit[a][out1]; [a] showcqt [out0]'
  61803. </pre></div>
  61804. </li><li>Same as above, but with more accuracy in frequency domain:
  61805. <div class="example">
  61806. <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),
  61807. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  61808. </pre></div>
  61809. </li><li>Custom volume:
  61810. <div class="example">
  61811. <pre class="example-preformatted">bar_v=10:sono_v=bar_v*a_weighting(f)
  61812. </pre></div>
  61813. </li><li>Custom gamma, now spectrum is linear to the amplitude.
  61814. <div class="example">
  61815. <pre class="example-preformatted">bar_g=2:sono_g=2
  61816. </pre></div>
  61817. </li><li>Custom tlength equation:
  61818. <div class="example">
  61819. <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)))'
  61820. </pre></div>
  61821. </li><li>Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  61822. <div class="example">
  61823. <pre class="example-preformatted">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  61824. </pre></div>
  61825. </li><li>Custom font using fontconfig:
  61826. <div class="example">
  61827. <pre class="example-preformatted">font='Courier New,Monospace,mono|bold'
  61828. </pre></div>
  61829. </li><li>Custom frequency range with custom axis using image file:
  61830. <div class="example">
  61831. <pre class="example-preformatted">axisfile=myaxis.png:basefreq=40:endfreq=10000
  61832. </pre></div>
  61833. </li></ul>
  61834. <a name="showcwt"></a>
  61835. <h3 class="section">48.23 showcwt<span class="pull-right"><a class="anchor hidden-xs" href="#showcwt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showcwt" aria-hidden="true">TOC</a></span></h3>
  61836. <p>Convert input audio to video output representing frequency spectrum
  61837. using Continuous Wavelet Transform and Morlet wavelet.
  61838. </p>
  61839. <p>The filter accepts the following options:
  61840. </p>
  61841. <dl class="table">
  61842. <dt><samp class="option">size, s</samp></dt>
  61843. <dd><p>Specify the video size for the output. For the syntax of this option,
  61844. 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>.
  61845. Default value is <code class="code">640x512</code>.
  61846. </p>
  61847. </dd>
  61848. <dt><samp class="option">rate, r</samp></dt>
  61849. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  61850. </p>
  61851. </dd>
  61852. <dt><samp class="option">scale</samp></dt>
  61853. <dd><p>Set the frequency scale used. Allowed values are:
  61854. </p>
  61855. <dl class="table">
  61856. <dt><samp class="option">linear</samp></dt>
  61857. <dt><samp class="option">log</samp></dt>
  61858. <dt><samp class="option">bark</samp></dt>
  61859. <dt><samp class="option">mel</samp></dt>
  61860. <dt><samp class="option">erbs</samp></dt>
  61861. <dt><samp class="option">sqrt</samp></dt>
  61862. <dt><samp class="option">cbrt</samp></dt>
  61863. <dt><samp class="option">qdrt</samp></dt>
  61864. <dt><samp class="option">fm</samp></dt>
  61865. </dl>
  61866. <p>Default value is <code class="code">linear</code>.
  61867. </p>
  61868. </dd>
  61869. <dt><samp class="option">iscale</samp></dt>
  61870. <dd><p>Set the intensity scale used. Allowed values are:
  61871. </p>
  61872. <dl class="table">
  61873. <dt><samp class="option">linear</samp></dt>
  61874. <dt><samp class="option">log</samp></dt>
  61875. <dt><samp class="option">sqrt</samp></dt>
  61876. <dt><samp class="option">cbrt</samp></dt>
  61877. <dt><samp class="option">qdrt</samp></dt>
  61878. </dl>
  61879. <p>Default value is <code class="code">log</code>.
  61880. </p>
  61881. </dd>
  61882. <dt><samp class="option">min</samp></dt>
  61883. <dd><p>Set the minimum frequency that will be used in output.
  61884. Default is <code class="code">20</code> Hz.
  61885. </p>
  61886. </dd>
  61887. <dt><samp class="option">max</samp></dt>
  61888. <dd><p>Set the maximum frequency that will be used in output.
  61889. Default is <code class="code">20000</code> Hz. The real frequency upper limit
  61890. depends on input audio&rsquo;s sample rate and such will be enforced
  61891. on this value when it is set to value greater than Nyquist frequency.
  61892. </p>
  61893. </dd>
  61894. <dt><samp class="option">imin</samp></dt>
  61895. <dd><p>Set the minimum intensity that will be used in output.
  61896. </p>
  61897. </dd>
  61898. <dt><samp class="option">imax</samp></dt>
  61899. <dd><p>Set the maximum intensity that will be used in output.
  61900. </p>
  61901. </dd>
  61902. <dt><samp class="option">logb</samp></dt>
  61903. <dd><p>Set the logarithmic basis for brightness strength when
  61904. mapping calculated magnitude values to pixel values.
  61905. Allowed range is from <code class="code">0</code> to <code class="code">1</code>.
  61906. Default value is <code class="code">0.0001</code>.
  61907. </p>
  61908. </dd>
  61909. <dt><samp class="option">deviation</samp></dt>
  61910. <dd><p>Set the frequency deviation.
  61911. Lower values than <code class="code">1</code> are more frequency oriented,
  61912. while higher values than <code class="code">1</code> are more time oriented.
  61913. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  61914. Default value is <code class="code">1</code>.
  61915. </p>
  61916. </dd>
  61917. <dt><samp class="option">pps</samp></dt>
  61918. <dd><p>Set the number of pixel output per each second in one row.
  61919. Allowed range is from <code class="code">1</code> to <code class="code">1024</code>.
  61920. Default value is <code class="code">64</code>.
  61921. </p>
  61922. </dd>
  61923. <dt><samp class="option">mode</samp></dt>
  61924. <dd><p>Set the output visual mode. Allowed values are:
  61925. </p>
  61926. <dl class="table">
  61927. <dt><samp class="option">magnitude</samp></dt>
  61928. <dd><p>Show magnitude.
  61929. </p></dd>
  61930. <dt><samp class="option">phase</samp></dt>
  61931. <dd><p>Show only phase.
  61932. </p></dd>
  61933. <dt><samp class="option">magphase</samp></dt>
  61934. <dd><p>Show combination of magnitude and phase.
  61935. Magnitude is mapped to brightness and phase to color.
  61936. </p></dd>
  61937. <dt><samp class="option">channel</samp></dt>
  61938. <dd><p>Show unique color per channel magnitude.
  61939. </p></dd>
  61940. <dt><samp class="option">stereo</samp></dt>
  61941. <dd><p>Show unique color per stereo difference.
  61942. </p></dd>
  61943. </dl>
  61944. <p>Default value is <code class="code">magnitude</code>.
  61945. </p>
  61946. </dd>
  61947. <dt><samp class="option">slide</samp></dt>
  61948. <dd><p>Set the output slide method. Allowed values are:
  61949. </p>
  61950. <dl class="table">
  61951. <dt><samp class="option">replace</samp></dt>
  61952. <dt><samp class="option">scroll</samp></dt>
  61953. <dt><samp class="option">frame</samp></dt>
  61954. </dl>
  61955. </dd>
  61956. <dt><samp class="option">direction</samp></dt>
  61957. <dd><p>Set the direction method for output slide method. Allowed values are:
  61958. </p>
  61959. <dl class="table">
  61960. <dt><samp class="option">lr</samp></dt>
  61961. <dd><p>Direction from left to right.
  61962. </p></dd>
  61963. <dt><samp class="option">rl</samp></dt>
  61964. <dd><p>Direction from right to left.
  61965. </p></dd>
  61966. <dt><samp class="option">ud</samp></dt>
  61967. <dd><p>Direction from up to down.
  61968. </p></dd>
  61969. <dt><samp class="option">du</samp></dt>
  61970. <dd><p>Direction from down to up.
  61971. </p></dd>
  61972. </dl>
  61973. </dd>
  61974. <dt><samp class="option">bar</samp></dt>
  61975. <dd><p>Set the ratio of bargraph display to display size. Default is 0.
  61976. </p>
  61977. </dd>
  61978. <dt><samp class="option">rotation</samp></dt>
  61979. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  61980. Default value is <code class="code">0</code>.
  61981. </p></dd>
  61982. </dl>
  61983. <a name="showfreqs"></a>
  61984. <h3 class="section">48.24 showfreqs<span class="pull-right"><a class="anchor hidden-xs" href="#showfreqs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showfreqs" aria-hidden="true">TOC</a></span></h3>
  61985. <p>Convert input audio to video output representing the audio power spectrum.
  61986. Audio amplitude is on Y-axis while frequency is on X-axis.
  61987. </p>
  61988. <p>The filter accepts the following options:
  61989. </p>
  61990. <dl class="table">
  61991. <dt><samp class="option">size, s</samp></dt>
  61992. <dd><p>Specify size of video. For the syntax of this option, check the
  61993. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  61994. Default is <code class="code">1024x512</code>.
  61995. </p>
  61996. </dd>
  61997. <dt><samp class="option">rate, r</samp></dt>
  61998. <dd><p>Set video rate. Default is <code class="code">25</code>.
  61999. </p>
  62000. </dd>
  62001. <dt><samp class="option">mode</samp></dt>
  62002. <dd><p>Set display mode.
  62003. This set how each frequency bin will be represented.
  62004. </p>
  62005. <p>It accepts the following values:
  62006. </p><dl class="table">
  62007. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  62008. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  62009. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  62010. </dl>
  62011. <p>Default is <code class="code">bar</code>.
  62012. </p>
  62013. </dd>
  62014. <dt><samp class="option">ascale</samp></dt>
  62015. <dd><p>Set amplitude scale.
  62016. </p>
  62017. <p>It accepts the following values:
  62018. </p><dl class="table">
  62019. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62020. <dd><p>Linear scale.
  62021. </p>
  62022. </dd>
  62023. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  62024. <dd><p>Square root scale.
  62025. </p>
  62026. </dd>
  62027. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  62028. <dd><p>Cubic root scale.
  62029. </p>
  62030. </dd>
  62031. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62032. <dd><p>Logarithmic scale.
  62033. </p></dd>
  62034. </dl>
  62035. <p>Default is <code class="code">log</code>.
  62036. </p>
  62037. </dd>
  62038. <dt><samp class="option">fscale</samp></dt>
  62039. <dd><p>Set frequency scale.
  62040. </p>
  62041. <p>It accepts the following values:
  62042. </p><dl class="table">
  62043. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62044. <dd><p>Linear scale.
  62045. </p>
  62046. </dd>
  62047. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62048. <dd><p>Logarithmic scale.
  62049. </p>
  62050. </dd>
  62051. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  62052. <dd><p>Reverse logarithmic scale.
  62053. </p></dd>
  62054. </dl>
  62055. <p>Default is <code class="code">lin</code>.
  62056. </p>
  62057. </dd>
  62058. <dt><samp class="option">win_size</samp></dt>
  62059. <dd><p>Set window size. Allowed range is from 16 to 65536.
  62060. </p>
  62061. <p>Default is <code class="code">2048</code>
  62062. </p>
  62063. </dd>
  62064. <dt><samp class="option">win_func</samp></dt>
  62065. <dd><p>Set windowing function.
  62066. </p>
  62067. <p>It accepts the following values:
  62068. </p><dl class="table">
  62069. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  62070. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  62071. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  62072. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  62073. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  62074. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  62075. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  62076. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  62077. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  62078. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  62079. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  62080. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  62081. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  62082. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  62083. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  62084. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  62085. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  62086. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  62087. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  62088. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  62089. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  62090. </dl>
  62091. <p>Default is <code class="code">hanning</code>.
  62092. </p>
  62093. </dd>
  62094. <dt><samp class="option">overlap</samp></dt>
  62095. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  62096. which means optimal overlap for selected window function will be picked.
  62097. </p>
  62098. </dd>
  62099. <dt><samp class="option">averaging</samp></dt>
  62100. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  62101. Default is <code class="code">1</code>, which means time averaging is disabled.
  62102. </p>
  62103. </dd>
  62104. <dt><samp class="option">colors</samp></dt>
  62105. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  62106. draw channel frequencies. Unrecognized or missing colors will be replaced
  62107. by white color.
  62108. </p>
  62109. </dd>
  62110. <dt><samp class="option">cmode</samp></dt>
  62111. <dd><p>Set channel display mode.
  62112. </p>
  62113. <p>It accepts the following values:
  62114. </p><dl class="table">
  62115. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  62116. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  62117. </dl>
  62118. <p>Default is <code class="code">combined</code>.
  62119. </p>
  62120. </dd>
  62121. <dt><samp class="option">minamp</samp></dt>
  62122. <dd><p>Set minimum amplitude used in <code class="code">log</code> amplitude scaler.
  62123. </p>
  62124. </dd>
  62125. <dt><samp class="option">data</samp></dt>
  62126. <dd><p>Set data display mode.
  62127. </p>
  62128. <p>It accepts the following values:
  62129. </p><dl class="table">
  62130. <dt>&lsquo;<samp class="samp">magnitude</samp>&rsquo;</dt>
  62131. <dt>&lsquo;<samp class="samp">phase</samp>&rsquo;</dt>
  62132. <dt>&lsquo;<samp class="samp">delay</samp>&rsquo;</dt>
  62133. </dl>
  62134. <p>Default is <code class="code">magnitude</code>.
  62135. </p>
  62136. </dd>
  62137. <dt><samp class="option">channels</samp></dt>
  62138. <dd><p>Set channels to use when processing audio. By default all are processed.
  62139. </p></dd>
  62140. </dl>
  62141. <a name="showspatial"></a>
  62142. <h3 class="section">48.25 showspatial<span class="pull-right"><a class="anchor hidden-xs" href="#showspatial" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspatial" aria-hidden="true">TOC</a></span></h3>
  62143. <p>Convert stereo input audio to a video output, representing the spatial relationship
  62144. between two channels.
  62145. </p>
  62146. <p>The filter accepts the following options:
  62147. </p>
  62148. <dl class="table">
  62149. <dt><samp class="option">size, s</samp></dt>
  62150. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  62151. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  62152. Default value is <code class="code">512x512</code>.
  62153. </p>
  62154. </dd>
  62155. <dt><samp class="option">win_size</samp></dt>
  62156. <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>.
  62157. </p>
  62158. </dd>
  62159. <dt><samp class="option">win_func</samp></dt>
  62160. <dd><p>Set window function.
  62161. </p>
  62162. <p>It accepts the following values:
  62163. </p><dl class="table">
  62164. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  62165. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  62166. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  62167. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  62168. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  62169. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  62170. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  62171. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  62172. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  62173. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  62174. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  62175. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  62176. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  62177. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  62178. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  62179. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  62180. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  62181. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  62182. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  62183. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  62184. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  62185. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  62186. </dl>
  62187. <p>Default value is <code class="code">hann</code>.
  62188. </p>
  62189. </dd>
  62190. <dt><samp class="option">rate, r</samp></dt>
  62191. <dd><p>Set output framerate.
  62192. </p></dd>
  62193. </dl>
  62194. <a class="anchor" id="showspectrum"></a><a name="showspectrum-1"></a>
  62195. <h3 class="section">48.26 showspectrum<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrum-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrum-1" aria-hidden="true">TOC</a></span></h3>
  62196. <p>Convert input audio to a video output, representing the audio frequency
  62197. spectrum.
  62198. </p>
  62199. <p>The filter accepts the following options:
  62200. </p>
  62201. <dl class="table">
  62202. <dt><samp class="option">size, s</samp></dt>
  62203. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  62204. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  62205. Default value is <code class="code">640x512</code>.
  62206. </p>
  62207. </dd>
  62208. <dt><samp class="option">slide</samp></dt>
  62209. <dd><p>Specify how the spectrum should slide along the window.
  62210. </p>
  62211. <p>It accepts the following values:
  62212. </p><dl class="table">
  62213. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  62214. <dd><p>the samples start again on the left when they reach the right
  62215. </p></dd>
  62216. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  62217. <dd><p>the samples scroll from right to left
  62218. </p></dd>
  62219. <dt>&lsquo;<samp class="samp">fullframe</samp>&rsquo;</dt>
  62220. <dd><p>frames are only produced when the samples reach the right
  62221. </p></dd>
  62222. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  62223. <dd><p>the samples scroll from left to right
  62224. </p></dd>
  62225. <dt>&lsquo;<samp class="samp">lreplace</samp>&rsquo;</dt>
  62226. <dd><p>the samples start again on the right when they reach the left
  62227. </p></dd>
  62228. </dl>
  62229. <p>Default value is <code class="code">replace</code>.
  62230. </p>
  62231. </dd>
  62232. <dt><samp class="option">mode</samp></dt>
  62233. <dd><p>Specify display mode.
  62234. </p>
  62235. <p>It accepts the following values:
  62236. </p><dl class="table">
  62237. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  62238. <dd><p>all channels are displayed in the same row
  62239. </p></dd>
  62240. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  62241. <dd><p>all channels are displayed in separate rows
  62242. </p></dd>
  62243. </dl>
  62244. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  62245. </p>
  62246. </dd>
  62247. <dt><samp class="option">color</samp></dt>
  62248. <dd><p>Specify display color mode.
  62249. </p>
  62250. <p>It accepts the following values:
  62251. </p><dl class="table">
  62252. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  62253. <dd><p>each channel is displayed in a separate color
  62254. </p></dd>
  62255. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  62256. <dd><p>each channel is displayed using the same color scheme
  62257. </p></dd>
  62258. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  62259. <dd><p>each channel is displayed using the rainbow color scheme
  62260. </p></dd>
  62261. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  62262. <dd><p>each channel is displayed using the moreland color scheme
  62263. </p></dd>
  62264. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  62265. <dd><p>each channel is displayed using the nebulae color scheme
  62266. </p></dd>
  62267. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  62268. <dd><p>each channel is displayed using the fire color scheme
  62269. </p></dd>
  62270. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  62271. <dd><p>each channel is displayed using the fiery color scheme
  62272. </p></dd>
  62273. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  62274. <dd><p>each channel is displayed using the fruit color scheme
  62275. </p></dd>
  62276. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  62277. <dd><p>each channel is displayed using the cool color scheme
  62278. </p></dd>
  62279. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  62280. <dd><p>each channel is displayed using the magma color scheme
  62281. </p></dd>
  62282. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  62283. <dd><p>each channel is displayed using the green color scheme
  62284. </p></dd>
  62285. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  62286. <dd><p>each channel is displayed using the viridis color scheme
  62287. </p></dd>
  62288. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  62289. <dd><p>each channel is displayed using the plasma color scheme
  62290. </p></dd>
  62291. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  62292. <dd><p>each channel is displayed using the cividis color scheme
  62293. </p></dd>
  62294. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  62295. <dd><p>each channel is displayed using the terrain color scheme
  62296. </p></dd>
  62297. </dl>
  62298. <p>Default value is &lsquo;<samp class="samp">channel</samp>&rsquo;.
  62299. </p>
  62300. </dd>
  62301. <dt><samp class="option">scale</samp></dt>
  62302. <dd><p>Specify scale used for calculating intensity color values.
  62303. </p>
  62304. <p>It accepts the following values:
  62305. </p><dl class="table">
  62306. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62307. <dd><p>linear
  62308. </p></dd>
  62309. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  62310. <dd><p>square root, default
  62311. </p></dd>
  62312. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  62313. <dd><p>cubic root
  62314. </p></dd>
  62315. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62316. <dd><p>logarithmic
  62317. </p></dd>
  62318. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  62319. <dd><p>4th root
  62320. </p></dd>
  62321. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  62322. <dd><p>5th root
  62323. </p></dd>
  62324. </dl>
  62325. <p>Default value is &lsquo;<samp class="samp">sqrt</samp>&rsquo;.
  62326. </p>
  62327. </dd>
  62328. <dt><samp class="option">fscale</samp></dt>
  62329. <dd><p>Specify frequency scale.
  62330. </p>
  62331. <p>It accepts the following values:
  62332. </p><dl class="table">
  62333. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62334. <dd><p>linear
  62335. </p></dd>
  62336. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62337. <dd><p>logarithmic
  62338. </p></dd>
  62339. </dl>
  62340. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  62341. </p>
  62342. </dd>
  62343. <dt><samp class="option">saturation</samp></dt>
  62344. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  62345. alternative color scheme. <code class="code">0</code> is no saturation at all.
  62346. Saturation must be in [-10.0, 10.0] range.
  62347. Default value is <code class="code">1</code>.
  62348. </p>
  62349. </dd>
  62350. <dt><samp class="option">win_func</samp></dt>
  62351. <dd><p>Set window function.
  62352. </p>
  62353. <p>It accepts the following values:
  62354. </p><dl class="table">
  62355. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  62356. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  62357. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  62358. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  62359. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  62360. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  62361. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  62362. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  62363. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  62364. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  62365. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  62366. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  62367. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  62368. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  62369. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  62370. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  62371. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  62372. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  62373. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  62374. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  62375. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  62376. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  62377. </dl>
  62378. <p>Default value is <code class="code">hann</code>.
  62379. </p>
  62380. </dd>
  62381. <dt><samp class="option">orientation</samp></dt>
  62382. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  62383. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  62384. </p>
  62385. </dd>
  62386. <dt><samp class="option">overlap</samp></dt>
  62387. <dd><p>Set ratio of overlap window. Default value is <code class="code">0</code>.
  62388. When value is <code class="code">1</code> overlap is set to recommended size for specific
  62389. window function currently used.
  62390. </p>
  62391. </dd>
  62392. <dt><samp class="option">gain</samp></dt>
  62393. <dd><p>Set scale gain for calculating intensity color values.
  62394. Default value is <code class="code">1</code>.
  62395. </p>
  62396. </dd>
  62397. <dt><samp class="option">data</samp></dt>
  62398. <dd><p>Set which data to display. Can be <code class="code">magnitude</code>, default or <code class="code">phase</code>,
  62399. or unwrapped phase: <code class="code">uphase</code>.
  62400. </p>
  62401. </dd>
  62402. <dt><samp class="option">rotation</samp></dt>
  62403. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  62404. Default value is <code class="code">0</code>.
  62405. </p>
  62406. </dd>
  62407. <dt><samp class="option">start</samp></dt>
  62408. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  62409. </p>
  62410. </dd>
  62411. <dt><samp class="option">stop</samp></dt>
  62412. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  62413. </p>
  62414. </dd>
  62415. <dt><samp class="option">fps</samp></dt>
  62416. <dd><p>Set upper frame rate limit. Default is <code class="code">auto</code>, unlimited.
  62417. </p>
  62418. </dd>
  62419. <dt><samp class="option">legend</samp></dt>
  62420. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  62421. </p>
  62422. </dd>
  62423. <dt><samp class="option">drange</samp></dt>
  62424. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  62425. Allowed range is from 10 to 200.
  62426. </p>
  62427. </dd>
  62428. <dt><samp class="option">limit</samp></dt>
  62429. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  62430. Allowed range is from -100 to 100.
  62431. </p>
  62432. </dd>
  62433. <dt><samp class="option">opacity</samp></dt>
  62434. <dd><p>Set opacity strength when using pixel format output with alpha component.
  62435. </p></dd>
  62436. </dl>
  62437. <p>The usage is very similar to the showwaves filter; see the examples in that
  62438. section.
  62439. </p>
  62440. <a name="Examples-223"></a>
  62441. <h4 class="subsection">48.26.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-223" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-223" aria-hidden="true">TOC</a></span></h4>
  62442. <ul class="itemize mark-bullet">
  62443. <li>Large window with logarithmic color scaling:
  62444. <div class="example">
  62445. <pre class="example-preformatted">showspectrum=s=1280x480:scale=log
  62446. </pre></div>
  62447. </li><li>Complete example for a colored and sliding spectrum per channel using <code class="command">ffplay</code>:
  62448. <div class="example">
  62449. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  62450. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  62451. </pre></div>
  62452. </li></ul>
  62453. <a name="showspectrumpic"></a>
  62454. <h3 class="section">48.27 showspectrumpic<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrumpic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrumpic" aria-hidden="true">TOC</a></span></h3>
  62455. <p>Convert input audio to a single video frame, representing the audio frequency
  62456. spectrum.
  62457. </p>
  62458. <p>The filter accepts the following options:
  62459. </p>
  62460. <dl class="table">
  62461. <dt><samp class="option">size, s</samp></dt>
  62462. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  62463. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  62464. Default value is <code class="code">4096x2048</code>.
  62465. </p>
  62466. </dd>
  62467. <dt><samp class="option">mode</samp></dt>
  62468. <dd><p>Specify display mode.
  62469. </p>
  62470. <p>It accepts the following values:
  62471. </p><dl class="table">
  62472. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  62473. <dd><p>all channels are displayed in the same row
  62474. </p></dd>
  62475. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  62476. <dd><p>all channels are displayed in separate rows
  62477. </p></dd>
  62478. </dl>
  62479. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  62480. </p>
  62481. </dd>
  62482. <dt><samp class="option">color</samp></dt>
  62483. <dd><p>Specify display color mode.
  62484. </p>
  62485. <p>It accepts the following values:
  62486. </p><dl class="table">
  62487. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  62488. <dd><p>each channel is displayed in a separate color
  62489. </p></dd>
  62490. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  62491. <dd><p>each channel is displayed using the same color scheme
  62492. </p></dd>
  62493. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  62494. <dd><p>each channel is displayed using the rainbow color scheme
  62495. </p></dd>
  62496. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  62497. <dd><p>each channel is displayed using the moreland color scheme
  62498. </p></dd>
  62499. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  62500. <dd><p>each channel is displayed using the nebulae color scheme
  62501. </p></dd>
  62502. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  62503. <dd><p>each channel is displayed using the fire color scheme
  62504. </p></dd>
  62505. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  62506. <dd><p>each channel is displayed using the fiery color scheme
  62507. </p></dd>
  62508. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  62509. <dd><p>each channel is displayed using the fruit color scheme
  62510. </p></dd>
  62511. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  62512. <dd><p>each channel is displayed using the cool color scheme
  62513. </p></dd>
  62514. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  62515. <dd><p>each channel is displayed using the magma color scheme
  62516. </p></dd>
  62517. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  62518. <dd><p>each channel is displayed using the green color scheme
  62519. </p></dd>
  62520. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  62521. <dd><p>each channel is displayed using the viridis color scheme
  62522. </p></dd>
  62523. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  62524. <dd><p>each channel is displayed using the plasma color scheme
  62525. </p></dd>
  62526. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  62527. <dd><p>each channel is displayed using the cividis color scheme
  62528. </p></dd>
  62529. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  62530. <dd><p>each channel is displayed using the terrain color scheme
  62531. </p></dd>
  62532. </dl>
  62533. <p>Default value is &lsquo;<samp class="samp">intensity</samp>&rsquo;.
  62534. </p>
  62535. </dd>
  62536. <dt><samp class="option">scale</samp></dt>
  62537. <dd><p>Specify scale used for calculating intensity color values.
  62538. </p>
  62539. <p>It accepts the following values:
  62540. </p><dl class="table">
  62541. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62542. <dd><p>linear
  62543. </p></dd>
  62544. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  62545. <dd><p>square root, default
  62546. </p></dd>
  62547. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  62548. <dd><p>cubic root
  62549. </p></dd>
  62550. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62551. <dd><p>logarithmic
  62552. </p></dd>
  62553. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  62554. <dd><p>4th root
  62555. </p></dd>
  62556. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  62557. <dd><p>5th root
  62558. </p></dd>
  62559. </dl>
  62560. <p>Default value is &lsquo;<samp class="samp">log</samp>&rsquo;.
  62561. </p>
  62562. </dd>
  62563. <dt><samp class="option">fscale</samp></dt>
  62564. <dd><p>Specify frequency scale.
  62565. </p>
  62566. <p>It accepts the following values:
  62567. </p><dl class="table">
  62568. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62569. <dd><p>linear
  62570. </p></dd>
  62571. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62572. <dd><p>logarithmic
  62573. </p></dd>
  62574. </dl>
  62575. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  62576. </p>
  62577. </dd>
  62578. <dt><samp class="option">saturation</samp></dt>
  62579. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  62580. alternative color scheme. <code class="code">0</code> is no saturation at all.
  62581. Saturation must be in [-10.0, 10.0] range.
  62582. Default value is <code class="code">1</code>.
  62583. </p>
  62584. </dd>
  62585. <dt><samp class="option">win_func</samp></dt>
  62586. <dd><p>Set window function.
  62587. </p>
  62588. <p>It accepts the following values:
  62589. </p><dl class="table">
  62590. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  62591. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  62592. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  62593. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  62594. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  62595. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  62596. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  62597. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  62598. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  62599. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  62600. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  62601. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  62602. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  62603. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  62604. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  62605. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  62606. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  62607. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  62608. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  62609. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  62610. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  62611. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  62612. </dl>
  62613. <p>Default value is <code class="code">hann</code>.
  62614. </p>
  62615. </dd>
  62616. <dt><samp class="option">orientation</samp></dt>
  62617. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  62618. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  62619. </p>
  62620. </dd>
  62621. <dt><samp class="option">gain</samp></dt>
  62622. <dd><p>Set scale gain for calculating intensity color values.
  62623. Default value is <code class="code">1</code>.
  62624. </p>
  62625. </dd>
  62626. <dt><samp class="option">legend</samp></dt>
  62627. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  62628. </p>
  62629. </dd>
  62630. <dt><samp class="option">rotation</samp></dt>
  62631. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  62632. Default value is <code class="code">0</code>.
  62633. </p>
  62634. </dd>
  62635. <dt><samp class="option">start</samp></dt>
  62636. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  62637. </p>
  62638. </dd>
  62639. <dt><samp class="option">stop</samp></dt>
  62640. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  62641. </p>
  62642. </dd>
  62643. <dt><samp class="option">drange</samp></dt>
  62644. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  62645. Allowed range is from 10 to 200.
  62646. </p>
  62647. </dd>
  62648. <dt><samp class="option">limit</samp></dt>
  62649. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  62650. Allowed range is from -100 to 100.
  62651. </p>
  62652. </dd>
  62653. <dt><samp class="option">opacity</samp></dt>
  62654. <dd><p>Set opacity strength when using pixel format output with alpha component.
  62655. </p></dd>
  62656. </dl>
  62657. <a name="Examples-224"></a>
  62658. <h4 class="subsection">48.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-224" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-224" aria-hidden="true">TOC</a></span></h4>
  62659. <ul class="itemize mark-bullet">
  62660. <li>Extract an audio spectrogram of a whole audio track
  62661. in a 1024x1024 picture using <code class="command">ffmpeg</code>:
  62662. <div class="example">
  62663. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  62664. </pre></div>
  62665. </li></ul>
  62666. <a name="showvolume"></a>
  62667. <h3 class="section">48.28 showvolume<span class="pull-right"><a class="anchor hidden-xs" href="#showvolume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showvolume" aria-hidden="true">TOC</a></span></h3>
  62668. <p>Convert input audio volume to a video output.
  62669. </p>
  62670. <p>The filter accepts the following options:
  62671. </p>
  62672. <dl class="table">
  62673. <dt><samp class="option">rate, r</samp></dt>
  62674. <dd><p>Set video rate.
  62675. </p>
  62676. </dd>
  62677. <dt><samp class="option">b</samp></dt>
  62678. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  62679. </p>
  62680. </dd>
  62681. <dt><samp class="option">w</samp></dt>
  62682. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  62683. </p>
  62684. </dd>
  62685. <dt><samp class="option">h</samp></dt>
  62686. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  62687. </p>
  62688. </dd>
  62689. <dt><samp class="option">f</samp></dt>
  62690. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  62691. </p>
  62692. </dd>
  62693. <dt><samp class="option">c</samp></dt>
  62694. <dd><p>Set volume color expression.
  62695. </p>
  62696. <p>The expression can use the following variables:
  62697. </p>
  62698. <dl class="table">
  62699. <dt><samp class="option">VOLUME</samp></dt>
  62700. <dd><p>Current max volume of channel in dB.
  62701. </p>
  62702. </dd>
  62703. <dt><samp class="option">PEAK</samp></dt>
  62704. <dd><p>Current peak.
  62705. </p>
  62706. </dd>
  62707. <dt><samp class="option">CHANNEL</samp></dt>
  62708. <dd><p>Current channel number, starting from 0.
  62709. </p></dd>
  62710. </dl>
  62711. </dd>
  62712. <dt><samp class="option">t</samp></dt>
  62713. <dd><p>If set, displays channel names. Default is enabled.
  62714. </p>
  62715. </dd>
  62716. <dt><samp class="option">v</samp></dt>
  62717. <dd><p>If set, displays volume values. Default is enabled.
  62718. </p>
  62719. </dd>
  62720. <dt><samp class="option">o</samp></dt>
  62721. <dd><p>Set orientation, can be horizontal: <code class="code">h</code> or vertical: <code class="code">v</code>,
  62722. default is <code class="code">h</code>.
  62723. </p>
  62724. </dd>
  62725. <dt><samp class="option">s</samp></dt>
  62726. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  62727. step is disabled.
  62728. </p>
  62729. </dd>
  62730. <dt><samp class="option">p</samp></dt>
  62731. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  62732. </p>
  62733. </dd>
  62734. <dt><samp class="option">m</samp></dt>
  62735. <dd><p>Set metering mode, can be peak: <code class="code">p</code> or rms: <code class="code">r</code>,
  62736. default is <code class="code">p</code>.
  62737. </p>
  62738. </dd>
  62739. <dt><samp class="option">ds</samp></dt>
  62740. <dd><p>Set display scale, can be linear: <code class="code">lin</code> or log: <code class="code">log</code>,
  62741. default is <code class="code">lin</code>.
  62742. </p>
  62743. </dd>
  62744. <dt><samp class="option">dm</samp></dt>
  62745. <dd><p>In second.
  62746. If set to &gt; 0., display a line for the max level
  62747. in the previous seconds.
  62748. default is disabled: <code class="code">0.</code>
  62749. </p>
  62750. </dd>
  62751. <dt><samp class="option">dmc</samp></dt>
  62752. <dd><p>The color of the max line. Use when <code class="code">dm</code> option is set to &gt; 0.
  62753. default is: <code class="code">orange</code>
  62754. </p></dd>
  62755. </dl>
  62756. <a name="showwaves"></a>
  62757. <h3 class="section">48.29 showwaves<span class="pull-right"><a class="anchor hidden-xs" href="#showwaves" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwaves" aria-hidden="true">TOC</a></span></h3>
  62758. <p>Convert input audio to a video output, representing the samples waves.
  62759. </p>
  62760. <p>The filter accepts the following options:
  62761. </p>
  62762. <dl class="table">
  62763. <dt><samp class="option">size, s</samp></dt>
  62764. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  62765. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  62766. Default value is <code class="code">600x240</code>.
  62767. </p>
  62768. </dd>
  62769. <dt><samp class="option">mode</samp></dt>
  62770. <dd><p>Set display mode.
  62771. </p>
  62772. <p>Available values are:
  62773. </p><dl class="table">
  62774. <dt>&lsquo;<samp class="samp">point</samp>&rsquo;</dt>
  62775. <dd><p>Draw a point for each sample.
  62776. </p>
  62777. </dd>
  62778. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  62779. <dd><p>Draw a vertical line for each sample.
  62780. </p>
  62781. </dd>
  62782. <dt>&lsquo;<samp class="samp">p2p</samp>&rsquo;</dt>
  62783. <dd><p>Draw a point for each sample and a line between them.
  62784. </p>
  62785. </dd>
  62786. <dt>&lsquo;<samp class="samp">cline</samp>&rsquo;</dt>
  62787. <dd><p>Draw a centered vertical line for each sample.
  62788. </p></dd>
  62789. </dl>
  62790. <p>Default value is <code class="code">point</code>.
  62791. </p>
  62792. </dd>
  62793. <dt><samp class="option">n</samp></dt>
  62794. <dd><p>Set the number of samples which are printed on the same column. A
  62795. larger value will decrease the frame rate. Must be a positive
  62796. integer. This option can be set only if the value for <var class="var">rate</var>
  62797. is not explicitly specified.
  62798. </p>
  62799. </dd>
  62800. <dt><samp class="option">rate, r</samp></dt>
  62801. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  62802. option <var class="var">n</var>. Default value is &quot;25&quot;.
  62803. </p>
  62804. </dd>
  62805. <dt><samp class="option">split_channels</samp></dt>
  62806. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  62807. </p>
  62808. </dd>
  62809. <dt><samp class="option">colors</samp></dt>
  62810. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  62811. </p>
  62812. </dd>
  62813. <dt><samp class="option">scale</samp></dt>
  62814. <dd><p>Set amplitude scale.
  62815. </p>
  62816. <p>Available values are:
  62817. </p><dl class="table">
  62818. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62819. <dd><p>Linear.
  62820. </p>
  62821. </dd>
  62822. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62823. <dd><p>Logarithmic.
  62824. </p>
  62825. </dd>
  62826. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  62827. <dd><p>Square root.
  62828. </p>
  62829. </dd>
  62830. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  62831. <dd><p>Cubic root.
  62832. </p></dd>
  62833. </dl>
  62834. <p>Default is linear.
  62835. </p>
  62836. </dd>
  62837. <dt><samp class="option">draw</samp></dt>
  62838. <dd><p>Set the draw mode. This is mostly useful to set for high <var class="var">n</var>.
  62839. </p>
  62840. <p>Available values are:
  62841. </p><dl class="table">
  62842. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  62843. <dd><p>Scale pixel values for each drawn sample.
  62844. </p>
  62845. </dd>
  62846. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  62847. <dd><p>Draw every sample directly.
  62848. </p></dd>
  62849. </dl>
  62850. <p>Default value is <code class="code">scale</code>.
  62851. </p></dd>
  62852. </dl>
  62853. <a name="Examples-225"></a>
  62854. <h4 class="subsection">48.29.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-225" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-225" aria-hidden="true">TOC</a></span></h4>
  62855. <ul class="itemize mark-bullet">
  62856. <li>Output the input file audio and the corresponding video representation
  62857. at the same time:
  62858. <div class="example">
  62859. <pre class="example-preformatted">amovie=a.mp3,asplit[out0],showwaves[out1]
  62860. </pre></div>
  62861. </li><li>Create a synthetic signal and show it with showwaves, forcing a
  62862. frame rate of 30 frames per second:
  62863. <div class="example">
  62864. <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]
  62865. </pre></div>
  62866. </li></ul>
  62867. <a name="showwavespic"></a>
  62868. <h3 class="section">48.30 showwavespic<span class="pull-right"><a class="anchor hidden-xs" href="#showwavespic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwavespic" aria-hidden="true">TOC</a></span></h3>
  62869. <p>Convert input audio to a single video frame, representing the samples waves.
  62870. </p>
  62871. <p>The filter accepts the following options:
  62872. </p>
  62873. <dl class="table">
  62874. <dt><samp class="option">size, s</samp></dt>
  62875. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  62876. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  62877. Default value is <code class="code">600x240</code>.
  62878. </p>
  62879. </dd>
  62880. <dt><samp class="option">split_channels</samp></dt>
  62881. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  62882. </p>
  62883. </dd>
  62884. <dt><samp class="option">colors</samp></dt>
  62885. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  62886. </p>
  62887. </dd>
  62888. <dt><samp class="option">scale</samp></dt>
  62889. <dd><p>Set amplitude scale.
  62890. </p>
  62891. <p>Available values are:
  62892. </p><dl class="table">
  62893. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62894. <dd><p>Linear.
  62895. </p>
  62896. </dd>
  62897. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62898. <dd><p>Logarithmic.
  62899. </p>
  62900. </dd>
  62901. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  62902. <dd><p>Square root.
  62903. </p>
  62904. </dd>
  62905. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  62906. <dd><p>Cubic root.
  62907. </p></dd>
  62908. </dl>
  62909. <p>Default is linear.
  62910. </p>
  62911. </dd>
  62912. <dt><samp class="option">draw</samp></dt>
  62913. <dd><p>Set the draw mode.
  62914. </p>
  62915. <p>Available values are:
  62916. </p><dl class="table">
  62917. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  62918. <dd><p>Scale pixel values for each drawn sample.
  62919. </p>
  62920. </dd>
  62921. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  62922. <dd><p>Draw every sample directly.
  62923. </p></dd>
  62924. </dl>
  62925. <p>Default value is <code class="code">scale</code>.
  62926. </p>
  62927. </dd>
  62928. <dt><samp class="option">filter</samp></dt>
  62929. <dd><p>Set the filter mode.
  62930. </p>
  62931. <p>Available values are:
  62932. </p><dl class="table">
  62933. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  62934. <dd><p>Use average samples values for each drawn sample.
  62935. </p>
  62936. </dd>
  62937. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  62938. <dd><p>Use peak samples values for each drawn sample.
  62939. </p></dd>
  62940. </dl>
  62941. <p>Default value is <code class="code">average</code>.
  62942. </p></dd>
  62943. </dl>
  62944. <a name="Examples-226"></a>
  62945. <h4 class="subsection">48.30.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-226" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-226" aria-hidden="true">TOC</a></span></h4>
  62946. <ul class="itemize mark-bullet">
  62947. <li>Extract a channel split representation of the wave form of a whole audio track
  62948. in a 1024x800 picture using <code class="command">ffmpeg</code>:
  62949. <div class="example">
  62950. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  62951. </pre></div>
  62952. </li></ul>
  62953. <a name="sidedata_002c-asidedata"></a>
  62954. <h3 class="section">48.31 sidedata, asidedata<span class="pull-right"><a class="anchor hidden-xs" href="#sidedata_002c-asidedata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidedata_002c-asidedata" aria-hidden="true">TOC</a></span></h3>
  62955. <p>Delete frame side data, or select frames based on it.
  62956. </p>
  62957. <p>This filter accepts the following options:
  62958. </p>
  62959. <dl class="table">
  62960. <dt><samp class="option">mode</samp></dt>
  62961. <dd><p>Set mode of operation of the filter.
  62962. </p>
  62963. <p>Can be one of the following:
  62964. </p>
  62965. <dl class="table">
  62966. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  62967. <dd><p>Select every frame with side data of <code class="code">type</code>.
  62968. </p>
  62969. </dd>
  62970. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  62971. <dd><p>Delete side data of <code class="code">type</code>. If <code class="code">type</code> is not set, delete all side
  62972. data in the frame.
  62973. </p>
  62974. </dd>
  62975. </dl>
  62976. </dd>
  62977. <dt><samp class="option">type</samp></dt>
  62978. <dd><p>Set side data type used with all modes. Must be set for <code class="code">select</code> mode.
  62979. </p>
  62980. <p>Possible values are:
  62981. </p>
  62982. <dl class="table">
  62983. <dt>&lsquo;<samp class="samp">PANSCAN</samp>&rsquo;</dt>
  62984. <dt>&lsquo;<samp class="samp">A53_CC</samp>&rsquo;</dt>
  62985. <dt>&lsquo;<samp class="samp">STEREO3D</samp>&rsquo;</dt>
  62986. <dt>&lsquo;<samp class="samp">MATRIXENCODING</samp>&rsquo;</dt>
  62987. <dt>&lsquo;<samp class="samp">DOWNMIX_INFO</samp>&rsquo;</dt>
  62988. <dt>&lsquo;<samp class="samp">REPLAYGAIN</samp>&rsquo;</dt>
  62989. <dt>&lsquo;<samp class="samp">DISPLAYMATRIX</samp>&rsquo;</dt>
  62990. <dt>&lsquo;<samp class="samp">AFD</samp>&rsquo;</dt>
  62991. <dt>&lsquo;<samp class="samp">MOTION_VECTORS</samp>&rsquo;</dt>
  62992. <dt>&lsquo;<samp class="samp">SKIP_SAMPLES</samp>&rsquo;</dt>
  62993. <dt>&lsquo;<samp class="samp">AUDIO_SERVICE_TYPE</samp>&rsquo;</dt>
  62994. <dt>&lsquo;<samp class="samp">MASTERING_DISPLAY_METADATA</samp>&rsquo;</dt>
  62995. <dt>&lsquo;<samp class="samp">GOP_TIMECODE</samp>&rsquo;</dt>
  62996. <dt>&lsquo;<samp class="samp">SPHERICAL</samp>&rsquo;</dt>
  62997. <dt>&lsquo;<samp class="samp">CONTENT_LIGHT_LEVEL</samp>&rsquo;</dt>
  62998. <dt>&lsquo;<samp class="samp">ICC_PROFILE</samp>&rsquo;</dt>
  62999. <dt>&lsquo;<samp class="samp">S12M_TIMECODE</samp>&rsquo;</dt>
  63000. <dt>&lsquo;<samp class="samp">DYNAMIC_HDR_PLUS</samp>&rsquo;</dt>
  63001. <dt>&lsquo;<samp class="samp">REGIONS_OF_INTEREST</samp>&rsquo;</dt>
  63002. <dt>&lsquo;<samp class="samp">VIDEO_ENC_PARAMS</samp>&rsquo;</dt>
  63003. <dt>&lsquo;<samp class="samp">SEI_UNREGISTERED</samp>&rsquo;</dt>
  63004. <dt>&lsquo;<samp class="samp">FILM_GRAIN_PARAMS</samp>&rsquo;</dt>
  63005. <dt>&lsquo;<samp class="samp">DETECTION_BOUNDING_BOXES</samp>&rsquo;</dt>
  63006. <dt>&lsquo;<samp class="samp">DETECTION_BBOXES</samp>&rsquo;</dt>
  63007. <dt>&lsquo;<samp class="samp">DOVI_RPU_BUFFER</samp>&rsquo;</dt>
  63008. <dt>&lsquo;<samp class="samp">DOVI_METADATA</samp>&rsquo;</dt>
  63009. <dt>&lsquo;<samp class="samp">DYNAMIC_HDR_VIVID</samp>&rsquo;</dt>
  63010. <dt>&lsquo;<samp class="samp">AMBIENT_VIEWING_ENVIRONMENT</samp>&rsquo;</dt>
  63011. <dt>&lsquo;<samp class="samp">VIDEO_HINT</samp>&rsquo;</dt>
  63012. </dl>
  63013. </dd>
  63014. </dl>
  63015. <a name="spectrumsynth"></a>
  63016. <h3 class="section">48.32 spectrumsynth<span class="pull-right"><a class="anchor hidden-xs" href="#spectrumsynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spectrumsynth" aria-hidden="true">TOC</a></span></h3>
  63017. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  63018. magnitude across time and second represents phase across time.
  63019. The filter will transform from frequency domain as displayed in videos back
  63020. to time domain as presented in audio output.
  63021. </p>
  63022. <p>This filter is primarily created for reversing processed <a class="ref" href="#showspectrum">showspectrum</a>
  63023. filter outputs, but can synthesize sound from other spectrograms too.
  63024. But in such case results are going to be poor if the phase data is not
  63025. available, because in such cases phase data need to be recreated, usually
  63026. it&rsquo;s just recreated from random noise.
  63027. For best results use gray only output (<code class="code">channel</code> color mode in
  63028. <a class="ref" href="#showspectrum">showspectrum</a> filter) and <code class="code">log</code> scale for magnitude video and
  63029. <code class="code">lin</code> scale for phase video. To produce phase, for 2nd video, use
  63030. <code class="code">data</code> option. Inputs videos should generally use <code class="code">fullframe</code>
  63031. slide mode as that saves resources needed for decoding video.
  63032. </p>
  63033. <p>The filter accepts the following options:
  63034. </p>
  63035. <dl class="table">
  63036. <dt><samp class="option">sample_rate</samp></dt>
  63037. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  63038. spectrum was generated may differ.
  63039. </p>
  63040. </dd>
  63041. <dt><samp class="option">channels</samp></dt>
  63042. <dd><p>Set number of channels represented in input video spectrums.
  63043. </p>
  63044. </dd>
  63045. <dt><samp class="option">scale</samp></dt>
  63046. <dd><p>Set scale which was used when generating magnitude input spectrum.
  63047. Can be <code class="code">lin</code> or <code class="code">log</code>. Default is <code class="code">log</code>.
  63048. </p>
  63049. </dd>
  63050. <dt><samp class="option">slide</samp></dt>
  63051. <dd><p>Set slide which was used when generating inputs spectrums.
  63052. Can be <code class="code">replace</code>, <code class="code">scroll</code>, <code class="code">fullframe</code> or <code class="code">rscroll</code>.
  63053. Default is <code class="code">fullframe</code>.
  63054. </p>
  63055. </dd>
  63056. <dt><samp class="option">win_func</samp></dt>
  63057. <dd><p>Set window function used for resynthesis.
  63058. </p>
  63059. </dd>
  63060. <dt><samp class="option">overlap</samp></dt>
  63061. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  63062. which means optimal overlap for selected window function will be picked.
  63063. </p>
  63064. </dd>
  63065. <dt><samp class="option">orientation</samp></dt>
  63066. <dd><p>Set orientation of input videos. Can be <code class="code">vertical</code> or <code class="code">horizontal</code>.
  63067. Default is <code class="code">vertical</code>.
  63068. </p></dd>
  63069. </dl>
  63070. <a name="Examples-227"></a>
  63071. <h4 class="subsection">48.32.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-227" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-227" aria-hidden="true">TOC</a></span></h4>
  63072. <ul class="itemize mark-bullet">
  63073. <li>First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  63074. then resynthesize videos back to audio with spectrumsynth:
  63075. <div class="example">
  63076. <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
  63077. 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
  63078. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  63079. </pre></div>
  63080. </li></ul>
  63081. <a name="split_002c-asplit"></a>
  63082. <h3 class="section">48.33 split, asplit<span class="pull-right"><a class="anchor hidden-xs" href="#split_002c-asplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-split_002c-asplit" aria-hidden="true">TOC</a></span></h3>
  63083. <p>Split input into several identical outputs.
  63084. </p>
  63085. <p><code class="code">asplit</code> works with audio input, <code class="code">split</code> with video.
  63086. </p>
  63087. <p>The filter accepts a single parameter which specifies the number of outputs. If
  63088. unspecified, it defaults to 2.
  63089. </p>
  63090. <a name="Examples-228"></a>
  63091. <h4 class="subsection">48.33.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-228" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-228" aria-hidden="true">TOC</a></span></h4>
  63092. <ul class="itemize mark-bullet">
  63093. <li>Create two separate outputs from the same input:
  63094. <div class="example">
  63095. <pre class="example-preformatted">[in] split [out0][out1]
  63096. </pre></div>
  63097. </li><li>To create 3 or more outputs, you need to specify the number of
  63098. outputs, like in:
  63099. <div class="example">
  63100. <pre class="example-preformatted">[in] asplit=3 [out0][out1][out2]
  63101. </pre></div>
  63102. </li><li>Create two separate outputs from the same input, one cropped and
  63103. one padded:
  63104. <div class="example">
  63105. <pre class="example-preformatted">[in] split [splitout1][splitout2];
  63106. [splitout1] crop=100:100:0:0 [cropout];
  63107. [splitout2] pad=200:200:100:100 [padout];
  63108. </pre></div>
  63109. </li><li>Create 5 copies of the input audio with <code class="command">ffmpeg</code>:
  63110. <div class="example">
  63111. <pre class="example-preformatted">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  63112. </pre></div>
  63113. </li></ul>
  63114. <a name="zmq_002c-azmq"></a>
  63115. <h3 class="section">48.34 zmq, azmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq_002c-azmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq_002c-azmq" aria-hidden="true">TOC</a></span></h3>
  63116. <p>Receive commands sent through a libzmq client, and forward them to
  63117. filters in the filtergraph.
  63118. </p>
  63119. <p><code class="code">zmq</code> and <code class="code">azmq</code> work as a pass-through filters. <code class="code">zmq</code>
  63120. must be inserted between two video filters, <code class="code">azmq</code> between two
  63121. audio filters. Both are capable to send messages to any filter type.
  63122. </p>
  63123. <p>To enable these filters you need to install the libzmq library and
  63124. headers and configure FFmpeg with <code class="code">--enable-libzmq</code>.
  63125. </p>
  63126. <p>For more information about libzmq see:
  63127. <a class="url" href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  63128. </p>
  63129. <p>The <code class="code">zmq</code> and <code class="code">azmq</code> filters work as a libzmq server, which
  63130. receives messages sent through a network interface defined by the
  63131. <samp class="option">bind_address</samp> (or the abbreviation &quot;<samp class="option">b</samp>&quot;) option.
  63132. Default value of this option is <samp class="file">tcp://localhost:5555</samp>. You may
  63133. want to alter this value to your needs, but do not forget to escape any
  63134. &rsquo;:&rsquo; signs (see <a class="ref" href="#filtergraph-escaping">filtergraph escaping</a>).
  63135. </p>
  63136. <p>The received message must be in the form:
  63137. </p><div class="example">
  63138. <pre class="example-preformatted"><var class="var">TARGET</var> <var class="var">COMMAND</var> [<var class="var">ARG</var>]
  63139. </pre></div>
  63140. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  63141. the filter class or a specific filter instance name. The default
  63142. filter instance name uses the pattern &lsquo;<samp class="samp">Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  63143. but you can override this by using the &lsquo;<samp class="samp">filter_name@id</samp>&rsquo; syntax
  63144. (see <a class="ref" href="#Filtergraph-syntax">Filtergraph syntax</a>).
  63145. </p>
  63146. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  63147. </p>
  63148. <p><var class="var">ARG</var> is optional and specifies the optional argument list for the
  63149. given <var class="var">COMMAND</var>.
  63150. </p>
  63151. <p>Upon reception, the message is processed and the corresponding command
  63152. is injected into the filtergraph. Depending on the result, the filter
  63153. will send a reply to the client, adopting the format:
  63154. </p><div class="example">
  63155. <pre class="example-preformatted"><var class="var">ERROR_CODE</var> <var class="var">ERROR_REASON</var>
  63156. <var class="var">MESSAGE</var>
  63157. </pre></div>
  63158. <p><var class="var">MESSAGE</var> is optional.
  63159. </p>
  63160. <a name="Examples-229"></a>
  63161. <h4 class="subsection">48.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-229" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-229" aria-hidden="true">TOC</a></span></h4>
  63162. <p>Look at <samp class="file">tools/zmqsend</samp> for an example of a zmq client which can
  63163. be used to send commands processed by these filters.
  63164. </p>
  63165. <p>Consider the following filtergraph generated by <code class="command">ffplay</code>.
  63166. In this example the last overlay filter has an instance name. All other
  63167. filters will have default instance names.
  63168. </p>
  63169. <div class="example">
  63170. <pre class="example-preformatted">ffplay -dumpgraph 1 -f lavfi &quot;
  63171. color=s=100x100:c=red [l];
  63172. color=s=100x100:c=blue [r];
  63173. nullsrc=s=200x100, zmq [bg];
  63174. [bg][l] overlay [bg+l];
  63175. [bg+l][r] overlay@my=x=100 &quot;
  63176. </pre></div>
  63177. <p>To change the color of the left side of the video, the following
  63178. command can be used:
  63179. </p><div class="example">
  63180. <pre class="example-preformatted">echo Parsed_color_0 c yellow | tools/zmqsend
  63181. </pre></div>
  63182. <p>To change the right side:
  63183. </p><div class="example">
  63184. <pre class="example-preformatted">echo Parsed_color_1 c pink | tools/zmqsend
  63185. </pre></div>
  63186. <p>To change the position of the right side:
  63187. </p><div class="example">
  63188. <pre class="example-preformatted">echo overlay@my x 150 | tools/zmqsend
  63189. </pre></div>
  63190. <a name="Multimedia-Sources"></a>
  63191. <h2 class="chapter">49 Multimedia Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Sources" aria-hidden="true">TOC</a></span></h2>
  63192. <p>Below is a description of the currently available multimedia sources.
  63193. </p>
  63194. <a name="amovie"></a>
  63195. <h3 class="section">49.1 amovie<span class="pull-right"><a class="anchor hidden-xs" href="#amovie" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amovie" aria-hidden="true">TOC</a></span></h3>
  63196. <p>This is the same as <a class="ref" href="#movie">movie</a> source, except it selects an audio
  63197. stream by default.
  63198. </p>
  63199. <a name="avsynctest"></a>
  63200. <h3 class="section">49.2 avsynctest<span class="pull-right"><a class="anchor hidden-xs" href="#avsynctest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avsynctest" aria-hidden="true">TOC</a></span></h3>
  63201. <p>Generate an Audio/Video Sync Test.
  63202. </p>
  63203. <p>Generated stream periodically shows flash video frame and emits beep in audio.
  63204. Useful to inspect A/V sync issues.
  63205. </p>
  63206. <p>It accepts the following options:
  63207. </p>
  63208. <dl class="table">
  63209. <dt><samp class="option">size, s</samp></dt>
  63210. <dd><p>Set output video size. Default value is <code class="code">hd720</code>.
  63211. </p>
  63212. </dd>
  63213. <dt><samp class="option">framerate, fr</samp></dt>
  63214. <dd><p>Set output video frame rate. Default value is <code class="code">30</code>.
  63215. </p>
  63216. </dd>
  63217. <dt><samp class="option">samplerate, sr</samp></dt>
  63218. <dd><p>Set output audio sample rate. Default value is <code class="code">44100</code>.
  63219. </p>
  63220. </dd>
  63221. <dt><samp class="option">amplitude, a</samp></dt>
  63222. <dd><p>Set output audio beep amplitude. Default value is <code class="code">0.7</code>.
  63223. </p>
  63224. </dd>
  63225. <dt><samp class="option">period, p</samp></dt>
  63226. <dd><p>Set output audio beep period in seconds. Default value is <code class="code">3</code>.
  63227. </p>
  63228. </dd>
  63229. <dt><samp class="option">delay, dl</samp></dt>
  63230. <dd><p>Set output video flash delay in number of frames. Default value is <code class="code">0</code>.
  63231. </p>
  63232. </dd>
  63233. <dt><samp class="option">cycle, c</samp></dt>
  63234. <dd><p>Enable cycling of video delays, by default is disabled.
  63235. </p>
  63236. </dd>
  63237. <dt><samp class="option">duration, d</samp></dt>
  63238. <dd><p>Set stream output duration. By default duration is unlimited.
  63239. </p>
  63240. </dd>
  63241. <dt><samp class="option">fg, bg, ag</samp></dt>
  63242. <dd><p>Set foreground/background/additional color.
  63243. </p></dd>
  63244. </dl>
  63245. <a name="Commands-164"></a>
  63246. <h4 class="subsection">49.2.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-164" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-164" aria-hidden="true">TOC</a></span></h4>
  63247. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  63248. </p>
  63249. <a class="anchor" id="movie"></a><a name="movie-1"></a>
  63250. <h3 class="section">49.3 movie<span class="pull-right"><a class="anchor hidden-xs" href="#movie-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-movie-1" aria-hidden="true">TOC</a></span></h3>
  63251. <p>Read audio and/or video stream(s) from a movie container.
  63252. </p>
  63253. <p>It accepts the following parameters:
  63254. </p>
  63255. <dl class="table">
  63256. <dt><samp class="option">filename</samp></dt>
  63257. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  63258. device or a stream accessed through some protocol).
  63259. </p>
  63260. </dd>
  63261. <dt><samp class="option">format_name, f</samp></dt>
  63262. <dd><p>Specifies the format assumed for the movie to read, and can be either
  63263. the name of a container or an input device. If not specified, the
  63264. format is guessed from <var class="var">movie_name</var> or by probing.
  63265. </p>
  63266. </dd>
  63267. <dt><samp class="option">seek_point, sp</samp></dt>
  63268. <dd><p>Specifies the seek point in seconds. The frames will be output
  63269. starting from this seek point. The parameter is evaluated with
  63270. <code class="code">av_strtod</code>, so the numerical value may be suffixed by an IS
  63271. postfix. The default value is &quot;0&quot;.
  63272. </p>
  63273. </dd>
  63274. <dt><samp class="option">streams, s</samp></dt>
  63275. <dd><p>Specifies the streams to read. Several streams can be specified,
  63276. separated by &quot;+&quot;. The source will then have as many outputs, in the
  63277. same order. The syntax is explained in the <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">&quot;Stream specifiers&quot;
  63278. section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  63279. respectively the default (best suited) video and audio stream. Default
  63280. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  63281. </p>
  63282. </dd>
  63283. <dt><samp class="option">stream_index, si</samp></dt>
  63284. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  63285. the most suitable video stream will be automatically selected. The default
  63286. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  63287. audio instead of video.
  63288. </p>
  63289. </dd>
  63290. <dt><samp class="option">loop</samp></dt>
  63291. <dd><p>Specifies how many times to read the stream in sequence.
  63292. If the value is 0, the stream will be looped infinitely.
  63293. Default value is &quot;1&quot;.
  63294. </p>
  63295. <p>Note that when the movie is looped the source timestamps are not
  63296. changed, so it will generate non monotonically increasing timestamps.
  63297. </p>
  63298. </dd>
  63299. <dt><samp class="option">discontinuity</samp></dt>
  63300. <dd><p>Specifies the time difference between frames above which the point is
  63301. considered a timestamp discontinuity which is removed by adjusting the later
  63302. timestamps.
  63303. </p>
  63304. </dd>
  63305. <dt><samp class="option">dec_threads</samp></dt>
  63306. <dd><p>Specifies the number of threads for decoding
  63307. </p>
  63308. </dd>
  63309. <dt><samp class="option">format_opts</samp></dt>
  63310. <dd><p>Specify format options for the opened file. Format options can be specified
  63311. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  63312. shows how to add protocol_whitelist and protocol_blacklist options:
  63313. </p><div class="example">
  63314. <pre class="example-preformatted">ffplay -f lavfi
  63315. &quot;movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'&quot;
  63316. </pre></div>
  63317. </dd>
  63318. </dl>
  63319. <p>It allows overlaying a second video on top of the main input of
  63320. a filtergraph, as shown in this graph:
  63321. </p><div class="example">
  63322. <pre class="example-preformatted">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  63323. ^
  63324. |
  63325. movie --&gt; scale--&gt; deltapts1 -------+
  63326. </pre></div>
  63327. <a name="Examples-230"></a>
  63328. <h4 class="subsection">49.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-230" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-230" aria-hidden="true">TOC</a></span></h4>
  63329. <ul class="itemize mark-bullet">
  63330. <li>Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  63331. on top of the input labelled &quot;in&quot;:
  63332. <div class="example">
  63333. <pre class="example-preformatted">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  63334. [in] setpts=PTS-STARTPTS [main];
  63335. [main][over] overlay=16:16 [out]
  63336. </pre></div>
  63337. </li><li>Read from a video4linux2 device, and overlay it on top of the input
  63338. labelled &quot;in&quot;:
  63339. <div class="example">
  63340. <pre class="example-preformatted">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  63341. [in] setpts=PTS-STARTPTS [main];
  63342. [main][over] overlay=16:16 [out]
  63343. </pre></div>
  63344. </li><li>Read the first video stream and the audio stream with id 0x81 from
  63345. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  63346. connected to the pad named &quot;audio&quot;:
  63347. <div class="example">
  63348. <pre class="example-preformatted">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  63349. </pre></div>
  63350. </li></ul>
  63351. <a name="Commands-165"></a>
  63352. <h4 class="subsection">49.3.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-165" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-165" aria-hidden="true">TOC</a></span></h4>
  63353. <p>Both movie and amovie support the following commands:
  63354. </p><dl class="table">
  63355. <dt><samp class="option">seek</samp></dt>
  63356. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  63357. The syntax is: seek <var class="var">stream_index</var>|<var class="var">timestamp</var>|<var class="var">flags</var>
  63358. </p><ul class="itemize mark-bullet">
  63359. <li><var class="var">stream_index</var>: If stream_index is -1, a default
  63360. stream is selected, and <var class="var">timestamp</var> is automatically converted
  63361. from AV_TIME_BASE units to the stream specific time_base.
  63362. </li><li><var class="var">timestamp</var>: Timestamp in AVStream.time_base units
  63363. or, if no stream is specified, in AV_TIME_BASE units.
  63364. </li><li><var class="var">flags</var>: Flags which select direction and seeking mode.
  63365. </li></ul>
  63366. </dd>
  63367. <dt><samp class="option">get_duration</samp></dt>
  63368. <dd><p>Get movie duration in AV_TIME_BASE units.
  63369. </p>
  63370. </dd>
  63371. </dl>
  63372. <a name="External-libraries"></a>
  63373. <h2 class="chapter">50 External libraries<span class="pull-right"><a class="anchor hidden-xs" href="#External-libraries" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-External-libraries" aria-hidden="true">TOC</a></span></h2>
  63374. <p>FFmpeg can be hooked up with a number of external libraries to add support
  63375. for more formats. None of them are used by default, their use has to be
  63376. explicitly requested by passing the appropriate flags to
  63377. <code class="command">./configure</code>.
  63378. </p>
  63379. <a name="Alliance-for-Open-Media-_0028AOM_0029"></a>
  63380. <h3 class="section">50.1 Alliance for Open Media (AOM)<span class="pull-right"><a class="anchor hidden-xs" href="#Alliance-for-Open-Media-_0028AOM_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Alliance-for-Open-Media-_0028AOM_0029" aria-hidden="true">TOC</a></span></h3>
  63381. <p>FFmpeg can make use of the AOM library for AV1 decoding and encoding.
  63382. </p>
  63383. <p>Go to <a class="url" href="http://aomedia.org/">http://aomedia.org/</a> and follow the instructions for
  63384. installing the library. Then pass <code class="code">--enable-libaom</code> to configure to
  63385. enable it.
  63386. </p>
  63387. <a name="AMD-AMF_002fVCE"></a>
  63388. <h3 class="section">50.2 AMD AMF/VCE<span class="pull-right"><a class="anchor hidden-xs" href="#AMD-AMF_002fVCE" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AMD-AMF_002fVCE" aria-hidden="true">TOC</a></span></h3>
  63389. <p>FFmpeg can use the AMD Advanced Media Framework library
  63390. for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE).
  63391. </p>
  63392. <p>To enable support you must obtain the AMF framework header files(version 1.4.9+) from
  63393. <a class="url" href="https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git">https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git</a>.
  63394. </p>
  63395. <p>Create an <code class="code">AMF/</code> directory in the system include path.
  63396. Copy the contents of <code class="code">AMF/amf/public/include/</code> into that directory.
  63397. Then configure FFmpeg with <code class="code">--enable-amf</code>.
  63398. </p>
  63399. <p>Initialization of amf encoder occurs in this order:
  63400. 1) trying to initialize through dx11(only windows)
  63401. 2) trying to initialize through dx9(only windows)
  63402. 3) trying to initialize through vulkan
  63403. </p>
  63404. <p>To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro
  63405. package(amdgru-pro contains, but does not install automatically) are required.
  63406. </p>
  63407. <p>This driver can be installed using amdgpu-pro-install script in official amd driver archive.
  63408. </p>
  63409. <a name="AviSynth"></a>
  63410. <h3 class="section">50.3 AviSynth<span class="pull-right"><a class="anchor hidden-xs" href="#AviSynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AviSynth" aria-hidden="true">TOC</a></span></h3>
  63411. <p>FFmpeg can read AviSynth scripts as input. To enable support, pass
  63412. <code class="code">--enable-avisynth</code> to configure after installing the headers
  63413. provided by <a class="url" href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>.
  63414. AviSynth+ can be configured to install only the headers by either
  63415. passing <code class="code">-DHEADERS_ONLY:bool=on</code> to the normal CMake-based build
  63416. system, or by using the supplied <code class="code">GNUmakefile</code>.
  63417. </p>
  63418. <p>For Windows, supported AviSynth variants are
  63419. <a class="url" href="http://avisynth.nl">AviSynth 2.6 RC1 or higher</a> for 32-bit builds and
  63420. <a class="url" href="http://avisynth.nl/index.php/AviSynth+">AviSynth+ r1718 or higher</a> for 32-bit and 64-bit builds.
  63421. </p>
  63422. <p>For Linux, macOS, and BSD, the only supported AviSynth variant is
  63423. <a class="url" href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>, starting with version 3.5.
  63424. </p>
  63425. <div class="info">
  63426. <p>In 2016, AviSynth+ added support for building with GCC. However, due to
  63427. the eccentricities of Windows&rsquo; calling conventions, 32-bit GCC builds
  63428. of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg.
  63429. </p>
  63430. <p>By default, FFmpeg assumes compatibility with 32-bit MSVC builds of
  63431. AviSynth+ since that is the most widely-used and entrenched build
  63432. configuration. Users can override this and enable support for 32-bit
  63433. GCC builds of AviSynth+ by passing <code class="code">-DAVSC_WIN32_GCC32</code> to
  63434. <code class="code">--extra-cflags</code> when configuring FFmpeg.
  63435. </p>
  63436. <p>64-bit builds of FFmpeg are not affected, and can use either MSVC or
  63437. GCC builds of AviSynth+ without any special flags.
  63438. </p></div>
  63439. <div class="info">
  63440. <p>AviSynth(+) is loaded dynamically. Distributors can build FFmpeg
  63441. with <code class="code">--enable-avisynth</code>, and the binaries will work regardless
  63442. of the end user having AviSynth installed. If/when an end user
  63443. would like to use AviSynth scripts, then they can install AviSynth(+)
  63444. and FFmpeg will be able to find and use it to open scripts.
  63445. </p></div>
  63446. <a name="Chromaprint"></a>
  63447. <h3 class="section">50.4 Chromaprint<span class="pull-right"><a class="anchor hidden-xs" href="#Chromaprint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Chromaprint" aria-hidden="true">TOC</a></span></h3>
  63448. <p>FFmpeg can make use of the Chromaprint library for generating audio fingerprints.
  63449. Pass <code class="code">--enable-chromaprint</code> to configure to
  63450. enable it. See <a class="url" href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>.
  63451. </p>
  63452. <a name="codec2-1"></a>
  63453. <h3 class="section">50.5 codec2<span class="pull-right"><a class="anchor hidden-xs" href="#codec2-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codec2-1" aria-hidden="true">TOC</a></span></h3>
  63454. <p>FFmpeg can make use of the codec2 library for codec2 decoding and encoding.
  63455. There is currently no native decoder, so libcodec2 must be used for decoding.
  63456. </p>
  63457. <p>Go to <a class="url" href="http://freedv.org/">http://freedv.org/</a>, download &quot;Codec 2 source archive&quot;.
  63458. Build and install using CMake. Debian users can install the libcodec2-dev package instead.
  63459. Once libcodec2 is installed you can pass <code class="code">--enable-libcodec2</code> to configure to enable it.
  63460. </p>
  63461. <p>The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding.
  63462. To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option:
  63463. <code class="code">ffmpeg -i input.wav -mode 700C output.c2</code>.
  63464. Playback is as simple as <code class="code">ffplay output.c2</code>.
  63465. For a list of supported modes, run <code class="code">ffmpeg -h encoder=libcodec2</code>.
  63466. Raw codec2 files are also supported.
  63467. To make sense of them the mode in use needs to be specified as a format option:
  63468. <code class="code">ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav</code>.
  63469. </p>
  63470. <a name="dav1d"></a>
  63471. <h3 class="section">50.6 dav1d<span class="pull-right"><a class="anchor hidden-xs" href="#dav1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dav1d" aria-hidden="true">TOC</a></span></h3>
  63472. <p>FFmpeg can make use of the dav1d library for AV1 video decoding.
  63473. </p>
  63474. <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
  63475. installing the library. Then pass <code class="code">--enable-libdav1d</code> to configure to enable it.
  63476. </p>
  63477. <a name="davs2"></a>
  63478. <h3 class="section">50.7 davs2<span class="pull-right"><a class="anchor hidden-xs" href="#davs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-davs2" aria-hidden="true">TOC</a></span></h3>
  63479. <p>FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding.
  63480. </p>
  63481. <p>Go to <a class="url" href="https://github.com/pkuvcl/davs2">https://github.com/pkuvcl/davs2</a> and follow the instructions for
  63482. installing the library. Then pass <code class="code">--enable-libdavs2</code> to configure to
  63483. enable it.
  63484. </p>
  63485. <div class="info">
  63486. <p>libdavs2 is under the GNU Public License Version 2 or later
  63487. (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
  63488. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  63489. </p></div>
  63490. <a name="uavs3d"></a>
  63491. <h3 class="section">50.8 uavs3d<span class="pull-right"><a class="anchor hidden-xs" href="#uavs3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-uavs3d" aria-hidden="true">TOC</a></span></h3>
  63492. <p>FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding.
  63493. </p>
  63494. <p>Go to <a class="url" href="https://github.com/uavs3/uavs3d">https://github.com/uavs3/uavs3d</a> and follow the instructions for
  63495. installing the library. Then pass <code class="code">--enable-libuavs3d</code> to configure to
  63496. enable it.
  63497. </p>
  63498. <a name="Game-Music-Emu"></a>
  63499. <h3 class="section">50.9 Game Music Emu<span class="pull-right"><a class="anchor hidden-xs" href="#Game-Music-Emu" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Game-Music-Emu" aria-hidden="true">TOC</a></span></h3>
  63500. <p>FFmpeg can make use of the Game Music Emu library to read audio from supported video game
  63501. music file formats. Pass <code class="code">--enable-libgme</code> to configure to
  63502. enable it. See <a class="url" href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a>.
  63503. </p>
  63504. <a name="Intel-QuickSync-Video"></a>
  63505. <h3 class="section">50.10 Intel QuickSync Video<span class="pull-right"><a class="anchor hidden-xs" href="#Intel-QuickSync-Video" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Intel-QuickSync-Video" aria-hidden="true">TOC</a></span></h3>
  63506. <p>FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding
  63507. of multiple codecs. To use QSV, FFmpeg must be linked against the <code class="code">libmfx</code>
  63508. dispatcher, which loads the actual decoding libraries.
  63509. </p>
  63510. <p>The dispatcher is open source and can be downloaded from
  63511. <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
  63512. with the <code class="code">--enable-libmfx</code> option and <code class="code">pkg-config</code> needs to be able to
  63513. locate the dispatcher&rsquo;s <code class="code">.pc</code> files.
  63514. </p>
  63515. <a name="Kvazaar"></a>
  63516. <h3 class="section">50.11 Kvazaar<span class="pull-right"><a class="anchor hidden-xs" href="#Kvazaar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Kvazaar" aria-hidden="true">TOC</a></span></h3>
  63517. <p>FFmpeg can make use of the Kvazaar library for HEVC encoding.
  63518. </p>
  63519. <p>Go to <a class="url" href="https://github.com/ultravideo/kvazaar">https://github.com/ultravideo/kvazaar</a> and follow the
  63520. instructions for installing the library. Then pass
  63521. <code class="code">--enable-libkvazaar</code> to configure to enable it.
  63522. </p>
  63523. <a name="LAME"></a>
  63524. <h3 class="section">50.12 LAME<span class="pull-right"><a class="anchor hidden-xs" href="#LAME" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-LAME" aria-hidden="true">TOC</a></span></h3>
  63525. <p>FFmpeg can make use of the LAME library for MP3 encoding.
  63526. </p>
  63527. <p>Go to <a class="url" href="http://lame.sourceforge.net/">http://lame.sourceforge.net/</a> and follow the
  63528. instructions for installing the library.
  63529. Then pass <code class="code">--enable-libmp3lame</code> to configure to enable it.
  63530. </p>
  63531. <a name="LCEVCdec"></a>
  63532. <h3 class="section">50.13 LCEVCdec<span class="pull-right"><a class="anchor hidden-xs" href="#LCEVCdec" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-LCEVCdec" aria-hidden="true">TOC</a></span></h3>
  63533. <p>FFmpeg can make use of the liblcevc_dec library for LCEVC enhancement layer
  63534. decoding on supported bitstreams.
  63535. </p>
  63536. <p>Go to <a class="url" href="https://github.com/v-novaltd/LCEVCdec">https://github.com/v-novaltd/LCEVCdec</a> and follow the instructions
  63537. for installing the library. Then pass <code class="code">--enable-liblcevc-dec</code> to configure to
  63538. enable it.
  63539. </p>
  63540. <div class="info">
  63541. <p>LCEVCdec is under the BSD-3-Clause-Clear License.
  63542. </p></div>
  63543. <a name="libilbc-1"></a>
  63544. <h3 class="section">50.14 libilbc<span class="pull-right"><a class="anchor hidden-xs" href="#libilbc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libilbc-1" aria-hidden="true">TOC</a></span></h3>
  63545. <p>iLBC is a narrowband speech codec that has been made freely available
  63546. by Google as part of the WebRTC project. libilbc is a packaging friendly
  63547. copy of the iLBC codec. FFmpeg can make use of the libilbc library for
  63548. iLBC decoding and encoding.
  63549. </p>
  63550. <p>Go to <a class="url" href="https://github.com/TimothyGu/libilbc">https://github.com/TimothyGu/libilbc</a> and follow the instructions for
  63551. installing the library. Then pass <code class="code">--enable-libilbc</code> to configure to
  63552. enable it.
  63553. </p>
  63554. <a name="libjxl-1"></a>
  63555. <h3 class="section">50.15 libjxl<span class="pull-right"><a class="anchor hidden-xs" href="#libjxl-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libjxl-1" aria-hidden="true">TOC</a></span></h3>
  63556. <p>JPEG XL is an image format intended to fully replace legacy JPEG for an extended
  63557. period of life. See <a class="url" href="https://jpegxl.info/">https://jpegxl.info/</a> for more information, and see
  63558. <a class="url" href="https://github.com/libjxl/libjxl">https://github.com/libjxl/libjxl</a> for the library source. You can pass
  63559. <code class="code">--enable-libjxl</code> to configure in order enable the libjxl wrapper.
  63560. </p>
  63561. <a name="libvpx-1"></a>
  63562. <h3 class="section">50.16 libvpx<span class="pull-right"><a class="anchor hidden-xs" href="#libvpx-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvpx-1" aria-hidden="true">TOC</a></span></h3>
  63563. <p>FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding.
  63564. </p>
  63565. <p>Go to <a class="url" href="http://www.webmproject.org/">http://www.webmproject.org/</a> and follow the instructions for
  63566. installing the library. Then pass <code class="code">--enable-libvpx</code> to configure to
  63567. enable it.
  63568. </p>
  63569. <a name="ModPlug"></a>
  63570. <h3 class="section">50.17 ModPlug<span class="pull-right"><a class="anchor hidden-xs" href="#ModPlug" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ModPlug" aria-hidden="true">TOC</a></span></h3>
  63571. <p>FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files.
  63572. 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
  63573. enable it.
  63574. </p>
  63575. <a name="OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries"></a>
  63576. <h3 class="section">50.18 OpenCORE, VisualOn, and Fraunhofer libraries<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" aria-hidden="true">TOC</a></span></h3>
  63577. <p>Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer
  63578. libraries provide encoders for a number of audio codecs.
  63579. </p>
  63580. <div class="info">
  63581. <p>OpenCORE and VisualOn libraries are under the Apache License 2.0
  63582. (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
  63583. incompatible to the LGPL version 2.1 and GPL version 2. You have to
  63584. upgrade FFmpeg&rsquo;s license to LGPL version 3 (or if you have enabled
  63585. GPL components, GPL version 3) by passing <code class="code">--enable-version3</code> to configure in
  63586. order to use it.
  63587. </p>
  63588. <p>The license of the Fraunhofer AAC library is incompatible with the GPL.
  63589. Therefore, for GPL builds, you have to pass <code class="code">--enable-nonfree</code> to
  63590. configure in order to use it. To the best of our knowledge, it is
  63591. compatible with the LGPL.
  63592. </p></div>
  63593. <a name="OpenCORE-AMR"></a>
  63594. <h4 class="subsection">50.18.1 OpenCORE AMR<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCORE-AMR" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCORE-AMR" aria-hidden="true">TOC</a></span></h4>
  63595. <p>FFmpeg can make use of the OpenCORE libraries for AMR-NB
  63596. decoding/encoding and AMR-WB decoding.
  63597. </p>
  63598. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  63599. instructions for installing the libraries.
  63600. Then pass <code class="code">--enable-libopencore-amrnb</code> and/or
  63601. <code class="code">--enable-libopencore-amrwb</code> to configure to enable them.
  63602. </p>
  63603. <a name="VisualOn-AMR_002dWB-encoder-library"></a>
  63604. <h4 class="subsection">50.18.2 VisualOn AMR-WB encoder library<span class="pull-right"><a class="anchor hidden-xs" href="#VisualOn-AMR_002dWB-encoder-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VisualOn-AMR_002dWB-encoder-library" aria-hidden="true">TOC</a></span></h4>
  63605. <p>FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
  63606. </p>
  63607. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  63608. instructions for installing the library.
  63609. Then pass <code class="code">--enable-libvo-amrwbenc</code> to configure to enable it.
  63610. </p>
  63611. <a name="Fraunhofer-AAC-library"></a>
  63612. <h4 class="subsection">50.18.3 Fraunhofer AAC library<span class="pull-right"><a class="anchor hidden-xs" href="#Fraunhofer-AAC-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Fraunhofer-AAC-library" aria-hidden="true">TOC</a></span></h4>
  63613. <p>FFmpeg can make use of the Fraunhofer AAC library for AAC decoding &amp; encoding.
  63614. </p>
  63615. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  63616. instructions for installing the library.
  63617. Then pass <code class="code">--enable-libfdk-aac</code> to configure to enable it.
  63618. </p>
  63619. <a name="Fraunhofer-MPEG_002dH-3D-Audio-decoder-library"></a>
  63620. <h4 class="subsection">50.18.4 Fraunhofer MPEG-H 3D Audio decoder library<span class="pull-right"><a class="anchor hidden-xs" href="#Fraunhofer-MPEG_002dH-3D-Audio-decoder-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Fraunhofer-MPEG_002dH-3D-Audio-decoder-library" aria-hidden="true">TOC</a></span></h4>
  63621. <p>FFmpeg can make use of the Fraunhofer MPEG-H decoder library for MPEG-H 3DA decoding.
  63622. </p>
  63623. <p>Go to <a class="url" href="https://github.com/Fraunhofer-IIS/mpeghdec">https://github.com/Fraunhofer-IIS/mpeghdec</a> and follow the
  63624. instructions for installing the library.
  63625. Then pass <code class="code">--enable-libmpeghdec --enable-nonfree</code> to configure to enable it.
  63626. </p>
  63627. <a name="LC3-library"></a>
  63628. <h4 class="subsection">50.18.5 LC3 library<span class="pull-right"><a class="anchor hidden-xs" href="#LC3-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-LC3-library" aria-hidden="true">TOC</a></span></h4>
  63629. <p>FFmpeg can make use of the Google LC3 library for LC3 decoding &amp; encoding.
  63630. </p>
  63631. <p>Go to <a class="url" href="https://github.com/google/liblc3/">https://github.com/google/liblc3/</a> and follow the instructions for
  63632. installing the library.
  63633. Then pass <code class="code">--enable-liblc3</code> to configure to enable it.
  63634. </p>
  63635. <a name="OpenH264"></a>
  63636. <h3 class="section">50.19 OpenH264<span class="pull-right"><a class="anchor hidden-xs" href="#OpenH264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenH264" aria-hidden="true">TOC</a></span></h3>
  63637. <p>FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding.
  63638. </p>
  63639. <p>Go to <a class="url" href="http://www.openh264.org/">http://www.openh264.org/</a> and follow the instructions for
  63640. installing the library. Then pass <code class="code">--enable-libopenh264</code> to configure to
  63641. enable it.
  63642. </p>
  63643. <p>For decoding, this library is much more limited than the built-in decoder
  63644. in libavcodec; currently, this library lacks support for decoding B-frames
  63645. and some other main/high profile features. (It currently only supports
  63646. constrained baseline profile and CABAC.) Using it is mostly useful for
  63647. testing and for taking advantage of Cisco&rsquo;s patent portfolio license
  63648. (<a class="url" href="http://www.openh264.org/BINARY_LICENSE.txt">http://www.openh264.org/BINARY_LICENSE.txt</a>).
  63649. </p>
  63650. <a name="OpenJPEG"></a>
  63651. <h3 class="section">50.20 OpenJPEG<span class="pull-right"><a class="anchor hidden-xs" href="#OpenJPEG" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenJPEG" aria-hidden="true">TOC</a></span></h3>
  63652. <p>FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to
  63653. <a class="url" href="http://www.openjpeg.org/">http://www.openjpeg.org/</a> to get the libraries and follow the installation
  63654. instructions. To enable using OpenJPEG in FFmpeg, pass <code class="code">--enable-libopenjpeg</code> to
  63655. <samp class="file">./configure</samp>.
  63656. </p>
  63657. <a name="rav1e"></a>
  63658. <h3 class="section">50.21 rav1e<span class="pull-right"><a class="anchor hidden-xs" href="#rav1e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rav1e" aria-hidden="true">TOC</a></span></h3>
  63659. <p>FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos.
  63660. Go to <a class="url" href="https://github.com/xiph/rav1e/">https://github.com/xiph/rav1e/</a> and follow the instructions to build
  63661. the C library. To enable using rav1e in FFmpeg, pass <code class="code">--enable-librav1e</code>
  63662. to <samp class="file">./configure</samp>.
  63663. </p>
  63664. <a name="SVT_002dAV1"></a>
  63665. <h3 class="section">50.22 SVT-AV1<span class="pull-right"><a class="anchor hidden-xs" href="#SVT_002dAV1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-SVT_002dAV1" aria-hidden="true">TOC</a></span></h3>
  63666. <p>FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding.
  63667. </p>
  63668. <p>Go to <a class="url" href="https://gitlab.com/AOMediaCodec/SVT-AV1/">https://gitlab.com/AOMediaCodec/SVT-AV1/</a> and follow the instructions
  63669. for installing the library. Then pass <code class="code">--enable-libsvtav1</code> to configure to
  63670. enable it.
  63671. </p>
  63672. <a name="SVT_002dJPEG_002dXS"></a>
  63673. <h3 class="section">50.23 SVT-JPEG-XS<span class="pull-right"><a class="anchor hidden-xs" href="#SVT_002dJPEG_002dXS" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-SVT_002dJPEG_002dXS" aria-hidden="true">TOC</a></span></h3>
  63674. <p>FFmpeg can make use of the Scalable Video Technology for JPEG-XS library for JPEG-XS
  63675. decoding and encoding.
  63676. </p>
  63677. <p>Go to <a class="url" href="https://github.com/OpenVisualCloud/SVT-JPEG-XS">https://github.com/OpenVisualCloud/SVT-JPEG-XS</a> and follow the instructions
  63678. for installing the library. Then pass <code class="code">--enable-libsvtjpegxs</code> to configure to
  63679. enable it.
  63680. </p>
  63681. <a name="TwoLAME"></a>
  63682. <h3 class="section">50.24 TwoLAME<span class="pull-right"><a class="anchor hidden-xs" href="#TwoLAME" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-TwoLAME" aria-hidden="true">TOC</a></span></h3>
  63683. <p>FFmpeg can make use of the TwoLAME library for MP2 encoding.
  63684. </p>
  63685. <p>Go to <a class="url" href="http://www.twolame.org/">http://www.twolame.org/</a> and follow the
  63686. instructions for installing the library.
  63687. Then pass <code class="code">--enable-libtwolame</code> to configure to enable it.
  63688. </p>
  63689. <a name="VapourSynth"></a>
  63690. <h3 class="section">50.25 VapourSynth<span class="pull-right"><a class="anchor hidden-xs" href="#VapourSynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VapourSynth" aria-hidden="true">TOC</a></span></h3>
  63691. <p>FFmpeg can read VapourSynth scripts as input. To enable support, pass
  63692. <code class="code">--enable-vapoursynth</code> to configure. Vapoursynth is detected via
  63693. <code class="code">pkg-config</code>. Versions 42 or greater supported.
  63694. See <a class="url" href="http://www.vapoursynth.com/">http://www.vapoursynth.com/</a>.
  63695. </p>
  63696. <p>Due to security concerns, Vapoursynth scripts will not
  63697. be autodetected so the input format has to be forced. For ff* CLI tools,
  63698. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  63699. </p>
  63700. <a name="x264"></a>
  63701. <h3 class="section">50.26 x264<span class="pull-right"><a class="anchor hidden-xs" href="#x264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x264" aria-hidden="true">TOC</a></span></h3>
  63702. <p>FFmpeg can make use of the x264 library for H.264 encoding.
  63703. </p>
  63704. <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
  63705. instructions for installing the library. Then pass <code class="code">--enable-libx264</code> to
  63706. configure to enable it.
  63707. </p>
  63708. <div class="info">
  63709. <p>x264 is under the GNU Public License Version 2 or later
  63710. (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
  63711. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  63712. </p></div>
  63713. <a name="x265"></a>
  63714. <h3 class="section">50.27 x265<span class="pull-right"><a class="anchor hidden-xs" href="#x265" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x265" aria-hidden="true">TOC</a></span></h3>
  63715. <p>FFmpeg can make use of the x265 library for HEVC encoding.
  63716. </p>
  63717. <p>Go to <a class="url" href="http://x265.org/developers.html">http://x265.org/developers.html</a> and follow the instructions
  63718. for installing the library. Then pass <code class="code">--enable-libx265</code> to configure
  63719. to enable it.
  63720. </p>
  63721. <div class="info">
  63722. <p>x265 is under the GNU Public License Version 2 or later
  63723. (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
  63724. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  63725. </p></div>
  63726. <a name="xavs"></a>
  63727. <h3 class="section">50.28 xavs<span class="pull-right"><a class="anchor hidden-xs" href="#xavs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xavs" aria-hidden="true">TOC</a></span></h3>
  63728. <p>FFmpeg can make use of the xavs library for AVS encoding.
  63729. </p>
  63730. <p>Go to <a class="url" href="http://xavs.sf.net/">http://xavs.sf.net/</a> and follow the instructions for
  63731. installing the library. Then pass <code class="code">--enable-libxavs</code> to configure to
  63732. enable it.
  63733. </p>
  63734. <a name="xavs2"></a>
  63735. <h3 class="section">50.29 xavs2<span class="pull-right"><a class="anchor hidden-xs" href="#xavs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xavs2" aria-hidden="true">TOC</a></span></h3>
  63736. <p>FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding.
  63737. </p>
  63738. <p>Go to <a class="url" href="https://github.com/pkuvcl/xavs2">https://github.com/pkuvcl/xavs2</a> and follow the instructions for
  63739. installing the library. Then pass <code class="code">--enable-libxavs2</code> to configure to
  63740. enable it.
  63741. </p>
  63742. <div class="info">
  63743. <p>libxavs2 is under the GNU Public License Version 2 or later
  63744. (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
  63745. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  63746. </p></div>
  63747. <a name="eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029"></a>
  63748. <h3 class="section">50.30 eXtra-fast Essential Video Encoder (XEVE)<span class="pull-right"><a class="anchor hidden-xs" href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029" aria-hidden="true">TOC</a></span></h3>
  63749. <p>FFmpeg can make use of the XEVE library for EVC video encoding.
  63750. </p>
  63751. <p>Go to <a class="url" href="https://github.com/mpeg5/xeve">https://github.com/mpeg5/xeve</a> and follow the instructions for
  63752. installing the XEVE library. Then pass <code class="code">--enable-libxeve</code> to configure to
  63753. enable it.
  63754. </p>
  63755. <a name="eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029"></a>
  63756. <h3 class="section">50.31 eXtra-fast Essential Video Decoder (XEVD)<span class="pull-right"><a class="anchor hidden-xs" href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029" aria-hidden="true">TOC</a></span></h3>
  63757. <p>FFmpeg can make use of the XEVD library for EVC video decoding.
  63758. </p>
  63759. <p>Go to <a class="url" href="https://github.com/mpeg5/xevd">https://github.com/mpeg5/xevd</a> and follow the instructions for
  63760. installing the XEVD library. Then pass <code class="code">--enable-libxevd</code> to configure to
  63761. enable it.
  63762. </p>
  63763. <a name="ZVBI"></a>
  63764. <h3 class="section">50.32 ZVBI<span class="pull-right"><a class="anchor hidden-xs" href="#ZVBI" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ZVBI" aria-hidden="true">TOC</a></span></h3>
  63765. <p>ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB
  63766. teletext pages and DVB teletext subtitles.
  63767. </p>
  63768. <p>Go to <a class="url" href="http://sourceforge.net/projects/zapping/">http://sourceforge.net/projects/zapping/</a> and follow the instructions for
  63769. installing the library. Then pass <code class="code">--enable-libzvbi</code> to configure to
  63770. enable it.
  63771. </p>
  63772. <a name="Supported-File-Formats_002c-Codecs-or-Features"></a>
  63773. <h2 class="chapter">51 Supported File Formats, Codecs or Features<span class="pull-right"><a class="anchor hidden-xs" href="#Supported-File-Formats_002c-Codecs-or-Features" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Supported-File-Formats_002c-Codecs-or-Features" aria-hidden="true">TOC</a></span></h2>
  63774. <p>You can use the <code class="code">-formats</code> and <code class="code">-codecs</code> options to have an exhaustive list.
  63775. </p>
  63776. <a name="File-Formats"></a>
  63777. <h3 class="section">51.1 File Formats<span class="pull-right"><a class="anchor hidden-xs" href="#File-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-File-Formats" aria-hidden="true">TOC</a></span></h3>
  63778. <p>FFmpeg supports the following file formats through the <code class="code">libavformat</code>
  63779. library:
  63780. </p>
  63781. <table class="multitable">
  63782. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  63783. <tr><td width="40%">3dostr</td><td width="10%"></td><td width="10%">X</td></tr>
  63784. <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>
  63785. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  63786. <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>
  63787. <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>
  63788. <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>
  63789. <tr><td width="40%">Adobe Filmstrip</td><td width="10%">X</td><td width="10%">X</td></tr>
  63790. <tr><td width="40%">Audio IFF (AIFF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  63791. <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>
  63792. <tr><td width="40%">3GPP AMR</td><td width="10%">X</td><td width="10%">X</td></tr>
  63793. <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>
  63794. <tr><td width="40%">Apple HTTP Live Streaming</td><td width="10%"></td><td width="10%">X</td></tr>
  63795. <tr><td width="40%">Artworx Data Format</td><td width="10%"></td><td width="10%">X</td></tr>
  63796. <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>
  63797. <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>
  63798. <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>
  63799. <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>
  63800. <tr><td width="40%">APNG</td><td width="10%">X</td><td width="10%">X</td></tr>
  63801. <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>
  63802. <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>
  63803. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  63804. <tr><td width="40%">AviSynth</td><td width="10%"></td><td width="10%">X</td></tr>
  63805. <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>
  63806. <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>
  63807. <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>
  63808. <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>
  63809. <tr><td width="40%">Binary text</td><td width="10%"></td><td width="10%">X</td></tr>
  63810. <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>
  63811. <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>
  63812. <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>
  63813. <tr><td width="40%">BRP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Argonaut Games format.</td></tr>
  63814. <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>
  63815. <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>
  63816. <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>
  63817. <tr><td width="40%">BW64</td><td width="10%"></td><td width="10%">X</td><td width="40%">Broadcast Wave 64bit.</td></tr>
  63818. <tr><td width="40%">BWF</td><td width="10%">X</td><td width="10%">X</td></tr>
  63819. <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>
  63820. <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>
  63821. <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>
  63822. <tr><td width="40%">CRI AIX</td><td width="10%"></td><td width="10%">X</td></tr>
  63823. <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>
  63824. <tr><td width="40%">Discworld II BMV</td><td width="10%"></td><td width="10%">X</td></tr>
  63825. <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>
  63826. <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>
  63827. <tr><td width="40%">Digital Speech Standard (DSS)</td><td width="10%"></td><td width="10%">X</td></tr>
  63828. <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>
  63829. <tr><td width="40%">Phantom Cine</td><td width="10%"></td><td width="10%">X</td></tr>
  63830. <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>
  63831. <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>
  63832. <tr><td width="40%">CRC testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  63833. <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>
  63834. <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>
  63835. <tr><td width="40%">D-Cinema audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  63836. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  63837. <tr><td width="40%">DCSTR</td><td width="10%"></td><td width="10%">X</td></tr>
  63838. <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>
  63839. <tr><td width="40%">DirectDraw Surface</td><td width="10%"></td><td width="10%">X</td></tr>
  63840. <tr><td width="40%">DSD Stream File (DSF)</td><td width="10%"></td><td width="10%">X</td></tr>
  63841. <tr><td width="40%">DV video</td><td width="10%">X</td><td width="10%">X</td></tr>
  63842. <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
  63843. game and different game cutscenes repacked for use with ScummVM.</td></tr>
  63844. <tr><td width="40%">Electronic Arts cdata</td><td width="10%"></td><td width="10%">X</td></tr>
  63845. <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>
  63846. <tr><td width="40%">Ensoniq Paris Audio File</td><td width="10%"></td><td width="10%">X</td></tr>
  63847. <tr><td width="40%">FFM (FFserver live feed)</td><td width="10%">X</td><td width="10%">X</td></tr>
  63848. <tr><td width="40%">Flash (SWF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  63849. <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>
  63850. <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>
  63851. <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>
  63852. <tr><td width="40%">framecrc testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  63853. <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>
  63854. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  63855. <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>
  63856. <tr><td width="40%">G.729 BIT</td><td width="10%">X</td><td width="10%">X</td></tr>
  63857. <tr><td width="40%">G.729 raw</td><td width="10%"></td><td width="10%">X</td></tr>
  63858. <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>
  63859. <tr><td width="40%">GIF Animation</td><td width="10%">X</td><td width="10%">X</td></tr>
  63860. <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
  63861. playout servers.</td></tr>
  63862. <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>
  63863. <tr><td width="40%">iCEDraw File</td><td width="10%"></td><td width="10%">X</td></tr>
  63864. <tr><td width="40%">ICO</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft Windows ICO</td></tr>
  63865. <tr><td width="40%">id Quake II CIN video</td><td width="10%"></td><td width="10%">X</td></tr>
  63866. <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>
  63867. <tr><td width="40%">IEC61937 encapsulation</td><td width="10%">X</td><td width="10%">X</td></tr>
  63868. <tr><td width="40%">IFF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Interchange File Format</td></tr>
  63869. <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>
  63870. <tr><td width="40%">iLBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  63871. <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>
  63872. <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>
  63873. <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>
  63874. <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>
  63875. <tr><td width="40%">Internet Video Recording</td><td width="10%"></td><td width="10%">X</td></tr>
  63876. <tr><td width="40%">IRCAM</td><td width="10%">X</td><td width="10%">X</td></tr>
  63877. <tr><td width="40%">LAF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Limitless Audio Format</td></tr>
  63878. <tr><td width="40%">LATM</td><td width="10%">X</td><td width="10%">X</td></tr>
  63879. <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>
  63880. <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>
  63881. <tr><td width="40%">LRC</td><td width="10%">X</td><td width="10%">X</td></tr>
  63882. <tr><td width="40%">LVF</td><td width="10%"></td><td width="10%">X</td></tr>
  63883. <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>
  63884. <tr><td width="40%">Magic Lantern Video (MLV)</td><td width="10%"></td><td width="10%">X</td></tr>
  63885. <tr><td width="40%">Matroska</td><td width="10%">X</td><td width="10%">X</td></tr>
  63886. <tr><td width="40%">Matroska audio</td><td width="10%">X</td><td width="10%"></td></tr>
  63887. <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>
  63888. <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>
  63889. <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>
  63890. <tr><td width="40%">MD Studio</td><td width="10%"></td><td width="10%">X</td></tr>
  63891. <tr><td width="40%">Metal Gear Solid: The Twin Snakes</td><td width="10%"></td><td width="10%">X</td></tr>
  63892. <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>
  63893. <tr><td width="40%">MobiClip MODS</td><td width="10%"></td><td width="10%">X</td></tr>
  63894. <tr><td width="40%">MobiClip MOFLEX</td><td width="10%"></td><td width="10%">X</td></tr>
  63895. <tr><td width="40%">Mobotix .mxg</td><td width="10%"></td><td width="10%">X</td></tr>
  63896. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  63897. <tr><td width="40%">Motion Pixels MVI</td><td width="10%"></td><td width="10%">X</td></tr>
  63898. <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>
  63899. <tr><td width="40%">MP2</td><td width="10%">X</td><td width="10%">X</td></tr>
  63900. <tr><td width="40%">MP3</td><td width="10%">X</td><td width="10%">X</td></tr>
  63901. <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>
  63902. <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>
  63903. <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>
  63904. <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>
  63905. <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>
  63906. <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>
  63907. <tr><td width="40%">MIDI Sample Dump Standard</td><td width="10%"></td><td width="10%">X</td></tr>
  63908. <tr><td width="40%">MIME multipart JPEG</td><td width="10%">X</td><td width="10%"></td></tr>
  63909. <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>
  63910. <tr><td width="40%">MTV</td><td width="10%"></td><td width="10%">X</td></tr>
  63911. <tr><td width="40%">Musepack</td><td width="10%"></td><td width="10%">X</td></tr>
  63912. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  63913. <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>
  63914. <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>
  63915. <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>
  63916. <tr><td width="40%">NIST SPeech HEader REsources</td><td width="10%"></td><td width="10%">X</td></tr>
  63917. <tr><td width="40%">Computerized Speech Lab NSP</td><td width="10%"></td><td width="10%">X</td></tr>
  63918. <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>
  63919. <tr><td width="40%">Nullsoft Streaming Video</td><td width="10%"></td><td width="10%">X</td></tr>
  63920. <tr><td width="40%">NuppelVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  63921. <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>
  63922. <tr><td width="40%">Ogg</td><td width="10%">X</td><td width="10%">X</td></tr>
  63923. <tr><td width="40%">Playstation Portable PMP</td><td width="10%"></td><td width="10%">X</td></tr>
  63924. <tr><td width="40%">Portable Voice Format</td><td width="10%"></td><td width="10%">X</td></tr>
  63925. <tr><td width="40%">RK Audio (RKA)</td><td width="10%"></td><td width="10%">X</td></tr>
  63926. <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>
  63927. <tr><td width="40%">QCP</td><td width="10%"></td><td width="10%">X</td></tr>
  63928. <tr><td width="40%">raw ADTS (AAC)</td><td width="10%">X</td><td width="10%">X</td></tr>
  63929. <tr><td width="40%">raw AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  63930. <tr><td width="40%">raw AMR-NB</td><td width="10%"></td><td width="10%">X</td></tr>
  63931. <tr><td width="40%">raw AMR-WB</td><td width="10%"></td><td width="10%">X</td></tr>
  63932. <tr><td width="40%">raw APAC</td><td width="10%"></td><td width="10%">X</td></tr>
  63933. <tr><td width="40%">raw APV</td><td width="10%">X</td><td width="10%">X</td></tr>
  63934. <tr><td width="40%">raw aptX</td><td width="10%">X</td><td width="10%">X</td></tr>
  63935. <tr><td width="40%">raw aptX HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  63936. <tr><td width="40%">raw Bonk</td><td width="10%"></td><td width="10%">X</td></tr>
  63937. <tr><td width="40%">raw Chinese AVS video</td><td width="10%">X</td><td width="10%">X</td></tr>
  63938. <tr><td width="40%">raw DFPWM</td><td width="10%">X</td><td width="10%">X</td></tr>
  63939. <tr><td width="40%">raw Dirac</td><td width="10%">X</td><td width="10%">X</td></tr>
  63940. <tr><td width="40%">raw DNxHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  63941. <tr><td width="40%">raw DTS</td><td width="10%">X</td><td width="10%">X</td></tr>
  63942. <tr><td width="40%">raw DTS-HD</td><td width="10%"></td><td width="10%">X</td></tr>
  63943. <tr><td width="40%">raw E-AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  63944. <tr><td width="40%">raw EVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  63945. <tr><td width="40%">raw FLAC</td><td width="10%">X</td><td width="10%">X</td></tr>
  63946. <tr><td width="40%">raw G.728</td><td width="10%"></td><td width="10%">X</td></tr>
  63947. <tr><td width="40%">raw GSM</td><td width="10%"></td><td width="10%">X</td></tr>
  63948. <tr><td width="40%">raw H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  63949. <tr><td width="40%">raw H.263</td><td width="10%">X</td><td width="10%">X</td></tr>
  63950. <tr><td width="40%">raw H.264</td><td width="10%">X</td><td width="10%">X</td></tr>
  63951. <tr><td width="40%">raw HEVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  63952. <tr><td width="40%">raw Ingenient MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  63953. <tr><td width="40%">raw MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  63954. <tr><td width="40%">raw MLP</td><td width="10%"></td><td width="10%">X</td></tr>
  63955. <tr><td width="40%">raw MPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  63956. <tr><td width="40%">raw MPEG-1</td><td width="10%"></td><td width="10%">X</td></tr>
  63957. <tr><td width="40%">raw MPEG-2</td><td width="10%"></td><td width="10%">X</td></tr>
  63958. <tr><td width="40%">raw MPEG-4</td><td width="10%">X</td><td width="10%">X</td></tr>
  63959. <tr><td width="40%">raw NULL</td><td width="10%">X</td><td width="10%"></td></tr>
  63960. <tr><td width="40%">raw video</td><td width="10%">X</td><td width="10%">X</td></tr>
  63961. <tr><td width="40%">raw id RoQ</td><td width="10%">X</td><td width="10%"></td></tr>
  63962. <tr><td width="40%">raw OBU</td><td width="10%">X</td><td width="10%">X</td></tr>
  63963. <tr><td width="40%">raw OSQ</td><td width="10%"></td><td width="10%">X</td></tr>
  63964. <tr><td width="40%">raw SBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  63965. <tr><td width="40%">raw Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  63966. <tr><td width="40%">raw TAK</td><td width="10%"></td><td width="10%">X</td></tr>
  63967. <tr><td width="40%">raw TrueHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  63968. <tr><td width="40%">raw VC-1</td><td width="10%">X</td><td width="10%">X</td></tr>
  63969. <tr><td width="40%">raw PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  63970. <tr><td width="40%">raw PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  63971. <tr><td width="40%">raw PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  63972. <tr><td width="40%">raw PCM signed 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  63973. <tr><td width="40%">raw PCM signed 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63974. <tr><td width="40%">raw PCM signed 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63975. <tr><td width="40%">raw PCM signed 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63976. <tr><td width="40%">raw PCM signed 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63977. <tr><td width="40%">raw PCM signed 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63978. <tr><td width="40%">raw PCM signed 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63979. <tr><td width="40%">raw PCM signed 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63980. <tr><td width="40%">raw PCM signed 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63981. <tr><td width="40%">raw PCM unsigned 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  63982. <tr><td width="40%">raw PCM unsigned 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63983. <tr><td width="40%">raw PCM unsigned 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63984. <tr><td width="40%">raw PCM unsigned 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63985. <tr><td width="40%">raw PCM unsigned 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63986. <tr><td width="40%">raw PCM unsigned 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63987. <tr><td width="40%">raw PCM unsigned 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63988. <tr><td width="40%">raw PCM 16.8 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  63989. <tr><td width="40%">raw PCM 24.0 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  63990. <tr><td width="40%">raw PCM floating-point 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63991. <tr><td width="40%">raw PCM floating-point 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63992. <tr><td width="40%">raw PCM floating-point 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63993. <tr><td width="40%">raw PCM floating-point 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  63994. <tr><td width="40%">RDT</td><td width="10%"></td><td width="10%">X</td></tr>
  63995. <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>
  63996. <tr><td width="40%">RealMedia</td><td width="10%">X</td><td width="10%">X</td></tr>
  63997. <tr><td width="40%">Redirector</td><td width="10%"></td><td width="10%">X</td></tr>
  63998. <tr><td width="40%">RedSpark</td><td width="10%"></td><td width="10%">X</td></tr>
  63999. <tr><td width="40%">Renderware TeXture Dictionary</td><td width="10%"></td><td width="10%">X</td></tr>
  64000. <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>
  64001. <tr><td width="40%">RF64</td><td width="10%"></td><td width="10%">X</td></tr>
  64002. <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>
  64003. <tr><td width="40%">RPL/ARMovie</td><td width="10%"></td><td width="10%">X</td></tr>
  64004. <tr><td width="40%">Lego Mindstorms RSO</td><td width="10%">X</td><td width="10%">X</td></tr>
  64005. <tr><td width="40%">RSD</td><td width="10%"></td><td width="10%">X</td></tr>
  64006. <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>
  64007. <tr><td width="40%">RTP</td><td width="10%">X</td><td width="10%">X</td></tr>
  64008. <tr><td width="40%">RTSP</td><td width="10%">X</td><td width="10%">X</td></tr>
  64009. <tr><td width="40%">Sample Dump eXchange</td><td width="10%"></td><td width="10%">X</td></tr>
  64010. <tr><td width="40%">SAP</td><td width="10%">X</td><td width="10%">X</td></tr>
  64011. <tr><td width="40%">SBG</td><td width="10%"></td><td width="10%">X</td></tr>
  64012. <tr><td width="40%">SDNS</td><td width="10%"></td><td width="10%">X</td></tr>
  64013. <tr><td width="40%">SDP</td><td width="10%"></td><td width="10%">X</td></tr>
  64014. <tr><td width="40%">SER</td><td width="10%"></td><td width="10%">X</td></tr>
  64015. <tr><td width="40%">Digital Pictures SGA</td><td width="10%"></td><td width="10%">X</td></tr>
  64016. <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>
  64017. <tr><td width="40%">Silicon Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  64018. <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>
  64019. <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>
  64020. <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>
  64021. <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>
  64022. <tr><td width="40%">SMPTE 337M encapsulation</td><td width="10%"></td><td width="10%">X</td></tr>
  64023. <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>
  64024. <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>
  64025. <tr><td width="40%">Sony PlayStation STR</td><td width="10%"></td><td width="10%">X</td></tr>
  64026. <tr><td width="40%">Sony Wave64 (W64)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64027. <tr><td width="40%">SoX native format</td><td width="10%">X</td><td width="10%">X</td></tr>
  64028. <tr><td width="40%">SUN AU format</td><td width="10%">X</td><td width="10%">X</td></tr>
  64029. <tr><td width="40%">SUP raw PGS subtitles</td><td width="10%">X</td><td width="10%">X</td></tr>
  64030. <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>
  64031. <tr><td width="40%">TDSC</td><td width="10%"></td><td width="10%">X</td></tr>
  64032. <tr><td width="40%">Text files</td><td width="10%"></td><td width="10%">X</td></tr>
  64033. <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>
  64034. <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>
  64035. <tr><td width="40%">True Audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  64036. <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>
  64037. <tr><td width="40%">VC-1 test bitstream</td><td width="10%">X</td><td width="10%">X</td></tr>
  64038. <tr><td width="40%">Vidvox Hap</td><td width="10%">X</td><td width="10%">X</td></tr>
  64039. <tr><td width="40%">Vivo</td><td width="10%"></td><td width="10%">X</td></tr>
  64040. <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>
  64041. <tr><td width="40%">Marble WADY</td><td width="10%"></td><td width="10%">X</td></tr>
  64042. <tr><td width="40%">WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  64043. <tr><td width="40%">Waveform Archiver</td><td width="10%"></td><td width="10%">X</td></tr>
  64044. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  64045. <tr><td width="40%">WebM</td><td width="10%">X</td><td width="10%">X</td></tr>
  64046. <tr><td width="40%">Windows Televison (WTV)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64047. <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>
  64048. <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>
  64049. <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>
  64050. <tr><td width="40%">Wideband Single-bit Data (WSD)</td><td width="10%"></td><td width="10%">X</td></tr>
  64051. <tr><td width="40%">WVE</td><td width="10%"></td><td width="10%">X</td></tr>
  64052. <tr><td width="40%">Konami XMD</td><td width="10%"></td><td width="10%">X</td></tr>
  64053. <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>
  64054. <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>
  64055. <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>
  64056. <tr><td width="40%">eXtended BINary text (XBIN)</td><td width="10%"></td><td width="10%">X</td></tr>
  64057. <tr><td width="40%">YUV4MPEG pipe</td><td width="10%">X</td><td width="10%">X</td></tr>
  64058. <tr><td width="40%">Psygnosis YOP</td><td width="10%"></td><td width="10%">X</td></tr>
  64059. </tbody>
  64060. </table>
  64061. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  64062. </p>
  64063. <a name="Image-Formats"></a>
  64064. <h3 class="section">51.2 Image Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Image-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Image-Formats" aria-hidden="true">TOC</a></span></h3>
  64065. <p>FFmpeg can read and write images for each frame of a video sequence. The
  64066. following image formats are supported:
  64067. </p>
  64068. <table class="multitable">
  64069. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  64070. <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>
  64071. <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>
  64072. <tr><td width="40%">animated GIF</td><td width="10%">X</td><td width="10%">X</td></tr>
  64073. <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>
  64074. <tr><td width="40%">BMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft BMP image</td></tr>
  64075. <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>
  64076. <tr><td width="40%">CRI</td><td width="10%"></td><td width="10%">X</td><td width="40%">Cintel RAW</td></tr>
  64077. <tr><td width="40%">DPX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Digital Picture Exchange</td></tr>
  64078. <tr><td width="40%">EXR</td><td width="10%"></td><td width="10%">X</td><td width="40%">OpenEXR</td></tr>
  64079. <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>
  64080. <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>
  64081. <tr><td width="40%">IMG</td><td width="10%"></td><td width="10%">X</td><td width="40%">GEM Raster image</td></tr>
  64082. <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>
  64083. <tr><td width="40%">JPEG 2000</td><td width="10%">X</td><td width="10%">X</td></tr>
  64084. <tr><td width="40%">JPEG-LS</td><td width="10%">X</td><td width="10%">X</td></tr>
  64085. <tr><td width="40%">JPEG-XS</td><td width="10%">E</td><td width="10%">E</td><td width="40%">Supported through external library libsvtjpegxs</td></tr>
  64086. <tr><td width="40%">LJPEG</td><td width="10%">X</td><td width="10%"></td><td width="40%">Lossless JPEG</td></tr>
  64087. <tr><td width="40%">Media 100</td><td width="10%"></td><td width="10%">X</td></tr>
  64088. <tr><td width="40%">MSP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Microsoft Paint image</td></tr>
  64089. <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>
  64090. <tr><td width="40%">PBM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable BitMap image</td></tr>
  64091. <tr><td width="40%">PCD</td><td width="10%"></td><td width="10%">X</td><td width="40%">PhotoCD</td></tr>
  64092. <tr><td width="40%">PCX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PC Paintbrush</td></tr>
  64093. <tr><td width="40%">PFM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable FloatMap image</td></tr>
  64094. <tr><td width="40%">PGM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable GrayMap image</td></tr>
  64095. <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>
  64096. <tr><td width="40%">PGX</td><td width="10%"></td><td width="10%">X</td><td width="40%">PGX file decoder</td></tr>
  64097. <tr><td width="40%">PHM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable HalfFloatMap image</td></tr>
  64098. <tr><td width="40%">PIC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Pictor/PC Paint</td></tr>
  64099. <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>
  64100. <tr><td width="40%">PPM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable PixelMap image</td></tr>
  64101. <tr><td width="40%">PSD</td><td width="10%"></td><td width="10%">X</td><td width="40%">Photoshop</td></tr>
  64102. <tr><td width="40%">PTX</td><td width="10%"></td><td width="10%">X</td><td width="40%">V.Flash PTX format</td></tr>
  64103. <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>
  64104. <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>
  64105. <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>
  64106. <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>
  64107. <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>
  64108. <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>
  64109. <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>
  64110. <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>
  64111. <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>
  64112. <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>
  64113. <tr><td width="40%">XPM</td><td width="10%"></td><td width="10%">X</td><td width="40%">X PixMap image format</td></tr>
  64114. <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>
  64115. </tbody>
  64116. </table>
  64117. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  64118. </p>
  64119. <p><code class="code">E</code> means that support is provided through an external library.
  64120. </p>
  64121. <a name="Video-Codecs"></a>
  64122. <h3 class="section">51.3 Video Codecs<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Codecs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Codecs" aria-hidden="true">TOC</a></span></h3>
  64123. <table class="multitable">
  64124. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  64125. <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>
  64126. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  64127. <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>
  64128. <tr><td width="40%">Amazing Studio PAF Video</td><td width="10%"></td><td width="10%">X</td></tr>
  64129. <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>
  64130. <tr><td width="40%">Amuse Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  64131. <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>
  64132. <tr><td width="40%">ANSI/ASCII art</td><td width="10%"></td><td width="10%">X</td></tr>
  64133. <tr><td width="40%">Apple Intermediate Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  64134. <tr><td width="40%">Apple MJPEG-B</td><td width="10%"></td><td width="10%">X</td></tr>
  64135. <tr><td width="40%">Apple Pixlet</td><td width="10%"></td><td width="10%">X</td></tr>
  64136. <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>
  64137. <tr><td width="40%">Apple QuickDraw</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: qdrw</td></tr>
  64138. <tr><td width="40%">APV</td><td width="10%"></td><td width="10%">X</td></tr>
  64139. <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>
  64140. <tr><td width="40%">Asus v1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV1</td></tr>
  64141. <tr><td width="40%">Asus v2</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV2</td></tr>
  64142. <tr><td width="40%">ATI VCR1</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR1</td></tr>
  64143. <tr><td width="40%">ATI VCR2</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR2</td></tr>
  64144. <tr><td width="40%">Auravision Aura</td><td width="10%"></td><td width="10%">X</td></tr>
  64145. <tr><td width="40%">Auravision Aura 2</td><td width="10%"></td><td width="10%">X</td></tr>
  64146. <tr><td width="40%">Autodesk Animator Flic video</td><td width="10%"></td><td width="10%">X</td></tr>
  64147. <tr><td width="40%">Autodesk RLE</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: AASC</td></tr>
  64148. <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>
  64149. <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>
  64150. <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>
  64151. <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>
  64152. <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>
  64153. <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>
  64154. <tr><td width="40%">Beam Software VB</td><td width="10%"></td><td width="10%">X</td></tr>
  64155. <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>
  64156. <tr><td width="40%">Bink Video</td><td width="10%"></td><td width="10%">X</td></tr>
  64157. <tr><td width="40%">BitJazz SheerVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  64158. <tr><td width="40%">Bitmap Brothers JV video</td><td width="10%"></td><td width="10%">X</td></tr>
  64159. <tr><td width="40%">y41p Brooktree uncompressed 4:1:1 12-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64160. <tr><td width="40%">Brooktree ProSumer Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: BT20</td></tr>
  64161. <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>
  64162. <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>
  64163. <tr><td width="40%">CamStudio</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: CSCD</td></tr>
  64164. <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>
  64165. <tr><td width="40%">CDXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">Amiga CD video codec</td></tr>
  64166. <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>
  64167. <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>
  64168. <tr><td width="40%">Discworld II BMV Video</td><td width="10%"></td><td width="10%">X</td></tr>
  64169. <tr><td width="40%">CineForm HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  64170. <tr><td width="40%">Canopus HQ</td><td width="10%"></td><td width="10%">X</td></tr>
  64171. <tr><td width="40%">Canopus HQA</td><td width="10%"></td><td width="10%">X</td></tr>
  64172. <tr><td width="40%">Canopus HQX</td><td width="10%"></td><td width="10%">X</td></tr>
  64173. <tr><td width="40%">Canopus Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  64174. <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>
  64175. <tr><td width="40%">Cinepak</td><td width="10%"></td><td width="10%">X</td></tr>
  64176. <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>
  64177. <tr><td width="40%">CPiA Video Format</td><td width="10%"></td><td width="10%">X</td></tr>
  64178. <tr><td width="40%">Creative YUV (CYUV)</td><td width="10%"></td><td width="10%">X</td></tr>
  64179. <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>
  64180. <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>
  64181. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  64182. <tr><td width="40%">DNxHD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">aka SMPTE VC3</td></tr>
  64183. <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>
  64184. <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>
  64185. <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>
  64186. <tr><td width="40%">DV (Digital Video)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64187. <tr><td width="40%">Dxtory capture format</td><td width="10%"></td><td width="10%">X</td></tr>
  64188. <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>
  64189. <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>
  64190. <tr><td width="40%">Electronic Arts Madcow video</td><td width="10%"></td><td width="10%">X</td></tr>
  64191. <tr><td width="40%">Electronic Arts TGV video</td><td width="10%"></td><td width="10%">X</td></tr>
  64192. <tr><td width="40%">Electronic Arts TGQ video</td><td width="10%"></td><td width="10%">X</td></tr>
  64193. <tr><td width="40%">Electronic Arts TQI video</td><td width="10%"></td><td width="10%">X</td></tr>
  64194. <tr><td width="40%">Escape 124</td><td width="10%"></td><td width="10%">X</td></tr>
  64195. <tr><td width="40%">Escape 130</td><td width="10%"></td><td width="10%">X</td></tr>
  64196. <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>
  64197. <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>
  64198. <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>
  64199. <tr><td width="40%">Flash Screen Video v2</td><td width="10%">X</td><td width="10%">X</td></tr>
  64200. <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>
  64201. <tr><td width="40%">FM Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  64202. <tr><td width="40%">Forward Uncompressed</td><td width="10%"></td><td width="10%">X</td></tr>
  64203. <tr><td width="40%">Fraps</td><td width="10%"></td><td width="10%">X</td></tr>
  64204. <tr><td width="40%">Go2Meeting</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M2, G2M3</td></tr>
  64205. <tr><td width="40%">Go2Webinar</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M4</td></tr>
  64206. <tr><td width="40%">Gremlin Digital Video</td><td width="10%"></td><td width="10%">X</td></tr>
  64207. <tr><td width="40%">H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  64208. <tr><td width="40%">H.263 / H.263-1996</td><td width="10%">X</td><td width="10%">X</td></tr>
  64209. <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>
  64210. <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>
  64211. <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>
  64212. <tr><td width="40%">HNM version 4</td><td width="10%"></td><td width="10%">X</td></tr>
  64213. <tr><td width="40%">HuffYUV</td><td width="10%">X</td><td width="10%">X</td></tr>
  64214. <tr><td width="40%">HuffYUV FFmpeg variant</td><td width="10%">X</td><td width="10%">X</td></tr>
  64215. <tr><td width="40%">IBM Ultimotion</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: ULTI</td></tr>
  64216. <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>
  64217. <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>
  64218. <tr><td width="40%">IFF ILBM</td><td width="10%"></td><td width="10%">X</td><td width="40%">IFF interleaved bitmap</td></tr>
  64219. <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>
  64220. <tr><td width="40%">Infinity IMM4</td><td width="10%"></td><td width="10%">X</td></tr>
  64221. <tr><td width="40%">Intel H.263</td><td width="10%"></td><td width="10%">X</td></tr>
  64222. <tr><td width="40%">Intel Indeo 2</td><td width="10%"></td><td width="10%">X</td></tr>
  64223. <tr><td width="40%">Intel Indeo 3</td><td width="10%"></td><td width="10%">X</td></tr>
  64224. <tr><td width="40%">Intel Indeo 4</td><td width="10%"></td><td width="10%">X</td></tr>
  64225. <tr><td width="40%">Intel Indeo 5</td><td width="10%"></td><td width="10%">X</td></tr>
  64226. <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>
  64227. <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>
  64228. <tr><td width="40%">J2K</td><td width="10%">X</td><td width="10%">X</td></tr>
  64229. <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>
  64230. <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>
  64231. <tr><td width="40%">Lagarith</td><td width="10%"></td><td width="10%">X</td></tr>
  64232. <tr><td width="40%">LCEVC / MPEG-5 LCEVC / MPEG-5 Part 2</td><td width="10%"></td><td width="10%">E</td><td width="40%">decoding supported through external library liblcevc-dec</td></tr>
  64233. <tr><td width="40%">LCL (LossLess Codec Library) MSZH</td><td width="10%"></td><td width="10%">X</td></tr>
  64234. <tr><td width="40%">LCL (LossLess Codec Library) ZLIB</td><td width="10%">E</td><td width="10%">E</td></tr>
  64235. <tr><td width="40%">LEAD MCMP</td><td width="10%"></td><td width="10%">X</td></tr>
  64236. <tr><td width="40%">LOCO</td><td width="10%"></td><td width="10%">X</td></tr>
  64237. <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>
  64238. <tr><td width="40%">lossless MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  64239. <tr><td width="40%">MagicYUV Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  64240. <tr><td width="40%">Mandsoft Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  64241. <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>
  64242. <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>
  64243. <tr><td width="40%">Microsoft RLE</td><td width="10%">X</td><td width="10%">X</td></tr>
  64244. <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>
  64245. <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>
  64246. <tr><td width="40%">Microsoft Video 1</td><td width="10%"></td><td width="10%">X</td></tr>
  64247. <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>
  64248. <tr><td width="40%">Miro VideoXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VIXL</td></tr>
  64249. <tr><td width="40%">MJPEG (Motion JPEG)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64250. <tr><td width="40%">Mobotix MxPEG video</td><td width="10%"></td><td width="10%">X</td></tr>
  64251. <tr><td width="40%">Motion Pixels video</td><td width="10%"></td><td width="10%">X</td></tr>
  64252. <tr><td width="40%">MPEG-1 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  64253. <tr><td width="40%">MPEG-2 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  64254. <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>
  64255. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 1</td><td width="10%"></td><td width="10%">X</td></tr>
  64256. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  64257. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 3</td><td width="10%">X</td><td width="10%">X</td></tr>
  64258. <tr><td width="40%">Newtek SpeedHQ</td><td width="10%">X</td><td width="10%">X</td></tr>
  64259. <tr><td width="40%">Nintendo Gamecube THP video</td><td width="10%"></td><td width="10%">X</td></tr>
  64260. <tr><td width="40%">NotchLC</td><td width="10%"></td><td width="10%">X</td></tr>
  64261. <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>
  64262. <tr><td width="40%">On2 VP3</td><td width="10%"></td><td width="10%">X</td><td width="40%">still experimental</td></tr>
  64263. <tr><td width="40%">On2 VP4</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP40</td></tr>
  64264. <tr><td width="40%">On2 VP5</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP50</td></tr>
  64265. <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>
  64266. <tr><td width="40%">On2 VP7</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP70,VP71</td></tr>
  64267. <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>
  64268. <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>
  64269. <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>
  64270. <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>
  64271. <tr><td width="40%">QuickTime 8BPS video</td><td width="10%"></td><td width="10%">X</td></tr>
  64272. <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>
  64273. <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>
  64274. <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>
  64275. <tr><td width="40%">R10K AJA Kona 10-bit RGB Codec</td><td width="10%">X</td><td width="10%">X</td></tr>
  64276. <tr><td width="40%">R210 Quicktime Uncompressed RGB 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64277. <tr><td width="40%">Raw Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  64278. <tr><td width="40%">RealVideo 1.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  64279. <tr><td width="40%">RealVideo 2.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  64280. <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>
  64281. <tr><td width="40%">RealVideo 4.0</td><td width="10%"></td><td width="10%">X</td></tr>
  64282. <tr><td width="40%">RealVideo 6.0</td><td width="10%"></td><td width="10%">X</td></tr>
  64283. <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>
  64284. <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>
  64285. <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>
  64286. <tr><td width="40%">ScreenPressor</td><td width="10%"></td><td width="10%">X</td></tr>
  64287. <tr><td width="40%">Screenpresso</td><td width="10%"></td><td width="10%">X</td></tr>
  64288. <tr><td width="40%">Screen Recorder Gold Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  64289. <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>
  64290. <tr><td width="40%">Silicon Graphics Motion Video Compressor 1 (MVC1)</td><td width="10%"></td><td width="10%">X</td></tr>
  64291. <tr><td width="40%">Silicon Graphics Motion Video Compressor 2 (MVC2)</td><td width="10%"></td><td width="10%">X</td></tr>
  64292. <tr><td width="40%">Silicon Graphics RLE 8-bit video</td><td width="10%"></td><td width="10%">X</td></tr>
  64293. <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>
  64294. <tr><td width="40%">SMPTE VC-1</td><td width="10%"></td><td width="10%">X</td></tr>
  64295. <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>
  64296. <tr><td width="40%">Sony PlayStation MDEC (Motion DECoder)</td><td width="10%"></td><td width="10%">X</td></tr>
  64297. <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>
  64298. <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>
  64299. <tr><td width="40%">Sunplus JPEG (SP5X)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: SP5X</td></tr>
  64300. <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>
  64301. <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>
  64302. <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>
  64303. <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>
  64304. <tr><td width="40%">Ut Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  64305. <tr><td width="40%">v210 QuickTime uncompressed 4:2:2 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64306. <tr><td width="40%">v308 QuickTime uncompressed 4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  64307. <tr><td width="40%">v408 QuickTime uncompressed 4:4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  64308. <tr><td width="40%">v410 QuickTime uncompressed 4:4:4 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64309. <tr><td width="40%">VBLE Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  64310. <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>
  64311. <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>
  64312. <tr><td width="40%">Westwood Studios VQA (Vector Quantized Animation) video</td><td width="10%"></td><td width="10%">X</td></tr>
  64313. <tr><td width="40%">Windows Media Image</td><td width="10%"></td><td width="10%">X</td></tr>
  64314. <tr><td width="40%">Windows Media Video 7</td><td width="10%">X</td><td width="10%">X</td></tr>
  64315. <tr><td width="40%">Windows Media Video 8</td><td width="10%">X</td><td width="10%">X</td></tr>
  64316. <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>
  64317. <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>
  64318. <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>
  64319. <tr><td width="40%">Winnov WNV1</td><td width="10%"></td><td width="10%">X</td></tr>
  64320. <tr><td width="40%">WMV7</td><td width="10%">X</td><td width="10%">X</td></tr>
  64321. <tr><td width="40%">YAMAHA SMAF</td><td width="10%">X</td><td width="10%">X</td></tr>
  64322. <tr><td width="40%">Psygnosis YOP Video</td><td width="10%"></td><td width="10%">X</td></tr>
  64323. <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>
  64324. <tr><td width="40%">ZeroCodec Lossless Video</td><td width="10%"></td><td width="10%">X</td></tr>
  64325. <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>
  64326. <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>
  64327. </tbody>
  64328. </table>
  64329. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  64330. </p>
  64331. <p><code class="code">E</code> means that support is provided through an external library.
  64332. </p>
  64333. <a name="Audio-Codecs"></a>
  64334. <h3 class="section">51.4 Audio Codecs<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Codecs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Codecs" aria-hidden="true">TOC</a></span></h3>
  64335. <table class="multitable">
  64336. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  64337. <tr><td width="40%">8SVX exponential</td><td width="10%"></td><td width="10%">X</td></tr>
  64338. <tr><td width="40%">8SVX fibonacci</td><td width="10%"></td><td width="10%">X</td></tr>
  64339. <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>
  64340. <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>
  64341. <tr><td width="40%">AC-3</td><td width="10%">IX</td><td width="10%">IX</td></tr>
  64342. <tr><td width="40%">ACELP.KELVIN</td><td width="10%"></td><td width="10%">X</td></tr>
  64343. <tr><td width="40%">ADPCM 4X Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  64344. <tr><td width="40%">ADPCM Yamaha AICA</td><td width="10%"></td><td width="10%">X</td></tr>
  64345. <tr><td width="40%">ADPCM AmuseGraphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  64346. <tr><td width="40%">ADPCM Argonaut Games</td><td width="10%">X</td><td width="10%">X</td></tr>
  64347. <tr><td width="40%">ADPCM CDROM XA</td><td width="10%"></td><td width="10%">X</td></tr>
  64348. <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>
  64349. <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>
  64350. <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>
  64351. <tr><td width="40%">ADPCM Electronic Arts R1</td><td width="10%"></td><td width="10%">X</td></tr>
  64352. <tr><td width="40%">ADPCM Electronic Arts R2</td><td width="10%"></td><td width="10%">X</td></tr>
  64353. <tr><td width="40%">ADPCM Electronic Arts R3</td><td width="10%"></td><td width="10%">X</td></tr>
  64354. <tr><td width="40%">ADPCM Electronic Arts XAS</td><td width="10%"></td><td width="10%">X</td></tr>
  64355. <tr><td width="40%">ADPCM G.722</td><td width="10%">X</td><td width="10%">X</td></tr>
  64356. <tr><td width="40%">ADPCM G.726</td><td width="10%">X</td><td width="10%">X</td></tr>
  64357. <tr><td width="40%">ADPCM IMA Acorn Replay</td><td width="10%"></td><td width="10%">X</td></tr>
  64358. <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>
  64359. <tr><td width="40%">ADPCM IMA Cunning Developments</td><td width="10%"></td><td width="10%">X</td></tr>
  64360. <tr><td width="40%">ADPCM IMA Electronic Arts EACS</td><td width="10%"></td><td width="10%">X</td></tr>
  64361. <tr><td width="40%">ADPCM IMA Electronic Arts SEAD</td><td width="10%"></td><td width="10%">X</td></tr>
  64362. <tr><td width="40%">ADPCM IMA Funcom</td><td width="10%"></td><td width="10%">X</td></tr>
  64363. <tr><td width="40%">ADPCM IMA High Voltage Software ALP</td><td width="10%">X</td><td width="10%">X</td></tr>
  64364. <tr><td width="40%">ADPCM IMA Mobiclip MOFLEX</td><td width="10%"></td><td width="10%">X</td></tr>
  64365. <tr><td width="40%">ADPCM IMA QuickTime</td><td width="10%">X</td><td width="10%">X</td></tr>
  64366. <tr><td width="40%">ADPCM IMA Simon &amp; Schuster Interactive</td><td width="10%">X</td><td width="10%">X</td></tr>
  64367. <tr><td width="40%">ADPCM IMA Ubisoft APM</td><td width="10%">X</td><td width="10%">X</td></tr>
  64368. <tr><td width="40%">ADPCM IMA Loki SDL MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  64369. <tr><td width="40%">ADPCM IMA WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  64370. <tr><td width="40%">ADPCM IMA Westwood</td><td width="10%"></td><td width="10%">X</td></tr>
  64371. <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>
  64372. <tr><td width="40%">ADPCM IMA Dialogic</td><td width="10%"></td><td width="10%">X</td></tr>
  64373. <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>
  64374. <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>
  64375. <tr><td width="40%">ADPCM IMA Radical</td><td width="10%"></td><td width="10%">X</td></tr>
  64376. <tr><td width="40%">ADPCM IMA Xbox</td><td width="10%"></td><td width="10%">X</td></tr>
  64377. <tr><td width="40%">ADPCM Microsoft</td><td width="10%">X</td><td width="10%">X</td></tr>
  64378. <tr><td width="40%">ADPCM MS IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  64379. <tr><td width="40%">ADPCM Nintendo Gamecube AFC</td><td width="10%"></td><td width="10%">X</td></tr>
  64380. <tr><td width="40%">ADPCM Nintendo Gamecube DTK</td><td width="10%"></td><td width="10%">X</td></tr>
  64381. <tr><td width="40%">ADPCM Nintendo THP</td><td width="10%"></td><td width="10%">X</td></tr>
  64382. <tr><td width="40%">ADPCM Playstation</td><td width="10%"></td><td width="10%">X</td></tr>
  64383. <tr><td width="40%">ADPCM QT IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  64384. <tr><td width="40%">ADPCM Sanyo</td><td width="10%"></td><td width="10%">X</td></tr>
  64385. <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>
  64386. <tr><td width="40%">ADPCM Shockwave Flash</td><td width="10%">X</td><td width="10%">X</td></tr>
  64387. <tr><td width="40%">ADPCM Sound Blaster Pro 2-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  64388. <tr><td width="40%">ADPCM Sound Blaster Pro 2.6-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  64389. <tr><td width="40%">ADPCM Sound Blaster Pro 4-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  64390. <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>
  64391. <tr><td width="40%">ADPCM Konami XMD</td><td width="10%"></td><td width="10%">X</td></tr>
  64392. <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>
  64393. <tr><td width="40%">ADPCM Yamaha</td><td width="10%">X</td><td width="10%">X</td></tr>
  64394. <tr><td width="40%">ADPCM Zork</td><td width="10%"></td><td width="10%">X</td></tr>
  64395. <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>
  64396. <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>
  64397. <tr><td width="40%">Amazing Studio PAF Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  64398. <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>
  64399. <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>
  64400. <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>
  64401. <tr><td width="40%">ATRAC1</td><td width="10%"></td><td width="10%">X</td></tr>
  64402. <tr><td width="40%">ATRAC3</td><td width="10%"></td><td width="10%">X</td></tr>
  64403. <tr><td width="40%">ATRAC3+</td><td width="10%"></td><td width="10%">X</td></tr>
  64404. <tr><td width="40%">ATRAC9</td><td width="10%"></td><td width="10%">X</td></tr>
  64405. <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>
  64406. <tr><td width="40%">Bonk audio</td><td width="10%"></td><td width="10%">X</td></tr>
  64407. <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>
  64408. <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>
  64409. <tr><td width="40%">CRI HCA</td><td width="10%"></td><td width="10%">X</td></tr>
  64410. <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>
  64411. <tr><td width="40%">DFPWM</td><td width="10%">X</td><td width="10%">X</td></tr>
  64412. <tr><td width="40%">Digital Speech Standard - Standard Play mode (DSS SP)</td><td width="10%"></td><td width="10%">X</td></tr>
  64413. <tr><td width="40%">Discworld II BMV Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  64414. <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>
  64415. <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>
  64416. <tr><td width="40%">Dolby E</td><td width="10%"></td><td width="10%">X</td></tr>
  64417. <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>
  64418. <tr><td width="40%">DPCM Gremlin</td><td width="10%"></td><td width="10%">X</td></tr>
  64419. <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>
  64420. <tr><td width="40%">DPCM Marble WADY</td><td width="10%"></td><td width="10%">X</td></tr>
  64421. <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>
  64422. <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>
  64423. <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>
  64424. <tr><td width="40%">DPCM Sol</td><td width="10%"></td><td width="10%">X</td></tr>
  64425. <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>
  64426. <tr><td width="40%">DPCM Xilam DERF</td><td width="10%"></td><td width="10%">X</td></tr>
  64427. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  64428. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  64429. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  64430. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  64431. <tr><td width="40%">DSP Group TrueSpeech</td><td width="10%"></td><td width="10%">X</td></tr>
  64432. <tr><td width="40%">DST (Direct Stream Transfer)</td><td width="10%"></td><td width="10%">X</td></tr>
  64433. <tr><td width="40%">DV audio</td><td width="10%"></td><td width="10%">X</td></tr>
  64434. <tr><td width="40%">Enhanced AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  64435. <tr><td width="40%">EVRC (Enhanced Variable Rate Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  64436. <tr><td width="40%">FLAC (Free Lossless Audio Codec)</td><td width="10%">X</td><td width="10%">IX</td></tr>
  64437. <tr><td width="40%">FTR Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  64438. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  64439. <tr><td width="40%">G.728</td><td width="10%"></td><td width="10%">X</td></tr>
  64440. <tr><td width="40%">G.729</td><td width="10%"></td><td width="10%">X</td></tr>
  64441. <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>
  64442. <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>
  64443. <tr><td width="40%">IAC (Indeo Audio Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  64444. <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>
  64445. <tr><td width="40%">IMC (Intel Music Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  64446. <tr><td width="40%">Interplay ACM</td><td width="10%"></td><td width="10%">X</td></tr>
  64447. <tr><td width="40%">LC3</td><td width="10%">E</td><td width="10%">E</td><td width="40%">supported through external library liblc3</td></tr>
  64448. <tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 6:1</td><td width="10%"></td><td width="10%">X</td></tr>
  64449. <tr><td width="40%">Marian&rsquo;s A-pac audio</td><td width="10%"></td><td width="10%">X</td></tr>
  64450. <tr><td width="40%">MI-SC4 (Micronas SC-4 Audio)</td><td width="10%"></td><td width="10%">X</td></tr>
  64451. <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>
  64452. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  64453. <tr><td width="40%">MP1 (MPEG audio layer 1)</td><td width="10%"></td><td width="10%">IX</td></tr>
  64454. <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>
  64455. <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>
  64456. <tr><td width="40%">MPEG-4 Audio Lossless Coding (ALS)</td><td width="10%"></td><td width="10%">X</td></tr>
  64457. <tr><td width="40%">MPEG-H 3D Audio</td><td width="10%"></td><td width="10%">E</td><td width="40%">decoding supported through external library libmpeghdec</td></tr>
  64458. <tr><td width="40%">MobiClip FastAudio</td><td width="10%"></td><td width="10%">X</td></tr>
  64459. <tr><td width="40%">Musepack SV7</td><td width="10%"></td><td width="10%">X</td></tr>
  64460. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  64461. <tr><td width="40%">Nellymoser Asao</td><td width="10%">X</td><td width="10%">X</td></tr>
  64462. <tr><td width="40%">On2 AVC (Audio for Video Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  64463. <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>
  64464. <tr><td width="40%">OSQ (Original Sound Quality)</td><td width="10%"></td><td width="10%">X</td></tr>
  64465. <tr><td width="40%">PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  64466. <tr><td width="40%">PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  64467. <tr><td width="40%">PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  64468. <tr><td width="40%">PCM signed 8-bit planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  64469. <tr><td width="40%">PCM signed 16-bit big-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  64470. <tr><td width="40%">PCM signed 16-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  64471. <tr><td width="40%">PCM signed 24-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  64472. <tr><td width="40%">PCM signed 32-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  64473. <tr><td width="40%">PCM 32-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64474. <tr><td width="40%">PCM 32-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64475. <tr><td width="40%">PCM 64-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64476. <tr><td width="40%">PCM 64-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64477. <tr><td width="40%">PCM D-Cinema audio signed 24-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64478. <tr><td width="40%">PCM signed 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64479. <tr><td width="40%">PCM signed 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64480. <tr><td width="40%">PCM signed 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64481. <tr><td width="40%">PCM signed 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64482. <tr><td width="40%">PCM signed 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64483. <tr><td width="40%">PCM signed 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64484. <tr><td width="40%">PCM signed 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64485. <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>
  64486. <tr><td width="40%">PCM unsigned 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64487. <tr><td width="40%">PCM unsigned 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64488. <tr><td width="40%">PCM unsigned 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64489. <tr><td width="40%">PCM unsigned 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64490. <tr><td width="40%">PCM unsigned 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64491. <tr><td width="40%">PCM unsigned 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64492. <tr><td width="40%">PCM unsigned 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64493. <tr><td width="40%">PCM SGA</td><td width="10%"></td><td width="10%">X</td></tr>
  64494. <tr><td width="40%">QCELP / PureVoice</td><td width="10%"></td><td width="10%">X</td></tr>
  64495. <tr><td width="40%">QDesign Music Codec 1</td><td width="10%"></td><td width="10%">X</td></tr>
  64496. <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>
  64497. <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>
  64498. <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>
  64499. <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>
  64500. <tr><td width="40%">RealAudio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  64501. <tr><td width="40%">RealAudio SIPR / ACELP.NET</td><td width="10%"></td><td width="10%">X</td></tr>
  64502. <tr><td width="40%">RK Audio (RKA)</td><td width="10%"></td><td width="10%">X</td></tr>
  64503. <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>
  64504. <tr><td width="40%">Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  64505. <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>
  64506. <tr><td width="40%">Smacker audio</td><td width="10%"></td><td width="10%">X</td></tr>
  64507. <tr><td width="40%">SMPTE 302M AES3 audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  64508. <tr><td width="40%">Sonic</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  64509. <tr><td width="40%">Sonic lossless</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  64510. <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>
  64511. <tr><td width="40%">TAK (Tom&rsquo;s lossless Audio Kompressor)</td><td width="10%"></td><td width="10%">X</td></tr>
  64512. <tr><td width="40%">True Audio (TTA)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64513. <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>
  64514. <tr><td width="40%">TwinVQ (VQF flavor)</td><td width="10%"></td><td width="10%">X</td></tr>
  64515. <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>
  64516. <tr><td width="40%">ViewQuest VQC</td><td width="10%"></td><td width="10%">X</td></tr>
  64517. <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>
  64518. <tr><td width="40%">Voxware MetaSound</td><td width="10%"></td><td width="10%">X</td></tr>
  64519. <tr><td width="40%">Waveform Archiver</td><td width="10%"></td><td width="10%">X</td></tr>
  64520. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  64521. <tr><td width="40%">Westwood Audio (SND1)</td><td width="10%"></td><td width="10%">X</td></tr>
  64522. <tr><td width="40%">Windows Media Audio 1</td><td width="10%">X</td><td width="10%">X</td></tr>
  64523. <tr><td width="40%">Windows Media Audio 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  64524. <tr><td width="40%">Windows Media Audio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  64525. <tr><td width="40%">Windows Media Audio Pro</td><td width="10%"></td><td width="10%">X</td></tr>
  64526. <tr><td width="40%">Windows Media Audio Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  64527. <tr><td width="40%">Xbox Media Audio 1</td><td width="10%"></td><td width="10%">X</td></tr>
  64528. <tr><td width="40%">Xbox Media Audio 2</td><td width="10%"></td><td width="10%">X</td></tr>
  64529. </tbody>
  64530. </table>
  64531. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  64532. </p>
  64533. <p><code class="code">E</code> means that support is provided through an external library.
  64534. </p>
  64535. <p><code class="code">I</code> means that an integer-only version is available, too (ensures high
  64536. performance on systems without hardware floating point support).
  64537. </p>
  64538. <a name="Subtitle-Formats"></a>
  64539. <h3 class="section">51.5 Subtitle Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitle-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitle-Formats" aria-hidden="true">TOC</a></span></h3>
  64540. <table class="multitable">
  64541. <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>
  64542. <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>
  64543. <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>
  64544. <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>
  64545. <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>
  64546. <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>
  64547. <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>
  64548. <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>
  64549. <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>
  64550. <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>
  64551. <tr><td width="40%">PGS</td><td width="10%"></td><td width="10%"></td><td width="10%"></td><td width="10%">X</td></tr>
  64552. <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>
  64553. <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>
  64554. <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>
  64555. <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>
  64556. <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>
  64557. <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>
  64558. <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>
  64559. <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>
  64560. <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>
  64561. <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>
  64562. <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>
  64563. <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>
  64564. <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>
  64565. <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>
  64566. </tbody>
  64567. </table>
  64568. <p><code class="code">X</code> means that the feature is supported.
  64569. </p>
  64570. <p><code class="code">E</code> means that support is provided through an external library.
  64571. </p>
  64572. <a name="Network-Protocols"></a>
  64573. <h3 class="section">51.6 Network Protocols<span class="pull-right"><a class="anchor hidden-xs" href="#Network-Protocols" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Network-Protocols" aria-hidden="true">TOC</a></span></h3>
  64574. <table class="multitable">
  64575. <tbody><tr><td width="40%">Name</td><td width="10%">Support</td></tr>
  64576. <tr><td width="40%">AMQP</td><td width="10%">E</td></tr>
  64577. <tr><td width="40%">file</td><td width="10%">X</td></tr>
  64578. <tr><td width="40%">FTP</td><td width="10%">X</td></tr>
  64579. <tr><td width="40%">Gopher</td><td width="10%">X</td></tr>
  64580. <tr><td width="40%">Gophers</td><td width="10%">X</td></tr>
  64581. <tr><td width="40%">HLS</td><td width="10%">X</td></tr>
  64582. <tr><td width="40%">HTTP</td><td width="10%">X</td></tr>
  64583. <tr><td width="40%">HTTPS</td><td width="10%">X</td></tr>
  64584. <tr><td width="40%">Icecast</td><td width="10%">X</td></tr>
  64585. <tr><td width="40%">MMSH</td><td width="10%">X</td></tr>
  64586. <tr><td width="40%">MMST</td><td width="10%">X</td></tr>
  64587. <tr><td width="40%">pipe</td><td width="10%">X</td></tr>
  64588. <tr><td width="40%">Pro-MPEG FEC</td><td width="10%">X</td></tr>
  64589. <tr><td width="40%">RTMP</td><td width="10%">X</td></tr>
  64590. <tr><td width="40%">RTMPE</td><td width="10%">X</td></tr>
  64591. <tr><td width="40%">RTMPS</td><td width="10%">X</td></tr>
  64592. <tr><td width="40%">RTMPT</td><td width="10%">X</td></tr>
  64593. <tr><td width="40%">RTMPTE</td><td width="10%">X</td></tr>
  64594. <tr><td width="40%">RTMPTS</td><td width="10%">X</td></tr>
  64595. <tr><td width="40%">RTP</td><td width="10%">X</td></tr>
  64596. <tr><td width="40%">SAMBA</td><td width="10%">E</td></tr>
  64597. <tr><td width="40%">SCTP</td><td width="10%">X</td></tr>
  64598. <tr><td width="40%">SFTP</td><td width="10%">E</td></tr>
  64599. <tr><td width="40%">TCP</td><td width="10%">X</td></tr>
  64600. <tr><td width="40%">TLS</td><td width="10%">X</td></tr>
  64601. <tr><td width="40%">UDP</td><td width="10%">X</td></tr>
  64602. <tr><td width="40%">ZMQ</td><td width="10%">E</td></tr>
  64603. </tbody>
  64604. </table>
  64605. <p><code class="code">X</code> means that the protocol is supported.
  64606. </p>
  64607. <p><code class="code">E</code> means that support is provided through an external library.
  64608. </p>
  64609. <a name="Input_002fOutput-Devices"></a>
  64610. <h3 class="section">51.7 Input/Output Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input_002fOutput-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input_002fOutput-Devices" aria-hidden="true">TOC</a></span></h3>
  64611. <table class="multitable">
  64612. <tbody><tr><td width="40%">Name</td><td width="10%">Input</td><td width="10%">Output</td></tr>
  64613. <tr><td width="40%">ALSA</td><td width="10%">X</td><td width="10%">X</td></tr>
  64614. <tr><td width="40%">BKTR</td><td width="10%">X</td><td width="10%"></td></tr>
  64615. <tr><td width="40%">caca</td><td width="10%"></td><td width="10%">X</td></tr>
  64616. <tr><td width="40%">DV1394</td><td width="10%">X</td><td width="10%"></td></tr>
  64617. <tr><td width="40%">Lavfi virtual device</td><td width="10%">X</td><td width="10%"></td></tr>
  64618. <tr><td width="40%">Linux framebuffer</td><td width="10%">X</td><td width="10%">X</td></tr>
  64619. <tr><td width="40%">JACK</td><td width="10%">X</td><td width="10%"></td></tr>
  64620. <tr><td width="40%">LIBCDIO</td><td width="10%">X</td></tr>
  64621. <tr><td width="40%">LIBDC1394</td><td width="10%">X</td><td width="10%"></td></tr>
  64622. <tr><td width="40%">OpenAL</td><td width="10%">X</td></tr>
  64623. <tr><td width="40%">OpenGL</td><td width="10%"></td><td width="10%">X</td></tr>
  64624. <tr><td width="40%">OSS</td><td width="10%">X</td><td width="10%">X</td></tr>
  64625. <tr><td width="40%">PulseAudio</td><td width="10%">X</td><td width="10%">X</td></tr>
  64626. <tr><td width="40%">SDL</td><td width="10%"></td><td width="10%">X</td></tr>
  64627. <tr><td width="40%">Video4Linux2</td><td width="10%">X</td><td width="10%">X</td></tr>
  64628. <tr><td width="40%">VfW capture</td><td width="10%">X</td><td width="10%"></td></tr>
  64629. <tr><td width="40%">X11 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  64630. <tr><td width="40%">Win32 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  64631. </tbody>
  64632. </table>
  64633. <p><code class="code">X</code> means that input/output is supported.
  64634. </p>
  64635. <a name="Timecode"></a>
  64636. <h3 class="section">51.8 Timecode<span class="pull-right"><a class="anchor hidden-xs" href="#Timecode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timecode" aria-hidden="true">TOC</a></span></h3>
  64637. <table class="multitable">
  64638. <tbody><tr><td width="40%">Codec/format</td><td width="10%">Read</td><td width="10%">Write</td></tr>
  64639. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  64640. <tr><td width="40%">DV</td><td width="10%">X</td><td width="10%">X</td></tr>
  64641. <tr><td width="40%">GXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  64642. <tr><td width="40%">MOV</td><td width="10%">X</td><td width="10%">X</td></tr>
  64643. <tr><td width="40%">MPEG1/2</td><td width="10%">X</td><td width="10%">X</td></tr>
  64644. <tr><td width="40%">MXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  64645. </tbody>
  64646. </table>
  64647. <a name="See-Also"></a>
  64648. <h2 class="chapter">52 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
  64649. <p><a class="url" href="ffmpeg.html">ffmpeg</a>
  64650. <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
  64651. <a class="url" href="ffmpeg-utils.html">ffmpeg-utils</a>,
  64652. <a class="url" href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
  64653. <a class="url" href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
  64654. <a class="url" href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
  64655. <a class="url" href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
  64656. <a class="url" href="ffmpeg-formats.html">ffmpeg-formats</a>,
  64657. <a class="url" href="ffmpeg-devices.html">ffmpeg-devices</a>,
  64658. <a class="url" href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
  64659. <a class="url" href="ffmpeg-filters.html">ffmpeg-filters</a>
  64660. </p>
  64661. <a name="Authors"></a>
  64662. <h2 class="chapter">53 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
  64663. <p>The FFmpeg developers.
  64664. </p>
  64665. <p>For details about the authorship, see the Git history of the project
  64666. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  64667. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  64668. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  64669. </p>
  64670. <p>Maintainers for the specific components are listed in the file
  64671. <samp class="file">MAINTAINERS</samp> in the source code tree.
  64672. </p>
  64673. <p style="font-size: small;">
  64674. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  64675. </p>
  64676. </div>
  64677. </body>
  64678. </html>