ffmpeg-all.html 2.7 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085660866608766088660896609066091660926609366094660956609666097660986609966100661016610266103661046610566106661076610866109661106611166112661136611466115661166611766118661196612066121661226612366124661256612666127661286612966130661316613266133661346613566136661376613866139661406614166142661436614466145661466614766148661496615066151661526615366154661556615666157661586615966160661616616266163661646616566166661676616866169661706617166172661736617466175661766617766178661796618066181661826618366184661856618666187661886618966190661916619266193661946619566196661976619866199662006620166202662036620466205662066620766208662096621066211662126621366214662156621666217662186621966220662216622266223662246622566226662276622866229662306623166232662336623466235662366623766238662396624066241662426624366244662456624666247662486624966250662516625266253662546625566256662576625866259662606626166262662636626466265662666626766268662696627066271662726627366274662756627666277662786627966280662816628266283662846628566286662876628866289662906629166292662936629466295662966629766298662996630066301663026630366304663056630666307663086630966310663116631266313663146631566316663176631866319663206632166322663236632466325663266632766328663296633066331663326633366334663356633666337663386633966340663416634266343663446634566346663476634866349663506635166352663536635466355663566635766358663596636066361663626636366364663656636666367663686636966370663716637266373663746637566376663776637866379663806638166382663836638466385663866638766388663896639066391663926639366394663956639666397663986639966400664016640266403664046640566406664076640866409664106641166412664136641466415664166641766418664196642066421664226642366424664256642666427664286642966430664316643266433664346643566436664376643866439664406644166442664436644466445664466644766448664496645066451664526645366454664556645666457664586645966460664616646266463664646646566466664676646866469664706647166472664736647466475664766647766478664796648066481664826648366484664856648666487664886648966490664916649266493664946649566496664976649866499665006650166502665036650466505665066650766508665096651066511665126651366514665156651666517665186651966520665216652266523665246652566526665276652866529665306653166532665336653466535665366653766538665396654066541665426654366544665456654666547665486654966550665516655266553665546655566556665576655866559665606656166562665636656466565665666656766568665696657066571665726657366574665756657666577665786657966580665816658266583665846658566586665876658866589665906659166592665936659466595665966659766598665996660066601666026660366604666056660666607666086660966610666116661266613666146661566616666176661866619666206662166622666236662466625666266662766628666296663066631666326663366634666356663666637666386663966640666416664266643666446664566646666476664866649666506665166652666536665466655666566665766658666596666066661666626666366664666656666666667666686666966670666716667266673666746667566676666776667866679666806668166682666836668466685666866668766688666896669066691666926669366694666956669666697666986669966700667016670266703667046670566706667076670866709667106671166712667136671466715667166671766718667196672066721667226672366724667256672666727667286672966730667316673266733667346673566736667376673866739667406674166742667436674466745667466674766748667496675066751667526675366754667556675666757667586675966760667616676266763667646676566766667676676866769667706677166772667736677466775667766677766778667796678066781667826678366784667856678666787667886678966790667916679266793667946679566796667976679866799668006680166802668036680466805668066680766808668096681066811668126681366814668156681666817668186681966820668216682266823668246682566826668276682866829668306683166832668336683466835668366683766838668396684066841668426684366844668456684666847668486684966850668516685266853668546685566856668576685866859668606686166862668636686466865668666686766868668696687066871668726687366874668756687666877668786687966880668816688266883668846688566886668876688866889668906689166892668936689466895668966689766898668996690066901669026690366904669056690666907669086690966910669116691266913669146691566916669176691866919669206692166922669236692466925669266692766928669296693066931669326693366934669356693666937669386693966940669416694266943669446694566946669476694866949669506695166952669536695466955669566695766958669596696066961669626696366964669656696666967669686696966970669716697266973669746697566976669776697866979669806698166982669836698466985669866698766988669896699066991669926699366994669956699666997669986699967000670016700267003670046700567006670076700867009670106701167012670136701467015670166701767018670196702067021670226702367024670256702667027670286702967030670316703267033670346703567036670376703867039670406704167042670436704467045670466704767048670496705067051670526705367054670556705667057670586705967060670616706267063670646706567066670676706867069670706707167072670736707467075670766707767078670796708067081670826708367084670856708667087670886708967090670916709267093670946709567096670976709867099671006710167102671036710467105671066710767108671096711067111671126711367114671156711667117671186711967120671216712267123671246712567126671276712867129671306713167132671336713467135671366713767138671396714067141671426714367144671456714667147671486714967150671516715267153671546715567156671576715867159671606716167162671636716467165671666716767168671696717067171671726717367174671756717667177671786717967180671816718267183671846718567186671876718867189671906719167192671936719467195671966719767198671996720067201672026720367204672056720667207672086720967210672116721267213672146721567216672176721867219672206722167222672236722467225672266722767228672296723067231672326723367234672356723667237672386723967240672416724267243672446724567246672476724867249672506725167252672536725467255672566725767258672596726067261672626726367264672656726667267672686726967270672716727267273672746727567276672776727867279672806728167282672836728467285672866728767288672896729067291672926729367294672956729667297672986729967300673016730267303673046730567306673076730867309673106731167312673136731467315673166731767318673196732067321673226732367324673256732667327673286732967330673316733267333673346733567336673376733867339673406734167342673436734467345673466734767348673496735067351673526735367354673556735667357673586735967360673616736267363673646736567366673676736867369673706737167372673736737467375673766737767378673796738067381673826738367384673856738667387673886738967390673916739267393673946739567396673976739867399674006740167402674036740467405674066740767408674096741067411674126741367414674156741667417674186741967420674216742267423674246742567426674276742867429674306743167432674336743467435674366743767438674396744067441674426744367444674456744667447674486744967450674516745267453674546745567456674576745867459674606746167462674636746467465674666746767468674696747067471674726747367474674756747667477674786747967480674816748267483674846748567486674876748867489674906749167492674936749467495674966749767498674996750067501675026750367504675056750667507675086750967510675116751267513675146751567516675176751867519675206752167522675236752467525675266752767528675296753067531675326753367534675356753667537675386753967540675416754267543675446754567546675476754867549675506755167552675536755467555675566755767558675596756067561675626756367564675656756667567675686756967570675716757267573675746757567576675776757867579675806758167582675836758467585675866758767588675896759067591675926759367594675956759667597675986759967600676016760267603676046760567606676076760867609676106761167612676136761467615676166761767618676196762067621676226762367624676256762667627676286762967630676316763267633676346763567636676376763867639676406764167642676436764467645676466764767648676496765067651676526765367654676556765667657676586765967660676616766267663676646766567666676676766867669676706767167672676736767467675676766767767678676796768067681676826768367684676856768667687676886768967690676916769267693676946769567696676976769867699677006770167702677036770467705677066770767708677096771067711677126771367714677156771667717677186771967720677216772267723677246772567726677276772867729677306773167732677336773467735677366773767738677396774067741677426774367744677456774667747677486774967750677516775267753677546775567756677576775867759677606776167762677636776467765677666776767768677696777067771677726777367774677756777667777677786777967780677816778267783677846778567786677876778867789677906779167792677936779467795677966779767798677996780067801678026780367804678056780667807678086780967810678116781267813678146781567816678176781867819678206782167822678236782467825678266782767828678296783067831678326783367834678356783667837678386783967840678416784267843678446784567846678476784867849678506785167852678536785467855678566785767858678596786067861678626786367864678656786667867678686786967870678716787267873678746787567876678776787867879678806788167882678836788467885678866788767888678896789067891678926789367894678956789667897678986789967900679016790267903679046790567906679076790867909679106791167912679136791467915679166791767918679196792067921679226792367924679256792667927679286792967930679316793267933679346793567936679376793867939679406794167942679436794467945679466794767948679496795067951679526795367954679556795667957679586795967960679616796267963679646796567966679676796867969679706797167972679736797467975679766797767978679796798067981679826798367984679856798667987679886798967990679916799267993679946799567996679976799867999680006800168002680036800468005680066800768008680096801068011680126801368014680156801668017680186801968020680216802268023680246802568026680276802868029680306803168032680336803468035680366803768038680396804068041680426804368044680456804668047680486804968050680516805268053680546805568056680576805868059680606806168062680636806468065680666806768068680696807068071680726807368074680756807668077680786807968080680816808268083680846808568086680876808868089680906809168092680936809468095680966809768098680996810068101681026810368104681056810668107681086810968110681116811268113681146811568116681176811868119681206812168122681236812468125681266812768128681296813068131681326813368134681356813668137681386813968140681416814268143681446814568146681476814868149681506815168152681536815468155681566815768158681596816068161681626816368164681656816668167681686816968170681716817268173681746817568176681776817868179681806818168182681836818468185681866818768188681896819068191681926819368194681956819668197681986819968200682016820268203682046820568206682076820868209682106821168212682136821468215682166821768218682196822068221682226822368224682256822668227682286822968230682316823268233682346823568236682376823868239682406824168242682436824468245682466824768248682496825068251682526825368254682556825668257682586825968260682616826268263682646826568266682676826868269682706827168272682736827468275682766827768278682796828068281682826828368284682856828668287682886828968290682916829268293682946829568296682976829868299683006830168302683036830468305683066830768308683096831068311683126831368314683156831668317683186831968320683216832268323683246832568326683276832868329683306833168332683336833468335683366833768338683396834068341683426834368344683456834668347683486834968350683516835268353683546835568356683576835868359683606836168362683636836468365683666836768368683696837068371683726837368374683756837668377683786837968380683816838268383683846838568386683876838868389683906839168392683936839468395683966839768398683996840068401684026840368404684056840668407684086840968410684116841268413684146841568416684176841868419684206842168422684236842468425684266842768428684296843068431684326843368434684356843668437684386843968440684416844268443684446844568446684476844868449684506845168452684536845468455684566845768458684596846068461684626846368464684656846668467684686846968470684716847268473684746847568476684776847868479684806848168482684836848468485684866848768488684896849068491684926849368494684956849668497684986849968500685016850268503685046850568506685076850868509685106851168512685136851468515685166851768518685196852068521685226852368524685256852668527685286852968530685316853268533685346853568536685376853868539685406854168542685436854468545685466854768548685496855068551685526855368554685556855668557685586855968560685616856268563685646856568566685676856868569685706857168572685736857468575685766857768578685796858068581685826858368584685856858668587685886858968590685916859268593685946859568596685976859868599686006860168602686036860468605686066860768608686096861068611686126861368614686156861668617686186861968620686216862268623686246862568626686276862868629686306863168632686336863468635686366863768638686396864068641686426864368644686456864668647686486864968650686516865268653686546865568656686576865868659686606866168662686636866468665686666866768668686696867068671686726867368674686756867668677686786867968680686816868268683686846868568686686876868868689686906869168692686936869468695686966869768698686996870068701687026870368704687056870668707687086870968710687116871268713687146871568716687176871868719687206872168722687236872468725687266872768728687296873068731687326873368734687356873668737687386873968740687416874268743687446874568746687476874868749687506875168752687536875468755687566875768758687596876068761687626876368764687656876668767687686876968770687716877268773687746877568776687776877868779687806878168782687836878468785687866878768788687896879068791687926879368794687956879668797687986879968800688016880268803688046880568806688076880868809688106881168812688136881468815688166881768818688196882068821688226882368824688256882668827688286882968830688316883268833688346883568836688376883868839688406884168842688436884468845688466884768848688496885068851688526885368854688556885668857688586885968860688616886268863688646886568866688676886868869688706887168872688736887468875688766887768878688796888068881688826888368884688856888668887688886888968890688916889268893688946889568896688976889868899689006890168902689036890468905689066890768908689096891068911689126891368914689156891668917689186891968920689216892268923689246892568926689276892868929689306893168932689336893468935689366893768938689396894068941689426894368944689456894668947689486894968950689516895268953689546895568956689576895868959689606896168962689636896468965689666896768968689696897068971689726897368974689756897668977689786897968980689816898268983689846898568986689876898868989689906899168992689936899468995689966899768998689996900069001690026900369004690056900669007690086900969010690116901269013690146901569016690176901869019690206902169022690236902469025690266902769028690296903069031690326903369034690356903669037690386903969040690416904269043690446904569046690476904869049690506905169052690536905469055690566905769058690596906069061690626906369064690656906669067690686906969070690716907269073690746907569076690776907869079690806908169082690836908469085690866908769088690896909069091690926909369094690956909669097690986909969100691016910269103691046910569106691076910869109691106911169112691136911469115691166911769118691196912069121691226912369124691256912669127691286912969130691316913269133691346913569136691376913869139691406914169142691436914469145691466914769148691496915069151691526915369154691556915669157691586915969160691616916269163691646916569166691676916869169691706917169172691736917469175691766917769178691796918069181691826918369184691856918669187691886918969190691916919269193691946919569196691976919869199692006920169202692036920469205692066920769208692096921069211692126921369214692156921669217692186921969220692216922269223692246922569226692276922869229692306923169232692336923469235692366923769238692396924069241692426924369244692456924669247692486924969250692516925269253692546925569256692576925869259692606926169262692636926469265692666926769268692696927069271692726927369274692756927669277692786927969280692816928269283692846928569286692876928869289692906929169292692936929469295692966929769298692996930069301693026930369304693056930669307693086930969310693116931269313693146931569316693176931869319693206932169322693236932469325693266932769328693296933069331693326933369334693356933669337693386933969340693416934269343693446934569346693476934869349693506935169352693536935469355693566935769358693596936069361693626936369364693656936669367693686936969370693716937269373693746937569376693776937869379693806938169382693836938469385693866938769388693896939069391693926939369394693956939669397693986939969400694016940269403694046940569406694076940869409694106941169412694136941469415694166941769418694196942069421694226942369424694256942669427694286942969430694316943269433694346943569436694376943869439694406944169442694436944469445694466944769448694496945069451694526945369454694556945669457694586945969460694616946269463694646946569466694676946869469694706947169472
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by , GNU Texinfo 7.1 -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. 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. <div class="top-level-extent" id="SEC_Top">
  19. <div class="element-contents" id="SEC_Contents">
  20. <h2 class="contents-heading">Table of Contents</h2>
  21. <div class="contents">
  22. <ul class="toc-numbered-mark">
  23. <li><a id="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
  24. <li><a id="toc-Description" href="#Description">2 Description</a></li>
  25. <li><a id="toc-Detailed-description" href="#Detailed-description">3 Detailed description</a>
  26. <ul class="toc-numbered-mark">
  27. <li><a id="toc-Filtering" href="#Filtering">3.1 Filtering</a>
  28. <ul class="toc-numbered-mark">
  29. <li><a id="toc-Simple-filtergraphs" href="#Simple-filtergraphs">3.1.1 Simple filtergraphs</a></li>
  30. <li><a id="toc-Complex-filtergraphs" href="#Complex-filtergraphs">3.1.2 Complex filtergraphs</a></li>
  31. </ul></li>
  32. <li><a id="toc-Stream-copy" href="#Stream-copy">3.2 Stream copy</a></li>
  33. <li><a id="toc-Loopback-decoders" href="#Loopback-decoders">3.3 Loopback decoders</a></li>
  34. </ul></li>
  35. <li><a id="toc-Stream-selection" href="#Stream-selection">4 Stream selection</a>
  36. <ul class="toc-numbered-mark">
  37. <li><a id="toc-Description-1" href="#Description-1">4.1 Description</a>
  38. <ul class="toc-numbered-mark">
  39. <li><a id="toc-Automatic-stream-selection" href="#Automatic-stream-selection">4.1.1 Automatic stream selection</a></li>
  40. <li><a id="toc-Manual-stream-selection" href="#Manual-stream-selection">4.1.2 Manual stream selection</a></li>
  41. <li><a id="toc-Complex-filtergraphs-1" href="#Complex-filtergraphs-1">4.1.3 Complex filtergraphs</a></li>
  42. <li><a id="toc-Stream-handling" href="#Stream-handling">4.1.4 Stream handling</a></li>
  43. </ul></li>
  44. <li><a id="toc-Examples" href="#Examples">4.2 Examples</a></li>
  45. </ul></li>
  46. <li><a id="toc-Options" href="#Options">5 Options</a>
  47. <ul class="toc-numbered-mark">
  48. <li><a id="toc-Stream-specifiers-1" href="#Stream-specifiers-1">5.1 Stream specifiers</a></li>
  49. <li><a id="toc-Generic-options" href="#Generic-options">5.2 Generic options</a></li>
  50. <li><a id="toc-AVOptions" href="#AVOptions">5.3 AVOptions</a></li>
  51. <li><a id="toc-Main-options" href="#Main-options">5.4 Main options</a></li>
  52. <li><a id="toc-Video-Options" href="#Video-Options">5.5 Video Options</a></li>
  53. <li><a id="toc-Advanced-Video-options" href="#Advanced-Video-options">5.6 Advanced Video options</a></li>
  54. <li><a id="toc-Audio-Options" href="#Audio-Options">5.7 Audio Options</a></li>
  55. <li><a id="toc-Advanced-Audio-options" href="#Advanced-Audio-options">5.8 Advanced Audio options</a></li>
  56. <li><a id="toc-Subtitle-options" href="#Subtitle-options">5.9 Subtitle options</a></li>
  57. <li><a id="toc-Advanced-Subtitle-options" href="#Advanced-Subtitle-options">5.10 Advanced Subtitle options</a></li>
  58. <li><a id="toc-Advanced-options" href="#Advanced-options">5.11 Advanced options</a></li>
  59. <li><a id="toc-Preset-files" href="#Preset-files">5.12 Preset files</a>
  60. <ul class="toc-numbered-mark">
  61. <li><a id="toc-ffpreset-files" href="#ffpreset-files">5.12.1 ffpreset files</a></li>
  62. <li><a id="toc-avpreset-files" href="#avpreset-files">5.12.2 avpreset files</a></li>
  63. </ul></li>
  64. <li><a id="toc-vstats-file-format" href="#vstats-file-format">5.13 vstats file format</a></li>
  65. </ul></li>
  66. <li><a id="toc-Examples-1" href="#Examples-1">6 Examples</a>
  67. <ul class="toc-numbered-mark">
  68. <li><a id="toc-Video-and-Audio-grabbing" href="#Video-and-Audio-grabbing">6.1 Video and Audio grabbing</a></li>
  69. <li><a id="toc-X11-grabbing" href="#X11-grabbing">6.2 X11 grabbing</a></li>
  70. <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>
  71. </ul></li>
  72. <li><a id="toc-Syntax" href="#Syntax">7 Syntax</a>
  73. <ul class="toc-numbered-mark">
  74. <li><a id="toc-Quoting-and-escaping" href="#Quoting-and-escaping">7.1 Quoting and escaping</a>
  75. <ul class="toc-numbered-mark">
  76. <li><a id="toc-Examples-2" href="#Examples-2">7.1.1 Examples</a></li>
  77. </ul></li>
  78. <li><a id="toc-Date" href="#Date">7.2 Date</a></li>
  79. <li><a id="toc-Time-duration" href="#Time-duration">7.3 Time duration</a>
  80. <ul class="toc-numbered-mark">
  81. <li><a id="toc-Examples-3" href="#Examples-3">7.3.1 Examples</a></li>
  82. </ul></li>
  83. <li><a id="toc-Video-size" href="#Video-size">7.4 Video size</a></li>
  84. <li><a id="toc-Video-rate" href="#Video-rate">7.5 Video rate</a></li>
  85. <li><a id="toc-Ratio" href="#Ratio">7.6 Ratio</a></li>
  86. <li><a id="toc-Color" href="#Color">7.7 Color</a></li>
  87. <li><a id="toc-Channel-Layout" href="#Channel-Layout">7.8 Channel Layout</a></li>
  88. </ul></li>
  89. <li><a id="toc-Expression-Evaluation" href="#Expression-Evaluation">8 Expression Evaluation</a></li>
  90. <li><a id="toc-Codec-Options" href="#Codec-Options">9 Codec Options</a></li>
  91. <li><a id="toc-Decoders" href="#Decoders">10 Decoders</a></li>
  92. <li><a id="toc-Video-Decoders" href="#Video-Decoders">11 Video Decoders</a>
  93. <ul class="toc-numbered-mark">
  94. <li><a id="toc-av1" href="#av1">11.1 av1</a>
  95. <ul class="toc-numbered-mark">
  96. <li><a id="toc-Options-1" href="#Options-1">11.1.1 Options</a></li>
  97. </ul></li>
  98. <li><a id="toc-rawvideo" href="#rawvideo">11.2 rawvideo</a>
  99. <ul class="toc-numbered-mark">
  100. <li><a id="toc-Options-2" href="#Options-2">11.2.1 Options</a></li>
  101. </ul></li>
  102. <li><a id="toc-libdav1d" href="#libdav1d">11.3 libdav1d</a>
  103. <ul class="toc-numbered-mark">
  104. <li><a id="toc-Options-3" href="#Options-3">11.3.1 Options</a></li>
  105. </ul></li>
  106. <li><a id="toc-libdavs2" href="#libdavs2">11.4 libdavs2</a></li>
  107. <li><a id="toc-libuavs3d" href="#libuavs3d">11.5 libuavs3d</a>
  108. <ul class="toc-numbered-mark">
  109. <li><a id="toc-Options-4" href="#Options-4">11.5.1 Options</a></li>
  110. </ul></li>
  111. <li><a id="toc-libxevd" href="#libxevd">11.6 libxevd</a>
  112. <ul class="toc-numbered-mark">
  113. <li><a id="toc-Options-5" href="#Options-5">11.6.1 Options</a></li>
  114. </ul></li>
  115. <li><a id="toc-QSV-Decoders" href="#QSV-Decoders">11.7 QSV Decoders</a>
  116. <ul class="toc-numbered-mark">
  117. <li><a id="toc-Common-Options" href="#Common-Options">11.7.1 Common Options</a></li>
  118. <li><a id="toc-HEVC-Options" href="#HEVC-Options">11.7.2 HEVC Options</a></li>
  119. </ul></li>
  120. <li><a id="toc-v210" href="#v210">11.8 v210</a>
  121. <ul class="toc-numbered-mark">
  122. <li><a id="toc-Options-6" href="#Options-6">11.8.1 Options</a></li>
  123. </ul></li>
  124. </ul></li>
  125. <li><a id="toc-Audio-Decoders" href="#Audio-Decoders">12 Audio Decoders</a>
  126. <ul class="toc-numbered-mark">
  127. <li><a id="toc-ac3" href="#ac3">12.1 ac3</a>
  128. <ul class="toc-numbered-mark">
  129. <li><a id="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">12.1.1 AC-3 Decoder Options</a></li>
  130. </ul></li>
  131. <li><a id="toc-flac-1" href="#flac-1">12.2 flac</a>
  132. <ul class="toc-numbered-mark">
  133. <li><a id="toc-FLAC-Decoder-options" href="#FLAC-Decoder-options">12.2.1 FLAC Decoder options</a></li>
  134. </ul></li>
  135. <li><a id="toc-ffwavesynth" href="#ffwavesynth">12.3 ffwavesynth</a></li>
  136. <li><a id="toc-libcelt" href="#libcelt">12.4 libcelt</a></li>
  137. <li><a id="toc-libgsm" href="#libgsm">12.5 libgsm</a></li>
  138. <li><a id="toc-libilbc" href="#libilbc">12.6 libilbc</a>
  139. <ul class="toc-numbered-mark">
  140. <li><a id="toc-Options-7" href="#Options-7">12.6.1 Options</a></li>
  141. </ul></li>
  142. <li><a id="toc-libopencore_002damrnb" href="#libopencore_002damrnb">12.7 libopencore-amrnb</a></li>
  143. <li><a id="toc-libopencore_002damrwb" href="#libopencore_002damrwb">12.8 libopencore-amrwb</a></li>
  144. <li><a id="toc-libopus" href="#libopus">12.9 libopus</a></li>
  145. </ul></li>
  146. <li><a id="toc-Subtitles-Decoders" href="#Subtitles-Decoders">13 Subtitles Decoders</a>
  147. <ul class="toc-numbered-mark">
  148. <li><a id="toc-libaribb24" href="#libaribb24">13.1 libaribb24</a>
  149. <ul class="toc-numbered-mark">
  150. <li><a id="toc-libaribb24-Decoder-Options" href="#libaribb24-Decoder-Options">13.1.1 libaribb24 Decoder Options</a></li>
  151. </ul></li>
  152. <li><a id="toc-libaribcaption" href="#libaribcaption">13.2 libaribcaption</a>
  153. <ul class="toc-numbered-mark">
  154. <li><a id="toc-libaribcaption-Decoder-Options" href="#libaribcaption-Decoder-Options">13.2.1 libaribcaption Decoder Options</a></li>
  155. <li><a id="toc-libaribcaption-decoder-usage-examples" href="#libaribcaption-decoder-usage-examples">13.2.2 libaribcaption decoder usage examples</a></li>
  156. </ul></li>
  157. <li><a id="toc-dvbsub" href="#dvbsub">13.3 dvbsub</a>
  158. <ul class="toc-numbered-mark">
  159. <li><a id="toc-Options-8" href="#Options-8">13.3.1 Options</a></li>
  160. </ul></li>
  161. <li><a id="toc-dvdsub" href="#dvdsub">13.4 dvdsub</a>
  162. <ul class="toc-numbered-mark">
  163. <li><a id="toc-Options-9" href="#Options-9">13.4.1 Options</a></li>
  164. </ul></li>
  165. <li><a id="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">13.5 libzvbi-teletext</a>
  166. <ul class="toc-numbered-mark">
  167. <li><a id="toc-Options-10" href="#Options-10">13.5.1 Options</a></li>
  168. </ul></li>
  169. </ul></li>
  170. <li><a id="toc-Encoders" href="#Encoders">14 Encoders</a></li>
  171. <li><a id="toc-Audio-Encoders" href="#Audio-Encoders">15 Audio Encoders</a>
  172. <ul class="toc-numbered-mark">
  173. <li><a id="toc-aac" href="#aac">15.1 aac</a>
  174. <ul class="toc-numbered-mark">
  175. <li><a id="toc-Options-11" href="#Options-11">15.1.1 Options</a></li>
  176. </ul></li>
  177. <li><a id="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">15.2 ac3 and ac3_fixed</a>
  178. <ul class="toc-numbered-mark">
  179. <li><a id="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">15.2.1 AC-3 Metadata</a>
  180. <ul class="toc-numbered-mark">
  181. <li><a id="toc-Metadata-Control-Options" href="#Metadata-Control-Options">15.2.1.1 Metadata Control Options</a></li>
  182. <li><a id="toc-Downmix-Levels" href="#Downmix-Levels">15.2.1.2 Downmix Levels</a></li>
  183. <li><a id="toc-Audio-Production-Information" href="#Audio-Production-Information">15.2.1.3 Audio Production Information</a></li>
  184. <li><a id="toc-Other-Metadata-Options" href="#Other-Metadata-Options">15.2.1.4 Other Metadata Options</a></li>
  185. </ul></li>
  186. <li><a id="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">15.2.2 Extended Bitstream Information</a>
  187. <ul class="toc-numbered-mark">
  188. <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>
  189. <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>
  190. </ul></li>
  191. <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>
  192. <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>
  193. </ul></li>
  194. <li><a id="toc-flac-2" href="#flac-2">15.3 flac</a>
  195. <ul class="toc-numbered-mark">
  196. <li><a id="toc-Options-12" href="#Options-12">15.3.1 Options</a></li>
  197. </ul></li>
  198. <li><a id="toc-opus" href="#opus">15.4 opus</a>
  199. <ul class="toc-numbered-mark">
  200. <li><a id="toc-Options-13" href="#Options-13">15.4.1 Options</a></li>
  201. </ul></li>
  202. <li><a id="toc-libfdk_005faac" href="#libfdk_005faac">15.5 libfdk_aac</a>
  203. <ul class="toc-numbered-mark">
  204. <li><a id="toc-Options-14" href="#Options-14">15.5.1 Options</a></li>
  205. <li><a id="toc-Examples-4" href="#Examples-4">15.5.2 Examples</a></li>
  206. </ul></li>
  207. <li><a id="toc-libmp3lame-1" href="#libmp3lame-1">15.6 libmp3lame</a>
  208. <ul class="toc-numbered-mark">
  209. <li><a id="toc-Options-15" href="#Options-15">15.6.1 Options</a></li>
  210. </ul></li>
  211. <li><a id="toc-libopencore_002damrnb-1" href="#libopencore_002damrnb-1">15.7 libopencore-amrnb</a>
  212. <ul class="toc-numbered-mark">
  213. <li><a id="toc-Options-16" href="#Options-16">15.7.1 Options</a></li>
  214. </ul></li>
  215. <li><a id="toc-libopus-1" href="#libopus-1">15.8 libopus</a>
  216. <ul class="toc-numbered-mark">
  217. <li><a id="toc-Option-Mapping" href="#Option-Mapping">15.8.1 Option Mapping</a></li>
  218. </ul></li>
  219. <li><a id="toc-libshine-1" href="#libshine-1">15.9 libshine</a>
  220. <ul class="toc-numbered-mark">
  221. <li><a id="toc-Options-17" href="#Options-17">15.9.1 Options</a></li>
  222. </ul></li>
  223. <li><a id="toc-libtwolame" href="#libtwolame">15.10 libtwolame</a>
  224. <ul class="toc-numbered-mark">
  225. <li><a id="toc-Options-18" href="#Options-18">15.10.1 Options</a></li>
  226. </ul></li>
  227. <li><a id="toc-libvo_002damrwbenc" href="#libvo_002damrwbenc">15.11 libvo-amrwbenc</a>
  228. <ul class="toc-numbered-mark">
  229. <li><a id="toc-Options-19" href="#Options-19">15.11.1 Options</a></li>
  230. </ul></li>
  231. <li><a id="toc-libvorbis" href="#libvorbis">15.12 libvorbis</a>
  232. <ul class="toc-numbered-mark">
  233. <li><a id="toc-Options-20" href="#Options-20">15.12.1 Options</a></li>
  234. </ul></li>
  235. <li><a id="toc-mjpeg" href="#mjpeg">15.13 mjpeg</a>
  236. <ul class="toc-numbered-mark">
  237. <li><a id="toc-Options-21" href="#Options-21">15.13.1 Options</a></li>
  238. </ul></li>
  239. <li><a id="toc-wavpack" href="#wavpack">15.14 wavpack</a>
  240. <ul class="toc-numbered-mark">
  241. <li><a id="toc-Options-22" href="#Options-22">15.14.1 Options</a>
  242. <ul class="toc-numbered-mark">
  243. <li><a id="toc-Shared-options" href="#Shared-options">15.14.1.1 Shared options</a></li>
  244. <li><a id="toc-Private-options" href="#Private-options">15.14.1.2 Private options</a></li>
  245. </ul></li>
  246. </ul></li>
  247. </ul></li>
  248. <li><a id="toc-Video-Encoders" href="#Video-Encoders">16 Video Encoders</a>
  249. <ul class="toc-numbered-mark">
  250. <li><a id="toc-a64_005fmulti_002c-a64_005fmulti5" href="#a64_005fmulti_002c-a64_005fmulti5">16.1 a64_multi, a64_multi5</a></li>
  251. <li><a id="toc-Cinepak" href="#Cinepak">16.2 Cinepak</a>
  252. <ul class="toc-numbered-mark">
  253. <li><a id="toc-Options-23" href="#Options-23">16.2.1 Options</a></li>
  254. </ul></li>
  255. <li><a id="toc-GIF" href="#GIF">16.3 GIF</a>
  256. <ul class="toc-numbered-mark">
  257. <li><a id="toc-Options-24" href="#Options-24">16.3.1 Options</a></li>
  258. </ul></li>
  259. <li><a id="toc-Hap" href="#Hap">16.4 Hap</a>
  260. <ul class="toc-numbered-mark">
  261. <li><a id="toc-Options-25" href="#Options-25">16.4.1 Options</a></li>
  262. </ul></li>
  263. <li><a id="toc-jpeg2000" href="#jpeg2000">16.5 jpeg2000</a>
  264. <ul class="toc-numbered-mark">
  265. <li><a id="toc-Options-26" href="#Options-26">16.5.1 Options</a></li>
  266. </ul></li>
  267. <li><a id="toc-librav1e" href="#librav1e">16.6 librav1e</a>
  268. <ul class="toc-numbered-mark">
  269. <li><a id="toc-Options-27" href="#Options-27">16.6.1 Options</a></li>
  270. </ul></li>
  271. <li><a id="toc-libaom_002dav1" href="#libaom_002dav1">16.7 libaom-av1</a>
  272. <ul class="toc-numbered-mark">
  273. <li><a id="toc-Options-28" href="#Options-28">16.7.1 Options</a></li>
  274. </ul></li>
  275. <li><a id="toc-libsvtav1" href="#libsvtav1">16.8 libsvtav1</a>
  276. <ul class="toc-numbered-mark">
  277. <li><a id="toc-Options-29" href="#Options-29">16.8.1 Options</a></li>
  278. </ul></li>
  279. <li><a id="toc-libjxl" href="#libjxl">16.9 libjxl</a>
  280. <ul class="toc-numbered-mark">
  281. <li><a id="toc-Options-30" href="#Options-30">16.9.1 Options</a></li>
  282. </ul></li>
  283. <li><a id="toc-libkvazaar" href="#libkvazaar">16.10 libkvazaar</a>
  284. <ul class="toc-numbered-mark">
  285. <li><a id="toc-Options-31" href="#Options-31">16.10.1 Options</a></li>
  286. </ul></li>
  287. <li><a id="toc-libopenh264" href="#libopenh264">16.11 libopenh264</a>
  288. <ul class="toc-numbered-mark">
  289. <li><a id="toc-Options-32" href="#Options-32">16.11.1 Options</a></li>
  290. </ul></li>
  291. <li><a id="toc-libtheora" href="#libtheora">16.12 libtheora</a>
  292. <ul class="toc-numbered-mark">
  293. <li><a id="toc-Options-33" href="#Options-33">16.12.1 Options</a></li>
  294. <li><a id="toc-Examples-5" href="#Examples-5">16.12.2 Examples</a></li>
  295. </ul></li>
  296. <li><a id="toc-libvpx" href="#libvpx">16.13 libvpx</a>
  297. <ul class="toc-numbered-mark">
  298. <li><a id="toc-Options-34" href="#Options-34">16.13.1 Options</a></li>
  299. </ul></li>
  300. <li><a id="toc-libwebp" href="#libwebp">16.14 libwebp</a>
  301. <ul class="toc-numbered-mark">
  302. <li><a id="toc-Pixel-Format" href="#Pixel-Format">16.14.1 Pixel Format</a></li>
  303. <li><a id="toc-Options-35" href="#Options-35">16.14.2 Options</a></li>
  304. </ul></li>
  305. <li><a id="toc-libx264_002c-libx264rgb" href="#libx264_002c-libx264rgb">16.15 libx264, libx264rgb</a>
  306. <ul class="toc-numbered-mark">
  307. <li><a id="toc-Supported-Pixel-Formats" href="#Supported-Pixel-Formats">16.15.1 Supported Pixel Formats</a></li>
  308. <li><a id="toc-Options-36" href="#Options-36">16.15.2 Options</a></li>
  309. </ul></li>
  310. <li><a id="toc-libx265" href="#libx265">16.16 libx265</a>
  311. <ul class="toc-numbered-mark">
  312. <li><a id="toc-Options-37" href="#Options-37">16.16.1 Options</a></li>
  313. </ul></li>
  314. <li><a id="toc-libxavs2" href="#libxavs2">16.17 libxavs2</a>
  315. <ul class="toc-numbered-mark">
  316. <li><a id="toc-Options-38" href="#Options-38">16.17.1 Options</a></li>
  317. </ul></li>
  318. <li><a id="toc-libxeve" href="#libxeve">16.18 libxeve</a>
  319. <ul class="toc-numbered-mark">
  320. <li><a id="toc-Options-39" href="#Options-39">16.18.1 Options</a></li>
  321. </ul></li>
  322. <li><a id="toc-libxvid" href="#libxvid">16.19 libxvid</a>
  323. <ul class="toc-numbered-mark">
  324. <li><a id="toc-Options-40" href="#Options-40">16.19.1 Options</a></li>
  325. </ul></li>
  326. <li><a id="toc-MediaFoundation" href="#MediaFoundation">16.20 MediaFoundation</a></li>
  327. <li><a id="toc-Microsoft-RLE" href="#Microsoft-RLE">16.21 Microsoft RLE</a>
  328. <ul class="toc-numbered-mark">
  329. <li><a id="toc-Options-41" href="#Options-41">16.21.1 Options</a></li>
  330. </ul></li>
  331. <li><a id="toc-mpeg2" href="#mpeg2">16.22 mpeg2</a>
  332. <ul class="toc-numbered-mark">
  333. <li><a id="toc-Options-42" href="#Options-42">16.22.1 Options</a></li>
  334. </ul></li>
  335. <li><a id="toc-png" href="#png">16.23 png</a>
  336. <ul class="toc-numbered-mark">
  337. <li><a id="toc-Private-options-1" href="#Private-options-1">16.23.1 Private options</a></li>
  338. </ul></li>
  339. <li><a id="toc-ProRes" href="#ProRes">16.24 ProRes</a>
  340. <ul class="toc-numbered-mark">
  341. <li><a id="toc-Private-Options-for-prores_002dks" href="#Private-Options-for-prores_002dks">16.24.1 Private Options for prores-ks</a></li>
  342. <li><a id="toc-Speed-considerations" href="#Speed-considerations">16.24.2 Speed considerations</a></li>
  343. </ul></li>
  344. <li><a id="toc-QSV-Encoders" href="#QSV-Encoders">16.25 QSV Encoders</a>
  345. <ul class="toc-numbered-mark">
  346. <li><a id="toc-Ratecontrol-Method" href="#Ratecontrol-Method">16.25.1 Ratecontrol Method</a></li>
  347. <li><a id="toc-Global-Options-_002d_003e-MSDK-Options" href="#Global-Options-_002d_003e-MSDK-Options">16.25.2 Global Options -&gt; MSDK Options</a></li>
  348. <li><a id="toc-Common-Options-1" href="#Common-Options-1">16.25.3 Common Options</a></li>
  349. <li><a id="toc-Runtime-Options" href="#Runtime-Options">16.25.4 Runtime Options</a></li>
  350. <li><a id="toc-H264-options" href="#H264-options">16.25.5 H264 options</a></li>
  351. <li><a id="toc-HEVC-Options-1" href="#HEVC-Options-1">16.25.6 HEVC Options</a></li>
  352. <li><a id="toc-MPEG2-Options" href="#MPEG2-Options">16.25.7 MPEG2 Options</a></li>
  353. <li><a id="toc-VP9-Options" href="#VP9-Options">16.25.8 VP9 Options</a></li>
  354. <li><a id="toc-AV1-Options" href="#AV1-Options">16.25.9 AV1 Options</a></li>
  355. </ul></li>
  356. <li><a id="toc-snow" href="#snow">16.26 snow</a>
  357. <ul class="toc-numbered-mark">
  358. <li><a id="toc-Options-43" href="#Options-43">16.26.1 Options</a></li>
  359. </ul></li>
  360. <li><a id="toc-VAAPI-encoders" href="#VAAPI-encoders">16.27 VAAPI encoders</a></li>
  361. <li><a id="toc-vbn" href="#vbn">16.28 vbn</a>
  362. <ul class="toc-numbered-mark">
  363. <li><a id="toc-Options-44" href="#Options-44">16.28.1 Options</a></li>
  364. </ul></li>
  365. <li><a id="toc-vc2" href="#vc2">16.29 vc2</a>
  366. <ul class="toc-numbered-mark">
  367. <li><a id="toc-Options-45" href="#Options-45">16.29.1 Options</a></li>
  368. </ul></li>
  369. </ul></li>
  370. <li><a id="toc-Subtitles-Encoders" href="#Subtitles-Encoders">17 Subtitles Encoders</a>
  371. <ul class="toc-numbered-mark">
  372. <li><a id="toc-dvdsub-1" href="#dvdsub-1">17.1 dvdsub</a>
  373. <ul class="toc-numbered-mark">
  374. <li><a id="toc-Options-46" href="#Options-46">17.1.1 Options</a></li>
  375. </ul></li>
  376. </ul></li>
  377. <li><a id="toc-Bitstream-Filters" href="#Bitstream-Filters">18 Bitstream Filters</a>
  378. <ul class="toc-numbered-mark">
  379. <li><a id="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">18.1 aac_adtstoasc</a></li>
  380. <li><a id="toc-av1_005fmetadata" href="#av1_005fmetadata">18.2 av1_metadata</a></li>
  381. <li><a id="toc-chomp" href="#chomp">18.3 chomp</a></li>
  382. <li><a id="toc-dca_005fcore" href="#dca_005fcore">18.4 dca_core</a></li>
  383. <li><a id="toc-dump_005fextra" href="#dump_005fextra">18.5 dump_extra</a></li>
  384. <li><a id="toc-dv_005ferror_005fmarker" href="#dv_005ferror_005fmarker">18.6 dv_error_marker</a></li>
  385. <li><a id="toc-eac3_005fcore" href="#eac3_005fcore">18.7 eac3_core</a></li>
  386. <li><a id="toc-extract_005fextradata" href="#extract_005fextradata">18.8 extract_extradata</a></li>
  387. <li><a id="toc-filter_005funits" href="#filter_005funits">18.9 filter_units</a></li>
  388. <li><a id="toc-hapqa_005fextract" href="#hapqa_005fextract">18.10 hapqa_extract</a></li>
  389. <li><a id="toc-h264_005fmetadata" href="#h264_005fmetadata">18.11 h264_metadata</a></li>
  390. <li><a id="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">18.12 h264_mp4toannexb</a></li>
  391. <li><a id="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">18.13 h264_redundant_pps</a></li>
  392. <li><a id="toc-hevc_005fmetadata" href="#hevc_005fmetadata">18.14 hevc_metadata</a></li>
  393. <li><a id="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">18.15 hevc_mp4toannexb</a></li>
  394. <li><a id="toc-imxdump" href="#imxdump">18.16 imxdump</a></li>
  395. <li><a id="toc-mjpeg2jpeg" href="#mjpeg2jpeg">18.17 mjpeg2jpeg</a></li>
  396. <li><a id="toc-mjpegadump" href="#mjpegadump">18.18 mjpegadump</a></li>
  397. <li><a id="toc-mov2textsub-1" href="#mov2textsub-1">18.19 mov2textsub</a></li>
  398. <li><a id="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">18.20 mpeg2_metadata</a></li>
  399. <li><a id="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">18.21 mpeg4_unpack_bframes</a></li>
  400. <li><a id="toc-noise" href="#noise">18.22 noise</a>
  401. <ul class="toc-numbered-mark">
  402. <li><a id="toc-Examples-6" href="#Examples-6">18.22.1 Examples</a></li>
  403. </ul></li>
  404. <li><a id="toc-null" href="#null">18.23 null</a></li>
  405. <li><a id="toc-pcm_005frechunk" href="#pcm_005frechunk">18.24 pcm_rechunk</a></li>
  406. <li><a id="toc-pgs_005fframe_005fmerge" href="#pgs_005fframe_005fmerge">18.25 pgs_frame_merge</a></li>
  407. <li><a id="toc-prores_005fmetadata" href="#prores_005fmetadata">18.26 prores_metadata</a></li>
  408. <li><a id="toc-remove_005fextra" href="#remove_005fextra">18.27 remove_extra</a></li>
  409. <li><a id="toc-setts" href="#setts">18.28 setts</a></li>
  410. <li><a id="toc-showinfo" href="#showinfo">18.29 showinfo</a></li>
  411. <li><a id="toc-text2movsub-1" href="#text2movsub-1">18.30 text2movsub</a></li>
  412. <li><a id="toc-trace_005fheaders" href="#trace_005fheaders">18.31 trace_headers</a></li>
  413. <li><a id="toc-truehd_005fcore" href="#truehd_005fcore">18.32 truehd_core</a></li>
  414. <li><a id="toc-vp9_005fmetadata" href="#vp9_005fmetadata">18.33 vp9_metadata</a></li>
  415. <li><a id="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">18.34 vp9_superframe</a></li>
  416. <li><a id="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">18.35 vp9_superframe_split</a></li>
  417. <li><a id="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">18.36 vp9_raw_reorder</a></li>
  418. </ul></li>
  419. <li><a id="toc-Format-Options" href="#Format-Options">19 Format Options</a>
  420. <ul class="toc-numbered-mark">
  421. <li><a id="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">19.1 Format stream specifiers</a></li>
  422. </ul></li>
  423. <li><a id="toc-Demuxers" href="#Demuxers">20 Demuxers</a>
  424. <ul class="toc-numbered-mark">
  425. <li><a id="toc-aa" href="#aa">20.1 aa</a></li>
  426. <li><a id="toc-aac-1" href="#aac-1">20.2 aac</a></li>
  427. <li><a id="toc-apng" href="#apng">20.3 apng</a></li>
  428. <li><a id="toc-asf-1" href="#asf-1">20.4 asf</a></li>
  429. <li><a id="toc-concat-1" href="#concat-1">20.5 concat</a>
  430. <ul class="toc-numbered-mark">
  431. <li><a id="toc-Syntax-1" href="#Syntax-1">20.5.1 Syntax</a></li>
  432. <li><a id="toc-Options-47" href="#Options-47">20.5.2 Options</a></li>
  433. <li><a id="toc-Examples-7" href="#Examples-7">20.5.3 Examples</a></li>
  434. </ul></li>
  435. <li><a id="toc-dash-1" href="#dash-1">20.6 dash</a>
  436. <ul class="toc-numbered-mark">
  437. <li><a id="toc-Options-48" href="#Options-48">20.6.1 Options</a></li>
  438. </ul></li>
  439. <li><a id="toc-dvdvideo" href="#dvdvideo">20.7 dvdvideo</a>
  440. <ul class="toc-numbered-mark">
  441. <li><a id="toc-Background" href="#Background">20.7.1 Background</a></li>
  442. <li><a id="toc-Options-49" href="#Options-49">20.7.2 Options</a></li>
  443. <li><a id="toc-Examples-8" href="#Examples-8">20.7.3 Examples</a></li>
  444. </ul></li>
  445. <li><a id="toc-ea" href="#ea">20.8 ea</a>
  446. <ul class="toc-numbered-mark">
  447. <li><a id="toc-Options-50" href="#Options-50">20.8.1 Options</a></li>
  448. </ul></li>
  449. <li><a id="toc-imf" href="#imf">20.9 imf</a></li>
  450. <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>
  451. <li><a id="toc-gif-1" href="#gif-1">20.11 gif</a></li>
  452. <li><a id="toc-hls-1" href="#hls-1">20.12 hls</a></li>
  453. <li><a id="toc-image2-1" href="#image2-1">20.13 image2</a>
  454. <ul class="toc-numbered-mark">
  455. <li><a id="toc-Examples-9" href="#Examples-9">20.13.1 Examples</a></li>
  456. </ul></li>
  457. <li><a id="toc-libgme" href="#libgme">20.14 libgme</a></li>
  458. <li><a id="toc-libmodplug" href="#libmodplug">20.15 libmodplug</a></li>
  459. <li><a id="toc-libopenmpt" href="#libopenmpt">20.16 libopenmpt</a></li>
  460. <li><a id="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">20.17 mov/mp4/3gp</a>
  461. <ul class="toc-numbered-mark">
  462. <li><a id="toc-Options-51" href="#Options-51">20.17.1 Options</a></li>
  463. <li><a id="toc-Audible-AAX" href="#Audible-AAX">20.17.2 Audible AAX</a></li>
  464. </ul></li>
  465. <li><a id="toc-mpegts" href="#mpegts">20.18 mpegts</a></li>
  466. <li><a id="toc-mpjpeg" href="#mpjpeg">20.19 mpjpeg</a></li>
  467. <li><a id="toc-rawvideo-1" href="#rawvideo-1">20.20 rawvideo</a></li>
  468. <li><a id="toc-sbg" href="#sbg">20.21 sbg</a></li>
  469. <li><a id="toc-tedcaptions" href="#tedcaptions">20.22 tedcaptions</a></li>
  470. <li><a id="toc-vapoursynth" href="#vapoursynth">20.23 vapoursynth</a></li>
  471. <li><a id="toc-w64" href="#w64">20.24 w64</a></li>
  472. <li><a id="toc-wav-1" href="#wav-1">20.25 wav</a></li>
  473. </ul></li>
  474. <li><a id="toc-Muxers" href="#Muxers">21 Muxers</a>
  475. <ul class="toc-numbered-mark">
  476. <li><a id="toc-Raw-muxers" href="#Raw-muxers">21.1 Raw muxers</a>
  477. <ul class="toc-numbered-mark">
  478. <li><a id="toc-Examples-10" href="#Examples-10">21.1.1 Examples</a></li>
  479. </ul></li>
  480. <li><a id="toc-Raw-PCM-muxers" href="#Raw-PCM-muxers">21.2 Raw PCM muxers</a></li>
  481. <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>
  482. <ul class="toc-numbered-mark">
  483. <li><a id="toc-Options-52" href="#Options-52">21.3.1 Options</a></li>
  484. </ul></li>
  485. <li><a id="toc-MOV_002fMPEG_002d4_002fISOMBFF-muxers" href="#MOV_002fMPEG_002d4_002fISOMBFF-muxers">21.4 MOV/MPEG-4/ISOMBFF muxers</a>
  486. <ul class="toc-numbered-mark">
  487. <li><a id="toc-Fragmentation" href="#Fragmentation">21.4.1 Fragmentation</a></li>
  488. <li><a id="toc-Options-53" href="#Options-53">21.4.2 Options</a></li>
  489. <li><a id="toc-Examples-11" href="#Examples-11">21.4.3 Examples</a></li>
  490. </ul></li>
  491. <li><a id="toc-a64-1" href="#a64-1">21.5 a64</a></li>
  492. <li><a id="toc-ac4" href="#ac4">21.6 ac4</a>
  493. <ul class="toc-numbered-mark">
  494. <li><a id="toc-Options-54" href="#Options-54">21.6.1 Options</a></li>
  495. </ul></li>
  496. <li><a id="toc-adts-1" href="#adts-1">21.7 adts</a>
  497. <ul class="toc-numbered-mark">
  498. <li><a id="toc-Options-55" href="#Options-55">21.7.1 Options</a></li>
  499. </ul></li>
  500. <li><a id="toc-aea-1" href="#aea-1">21.8 aea</a></li>
  501. <li><a id="toc-aiff-1" href="#aiff-1">21.9 aiff</a>
  502. <ul class="toc-numbered-mark">
  503. <li><a id="toc-Options-56" href="#Options-56">21.9.1 Options</a></li>
  504. </ul></li>
  505. <li><a id="toc-alp-1" href="#alp-1">21.10 alp</a>
  506. <ul class="toc-numbered-mark">
  507. <li><a id="toc-Options-57" href="#Options-57">21.10.1 Options</a></li>
  508. </ul></li>
  509. <li><a id="toc-amr" href="#amr">21.11 amr</a></li>
  510. <li><a id="toc-amv" href="#amv">21.12 amv</a></li>
  511. <li><a id="toc-apm" href="#apm">21.13 apm</a></li>
  512. <li><a id="toc-apng-1" href="#apng-1">21.14 apng</a>
  513. <ul class="toc-numbered-mark">
  514. <li><a id="toc-Options-58" href="#Options-58">21.14.1 Options</a></li>
  515. <li><a id="toc-Examples-12" href="#Examples-12">21.14.2 Examples</a></li>
  516. </ul></li>
  517. <li><a id="toc-argo_005fasf" href="#argo_005fasf">21.15 argo_asf</a>
  518. <ul class="toc-numbered-mark">
  519. <li><a id="toc-Options-59" href="#Options-59">21.15.1 Options</a></li>
  520. </ul></li>
  521. <li><a id="toc-argo_005fcvg" href="#argo_005fcvg">21.16 argo_cvg</a>
  522. <ul class="toc-numbered-mark">
  523. <li><a id="toc-Options-60" href="#Options-60">21.16.1 Options</a></li>
  524. </ul></li>
  525. <li><a id="toc-asf_002c-asf_005fstream" href="#asf_002c-asf_005fstream">21.17 asf, asf_stream</a>
  526. <ul class="toc-numbered-mark">
  527. <li><a id="toc-Options-61" href="#Options-61">21.17.1 Options</a></li>
  528. </ul></li>
  529. <li><a id="toc-ass" href="#ass">21.18 ass</a>
  530. <ul class="toc-numbered-mark">
  531. <li><a id="toc-Options-62" href="#Options-62">21.18.1 Options</a></li>
  532. </ul></li>
  533. <li><a id="toc-ast" href="#ast">21.19 ast</a>
  534. <ul class="toc-numbered-mark">
  535. <li><a id="toc-Options-63" href="#Options-63">21.19.1 Options</a></li>
  536. </ul></li>
  537. <li><a id="toc-au" href="#au">21.20 au</a></li>
  538. <li><a id="toc-avi-1" href="#avi-1">21.21 avi</a>
  539. <ul class="toc-numbered-mark">
  540. <li><a id="toc-Options-64" href="#Options-64">21.21.1 Options</a></li>
  541. </ul></li>
  542. <li><a id="toc-avif" href="#avif">21.22 avif</a>
  543. <ul class="toc-numbered-mark">
  544. <li><a id="toc-Options-65" href="#Options-65">21.22.1 Options</a></li>
  545. </ul></li>
  546. <li><a id="toc-avm2" href="#avm2">21.23 avm2</a></li>
  547. <li><a id="toc-bit" href="#bit">21.24 bit</a></li>
  548. <li><a id="toc-caf" href="#caf">21.25 caf</a></li>
  549. <li><a id="toc-codec2" href="#codec2">21.26 codec2</a></li>
  550. <li><a id="toc-chromaprint-1" href="#chromaprint-1">21.27 chromaprint</a>
  551. <ul class="toc-numbered-mark">
  552. <li><a id="toc-Options-66" href="#Options-66">21.27.1 Options</a></li>
  553. </ul></li>
  554. <li><a id="toc-crc-1" href="#crc-1">21.28 crc</a>
  555. <ul class="toc-numbered-mark">
  556. <li><a id="toc-Examples-13" href="#Examples-13">21.28.1 Examples</a></li>
  557. </ul></li>
  558. <li><a id="toc-dash-2" href="#dash-2">21.29 dash</a>
  559. <ul class="toc-numbered-mark">
  560. <li><a id="toc-Options-67" href="#Options-67">21.29.1 Options</a></li>
  561. <li><a id="toc-Example" href="#Example">21.29.2 Example</a></li>
  562. </ul></li>
  563. <li><a id="toc-daud" href="#daud">21.30 daud</a>
  564. <ul class="toc-numbered-mark">
  565. <li><a id="toc-Example-1" href="#Example-1">21.30.1 Example</a></li>
  566. </ul></li>
  567. <li><a id="toc-dv" href="#dv">21.31 dv</a>
  568. <ul class="toc-numbered-mark">
  569. <li><a id="toc-Example-2" href="#Example-2">21.31.1 Example</a></li>
  570. </ul></li>
  571. <li><a id="toc-ffmetadata" href="#ffmetadata">21.32 ffmetadata</a>
  572. <ul class="toc-numbered-mark">
  573. <li><a id="toc-Example-3" href="#Example-3">21.32.1 Example</a></li>
  574. </ul></li>
  575. <li><a id="toc-fifo-1" href="#fifo-1">21.33 fifo</a>
  576. <ul class="toc-numbered-mark">
  577. <li><a id="toc-Options-68" href="#Options-68">21.33.1 Options</a></li>
  578. <li><a id="toc-Example-4" href="#Example-4">21.33.2 Example</a></li>
  579. </ul></li>
  580. <li><a id="toc-film_005fcpk" href="#film_005fcpk">21.34 film_cpk</a></li>
  581. <li><a id="toc-filmstrip" href="#filmstrip">21.35 filmstrip</a></li>
  582. <li><a id="toc-fits" href="#fits">21.36 fits</a></li>
  583. <li><a id="toc-flac-3" href="#flac-3">21.37 flac</a>
  584. <ul class="toc-numbered-mark">
  585. <li><a id="toc-Options-69" href="#Options-69">21.37.1 Options</a></li>
  586. <li><a id="toc-Example-5" href="#Example-5">21.37.2 Example</a></li>
  587. </ul></li>
  588. <li><a id="toc-flv" href="#flv">21.38 flv</a>
  589. <ul class="toc-numbered-mark">
  590. <li><a id="toc-Options-70" href="#Options-70">21.38.1 Options</a></li>
  591. </ul></li>
  592. <li><a id="toc-framecrc-1" href="#framecrc-1">21.39 framecrc</a>
  593. <ul class="toc-numbered-mark">
  594. <li><a id="toc-Examples-14" href="#Examples-14">21.39.1 Examples</a></li>
  595. </ul></li>
  596. <li><a id="toc-framehash-1" href="#framehash-1">21.40 framehash</a>
  597. <ul class="toc-numbered-mark">
  598. <li><a id="toc-Examples-15" href="#Examples-15">21.40.1 Examples</a></li>
  599. </ul></li>
  600. <li><a id="toc-framemd5-1" href="#framemd5-1">21.41 framemd5</a>
  601. <ul class="toc-numbered-mark">
  602. <li><a id="toc-Examples-16" href="#Examples-16">21.41.1 Examples</a></li>
  603. </ul></li>
  604. <li><a id="toc-gif-2" href="#gif-2">21.42 gif</a>
  605. <ul class="toc-numbered-mark">
  606. <li><a id="toc-Options-71" href="#Options-71">21.42.1 Options</a></li>
  607. <li><a id="toc-Example-6" href="#Example-6">21.42.2 Example</a></li>
  608. </ul></li>
  609. <li><a id="toc-gxf" href="#gxf">21.43 gxf</a></li>
  610. <li><a id="toc-hash-1" href="#hash-1">21.44 hash</a>
  611. <ul class="toc-numbered-mark">
  612. <li><a id="toc-Examples-17" href="#Examples-17">21.44.1 Examples</a></li>
  613. </ul></li>
  614. <li><a id="toc-hds-1" href="#hds-1">21.45 hds</a>
  615. <ul class="toc-numbered-mark">
  616. <li><a id="toc-Options-72" href="#Options-72">21.45.1 Options</a></li>
  617. <li><a id="toc-Example-7" href="#Example-7">21.45.2 Example</a></li>
  618. </ul></li>
  619. <li><a id="toc-hls-2" href="#hls-2">21.46 hls</a>
  620. <ul class="toc-numbered-mark">
  621. <li><a id="toc-Options-73" href="#Options-73">21.46.1 Options</a></li>
  622. </ul></li>
  623. <li><a id="toc-ico-1" href="#ico-1">21.47 ico</a></li>
  624. <li><a id="toc-image2-2" href="#image2-2">21.48 image2</a>
  625. <ul class="toc-numbered-mark">
  626. <li><a id="toc-Options-74" href="#Options-74">21.48.1 Options</a></li>
  627. <li><a id="toc-Examples-18" href="#Examples-18">21.48.2 Examples</a></li>
  628. </ul></li>
  629. <li><a id="toc-matroska" href="#matroska">21.49 matroska</a>
  630. <ul class="toc-numbered-mark">
  631. <li><a id="toc-Metadata" href="#Metadata">21.49.1 Metadata</a></li>
  632. <li><a id="toc-Options-75" href="#Options-75">21.49.2 Options</a></li>
  633. </ul></li>
  634. <li><a id="toc-md5-1" href="#md5-1">21.50 md5</a>
  635. <ul class="toc-numbered-mark">
  636. <li><a id="toc-Examples-19" href="#Examples-19">21.50.1 Examples</a></li>
  637. </ul></li>
  638. <li><a id="toc-mp3" href="#mp3">21.51 mp3</a></li>
  639. <li><a id="toc-mpegts-1" href="#mpegts-1">21.52 mpegts</a>
  640. <ul class="toc-numbered-mark">
  641. <li><a id="toc-Options-76" href="#Options-76">21.52.1 Options</a></li>
  642. <li><a id="toc-Example-8" href="#Example-8">21.52.2 Example</a></li>
  643. </ul></li>
  644. <li><a id="toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">21.53 mxf, mxf_d10, mxf_opatom</a>
  645. <ul class="toc-numbered-mark">
  646. <li><a id="toc-Options-77" href="#Options-77">21.53.1 Options</a></li>
  647. </ul></li>
  648. <li><a id="toc-null-1" href="#null-1">21.54 null</a></li>
  649. <li><a id="toc-nut" href="#nut">21.55 nut</a></li>
  650. <li><a id="toc-ogg" href="#ogg">21.56 ogg</a></li>
  651. <li><a id="toc-rcwt-1" href="#rcwt-1">21.57 rcwt</a></li>
  652. <li><a id="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">21.58 segment, stream_segment, ssegment</a>
  653. <ul class="toc-numbered-mark">
  654. <li><a id="toc-Options-78" href="#Options-78">21.58.1 Options</a></li>
  655. <li><a id="toc-Examples-20" href="#Examples-20">21.58.2 Examples</a></li>
  656. </ul></li>
  657. <li><a id="toc-smoothstreaming" href="#smoothstreaming">21.59 smoothstreaming</a></li>
  658. <li><a id="toc-streamhash-1" href="#streamhash-1">21.60 streamhash</a>
  659. <ul class="toc-numbered-mark">
  660. <li><a id="toc-Examples-21" href="#Examples-21">21.60.1 Examples</a></li>
  661. </ul></li>
  662. <li><a id="toc-tee-1" href="#tee-1">21.61 tee</a>
  663. <ul class="toc-numbered-mark">
  664. <li><a id="toc-Options-79" href="#Options-79">21.61.1 Options</a></li>
  665. <li><a id="toc-Examples-22" href="#Examples-22">21.61.2 Examples</a></li>
  666. </ul></li>
  667. <li><a id="toc-webm_005fchunk" href="#webm_005fchunk">21.62 webm_chunk</a>
  668. <ul class="toc-numbered-mark">
  669. <li><a id="toc-Options-80" href="#Options-80">21.62.1 Options</a></li>
  670. <li><a id="toc-Example-9" href="#Example-9">21.62.2 Example</a></li>
  671. </ul></li>
  672. <li><a id="toc-webm_005fdash_005fmanifest" href="#webm_005fdash_005fmanifest">21.63 webm_dash_manifest</a>
  673. <ul class="toc-numbered-mark">
  674. <li><a id="toc-Options-81" href="#Options-81">21.63.1 Options</a></li>
  675. <li><a id="toc-Example-10" href="#Example-10">21.63.2 Example</a></li>
  676. </ul></li>
  677. </ul></li>
  678. <li><a id="toc-Metadata-1" href="#Metadata-1">22 Metadata</a></li>
  679. <li><a id="toc-Protocol-Options" href="#Protocol-Options">23 Protocol Options</a></li>
  680. <li><a id="toc-Protocols" href="#Protocols">24 Protocols</a>
  681. <ul class="toc-numbered-mark">
  682. <li><a id="toc-amqp" href="#amqp">24.1 amqp</a></li>
  683. <li><a id="toc-async" href="#async">24.2 async</a></li>
  684. <li><a id="toc-bluray" href="#bluray">24.3 bluray</a></li>
  685. <li><a id="toc-cache" href="#cache">24.4 cache</a></li>
  686. <li><a id="toc-concat-2" href="#concat-2">24.5 concat</a></li>
  687. <li><a id="toc-concatf" href="#concatf">24.6 concatf</a></li>
  688. <li><a id="toc-crypto" href="#crypto">24.7 crypto</a></li>
  689. <li><a id="toc-data" href="#data">24.8 data</a></li>
  690. <li><a id="toc-fd" href="#fd">24.9 fd</a></li>
  691. <li><a id="toc-file" href="#file">24.10 file</a></li>
  692. <li><a id="toc-ftp" href="#ftp">24.11 ftp</a></li>
  693. <li><a id="toc-gopher" href="#gopher">24.12 gopher</a></li>
  694. <li><a id="toc-gophers" href="#gophers">24.13 gophers</a></li>
  695. <li><a id="toc-hls-3" href="#hls-3">24.14 hls</a></li>
  696. <li><a id="toc-http" href="#http">24.15 http</a>
  697. <ul class="toc-numbered-mark">
  698. <li><a id="toc-HTTP-Cookies" href="#HTTP-Cookies">24.15.1 HTTP Cookies</a></li>
  699. </ul></li>
  700. <li><a id="toc-Icecast" href="#Icecast">24.16 Icecast</a></li>
  701. <li><a id="toc-ipfs" href="#ipfs">24.17 ipfs</a></li>
  702. <li><a id="toc-mmst" href="#mmst">24.18 mmst</a></li>
  703. <li><a id="toc-mmsh" href="#mmsh">24.19 mmsh</a></li>
  704. <li><a id="toc-md5-2" href="#md5-2">24.20 md5</a></li>
  705. <li><a id="toc-pipe" href="#pipe">24.21 pipe</a></li>
  706. <li><a id="toc-prompeg" href="#prompeg">24.22 prompeg</a></li>
  707. <li><a id="toc-rist" href="#rist">24.23 rist</a></li>
  708. <li><a id="toc-rtmp" href="#rtmp">24.24 rtmp</a></li>
  709. <li><a id="toc-rtmpe" href="#rtmpe">24.25 rtmpe</a></li>
  710. <li><a id="toc-rtmps" href="#rtmps">24.26 rtmps</a></li>
  711. <li><a id="toc-rtmpt" href="#rtmpt">24.27 rtmpt</a></li>
  712. <li><a id="toc-rtmpte" href="#rtmpte">24.28 rtmpte</a></li>
  713. <li><a id="toc-rtmpts" href="#rtmpts">24.29 rtmpts</a></li>
  714. <li><a id="toc-libsmbclient" href="#libsmbclient">24.30 libsmbclient</a></li>
  715. <li><a id="toc-libssh" href="#libssh">24.31 libssh</a></li>
  716. <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>
  717. <li><a id="toc-rtp" href="#rtp">24.33 rtp</a></li>
  718. <li><a id="toc-rtsp" href="#rtsp">24.34 rtsp</a>
  719. <ul class="toc-numbered-mark">
  720. <li><a id="toc-Muxer" href="#Muxer">24.34.1 Muxer</a></li>
  721. <li><a id="toc-Demuxer" href="#Demuxer">24.34.2 Demuxer</a></li>
  722. <li><a id="toc-Examples-23" href="#Examples-23">24.34.3 Examples</a></li>
  723. </ul></li>
  724. <li><a id="toc-sap" href="#sap">24.35 sap</a>
  725. <ul class="toc-numbered-mark">
  726. <li><a id="toc-Muxer-1" href="#Muxer-1">24.35.1 Muxer</a></li>
  727. <li><a id="toc-Demuxer-1" href="#Demuxer-1">24.35.2 Demuxer</a></li>
  728. </ul></li>
  729. <li><a id="toc-sctp" href="#sctp">24.36 sctp</a></li>
  730. <li><a id="toc-srt" href="#srt">24.37 srt</a></li>
  731. <li><a id="toc-srtp" href="#srtp">24.38 srtp</a></li>
  732. <li><a id="toc-subfile" href="#subfile">24.39 subfile</a></li>
  733. <li><a id="toc-tee-2" href="#tee-2">24.40 tee</a></li>
  734. <li><a id="toc-tcp" href="#tcp">24.41 tcp</a></li>
  735. <li><a id="toc-tls" href="#tls">24.42 tls</a></li>
  736. <li><a id="toc-udp" href="#udp">24.43 udp</a>
  737. <ul class="toc-numbered-mark">
  738. <li><a id="toc-Examples-24" href="#Examples-24">24.43.1 Examples</a></li>
  739. </ul></li>
  740. <li><a id="toc-unix" href="#unix">24.44 unix</a></li>
  741. <li><a id="toc-zmq" href="#zmq">24.45 zmq</a></li>
  742. </ul></li>
  743. <li><a id="toc-Device-Options" href="#Device-Options">25 Device Options</a></li>
  744. <li><a id="toc-Input-Devices" href="#Input-Devices">26 Input Devices</a>
  745. <ul class="toc-numbered-mark">
  746. <li><a id="toc-alsa" href="#alsa">26.1 alsa</a>
  747. <ul class="toc-numbered-mark">
  748. <li><a id="toc-Options-82" href="#Options-82">26.1.1 Options</a></li>
  749. </ul></li>
  750. <li><a id="toc-android_005fcamera" href="#android_005fcamera">26.2 android_camera</a>
  751. <ul class="toc-numbered-mark">
  752. <li><a id="toc-Options-83" href="#Options-83">26.2.1 Options</a></li>
  753. </ul></li>
  754. <li><a id="toc-avfoundation" href="#avfoundation">26.3 avfoundation</a>
  755. <ul class="toc-numbered-mark">
  756. <li><a id="toc-Options-84" href="#Options-84">26.3.1 Options</a></li>
  757. <li><a id="toc-Examples-25" href="#Examples-25">26.3.2 Examples</a></li>
  758. </ul></li>
  759. <li><a id="toc-bktr" href="#bktr">26.4 bktr</a>
  760. <ul class="toc-numbered-mark">
  761. <li><a id="toc-Options-85" href="#Options-85">26.4.1 Options</a></li>
  762. </ul></li>
  763. <li><a id="toc-decklink" href="#decklink">26.5 decklink</a>
  764. <ul class="toc-numbered-mark">
  765. <li><a id="toc-Options-86" href="#Options-86">26.5.1 Options</a></li>
  766. <li><a id="toc-Examples-26" href="#Examples-26">26.5.2 Examples</a></li>
  767. </ul></li>
  768. <li><a id="toc-dshow" href="#dshow">26.6 dshow</a>
  769. <ul class="toc-numbered-mark">
  770. <li><a id="toc-Options-87" href="#Options-87">26.6.1 Options</a></li>
  771. <li><a id="toc-Examples-27" href="#Examples-27">26.6.2 Examples</a></li>
  772. </ul></li>
  773. <li><a id="toc-fbdev" href="#fbdev">26.7 fbdev</a>
  774. <ul class="toc-numbered-mark">
  775. <li><a id="toc-Options-88" href="#Options-88">26.7.1 Options</a></li>
  776. </ul></li>
  777. <li><a id="toc-gdigrab" href="#gdigrab">26.8 gdigrab</a>
  778. <ul class="toc-numbered-mark">
  779. <li><a id="toc-Options-89" href="#Options-89">26.8.1 Options</a></li>
  780. </ul></li>
  781. <li><a id="toc-iec61883" href="#iec61883">26.9 iec61883</a>
  782. <ul class="toc-numbered-mark">
  783. <li><a id="toc-Options-90" href="#Options-90">26.9.1 Options</a></li>
  784. <li><a id="toc-Examples-28" href="#Examples-28">26.9.2 Examples</a></li>
  785. </ul></li>
  786. <li><a id="toc-jack" href="#jack">26.10 jack</a>
  787. <ul class="toc-numbered-mark">
  788. <li><a id="toc-Options-91" href="#Options-91">26.10.1 Options</a></li>
  789. </ul></li>
  790. <li><a id="toc-kmsgrab" href="#kmsgrab">26.11 kmsgrab</a>
  791. <ul class="toc-numbered-mark">
  792. <li><a id="toc-Options-92" href="#Options-92">26.11.1 Options</a></li>
  793. <li><a id="toc-Examples-29" href="#Examples-29">26.11.2 Examples</a></li>
  794. </ul></li>
  795. <li><a id="toc-lavfi" href="#lavfi">26.12 lavfi</a>
  796. <ul class="toc-numbered-mark">
  797. <li><a id="toc-Options-93" href="#Options-93">26.12.1 Options</a></li>
  798. <li><a id="toc-Examples-30" href="#Examples-30">26.12.2 Examples</a></li>
  799. </ul></li>
  800. <li><a id="toc-libcdio" href="#libcdio">26.13 libcdio</a>
  801. <ul class="toc-numbered-mark">
  802. <li><a id="toc-Options-94" href="#Options-94">26.13.1 Options</a></li>
  803. </ul></li>
  804. <li><a id="toc-libdc1394" href="#libdc1394">26.14 libdc1394</a>
  805. <ul class="toc-numbered-mark">
  806. <li><a id="toc-Options-95" href="#Options-95">26.14.1 Options</a></li>
  807. </ul></li>
  808. <li><a id="toc-openal" href="#openal">26.15 openal</a>
  809. <ul class="toc-numbered-mark">
  810. <li><a id="toc-Options-96" href="#Options-96">26.15.1 Options</a></li>
  811. <li><a id="toc-Examples-31" href="#Examples-31">26.15.2 Examples</a></li>
  812. </ul></li>
  813. <li><a id="toc-oss" href="#oss">26.16 oss</a>
  814. <ul class="toc-numbered-mark">
  815. <li><a id="toc-Options-97" href="#Options-97">26.16.1 Options</a></li>
  816. </ul></li>
  817. <li><a id="toc-pulse" href="#pulse">26.17 pulse</a>
  818. <ul class="toc-numbered-mark">
  819. <li><a id="toc-Options-98" href="#Options-98">26.17.1 Options</a></li>
  820. <li><a id="toc-Examples-32" href="#Examples-32">26.17.2 Examples</a></li>
  821. </ul></li>
  822. <li><a id="toc-sndio" href="#sndio">26.18 sndio</a>
  823. <ul class="toc-numbered-mark">
  824. <li><a id="toc-Options-99" href="#Options-99">26.18.1 Options</a></li>
  825. </ul></li>
  826. <li><a id="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">26.19 video4linux2, v4l2</a>
  827. <ul class="toc-numbered-mark">
  828. <li><a id="toc-Options-100" href="#Options-100">26.19.1 Options</a></li>
  829. </ul></li>
  830. <li><a id="toc-vfwcap" href="#vfwcap">26.20 vfwcap</a>
  831. <ul class="toc-numbered-mark">
  832. <li><a id="toc-Options-101" href="#Options-101">26.20.1 Options</a></li>
  833. </ul></li>
  834. <li><a id="toc-x11grab" href="#x11grab">26.21 x11grab</a>
  835. <ul class="toc-numbered-mark">
  836. <li><a id="toc-Options-102" href="#Options-102">26.21.1 Options</a></li>
  837. </ul></li>
  838. </ul></li>
  839. <li><a id="toc-Output-Devices" href="#Output-Devices">27 Output Devices</a>
  840. <ul class="toc-numbered-mark">
  841. <li><a id="toc-alsa-1" href="#alsa-1">27.1 alsa</a>
  842. <ul class="toc-numbered-mark">
  843. <li><a id="toc-Examples-33" href="#Examples-33">27.1.1 Examples</a></li>
  844. </ul></li>
  845. <li><a id="toc-AudioToolbox" href="#AudioToolbox">27.2 AudioToolbox</a>
  846. <ul class="toc-numbered-mark">
  847. <li><a id="toc-Options-103" href="#Options-103">27.2.1 Options</a></li>
  848. <li><a id="toc-Examples-34" href="#Examples-34">27.2.2 Examples</a></li>
  849. </ul></li>
  850. <li><a id="toc-caca" href="#caca">27.3 caca</a>
  851. <ul class="toc-numbered-mark">
  852. <li><a id="toc-Options-104" href="#Options-104">27.3.1 Options</a></li>
  853. <li><a id="toc-Examples-35" href="#Examples-35">27.3.2 Examples</a></li>
  854. </ul></li>
  855. <li><a id="toc-decklink-1" href="#decklink-1">27.4 decklink</a>
  856. <ul class="toc-numbered-mark">
  857. <li><a id="toc-Options-105" href="#Options-105">27.4.1 Options</a></li>
  858. <li><a id="toc-Examples-36" href="#Examples-36">27.4.2 Examples</a></li>
  859. </ul></li>
  860. <li><a id="toc-fbdev-1" href="#fbdev-1">27.5 fbdev</a>
  861. <ul class="toc-numbered-mark">
  862. <li><a id="toc-Options-106" href="#Options-106">27.5.1 Options</a></li>
  863. <li><a id="toc-Examples-37" href="#Examples-37">27.5.2 Examples</a></li>
  864. </ul></li>
  865. <li><a id="toc-opengl" href="#opengl">27.6 opengl</a>
  866. <ul class="toc-numbered-mark">
  867. <li><a id="toc-Options-107" href="#Options-107">27.6.1 Options</a></li>
  868. <li><a id="toc-Examples-38" href="#Examples-38">27.6.2 Examples</a></li>
  869. </ul></li>
  870. <li><a id="toc-oss-1" href="#oss-1">27.7 oss</a></li>
  871. <li><a id="toc-pulse-1" href="#pulse-1">27.8 pulse</a>
  872. <ul class="toc-numbered-mark">
  873. <li><a id="toc-Options-108" href="#Options-108">27.8.1 Options</a></li>
  874. <li><a id="toc-Examples-39" href="#Examples-39">27.8.2 Examples</a></li>
  875. </ul></li>
  876. <li><a id="toc-sdl" href="#sdl">27.9 sdl</a>
  877. <ul class="toc-numbered-mark">
  878. <li><a id="toc-Options-109" href="#Options-109">27.9.1 Options</a></li>
  879. <li><a id="toc-Interactive-commands" href="#Interactive-commands">27.9.2 Interactive commands</a></li>
  880. <li><a id="toc-Examples-40" href="#Examples-40">27.9.3 Examples</a></li>
  881. </ul></li>
  882. <li><a id="toc-sndio-1" href="#sndio-1">27.10 sndio</a></li>
  883. <li><a id="toc-v4l2" href="#v4l2">27.11 v4l2</a></li>
  884. <li><a id="toc-xv" href="#xv">27.12 xv</a>
  885. <ul class="toc-numbered-mark">
  886. <li><a id="toc-Options-110" href="#Options-110">27.12.1 Options</a></li>
  887. <li><a id="toc-Examples-41" href="#Examples-41">27.12.2 Examples</a></li>
  888. </ul></li>
  889. </ul></li>
  890. <li><a id="toc-Resampler-Options" href="#Resampler-Options">28 Resampler Options</a></li>
  891. <li><a id="toc-Scaler-Options" href="#Scaler-Options">29 Scaler Options</a></li>
  892. <li><a id="toc-Filtering-Introduction" href="#Filtering-Introduction">30 Filtering Introduction</a></li>
  893. <li><a id="toc-graph2dot" href="#graph2dot">31 graph2dot</a></li>
  894. <li><a id="toc-Filtergraph-description" href="#Filtergraph-description">32 Filtergraph description</a>
  895. <ul class="toc-numbered-mark">
  896. <li><a id="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">32.1 Filtergraph syntax</a></li>
  897. <li><a id="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></li>
  898. </ul></li>
  899. <li><a id="toc-Timeline-editing" href="#Timeline-editing">33 Timeline editing</a></li>
  900. <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>
  901. <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>
  902. <li><a id="toc-Audio-Filters" href="#Audio-Filters">36 Audio Filters</a>
  903. <ul class="toc-numbered-mark">
  904. <li><a id="toc-aap" href="#aap">36.1 aap</a></li>
  905. <li><a id="toc-acompressor" href="#acompressor">36.2 acompressor</a>
  906. <ul class="toc-numbered-mark">
  907. <li><a id="toc-Commands" href="#Commands">36.2.1 Commands</a></li>
  908. </ul></li>
  909. <li><a id="toc-acontrast" href="#acontrast">36.3 acontrast</a></li>
  910. <li><a id="toc-acopy" href="#acopy">36.4 acopy</a></li>
  911. <li><a id="toc-acrossfade" href="#acrossfade">36.5 acrossfade</a>
  912. <ul class="toc-numbered-mark">
  913. <li><a id="toc-Examples-42" href="#Examples-42">36.5.1 Examples</a></li>
  914. </ul></li>
  915. <li><a id="toc-acrossover" href="#acrossover">36.6 acrossover</a>
  916. <ul class="toc-numbered-mark">
  917. <li><a id="toc-Examples-43" href="#Examples-43">36.6.1 Examples</a></li>
  918. </ul></li>
  919. <li><a id="toc-acrusher" href="#acrusher">36.7 acrusher</a>
  920. <ul class="toc-numbered-mark">
  921. <li><a id="toc-Commands-1" href="#Commands-1">36.7.1 Commands</a></li>
  922. </ul></li>
  923. <li><a id="toc-acue" href="#acue">36.8 acue</a></li>
  924. <li><a id="toc-adeclick" href="#adeclick">36.9 adeclick</a></li>
  925. <li><a id="toc-adeclip" href="#adeclip">36.10 adeclip</a></li>
  926. <li><a id="toc-adecorrelate" href="#adecorrelate">36.11 adecorrelate</a></li>
  927. <li><a id="toc-adelay" href="#adelay">36.12 adelay</a>
  928. <ul class="toc-numbered-mark">
  929. <li><a id="toc-Examples-44" href="#Examples-44">36.12.1 Examples</a></li>
  930. </ul></li>
  931. <li><a id="toc-adenorm" href="#adenorm">36.13 adenorm</a>
  932. <ul class="toc-numbered-mark">
  933. <li><a id="toc-Commands-2" href="#Commands-2">36.13.1 Commands</a></li>
  934. </ul></li>
  935. <li><a id="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">36.14 aderivative, aintegral</a></li>
  936. <li><a id="toc-adrc" href="#adrc">36.15 adrc</a>
  937. <ul class="toc-numbered-mark">
  938. <li><a id="toc-Commands-3" href="#Commands-3">36.15.1 Commands</a></li>
  939. <li><a id="toc-Examples-45" href="#Examples-45">36.15.2 Examples</a></li>
  940. </ul></li>
  941. <li><a id="toc-adynamicequalizer" href="#adynamicequalizer">36.16 adynamicequalizer</a>
  942. <ul class="toc-numbered-mark">
  943. <li><a id="toc-Commands-4" href="#Commands-4">36.16.1 Commands</a></li>
  944. </ul></li>
  945. <li><a id="toc-adynamicsmooth" href="#adynamicsmooth">36.17 adynamicsmooth</a>
  946. <ul class="toc-numbered-mark">
  947. <li><a id="toc-Commands-5" href="#Commands-5">36.17.1 Commands</a></li>
  948. </ul></li>
  949. <li><a id="toc-aecho" href="#aecho">36.18 aecho</a>
  950. <ul class="toc-numbered-mark">
  951. <li><a id="toc-Examples-46" href="#Examples-46">36.18.1 Examples</a></li>
  952. </ul></li>
  953. <li><a id="toc-aemphasis" href="#aemphasis">36.19 aemphasis</a>
  954. <ul class="toc-numbered-mark">
  955. <li><a id="toc-Commands-6" href="#Commands-6">36.19.1 Commands</a></li>
  956. </ul></li>
  957. <li><a id="toc-aeval" href="#aeval">36.20 aeval</a>
  958. <ul class="toc-numbered-mark">
  959. <li><a id="toc-Examples-47" href="#Examples-47">36.20.1 Examples</a></li>
  960. </ul></li>
  961. <li><a id="toc-aexciter" href="#aexciter">36.21 aexciter</a>
  962. <ul class="toc-numbered-mark">
  963. <li><a id="toc-Commands-7" href="#Commands-7">36.21.1 Commands</a></li>
  964. </ul></li>
  965. <li><a id="toc-afade-1" href="#afade-1">36.22 afade</a>
  966. <ul class="toc-numbered-mark">
  967. <li><a id="toc-Commands-8" href="#Commands-8">36.22.1 Commands</a></li>
  968. <li><a id="toc-Examples-48" href="#Examples-48">36.22.2 Examples</a></li>
  969. </ul></li>
  970. <li><a id="toc-afftdn" href="#afftdn">36.23 afftdn</a>
  971. <ul class="toc-numbered-mark">
  972. <li><a id="toc-Commands-9" href="#Commands-9">36.23.1 Commands</a></li>
  973. <li><a id="toc-Examples-49" href="#Examples-49">36.23.2 Examples</a></li>
  974. </ul></li>
  975. <li><a id="toc-afftfilt" href="#afftfilt">36.24 afftfilt</a>
  976. <ul class="toc-numbered-mark">
  977. <li><a id="toc-Examples-50" href="#Examples-50">36.24.1 Examples</a></li>
  978. </ul></li>
  979. <li><a id="toc-afir-1" href="#afir-1">36.25 afir</a>
  980. <ul class="toc-numbered-mark">
  981. <li><a id="toc-Examples-51" href="#Examples-51">36.25.1 Examples</a></li>
  982. </ul></li>
  983. <li><a id="toc-aformat-1" href="#aformat-1">36.26 aformat</a></li>
  984. <li><a id="toc-afreqshift" href="#afreqshift">36.27 afreqshift</a>
  985. <ul class="toc-numbered-mark">
  986. <li><a id="toc-Commands-10" href="#Commands-10">36.27.1 Commands</a></li>
  987. </ul></li>
  988. <li><a id="toc-afwtdn" href="#afwtdn">36.28 afwtdn</a>
  989. <ul class="toc-numbered-mark">
  990. <li><a id="toc-Commands-11" href="#Commands-11">36.28.1 Commands</a></li>
  991. </ul></li>
  992. <li><a id="toc-agate" href="#agate">36.29 agate</a>
  993. <ul class="toc-numbered-mark">
  994. <li><a id="toc-Commands-12" href="#Commands-12">36.29.1 Commands</a></li>
  995. </ul></li>
  996. <li><a id="toc-aiir" href="#aiir">36.30 aiir</a>
  997. <ul class="toc-numbered-mark">
  998. <li><a id="toc-Examples-52" href="#Examples-52">36.30.1 Examples</a></li>
  999. </ul></li>
  1000. <li><a id="toc-alimiter" href="#alimiter">36.31 alimiter</a></li>
  1001. <li><a id="toc-allpass" href="#allpass">36.32 allpass</a>
  1002. <ul class="toc-numbered-mark">
  1003. <li><a id="toc-Commands-13" href="#Commands-13">36.32.1 Commands</a></li>
  1004. </ul></li>
  1005. <li><a id="toc-aloop" href="#aloop">36.33 aloop</a></li>
  1006. <li><a id="toc-amerge-1" href="#amerge-1">36.34 amerge</a>
  1007. <ul class="toc-numbered-mark">
  1008. <li><a id="toc-Examples-53" href="#Examples-53">36.34.1 Examples</a></li>
  1009. </ul></li>
  1010. <li><a id="toc-amix" href="#amix">36.35 amix</a>
  1011. <ul class="toc-numbered-mark">
  1012. <li><a id="toc-Examples-54" href="#Examples-54">36.35.1 Examples</a></li>
  1013. <li><a id="toc-Commands-14" href="#Commands-14">36.35.2 Commands</a></li>
  1014. </ul></li>
  1015. <li><a id="toc-amultiply" href="#amultiply">36.36 amultiply</a></li>
  1016. <li><a id="toc-anequalizer" href="#anequalizer">36.37 anequalizer</a>
  1017. <ul class="toc-numbered-mark">
  1018. <li><a id="toc-Examples-55" href="#Examples-55">36.37.1 Examples</a></li>
  1019. <li><a id="toc-Commands-15" href="#Commands-15">36.37.2 Commands</a></li>
  1020. </ul></li>
  1021. <li><a id="toc-anlmdn" href="#anlmdn">36.38 anlmdn</a>
  1022. <ul class="toc-numbered-mark">
  1023. <li><a id="toc-Commands-16" href="#Commands-16">36.38.1 Commands</a></li>
  1024. </ul></li>
  1025. <li><a id="toc-anlmf_002c-anlms" href="#anlmf_002c-anlms">36.39 anlmf, anlms</a>
  1026. <ul class="toc-numbered-mark">
  1027. <li><a id="toc-Examples-56" href="#Examples-56">36.39.1 Examples</a></li>
  1028. <li><a id="toc-Commands-17" href="#Commands-17">36.39.2 Commands</a></li>
  1029. </ul></li>
  1030. <li><a id="toc-anull" href="#anull">36.40 anull</a></li>
  1031. <li><a id="toc-apad" href="#apad">36.41 apad</a>
  1032. <ul class="toc-numbered-mark">
  1033. <li><a id="toc-Examples-57" href="#Examples-57">36.41.1 Examples</a></li>
  1034. </ul></li>
  1035. <li><a id="toc-aphaser" href="#aphaser">36.42 aphaser</a></li>
  1036. <li><a id="toc-aphaseshift" href="#aphaseshift">36.43 aphaseshift</a>
  1037. <ul class="toc-numbered-mark">
  1038. <li><a id="toc-Commands-18" href="#Commands-18">36.43.1 Commands</a></li>
  1039. </ul></li>
  1040. <li><a id="toc-apsnr" href="#apsnr">36.44 apsnr</a></li>
  1041. <li><a id="toc-apsyclip" href="#apsyclip">36.45 apsyclip</a>
  1042. <ul class="toc-numbered-mark">
  1043. <li><a id="toc-Commands-19" href="#Commands-19">36.45.1 Commands</a></li>
  1044. </ul></li>
  1045. <li><a id="toc-apulsator" href="#apulsator">36.46 apulsator</a></li>
  1046. <li><a id="toc-aresample-1" href="#aresample-1">36.47 aresample</a>
  1047. <ul class="toc-numbered-mark">
  1048. <li><a id="toc-Examples-58" href="#Examples-58">36.47.1 Examples</a></li>
  1049. </ul></li>
  1050. <li><a id="toc-areverse" href="#areverse">36.48 areverse</a>
  1051. <ul class="toc-numbered-mark">
  1052. <li><a id="toc-Examples-59" href="#Examples-59">36.48.1 Examples</a></li>
  1053. </ul></li>
  1054. <li><a id="toc-arls" href="#arls">36.49 arls</a></li>
  1055. <li><a id="toc-arnndn" href="#arnndn">36.50 arnndn</a>
  1056. <ul class="toc-numbered-mark">
  1057. <li><a id="toc-Commands-20" href="#Commands-20">36.50.1 Commands</a></li>
  1058. </ul></li>
  1059. <li><a id="toc-asdr" href="#asdr">36.51 asdr</a></li>
  1060. <li><a id="toc-asetnsamples" href="#asetnsamples">36.52 asetnsamples</a></li>
  1061. <li><a id="toc-asetrate" href="#asetrate">36.53 asetrate</a></li>
  1062. <li><a id="toc-ashowinfo" href="#ashowinfo">36.54 ashowinfo</a></li>
  1063. <li><a id="toc-asisdr" href="#asisdr">36.55 asisdr</a></li>
  1064. <li><a id="toc-asoftclip" href="#asoftclip">36.56 asoftclip</a>
  1065. <ul class="toc-numbered-mark">
  1066. <li><a id="toc-Commands-21" href="#Commands-21">36.56.1 Commands</a></li>
  1067. </ul></li>
  1068. <li><a id="toc-aspectralstats" href="#aspectralstats">36.57 aspectralstats</a></li>
  1069. <li><a id="toc-asr" href="#asr">36.58 asr</a></li>
  1070. <li><a id="toc-astats-1" href="#astats-1">36.59 astats</a></li>
  1071. <li><a id="toc-asubboost" href="#asubboost">36.60 asubboost</a>
  1072. <ul class="toc-numbered-mark">
  1073. <li><a id="toc-Commands-22" href="#Commands-22">36.60.1 Commands</a></li>
  1074. </ul></li>
  1075. <li><a id="toc-asubcut" href="#asubcut">36.61 asubcut</a>
  1076. <ul class="toc-numbered-mark">
  1077. <li><a id="toc-Commands-23" href="#Commands-23">36.61.1 Commands</a></li>
  1078. </ul></li>
  1079. <li><a id="toc-asupercut" href="#asupercut">36.62 asupercut</a>
  1080. <ul class="toc-numbered-mark">
  1081. <li><a id="toc-Commands-24" href="#Commands-24">36.62.1 Commands</a></li>
  1082. </ul></li>
  1083. <li><a id="toc-asuperpass" href="#asuperpass">36.63 asuperpass</a>
  1084. <ul class="toc-numbered-mark">
  1085. <li><a id="toc-Commands-25" href="#Commands-25">36.63.1 Commands</a></li>
  1086. </ul></li>
  1087. <li><a id="toc-asuperstop" href="#asuperstop">36.64 asuperstop</a>
  1088. <ul class="toc-numbered-mark">
  1089. <li><a id="toc-Commands-26" href="#Commands-26">36.64.1 Commands</a></li>
  1090. </ul></li>
  1091. <li><a id="toc-atempo" href="#atempo">36.65 atempo</a>
  1092. <ul class="toc-numbered-mark">
  1093. <li><a id="toc-Examples-60" href="#Examples-60">36.65.1 Examples</a></li>
  1094. <li><a id="toc-Commands-27" href="#Commands-27">36.65.2 Commands</a></li>
  1095. </ul></li>
  1096. <li><a id="toc-atilt" href="#atilt">36.66 atilt</a>
  1097. <ul class="toc-numbered-mark">
  1098. <li><a id="toc-Commands-28" href="#Commands-28">36.66.1 Commands</a></li>
  1099. </ul></li>
  1100. <li><a id="toc-atrim" href="#atrim">36.67 atrim</a></li>
  1101. <li><a id="toc-axcorrelate" href="#axcorrelate">36.68 axcorrelate</a>
  1102. <ul class="toc-numbered-mark">
  1103. <li><a id="toc-Examples-61" href="#Examples-61">36.68.1 Examples</a></li>
  1104. </ul></li>
  1105. <li><a id="toc-bandpass" href="#bandpass">36.69 bandpass</a>
  1106. <ul class="toc-numbered-mark">
  1107. <li><a id="toc-Commands-29" href="#Commands-29">36.69.1 Commands</a></li>
  1108. </ul></li>
  1109. <li><a id="toc-bandreject" href="#bandreject">36.70 bandreject</a>
  1110. <ul class="toc-numbered-mark">
  1111. <li><a id="toc-Commands-30" href="#Commands-30">36.70.1 Commands</a></li>
  1112. </ul></li>
  1113. <li><a id="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">36.71 bass, lowshelf</a>
  1114. <ul class="toc-numbered-mark">
  1115. <li><a id="toc-Commands-31" href="#Commands-31">36.71.1 Commands</a></li>
  1116. </ul></li>
  1117. <li><a id="toc-biquad" href="#biquad">36.72 biquad</a>
  1118. <ul class="toc-numbered-mark">
  1119. <li><a id="toc-Commands-32" href="#Commands-32">36.72.1 Commands</a></li>
  1120. </ul></li>
  1121. <li><a id="toc-bs2b" href="#bs2b">36.73 bs2b</a></li>
  1122. <li><a id="toc-channelmap" href="#channelmap">36.74 channelmap</a>
  1123. <ul class="toc-numbered-mark">
  1124. <li><a id="toc-Examples-62" href="#Examples-62">36.74.1 Examples</a></li>
  1125. </ul></li>
  1126. <li><a id="toc-channelsplit" href="#channelsplit">36.75 channelsplit</a>
  1127. <ul class="toc-numbered-mark">
  1128. <li><a id="toc-Examples-63" href="#Examples-63">36.75.1 Examples</a></li>
  1129. </ul></li>
  1130. <li><a id="toc-chorus" href="#chorus">36.76 chorus</a>
  1131. <ul class="toc-numbered-mark">
  1132. <li><a id="toc-Examples-64" href="#Examples-64">36.76.1 Examples</a></li>
  1133. </ul></li>
  1134. <li><a id="toc-compand" href="#compand">36.77 compand</a>
  1135. <ul class="toc-numbered-mark">
  1136. <li><a id="toc-Examples-65" href="#Examples-65">36.77.1 Examples</a></li>
  1137. </ul></li>
  1138. <li><a id="toc-compensationdelay" href="#compensationdelay">36.78 compensationdelay</a>
  1139. <ul class="toc-numbered-mark">
  1140. <li><a id="toc-Commands-33" href="#Commands-33">36.78.1 Commands</a></li>
  1141. </ul></li>
  1142. <li><a id="toc-crossfeed" href="#crossfeed">36.79 crossfeed</a>
  1143. <ul class="toc-numbered-mark">
  1144. <li><a id="toc-Commands-34" href="#Commands-34">36.79.1 Commands</a></li>
  1145. </ul></li>
  1146. <li><a id="toc-crystalizer" href="#crystalizer">36.80 crystalizer</a>
  1147. <ul class="toc-numbered-mark">
  1148. <li><a id="toc-Commands-35" href="#Commands-35">36.80.1 Commands</a></li>
  1149. </ul></li>
  1150. <li><a id="toc-dcshift" href="#dcshift">36.81 dcshift</a></li>
  1151. <li><a id="toc-deesser" href="#deesser">36.82 deesser</a></li>
  1152. <li><a id="toc-dialoguenhance" href="#dialoguenhance">36.83 dialoguenhance</a>
  1153. <ul class="toc-numbered-mark">
  1154. <li><a id="toc-Commands-36" href="#Commands-36">36.83.1 Commands</a></li>
  1155. </ul></li>
  1156. <li><a id="toc-drmeter" href="#drmeter">36.84 drmeter</a></li>
  1157. <li><a id="toc-dynaudnorm" href="#dynaudnorm">36.85 dynaudnorm</a>
  1158. <ul class="toc-numbered-mark">
  1159. <li><a id="toc-Commands-37" href="#Commands-37">36.85.1 Commands</a></li>
  1160. </ul></li>
  1161. <li><a id="toc-earwax" href="#earwax">36.86 earwax</a></li>
  1162. <li><a id="toc-equalizer" href="#equalizer">36.87 equalizer</a>
  1163. <ul class="toc-numbered-mark">
  1164. <li><a id="toc-Examples-66" href="#Examples-66">36.87.1 Examples</a></li>
  1165. <li><a id="toc-Commands-38" href="#Commands-38">36.87.2 Commands</a></li>
  1166. </ul></li>
  1167. <li><a id="toc-extrastereo" href="#extrastereo">36.88 extrastereo</a>
  1168. <ul class="toc-numbered-mark">
  1169. <li><a id="toc-Commands-39" href="#Commands-39">36.88.1 Commands</a></li>
  1170. </ul></li>
  1171. <li><a id="toc-firequalizer" href="#firequalizer">36.89 firequalizer</a>
  1172. <ul class="toc-numbered-mark">
  1173. <li><a id="toc-Examples-67" href="#Examples-67">36.89.1 Examples</a></li>
  1174. </ul></li>
  1175. <li><a id="toc-flanger" href="#flanger">36.90 flanger</a></li>
  1176. <li><a id="toc-haas" href="#haas">36.91 haas</a></li>
  1177. <li><a id="toc-hdcd" href="#hdcd">36.92 hdcd</a></li>
  1178. <li><a id="toc-headphone" href="#headphone">36.93 headphone</a>
  1179. <ul class="toc-numbered-mark">
  1180. <li><a id="toc-Examples-68" href="#Examples-68">36.93.1 Examples</a></li>
  1181. </ul></li>
  1182. <li><a id="toc-highpass" href="#highpass">36.94 highpass</a>
  1183. <ul class="toc-numbered-mark">
  1184. <li><a id="toc-Commands-40" href="#Commands-40">36.94.1 Commands</a></li>
  1185. </ul></li>
  1186. <li><a id="toc-join" href="#join">36.95 join</a></li>
  1187. <li><a id="toc-ladspa" href="#ladspa">36.96 ladspa</a>
  1188. <ul class="toc-numbered-mark">
  1189. <li><a id="toc-Examples-69" href="#Examples-69">36.96.1 Examples</a></li>
  1190. <li><a id="toc-Commands-41" href="#Commands-41">36.96.2 Commands</a></li>
  1191. </ul></li>
  1192. <li><a id="toc-loudnorm" href="#loudnorm">36.97 loudnorm</a></li>
  1193. <li><a id="toc-lowpass" href="#lowpass">36.98 lowpass</a>
  1194. <ul class="toc-numbered-mark">
  1195. <li><a id="toc-Examples-70" href="#Examples-70">36.98.1 Examples</a></li>
  1196. <li><a id="toc-Commands-42" href="#Commands-42">36.98.2 Commands</a></li>
  1197. </ul></li>
  1198. <li><a id="toc-lv2" href="#lv2">36.99 lv2</a>
  1199. <ul class="toc-numbered-mark">
  1200. <li><a id="toc-Examples-71" href="#Examples-71">36.99.1 Examples</a></li>
  1201. <li><a id="toc-Commands-43" href="#Commands-43">36.99.2 Commands</a></li>
  1202. </ul></li>
  1203. <li><a id="toc-mcompand" href="#mcompand">36.100 mcompand</a></li>
  1204. <li><a id="toc-pan-1" href="#pan-1">36.101 pan</a>
  1205. <ul class="toc-numbered-mark">
  1206. <li><a id="toc-Mixing-examples" href="#Mixing-examples">36.101.1 Mixing examples</a></li>
  1207. <li><a id="toc-Remapping-examples" href="#Remapping-examples">36.101.2 Remapping examples</a></li>
  1208. </ul></li>
  1209. <li><a id="toc-replaygain" href="#replaygain">36.102 replaygain</a></li>
  1210. <li><a id="toc-resample" href="#resample">36.103 resample</a></li>
  1211. <li><a id="toc-rubberband" href="#rubberband">36.104 rubberband</a>
  1212. <ul class="toc-numbered-mark">
  1213. <li><a id="toc-Commands-44" href="#Commands-44">36.104.1 Commands</a></li>
  1214. </ul></li>
  1215. <li><a id="toc-sidechaincompress" href="#sidechaincompress">36.105 sidechaincompress</a>
  1216. <ul class="toc-numbered-mark">
  1217. <li><a id="toc-Commands-45" href="#Commands-45">36.105.1 Commands</a></li>
  1218. <li><a id="toc-Examples-72" href="#Examples-72">36.105.2 Examples</a></li>
  1219. </ul></li>
  1220. <li><a id="toc-sidechaingate" href="#sidechaingate">36.106 sidechaingate</a>
  1221. <ul class="toc-numbered-mark">
  1222. <li><a id="toc-Commands-46" href="#Commands-46">36.106.1 Commands</a></li>
  1223. </ul></li>
  1224. <li><a id="toc-silencedetect" href="#silencedetect">36.107 silencedetect</a>
  1225. <ul class="toc-numbered-mark">
  1226. <li><a id="toc-Examples-73" href="#Examples-73">36.107.1 Examples</a></li>
  1227. </ul></li>
  1228. <li><a id="toc-silenceremove" href="#silenceremove">36.108 silenceremove</a>
  1229. <ul class="toc-numbered-mark">
  1230. <li><a id="toc-Examples-74" href="#Examples-74">36.108.1 Examples</a></li>
  1231. <li><a id="toc-Commands-47" href="#Commands-47">36.108.2 Commands</a></li>
  1232. </ul></li>
  1233. <li><a id="toc-sofalizer" href="#sofalizer">36.109 sofalizer</a>
  1234. <ul class="toc-numbered-mark">
  1235. <li><a id="toc-Examples-75" href="#Examples-75">36.109.1 Examples</a></li>
  1236. </ul></li>
  1237. <li><a id="toc-speechnorm" href="#speechnorm">36.110 speechnorm</a>
  1238. <ul class="toc-numbered-mark">
  1239. <li><a id="toc-Commands-48" href="#Commands-48">36.110.1 Commands</a></li>
  1240. <li><a id="toc-Examples-76" href="#Examples-76">36.110.2 Examples</a></li>
  1241. </ul></li>
  1242. <li><a id="toc-stereotools" href="#stereotools">36.111 stereotools</a>
  1243. <ul class="toc-numbered-mark">
  1244. <li><a id="toc-Commands-49" href="#Commands-49">36.111.1 Commands</a></li>
  1245. <li><a id="toc-Examples-77" href="#Examples-77">36.111.2 Examples</a></li>
  1246. </ul></li>
  1247. <li><a id="toc-stereowiden" href="#stereowiden">36.112 stereowiden</a>
  1248. <ul class="toc-numbered-mark">
  1249. <li><a id="toc-Commands-50" href="#Commands-50">36.112.1 Commands</a></li>
  1250. </ul></li>
  1251. <li><a id="toc-superequalizer" href="#superequalizer">36.113 superequalizer</a></li>
  1252. <li><a id="toc-surround" href="#surround">36.114 surround</a></li>
  1253. <li><a id="toc-tiltshelf" href="#tiltshelf">36.115 tiltshelf</a>
  1254. <ul class="toc-numbered-mark">
  1255. <li><a id="toc-Commands-51" href="#Commands-51">36.115.1 Commands</a></li>
  1256. </ul></li>
  1257. <li><a id="toc-treble_002c-highshelf" href="#treble_002c-highshelf">36.116 treble, highshelf</a>
  1258. <ul class="toc-numbered-mark">
  1259. <li><a id="toc-Commands-52" href="#Commands-52">36.116.1 Commands</a></li>
  1260. </ul></li>
  1261. <li><a id="toc-tremolo" href="#tremolo">36.117 tremolo</a></li>
  1262. <li><a id="toc-vibrato" href="#vibrato">36.118 vibrato</a></li>
  1263. <li><a id="toc-virtualbass" href="#virtualbass">36.119 virtualbass</a></li>
  1264. <li><a id="toc-volume" href="#volume">36.120 volume</a>
  1265. <ul class="toc-numbered-mark">
  1266. <li><a id="toc-Commands-53" href="#Commands-53">36.120.1 Commands</a></li>
  1267. <li><a id="toc-Examples-78" href="#Examples-78">36.120.2 Examples</a></li>
  1268. </ul></li>
  1269. <li><a id="toc-volumedetect" href="#volumedetect">36.121 volumedetect</a>
  1270. <ul class="toc-numbered-mark">
  1271. <li><a id="toc-Examples-79" href="#Examples-79">36.121.1 Examples</a></li>
  1272. </ul></li>
  1273. </ul></li>
  1274. <li><a id="toc-Audio-Sources" href="#Audio-Sources">37 Audio Sources</a>
  1275. <ul class="toc-numbered-mark">
  1276. <li><a id="toc-abuffer" href="#abuffer">37.1 abuffer</a>
  1277. <ul class="toc-numbered-mark">
  1278. <li><a id="toc-Examples-80" href="#Examples-80">37.1.1 Examples</a></li>
  1279. </ul></li>
  1280. <li><a id="toc-aevalsrc" href="#aevalsrc">37.2 aevalsrc</a>
  1281. <ul class="toc-numbered-mark">
  1282. <li><a id="toc-Examples-81" href="#Examples-81">37.2.1 Examples</a></li>
  1283. </ul></li>
  1284. <li><a id="toc-afdelaysrc" href="#afdelaysrc">37.3 afdelaysrc</a></li>
  1285. <li><a id="toc-afireqsrc" href="#afireqsrc">37.4 afireqsrc</a></li>
  1286. <li><a id="toc-afirsrc" href="#afirsrc">37.5 afirsrc</a></li>
  1287. <li><a id="toc-anullsrc" href="#anullsrc">37.6 anullsrc</a>
  1288. <ul class="toc-numbered-mark">
  1289. <li><a id="toc-Examples-82" href="#Examples-82">37.6.1 Examples</a></li>
  1290. </ul></li>
  1291. <li><a id="toc-flite" href="#flite">37.7 flite</a>
  1292. <ul class="toc-numbered-mark">
  1293. <li><a id="toc-Examples-83" href="#Examples-83">37.7.1 Examples</a></li>
  1294. </ul></li>
  1295. <li><a id="toc-anoisesrc" href="#anoisesrc">37.8 anoisesrc</a>
  1296. <ul class="toc-numbered-mark">
  1297. <li><a id="toc-Examples-84" href="#Examples-84">37.8.1 Examples</a></li>
  1298. </ul></li>
  1299. <li><a id="toc-hilbert" href="#hilbert">37.9 hilbert</a></li>
  1300. <li><a id="toc-sinc" href="#sinc">37.10 sinc</a></li>
  1301. <li><a id="toc-sine" href="#sine">37.11 sine</a>
  1302. <ul class="toc-numbered-mark">
  1303. <li><a id="toc-Examples-85" href="#Examples-85">37.11.1 Examples</a></li>
  1304. </ul></li>
  1305. </ul></li>
  1306. <li><a id="toc-Audio-Sinks" href="#Audio-Sinks">38 Audio Sinks</a>
  1307. <ul class="toc-numbered-mark">
  1308. <li><a id="toc-abuffersink" href="#abuffersink">38.1 abuffersink</a></li>
  1309. <li><a id="toc-anullsink" href="#anullsink">38.2 anullsink</a></li>
  1310. </ul></li>
  1311. <li><a id="toc-Video-Filters" href="#Video-Filters">39 Video Filters</a>
  1312. <ul class="toc-numbered-mark">
  1313. <li><a id="toc-addroi" href="#addroi">39.1 addroi</a>
  1314. <ul class="toc-numbered-mark">
  1315. <li><a id="toc-Examples-86" href="#Examples-86">39.1.1 Examples</a></li>
  1316. </ul></li>
  1317. <li><a id="toc-alphaextract" href="#alphaextract">39.2 alphaextract</a></li>
  1318. <li><a id="toc-alphamerge" href="#alphamerge">39.3 alphamerge</a></li>
  1319. <li><a id="toc-amplify" href="#amplify">39.4 amplify</a>
  1320. <ul class="toc-numbered-mark">
  1321. <li><a id="toc-Commands-54" href="#Commands-54">39.4.1 Commands</a></li>
  1322. </ul></li>
  1323. <li><a id="toc-ass-1" href="#ass-1">39.5 ass</a></li>
  1324. <li><a id="toc-atadenoise" href="#atadenoise">39.6 atadenoise</a>
  1325. <ul class="toc-numbered-mark">
  1326. <li><a id="toc-Commands-55" href="#Commands-55">39.6.1 Commands</a></li>
  1327. </ul></li>
  1328. <li><a id="toc-avgblur" href="#avgblur">39.7 avgblur</a>
  1329. <ul class="toc-numbered-mark">
  1330. <li><a id="toc-Commands-56" href="#Commands-56">39.7.1 Commands</a></li>
  1331. </ul></li>
  1332. <li><a id="toc-backgroundkey" href="#backgroundkey">39.8 backgroundkey</a>
  1333. <ul class="toc-numbered-mark">
  1334. <li><a id="toc-Commands-57" href="#Commands-57">39.8.1 Commands</a></li>
  1335. </ul></li>
  1336. <li><a id="toc-bbox" href="#bbox">39.9 bbox</a>
  1337. <ul class="toc-numbered-mark">
  1338. <li><a id="toc-Commands-58" href="#Commands-58">39.9.1 Commands</a></li>
  1339. </ul></li>
  1340. <li><a id="toc-bilateral" href="#bilateral">39.10 bilateral</a>
  1341. <ul class="toc-numbered-mark">
  1342. <li><a id="toc-Commands-59" href="#Commands-59">39.10.1 Commands</a></li>
  1343. </ul></li>
  1344. <li><a id="toc-bilateral_005fcuda" href="#bilateral_005fcuda">39.11 bilateral_cuda</a>
  1345. <ul class="toc-numbered-mark">
  1346. <li><a id="toc-Examples-87" href="#Examples-87">39.11.1 Examples</a></li>
  1347. </ul></li>
  1348. <li><a id="toc-bitplanenoise" href="#bitplanenoise">39.12 bitplanenoise</a></li>
  1349. <li><a id="toc-blackdetect" href="#blackdetect">39.13 blackdetect</a></li>
  1350. <li><a id="toc-blackframe" href="#blackframe">39.14 blackframe</a></li>
  1351. <li><a id="toc-blend-1" href="#blend-1">39.15 blend</a>
  1352. <ul class="toc-numbered-mark">
  1353. <li><a id="toc-Examples-88" href="#Examples-88">39.15.1 Examples</a></li>
  1354. <li><a id="toc-Commands-60" href="#Commands-60">39.15.2 Commands</a></li>
  1355. </ul></li>
  1356. <li><a id="toc-blockdetect-1" href="#blockdetect-1">39.16 blockdetect</a>
  1357. <ul class="toc-numbered-mark">
  1358. <li><a id="toc-Examples-89" href="#Examples-89">39.16.1 Examples</a></li>
  1359. </ul></li>
  1360. <li><a id="toc-blurdetect-1" href="#blurdetect-1">39.17 blurdetect</a>
  1361. <ul class="toc-numbered-mark">
  1362. <li><a id="toc-Examples-90" href="#Examples-90">39.17.1 Examples</a></li>
  1363. </ul></li>
  1364. <li><a id="toc-bm3d" href="#bm3d">39.18 bm3d</a>
  1365. <ul class="toc-numbered-mark">
  1366. <li><a id="toc-Examples-91" href="#Examples-91">39.18.1 Examples</a></li>
  1367. </ul></li>
  1368. <li><a id="toc-boxblur" href="#boxblur">39.19 boxblur</a>
  1369. <ul class="toc-numbered-mark">
  1370. <li><a id="toc-Examples-92" href="#Examples-92">39.19.1 Examples</a></li>
  1371. </ul></li>
  1372. <li><a id="toc-bwdif-1" href="#bwdif-1">39.20 bwdif</a></li>
  1373. <li><a id="toc-bwdif_005fcuda" href="#bwdif_005fcuda">39.21 bwdif_cuda</a></li>
  1374. <li><a id="toc-ccrepack" href="#ccrepack">39.22 ccrepack</a></li>
  1375. <li><a id="toc-cas" href="#cas">39.23 cas</a>
  1376. <ul class="toc-numbered-mark">
  1377. <li><a id="toc-Commands-61" href="#Commands-61">39.23.1 Commands</a></li>
  1378. </ul></li>
  1379. <li><a id="toc-chromahold" href="#chromahold">39.24 chromahold</a>
  1380. <ul class="toc-numbered-mark">
  1381. <li><a id="toc-Commands-62" href="#Commands-62">39.24.1 Commands</a></li>
  1382. </ul></li>
  1383. <li><a id="toc-chromakey-1" href="#chromakey-1">39.25 chromakey</a>
  1384. <ul class="toc-numbered-mark">
  1385. <li><a id="toc-Commands-63" href="#Commands-63">39.25.1 Commands</a></li>
  1386. <li><a id="toc-Examples-93" href="#Examples-93">39.25.2 Examples</a></li>
  1387. </ul></li>
  1388. <li><a id="toc-chromakey_005fcuda" href="#chromakey_005fcuda">39.26 chromakey_cuda</a>
  1389. <ul class="toc-numbered-mark">
  1390. <li><a id="toc-Examples-94" href="#Examples-94">39.26.1 Examples</a></li>
  1391. </ul></li>
  1392. <li><a id="toc-chromanr" href="#chromanr">39.27 chromanr</a>
  1393. <ul class="toc-numbered-mark">
  1394. <li><a id="toc-Commands-64" href="#Commands-64">39.27.1 Commands</a></li>
  1395. </ul></li>
  1396. <li><a id="toc-chromashift" href="#chromashift">39.28 chromashift</a>
  1397. <ul class="toc-numbered-mark">
  1398. <li><a id="toc-Commands-65" href="#Commands-65">39.28.1 Commands</a></li>
  1399. </ul></li>
  1400. <li><a id="toc-ciescope" href="#ciescope">39.29 ciescope</a></li>
  1401. <li><a id="toc-codecview" href="#codecview">39.30 codecview</a>
  1402. <ul class="toc-numbered-mark">
  1403. <li><a id="toc-Examples-95" href="#Examples-95">39.30.1 Examples</a></li>
  1404. </ul></li>
  1405. <li><a id="toc-colorbalance" href="#colorbalance">39.31 colorbalance</a>
  1406. <ul class="toc-numbered-mark">
  1407. <li><a id="toc-Examples-96" href="#Examples-96">39.31.1 Examples</a></li>
  1408. <li><a id="toc-Commands-66" href="#Commands-66">39.31.2 Commands</a></li>
  1409. </ul></li>
  1410. <li><a id="toc-colorcontrast" href="#colorcontrast">39.32 colorcontrast</a>
  1411. <ul class="toc-numbered-mark">
  1412. <li><a id="toc-Commands-67" href="#Commands-67">39.32.1 Commands</a></li>
  1413. </ul></li>
  1414. <li><a id="toc-colorcorrect" href="#colorcorrect">39.33 colorcorrect</a>
  1415. <ul class="toc-numbered-mark">
  1416. <li><a id="toc-Commands-68" href="#Commands-68">39.33.1 Commands</a></li>
  1417. </ul></li>
  1418. <li><a id="toc-colorchannelmixer" href="#colorchannelmixer">39.34 colorchannelmixer</a>
  1419. <ul class="toc-numbered-mark">
  1420. <li><a id="toc-Examples-97" href="#Examples-97">39.34.1 Examples</a></li>
  1421. <li><a id="toc-Commands-69" href="#Commands-69">39.34.2 Commands</a></li>
  1422. </ul></li>
  1423. <li><a id="toc-colorize" href="#colorize">39.35 colorize</a>
  1424. <ul class="toc-numbered-mark">
  1425. <li><a id="toc-Commands-70" href="#Commands-70">39.35.1 Commands</a></li>
  1426. </ul></li>
  1427. <li><a id="toc-colorkey" href="#colorkey">39.36 colorkey</a>
  1428. <ul class="toc-numbered-mark">
  1429. <li><a id="toc-Examples-98" href="#Examples-98">39.36.1 Examples</a></li>
  1430. <li><a id="toc-Commands-71" href="#Commands-71">39.36.2 Commands</a></li>
  1431. </ul></li>
  1432. <li><a id="toc-colorhold" href="#colorhold">39.37 colorhold</a>
  1433. <ul class="toc-numbered-mark">
  1434. <li><a id="toc-Commands-72" href="#Commands-72">39.37.1 Commands</a></li>
  1435. </ul></li>
  1436. <li><a id="toc-colorlevels" href="#colorlevels">39.38 colorlevels</a>
  1437. <ul class="toc-numbered-mark">
  1438. <li><a id="toc-Examples-99" href="#Examples-99">39.38.1 Examples</a></li>
  1439. <li><a id="toc-Commands-73" href="#Commands-73">39.38.2 Commands</a></li>
  1440. </ul></li>
  1441. <li><a id="toc-colormap" href="#colormap">39.39 colormap</a></li>
  1442. <li><a id="toc-colormatrix" href="#colormatrix">39.40 colormatrix</a></li>
  1443. <li><a id="toc-colorspace" href="#colorspace">39.41 colorspace</a></li>
  1444. <li><a id="toc-colorspace_005fcuda" href="#colorspace_005fcuda">39.42 colorspace_cuda</a></li>
  1445. <li><a id="toc-colortemperature" href="#colortemperature">39.43 colortemperature</a>
  1446. <ul class="toc-numbered-mark">
  1447. <li><a id="toc-Commands-74" href="#Commands-74">39.43.1 Commands</a></li>
  1448. </ul></li>
  1449. <li><a id="toc-convolution" href="#convolution">39.44 convolution</a>
  1450. <ul class="toc-numbered-mark">
  1451. <li><a id="toc-Commands-75" href="#Commands-75">39.44.1 Commands</a></li>
  1452. <li><a id="toc-Examples-100" href="#Examples-100">39.44.2 Examples</a></li>
  1453. </ul></li>
  1454. <li><a id="toc-convolve" href="#convolve">39.45 convolve</a></li>
  1455. <li><a id="toc-copy" href="#copy">39.46 copy</a></li>
  1456. <li><a id="toc-coreimage-1" href="#coreimage-1">39.47 coreimage</a>
  1457. <ul class="toc-numbered-mark">
  1458. <li><a id="toc-Examples-101" href="#Examples-101">39.47.1 Examples</a></li>
  1459. </ul></li>
  1460. <li><a id="toc-corr" href="#corr">39.48 corr</a></li>
  1461. <li><a id="toc-cover_005frect" href="#cover_005frect">39.49 cover_rect</a>
  1462. <ul class="toc-numbered-mark">
  1463. <li><a id="toc-Examples-102" href="#Examples-102">39.49.1 Examples</a></li>
  1464. </ul></li>
  1465. <li><a id="toc-crop" href="#crop">39.50 crop</a>
  1466. <ul class="toc-numbered-mark">
  1467. <li><a id="toc-Examples-103" href="#Examples-103">39.50.1 Examples</a></li>
  1468. <li><a id="toc-Commands-76" href="#Commands-76">39.50.2 Commands</a></li>
  1469. </ul></li>
  1470. <li><a id="toc-cropdetect" href="#cropdetect">39.51 cropdetect</a>
  1471. <ul class="toc-numbered-mark">
  1472. <li><a id="toc-Examples-104" href="#Examples-104">39.51.1 Examples</a></li>
  1473. <li><a id="toc-Commands-77" href="#Commands-77">39.51.2 Commands</a></li>
  1474. </ul></li>
  1475. <li><a id="toc-cue-1" href="#cue-1">39.52 cue</a></li>
  1476. <li><a id="toc-curves-1" href="#curves-1">39.53 curves</a>
  1477. <ul class="toc-numbered-mark">
  1478. <li><a id="toc-Commands-78" href="#Commands-78">39.53.1 Commands</a></li>
  1479. <li><a id="toc-Examples-105" href="#Examples-105">39.53.2 Examples</a></li>
  1480. </ul></li>
  1481. <li><a id="toc-datascope" href="#datascope">39.54 datascope</a>
  1482. <ul class="toc-numbered-mark">
  1483. <li><a id="toc-Commands-79" href="#Commands-79">39.54.1 Commands</a></li>
  1484. </ul></li>
  1485. <li><a id="toc-dblur" href="#dblur">39.55 dblur</a>
  1486. <ul class="toc-numbered-mark">
  1487. <li><a id="toc-Commands-80" href="#Commands-80">39.55.1 Commands</a></li>
  1488. </ul></li>
  1489. <li><a id="toc-dctdnoiz" href="#dctdnoiz">39.56 dctdnoiz</a>
  1490. <ul class="toc-numbered-mark">
  1491. <li><a id="toc-Examples-106" href="#Examples-106">39.56.1 Examples</a></li>
  1492. </ul></li>
  1493. <li><a id="toc-deband" href="#deband">39.57 deband</a>
  1494. <ul class="toc-numbered-mark">
  1495. <li><a id="toc-Commands-81" href="#Commands-81">39.57.1 Commands</a></li>
  1496. </ul></li>
  1497. <li><a id="toc-deblock" href="#deblock">39.58 deblock</a>
  1498. <ul class="toc-numbered-mark">
  1499. <li><a id="toc-Examples-107" href="#Examples-107">39.58.1 Examples</a></li>
  1500. <li><a id="toc-Commands-82" href="#Commands-82">39.58.2 Commands</a></li>
  1501. </ul></li>
  1502. <li><a id="toc-decimate-1" href="#decimate-1">39.59 decimate</a></li>
  1503. <li><a id="toc-deconvolve" href="#deconvolve">39.60 deconvolve</a></li>
  1504. <li><a id="toc-dedot" href="#dedot">39.61 dedot</a></li>
  1505. <li><a id="toc-deflate" href="#deflate">39.62 deflate</a>
  1506. <ul class="toc-numbered-mark">
  1507. <li><a id="toc-Commands-83" href="#Commands-83">39.62.1 Commands</a></li>
  1508. </ul></li>
  1509. <li><a id="toc-deflicker" href="#deflicker">39.63 deflicker</a></li>
  1510. <li><a id="toc-dejudder" href="#dejudder">39.64 dejudder</a></li>
  1511. <li><a id="toc-delogo" href="#delogo">39.65 delogo</a>
  1512. <ul class="toc-numbered-mark">
  1513. <li><a id="toc-Examples-108" href="#Examples-108">39.65.1 Examples</a></li>
  1514. </ul></li>
  1515. <li><a id="toc-derain-1" href="#derain-1">39.66 derain</a></li>
  1516. <li><a id="toc-deshake" href="#deshake">39.67 deshake</a></li>
  1517. <li><a id="toc-despill" href="#despill">39.68 despill</a>
  1518. <ul class="toc-numbered-mark">
  1519. <li><a id="toc-Commands-84" href="#Commands-84">39.68.1 Commands</a></li>
  1520. </ul></li>
  1521. <li><a id="toc-detelecine" href="#detelecine">39.69 detelecine</a></li>
  1522. <li><a id="toc-dilation-1" href="#dilation-1">39.70 dilation</a>
  1523. <ul class="toc-numbered-mark">
  1524. <li><a id="toc-Commands-85" href="#Commands-85">39.70.1 Commands</a></li>
  1525. </ul></li>
  1526. <li><a id="toc-displace" href="#displace">39.71 displace</a>
  1527. <ul class="toc-numbered-mark">
  1528. <li><a id="toc-Examples-109" href="#Examples-109">39.71.1 Examples</a></li>
  1529. </ul></li>
  1530. <li><a id="toc-dnn_005fclassify" href="#dnn_005fclassify">39.72 dnn_classify</a></li>
  1531. <li><a id="toc-dnn_005fdetect" href="#dnn_005fdetect">39.73 dnn_detect</a></li>
  1532. <li><a id="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">39.74 dnn_processing</a>
  1533. <ul class="toc-numbered-mark">
  1534. <li><a id="toc-Examples-110" href="#Examples-110">39.74.1 Examples</a></li>
  1535. </ul></li>
  1536. <li><a id="toc-drawbox" href="#drawbox">39.75 drawbox</a>
  1537. <ul class="toc-numbered-mark">
  1538. <li><a id="toc-Examples-111" href="#Examples-111">39.75.1 Examples</a></li>
  1539. <li><a id="toc-Commands-86" href="#Commands-86">39.75.2 Commands</a></li>
  1540. </ul></li>
  1541. <li><a id="toc-drawgraph-1" href="#drawgraph-1">39.76 drawgraph</a></li>
  1542. <li><a id="toc-drawgrid" href="#drawgrid">39.77 drawgrid</a>
  1543. <ul class="toc-numbered-mark">
  1544. <li><a id="toc-Examples-112" href="#Examples-112">39.77.1 Examples</a></li>
  1545. <li><a id="toc-Commands-87" href="#Commands-87">39.77.2 Commands</a></li>
  1546. </ul></li>
  1547. <li><a id="toc-drawtext-1" href="#drawtext-1">39.78 drawtext</a>
  1548. <ul class="toc-numbered-mark">
  1549. <li><a id="toc-Syntax-2" href="#Syntax-2">39.78.1 Syntax</a></li>
  1550. <li><a id="toc-Text-expansion" href="#Text-expansion">39.78.2 Text expansion</a></li>
  1551. <li><a id="toc-Commands-88" href="#Commands-88">39.78.3 Commands</a></li>
  1552. <li><a id="toc-Examples-113" href="#Examples-113">39.78.4 Examples</a></li>
  1553. </ul></li>
  1554. <li><a id="toc-edgedetect" href="#edgedetect">39.79 edgedetect</a>
  1555. <ul class="toc-numbered-mark">
  1556. <li><a id="toc-Examples-114" href="#Examples-114">39.79.1 Examples</a></li>
  1557. </ul></li>
  1558. <li><a id="toc-elbg" href="#elbg">39.80 elbg</a></li>
  1559. <li><a id="toc-entropy" href="#entropy">39.81 entropy</a></li>
  1560. <li><a id="toc-epx" href="#epx">39.82 epx</a></li>
  1561. <li><a id="toc-eq" href="#eq">39.83 eq</a>
  1562. <ul class="toc-numbered-mark">
  1563. <li><a id="toc-Commands-89" href="#Commands-89">39.83.1 Commands</a></li>
  1564. </ul></li>
  1565. <li><a id="toc-erosion-1" href="#erosion-1">39.84 erosion</a>
  1566. <ul class="toc-numbered-mark">
  1567. <li><a id="toc-Commands-90" href="#Commands-90">39.84.1 Commands</a></li>
  1568. </ul></li>
  1569. <li><a id="toc-estdif" href="#estdif">39.85 estdif</a>
  1570. <ul class="toc-numbered-mark">
  1571. <li><a id="toc-Commands-91" href="#Commands-91">39.85.1 Commands</a></li>
  1572. </ul></li>
  1573. <li><a id="toc-exposure" href="#exposure">39.86 exposure</a>
  1574. <ul class="toc-numbered-mark">
  1575. <li><a id="toc-Commands-92" href="#Commands-92">39.86.1 Commands</a></li>
  1576. </ul></li>
  1577. <li><a id="toc-extractplanes" href="#extractplanes">39.87 extractplanes</a>
  1578. <ul class="toc-numbered-mark">
  1579. <li><a id="toc-Examples-115" href="#Examples-115">39.87.1 Examples</a></li>
  1580. </ul></li>
  1581. <li><a id="toc-fade" href="#fade">39.88 fade</a>
  1582. <ul class="toc-numbered-mark">
  1583. <li><a id="toc-Examples-116" href="#Examples-116">39.88.1 Examples</a></li>
  1584. </ul></li>
  1585. <li><a id="toc-feedback" href="#feedback">39.89 feedback</a>
  1586. <ul class="toc-numbered-mark">
  1587. <li><a id="toc-Examples-117" href="#Examples-117">39.89.1 Examples</a></li>
  1588. </ul></li>
  1589. <li><a id="toc-fftdnoiz" href="#fftdnoiz">39.90 fftdnoiz</a></li>
  1590. <li><a id="toc-fftfilt" href="#fftfilt">39.91 fftfilt</a>
  1591. <ul class="toc-numbered-mark">
  1592. <li><a id="toc-Examples-118" href="#Examples-118">39.91.1 Examples</a></li>
  1593. </ul></li>
  1594. <li><a id="toc-field" href="#field">39.92 field</a></li>
  1595. <li><a id="toc-fieldhint" href="#fieldhint">39.93 fieldhint</a></li>
  1596. <li><a id="toc-fieldmatch" href="#fieldmatch">39.94 fieldmatch</a>
  1597. <ul class="toc-numbered-mark">
  1598. <li><a id="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">39.94.1 p/c/n/u/b meaning</a>
  1599. <ul class="toc-numbered-mark">
  1600. <li><a id="toc-p_002fc_002fn" href="#p_002fc_002fn">39.94.1.1 p/c/n</a></li>
  1601. <li><a id="toc-u_002fb" href="#u_002fb">39.94.1.2 u/b</a></li>
  1602. </ul></li>
  1603. <li><a id="toc-Examples-119" href="#Examples-119">39.94.2 Examples</a></li>
  1604. </ul></li>
  1605. <li><a id="toc-fieldorder" href="#fieldorder">39.95 fieldorder</a></li>
  1606. <li><a id="toc-fillborders" href="#fillborders">39.96 fillborders</a>
  1607. <ul class="toc-numbered-mark">
  1608. <li><a id="toc-Commands-93" href="#Commands-93">39.96.1 Commands</a></li>
  1609. </ul></li>
  1610. <li><a id="toc-find_005frect" href="#find_005frect">39.97 find_rect</a>
  1611. <ul class="toc-numbered-mark">
  1612. <li><a id="toc-Examples-120" href="#Examples-120">39.97.1 Examples</a></li>
  1613. </ul></li>
  1614. <li><a id="toc-floodfill" href="#floodfill">39.98 floodfill</a></li>
  1615. <li><a id="toc-format-1" href="#format-1">39.99 format</a>
  1616. <ul class="toc-numbered-mark">
  1617. <li><a id="toc-Examples-121" href="#Examples-121">39.99.1 Examples</a></li>
  1618. </ul></li>
  1619. <li><a id="toc-fps-1" href="#fps-1">39.100 fps</a>
  1620. <ul class="toc-numbered-mark">
  1621. <li><a id="toc-Examples-122" href="#Examples-122">39.100.1 Examples</a></li>
  1622. </ul></li>
  1623. <li><a id="toc-framepack" href="#framepack">39.101 framepack</a></li>
  1624. <li><a id="toc-framerate" href="#framerate">39.102 framerate</a></li>
  1625. <li><a id="toc-framestep" href="#framestep">39.103 framestep</a></li>
  1626. <li><a id="toc-freezedetect" href="#freezedetect">39.104 freezedetect</a></li>
  1627. <li><a id="toc-freezeframes" href="#freezeframes">39.105 freezeframes</a></li>
  1628. <li><a id="toc-frei0r-1" href="#frei0r-1">39.106 frei0r</a>
  1629. <ul class="toc-numbered-mark">
  1630. <li><a id="toc-Examples-123" href="#Examples-123">39.106.1 Examples</a></li>
  1631. <li><a id="toc-Commands-94" href="#Commands-94">39.106.2 Commands</a></li>
  1632. </ul></li>
  1633. <li><a id="toc-fspp" href="#fspp">39.107 fspp</a></li>
  1634. <li><a id="toc-fsync-1" href="#fsync-1">39.108 fsync</a></li>
  1635. <li><a id="toc-gblur" href="#gblur">39.109 gblur</a>
  1636. <ul class="toc-numbered-mark">
  1637. <li><a id="toc-Commands-95" href="#Commands-95">39.109.1 Commands</a></li>
  1638. </ul></li>
  1639. <li><a id="toc-geq" href="#geq">39.110 geq</a>
  1640. <ul class="toc-numbered-mark">
  1641. <li><a id="toc-Examples-124" href="#Examples-124">39.110.1 Examples</a></li>
  1642. </ul></li>
  1643. <li><a id="toc-gradfun" href="#gradfun">39.111 gradfun</a>
  1644. <ul class="toc-numbered-mark">
  1645. <li><a id="toc-Examples-125" href="#Examples-125">39.111.1 Examples</a></li>
  1646. </ul></li>
  1647. <li><a id="toc-graphmonitor-1" href="#graphmonitor-1">39.112 graphmonitor</a></li>
  1648. <li><a id="toc-grayworld" href="#grayworld">39.113 grayworld</a></li>
  1649. <li><a id="toc-greyedge" href="#greyedge">39.114 greyedge</a>
  1650. <ul class="toc-numbered-mark">
  1651. <li><a id="toc-Examples-126" href="#Examples-126">39.114.1 Examples</a></li>
  1652. </ul></li>
  1653. <li><a id="toc-guided" href="#guided">39.115 guided</a>
  1654. <ul class="toc-numbered-mark">
  1655. <li><a id="toc-Commands-96" href="#Commands-96">39.115.1 Commands</a></li>
  1656. <li><a id="toc-Examples-127" href="#Examples-127">39.115.2 Examples</a></li>
  1657. </ul></li>
  1658. <li><a id="toc-haldclut-1" href="#haldclut-1">39.116 haldclut</a>
  1659. <ul class="toc-numbered-mark">
  1660. <li><a id="toc-Commands-97" href="#Commands-97">39.116.1 Commands</a></li>
  1661. <li><a id="toc-Workflow-examples" href="#Workflow-examples">39.116.2 Workflow examples</a>
  1662. <ul class="toc-numbered-mark">
  1663. <li><a id="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">39.116.2.1 Hald CLUT video stream</a></li>
  1664. <li><a id="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">39.116.2.2 Hald CLUT with preview</a></li>
  1665. </ul></li>
  1666. </ul></li>
  1667. <li><a id="toc-hflip" href="#hflip">39.117 hflip</a></li>
  1668. <li><a id="toc-histeq" href="#histeq">39.118 histeq</a></li>
  1669. <li><a id="toc-histogram-1" href="#histogram-1">39.119 histogram</a>
  1670. <ul class="toc-numbered-mark">
  1671. <li><a id="toc-Examples-128" href="#Examples-128">39.119.1 Examples</a></li>
  1672. </ul></li>
  1673. <li><a id="toc-hqdn3d-1" href="#hqdn3d-1">39.120 hqdn3d</a>
  1674. <ul class="toc-numbered-mark">
  1675. <li><a id="toc-Commands-98" href="#Commands-98">39.120.1 Commands</a></li>
  1676. </ul></li>
  1677. <li><a id="toc-hwdownload-1" href="#hwdownload-1">39.121 hwdownload</a></li>
  1678. <li><a id="toc-hwmap" href="#hwmap">39.122 hwmap</a></li>
  1679. <li><a id="toc-hwupload-1" href="#hwupload-1">39.123 hwupload</a></li>
  1680. <li><a id="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">39.124 hwupload_cuda</a></li>
  1681. <li><a id="toc-hqx" href="#hqx">39.125 hqx</a></li>
  1682. <li><a id="toc-hstack-1" href="#hstack-1">39.126 hstack</a></li>
  1683. <li><a id="toc-hsvhold" href="#hsvhold">39.127 hsvhold</a></li>
  1684. <li><a id="toc-hsvkey" href="#hsvkey">39.128 hsvkey</a></li>
  1685. <li><a id="toc-hue" href="#hue">39.129 hue</a>
  1686. <ul class="toc-numbered-mark">
  1687. <li><a id="toc-Examples-129" href="#Examples-129">39.129.1 Examples</a></li>
  1688. <li><a id="toc-Commands-99" href="#Commands-99">39.129.2 Commands</a></li>
  1689. </ul></li>
  1690. <li><a id="toc-huesaturation" href="#huesaturation">39.130 huesaturation</a></li>
  1691. <li><a id="toc-hysteresis" href="#hysteresis">39.131 hysteresis</a></li>
  1692. <li><a id="toc-iccdetect" href="#iccdetect">39.132 iccdetect</a></li>
  1693. <li><a id="toc-iccgen" href="#iccgen">39.133 iccgen</a></li>
  1694. <li><a id="toc-identity" href="#identity">39.134 identity</a></li>
  1695. <li><a id="toc-idet" href="#idet">39.135 idet</a>
  1696. <ul class="toc-numbered-mark">
  1697. <li><a id="toc-Examples-130" href="#Examples-130">39.135.1 Examples</a></li>
  1698. </ul></li>
  1699. <li><a id="toc-il" href="#il">39.136 il</a>
  1700. <ul class="toc-numbered-mark">
  1701. <li><a id="toc-Commands-100" href="#Commands-100">39.136.1 Commands</a></li>
  1702. </ul></li>
  1703. <li><a id="toc-inflate" href="#inflate">39.137 inflate</a>
  1704. <ul class="toc-numbered-mark">
  1705. <li><a id="toc-Commands-101" href="#Commands-101">39.137.1 Commands</a></li>
  1706. </ul></li>
  1707. <li><a id="toc-interlace" href="#interlace">39.138 interlace</a></li>
  1708. <li><a id="toc-kerndeint" href="#kerndeint">39.139 kerndeint</a>
  1709. <ul class="toc-numbered-mark">
  1710. <li><a id="toc-Examples-131" href="#Examples-131">39.139.1 Examples</a></li>
  1711. </ul></li>
  1712. <li><a id="toc-kirsch" href="#kirsch">39.140 kirsch</a>
  1713. <ul class="toc-numbered-mark">
  1714. <li><a id="toc-Commands-102" href="#Commands-102">39.140.1 Commands</a></li>
  1715. </ul></li>
  1716. <li><a id="toc-lagfun" href="#lagfun">39.141 lagfun</a>
  1717. <ul class="toc-numbered-mark">
  1718. <li><a id="toc-Commands-103" href="#Commands-103">39.141.1 Commands</a></li>
  1719. </ul></li>
  1720. <li><a id="toc-lenscorrection" href="#lenscorrection">39.142 lenscorrection</a>
  1721. <ul class="toc-numbered-mark">
  1722. <li><a id="toc-Options-111" href="#Options-111">39.142.1 Options</a></li>
  1723. <li><a id="toc-Commands-104" href="#Commands-104">39.142.2 Commands</a></li>
  1724. </ul></li>
  1725. <li><a id="toc-lensfun" href="#lensfun">39.143 lensfun</a>
  1726. <ul class="toc-numbered-mark">
  1727. <li><a id="toc-Examples-132" href="#Examples-132">39.143.1 Examples</a></li>
  1728. </ul></li>
  1729. <li><a id="toc-libplacebo" href="#libplacebo">39.144 libplacebo</a>
  1730. <ul class="toc-numbered-mark">
  1731. <li><a id="toc-Options-112" href="#Options-112">39.144.1 Options</a>
  1732. <ul class="toc-numbered-mark">
  1733. <li><a id="toc-Output-mode" href="#Output-mode">39.144.1.1 Output mode</a></li>
  1734. <li><a id="toc-Scaling" href="#Scaling">39.144.1.2 Scaling</a></li>
  1735. <li><a id="toc-Debanding" href="#Debanding">39.144.1.3 Debanding</a></li>
  1736. <li><a id="toc-Color-adjustment" href="#Color-adjustment">39.144.1.4 Color adjustment</a></li>
  1737. <li><a id="toc-Peak-detection" href="#Peak-detection">39.144.1.5 Peak detection</a></li>
  1738. <li><a id="toc-Tone-mapping" href="#Tone-mapping">39.144.1.6 Tone mapping</a></li>
  1739. <li><a id="toc-Dithering" href="#Dithering">39.144.1.7 Dithering</a></li>
  1740. <li><a id="toc-Custom-shaders" href="#Custom-shaders">39.144.1.8 Custom shaders</a></li>
  1741. <li><a id="toc-Debugging-_002f-performance" href="#Debugging-_002f-performance">39.144.1.9 Debugging / performance</a></li>
  1742. </ul></li>
  1743. <li><a id="toc-Commands-105" href="#Commands-105">39.144.2 Commands</a></li>
  1744. <li><a id="toc-Examples-133" href="#Examples-133">39.144.3 Examples</a></li>
  1745. </ul></li>
  1746. <li><a id="toc-libvmaf-1" href="#libvmaf-1">39.145 libvmaf</a>
  1747. <ul class="toc-numbered-mark">
  1748. <li><a id="toc-Examples-134" href="#Examples-134">39.145.1 Examples</a></li>
  1749. </ul></li>
  1750. <li><a id="toc-libvmaf_005fcuda" href="#libvmaf_005fcuda">39.146 libvmaf_cuda</a>
  1751. <ul class="toc-numbered-mark">
  1752. <li><a id="toc-Examples-135" href="#Examples-135">39.146.1 Examples</a></li>
  1753. </ul></li>
  1754. <li><a id="toc-limitdiff" href="#limitdiff">39.147 limitdiff</a>
  1755. <ul class="toc-numbered-mark">
  1756. <li><a id="toc-Commands-106" href="#Commands-106">39.147.1 Commands</a></li>
  1757. </ul></li>
  1758. <li><a id="toc-limiter" href="#limiter">39.148 limiter</a>
  1759. <ul class="toc-numbered-mark">
  1760. <li><a id="toc-Commands-107" href="#Commands-107">39.148.1 Commands</a></li>
  1761. </ul></li>
  1762. <li><a id="toc-loop" href="#loop">39.149 loop</a>
  1763. <ul class="toc-numbered-mark">
  1764. <li><a id="toc-Examples-136" href="#Examples-136">39.149.1 Examples</a></li>
  1765. </ul></li>
  1766. <li><a id="toc-lut1d" href="#lut1d">39.150 lut1d</a>
  1767. <ul class="toc-numbered-mark">
  1768. <li><a id="toc-Commands-108" href="#Commands-108">39.150.1 Commands</a></li>
  1769. </ul></li>
  1770. <li><a id="toc-lut3d-1" href="#lut3d-1">39.151 lut3d</a>
  1771. <ul class="toc-numbered-mark">
  1772. <li><a id="toc-Commands-109" href="#Commands-109">39.151.1 Commands</a></li>
  1773. </ul></li>
  1774. <li><a id="toc-lumakey" href="#lumakey">39.152 lumakey</a>
  1775. <ul class="toc-numbered-mark">
  1776. <li><a id="toc-Commands-110" href="#Commands-110">39.152.1 Commands</a></li>
  1777. </ul></li>
  1778. <li><a id="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">39.153 lut, lutrgb, lutyuv</a>
  1779. <ul class="toc-numbered-mark">
  1780. <li><a id="toc-Commands-111" href="#Commands-111">39.153.1 Commands</a></li>
  1781. <li><a id="toc-Examples-137" href="#Examples-137">39.153.2 Examples</a></li>
  1782. </ul></li>
  1783. <li><a id="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">39.154 lut2, tlut2</a>
  1784. <ul class="toc-numbered-mark">
  1785. <li><a id="toc-Commands-112" href="#Commands-112">39.154.1 Commands</a></li>
  1786. <li><a id="toc-Examples-138" href="#Examples-138">39.154.2 Examples</a></li>
  1787. </ul></li>
  1788. <li><a id="toc-maskedclamp" href="#maskedclamp">39.155 maskedclamp</a>
  1789. <ul class="toc-numbered-mark">
  1790. <li><a id="toc-Commands-113" href="#Commands-113">39.155.1 Commands</a></li>
  1791. </ul></li>
  1792. <li><a id="toc-maskedmax" href="#maskedmax">39.156 maskedmax</a>
  1793. <ul class="toc-numbered-mark">
  1794. <li><a id="toc-Commands-114" href="#Commands-114">39.156.1 Commands</a></li>
  1795. </ul></li>
  1796. <li><a id="toc-maskedmerge" href="#maskedmerge">39.157 maskedmerge</a>
  1797. <ul class="toc-numbered-mark">
  1798. <li><a id="toc-Commands-115" href="#Commands-115">39.157.1 Commands</a></li>
  1799. </ul></li>
  1800. <li><a id="toc-maskedmin" href="#maskedmin">39.158 maskedmin</a>
  1801. <ul class="toc-numbered-mark">
  1802. <li><a id="toc-Commands-116" href="#Commands-116">39.158.1 Commands</a></li>
  1803. </ul></li>
  1804. <li><a id="toc-maskedthreshold" href="#maskedthreshold">39.159 maskedthreshold</a>
  1805. <ul class="toc-numbered-mark">
  1806. <li><a id="toc-Commands-117" href="#Commands-117">39.159.1 Commands</a></li>
  1807. </ul></li>
  1808. <li><a id="toc-maskfun" href="#maskfun">39.160 maskfun</a>
  1809. <ul class="toc-numbered-mark">
  1810. <li><a id="toc-Commands-118" href="#Commands-118">39.160.1 Commands</a></li>
  1811. </ul></li>
  1812. <li><a id="toc-mcdeint" href="#mcdeint">39.161 mcdeint</a></li>
  1813. <li><a id="toc-median" href="#median">39.162 median</a>
  1814. <ul class="toc-numbered-mark">
  1815. <li><a id="toc-Commands-119" href="#Commands-119">39.162.1 Commands</a></li>
  1816. </ul></li>
  1817. <li><a id="toc-mergeplanes" href="#mergeplanes">39.163 mergeplanes</a>
  1818. <ul class="toc-numbered-mark">
  1819. <li><a id="toc-Examples-139" href="#Examples-139">39.163.1 Examples</a></li>
  1820. </ul></li>
  1821. <li><a id="toc-mestimate" href="#mestimate">39.164 mestimate</a></li>
  1822. <li><a id="toc-midequalizer" href="#midequalizer">39.165 midequalizer</a></li>
  1823. <li><a id="toc-minterpolate" href="#minterpolate">39.166 minterpolate</a></li>
  1824. <li><a id="toc-mix" href="#mix">39.167 mix</a>
  1825. <ul class="toc-numbered-mark">
  1826. <li><a id="toc-Commands-120" href="#Commands-120">39.167.1 Commands</a></li>
  1827. </ul></li>
  1828. <li><a id="toc-monochrome" href="#monochrome">39.168 monochrome</a>
  1829. <ul class="toc-numbered-mark">
  1830. <li><a id="toc-Commands-121" href="#Commands-121">39.168.1 Commands</a></li>
  1831. </ul></li>
  1832. <li><a id="toc-morpho" href="#morpho">39.169 morpho</a>
  1833. <ul class="toc-numbered-mark">
  1834. <li><a id="toc-Commands-122" href="#Commands-122">39.169.1 Commands</a></li>
  1835. </ul></li>
  1836. <li><a id="toc-mpdecimate" href="#mpdecimate">39.170 mpdecimate</a></li>
  1837. <li><a id="toc-msad" href="#msad">39.171 msad</a></li>
  1838. <li><a id="toc-multiply" href="#multiply">39.172 multiply</a>
  1839. <ul class="toc-numbered-mark">
  1840. <li><a id="toc-Commands-123" href="#Commands-123">39.172.1 Commands</a></li>
  1841. </ul></li>
  1842. <li><a id="toc-negate" href="#negate">39.173 negate</a>
  1843. <ul class="toc-numbered-mark">
  1844. <li><a id="toc-Commands-124" href="#Commands-124">39.173.1 Commands</a></li>
  1845. </ul></li>
  1846. <li><a id="toc-nlmeans-1" href="#nlmeans-1">39.174 nlmeans</a></li>
  1847. <li><a id="toc-nnedi" href="#nnedi">39.175 nnedi</a>
  1848. <ul class="toc-numbered-mark">
  1849. <li><a id="toc-Commands-125" href="#Commands-125">39.175.1 Commands</a></li>
  1850. </ul></li>
  1851. <li><a id="toc-noformat" href="#noformat">39.176 noformat</a>
  1852. <ul class="toc-numbered-mark">
  1853. <li><a id="toc-Examples-140" href="#Examples-140">39.176.1 Examples</a></li>
  1854. </ul></li>
  1855. <li><a id="toc-noise-1" href="#noise-1">39.177 noise</a>
  1856. <ul class="toc-numbered-mark">
  1857. <li><a id="toc-Examples-141" href="#Examples-141">39.177.1 Examples</a></li>
  1858. </ul></li>
  1859. <li><a id="toc-normalize" href="#normalize">39.178 normalize</a>
  1860. <ul class="toc-numbered-mark">
  1861. <li><a id="toc-Commands-126" href="#Commands-126">39.178.1 Commands</a></li>
  1862. <li><a id="toc-Examples-142" href="#Examples-142">39.178.2 Examples</a></li>
  1863. </ul></li>
  1864. <li><a id="toc-null-2" href="#null-2">39.179 null</a></li>
  1865. <li><a id="toc-ocr" href="#ocr">39.180 ocr</a></li>
  1866. <li><a id="toc-ocv" href="#ocv">39.181 ocv</a>
  1867. <ul class="toc-numbered-mark">
  1868. <li><a id="toc-dilate-1" href="#dilate-1">39.181.1 dilate</a></li>
  1869. <li><a id="toc-erode" href="#erode">39.181.2 erode</a></li>
  1870. <li><a id="toc-smooth" href="#smooth">39.181.3 smooth</a></li>
  1871. </ul></li>
  1872. <li><a id="toc-oscilloscope" href="#oscilloscope">39.182 oscilloscope</a>
  1873. <ul class="toc-numbered-mark">
  1874. <li><a id="toc-Commands-127" href="#Commands-127">39.182.1 Commands</a></li>
  1875. <li><a id="toc-Examples-143" href="#Examples-143">39.182.2 Examples</a></li>
  1876. </ul></li>
  1877. <li><a id="toc-overlay-1" href="#overlay-1">39.183 overlay</a>
  1878. <ul class="toc-numbered-mark">
  1879. <li><a id="toc-Commands-128" href="#Commands-128">39.183.1 Commands</a></li>
  1880. <li><a id="toc-Examples-144" href="#Examples-144">39.183.2 Examples</a></li>
  1881. </ul></li>
  1882. <li><a id="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">39.184 overlay_cuda</a></li>
  1883. <li><a id="toc-owdenoise" href="#owdenoise">39.185 owdenoise</a></li>
  1884. <li><a id="toc-pad-1" href="#pad-1">39.186 pad</a>
  1885. <ul class="toc-numbered-mark">
  1886. <li><a id="toc-Examples-145" href="#Examples-145">39.186.1 Examples</a></li>
  1887. </ul></li>
  1888. <li><a id="toc-palettegen-1" href="#palettegen-1">39.187 palettegen</a>
  1889. <ul class="toc-numbered-mark">
  1890. <li><a id="toc-Examples-146" href="#Examples-146">39.187.1 Examples</a></li>
  1891. </ul></li>
  1892. <li><a id="toc-paletteuse" href="#paletteuse">39.188 paletteuse</a>
  1893. <ul class="toc-numbered-mark">
  1894. <li><a id="toc-Examples-147" href="#Examples-147">39.188.1 Examples</a></li>
  1895. </ul></li>
  1896. <li><a id="toc-perspective" href="#perspective">39.189 perspective</a></li>
  1897. <li><a id="toc-phase" href="#phase">39.190 phase</a>
  1898. <ul class="toc-numbered-mark">
  1899. <li><a id="toc-Commands-129" href="#Commands-129">39.190.1 Commands</a></li>
  1900. </ul></li>
  1901. <li><a id="toc-photosensitivity" href="#photosensitivity">39.191 photosensitivity</a></li>
  1902. <li><a id="toc-pixdesctest" href="#pixdesctest">39.192 pixdesctest</a></li>
  1903. <li><a id="toc-pixelize" href="#pixelize">39.193 pixelize</a>
  1904. <ul class="toc-numbered-mark">
  1905. <li><a id="toc-Commands-130" href="#Commands-130">39.193.1 Commands</a></li>
  1906. </ul></li>
  1907. <li><a id="toc-pixscope" href="#pixscope">39.194 pixscope</a>
  1908. <ul class="toc-numbered-mark">
  1909. <li><a id="toc-Commands-131" href="#Commands-131">39.194.1 Commands</a></li>
  1910. </ul></li>
  1911. <li><a id="toc-pp" href="#pp">39.195 pp</a>
  1912. <ul class="toc-numbered-mark">
  1913. <li><a id="toc-Examples-148" href="#Examples-148">39.195.1 Examples</a></li>
  1914. </ul></li>
  1915. <li><a id="toc-pp7" href="#pp7">39.196 pp7</a></li>
  1916. <li><a id="toc-premultiply" href="#premultiply">39.197 premultiply</a></li>
  1917. <li><a id="toc-prewitt" href="#prewitt">39.198 prewitt</a>
  1918. <ul class="toc-numbered-mark">
  1919. <li><a id="toc-Commands-132" href="#Commands-132">39.198.1 Commands</a></li>
  1920. </ul></li>
  1921. <li><a id="toc-pseudocolor" href="#pseudocolor">39.199 pseudocolor</a>
  1922. <ul class="toc-numbered-mark">
  1923. <li><a id="toc-Commands-133" href="#Commands-133">39.199.1 Commands</a></li>
  1924. <li><a id="toc-Examples-149" href="#Examples-149">39.199.2 Examples</a></li>
  1925. </ul></li>
  1926. <li><a id="toc-psnr" href="#psnr">39.200 psnr</a>
  1927. <ul class="toc-numbered-mark">
  1928. <li><a id="toc-Examples-150" href="#Examples-150">39.200.1 Examples</a></li>
  1929. </ul></li>
  1930. <li><a id="toc-pullup-1" href="#pullup-1">39.201 pullup</a></li>
  1931. <li><a id="toc-qp" href="#qp">39.202 qp</a>
  1932. <ul class="toc-numbered-mark">
  1933. <li><a id="toc-Examples-151" href="#Examples-151">39.202.1 Examples</a></li>
  1934. </ul></li>
  1935. <li><a id="toc-qrencode" href="#qrencode">39.203 qrencode</a>
  1936. <ul class="toc-numbered-mark">
  1937. <li><a id="toc-qrencode-Expressions" href="#qrencode-Expressions">39.203.1 qrencode Expressions</a></li>
  1938. <li><a id="toc-qrencode-Text-expansion" href="#qrencode-Text-expansion">39.203.2 qrencode Text expansion</a></li>
  1939. <li><a id="toc-Examples-152" href="#Examples-152">39.203.3 Examples</a></li>
  1940. </ul></li>
  1941. <li><a id="toc-quirc" href="#quirc">39.204 quirc</a></li>
  1942. <li><a id="toc-random" href="#random">39.205 random</a></li>
  1943. <li><a id="toc-readeia608" href="#readeia608">39.206 readeia608</a>
  1944. <ul class="toc-numbered-mark">
  1945. <li><a id="toc-Commands-134" href="#Commands-134">39.206.1 Commands</a></li>
  1946. <li><a id="toc-Examples-153" href="#Examples-153">39.206.2 Examples</a></li>
  1947. </ul></li>
  1948. <li><a id="toc-readvitc" href="#readvitc">39.207 readvitc</a>
  1949. <ul class="toc-numbered-mark">
  1950. <li><a id="toc-Examples-154" href="#Examples-154">39.207.1 Examples</a></li>
  1951. </ul></li>
  1952. <li><a id="toc-remap" href="#remap">39.208 remap</a></li>
  1953. <li><a id="toc-removegrain" href="#removegrain">39.209 removegrain</a></li>
  1954. <li><a id="toc-removelogo" href="#removelogo">39.210 removelogo</a></li>
  1955. <li><a id="toc-repeatfields" href="#repeatfields">39.211 repeatfields</a></li>
  1956. <li><a id="toc-reverse" href="#reverse">39.212 reverse</a>
  1957. <ul class="toc-numbered-mark">
  1958. <li><a id="toc-Examples-155" href="#Examples-155">39.212.1 Examples</a></li>
  1959. </ul></li>
  1960. <li><a id="toc-rgbashift" href="#rgbashift">39.213 rgbashift</a>
  1961. <ul class="toc-numbered-mark">
  1962. <li><a id="toc-Commands-135" href="#Commands-135">39.213.1 Commands</a></li>
  1963. </ul></li>
  1964. <li><a id="toc-roberts" href="#roberts">39.214 roberts</a>
  1965. <ul class="toc-numbered-mark">
  1966. <li><a id="toc-Commands-136" href="#Commands-136">39.214.1 Commands</a></li>
  1967. </ul></li>
  1968. <li><a id="toc-rotate" href="#rotate">39.215 rotate</a>
  1969. <ul class="toc-numbered-mark">
  1970. <li><a id="toc-Examples-156" href="#Examples-156">39.215.1 Examples</a></li>
  1971. <li><a id="toc-Commands-137" href="#Commands-137">39.215.2 Commands</a></li>
  1972. </ul></li>
  1973. <li><a id="toc-sab" href="#sab">39.216 sab</a></li>
  1974. <li><a id="toc-scale-1" href="#scale-1">39.217 scale</a>
  1975. <ul class="toc-numbered-mark">
  1976. <li><a id="toc-Options-113" href="#Options-113">39.217.1 Options</a></li>
  1977. <li><a id="toc-Examples-157" href="#Examples-157">39.217.2 Examples</a></li>
  1978. <li><a id="toc-Commands-138" href="#Commands-138">39.217.3 Commands</a></li>
  1979. </ul></li>
  1980. <li><a id="toc-scale_005fcuda-1" href="#scale_005fcuda-1">39.218 scale_cuda</a>
  1981. <ul class="toc-numbered-mark">
  1982. <li><a id="toc-Examples-158" href="#Examples-158">39.218.1 Examples</a></li>
  1983. </ul></li>
  1984. <li><a id="toc-scale_005fnpp-1" href="#scale_005fnpp-1">39.219 scale_npp</a></li>
  1985. <li><a id="toc-scale2ref" href="#scale2ref">39.220 scale2ref</a>
  1986. <ul class="toc-numbered-mark">
  1987. <li><a id="toc-Examples-159" href="#Examples-159">39.220.1 Examples</a></li>
  1988. <li><a id="toc-Commands-139" href="#Commands-139">39.220.2 Commands</a></li>
  1989. </ul></li>
  1990. <li><a id="toc-scale2ref_005fnpp" href="#scale2ref_005fnpp">39.221 scale2ref_npp</a>
  1991. <ul class="toc-numbered-mark">
  1992. <li><a id="toc-Examples-160" href="#Examples-160">39.221.1 Examples</a></li>
  1993. </ul></li>
  1994. <li><a id="toc-scale_005fvt" href="#scale_005fvt">39.222 scale_vt</a></li>
  1995. <li><a id="toc-scharr" href="#scharr">39.223 scharr</a>
  1996. <ul class="toc-numbered-mark">
  1997. <li><a id="toc-Commands-140" href="#Commands-140">39.223.1 Commands</a></li>
  1998. </ul></li>
  1999. <li><a id="toc-scroll" href="#scroll">39.224 scroll</a>
  2000. <ul class="toc-numbered-mark">
  2001. <li><a id="toc-Commands-141" href="#Commands-141">39.224.1 Commands</a></li>
  2002. </ul></li>
  2003. <li><a id="toc-scdet-1" href="#scdet-1">39.225 scdet</a></li>
  2004. <li><a id="toc-selectivecolor-1" href="#selectivecolor-1">39.226 selectivecolor</a>
  2005. <ul class="toc-numbered-mark">
  2006. <li><a id="toc-Examples-161" href="#Examples-161">39.226.1 Examples</a></li>
  2007. </ul></li>
  2008. <li><a id="toc-separatefields-1" href="#separatefields-1">39.227 separatefields</a></li>
  2009. <li><a id="toc-setdar_002c-setsar" href="#setdar_002c-setsar">39.228 setdar, setsar</a>
  2010. <ul class="toc-numbered-mark">
  2011. <li><a id="toc-Examples-162" href="#Examples-162">39.228.1 Examples</a></li>
  2012. </ul></li>
  2013. <li><a id="toc-setfield-1" href="#setfield-1">39.229 setfield</a></li>
  2014. <li><a id="toc-setparams-1" href="#setparams-1">39.230 setparams</a></li>
  2015. <li><a id="toc-sharpen_005fnpp" href="#sharpen_005fnpp">39.231 sharpen_npp</a></li>
  2016. <li><a id="toc-shear" href="#shear">39.232 shear</a>
  2017. <ul class="toc-numbered-mark">
  2018. <li><a id="toc-Commands-142" href="#Commands-142">39.232.1 Commands</a></li>
  2019. </ul></li>
  2020. <li><a id="toc-showinfo-1" href="#showinfo-1">39.233 showinfo</a></li>
  2021. <li><a id="toc-showpalette" href="#showpalette">39.234 showpalette</a></li>
  2022. <li><a id="toc-shuffleframes" href="#shuffleframes">39.235 shuffleframes</a>
  2023. <ul class="toc-numbered-mark">
  2024. <li><a id="toc-Examples-163" href="#Examples-163">39.235.1 Examples</a></li>
  2025. </ul></li>
  2026. <li><a id="toc-shufflepixels" href="#shufflepixels">39.236 shufflepixels</a></li>
  2027. <li><a id="toc-shuffleplanes" href="#shuffleplanes">39.237 shuffleplanes</a>
  2028. <ul class="toc-numbered-mark">
  2029. <li><a id="toc-Examples-164" href="#Examples-164">39.237.1 Examples</a></li>
  2030. </ul></li>
  2031. <li><a id="toc-signalstats-1" href="#signalstats-1">39.238 signalstats</a>
  2032. <ul class="toc-numbered-mark">
  2033. <li><a id="toc-Examples-165" href="#Examples-165">39.238.1 Examples</a></li>
  2034. </ul></li>
  2035. <li><a id="toc-signature-1" href="#signature-1">39.239 signature</a>
  2036. <ul class="toc-numbered-mark">
  2037. <li><a id="toc-Examples-166" href="#Examples-166">39.239.1 Examples</a></li>
  2038. </ul></li>
  2039. <li><a id="toc-siti-1" href="#siti-1">39.240 siti</a>
  2040. <ul class="toc-numbered-mark">
  2041. <li><a id="toc-Examples-167" href="#Examples-167">39.240.1 Examples</a></li>
  2042. </ul></li>
  2043. <li><a id="toc-smartblur-1" href="#smartblur-1">39.241 smartblur</a></li>
  2044. <li><a id="toc-sobel" href="#sobel">39.242 sobel</a>
  2045. <ul class="toc-numbered-mark">
  2046. <li><a id="toc-Commands-143" href="#Commands-143">39.242.1 Commands</a></li>
  2047. </ul></li>
  2048. <li><a id="toc-spp-1" href="#spp-1">39.243 spp</a>
  2049. <ul class="toc-numbered-mark">
  2050. <li><a id="toc-Commands-144" href="#Commands-144">39.243.1 Commands</a></li>
  2051. </ul></li>
  2052. <li><a id="toc-sr-1" href="#sr-1">39.244 sr</a></li>
  2053. <li><a id="toc-ssim" href="#ssim">39.245 ssim</a>
  2054. <ul class="toc-numbered-mark">
  2055. <li><a id="toc-Examples-168" href="#Examples-168">39.245.1 Examples</a></li>
  2056. </ul></li>
  2057. <li><a id="toc-stereo3d" href="#stereo3d">39.246 stereo3d</a>
  2058. <ul class="toc-numbered-mark">
  2059. <li><a id="toc-Examples-169" href="#Examples-169">39.246.1 Examples</a></li>
  2060. </ul></li>
  2061. <li><a id="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">39.247 streamselect, astreamselect</a>
  2062. <ul class="toc-numbered-mark">
  2063. <li><a id="toc-Commands-145" href="#Commands-145">39.247.1 Commands</a></li>
  2064. <li><a id="toc-Examples-170" href="#Examples-170">39.247.2 Examples</a></li>
  2065. </ul></li>
  2066. <li><a id="toc-subtitles-1" href="#subtitles-1">39.248 subtitles</a></li>
  2067. <li><a id="toc-super2xsai" href="#super2xsai">39.249 super2xsai</a></li>
  2068. <li><a id="toc-swaprect" href="#swaprect">39.250 swaprect</a>
  2069. <ul class="toc-numbered-mark">
  2070. <li><a id="toc-Commands-146" href="#Commands-146">39.250.1 Commands</a></li>
  2071. </ul></li>
  2072. <li><a id="toc-swapuv" href="#swapuv">39.251 swapuv</a></li>
  2073. <li><a id="toc-tblend" href="#tblend">39.252 tblend</a></li>
  2074. <li><a id="toc-telecine" href="#telecine">39.253 telecine</a></li>
  2075. <li><a id="toc-thistogram" href="#thistogram">39.254 thistogram</a></li>
  2076. <li><a id="toc-threshold" href="#threshold">39.255 threshold</a>
  2077. <ul class="toc-numbered-mark">
  2078. <li><a id="toc-Commands-147" href="#Commands-147">39.255.1 Commands</a></li>
  2079. <li><a id="toc-Examples-171" href="#Examples-171">39.255.2 Examples</a></li>
  2080. </ul></li>
  2081. <li><a id="toc-thumbnail" href="#thumbnail">39.256 thumbnail</a>
  2082. <ul class="toc-numbered-mark">
  2083. <li><a id="toc-Examples-172" href="#Examples-172">39.256.1 Examples</a></li>
  2084. </ul></li>
  2085. <li><a id="toc-tile-1" href="#tile-1">39.257 tile</a>
  2086. <ul class="toc-numbered-mark">
  2087. <li><a id="toc-Examples-173" href="#Examples-173">39.257.1 Examples</a></li>
  2088. </ul></li>
  2089. <li><a id="toc-tiltandshift" href="#tiltandshift">39.258 tiltandshift</a></li>
  2090. <li><a id="toc-tinterlace" href="#tinterlace">39.259 tinterlace</a></li>
  2091. <li><a id="toc-tmedian" href="#tmedian">39.260 tmedian</a>
  2092. <ul class="toc-numbered-mark">
  2093. <li><a id="toc-Commands-148" href="#Commands-148">39.260.1 Commands</a></li>
  2094. </ul></li>
  2095. <li><a id="toc-tmidequalizer" href="#tmidequalizer">39.261 tmidequalizer</a></li>
  2096. <li><a id="toc-tmix" href="#tmix">39.262 tmix</a>
  2097. <ul class="toc-numbered-mark">
  2098. <li><a id="toc-Examples-174" href="#Examples-174">39.262.1 Examples</a></li>
  2099. <li><a id="toc-Commands-149" href="#Commands-149">39.262.2 Commands</a></li>
  2100. </ul></li>
  2101. <li><a id="toc-tonemap-1" href="#tonemap-1">39.263 tonemap</a>
  2102. <ul class="toc-numbered-mark">
  2103. <li><a id="toc-Options-114" href="#Options-114">39.263.1 Options</a></li>
  2104. </ul></li>
  2105. <li><a id="toc-tpad" href="#tpad">39.264 tpad</a></li>
  2106. <li><a id="toc-transpose-1" href="#transpose-1">39.265 transpose</a></li>
  2107. <li><a id="toc-transpose_005fnpp" href="#transpose_005fnpp">39.266 transpose_npp</a></li>
  2108. <li><a id="toc-trim" href="#trim">39.267 trim</a></li>
  2109. <li><a id="toc-unpremultiply" href="#unpremultiply">39.268 unpremultiply</a></li>
  2110. <li><a id="toc-unsharp-1" href="#unsharp-1">39.269 unsharp</a>
  2111. <ul class="toc-numbered-mark">
  2112. <li><a id="toc-Examples-175" href="#Examples-175">39.269.1 Examples</a></li>
  2113. </ul></li>
  2114. <li><a id="toc-untile-1" href="#untile-1">39.270 untile</a>
  2115. <ul class="toc-numbered-mark">
  2116. <li><a id="toc-Examples-176" href="#Examples-176">39.270.1 Examples</a></li>
  2117. </ul></li>
  2118. <li><a id="toc-uspp" href="#uspp">39.271 uspp</a></li>
  2119. <li><a id="toc-v360" href="#v360">39.272 v360</a>
  2120. <ul class="toc-numbered-mark">
  2121. <li><a id="toc-Examples-177" href="#Examples-177">39.272.1 Examples</a></li>
  2122. <li><a id="toc-Commands-150" href="#Commands-150">39.272.2 Commands</a></li>
  2123. </ul></li>
  2124. <li><a id="toc-vaguedenoiser" href="#vaguedenoiser">39.273 vaguedenoiser</a></li>
  2125. <li><a id="toc-varblur" href="#varblur">39.274 varblur</a>
  2126. <ul class="toc-numbered-mark">
  2127. <li><a id="toc-Commands-151" href="#Commands-151">39.274.1 Commands</a></li>
  2128. </ul></li>
  2129. <li><a id="toc-vectorscope" href="#vectorscope">39.275 vectorscope</a></li>
  2130. <li><a id="toc-vidstabdetect-1" href="#vidstabdetect-1">39.276 vidstabdetect</a>
  2131. <ul class="toc-numbered-mark">
  2132. <li><a id="toc-Examples-178" href="#Examples-178">39.276.1 Examples</a></li>
  2133. </ul></li>
  2134. <li><a id="toc-vidstabtransform-1" href="#vidstabtransform-1">39.277 vidstabtransform</a>
  2135. <ul class="toc-numbered-mark">
  2136. <li><a id="toc-Options-115" href="#Options-115">39.277.1 Options</a></li>
  2137. <li><a id="toc-Examples-179" href="#Examples-179">39.277.2 Examples</a></li>
  2138. </ul></li>
  2139. <li><a id="toc-vflip" href="#vflip">39.278 vflip</a></li>
  2140. <li><a id="toc-vfrdet" href="#vfrdet">39.279 vfrdet</a></li>
  2141. <li><a id="toc-vibrance" href="#vibrance">39.280 vibrance</a>
  2142. <ul class="toc-numbered-mark">
  2143. <li><a id="toc-Commands-152" href="#Commands-152">39.280.1 Commands</a></li>
  2144. </ul></li>
  2145. <li><a id="toc-vif" href="#vif">39.281 vif</a></li>
  2146. <li><a id="toc-vignette-1" href="#vignette-1">39.282 vignette</a>
  2147. <ul class="toc-numbered-mark">
  2148. <li><a id="toc-Expressions" href="#Expressions">39.282.1 Expressions</a></li>
  2149. <li><a id="toc-Examples-180" href="#Examples-180">39.282.2 Examples</a></li>
  2150. </ul></li>
  2151. <li><a id="toc-vmafmotion" href="#vmafmotion">39.283 vmafmotion</a></li>
  2152. <li><a id="toc-vstack-1" href="#vstack-1">39.284 vstack</a></li>
  2153. <li><a id="toc-w3fdif" href="#w3fdif">39.285 w3fdif</a>
  2154. <ul class="toc-numbered-mark">
  2155. <li><a id="toc-Commands-153" href="#Commands-153">39.285.1 Commands</a></li>
  2156. </ul></li>
  2157. <li><a id="toc-waveform" href="#waveform">39.286 waveform</a></li>
  2158. <li><a id="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">39.287 weave, doubleweave</a>
  2159. <ul class="toc-numbered-mark">
  2160. <li><a id="toc-Examples-181" href="#Examples-181">39.287.1 Examples</a></li>
  2161. </ul></li>
  2162. <li><a id="toc-xbr" href="#xbr">39.288 xbr</a></li>
  2163. <li><a id="toc-xcorrelate" href="#xcorrelate">39.289 xcorrelate</a></li>
  2164. <li><a id="toc-xfade" href="#xfade">39.290 xfade</a>
  2165. <ul class="toc-numbered-mark">
  2166. <li><a id="toc-Examples-182" href="#Examples-182">39.290.1 Examples</a></li>
  2167. </ul></li>
  2168. <li><a id="toc-xmedian" href="#xmedian">39.291 xmedian</a>
  2169. <ul class="toc-numbered-mark">
  2170. <li><a id="toc-Commands-154" href="#Commands-154">39.291.1 Commands</a></li>
  2171. </ul></li>
  2172. <li><a id="toc-xstack-1" href="#xstack-1">39.292 xstack</a>
  2173. <ul class="toc-numbered-mark">
  2174. <li><a id="toc-Examples-183" href="#Examples-183">39.292.1 Examples</a></li>
  2175. </ul></li>
  2176. <li><a id="toc-yadif-1" href="#yadif-1">39.293 yadif</a></li>
  2177. <li><a id="toc-yadif_005fcuda" href="#yadif_005fcuda">39.294 yadif_cuda</a></li>
  2178. <li><a id="toc-yaepblur" href="#yaepblur">39.295 yaepblur</a>
  2179. <ul class="toc-numbered-mark">
  2180. <li><a id="toc-Commands-155" href="#Commands-155">39.295.1 Commands</a></li>
  2181. </ul></li>
  2182. <li><a id="toc-zoompan" href="#zoompan">39.296 zoompan</a>
  2183. <ul class="toc-numbered-mark">
  2184. <li><a id="toc-Examples-184" href="#Examples-184">39.296.1 Examples</a></li>
  2185. </ul></li>
  2186. <li><a id="toc-zscale-1" href="#zscale-1">39.297 zscale</a>
  2187. <ul class="toc-numbered-mark">
  2188. <li><a id="toc-Options-116" href="#Options-116">39.297.1 Options</a></li>
  2189. <li><a id="toc-Commands-156" href="#Commands-156">39.297.2 Commands</a></li>
  2190. </ul></li>
  2191. </ul></li>
  2192. <li><a id="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">40 OpenCL Video Filters</a>
  2193. <ul class="toc-numbered-mark">
  2194. <li><a id="toc-avgblur_005fopencl" href="#avgblur_005fopencl">40.1 avgblur_opencl</a>
  2195. <ul class="toc-numbered-mark">
  2196. <li><a id="toc-Example-11" href="#Example-11">40.1.1 Example</a></li>
  2197. </ul></li>
  2198. <li><a id="toc-boxblur_005fopencl" href="#boxblur_005fopencl">40.2 boxblur_opencl</a>
  2199. <ul class="toc-numbered-mark">
  2200. <li><a id="toc-Examples-185" href="#Examples-185">40.2.1 Examples</a></li>
  2201. </ul></li>
  2202. <li><a id="toc-colorkey_005fopencl" href="#colorkey_005fopencl">40.3 colorkey_opencl</a>
  2203. <ul class="toc-numbered-mark">
  2204. <li><a id="toc-Examples-186" href="#Examples-186">40.3.1 Examples</a></li>
  2205. </ul></li>
  2206. <li><a id="toc-convolution_005fopencl" href="#convolution_005fopencl">40.4 convolution_opencl</a>
  2207. <ul class="toc-numbered-mark">
  2208. <li><a id="toc-Examples-187" href="#Examples-187">40.4.1 Examples</a></li>
  2209. </ul></li>
  2210. <li><a id="toc-erosion_005fopencl" href="#erosion_005fopencl">40.5 erosion_opencl</a>
  2211. <ul class="toc-numbered-mark">
  2212. <li><a id="toc-Example-12" href="#Example-12">40.5.1 Example</a></li>
  2213. </ul></li>
  2214. <li><a id="toc-deshake_005fopencl" href="#deshake_005fopencl">40.6 deshake_opencl</a>
  2215. <ul class="toc-numbered-mark">
  2216. <li><a id="toc-Examples-188" href="#Examples-188">40.6.1 Examples</a></li>
  2217. </ul></li>
  2218. <li><a id="toc-dilation_005fopencl" href="#dilation_005fopencl">40.7 dilation_opencl</a>
  2219. <ul class="toc-numbered-mark">
  2220. <li><a id="toc-Example-13" href="#Example-13">40.7.1 Example</a></li>
  2221. </ul></li>
  2222. <li><a id="toc-nlmeans_005fopencl-1" href="#nlmeans_005fopencl-1">40.8 nlmeans_opencl</a></li>
  2223. <li><a id="toc-overlay_005fopencl" href="#overlay_005fopencl">40.9 overlay_opencl</a>
  2224. <ul class="toc-numbered-mark">
  2225. <li><a id="toc-Examples-189" href="#Examples-189">40.9.1 Examples</a></li>
  2226. </ul></li>
  2227. <li><a id="toc-pad_005fopencl" href="#pad_005fopencl">40.10 pad_opencl</a></li>
  2228. <li><a id="toc-prewitt_005fopencl" href="#prewitt_005fopencl">40.11 prewitt_opencl</a>
  2229. <ul class="toc-numbered-mark">
  2230. <li><a id="toc-Example-14" href="#Example-14">40.11.1 Example</a></li>
  2231. </ul></li>
  2232. <li><a id="toc-program_005fopencl-1" href="#program_005fopencl-1">40.12 program_opencl</a></li>
  2233. <li><a id="toc-remap_005fopencl" href="#remap_005fopencl">40.13 remap_opencl</a></li>
  2234. <li><a id="toc-roberts_005fopencl" href="#roberts_005fopencl">40.14 roberts_opencl</a>
  2235. <ul class="toc-numbered-mark">
  2236. <li><a id="toc-Example-15" href="#Example-15">40.14.1 Example</a></li>
  2237. </ul></li>
  2238. <li><a id="toc-sobel_005fopencl" href="#sobel_005fopencl">40.15 sobel_opencl</a>
  2239. <ul class="toc-numbered-mark">
  2240. <li><a id="toc-Example-16" href="#Example-16">40.15.1 Example</a></li>
  2241. </ul></li>
  2242. <li><a id="toc-tonemap_005fopencl" href="#tonemap_005fopencl">40.16 tonemap_opencl</a>
  2243. <ul class="toc-numbered-mark">
  2244. <li><a id="toc-Example-17" href="#Example-17">40.16.1 Example</a></li>
  2245. </ul></li>
  2246. <li><a id="toc-unsharp_005fopencl" href="#unsharp_005fopencl">40.17 unsharp_opencl</a>
  2247. <ul class="toc-numbered-mark">
  2248. <li><a id="toc-Examples-190" href="#Examples-190">40.17.1 Examples</a></li>
  2249. </ul></li>
  2250. <li><a id="toc-xfade_005fopencl" href="#xfade_005fopencl">40.18 xfade_opencl</a></li>
  2251. </ul></li>
  2252. <li><a id="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">41 VAAPI Video Filters</a>
  2253. <ul class="toc-numbered-mark">
  2254. <li><a id="toc-overlay_005fvaapi" href="#overlay_005fvaapi">41.1 overlay_vaapi</a>
  2255. <ul class="toc-numbered-mark">
  2256. <li><a id="toc-Examples-191" href="#Examples-191">41.1.1 Examples</a></li>
  2257. </ul></li>
  2258. <li><a id="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">41.2 tonemap_vaapi</a>
  2259. <ul class="toc-numbered-mark">
  2260. <li><a id="toc-Example-18" href="#Example-18">41.2.1 Example</a></li>
  2261. </ul></li>
  2262. <li><a id="toc-hstack_005fvaapi" href="#hstack_005fvaapi">41.3 hstack_vaapi</a></li>
  2263. <li><a id="toc-vstack_005fvaapi" href="#vstack_005fvaapi">41.4 vstack_vaapi</a></li>
  2264. <li><a id="toc-xstack_005fvaapi" href="#xstack_005fvaapi">41.5 xstack_vaapi</a></li>
  2265. </ul></li>
  2266. <li><a id="toc-Vulkan-Video-Filters" href="#Vulkan-Video-Filters">42 Vulkan Video Filters</a>
  2267. <ul class="toc-numbered-mark">
  2268. <li><a id="toc-avgblur_005fvulkan" href="#avgblur_005fvulkan">42.1 avgblur_vulkan</a></li>
  2269. <li><a id="toc-blend_005fvulkan" href="#blend_005fvulkan">42.2 blend_vulkan</a></li>
  2270. <li><a id="toc-bwdif_005fvulkan" href="#bwdif_005fvulkan">42.3 bwdif_vulkan</a></li>
  2271. <li><a id="toc-chromaber_005fvulkan" href="#chromaber_005fvulkan">42.4 chromaber_vulkan</a></li>
  2272. <li><a id="toc-color_005fvulkan" href="#color_005fvulkan">42.5 color_vulkan</a></li>
  2273. <li><a id="toc-vflip_005fvulkan" href="#vflip_005fvulkan">42.6 vflip_vulkan</a></li>
  2274. <li><a id="toc-hflip_005fvulkan" href="#hflip_005fvulkan">42.7 hflip_vulkan</a></li>
  2275. <li><a id="toc-flip_005fvulkan" href="#flip_005fvulkan">42.8 flip_vulkan</a></li>
  2276. <li><a id="toc-gblur_005fvulkan" href="#gblur_005fvulkan">42.9 gblur_vulkan</a></li>
  2277. <li><a id="toc-nlmeans_005fvulkan" href="#nlmeans_005fvulkan">42.10 nlmeans_vulkan</a></li>
  2278. <li><a id="toc-overlay_005fvulkan" href="#overlay_005fvulkan">42.11 overlay_vulkan</a></li>
  2279. <li><a id="toc-transpose_005fvt" href="#transpose_005fvt">42.12 transpose_vt</a></li>
  2280. <li><a id="toc-transpose_005fvulkan" href="#transpose_005fvulkan">42.13 transpose_vulkan</a></li>
  2281. </ul></li>
  2282. <li><a id="toc-QSV-Video-Filters" href="#QSV-Video-Filters">43 QSV Video Filters</a>
  2283. <ul class="toc-numbered-mark">
  2284. <li><a id="toc-hstack_005fqsv" href="#hstack_005fqsv">43.1 hstack_qsv</a></li>
  2285. <li><a id="toc-vstack_005fqsv" href="#vstack_005fqsv">43.2 vstack_qsv</a></li>
  2286. <li><a id="toc-xstack_005fqsv" href="#xstack_005fqsv">43.3 xstack_qsv</a></li>
  2287. </ul></li>
  2288. <li><a id="toc-Video-Sources" href="#Video-Sources">44 Video Sources</a>
  2289. <ul class="toc-numbered-mark">
  2290. <li><a id="toc-buffer" href="#buffer">44.1 buffer</a></li>
  2291. <li><a id="toc-cellauto" href="#cellauto">44.2 cellauto</a>
  2292. <ul class="toc-numbered-mark">
  2293. <li><a id="toc-Examples-192" href="#Examples-192">44.2.1 Examples</a></li>
  2294. </ul></li>
  2295. <li><a id="toc-coreimagesrc-1" href="#coreimagesrc-1">44.3 coreimagesrc</a>
  2296. <ul class="toc-numbered-mark">
  2297. <li><a id="toc-Examples-193" href="#Examples-193">44.3.1 Examples</a></li>
  2298. </ul></li>
  2299. <li><a id="toc-ddagrab" href="#ddagrab">44.4 ddagrab</a>
  2300. <ul class="toc-numbered-mark">
  2301. <li><a id="toc-Examples-194" href="#Examples-194">44.4.1 Examples</a></li>
  2302. </ul></li>
  2303. <li><a id="toc-gradients" href="#gradients">44.5 gradients</a>
  2304. <ul class="toc-numbered-mark">
  2305. <li><a id="toc-Commands-157" href="#Commands-157">44.5.1 Commands</a></li>
  2306. </ul></li>
  2307. <li><a id="toc-mandelbrot" href="#mandelbrot">44.6 mandelbrot</a></li>
  2308. <li><a id="toc-mptestsrc" href="#mptestsrc">44.7 mptestsrc</a></li>
  2309. <li><a id="toc-frei0r_005fsrc" href="#frei0r_005fsrc">44.8 frei0r_src</a></li>
  2310. <li><a id="toc-life" href="#life">44.9 life</a>
  2311. <ul class="toc-numbered-mark">
  2312. <li><a id="toc-Examples-195" href="#Examples-195">44.9.1 Examples</a></li>
  2313. </ul></li>
  2314. <li><a id="toc-qrencodesrc" href="#qrencodesrc">44.10 qrencodesrc</a>
  2315. <ul class="toc-numbered-mark">
  2316. <li><a id="toc-Examples-196" href="#Examples-196">44.10.1 Examples</a></li>
  2317. </ul></li>
  2318. <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">44.11 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  2319. <ul class="toc-numbered-mark">
  2320. <li><a id="toc-Examples-197" href="#Examples-197">44.11.1 Examples</a></li>
  2321. <li><a id="toc-Commands-158" href="#Commands-158">44.11.2 Commands</a></li>
  2322. </ul></li>
  2323. <li><a id="toc-openclsrc" href="#openclsrc">44.12 openclsrc</a></li>
  2324. <li><a id="toc-sierpinski" href="#sierpinski">44.13 sierpinski</a></li>
  2325. <li><a id="toc-zoneplate" href="#zoneplate">44.14 zoneplate</a>
  2326. <ul class="toc-numbered-mark">
  2327. <li><a id="toc-Commands-159" href="#Commands-159">44.14.1 Commands</a></li>
  2328. <li><a id="toc-Examples-198" href="#Examples-198">44.14.2 Examples</a></li>
  2329. </ul></li>
  2330. </ul></li>
  2331. <li><a id="toc-Video-Sinks" href="#Video-Sinks">45 Video Sinks</a>
  2332. <ul class="toc-numbered-mark">
  2333. <li><a id="toc-buffersink" href="#buffersink">45.1 buffersink</a></li>
  2334. <li><a id="toc-nullsink" href="#nullsink">45.2 nullsink</a></li>
  2335. </ul></li>
  2336. <li><a id="toc-Multimedia-Filters" href="#Multimedia-Filters">46 Multimedia Filters</a>
  2337. <ul class="toc-numbered-mark">
  2338. <li><a id="toc-a3dscope" href="#a3dscope">46.1 a3dscope</a>
  2339. <ul class="toc-numbered-mark">
  2340. <li><a id="toc-Commands-160" href="#Commands-160">46.1.1 Commands</a></li>
  2341. </ul></li>
  2342. <li><a id="toc-abitscope" href="#abitscope">46.2 abitscope</a></li>
  2343. <li><a id="toc-adrawgraph" href="#adrawgraph">46.3 adrawgraph</a></li>
  2344. <li><a id="toc-agraphmonitor" href="#agraphmonitor">46.4 agraphmonitor</a></li>
  2345. <li><a id="toc-ahistogram" href="#ahistogram">46.5 ahistogram</a></li>
  2346. <li><a id="toc-aphasemeter" href="#aphasemeter">46.6 aphasemeter</a>
  2347. <ul class="toc-numbered-mark">
  2348. <li><a id="toc-phasing-detection" href="#phasing-detection">46.6.1 phasing detection</a></li>
  2349. <li><a id="toc-Examples-199" href="#Examples-199">46.6.2 Examples</a></li>
  2350. </ul></li>
  2351. <li><a id="toc-avectorscope" href="#avectorscope">46.7 avectorscope</a>
  2352. <ul class="toc-numbered-mark">
  2353. <li><a id="toc-Examples-200" href="#Examples-200">46.7.1 Examples</a></li>
  2354. <li><a id="toc-Commands-161" href="#Commands-161">46.7.2 Commands</a></li>
  2355. </ul></li>
  2356. <li><a id="toc-bench_002c-abench" href="#bench_002c-abench">46.8 bench, abench</a>
  2357. <ul class="toc-numbered-mark">
  2358. <li><a id="toc-Examples-201" href="#Examples-201">46.8.1 Examples</a></li>
  2359. </ul></li>
  2360. <li><a id="toc-concat-3" href="#concat-3">46.9 concat</a>
  2361. <ul class="toc-numbered-mark">
  2362. <li><a id="toc-Examples-202" href="#Examples-202">46.9.1 Examples</a></li>
  2363. <li><a id="toc-Commands-162" href="#Commands-162">46.9.2 Commands</a></li>
  2364. </ul></li>
  2365. <li><a id="toc-ebur128-1" href="#ebur128-1">46.10 ebur128</a>
  2366. <ul class="toc-numbered-mark">
  2367. <li><a id="toc-Examples-203" href="#Examples-203">46.10.1 Examples</a></li>
  2368. </ul></li>
  2369. <li><a id="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">46.11 interleave, ainterleave</a>
  2370. <ul class="toc-numbered-mark">
  2371. <li><a id="toc-Examples-204" href="#Examples-204">46.11.1 Examples</a></li>
  2372. </ul></li>
  2373. <li><a id="toc-latency_002c-alatency" href="#latency_002c-alatency">46.12 latency, alatency</a></li>
  2374. <li><a id="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">46.13 metadata, ametadata</a>
  2375. <ul class="toc-numbered-mark">
  2376. <li><a id="toc-Examples-205" href="#Examples-205">46.13.1 Examples</a></li>
  2377. </ul></li>
  2378. <li><a id="toc-perms_002c-aperms" href="#perms_002c-aperms">46.14 perms, aperms</a></li>
  2379. <li><a id="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">46.15 realtime, arealtime</a>
  2380. <ul class="toc-numbered-mark">
  2381. <li><a id="toc-Commands-163" href="#Commands-163">46.15.1 Commands</a></li>
  2382. </ul></li>
  2383. <li><a id="toc-segment_002c-asegment" href="#segment_002c-asegment">46.16 segment, asegment</a>
  2384. <ul class="toc-numbered-mark">
  2385. <li><a id="toc-Examples-206" href="#Examples-206">46.16.1 Examples</a></li>
  2386. </ul></li>
  2387. <li><a id="toc-select_002c-aselect" href="#select_002c-aselect">46.17 select, aselect</a>
  2388. <ul class="toc-numbered-mark">
  2389. <li><a id="toc-Examples-207" href="#Examples-207">46.17.1 Examples</a></li>
  2390. </ul></li>
  2391. <li><a id="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">46.18 sendcmd, asendcmd</a>
  2392. <ul class="toc-numbered-mark">
  2393. <li><a id="toc-Commands-syntax" href="#Commands-syntax">46.18.1 Commands syntax</a></li>
  2394. <li><a id="toc-Examples-208" href="#Examples-208">46.18.2 Examples</a></li>
  2395. </ul></li>
  2396. <li><a id="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">46.19 setpts, asetpts</a>
  2397. <ul class="toc-numbered-mark">
  2398. <li><a id="toc-Examples-209" href="#Examples-209">46.19.1 Examples</a></li>
  2399. <li><a id="toc-Commands-164" href="#Commands-164">46.19.2 Commands</a></li>
  2400. </ul></li>
  2401. <li><a id="toc-setrange" href="#setrange">46.20 setrange</a></li>
  2402. <li><a id="toc-settb_002c-asettb" href="#settb_002c-asettb">46.21 settb, asettb</a>
  2403. <ul class="toc-numbered-mark">
  2404. <li><a id="toc-Examples-210" href="#Examples-210">46.21.1 Examples</a></li>
  2405. </ul></li>
  2406. <li><a id="toc-showcqt" href="#showcqt">46.22 showcqt</a>
  2407. <ul class="toc-numbered-mark">
  2408. <li><a id="toc-Examples-211" href="#Examples-211">46.22.1 Examples</a></li>
  2409. </ul></li>
  2410. <li><a id="toc-showcwt" href="#showcwt">46.23 showcwt</a></li>
  2411. <li><a id="toc-showfreqs" href="#showfreqs">46.24 showfreqs</a></li>
  2412. <li><a id="toc-showspatial" href="#showspatial">46.25 showspatial</a></li>
  2413. <li><a id="toc-showspectrum-1" href="#showspectrum-1">46.26 showspectrum</a>
  2414. <ul class="toc-numbered-mark">
  2415. <li><a id="toc-Examples-212" href="#Examples-212">46.26.1 Examples</a></li>
  2416. </ul></li>
  2417. <li><a id="toc-showspectrumpic" href="#showspectrumpic">46.27 showspectrumpic</a>
  2418. <ul class="toc-numbered-mark">
  2419. <li><a id="toc-Examples-213" href="#Examples-213">46.27.1 Examples</a></li>
  2420. </ul></li>
  2421. <li><a id="toc-showvolume" href="#showvolume">46.28 showvolume</a></li>
  2422. <li><a id="toc-showwaves" href="#showwaves">46.29 showwaves</a>
  2423. <ul class="toc-numbered-mark">
  2424. <li><a id="toc-Examples-214" href="#Examples-214">46.29.1 Examples</a></li>
  2425. </ul></li>
  2426. <li><a id="toc-showwavespic" href="#showwavespic">46.30 showwavespic</a>
  2427. <ul class="toc-numbered-mark">
  2428. <li><a id="toc-Examples-215" href="#Examples-215">46.30.1 Examples</a></li>
  2429. </ul></li>
  2430. <li><a id="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">46.31 sidedata, asidedata</a></li>
  2431. <li><a id="toc-spectrumsynth" href="#spectrumsynth">46.32 spectrumsynth</a>
  2432. <ul class="toc-numbered-mark">
  2433. <li><a id="toc-Examples-216" href="#Examples-216">46.32.1 Examples</a></li>
  2434. </ul></li>
  2435. <li><a id="toc-split_002c-asplit" href="#split_002c-asplit">46.33 split, asplit</a>
  2436. <ul class="toc-numbered-mark">
  2437. <li><a id="toc-Examples-217" href="#Examples-217">46.33.1 Examples</a></li>
  2438. </ul></li>
  2439. <li><a id="toc-zmq_002c-azmq" href="#zmq_002c-azmq">46.34 zmq, azmq</a>
  2440. <ul class="toc-numbered-mark">
  2441. <li><a id="toc-Examples-218" href="#Examples-218">46.34.1 Examples</a></li>
  2442. </ul></li>
  2443. </ul></li>
  2444. <li><a id="toc-Multimedia-Sources" href="#Multimedia-Sources">47 Multimedia Sources</a>
  2445. <ul class="toc-numbered-mark">
  2446. <li><a id="toc-amovie" href="#amovie">47.1 amovie</a></li>
  2447. <li><a id="toc-avsynctest" href="#avsynctest">47.2 avsynctest</a>
  2448. <ul class="toc-numbered-mark">
  2449. <li><a id="toc-Commands-165" href="#Commands-165">47.2.1 Commands</a></li>
  2450. </ul></li>
  2451. <li><a id="toc-movie-1" href="#movie-1">47.3 movie</a>
  2452. <ul class="toc-numbered-mark">
  2453. <li><a id="toc-Examples-219" href="#Examples-219">47.3.1 Examples</a></li>
  2454. <li><a id="toc-Commands-166" href="#Commands-166">47.3.2 Commands</a></li>
  2455. </ul></li>
  2456. </ul></li>
  2457. <li><a id="toc-External-libraries" href="#External-libraries">48 External libraries</a>
  2458. <ul class="toc-numbered-mark">
  2459. <li><a id="toc-Alliance-for-Open-Media-_0028AOM_0029" href="#Alliance-for-Open-Media-_0028AOM_0029">48.1 Alliance for Open Media (AOM)</a></li>
  2460. <li><a id="toc-AMD-AMF_002fVCE" href="#AMD-AMF_002fVCE">48.2 AMD AMF/VCE</a></li>
  2461. <li><a id="toc-AviSynth" href="#AviSynth">48.3 AviSynth</a></li>
  2462. <li><a id="toc-Chromaprint" href="#Chromaprint">48.4 Chromaprint</a></li>
  2463. <li><a id="toc-codec2-1" href="#codec2-1">48.5 codec2</a></li>
  2464. <li><a id="toc-dav1d" href="#dav1d">48.6 dav1d</a></li>
  2465. <li><a id="toc-davs2" href="#davs2">48.7 davs2</a></li>
  2466. <li><a id="toc-uavs3d" href="#uavs3d">48.8 uavs3d</a></li>
  2467. <li><a id="toc-Game-Music-Emu" href="#Game-Music-Emu">48.9 Game Music Emu</a></li>
  2468. <li><a id="toc-Intel-QuickSync-Video" href="#Intel-QuickSync-Video">48.10 Intel QuickSync Video</a></li>
  2469. <li><a id="toc-Kvazaar" href="#Kvazaar">48.11 Kvazaar</a></li>
  2470. <li><a id="toc-LAME" href="#LAME">48.12 LAME</a></li>
  2471. <li><a id="toc-libilbc-1" href="#libilbc-1">48.13 libilbc</a></li>
  2472. <li><a id="toc-libjxl-1" href="#libjxl-1">48.14 libjxl</a></li>
  2473. <li><a id="toc-libvpx-1" href="#libvpx-1">48.15 libvpx</a></li>
  2474. <li><a id="toc-ModPlug" href="#ModPlug">48.16 ModPlug</a></li>
  2475. <li><a id="toc-OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">48.17 OpenCORE, VisualOn, and Fraunhofer libraries</a>
  2476. <ul class="toc-numbered-mark">
  2477. <li><a id="toc-OpenCORE-AMR" href="#OpenCORE-AMR">48.17.1 OpenCORE AMR</a></li>
  2478. <li><a id="toc-VisualOn-AMR_002dWB-encoder-library" href="#VisualOn-AMR_002dWB-encoder-library">48.17.2 VisualOn AMR-WB encoder library</a></li>
  2479. <li><a id="toc-Fraunhofer-AAC-library" href="#Fraunhofer-AAC-library">48.17.3 Fraunhofer AAC library</a></li>
  2480. </ul></li>
  2481. <li><a id="toc-OpenH264" href="#OpenH264">48.18 OpenH264</a></li>
  2482. <li><a id="toc-OpenJPEG" href="#OpenJPEG">48.19 OpenJPEG</a></li>
  2483. <li><a id="toc-rav1e" href="#rav1e">48.20 rav1e</a></li>
  2484. <li><a id="toc-SVT_002dAV1" href="#SVT_002dAV1">48.21 SVT-AV1</a></li>
  2485. <li><a id="toc-TwoLAME" href="#TwoLAME">48.22 TwoLAME</a></li>
  2486. <li><a id="toc-VapourSynth" href="#VapourSynth">48.23 VapourSynth</a></li>
  2487. <li><a id="toc-x264" href="#x264">48.24 x264</a></li>
  2488. <li><a id="toc-x265" href="#x265">48.25 x265</a></li>
  2489. <li><a id="toc-xavs" href="#xavs">48.26 xavs</a></li>
  2490. <li><a id="toc-xavs2" href="#xavs2">48.27 xavs2</a></li>
  2491. <li><a id="toc-eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029" href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029">48.28 eXtra-fast Essential Video Encoder (XEVE)</a></li>
  2492. <li><a id="toc-eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029" href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029">48.29 eXtra-fast Essential Video Decoder (XEVD)</a></li>
  2493. <li><a id="toc-ZVBI" href="#ZVBI">48.30 ZVBI</a></li>
  2494. </ul></li>
  2495. <li><a id="toc-Supported-File-Formats_002c-Codecs-or-Features" href="#Supported-File-Formats_002c-Codecs-or-Features">49 Supported File Formats, Codecs or Features</a>
  2496. <ul class="toc-numbered-mark">
  2497. <li><a id="toc-File-Formats" href="#File-Formats">49.1 File Formats</a></li>
  2498. <li><a id="toc-Image-Formats" href="#Image-Formats">49.2 Image Formats</a></li>
  2499. <li><a id="toc-Video-Codecs" href="#Video-Codecs">49.3 Video Codecs</a></li>
  2500. <li><a id="toc-Audio-Codecs" href="#Audio-Codecs">49.4 Audio Codecs</a></li>
  2501. <li><a id="toc-Subtitle-Formats" href="#Subtitle-Formats">49.5 Subtitle Formats</a></li>
  2502. <li><a id="toc-Network-Protocols" href="#Network-Protocols">49.6 Network Protocols</a></li>
  2503. <li><a id="toc-Input_002fOutput-Devices" href="#Input_002fOutput-Devices">49.7 Input/Output Devices</a></li>
  2504. <li><a id="toc-Timecode" href="#Timecode">49.8 Timecode</a></li>
  2505. </ul></li>
  2506. <li><a id="toc-See-Also" href="#See-Also">50 See Also</a></li>
  2507. <li><a id="toc-Authors" href="#Authors">51 Authors</a></li>
  2508. </ul>
  2509. </div>
  2510. </div>
  2511. <ul class="mini-toc">
  2512. <li><a href="#Synopsis" accesskey="1">Synopsis</a></li>
  2513. <li><a href="#Description" accesskey="2">Description</a></li>
  2514. <li><a href="#Detailed-description" accesskey="3">Detailed description</a></li>
  2515. <li><a href="#Stream-selection" accesskey="4">Stream selection</a></li>
  2516. <li><a href="#Options" accesskey="5">Options</a></li>
  2517. <li><a href="#Examples-1" accesskey="6">Examples</a></li>
  2518. <li><a href="#Syntax" accesskey="7">Syntax</a></li>
  2519. <li><a href="#Expression-Evaluation" accesskey="8">Expression Evaluation</a></li>
  2520. <li><a href="#Codec-Options" accesskey="9">Codec Options</a></li>
  2521. <li><a href="#Decoders">Decoders</a></li>
  2522. <li><a href="#Video-Decoders">Video Decoders</a></li>
  2523. <li><a href="#Audio-Decoders">Audio Decoders</a></li>
  2524. <li><a href="#Subtitles-Decoders">Subtitles Decoders</a></li>
  2525. <li><a href="#Encoders">Encoders</a></li>
  2526. <li><a href="#Audio-Encoders">Audio Encoders</a></li>
  2527. <li><a href="#Video-Encoders">Video Encoders</a></li>
  2528. <li><a href="#Subtitles-Encoders">Subtitles Encoders</a></li>
  2529. <li><a href="#Bitstream-Filters">Bitstream Filters</a></li>
  2530. <li><a href="#Format-Options">Format Options</a></li>
  2531. <li><a href="#Demuxers">Demuxers</a></li>
  2532. <li><a href="#Muxers">Muxers</a></li>
  2533. <li><a href="#Metadata-1">Metadata</a></li>
  2534. <li><a href="#Protocol-Options">Protocol Options</a></li>
  2535. <li><a href="#Protocols">Protocols</a></li>
  2536. <li><a href="#Device-Options">Device Options</a></li>
  2537. <li><a href="#Input-Devices">Input Devices</a></li>
  2538. <li><a href="#Output-Devices">Output Devices</a></li>
  2539. <li><a href="#Resampler-Options">Resampler Options</a></li>
  2540. <li><a href="#Scaler-Options">Scaler Options</a></li>
  2541. <li><a href="#Filtering-Introduction">Filtering Introduction</a></li>
  2542. <li><a href="#graph2dot">graph2dot</a></li>
  2543. <li><a href="#Filtergraph-description">Filtergraph description</a></li>
  2544. <li><a href="#Timeline-editing">Timeline editing</a></li>
  2545. <li><a href="#Changing-options-at-runtime-with-a-command">Changing options at runtime with a command</a></li>
  2546. <li><a href="#Options-for-filters-with-several-inputs-_0028framesync_0029">Options for filters with several inputs (framesync)</a></li>
  2547. <li><a href="#Audio-Filters">Audio Filters</a></li>
  2548. <li><a href="#Audio-Sources">Audio Sources</a></li>
  2549. <li><a href="#Audio-Sinks">Audio Sinks</a></li>
  2550. <li><a href="#Video-Filters">Video Filters</a></li>
  2551. <li><a href="#OpenCL-Video-Filters">OpenCL Video Filters</a></li>
  2552. <li><a href="#VAAPI-Video-Filters">VAAPI Video Filters</a></li>
  2553. <li><a href="#Vulkan-Video-Filters">Vulkan Video Filters</a></li>
  2554. <li><a href="#QSV-Video-Filters">QSV Video Filters</a></li>
  2555. <li><a href="#Video-Sources">Video Sources</a></li>
  2556. <li><a href="#Video-Sinks">Video Sinks</a></li>
  2557. <li><a href="#Multimedia-Filters">Multimedia Filters</a></li>
  2558. <li><a href="#Multimedia-Sources">Multimedia Sources</a></li>
  2559. <li><a href="#External-libraries">External libraries</a></li>
  2560. <li><a href="#Supported-File-Formats_002c-Codecs-or-Features">Supported File Formats, Codecs or Features</a></li>
  2561. <li><a href="#See-Also">See Also</a></li>
  2562. <li><a href="#Authors">Authors</a></li>
  2563. </ul>
  2564. <div class="chapter-level-extent" id="Synopsis">
  2565. <h2 class="chapter"><span>1 Synopsis<a class="copiable-link" href="#Synopsis"> &para;</a></span></h2>
  2566. <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>} ...
  2567. </p>
  2568. </div>
  2569. <div class="chapter-level-extent" id="Description">
  2570. <h2 class="chapter"><span>2 Description<a class="copiable-link" href="#Description"> &para;</a></span></h2>
  2571. <p><code class="command">ffmpeg</code> is a universal media converter. It can read a wide variety of
  2572. inputs - including live grabbing/recording devices - filter, and transcode them
  2573. into a plethora of output formats.
  2574. </p>
  2575. <p><code class="command">ffmpeg</code> reads from an arbitrary number of input &quot;files&quot; (which can be regular
  2576. files, pipes, network streams, grabbing devices, etc.), specified by the
  2577. <code class="code">-i</code> option, and writes to an arbitrary number of output &quot;files&quot;, which are
  2578. specified by a plain output url. Anything found on the command line which
  2579. cannot be interpreted as an option is considered to be an output url.
  2580. </p>
  2581. <p>Each input or output url can, in principle, contain any number of streams of
  2582. different types (video/audio/subtitle/attachment/data). The allowed number and/or
  2583. types of streams may be limited by the container format. Selecting which
  2584. streams from which inputs will go into which output is either done automatically
  2585. or with the <code class="code">-map</code> option (see the Stream selection chapter).
  2586. </p>
  2587. <p>To refer to input files in options, you must use their indices (0-based). E.g.
  2588. the first input file is <code class="code">0</code>, the second is <code class="code">1</code>, etc. Similarly, streams
  2589. within a file are referred to by their indices. E.g. <code class="code">2:3</code> refers to the
  2590. fourth stream in the third input file. Also see the Stream specifiers chapter.
  2591. </p>
  2592. <p>As a general rule, options are applied to the next specified
  2593. file. Therefore, order is important, and you can have the same
  2594. option on the command line multiple times. Each occurrence is
  2595. then applied to the next input or output file.
  2596. Exceptions from this rule are the global options (e.g. verbosity level),
  2597. which should be specified first.
  2598. </p>
  2599. <p>Do not mix input and output files &ndash; first specify all input files, then all
  2600. output files. Also do not mix options which belong to different files. All
  2601. options apply ONLY to the next input or output file and are reset between files.
  2602. </p>
  2603. <p>Some simple examples follow.
  2604. </p>
  2605. <ul class="itemize mark-bullet">
  2606. <li>Convert an input media file to a different format, by re-encoding media streams:
  2607. <div class="example">
  2608. <pre class="example-preformatted">ffmpeg -i input.avi output.mp4
  2609. </pre></div>
  2610. </li><li>Set the video bitrate of the output file to 64 kbit/s:
  2611. <div class="example">
  2612. <pre class="example-preformatted">ffmpeg -i input.avi -b:v 64k -bufsize 64k output.mp4
  2613. </pre></div>
  2614. </li><li>Force the frame rate of the output file to 24 fps:
  2615. <div class="example">
  2616. <pre class="example-preformatted">ffmpeg -i input.avi -r 24 output.mp4
  2617. </pre></div>
  2618. </li><li>Force the frame rate of the input file (valid for raw formats only) to 1 fps and
  2619. the frame rate of the output file to 24 fps:
  2620. <div class="example">
  2621. <pre class="example-preformatted">ffmpeg -r 1 -i input.m2v -r 24 output.mp4
  2622. </pre></div>
  2623. </li></ul>
  2624. <p>The format option may be needed for raw input files.
  2625. </p>
  2626. </div>
  2627. <div class="chapter-level-extent" id="Detailed-description">
  2628. <h2 class="chapter"><span>3 Detailed description<a class="copiable-link" href="#Detailed-description"> &para;</a></span></h2>
  2629. <p>The transcoding process in <code class="command">ffmpeg</code> for each output can be described by
  2630. the following diagram:
  2631. </p>
  2632. <pre class="verbatim"> _______ ______________
  2633. | | | |
  2634. | input | demuxer | encoded data | decoder
  2635. | file | ---------&gt; | packets | -----+
  2636. |_______| |______________| |
  2637. v
  2638. _________
  2639. | |
  2640. | decoded |
  2641. | frames |
  2642. |_________|
  2643. ________ ______________ |
  2644. | | | | |
  2645. | output | &lt;-------- | encoded data | &lt;----+
  2646. | file | muxer | packets | encoder
  2647. |________| |______________|
  2648. </pre>
  2649. <p><code class="command">ffmpeg</code> calls the libavformat library (containing demuxers) to read
  2650. input files and get packets containing encoded data from them. When there are
  2651. multiple input files, <code class="command">ffmpeg</code> tries to keep them synchronized by
  2652. tracking lowest timestamp on any active input stream.
  2653. </p>
  2654. <p>Encoded packets are then passed to the decoder (unless streamcopy is selected
  2655. for the stream, see further for a description). The decoder produces
  2656. uncompressed frames (raw video/PCM audio/...) which can be processed further by
  2657. filtering (see next section). After filtering, the frames are passed to the
  2658. encoder, which encodes them and outputs encoded packets. Finally, those are
  2659. passed to the muxer, which writes the encoded packets to the output file.
  2660. </p>
  2661. <ul class="mini-toc">
  2662. <li><a href="#Filtering" accesskey="1">Filtering</a></li>
  2663. <li><a href="#Stream-copy" accesskey="2">Stream copy</a></li>
  2664. <li><a href="#Loopback-decoders" accesskey="3">Loopback decoders</a></li>
  2665. </ul>
  2666. <div class="section-level-extent" id="Filtering">
  2667. <h3 class="section"><span>3.1 Filtering<a class="copiable-link" href="#Filtering"> &para;</a></span></h3>
  2668. <p>Before encoding, <code class="command">ffmpeg</code> can process raw audio and video frames using
  2669. filters from the libavfilter library. Several chained filters form a filter
  2670. graph. <code class="command">ffmpeg</code> distinguishes between two types of filtergraphs:
  2671. simple and complex.
  2672. </p>
  2673. <ul class="mini-toc">
  2674. <li><a href="#Simple-filtergraphs" accesskey="1">Simple filtergraphs</a></li>
  2675. <li><a href="#Complex-filtergraphs" accesskey="2">Complex filtergraphs</a></li>
  2676. </ul>
  2677. <div class="subsection-level-extent" id="Simple-filtergraphs">
  2678. <h4 class="subsection"><span>3.1.1 Simple filtergraphs<a class="copiable-link" href="#Simple-filtergraphs"> &para;</a></span></h4>
  2679. <p>Simple filtergraphs are those that have exactly one input and output, both of
  2680. the same type. In the above diagram they can be represented by simply inserting
  2681. an additional step between decoding and encoding:
  2682. </p>
  2683. <pre class="verbatim"> _________ ______________
  2684. | | | |
  2685. | decoded | | encoded data |
  2686. | frames |\ _ | packets |
  2687. |_________| \ /||______________|
  2688. \ __________ /
  2689. simple _\|| | / encoder
  2690. filtergraph | filtered |/
  2691. | frames |
  2692. |__________|
  2693. </pre>
  2694. <p>Simple filtergraphs are configured with the per-stream <samp class="option">-filter</samp> option
  2695. (with <samp class="option">-vf</samp> and <samp class="option">-af</samp> aliases for video and audio respectively).
  2696. A simple filtergraph for video can look for example like this:
  2697. </p>
  2698. <pre class="verbatim"> _______ _____________ _______ ________
  2699. | | | | | | | |
  2700. | input | ---&gt; | deinterlace | ---&gt; | scale | ---&gt; | output |
  2701. |_______| |_____________| |_______| |________|
  2702. </pre>
  2703. <p>Note that some filters change frame properties but not frame contents. E.g. the
  2704. <code class="code">fps</code> filter in the example above changes number of frames, but does not
  2705. touch the frame contents. Another example is the <code class="code">setpts</code> filter, which
  2706. only sets timestamps and otherwise passes the frames unchanged.
  2707. </p>
  2708. </div>
  2709. <div class="subsection-level-extent" id="Complex-filtergraphs">
  2710. <h4 class="subsection"><span>3.1.2 Complex filtergraphs<a class="copiable-link" href="#Complex-filtergraphs"> &para;</a></span></h4>
  2711. <p>Complex filtergraphs are those which cannot be described as simply a linear
  2712. processing chain applied to one stream. This is the case, for example, when the graph has
  2713. more than one input and/or output, or when output stream type is different from
  2714. input. They can be represented with the following diagram:
  2715. </p>
  2716. <pre class="verbatim"> _________
  2717. | |
  2718. | input 0 |\ __________
  2719. |_________| \ | |
  2720. \ _________ /| output 0 |
  2721. \ | | / |__________|
  2722. _________ \| complex | /
  2723. | | | |/
  2724. | input 1 |----&gt;| filter |\
  2725. |_________| | | \ __________
  2726. /| graph | \ | |
  2727. / | | \| output 1 |
  2728. _________ / |_________| |__________|
  2729. | | /
  2730. | input 2 |/
  2731. |_________|
  2732. </pre>
  2733. <p>Complex filtergraphs are configured with the <samp class="option">-filter_complex</samp> option.
  2734. Note that this option is global, since a complex filtergraph, by its nature,
  2735. cannot be unambiguously associated with a single stream or file.
  2736. </p>
  2737. <p>The <samp class="option">-lavfi</samp> option is equivalent to <samp class="option">-filter_complex</samp>.
  2738. </p>
  2739. <p>A trivial example of a complex filtergraph is the <code class="code">overlay</code> filter, which
  2740. has two video inputs and one video output, containing one video overlaid on top
  2741. of the other. Its audio counterpart is the <code class="code">amix</code> filter.
  2742. </p>
  2743. </div>
  2744. </div>
  2745. <div class="section-level-extent" id="Stream-copy">
  2746. <h3 class="section"><span>3.2 Stream copy<a class="copiable-link" href="#Stream-copy"> &para;</a></span></h3>
  2747. <p>Stream copy is a mode selected by supplying the <code class="code">copy</code> parameter to the
  2748. <samp class="option">-codec</samp> option. It makes <code class="command">ffmpeg</code> omit the decoding and encoding
  2749. step for the specified stream, so it does only demuxing and muxing. It is useful
  2750. for changing the container format or modifying container-level metadata. The
  2751. diagram above will, in this case, simplify to this:
  2752. </p>
  2753. <pre class="verbatim"> _______ ______________ ________
  2754. | | | | | |
  2755. | input | demuxer | encoded data | muxer | output |
  2756. | file | ---------&gt; | packets | -------&gt; | file |
  2757. |_______| |______________| |________|
  2758. </pre>
  2759. <p>Since there is no decoding or encoding, it is very fast and there is no quality
  2760. loss. However, it might not work in some cases because of many factors. Applying
  2761. filters is obviously also impossible, since filters work on uncompressed data.
  2762. </p>
  2763. </div>
  2764. <div class="section-level-extent" id="Loopback-decoders">
  2765. <h3 class="section"><span>3.3 Loopback decoders<a class="copiable-link" href="#Loopback-decoders"> &para;</a></span></h3>
  2766. <p>While decoders are normally associated with demuxer streams, it is also possible
  2767. to create &quot;loopback&quot; decoders that decode the output from some encoder and allow
  2768. it to be fed back to complex filtergraphs. This is done with the <code class="code">-dec</code>
  2769. directive, which takes as a parameter the index of the output stream that should
  2770. be decoded. Every such directive creates a new loopback decoder, indexed with
  2771. successive integers starting at zero. These indices should then be used to refer
  2772. to loopback decoders in complex filtergraph link labels, as described in the
  2773. documentation for <samp class="option">-filter_complex</samp>.
  2774. </p>
  2775. <p>E.g. the following example:
  2776. </p>
  2777. <div class="example">
  2778. <pre class="example-preformatted">ffmpeg -i INPUT \
  2779. -map 0:v:0 -c:v libx264 -crf 45 -f null - \
  2780. -dec 0:0 -filter_complex '[0:v][dec:0]hstack[stack]' \
  2781. -map '[stack]' -c:v ffv1 OUTPUT
  2782. </pre></div>
  2783. <p>reads an input video and
  2784. </p><ul class="itemize mark-bullet">
  2785. <li>(line 2) encodes it with <code class="code">libx264</code> at low quality;
  2786. </li><li>(line 3) decodes this encoded stream and places it side by side with the
  2787. original input video;
  2788. </li><li>(line 4) combined video is then losslessly encoded and written into
  2789. <samp class="file">OUTPUT</samp>.
  2790. </li></ul>
  2791. </div>
  2792. </div>
  2793. <div class="chapter-level-extent" id="Stream-selection">
  2794. <h2 class="chapter"><span>4 Stream selection<a class="copiable-link" href="#Stream-selection"> &para;</a></span></h2>
  2795. <p><code class="command">ffmpeg</code> provides the <code class="code">-map</code> option for manual control of stream selection in each
  2796. output file. Users can skip <code class="code">-map</code> and let ffmpeg perform automatic stream selection as
  2797. described below. The <code class="code">-vn / -an / -sn / -dn</code> options can be used to skip inclusion of
  2798. video, audio, subtitle and data streams respectively, whether manually mapped or automatically
  2799. selected, except for those streams which are outputs of complex filtergraphs.
  2800. </p>
  2801. <ul class="mini-toc">
  2802. <li><a href="#Description-1" accesskey="1">Description</a></li>
  2803. <li><a href="#Examples" accesskey="2">Examples</a></li>
  2804. </ul>
  2805. <div class="section-level-extent" id="Description-1">
  2806. <h3 class="section"><span>4.1 Description<a class="copiable-link" href="#Description-1"> &para;</a></span></h3>
  2807. <p>The sub-sections that follow describe the various rules that are involved in stream selection.
  2808. The examples that follow next show how these rules are applied in practice.
  2809. </p>
  2810. <p>While every effort is made to accurately reflect the behavior of the program, FFmpeg is under
  2811. continuous development and the code may have changed since the time of this writing.
  2812. </p>
  2813. <ul class="mini-toc">
  2814. <li><a href="#Automatic-stream-selection" accesskey="1">Automatic stream selection</a></li>
  2815. <li><a href="#Manual-stream-selection" accesskey="2">Manual stream selection</a></li>
  2816. <li><a href="#Complex-filtergraphs-1" accesskey="3">Complex filtergraphs</a></li>
  2817. <li><a href="#Stream-handling" accesskey="4">Stream handling</a></li>
  2818. </ul>
  2819. <div class="subsection-level-extent" id="Automatic-stream-selection">
  2820. <h4 class="subsection"><span>4.1.1 Automatic stream selection<a class="copiable-link" href="#Automatic-stream-selection"> &para;</a></span></h4>
  2821. <p>In the absence of any map options for a particular output file, ffmpeg inspects the output
  2822. format to check which type of streams can be included in it, viz. video, audio and/or
  2823. subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available,
  2824. from among all the inputs.
  2825. </p>
  2826. <p>It will select that stream based upon the following criteria:
  2827. </p><ul class="itemize mark-bullet">
  2828. <li>for video, it is the stream with the highest resolution,
  2829. </li><li>for audio, it is the stream with the most channels,
  2830. </li><li>for subtitles, it is the first subtitle stream found but there&rsquo;s a caveat.
  2831. The output format&rsquo;s default subtitle encoder can be either text-based or image-based,
  2832. and only a subtitle stream of the same type will be chosen.
  2833. </li></ul>
  2834. <p>In the case where several streams of the same type rate equally, the stream with the lowest
  2835. index is chosen.
  2836. </p>
  2837. <p>Data or attachment streams are not automatically selected and can only be included
  2838. using <code class="code">-map</code>.
  2839. </p></div>
  2840. <div class="subsection-level-extent" id="Manual-stream-selection">
  2841. <h4 class="subsection"><span>4.1.2 Manual stream selection<a class="copiable-link" href="#Manual-stream-selection"> &para;</a></span></h4>
  2842. <p>When <code class="code">-map</code> is used, only user-mapped streams are included in that output file,
  2843. with one possible exception for filtergraph outputs described below.
  2844. </p>
  2845. </div>
  2846. <div class="subsection-level-extent" id="Complex-filtergraphs-1">
  2847. <h4 class="subsection"><span>4.1.3 Complex filtergraphs<a class="copiable-link" href="#Complex-filtergraphs-1"> &para;</a></span></h4>
  2848. <p>If there are any complex filtergraph output streams with unlabeled pads, they will be added
  2849. to the first output file. This will lead to a fatal error if the stream type is not supported
  2850. by the output format. In the absence of the map option, the inclusion of these streams leads
  2851. to the automatic stream selection of their types being skipped. If map options are present,
  2852. these filtergraph streams are included in addition to the mapped streams.
  2853. </p>
  2854. <p>Complex filtergraph output streams with labeled pads must be mapped once and exactly once.
  2855. </p>
  2856. </div>
  2857. <div class="subsection-level-extent" id="Stream-handling">
  2858. <h4 class="subsection"><span>4.1.4 Stream handling<a class="copiable-link" href="#Stream-handling"> &para;</a></span></h4>
  2859. <p>Stream handling is independent of stream selection, with an exception for subtitles described
  2860. below. Stream handling is set via the <code class="code">-codec</code> option addressed to streams within a
  2861. specific <em class="emph">output</em> file. In particular, codec options are applied by ffmpeg after the
  2862. stream selection process and thus do not influence the latter. If no <code class="code">-codec</code> option is
  2863. specified for a stream type, ffmpeg will select the default encoder registered by the output
  2864. file muxer.
  2865. </p>
  2866. <p>An exception exists for subtitles. If a subtitle encoder is specified for an output file, the
  2867. first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate
  2868. if the specified encoder can convert the selected stream or if the converted stream is acceptable
  2869. within the output format. This applies generally as well: when the user sets an encoder manually,
  2870. the stream selection process cannot check if the encoded stream can be muxed into the output file.
  2871. If it cannot, ffmpeg will abort and <em class="emph">all</em> output files will fail to be processed.
  2872. </p>
  2873. </div>
  2874. </div>
  2875. <div class="section-level-extent" id="Examples">
  2876. <h3 class="section"><span>4.2 Examples<a class="copiable-link" href="#Examples"> &para;</a></span></h3>
  2877. <p>The following examples illustrate the behavior, quirks and limitations of ffmpeg&rsquo;s stream
  2878. selection methods.
  2879. </p>
  2880. <p>They assume the following three input files.
  2881. </p>
  2882. <pre class="verbatim">
  2883. input file 'A.avi'
  2884. stream 0: video 640x360
  2885. stream 1: audio 2 channels
  2886. input file 'B.mp4'
  2887. stream 0: video 1920x1080
  2888. stream 1: audio 2 channels
  2889. stream 2: subtitles (text)
  2890. stream 3: audio 5.1 channels
  2891. stream 4: subtitles (text)
  2892. input file 'C.mkv'
  2893. stream 0: video 1280x720
  2894. stream 1: audio 2 channels
  2895. stream 2: subtitles (image)
  2896. </pre>
  2897. <h4 class="subsubheading" id="Example_003a-automatic-stream-selection"><span>Example: automatic stream selection<a class="copiable-link" href="#Example_003a-automatic-stream-selection"> &para;</a></span></h4>
  2898. <div class="example">
  2899. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
  2900. </pre></div>
  2901. <p>There are three output files specified, and for the first two, no <code class="code">-map</code> options
  2902. are set, so ffmpeg will select streams for these two files automatically.
  2903. </p>
  2904. <p><samp class="file">out1.mkv</samp> is a Matroska container file and accepts video, audio and subtitle streams,
  2905. so ffmpeg will try to select one of each type.<br>
  2906. For video, it will select <code class="code">stream 0</code> from <samp class="file">B.mp4</samp>, which has the highest
  2907. resolution among all the input video streams.<br>
  2908. For audio, it will select <code class="code">stream 3</code> from <samp class="file">B.mp4</samp>, since it has the greatest
  2909. number of channels.<br>
  2910. For subtitles, it will select <code class="code">stream 2</code> from <samp class="file">B.mp4</samp>, which is the first subtitle
  2911. stream from among <samp class="file">A.avi</samp> and <samp class="file">B.mp4</samp>.
  2912. </p>
  2913. <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
  2914. selected.
  2915. </p>
  2916. <p>For <samp class="file">out3.mov</samp>, since a <code class="code">-map</code> option is set, no automatic stream selection will
  2917. occur. The <code class="code">-map 1:a</code> option will select all audio streams from the second input
  2918. <samp class="file">B.mp4</samp>. No other streams will be included in this output file.
  2919. </p>
  2920. <p>For the first two outputs, all included streams will be transcoded. The encoders chosen will
  2921. be the default ones registered by each output format, which may not match the codec of the
  2922. selected input streams.
  2923. </p>
  2924. <p>For the third output, codec option for audio streams has been set
  2925. to <code class="code">copy</code>, so no decoding-filtering-encoding operations will occur, or <em class="emph">can</em> occur.
  2926. Packets of selected streams shall be conveyed from the input file and muxed within the output
  2927. file.
  2928. </p>
  2929. <h4 class="subsubheading" id="Example_003a-automatic-subtitles-selection"><span>Example: automatic subtitles selection<a class="copiable-link" href="#Example_003a-automatic-subtitles-selection"> &para;</a></span></h4>
  2930. <div class="example">
  2931. <pre class="example-preformatted">ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
  2932. </pre></div>
  2933. <p>Although <samp class="file">out1.mkv</samp> is a Matroska container file which accepts subtitle streams, only a
  2934. video and audio stream shall be selected. The subtitle stream of <samp class="file">C.mkv</samp> is image-based
  2935. and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation
  2936. for the subtitles is expected to fail and hence the stream isn&rsquo;t selected. However, in
  2937. <samp class="file">out2.mkv</samp>, a subtitle encoder is specified in the command and so, the subtitle stream is
  2938. selected, in addition to the video stream. The presence of <code class="code">-an</code> disables audio stream
  2939. selection for <samp class="file">out2.mkv</samp>.
  2940. </p>
  2941. <h4 class="subsubheading" id="Example_003a-unlabeled-filtergraph-outputs"><span>Example: unlabeled filtergraph outputs<a class="copiable-link" href="#Example_003a-unlabeled-filtergraph-outputs"> &para;</a></span></h4>
  2942. <div class="example">
  2943. <pre class="example-preformatted">ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex &quot;overlay&quot; out1.mp4 out2.srt
  2944. </pre></div>
  2945. <p>A filtergraph is setup here using the <code class="code">-filter_complex</code> option and consists of a single
  2946. video filter. The <code class="code">overlay</code> filter requires exactly two video inputs, but none are
  2947. specified, so the first two available video streams are used, those of <samp class="file">A.avi</samp> and
  2948. <samp class="file">C.mkv</samp>. The output pad of the filter has no label and so is sent to the first output file
  2949. <samp class="file">out1.mp4</samp>. Due to this, automatic selection of the video stream is skipped, which would
  2950. have selected the stream in <samp class="file">B.mp4</samp>. The audio stream with most channels viz. <code class="code">stream 3</code>
  2951. in <samp class="file">B.mp4</samp>, is chosen automatically. No subtitle stream is chosen however, since the MP4
  2952. format has no default subtitle encoder registered, and the user hasn&rsquo;t specified a subtitle encoder.
  2953. </p>
  2954. <p>The 2nd output file, <samp class="file">out2.srt</samp>, only accepts text-based subtitle streams. So, even though
  2955. the first subtitle stream available belongs to <samp class="file">C.mkv</samp>, it is image-based and hence skipped.
  2956. The selected stream, <code class="code">stream 2</code> in <samp class="file">B.mp4</samp>, is the first text-based subtitle stream.
  2957. </p>
  2958. <h4 class="subsubheading" id="Example_003a-labeled-filtergraph-outputs"><span>Example: labeled filtergraph outputs<a class="copiable-link" href="#Example_003a-labeled-filtergraph-outputs"> &para;</a></span></h4>
  2959. <div class="example">
  2960. <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; \
  2961. -map '[outv]' -an out1.mp4 \
  2962. out2.mkv \
  2963. -map '[outv]' -map 1:a:0 out3.mkv
  2964. </pre></div>
  2965. <p>The above command will fail, as the output pad labelled <code class="code">[outv]</code> has been mapped twice.
  2966. None of the output files shall be processed.
  2967. </p>
  2968. <div class="example">
  2969. <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; \
  2970. -an out1.mp4 \
  2971. out2.mkv \
  2972. -map 1:a:0 out3.mkv
  2973. </pre></div>
  2974. <p>This command above will also fail as the hue filter output has a label, <code class="code">[outv]</code>,
  2975. and hasn&rsquo;t been mapped anywhere.
  2976. </p>
  2977. <p>The command should be modified as follows,
  2978. </p><div class="example">
  2979. <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; \
  2980. -map '[outv1]' -an out1.mp4 \
  2981. out2.mkv \
  2982. -map '[outv2]' -map 1:a:0 out3.mkv
  2983. </pre></div>
  2984. <p>The video stream from <samp class="file">B.mp4</samp> is sent to the hue filter, whose output is cloned once using
  2985. the split filter, and both outputs labelled. Then a copy each is mapped to the first and third
  2986. output files.
  2987. </p>
  2988. <p>The overlay filter, requiring two video inputs, uses the first two unused video streams. Those
  2989. 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
  2990. sent to the first output file <samp class="file">out1.mp4</samp>, regardless of the presence of the <code class="code">-map</code> option.
  2991. </p>
  2992. <p>The aresample filter is sent the first unused audio stream, that of <samp class="file">A.avi</samp>. Since this filter
  2993. output is also unlabelled, it too is mapped to the first output file. The presence of <code class="code">-an</code>
  2994. only suppresses automatic or manual stream selection of audio streams, not outputs sent from
  2995. filtergraphs. Both these mapped streams shall be ordered before the mapped stream in <samp class="file">out1.mp4</samp>.
  2996. </p>
  2997. <p>The video, audio and subtitle streams mapped to <code class="code">out2.mkv</code> are entirely determined by
  2998. automatic stream selection.
  2999. </p>
  3000. <p><samp class="file">out3.mkv</samp> consists of the cloned video output from the hue filter and the first audio
  3001. stream from <samp class="file">B.mp4</samp>.
  3002. <br>
  3003. </p>
  3004. </div>
  3005. </div>
  3006. <div class="chapter-level-extent" id="Options">
  3007. <h2 class="chapter"><span>5 Options<a class="copiable-link" href="#Options"> &para;</a></span></h2>
  3008. <p>All the numerical options, if not specified otherwise, accept a string
  3009. representing a number as input, which may be followed by one of the SI
  3010. unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
  3011. </p>
  3012. <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
  3013. interpreted as a unit prefix for binary multiples, which are based on
  3014. powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
  3015. prefix multiplies the value by 8. This allows using, for example:
  3016. &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
  3017. </p>
  3018. <p>Options which do not take arguments are boolean options, and set the
  3019. corresponding value to true. They can be set to false by prefixing
  3020. the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
  3021. will set the boolean option with name &quot;foo&quot; to false.
  3022. </p>
  3023. <p>Options that take arguments support a special syntax where the argument given on
  3024. the command line is interpreted as a path to the file from which the actual
  3025. argument value is loaded. To use this feature, add a forward slash &rsquo;/&rsquo;
  3026. immediately before the option name (after the leading dash). E.g.
  3027. </p><div class="example">
  3028. <pre class="example-preformatted">ffmpeg -i INPUT -/filter:v filter.script OUTPUT
  3029. </pre></div>
  3030. <p>will load a filtergraph description from the file named <samp class="file">filter.script</samp>.
  3031. </p>
  3032. <a class="anchor" id="Stream-specifiers"></a><ul class="mini-toc">
  3033. <li><a href="#Stream-specifiers-1" accesskey="1">Stream specifiers</a></li>
  3034. <li><a href="#Generic-options" accesskey="2">Generic options</a></li>
  3035. <li><a href="#AVOptions" accesskey="3">AVOptions</a></li>
  3036. <li><a href="#Main-options" accesskey="4">Main options</a></li>
  3037. <li><a href="#Video-Options" accesskey="5">Video Options</a></li>
  3038. <li><a href="#Advanced-Video-options" accesskey="6">Advanced Video options</a></li>
  3039. <li><a href="#Audio-Options" accesskey="7">Audio Options</a></li>
  3040. <li><a href="#Advanced-Audio-options" accesskey="8">Advanced Audio options</a></li>
  3041. <li><a href="#Subtitle-options" accesskey="9">Subtitle options</a></li>
  3042. <li><a href="#Advanced-Subtitle-options">Advanced Subtitle options</a></li>
  3043. <li><a href="#Advanced-options">Advanced options</a></li>
  3044. <li><a href="#Preset-files">Preset files</a></li>
  3045. <li><a href="#vstats-file-format">vstats file format</a></li>
  3046. </ul>
  3047. <div class="section-level-extent" id="Stream-specifiers-1">
  3048. <h3 class="section"><span>5.1 Stream specifiers<a class="copiable-link" href="#Stream-specifiers-1"> &para;</a></span></h3>
  3049. <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  3050. are used to precisely specify which stream(s) a given option belongs to.
  3051. </p>
  3052. <p>A stream specifier is a string generally appended to the option name and
  3053. separated from it by a colon. E.g. <code class="code">-codec:a:1 ac3</code> contains the
  3054. <code class="code">a:1</code> stream specifier, which matches the second audio stream. Therefore, it
  3055. would select the ac3 codec for the second audio stream.
  3056. </p>
  3057. <p>A stream specifier can match several streams, so that the option is applied to all
  3058. of them. E.g. the stream specifier in <code class="code">-b:a 128k</code> matches all audio
  3059. streams.
  3060. </p>
  3061. <p>An empty stream specifier matches all streams. For example, <code class="code">-codec copy</code>
  3062. or <code class="code">-codec: copy</code> would copy all the streams without reencoding.
  3063. </p>
  3064. <p>Possible forms of stream specifiers are:
  3065. </p><dl class="table">
  3066. <dt><samp class="option"><var class="var">stream_index</var></samp></dt>
  3067. <dd><p>Matches the stream with this index. E.g. <code class="code">-threads:1 4</code> would set the
  3068. thread count for the second stream to 4. If <var class="var">stream_index</var> is used as an
  3069. additional stream specifier (see below), then it selects stream number
  3070. <var class="var">stream_index</var> from the matching streams. Stream numbering is based on the
  3071. order of the streams as detected by libavformat except when a stream group
  3072. specifier or program ID is also specified. In this case it is based on the
  3073. ordering of the streams in the group or program.
  3074. </p></dd>
  3075. <dt><samp class="option"><var class="var">stream_type</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  3076. <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;
  3077. for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
  3078. streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
  3079. thumbnails or cover arts. If <var class="var">additional_stream_specifier</var> is used, then
  3080. it matches streams which both have this type and match the
  3081. <var class="var">additional_stream_specifier</var>. Otherwise, it matches all streams of the
  3082. specified type.
  3083. </p></dd>
  3084. <dt><samp class="option">g:<var class="var">group_specifier</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  3085. <dd><p>Matches streams which are in the group with the specifier <var class="var">group_specifier</var>.
  3086. if <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  3087. are part of the group and match the <var class="var">additional_stream_specifier</var>.
  3088. <var class="var">group_specifier</var> may be one of the following:
  3089. </p><dl class="table">
  3090. <dt><samp class="option"><var class="var">group_index</var></samp></dt>
  3091. <dd><p>Match the stream with this group index.
  3092. </p></dd>
  3093. <dt><samp class="option">#<var class="var">group_id</var> or i:<var class="var">group_id</var></samp></dt>
  3094. <dd><p>Match the stream with this group id.
  3095. </p></dd>
  3096. </dl>
  3097. </dd>
  3098. <dt><samp class="option">p:<var class="var">program_id</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  3099. <dd><p>Matches streams which are in the program with the id <var class="var">program_id</var>. If
  3100. <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  3101. are part of the program and match the <var class="var">additional_stream_specifier</var>.
  3102. </p>
  3103. </dd>
  3104. <dt><samp class="option">#<var class="var">stream_id</var> or i:<var class="var">stream_id</var></samp></dt>
  3105. <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
  3106. </p></dd>
  3107. <dt><samp class="option">m:<var class="var">key</var>[:<var class="var">value</var>]</samp></dt>
  3108. <dd><p>Matches streams with the metadata tag <var class="var">key</var> having the specified value. If
  3109. <var class="var">value</var> is not given, matches streams that contain the given tag with any
  3110. value.
  3111. </p></dd>
  3112. <dt><samp class="option">u</samp></dt>
  3113. <dd><p>Matches streams with usable configuration, the codec must be defined and the
  3114. essential information such as video dimension or audio sample rate must be present.
  3115. </p>
  3116. <p>Note that in <code class="command">ffmpeg</code>, matching by metadata will only work properly for
  3117. input files.
  3118. </p></dd>
  3119. </dl>
  3120. </div>
  3121. <div class="section-level-extent" id="Generic-options">
  3122. <h3 class="section"><span>5.2 Generic options<a class="copiable-link" href="#Generic-options"> &para;</a></span></h3>
  3123. <p>These options are shared amongst the ff* tools.
  3124. </p>
  3125. <dl class="table">
  3126. <dt><samp class="option">-L</samp></dt>
  3127. <dd><p>Show license.
  3128. </p>
  3129. </dd>
  3130. <dt><samp class="option">-h, -?, -help, --help [<var class="var">arg</var>]</samp></dt>
  3131. <dd><p>Show help. An optional parameter may be specified to print help about a specific
  3132. item. If no argument is specified, only basic (non advanced) tool
  3133. options are shown.
  3134. </p>
  3135. <p>Possible values of <var class="var">arg</var> are:
  3136. </p><dl class="table">
  3137. <dt><samp class="option">long</samp></dt>
  3138. <dd><p>Print advanced tool options in addition to the basic tool options.
  3139. </p>
  3140. </dd>
  3141. <dt><samp class="option">full</samp></dt>
  3142. <dd><p>Print complete list of options, including shared and private options
  3143. for encoders, decoders, demuxers, muxers, filters, etc.
  3144. </p>
  3145. </dd>
  3146. <dt><samp class="option">decoder=<var class="var">decoder_name</var></samp></dt>
  3147. <dd><p>Print detailed information about the decoder named <var class="var">decoder_name</var>. Use the
  3148. <samp class="option">-decoders</samp> option to get a list of all decoders.
  3149. </p>
  3150. </dd>
  3151. <dt><samp class="option">encoder=<var class="var">encoder_name</var></samp></dt>
  3152. <dd><p>Print detailed information about the encoder named <var class="var">encoder_name</var>. Use the
  3153. <samp class="option">-encoders</samp> option to get a list of all encoders.
  3154. </p>
  3155. </dd>
  3156. <dt><samp class="option">demuxer=<var class="var">demuxer_name</var></samp></dt>
  3157. <dd><p>Print detailed information about the demuxer named <var class="var">demuxer_name</var>. Use the
  3158. <samp class="option">-formats</samp> option to get a list of all demuxers and muxers.
  3159. </p>
  3160. </dd>
  3161. <dt><samp class="option">muxer=<var class="var">muxer_name</var></samp></dt>
  3162. <dd><p>Print detailed information about the muxer named <var class="var">muxer_name</var>. Use the
  3163. <samp class="option">-formats</samp> option to get a list of all muxers and demuxers.
  3164. </p>
  3165. </dd>
  3166. <dt><samp class="option">filter=<var class="var">filter_name</var></samp></dt>
  3167. <dd><p>Print detailed information about the filter named <var class="var">filter_name</var>. Use the
  3168. <samp class="option">-filters</samp> option to get a list of all filters.
  3169. </p>
  3170. </dd>
  3171. <dt><samp class="option">bsf=<var class="var">bitstream_filter_name</var></samp></dt>
  3172. <dd><p>Print detailed information about the bitstream filter named <var class="var">bitstream_filter_name</var>.
  3173. Use the <samp class="option">-bsfs</samp> option to get a list of all bitstream filters.
  3174. </p>
  3175. </dd>
  3176. <dt><samp class="option">protocol=<var class="var">protocol_name</var></samp></dt>
  3177. <dd><p>Print detailed information about the protocol named <var class="var">protocol_name</var>.
  3178. Use the <samp class="option">-protocols</samp> option to get a list of all protocols.
  3179. </p></dd>
  3180. </dl>
  3181. </dd>
  3182. <dt><samp class="option">-version</samp></dt>
  3183. <dd><p>Show version.
  3184. </p>
  3185. </dd>
  3186. <dt><samp class="option">-buildconf</samp></dt>
  3187. <dd><p>Show the build configuration, one option per line.
  3188. </p>
  3189. </dd>
  3190. <dt><samp class="option">-formats</samp></dt>
  3191. <dd><p>Show available formats (including devices).
  3192. </p>
  3193. </dd>
  3194. <dt><samp class="option">-demuxers</samp></dt>
  3195. <dd><p>Show available demuxers.
  3196. </p>
  3197. </dd>
  3198. <dt><samp class="option">-muxers</samp></dt>
  3199. <dd><p>Show available muxers.
  3200. </p>
  3201. </dd>
  3202. <dt><samp class="option">-devices</samp></dt>
  3203. <dd><p>Show available devices.
  3204. </p>
  3205. </dd>
  3206. <dt><samp class="option">-codecs</samp></dt>
  3207. <dd><p>Show all codecs known to libavcodec.
  3208. </p>
  3209. <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
  3210. for what is more correctly called a media bitstream format.
  3211. </p>
  3212. </dd>
  3213. <dt><samp class="option">-decoders</samp></dt>
  3214. <dd><p>Show available decoders.
  3215. </p>
  3216. </dd>
  3217. <dt><samp class="option">-encoders</samp></dt>
  3218. <dd><p>Show all available encoders.
  3219. </p>
  3220. </dd>
  3221. <dt><samp class="option">-bsfs</samp></dt>
  3222. <dd><p>Show available bitstream filters.
  3223. </p>
  3224. </dd>
  3225. <dt><samp class="option">-protocols</samp></dt>
  3226. <dd><p>Show available protocols.
  3227. </p>
  3228. </dd>
  3229. <dt><samp class="option">-filters</samp></dt>
  3230. <dd><p>Show available libavfilter filters.
  3231. </p>
  3232. </dd>
  3233. <dt><samp class="option">-pix_fmts</samp></dt>
  3234. <dd><p>Show available pixel formats.
  3235. </p>
  3236. </dd>
  3237. <dt><samp class="option">-sample_fmts</samp></dt>
  3238. <dd><p>Show available sample formats.
  3239. </p>
  3240. </dd>
  3241. <dt><samp class="option">-layouts</samp></dt>
  3242. <dd><p>Show channel names and standard channel layouts.
  3243. </p>
  3244. </dd>
  3245. <dt><samp class="option">-dispositions</samp></dt>
  3246. <dd><p>Show stream dispositions.
  3247. </p>
  3248. </dd>
  3249. <dt><samp class="option">-colors</samp></dt>
  3250. <dd><p>Show recognized color names.
  3251. </p>
  3252. </dd>
  3253. <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>
  3254. <dd><p>Show autodetected sources of the input device.
  3255. Some devices may provide system-dependent source names that cannot be autodetected.
  3256. The returned list cannot be assumed to be always complete.
  3257. </p><div class="example">
  3258. <pre class="example-preformatted">ffmpeg -sources pulse,server=192.168.0.4
  3259. </pre></div>
  3260. </dd>
  3261. <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>
  3262. <dd><p>Show autodetected sinks of the output device.
  3263. Some devices may provide system-dependent sink names that cannot be autodetected.
  3264. The returned list cannot be assumed to be always complete.
  3265. </p><div class="example">
  3266. <pre class="example-preformatted">ffmpeg -sinks pulse,server=192.168.0.4
  3267. </pre></div>
  3268. </dd>
  3269. <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>
  3270. <dd><p>Set logging level and flags used by the library.
  3271. </p>
  3272. <p>The optional <var class="var">flags</var> prefix can consist of the following values:
  3273. </p><dl class="table">
  3274. <dt>&lsquo;<samp class="samp">repeat</samp>&rsquo;</dt>
  3275. <dd><p>Indicates that repeated log output should not be compressed to the first line
  3276. and the &quot;Last message repeated n times&quot; line will be omitted.
  3277. </p></dd>
  3278. <dt>&lsquo;<samp class="samp">level</samp>&rsquo;</dt>
  3279. <dd><p>Indicates that log output should add a <code class="code">[level]</code> prefix to each message
  3280. line. This can be used as an alternative to log coloring, e.g. when dumping the
  3281. log to file.
  3282. </p></dd>
  3283. </dl>
  3284. <p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
  3285. flag without affecting other <var class="var">flags</var> or changing <var class="var">loglevel</var>. When
  3286. setting both <var class="var">flags</var> and <var class="var">loglevel</var>, a &rsquo;+&rsquo; separator is expected
  3287. between the last <var class="var">flags</var> value and before <var class="var">loglevel</var>.
  3288. </p>
  3289. <p><var class="var">loglevel</var> is a string or a number containing one of the following values:
  3290. </p><dl class="table">
  3291. <dt>&lsquo;<samp class="samp">quiet, -8</samp>&rsquo;</dt>
  3292. <dd><p>Show nothing at all; be silent.
  3293. </p></dd>
  3294. <dt>&lsquo;<samp class="samp">panic, 0</samp>&rsquo;</dt>
  3295. <dd><p>Only show fatal errors which could lead the process to crash, such as
  3296. an assertion failure. This is not currently used for anything.
  3297. </p></dd>
  3298. <dt>&lsquo;<samp class="samp">fatal, 8</samp>&rsquo;</dt>
  3299. <dd><p>Only show fatal errors. These are errors after which the process absolutely
  3300. cannot continue.
  3301. </p></dd>
  3302. <dt>&lsquo;<samp class="samp">error, 16</samp>&rsquo;</dt>
  3303. <dd><p>Show all errors, including ones which can be recovered from.
  3304. </p></dd>
  3305. <dt>&lsquo;<samp class="samp">warning, 24</samp>&rsquo;</dt>
  3306. <dd><p>Show all warnings and errors. Any message related to possibly
  3307. incorrect or unexpected events will be shown.
  3308. </p></dd>
  3309. <dt>&lsquo;<samp class="samp">info, 32</samp>&rsquo;</dt>
  3310. <dd><p>Show informative messages during processing. This is in addition to
  3311. warnings and errors. This is the default value.
  3312. </p></dd>
  3313. <dt>&lsquo;<samp class="samp">verbose, 40</samp>&rsquo;</dt>
  3314. <dd><p>Same as <code class="code">info</code>, except more verbose.
  3315. </p></dd>
  3316. <dt>&lsquo;<samp class="samp">debug, 48</samp>&rsquo;</dt>
  3317. <dd><p>Show everything, including debugging information.
  3318. </p></dd>
  3319. <dt>&lsquo;<samp class="samp">trace, 56</samp>&rsquo;</dt>
  3320. </dl>
  3321. <p>For example to enable repeated log output, add the <code class="code">level</code> prefix, and set
  3322. <var class="var">loglevel</var> to <code class="code">verbose</code>:
  3323. </p><div class="example">
  3324. <pre class="example-preformatted">ffmpeg -loglevel repeat+level+verbose -i input output
  3325. </pre></div>
  3326. <p>Another example that enables repeated log output without affecting current
  3327. state of <code class="code">level</code> prefix flag or <var class="var">loglevel</var>:
  3328. </p><div class="example">
  3329. <pre class="example-preformatted">ffmpeg [...] -loglevel +repeat
  3330. </pre></div>
  3331. <p>By default the program logs to stderr. If coloring is supported by the
  3332. terminal, colors are used to mark errors and warnings. Log coloring
  3333. can be disabled setting the environment variable
  3334. <code class="env">AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
  3335. the environment variable <code class="env">AV_LOG_FORCE_COLOR</code>.
  3336. </p>
  3337. </dd>
  3338. <dt><samp class="option">-report</samp></dt>
  3339. <dd><p>Dump full command line and log output to a file named
  3340. <code class="code"><var class="var">program</var>-<var class="var">YYYYMMDD</var>-<var class="var">HHMMSS</var>.log</code> in the current
  3341. directory.
  3342. This file can be useful for bug reports.
  3343. It also implies <code class="code">-loglevel debug</code>.
  3344. </p>
  3345. <p>Setting the environment variable <code class="env">FFREPORT</code> to any value has the
  3346. same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
  3347. options will affect the report; option values must be escaped if they
  3348. contain special characters or the options delimiter &rsquo;:&rsquo; (see the
  3349. &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
  3350. </p>
  3351. <p>The following options are recognized:
  3352. </p><dl class="table">
  3353. <dt><samp class="option">file</samp></dt>
  3354. <dd><p>set the file name to use for the report; <code class="code">%p</code> is expanded to the name
  3355. of the program, <code class="code">%t</code> is expanded to a timestamp, <code class="code">%%</code> is expanded
  3356. to a plain <code class="code">%</code>
  3357. </p></dd>
  3358. <dt><samp class="option">level</samp></dt>
  3359. <dd><p>set the log verbosity level using a numerical value (see <code class="code">-loglevel</code>).
  3360. </p></dd>
  3361. </dl>
  3362. <p>For example, to output a report to a file named <samp class="file">ffreport.log</samp>
  3363. using a log level of <code class="code">32</code> (alias for log level <code class="code">info</code>):
  3364. </p>
  3365. <div class="example">
  3366. <pre class="example-preformatted">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  3367. </pre></div>
  3368. <p>Errors in parsing the environment variable are not fatal, and will not
  3369. appear in the report.
  3370. </p>
  3371. </dd>
  3372. <dt><samp class="option">-hide_banner</samp></dt>
  3373. <dd><p>Suppress printing banner.
  3374. </p>
  3375. <p>All FFmpeg tools will normally show a copyright notice, build options
  3376. and library versions. This option can be used to suppress printing
  3377. this information.
  3378. </p>
  3379. </dd>
  3380. <dt><samp class="option">-cpuflags flags (<em class="emph">global</em>)</samp></dt>
  3381. <dd><p>Allows setting and clearing cpu flags. This option is intended
  3382. for testing. Do not use it unless you know what you&rsquo;re doing.
  3383. </p><div class="example">
  3384. <pre class="example-preformatted">ffmpeg -cpuflags -sse+mmx ...
  3385. ffmpeg -cpuflags mmx ...
  3386. ffmpeg -cpuflags 0 ...
  3387. </pre></div>
  3388. <p>Possible flags for this option are:
  3389. </p><dl class="table">
  3390. <dt>&lsquo;<samp class="samp">x86</samp>&rsquo;</dt>
  3391. <dd><dl class="table">
  3392. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  3393. <dt>&lsquo;<samp class="samp">mmxext</samp>&rsquo;</dt>
  3394. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  3395. <dt>&lsquo;<samp class="samp">sse2</samp>&rsquo;</dt>
  3396. <dt>&lsquo;<samp class="samp">sse2slow</samp>&rsquo;</dt>
  3397. <dt>&lsquo;<samp class="samp">sse3</samp>&rsquo;</dt>
  3398. <dt>&lsquo;<samp class="samp">sse3slow</samp>&rsquo;</dt>
  3399. <dt>&lsquo;<samp class="samp">ssse3</samp>&rsquo;</dt>
  3400. <dt>&lsquo;<samp class="samp">atom</samp>&rsquo;</dt>
  3401. <dt>&lsquo;<samp class="samp">sse4.1</samp>&rsquo;</dt>
  3402. <dt>&lsquo;<samp class="samp">sse4.2</samp>&rsquo;</dt>
  3403. <dt>&lsquo;<samp class="samp">avx</samp>&rsquo;</dt>
  3404. <dt>&lsquo;<samp class="samp">avx2</samp>&rsquo;</dt>
  3405. <dt>&lsquo;<samp class="samp">xop</samp>&rsquo;</dt>
  3406. <dt>&lsquo;<samp class="samp">fma3</samp>&rsquo;</dt>
  3407. <dt>&lsquo;<samp class="samp">fma4</samp>&rsquo;</dt>
  3408. <dt>&lsquo;<samp class="samp">3dnow</samp>&rsquo;</dt>
  3409. <dt>&lsquo;<samp class="samp">3dnowext</samp>&rsquo;</dt>
  3410. <dt>&lsquo;<samp class="samp">bmi1</samp>&rsquo;</dt>
  3411. <dt>&lsquo;<samp class="samp">bmi2</samp>&rsquo;</dt>
  3412. <dt>&lsquo;<samp class="samp">cmov</samp>&rsquo;</dt>
  3413. </dl>
  3414. </dd>
  3415. <dt>&lsquo;<samp class="samp">ARM</samp>&rsquo;</dt>
  3416. <dd><dl class="table">
  3417. <dt>&lsquo;<samp class="samp">armv5te</samp>&rsquo;</dt>
  3418. <dt>&lsquo;<samp class="samp">armv6</samp>&rsquo;</dt>
  3419. <dt>&lsquo;<samp class="samp">armv6t2</samp>&rsquo;</dt>
  3420. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  3421. <dt>&lsquo;<samp class="samp">vfpv3</samp>&rsquo;</dt>
  3422. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  3423. <dt>&lsquo;<samp class="samp">setend</samp>&rsquo;</dt>
  3424. </dl>
  3425. </dd>
  3426. <dt>&lsquo;<samp class="samp">AArch64</samp>&rsquo;</dt>
  3427. <dd><dl class="table">
  3428. <dt>&lsquo;<samp class="samp">armv8</samp>&rsquo;</dt>
  3429. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  3430. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  3431. </dl>
  3432. </dd>
  3433. <dt>&lsquo;<samp class="samp">PowerPC</samp>&rsquo;</dt>
  3434. <dd><dl class="table">
  3435. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  3436. </dl>
  3437. </dd>
  3438. <dt>&lsquo;<samp class="samp">Specific Processors</samp>&rsquo;</dt>
  3439. <dd><dl class="table">
  3440. <dt>&lsquo;<samp class="samp">pentium2</samp>&rsquo;</dt>
  3441. <dt>&lsquo;<samp class="samp">pentium3</samp>&rsquo;</dt>
  3442. <dt>&lsquo;<samp class="samp">pentium4</samp>&rsquo;</dt>
  3443. <dt>&lsquo;<samp class="samp">k6</samp>&rsquo;</dt>
  3444. <dt>&lsquo;<samp class="samp">k62</samp>&rsquo;</dt>
  3445. <dt>&lsquo;<samp class="samp">athlon</samp>&rsquo;</dt>
  3446. <dt>&lsquo;<samp class="samp">athlonxp</samp>&rsquo;</dt>
  3447. <dt>&lsquo;<samp class="samp">k8</samp>&rsquo;</dt>
  3448. </dl>
  3449. </dd>
  3450. </dl>
  3451. </dd>
  3452. <dt><samp class="option">-cpucount <var class="var">count</var> (<em class="emph">global</em>)</samp></dt>
  3453. <dd><p>Override detection of CPU count. This option is intended
  3454. for testing. Do not use it unless you know what you&rsquo;re doing.
  3455. </p><div class="example">
  3456. <pre class="example-preformatted">ffmpeg -cpucount 2
  3457. </pre></div>
  3458. </dd>
  3459. <dt><samp class="option">-max_alloc <var class="var">bytes</var></samp></dt>
  3460. <dd><p>Set the maximum size limit for allocating a block on the heap by ffmpeg&rsquo;s
  3461. family of malloc functions. Exercise <strong class="strong">extreme caution</strong> when using
  3462. this option. Don&rsquo;t use if you do not understand the full consequence of doing so.
  3463. Default is INT_MAX.
  3464. </p></dd>
  3465. </dl>
  3466. </div>
  3467. <div class="section-level-extent" id="AVOptions">
  3468. <h3 class="section"><span>5.3 AVOptions<a class="copiable-link" href="#AVOptions"> &para;</a></span></h3>
  3469. <p>These options are provided directly by the libavformat, libavdevice and
  3470. libavcodec libraries. To see the list of available AVOptions, use the
  3471. <samp class="option">-help</samp> option. They are separated into two categories:
  3472. </p><dl class="table">
  3473. <dt><samp class="option">generic</samp></dt>
  3474. <dd><p>These options can be set for any container, codec or device. Generic options
  3475. are listed under AVFormatContext options for containers/devices and under
  3476. AVCodecContext options for codecs.
  3477. </p></dd>
  3478. <dt><samp class="option">private</samp></dt>
  3479. <dd><p>These options are specific to the given container, device or codec. Private
  3480. options are listed under their corresponding containers/devices/codecs.
  3481. </p></dd>
  3482. </dl>
  3483. <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  3484. an MP3 file, use the <samp class="option">id3v2_version</samp> private option of the MP3
  3485. muxer:
  3486. </p><div class="example">
  3487. <pre class="example-preformatted">ffmpeg -i input.flac -id3v2_version 3 out.mp3
  3488. </pre></div>
  3489. <p>All codec AVOptions are per-stream, and thus a stream specifier
  3490. should be attached to them:
  3491. </p><div class="example">
  3492. <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
  3493. </pre></div>
  3494. <p>In the above example, a multichannel audio stream is mapped twice for output.
  3495. The first instance is encoded with codec ac3 and bitrate 640k.
  3496. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
  3497. absolute index of the output stream.
  3498. </p>
  3499. <p>Note: the <samp class="option">-nooption</samp> syntax cannot be used for boolean
  3500. AVOptions, use <samp class="option">-option 0</samp>/<samp class="option">-option 1</samp>.
  3501. </p>
  3502. <p>Note: the old undocumented way of specifying per-stream AVOptions by
  3503. prepending v/a/s to the options name is now obsolete and will be
  3504. removed soon.
  3505. </p>
  3506. </div>
  3507. <div class="section-level-extent" id="Main-options">
  3508. <h3 class="section"><span>5.4 Main options<a class="copiable-link" href="#Main-options"> &para;</a></span></h3>
  3509. <dl class="table">
  3510. <dt><samp class="option">-f <var class="var">fmt</var> (<em class="emph">input/output</em>)</samp></dt>
  3511. <dd><p>Force input or output file format. The format is normally auto detected for input
  3512. files and guessed from the file extension for output files, so this option is not
  3513. needed in most cases.
  3514. </p>
  3515. </dd>
  3516. <dt><samp class="option">-i <var class="var">url</var> (<em class="emph">input</em>)</samp></dt>
  3517. <dd><p>input file url
  3518. </p>
  3519. </dd>
  3520. <dt><samp class="option">-y (<em class="emph">global</em>)</samp></dt>
  3521. <dd><p>Overwrite output files without asking.
  3522. </p>
  3523. </dd>
  3524. <dt><samp class="option">-n (<em class="emph">global</em>)</samp></dt>
  3525. <dd><p>Do not overwrite output files, and exit immediately if a specified
  3526. output file already exists.
  3527. </p>
  3528. </dd>
  3529. <dt><samp class="option">-stream_loop <var class="var">number</var> (<em class="emph">input</em>)</samp></dt>
  3530. <dd><p>Set number of times input stream shall be looped. Loop 0 means no loop,
  3531. loop -1 means infinite loop.
  3532. </p>
  3533. </dd>
  3534. <dt><samp class="option">-recast_media (<em class="emph">global</em>)</samp></dt>
  3535. <dd><p>Allow forcing a decoder of a different media type than the one
  3536. detected or designated by the demuxer. Useful for decoding media
  3537. data muxed as data streams.
  3538. </p>
  3539. </dd>
  3540. <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>
  3541. <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>
  3542. <dd><p>Select an encoder (when used before an output file) or a decoder (when used
  3543. before an input file) for one or more streams. <var class="var">codec</var> is the name of a
  3544. decoder/encoder or a special value <code class="code">copy</code> (output only) to indicate that
  3545. the stream is not to be re-encoded.
  3546. </p>
  3547. <p>For example
  3548. </p><div class="example">
  3549. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
  3550. </pre></div>
  3551. <p>encodes all video streams with libx264 and copies all audio streams.
  3552. </p>
  3553. <p>For each stream, the last matching <code class="code">c</code> option is applied, so
  3554. </p><div class="example">
  3555. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
  3556. </pre></div>
  3557. <p>will copy all the streams except the second video, which will be encoded with
  3558. libx264, and the 138th audio, which will be encoded with libvorbis.
  3559. </p>
  3560. </dd>
  3561. <dt><samp class="option">-t <var class="var">duration</var> (<em class="emph">input/output</em>)</samp></dt>
  3562. <dd><p>When used as an input option (before <code class="code">-i</code>), limit the <var class="var">duration</var> of
  3563. data read from the input file.
  3564. </p>
  3565. <p>When used as an output option (before an output url), stop writing the
  3566. output after its duration reaches <var class="var">duration</var>.
  3567. </p>
  3568. <p><var class="var">duration</var> must be a time duration specification,
  3569. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  3570. </p>
  3571. <p>-to and -t are mutually exclusive and -t has priority.
  3572. </p>
  3573. </dd>
  3574. <dt><samp class="option">-to <var class="var">position</var> (<em class="emph">input/output</em>)</samp></dt>
  3575. <dd><p>Stop writing the output or reading the input at <var class="var">position</var>.
  3576. <var class="var">position</var> must be a time duration specification,
  3577. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  3578. </p>
  3579. <p>-to and -t are mutually exclusive and -t has priority.
  3580. </p>
  3581. </dd>
  3582. <dt><samp class="option">-fs <var class="var">limit_size</var> (<em class="emph">output</em>)</samp></dt>
  3583. <dd><p>Set the file size limit, expressed in bytes. No further chunk of bytes is written
  3584. after the limit is exceeded. The size of the output file is slightly more than the
  3585. requested file size.
  3586. </p>
  3587. </dd>
  3588. <dt><samp class="option">-ss <var class="var">position</var> (<em class="emph">input/output</em>)</samp></dt>
  3589. <dd><p>When used as an input option (before <code class="code">-i</code>), seeks in this input file to
  3590. <var class="var">position</var>. Note that in most formats it is not possible to seek exactly,
  3591. so <code class="command">ffmpeg</code> will seek to the closest seek point before <var class="var">position</var>.
  3592. When transcoding and <samp class="option">-accurate_seek</samp> is enabled (the default), this
  3593. extra segment between the seek point and <var class="var">position</var> will be decoded and
  3594. discarded. When doing stream copy or when <samp class="option">-noaccurate_seek</samp> is used, it
  3595. will be preserved.
  3596. </p>
  3597. <p>When used as an output option (before an output url), decodes but discards
  3598. input until the timestamps reach <var class="var">position</var>.
  3599. </p>
  3600. <p><var class="var">position</var> must be a time duration specification,
  3601. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  3602. </p>
  3603. </dd>
  3604. <dt><samp class="option">-sseof <var class="var">position</var> (<em class="emph">input</em>)</samp></dt>
  3605. <dd>
  3606. <p>Like the <code class="code">-ss</code> option but relative to the &quot;end of file&quot;. That is negative
  3607. values are earlier in the file, 0 is at EOF.
  3608. </p>
  3609. </dd>
  3610. <dt><samp class="option">-isync <var class="var">input_index</var> (<em class="emph">input</em>)</samp></dt>
  3611. <dd><p>Assign an input as a sync source.
  3612. </p>
  3613. <p>This will take the difference between the start times of the target and reference inputs and
  3614. offset the timestamps of the target file by that difference. The source timestamps of the two
  3615. inputs should derive from the same clock source for expected results. If <code class="code">copyts</code> is set
  3616. then <code class="code">start_at_zero</code> must also be set. If either of the inputs has no starting timestamp
  3617. then no sync adjustment is made.
  3618. </p>
  3619. <p>Acceptable values are those that refer to a valid ffmpeg input index. If the sync reference is
  3620. the target index itself or <var class="var">-1</var>, then no adjustment is made to target timestamps. A sync
  3621. reference may not itself be synced to any other input.
  3622. </p>
  3623. <p>Default value is <var class="var">-1</var>.
  3624. </p>
  3625. </dd>
  3626. <dt><samp class="option">-itsoffset <var class="var">offset</var> (<em class="emph">input</em>)</samp></dt>
  3627. <dd><p>Set the input time offset.
  3628. </p>
  3629. <p><var class="var">offset</var> must be a time duration specification,
  3630. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  3631. </p>
  3632. <p>The offset is added to the timestamps of the input files. Specifying
  3633. a positive offset means that the corresponding streams are delayed by
  3634. the time duration specified in <var class="var">offset</var>.
  3635. </p>
  3636. </dd>
  3637. <dt><samp class="option">-itsscale <var class="var">scale</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  3638. <dd><p>Rescale input timestamps. <var class="var">scale</var> should be a floating point number.
  3639. </p>
  3640. </dd>
  3641. <dt><samp class="option">-timestamp <var class="var">date</var> (<em class="emph">output</em>)</samp></dt>
  3642. <dd><p>Set the recording timestamp in the container.
  3643. </p>
  3644. <p><var class="var">date</var> must be a date specification,
  3645. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#date-syntax">the Date section in the ffmpeg-utils(1) manual</a>.
  3646. </p>
  3647. </dd>
  3648. <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>
  3649. <dd><p>Set a metadata key/value pair.
  3650. </p>
  3651. <p>An optional <var class="var">metadata_specifier</var> may be given to set metadata
  3652. on streams, chapters or programs. See <code class="code">-map_metadata</code>
  3653. documentation for details.
  3654. </p>
  3655. <p>This option overrides metadata set with <code class="code">-map_metadata</code>. It is
  3656. also possible to delete metadata by using an empty value.
  3657. </p>
  3658. <p>For example, for setting the title in the output file:
  3659. </p><div class="example">
  3660. <pre class="example-preformatted">ffmpeg -i in.avi -metadata title=&quot;my title&quot; out.flv
  3661. </pre></div>
  3662. <p>To set the language of the first audio stream:
  3663. </p><div class="example">
  3664. <pre class="example-preformatted">ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
  3665. </pre></div>
  3666. </dd>
  3667. <dt><samp class="option">-disposition[:stream_specifier] <var class="var">value</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3668. <dd><p>Sets the disposition for a stream.
  3669. </p>
  3670. <p>By default, the disposition is copied from the input stream, unless the output
  3671. stream this option applies to is fed by a complex filtergraph - in that case the
  3672. disposition is unset by default.
  3673. </p>
  3674. <p><var class="var">value</var> is a sequence of items separated by &rsquo;+&rsquo; or &rsquo;-&rsquo;. The first item may
  3675. also be prefixed with &rsquo;+&rsquo; or &rsquo;-&rsquo;, in which case this option modifies the default
  3676. value. Otherwise (the first item is not prefixed) this options overrides the
  3677. default value. A &rsquo;+&rsquo; prefix adds the given disposition, &rsquo;-&rsquo; removes it. It is
  3678. also possible to clear the disposition by setting it to 0.
  3679. </p>
  3680. <p>If no <code class="code">-disposition</code> options were specified for an output file, ffmpeg will
  3681. automatically set the &rsquo;default&rsquo; disposition on the first stream of each type,
  3682. when there are multiple streams of this type in the output file and no stream of
  3683. that type is already marked as default.
  3684. </p>
  3685. <p>The <code class="code">-dispositions</code> option lists the known dispositions.
  3686. </p>
  3687. <p>For example, to make the second audio stream the default stream:
  3688. </p><div class="example">
  3689. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
  3690. </pre></div>
  3691. <p>To make the second subtitle stream the default stream and remove the default
  3692. disposition from the first subtitle stream:
  3693. </p><div class="example">
  3694. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
  3695. </pre></div>
  3696. <p>To add an embedded cover/thumbnail:
  3697. </p><div class="example">
  3698. <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
  3699. </pre></div>
  3700. <p>Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.
  3701. </p>
  3702. </dd>
  3703. <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>
  3704. <dd>
  3705. <p>Creates a program with the specified <var class="var">title</var>, <var class="var">program_num</var> and adds the specified
  3706. <var class="var">stream</var>(s) to it.
  3707. </p>
  3708. </dd>
  3709. <dt><samp class="option">-stream_group 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>
  3710. <dd>
  3711. <p>Creates a stream group of the specified <var class="var">type</var>, <var class="var">stream_group_id</var> and adds the specified
  3712. <var class="var">stream</var>(s) and/or previously defined <var class="var">stream_group</var>(s) to it.
  3713. </p>
  3714. <p><var class="var">type</var> can be one of the following:
  3715. </p><dl class="table">
  3716. <dt><samp class="option">iamf_audio_element</samp></dt>
  3717. <dd><p>Groups <var class="var">stream</var>s that belong to the same IAMF Audio Element
  3718. </p>
  3719. <p>For this group <var class="var">type</var>, the following options are available
  3720. </p><dl class="table">
  3721. <dt><samp class="option">audio_element_type</samp></dt>
  3722. <dd><p>The Audio Element type. The following values are supported:
  3723. </p>
  3724. <dl class="table">
  3725. <dt><samp class="option">channel</samp></dt>
  3726. <dd><p>Scalable channel audio representation
  3727. </p></dd>
  3728. <dt><samp class="option">scene</samp></dt>
  3729. <dd><p>Ambisonics representation
  3730. </p></dd>
  3731. </dl>
  3732. </dd>
  3733. <dt><samp class="option">demixing</samp></dt>
  3734. <dd><p>Demixing information used to reconstruct a scalable channel audio representation.
  3735. This option must be separated from the rest with a &rsquo;,&rsquo;, and takes the following
  3736. key=value options
  3737. </p>
  3738. <dl class="table">
  3739. <dt><samp class="option">parameter_id</samp></dt>
  3740. <dd><p>An identifier parameters blocks in frames may refer to
  3741. </p></dd>
  3742. <dt><samp class="option">dmixp_mode</samp></dt>
  3743. <dd><p>A pre-defined combination of demixing parameters
  3744. </p></dd>
  3745. </dl>
  3746. </dd>
  3747. <dt><samp class="option">recon_gain</samp></dt>
  3748. <dd><p>Recon gain information used to reconstruct a scalable channel audio representation.
  3749. This option must be separated from the rest with a &rsquo;,&rsquo;, and takes the following
  3750. key=value options
  3751. </p>
  3752. <dl class="table">
  3753. <dt><samp class="option">parameter_id</samp></dt>
  3754. <dd><p>An identifier parameters blocks in frames may refer to
  3755. </p></dd>
  3756. </dl>
  3757. </dd>
  3758. <dt><samp class="option">layer</samp></dt>
  3759. <dd><p>A layer defining a Channel Layout in the Audio Element.
  3760. This option must be separated from the rest with a &rsquo;,&rsquo;. Several &rsquo;,&rsquo; separated entries
  3761. can be defined, and at least one must be set.
  3762. </p>
  3763. <p>It takes the following &quot;:&quot;-separated key=value options
  3764. </p>
  3765. <dl class="table">
  3766. <dt><samp class="option">ch_layout</samp></dt>
  3767. <dd><p>The layer&rsquo;s channel layout
  3768. </p></dd>
  3769. <dt><samp class="option">flags</samp></dt>
  3770. <dd><p>The following flags are available:
  3771. </p>
  3772. <dl class="table">
  3773. <dt><samp class="option">recon_gain</samp></dt>
  3774. <dd><p>Wether to signal if recon_gain is present as metadata in parameter blocks within frames
  3775. </p></dd>
  3776. </dl>
  3777. </dd>
  3778. <dt><samp class="option">output_gain</samp></dt>
  3779. <dt><samp class="option">output_gain_flags</samp></dt>
  3780. <dd><p>Which channels output_gain applies to. The following flags are available:
  3781. </p>
  3782. <dl class="table">
  3783. <dt><samp class="option">FL</samp></dt>
  3784. <dt><samp class="option">FR</samp></dt>
  3785. <dt><samp class="option">BL</samp></dt>
  3786. <dt><samp class="option">BR</samp></dt>
  3787. <dt><samp class="option">TFL</samp></dt>
  3788. <dt><samp class="option">TFR</samp></dt>
  3789. </dl>
  3790. </dd>
  3791. <dt><samp class="option">ambisonics_mode</samp></dt>
  3792. <dd><p>The ambisonics mode. This has no effect if audio_element_type is set to channel.
  3793. </p>
  3794. <p>The following values are supported:
  3795. </p>
  3796. <dl class="table">
  3797. <dt><samp class="option">mono</samp></dt>
  3798. <dd><p>Each ambisonics channel is coded as an individual mono stream in the group
  3799. </p></dd>
  3800. </dl>
  3801. </dd>
  3802. </dl>
  3803. </dd>
  3804. <dt><samp class="option">default_w</samp></dt>
  3805. <dd><p>Default weight value
  3806. </p>
  3807. </dd>
  3808. </dl>
  3809. </dd>
  3810. <dt><samp class="option">iamf_mix_presentation</samp></dt>
  3811. <dd><p>Groups <var class="var">stream</var>s that belong to all IAMF Audio Element the same
  3812. IAMF Mix Presentation references
  3813. </p>
  3814. <p>For this group <var class="var">type</var>, the following options are available
  3815. </p>
  3816. <dl class="table">
  3817. <dt><samp class="option">submix</samp></dt>
  3818. <dd><p>A sub-mix within the Mix Presentation.
  3819. This option must be separated from the rest with a &rsquo;,&rsquo;. Several &rsquo;,&rsquo; separated entries
  3820. can be defined, and at least one must be set.
  3821. </p>
  3822. <p>It takes the following &quot;:&quot;-separated key=value options
  3823. </p>
  3824. <dl class="table">
  3825. <dt><samp class="option">parameter_id</samp></dt>
  3826. <dd><p>An identifier parameters blocks in frames may refer to, for post-processing the mixed
  3827. audio signal to generate the audio signal for playback
  3828. </p></dd>
  3829. <dt><samp class="option">parameter_rate</samp></dt>
  3830. <dd><p>The sample rate duration fields in parameters blocks in frames that refer to this
  3831. <var class="var">parameter_id</var> are expressed as
  3832. </p></dd>
  3833. <dt><samp class="option">default_mix_gain</samp></dt>
  3834. <dd><p>Default mix gain value to apply when there are no parameter blocks sharing the same
  3835. <var class="var">parameter_id</var> for a given frame
  3836. </p>
  3837. </dd>
  3838. <dt><samp class="option">element</samp></dt>
  3839. <dd><p>References an Audio Element used in this Mix Presentation to generate the final output
  3840. audio signal for playback.
  3841. This option must be separated from the rest with a &rsquo;|&rsquo;. Several &rsquo;|&rsquo; separated entries
  3842. can be defined, and at least one must be set.
  3843. </p>
  3844. <p>It takes the following &quot;:&quot;-separated key=value options:
  3845. </p>
  3846. <dl class="table">
  3847. <dt><samp class="option">stg</samp></dt>
  3848. <dd><p>The <var class="var">stream_group_id</var> for an Audio Element which this sub-mix refers to
  3849. </p></dd>
  3850. <dt><samp class="option">parameter_id</samp></dt>
  3851. <dd><p>An identifier parameters blocks in frames may refer to, for applying any processing to
  3852. the referenced and rendered Audio Element before being summed with other processed Audio
  3853. Elements
  3854. </p></dd>
  3855. <dt><samp class="option">parameter_rate</samp></dt>
  3856. <dd><p>The sample rate duration fields in parameters blocks in frames that refer to this
  3857. <var class="var">parameter_id</var> are expressed as
  3858. </p></dd>
  3859. <dt><samp class="option">default_mix_gain</samp></dt>
  3860. <dd><p>Default mix gain value to apply when there are no parameter blocks sharing the same
  3861. <var class="var">parameter_id</var> for a given frame
  3862. </p></dd>
  3863. <dt><samp class="option">annotations</samp></dt>
  3864. <dd><p>A key=value string describing the sub-mix element where &quot;key&quot; is a string conforming to
  3865. BCP-47 that specifies the language for the &quot;value&quot; string. &quot;key&quot; must be the same as the
  3866. one in the mix&rsquo;s <var class="var">annotations</var>
  3867. </p></dd>
  3868. <dt><samp class="option">headphones_rendering_mode</samp></dt>
  3869. <dd><p>Indicates whether the input channel-based Audio Element is rendered to stereo loudspeakers
  3870. or spatialized with a binaural renderer when played back on headphones.
  3871. This has no effect if the referenced Audio Element&rsquo;s <var class="var">audio_element_type</var> is set to
  3872. channel.
  3873. </p>
  3874. <p>The following values are supported:
  3875. </p>
  3876. <dl class="table">
  3877. <dt><samp class="option">stereo</samp></dt>
  3878. <dt><samp class="option">binaural</samp></dt>
  3879. </dl>
  3880. </dd>
  3881. </dl>
  3882. </dd>
  3883. <dt><samp class="option">layout</samp></dt>
  3884. <dd><p>Specifies the layouts for this sub-mix on which the loudness information was measured.
  3885. This option must be separated from the rest with a &rsquo;|&rsquo;. Several &rsquo;|&rsquo; separated entries
  3886. can be defined, and at least one must be set.
  3887. </p>
  3888. <p>It takes the following &quot;:&quot;-separated key=value options:
  3889. </p>
  3890. <dl class="table">
  3891. <dt><samp class="option">layout_type</samp></dt>
  3892. <dd>
  3893. <dl class="table">
  3894. <dt><samp class="option">loudspeakers</samp></dt>
  3895. <dd><p>The layout follows the loudspeaker sound system convention of ITU-2051-3.
  3896. </p></dd>
  3897. <dt><samp class="option">binaural</samp></dt>
  3898. <dd><p>The layout is binaural.
  3899. </p></dd>
  3900. </dl>
  3901. </dd>
  3902. <dt><samp class="option">sound_system</samp></dt>
  3903. <dd><p>Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus 7.1.2 and 3.1.2
  3904. This has no effect if <var class="var">layout_type</var> is set to binaural.
  3905. </p></dd>
  3906. <dt><samp class="option">integrated_loudness</samp></dt>
  3907. <dd><p>The program integrated loudness information, as defined in ITU-1770-4.
  3908. </p></dd>
  3909. <dt><samp class="option">digital_peak</samp></dt>
  3910. <dd><p>The digital (sampled) peak value of the audio signal, as defined in ITU-1770-4.
  3911. </p></dd>
  3912. <dt><samp class="option">true_peak</samp></dt>
  3913. <dd><p>The true peak of the audio signal, as defined in ITU-1770-4.
  3914. </p></dd>
  3915. <dt><samp class="option">dialog_anchored_loudness</samp></dt>
  3916. <dd><p>The Dialogue loudness information, as defined in ITU-1770-4.
  3917. </p></dd>
  3918. <dt><samp class="option">album_anchored_loudness</samp></dt>
  3919. <dd><p>The Album loudness information, as defined in ITU-1770-4.
  3920. </p></dd>
  3921. </dl>
  3922. </dd>
  3923. </dl>
  3924. </dd>
  3925. <dt><samp class="option">annotations</samp></dt>
  3926. <dd><p>A key=value string string describing the mix where &quot;key&quot; is a string conforming to BCP-47
  3927. that specifies the language for the &quot;value&quot; string. &quot;key&quot; must be the same as the ones in
  3928. all sub-mix element&rsquo;s <var class="var">annotations</var>s
  3929. </p></dd>
  3930. </dl>
  3931. </dd>
  3932. </dl>
  3933. </dd>
  3934. <dt><samp class="option">-target <var class="var">type</var> (<em class="emph">output</em>)</samp></dt>
  3935. <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>,
  3936. <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
  3937. <code class="code">film-</code> to use the corresponding standard. All the format options
  3938. (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
  3939. </p>
  3940. <div class="example">
  3941. <pre class="example-preformatted">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  3942. </pre></div>
  3943. <p>Nevertheless you can specify additional options as long as you know
  3944. they do not conflict with the standard, as in:
  3945. </p>
  3946. <div class="example">
  3947. <pre class="example-preformatted">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  3948. </pre></div>
  3949. <p>The parameters set for each target are as follows.
  3950. </p>
  3951. <p><strong class="strong">VCD</strong>
  3952. </p><div class="example">
  3953. <pre class="example-preformatted"><var class="var">pal</var>:
  3954. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  3955. -s 352x288 -r 25
  3956. -codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  3957. -ar 44100 -ac 2
  3958. -codec:a mp2 -b:a 224k
  3959. <var class="var">ntsc</var>:
  3960. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  3961. -s 352x240 -r 30000/1001
  3962. -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  3963. -ar 44100 -ac 2
  3964. -codec:a mp2 -b:a 224k
  3965. <var class="var">film</var>:
  3966. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  3967. -s 352x240 -r 24000/1001
  3968. -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  3969. -ar 44100 -ac 2
  3970. -codec:a mp2 -b:a 224k
  3971. </pre></div>
  3972. <p><strong class="strong">SVCD</strong>
  3973. </p><div class="example">
  3974. <pre class="example-preformatted"><var class="var">pal</var>:
  3975. -f svcd -packetsize 2324
  3976. -s 480x576 -pix_fmt yuv420p -r 25
  3977. -codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  3978. -ar 44100
  3979. -codec:a mp2 -b:a 224k
  3980. <var class="var">ntsc</var>:
  3981. -f svcd -packetsize 2324
  3982. -s 480x480 -pix_fmt yuv420p -r 30000/1001
  3983. -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  3984. -ar 44100
  3985. -codec:a mp2 -b:a 224k
  3986. <var class="var">film</var>:
  3987. -f svcd -packetsize 2324
  3988. -s 480x480 -pix_fmt yuv420p -r 24000/1001
  3989. -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  3990. -ar 44100
  3991. -codec:a mp2 -b:a 224k
  3992. </pre></div>
  3993. <p><strong class="strong">DVD</strong>
  3994. </p><div class="example">
  3995. <pre class="example-preformatted"><var class="var">pal</var>:
  3996. -f dvd -muxrate 10080k -packetsize 2048
  3997. -s 720x576 -pix_fmt yuv420p -r 25
  3998. -codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  3999. -ar 48000
  4000. -codec:a ac3 -b:a 448k
  4001. <var class="var">ntsc</var>:
  4002. -f dvd -muxrate 10080k -packetsize 2048
  4003. -s 720x480 -pix_fmt yuv420p -r 30000/1001
  4004. -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  4005. -ar 48000
  4006. -codec:a ac3 -b:a 448k
  4007. <var class="var">film</var>:
  4008. -f dvd -muxrate 10080k -packetsize 2048
  4009. -s 720x480 -pix_fmt yuv420p -r 24000/1001
  4010. -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  4011. -ar 48000
  4012. -codec:a ac3 -b:a 448k
  4013. </pre></div>
  4014. <p><strong class="strong">DV</strong>
  4015. </p><div class="example">
  4016. <pre class="example-preformatted"><var class="var">pal</var>:
  4017. -f dv
  4018. -s 720x576 -pix_fmt yuv420p -r 25
  4019. -ar 48000 -ac 2
  4020. <var class="var">ntsc</var>:
  4021. -f dv
  4022. -s 720x480 -pix_fmt yuv411p -r 30000/1001
  4023. -ar 48000 -ac 2
  4024. <var class="var">film</var>:
  4025. -f dv
  4026. -s 720x480 -pix_fmt yuv411p -r 24000/1001
  4027. -ar 48000 -ac 2
  4028. </pre></div>
  4029. <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.
  4030. </p>
  4031. <p>Any user-set value for a parameter above will override the target preset value. In that case, the output may
  4032. not comply with the target standard.
  4033. </p>
  4034. </dd>
  4035. <dt><samp class="option">-dn (<em class="emph">input/output</em>)</samp></dt>
  4036. <dd><p>As an input option, blocks all data streams of a file from being filtered or
  4037. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  4038. option to disable streams individually.
  4039. </p>
  4040. <p>As an output option, disables data recording i.e. automatic selection or
  4041. mapping of any data stream. For full manual control see the <code class="code">-map</code>
  4042. option.
  4043. </p>
  4044. </dd>
  4045. <dt><samp class="option">-dframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  4046. <dd><p>Set the number of data frames to output. This is an obsolete alias for
  4047. <code class="code">-frames:d</code>, which you should use instead.
  4048. </p>
  4049. </dd>
  4050. <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>
  4051. <dd><p>Stop writing to the stream after <var class="var">framecount</var> frames.
  4052. </p>
  4053. </dd>
  4054. <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>
  4055. <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>
  4056. <dd><p>Use fixed quality scale (VBR). The meaning of <var class="var">q</var>/<var class="var">qscale</var> is
  4057. codec-dependent.
  4058. If <var class="var">qscale</var> is used without a <var class="var">stream_specifier</var> then it applies only
  4059. to the video stream, this is to maintain compatibility with previous behavior
  4060. and as specifying the same codec specific value to 2 different codecs that is
  4061. audio and video generally is not what is intended when no stream_specifier is
  4062. used.
  4063. </p>
  4064. <a class="anchor" id="filter_005foption"></a></dd>
  4065. <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>
  4066. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  4067. filter the stream.
  4068. </p>
  4069. <p><var class="var">filtergraph</var> is a description of the filtergraph to apply to
  4070. the stream, and must have a single input and a single output of the
  4071. same type of the stream. In the filtergraph, the input is associated
  4072. to the label <code class="code">in</code>, and the output to the label <code class="code">out</code>. See
  4073. the ffmpeg-filters manual for more information about the filtergraph
  4074. syntax.
  4075. </p>
  4076. <p>See the <a class="ref" href="#filter_005fcomplex_005foption">-filter_complex option</a> if you
  4077. want to create filtergraphs with multiple inputs and/or outputs.
  4078. </p>
  4079. </dd>
  4080. <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>
  4081. <dd><p>This boolean option determines if the filtergraph(s) to which this stream is fed gets
  4082. reinitialized when input frame parameters change mid-stream. This option is enabled by
  4083. default as most video and all audio filters cannot handle deviation in input frame properties.
  4084. Upon reinitialization, existing filter state is lost, like e.g. the frame count <code class="code">n</code>
  4085. reference available in some filters. Any frames buffered at time of reinitialization are lost.
  4086. The properties where a change triggers reinitialization are,
  4087. for video, frame resolution or pixel format;
  4088. for audio, sample format, sample rate, channel count or channel layout.
  4089. </p>
  4090. </dd>
  4091. <dt><samp class="option">-filter_threads <var class="var">nb_threads</var> (<em class="emph">global</em>)</samp></dt>
  4092. <dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
  4093. will produce a thread pool with this many threads available for parallel processing.
  4094. The default is the number of available CPUs.
  4095. </p>
  4096. </dd>
  4097. <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>
  4098. <dd><p>Specify the preset for matching stream(s).
  4099. </p>
  4100. </dd>
  4101. <dt><samp class="option">-stats (<em class="emph">global</em>)</samp></dt>
  4102. <dd><p>Print encoding progress/statistics. It is on by default, to explicitly
  4103. disable it you need to specify <code class="code">-nostats</code>.
  4104. </p>
  4105. </dd>
  4106. <dt><samp class="option">-stats_period <var class="var">time</var> (<em class="emph">global</em>)</samp></dt>
  4107. <dd><p>Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
  4108. </p>
  4109. </dd>
  4110. <dt><samp class="option">-progress <var class="var">url</var> (<em class="emph">global</em>)</samp></dt>
  4111. <dd><p>Send program-friendly progress information to <var class="var">url</var>.
  4112. </p>
  4113. <p>Progress information is written periodically and at the end of
  4114. 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>
  4115. consists of only alphanumeric characters. The last key of a sequence of
  4116. progress information is always &quot;progress&quot;.
  4117. </p>
  4118. <p>The update period is set using <code class="code">-stats_period</code>.
  4119. </p>
  4120. <a class="anchor" id="stdin-option"></a></dd>
  4121. <dt><samp class="option">-stdin</samp></dt>
  4122. <dd><p>Enable interaction on standard input. On by default unless standard input is
  4123. used as an input. To explicitly disable interaction you need to specify
  4124. <code class="code">-nostdin</code>.
  4125. </p>
  4126. <p>Disabling interaction on standard input is useful, for example, if
  4127. ffmpeg is in the background process group. Roughly the same result can
  4128. be achieved with <code class="code">ffmpeg ... &lt; /dev/null</code> but it requires a
  4129. shell.
  4130. </p>
  4131. </dd>
  4132. <dt><samp class="option">-debug_ts (<em class="emph">global</em>)</samp></dt>
  4133. <dd><p>Print timestamp/latency information. It is off by default. This option is
  4134. mostly useful for testing and debugging purposes, and the output
  4135. format may change from one version to another, so it should not be
  4136. employed by portable scripts.
  4137. </p>
  4138. <p>See also the option <code class="code">-fdebug ts</code>.
  4139. </p>
  4140. </dd>
  4141. <dt><samp class="option">-attach <var class="var">filename</var> (<em class="emph">output</em>)</samp></dt>
  4142. <dd><p>Add an attachment to the output file. This is supported by a few formats
  4143. like Matroska for e.g. fonts used in rendering subtitles. Attachments
  4144. are implemented as a specific type of stream, so this option will add
  4145. a new stream to the file. It is then possible to use per-stream options
  4146. on this stream in the usual way. Attachment streams created with this
  4147. option will be created after all the other streams (i.e. those created
  4148. with <code class="code">-map</code> or automatic mappings).
  4149. </p>
  4150. <p>Note that for Matroska you also have to set the mimetype metadata tag:
  4151. </p><div class="example">
  4152. <pre class="example-preformatted">ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
  4153. </pre></div>
  4154. <p>(assuming that the attachment stream will be third in the output file).
  4155. </p>
  4156. </dd>
  4157. <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>
  4158. <dd><p>Extract the matching attachment stream into a file named <var class="var">filename</var>. If
  4159. <var class="var">filename</var> is empty, then the value of the <code class="code">filename</code> metadata tag
  4160. will be used.
  4161. </p>
  4162. <p>E.g. to extract the first attachment to a file named &rsquo;out.ttf&rsquo;:
  4163. </p><div class="example">
  4164. <pre class="example-preformatted">ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
  4165. </pre></div>
  4166. <p>To extract all attachments to files determined by the <code class="code">filename</code> tag:
  4167. </p><div class="example">
  4168. <pre class="example-preformatted">ffmpeg -dump_attachment:t &quot;&quot; -i INPUT
  4169. </pre></div>
  4170. <p>Technical note &ndash; attachments are implemented as codec extradata, so this
  4171. option can actually be used to extract extradata from any stream, not just
  4172. attachments.
  4173. </p></dd>
  4174. </dl>
  4175. </div>
  4176. <div class="section-level-extent" id="Video-Options">
  4177. <h3 class="section"><span>5.5 Video Options<a class="copiable-link" href="#Video-Options"> &para;</a></span></h3>
  4178. <dl class="table">
  4179. <dt><samp class="option">-vframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  4180. <dd><p>Set the number of video frames to output. This is an obsolete alias for
  4181. <code class="code">-frames:v</code>, which you should use instead.
  4182. </p></dd>
  4183. <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>
  4184. <dd><p>Set frame rate (Hz value, fraction or abbreviation).
  4185. </p>
  4186. <p>As an input option, ignore any timestamps stored in the file and instead
  4187. generate timestamps assuming constant frame rate <var class="var">fps</var>.
  4188. This is not the same as the <samp class="option">-framerate</samp> option used for some input formats
  4189. like image2 or v4l2 (it used to be the same in older versions of FFmpeg).
  4190. If in doubt use <samp class="option">-framerate</samp> instead of the input option <samp class="option">-r</samp>.
  4191. </p>
  4192. <p>As an output option:
  4193. </p><dl class="table">
  4194. <dt><samp class="option">video encoding</samp></dt>
  4195. <dd><p>Duplicate or drop frames right before encoding them to achieve constant output
  4196. frame rate <var class="var">fps</var>.
  4197. </p>
  4198. </dd>
  4199. <dt><samp class="option">video streamcopy</samp></dt>
  4200. <dd><p>Indicate to the muxer that <var class="var">fps</var> is the stream frame rate. No data is
  4201. dropped or duplicated in this case. This may produce invalid files if <var class="var">fps</var>
  4202. does not match the actual stream frame rate as determined by packet timestamps.
  4203. See also the <code class="code">setts</code> bitstream filter.
  4204. </p>
  4205. </dd>
  4206. </dl>
  4207. </dd>
  4208. <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>
  4209. <dd><p>Set maximum frame rate (Hz value, fraction or abbreviation).
  4210. </p>
  4211. <p>Clamps output frame rate when output framerate is auto-set and is higher than this value.
  4212. Useful in batch processing or when input framerate is wrongly detected as very high.
  4213. It cannot be set together with <code class="code">-r</code>. It is ignored during streamcopy.
  4214. </p>
  4215. </dd>
  4216. <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>
  4217. <dd><p>Set frame size.
  4218. </p>
  4219. <p>As an input option, this is a shortcut for the <samp class="option">video_size</samp> private
  4220. option, recognized by some demuxers for which the frame size is either not
  4221. stored in the file or is configurable &ndash; e.g. raw video or video grabbers.
  4222. </p>
  4223. <p>As an output option, this inserts the <code class="code">scale</code> video filter to the
  4224. <em class="emph">end</em> of the corresponding filtergraph. Please use the <code class="code">scale</code> filter
  4225. directly to insert it at the beginning or some other place.
  4226. </p>
  4227. <p>The format is &lsquo;<samp class="samp">wxh</samp>&rsquo; (default - same as source).
  4228. </p>
  4229. </dd>
  4230. <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>
  4231. <dd><p>Set the video display aspect ratio specified by <var class="var">aspect</var>.
  4232. </p>
  4233. <p><var class="var">aspect</var> can be a floating point number string, or a string of the
  4234. 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
  4235. numerator and denominator of the aspect ratio. For example &quot;4:3&quot;,
  4236. &quot;16:9&quot;, &quot;1.3333&quot;, and &quot;1.7777&quot; are valid argument values.
  4237. </p>
  4238. <p>If used together with <samp class="option">-vcodec copy</samp>, it will affect the aspect ratio
  4239. stored at container level, but not the aspect ratio stored in encoded
  4240. frames, if it exists.
  4241. </p>
  4242. </dd>
  4243. <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>
  4244. <dd><p>Set video rotation metadata.
  4245. </p>
  4246. <p><var class="var">rotation</var> is a decimal number specifying the amount in degree by
  4247. which the video should be rotated counter-clockwise before being
  4248. displayed.
  4249. </p>
  4250. <p>This option overrides the rotation/display transform metadata stored in
  4251. the file, if any. When the video is being transcoded (rather than
  4252. copied) and <code class="code">-autorotate</code> is enabled, the video will be rotated at
  4253. the filtering stage. Otherwise, the metadata will be written into the
  4254. output file if the muxer supports it.
  4255. </p>
  4256. <p>If the <code class="code">-display_hflip</code> and/or <code class="code">-display_vflip</code> options are
  4257. given, they are applied after the rotation specified by this option.
  4258. </p>
  4259. </dd>
  4260. <dt><samp class="option">-display_hflip[:<var class="var">stream_specifier</var>] (<em class="emph">input,per-stream</em>)</samp></dt>
  4261. <dd><p>Set whether on display the image should be horizontally flipped.
  4262. </p>
  4263. <p>See the <code class="code">-display_rotation</code> option for more details.
  4264. </p>
  4265. </dd>
  4266. <dt><samp class="option">-display_vflip[:<var class="var">stream_specifier</var>] (<em class="emph">input,per-stream</em>)</samp></dt>
  4267. <dd><p>Set whether on display the image should be vertically flipped.
  4268. </p>
  4269. <p>See the <code class="code">-display_rotation</code> option for more details.
  4270. </p>
  4271. </dd>
  4272. <dt><samp class="option">-vn (<em class="emph">input/output</em>)</samp></dt>
  4273. <dd><p>As an input option, blocks all video streams of a file from being filtered or
  4274. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  4275. option to disable streams individually.
  4276. </p>
  4277. <p>As an output option, disables video recording i.e. automatic selection or
  4278. mapping of any video stream. For full manual control see the <code class="code">-map</code>
  4279. option.
  4280. </p>
  4281. </dd>
  4282. <dt><samp class="option">-vcodec <var class="var">codec</var> (<em class="emph">output</em>)</samp></dt>
  4283. <dd><p>Set the video codec. This is an alias for <code class="code">-codec:v</code>.
  4284. </p>
  4285. </dd>
  4286. <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>
  4287. <dd><p>Select the pass number (1 or 2). It is used to do two-pass
  4288. video encoding. The statistics of the video are recorded in the first
  4289. pass into a log file (see also the option -passlogfile),
  4290. and in the second pass that log file is used to generate the video
  4291. at the exact requested bitrate.
  4292. On pass 1, you may just deactivate audio and set output to null,
  4293. examples for Windows and Unix:
  4294. </p><div class="example">
  4295. <pre class="example-preformatted">ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
  4296. ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
  4297. </pre></div>
  4298. </dd>
  4299. <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>
  4300. <dd><p>Set two-pass log file name prefix to <var class="var">prefix</var>, the default file name
  4301. prefix is &ldquo;ffmpeg2pass&rdquo;. The complete file name will be
  4302. <samp class="file">PREFIX-N.log</samp>, where N is a number specific to the output
  4303. stream
  4304. </p>
  4305. </dd>
  4306. <dt><samp class="option">-vf <var class="var">filtergraph</var> (<em class="emph">output</em>)</samp></dt>
  4307. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  4308. filter the stream.
  4309. </p>
  4310. <p>This is an alias for <code class="code">-filter:v</code>, see the <a class="ref" href="#filter_005foption">-filter option</a>.
  4311. </p>
  4312. </dd>
  4313. <dt><samp class="option">-autorotate</samp></dt>
  4314. <dd><p>Automatically rotate the video according to file metadata. Enabled by
  4315. default, use <samp class="option">-noautorotate</samp> to disable it.
  4316. </p>
  4317. </dd>
  4318. <dt><samp class="option">-autoscale</samp></dt>
  4319. <dd><p>Automatically scale the video according to the resolution of first frame.
  4320. Enabled by default, use <samp class="option">-noautoscale</samp> to disable it. When autoscale is
  4321. disabled, all output frames of filter graph might not be in the same resolution
  4322. and may be inadequate for some encoder/muxer. Therefore, it is not recommended
  4323. to disable it unless you really know what you are doing.
  4324. Disable autoscale at your own risk.
  4325. </p></dd>
  4326. </dl>
  4327. </div>
  4328. <div class="section-level-extent" id="Advanced-Video-options">
  4329. <h3 class="section"><span>5.6 Advanced Video options<a class="copiable-link" href="#Advanced-Video-options"> &para;</a></span></h3>
  4330. <dl class="table">
  4331. <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>
  4332. <dd><p>Set pixel format. Use <code class="code">-pix_fmts</code> to show all the supported
  4333. pixel formats.
  4334. If the selected pixel format can not be selected, ffmpeg will print a
  4335. warning and select the best pixel format supported by the encoder.
  4336. If <var class="var">pix_fmt</var> is prefixed by a <code class="code">+</code>, ffmpeg will exit with an error
  4337. if the requested pixel format can not be selected, and automatic conversions
  4338. inside filtergraphs are disabled.
  4339. If <var class="var">pix_fmt</var> is a single <code class="code">+</code>, ffmpeg selects the same pixel format
  4340. as the input (or graph output) and automatic conversions are disabled.
  4341. </p>
  4342. </dd>
  4343. <dt><samp class="option">-sws_flags <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  4344. <dd><p>Set default flags for the libswscale library. These flags are used by
  4345. automatically inserted <code class="code">scale</code> filters and those within simple
  4346. filtergraphs, if not overridden within the filtergraph definition.
  4347. </p>
  4348. <p>See the <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#scaler_005foptions">ffmpeg-scaler manual</a> for a list
  4349. of scaler options.
  4350. </p>
  4351. </dd>
  4352. <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>
  4353. <dd><p>Rate control override for specific intervals, formatted as &quot;int,int,int&quot;
  4354. list separated with slashes. Two first values are the beginning and
  4355. end frame numbers, last one is quantizer to use if positive, or quality
  4356. factor if negative.
  4357. </p>
  4358. </dd>
  4359. <dt><samp class="option">-vstats</samp></dt>
  4360. <dd><p>Dump video coding statistics to <samp class="file">vstats_HHMMSS.log</samp>. See the
  4361. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  4362. </p>
  4363. </dd>
  4364. <dt><samp class="option">-vstats_file <var class="var">file</var></samp></dt>
  4365. <dd><p>Dump video coding statistics to <var class="var">file</var>. See the
  4366. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  4367. </p>
  4368. </dd>
  4369. <dt><samp class="option">-vstats_version <var class="var">file</var></samp></dt>
  4370. <dd><p>Specify which version of the vstats format to use. Default is <code class="code">2</code>. See the
  4371. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  4372. </p>
  4373. </dd>
  4374. <dt><samp class="option">-vtag <var class="var">fourcc/tag</var> (<em class="emph">output</em>)</samp></dt>
  4375. <dd><p>Force video tag/fourcc. This is an alias for <code class="code">-tag:v</code>.
  4376. </p>
  4377. </dd>
  4378. <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>
  4379. <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>
  4380. <dt><samp class="option">-force_key_frames[:<var class="var">stream_specifier</var>] source (<em class="emph">output,per-stream</em>)</samp></dt>
  4381. <dd>
  4382. <p><var class="var">force_key_frames</var> can take arguments of the following form:
  4383. </p>
  4384. <dl class="table">
  4385. <dt><samp class="option"><var class="var">time</var>[,<var class="var">time</var>...]</samp></dt>
  4386. <dd><p>If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
  4387. output timestamp as per the encoder time base and force a keyframe at the first frame having
  4388. timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
  4389. coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
  4390. The default encoder time base is the inverse of the output framerate but may be set otherwise
  4391. via <code class="code">-enc_time_base</code>.
  4392. </p>
  4393. <p>If one of the times is &quot;<code class="code">chapters</code>[<var class="var">delta</var>]&quot;, it is expanded into
  4394. the time of the beginning of all chapters in the file, shifted by
  4395. <var class="var">delta</var>, expressed as a time in seconds.
  4396. This option can be useful to ensure that a seek point is present at a
  4397. chapter mark or any other designated place in the output file.
  4398. </p>
  4399. <p>For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
  4400. before the beginning of every chapter:
  4401. </p><div class="example">
  4402. <pre class="example-preformatted">-force_key_frames 0:05:00,chapters-0.1
  4403. </pre></div>
  4404. </dd>
  4405. <dt><samp class="option">expr:<var class="var">expr</var></samp></dt>
  4406. <dd><p>If the argument is prefixed with <code class="code">expr:</code>, the string <var class="var">expr</var>
  4407. is interpreted like an expression and is evaluated for each frame. A
  4408. key frame is forced in case the evaluation is non-zero.
  4409. </p>
  4410. <p>The expression in <var class="var">expr</var> can contain the following constants:
  4411. </p><dl class="table">
  4412. <dt><samp class="option">n</samp></dt>
  4413. <dd><p>the number of current processed frame, starting from 0
  4414. </p></dd>
  4415. <dt><samp class="option">n_forced</samp></dt>
  4416. <dd><p>the number of forced frames
  4417. </p></dd>
  4418. <dt><samp class="option">prev_forced_n</samp></dt>
  4419. <dd><p>the number of the previous forced frame, it is <code class="code">NAN</code> when no
  4420. keyframe was forced yet
  4421. </p></dd>
  4422. <dt><samp class="option">prev_forced_t</samp></dt>
  4423. <dd><p>the time of the previous forced frame, it is <code class="code">NAN</code> when no
  4424. keyframe was forced yet
  4425. </p></dd>
  4426. <dt><samp class="option">t</samp></dt>
  4427. <dd><p>the time of the current processed frame
  4428. </p></dd>
  4429. </dl>
  4430. <p>For example to force a key frame every 5 seconds, you can specify:
  4431. </p><div class="example">
  4432. <pre class="example-preformatted">-force_key_frames expr:gte(t,n_forced*5)
  4433. </pre></div>
  4434. <p>To force a key frame 5 seconds after the time of the last forced one,
  4435. starting from second 13:
  4436. </p><div class="example">
  4437. <pre class="example-preformatted">-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
  4438. </pre></div>
  4439. </dd>
  4440. <dt><samp class="option">source</samp></dt>
  4441. <dd><p>If the argument is <code class="code">source</code>, ffmpeg will force a key frame if
  4442. the current frame being encoded is marked as a key frame in its source.
  4443. In cases where this particular source frame has to be dropped,
  4444. enforce the next available frame to become a key frame instead.
  4445. </p>
  4446. </dd>
  4447. </dl>
  4448. <p>Note that forcing too many keyframes is very harmful for the lookahead
  4449. algorithms of certain encoders: using fixed-GOP options or similar
  4450. would be more efficient.
  4451. </p>
  4452. </dd>
  4453. <dt><samp class="option">-copyinkf[:<var class="var">stream_specifier</var>] (<em class="emph">output,per-stream</em>)</samp></dt>
  4454. <dd><p>When doing stream copy, copy also non-key frames found at the
  4455. beginning.
  4456. </p>
  4457. </dd>
  4458. <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>
  4459. <dd><p>Initialise a new hardware device of type <var class="var">type</var> called <var class="var">name</var>, using the
  4460. given device parameters.
  4461. If no name is specified it will receive a default name of the form &quot;<var class="var">type</var>%d&quot;.
  4462. </p>
  4463. <p>The meaning of <var class="var">device</var> and the following arguments depends on the
  4464. device type:
  4465. </p><dl class="table">
  4466. <dt><samp class="option">cuda</samp></dt>
  4467. <dd><p><var class="var">device</var> is the number of the CUDA device.
  4468. </p>
  4469. <p>The following options are recognized:
  4470. </p><dl class="table">
  4471. <dt><samp class="option">primary_ctx</samp></dt>
  4472. <dd><p>If set to 1, uses the primary device context instead of creating a new one.
  4473. </p></dd>
  4474. </dl>
  4475. <p>Examples:
  4476. </p><dl class="table">
  4477. <dt><em class="emph">-init_hw_device cuda:1</em></dt>
  4478. <dd><p>Choose the second device on the system.
  4479. </p>
  4480. </dd>
  4481. <dt><em class="emph">-init_hw_device cuda:0,primary_ctx=1</em></dt>
  4482. <dd><p>Choose the first device and use the primary device context.
  4483. </p></dd>
  4484. </dl>
  4485. </dd>
  4486. <dt><samp class="option">dxva2</samp></dt>
  4487. <dd><p><var class="var">device</var> is the number of the Direct3D 9 display adapter.
  4488. </p>
  4489. </dd>
  4490. <dt><samp class="option">d3d11va</samp></dt>
  4491. <dd><p><var class="var">device</var> is the number of the Direct3D 11 display adapter.
  4492. If not specified, it will attempt to use the default Direct3D 11 display adapter
  4493. or the first Direct3D 11 display adapter whose hardware VendorId is specified
  4494. by &lsquo;<samp class="samp">vendor_id</samp>&rsquo;.
  4495. </p>
  4496. <p>Examples:
  4497. </p><dl class="table">
  4498. <dt><em class="emph">-init_hw_device d3d11va</em></dt>
  4499. <dd><p>Create a d3d11va device on the default Direct3D 11 display adapter.
  4500. </p>
  4501. </dd>
  4502. <dt><em class="emph">-init_hw_device d3d11va:1</em></dt>
  4503. <dd><p>Create a d3d11va device on the Direct3D 11 display adapter specified by index 1.
  4504. </p>
  4505. </dd>
  4506. <dt><em class="emph">-init_hw_device d3d11va:,vendor_id=0x8086</em></dt>
  4507. <dd><p>Create a d3d11va device on the first Direct3D 11 display adapter whose hardware VendorId is 0x8086.
  4508. </p></dd>
  4509. </dl>
  4510. </dd>
  4511. <dt><samp class="option">vaapi</samp></dt>
  4512. <dd><p><var class="var">device</var> is either an X11 display name, a DRM render node or a DirectX adapter index.
  4513. If not specified, it will attempt to open the default X11 display (<em class="emph">$DISPLAY</em>)
  4514. and then the first DRM render node (<em class="emph">/dev/dri/renderD128</em>), or the default
  4515. DirectX adapter on Windows.
  4516. </p>
  4517. <p>The following options are recognized:
  4518. </p><dl class="table">
  4519. <dt><samp class="option">kernel_driver</samp></dt>
  4520. <dd><p>When <var class="var">device</var> is not specified, use this option to specify the name of the kernel
  4521. driver associated with the desired device. This option is available only when
  4522. the hardware acceleration method <em class="emph">drm</em> and <em class="emph">vaapi</em> are enabled.
  4523. </p></dd>
  4524. </dl>
  4525. <p>Examples:
  4526. </p><dl class="table">
  4527. <dt><em class="emph">-init_hw_device vaapi</em></dt>
  4528. <dd><p>Create a vaapi device on the default device.
  4529. </p>
  4530. </dd>
  4531. <dt><em class="emph">-init_hw_device vaapi:/dev/dri/renderD129</em></dt>
  4532. <dd><p>Create a vaapi device on DRM render node <samp class="file">/dev/dri/renderD129</samp>.
  4533. </p>
  4534. </dd>
  4535. <dt><em class="emph">-init_hw_device vaapi:1</em></dt>
  4536. <dd><p>Create a vaapi device on DirectX adapter 1.
  4537. </p>
  4538. </dd>
  4539. <dt><em class="emph">-init_hw_device vaapi:,kernel_driver=i915</em></dt>
  4540. <dd><p>Create a vaapi device on a device associated with kernel driver &lsquo;<samp class="samp">i915</samp>&rsquo;.
  4541. </p></dd>
  4542. </dl>
  4543. </dd>
  4544. <dt><samp class="option">vdpau</samp></dt>
  4545. <dd><p><var class="var">device</var> is an X11 display name.
  4546. If not specified, it will attempt to open the default X11 display (<em class="emph">$DISPLAY</em>).
  4547. </p>
  4548. </dd>
  4549. <dt><samp class="option">qsv</samp></dt>
  4550. <dd><p><var class="var">device</var> selects a value in &lsquo;<samp class="samp">MFX_IMPL_*</samp>&rsquo;. Allowed values are:
  4551. </p><dl class="table">
  4552. <dt><samp class="option">auto</samp></dt>
  4553. <dt><samp class="option">sw</samp></dt>
  4554. <dt><samp class="option">hw</samp></dt>
  4555. <dt><samp class="option">auto_any</samp></dt>
  4556. <dt><samp class="option">hw_any</samp></dt>
  4557. <dt><samp class="option">hw2</samp></dt>
  4558. <dt><samp class="option">hw3</samp></dt>
  4559. <dt><samp class="option">hw4</samp></dt>
  4560. </dl>
  4561. <p>If not specified, &lsquo;<samp class="samp">auto_any</samp>&rsquo; is used.
  4562. (Note that it may be easier to achieve the desired result for QSV by creating the
  4563. 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
  4564. QSV device from that.)
  4565. </p>
  4566. <p>The following options are recognized:
  4567. </p><dl class="table">
  4568. <dt><samp class="option">child_device</samp></dt>
  4569. <dd><p>Specify a DRM render node on Linux or DirectX adapter on Windows.
  4570. </p></dd>
  4571. <dt><samp class="option">child_device_type</samp></dt>
  4572. <dd><p>Choose platform-appropriate subdevice type. On Windows &lsquo;<samp class="samp">d3d11va</samp>&rsquo; is used
  4573. as default subdevice type when <code class="code">--enable-libvpl</code> is specified at configuration time,
  4574. &lsquo;<samp class="samp">dxva2</samp>&rsquo; is used as default subdevice type when <code class="code">--enable-libmfx</code> is specified at
  4575. configuration time. On Linux user can use &lsquo;<samp class="samp">vaapi</samp>&rsquo; only as subdevice type.
  4576. </p></dd>
  4577. </dl>
  4578. <p>Examples:
  4579. </p><dl class="table">
  4580. <dt><em class="emph">-init_hw_device qsv:hw,child_device=/dev/dri/renderD129</em></dt>
  4581. <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>.
  4582. </p>
  4583. </dd>
  4584. <dt><em class="emph">-init_hw_device qsv:hw,child_device=1</em></dt>
  4585. <dd><p>Create a QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo; on DirectX adapter 1.
  4586. </p>
  4587. </dd>
  4588. <dt><em class="emph">-init_hw_device qsv:hw,child_device_type=d3d11va</em></dt>
  4589. <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;.
  4590. </p>
  4591. </dd>
  4592. <dt><em class="emph">-init_hw_device qsv:hw,child_device_type=dxva2</em></dt>
  4593. <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;.
  4594. </p>
  4595. </dd>
  4596. <dt><em class="emph">-init_hw_device qsv:hw,child_device=1,child_device_type=d3d11va</em></dt>
  4597. <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;.
  4598. </p>
  4599. </dd>
  4600. <dt><em class="emph">-init_hw_device vaapi=va:/dev/dri/renderD129 -init_hw_device qsv=hw1@<var class="var">va</var></em></dt>
  4601. <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;
  4602. from device &lsquo;<samp class="samp">va</samp>&rsquo;.
  4603. </p>
  4604. </dd>
  4605. </dl>
  4606. </dd>
  4607. <dt><samp class="option">opencl</samp></dt>
  4608. <dd><p><var class="var">device</var> selects the platform and device as <em class="emph">platform_index.device_index</em>.
  4609. </p>
  4610. <p>The set of devices can also be filtered using the key-value pairs to find only
  4611. devices matching particular platform or device strings.
  4612. </p>
  4613. <p>The strings usable as filters are:
  4614. </p><dl class="table">
  4615. <dt><samp class="option">platform_profile</samp></dt>
  4616. <dt><samp class="option">platform_version</samp></dt>
  4617. <dt><samp class="option">platform_name</samp></dt>
  4618. <dt><samp class="option">platform_vendor</samp></dt>
  4619. <dt><samp class="option">platform_extensions</samp></dt>
  4620. <dt><samp class="option">device_name</samp></dt>
  4621. <dt><samp class="option">device_vendor</samp></dt>
  4622. <dt><samp class="option">driver_version</samp></dt>
  4623. <dt><samp class="option">device_version</samp></dt>
  4624. <dt><samp class="option">device_profile</samp></dt>
  4625. <dt><samp class="option">device_extensions</samp></dt>
  4626. <dt><samp class="option">device_type</samp></dt>
  4627. </dl>
  4628. <p>The indices and filters must together uniquely select a device.
  4629. </p>
  4630. <p>Examples:
  4631. </p><dl class="table">
  4632. <dt><em class="emph">-init_hw_device opencl:0.1</em></dt>
  4633. <dd><p>Choose the second device on the first platform.
  4634. </p>
  4635. </dd>
  4636. <dt><em class="emph">-init_hw_device opencl:,device_name=Foo9000</em></dt>
  4637. <dd><p>Choose the device with a name containing the string <em class="emph">Foo9000</em>.
  4638. </p>
  4639. </dd>
  4640. <dt><em class="emph">-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16</em></dt>
  4641. <dd><p>Choose the GPU device on the second platform supporting the <em class="emph">cl_khr_fp16</em>
  4642. extension.
  4643. </p></dd>
  4644. </dl>
  4645. </dd>
  4646. <dt><samp class="option">vulkan</samp></dt>
  4647. <dd><p>If <var class="var">device</var> is an integer, it selects the device by its index in a
  4648. system-dependent list of devices. If <var class="var">device</var> is any other string, it
  4649. selects the first device with a name containing that string as a substring.
  4650. </p>
  4651. <p>The following options are recognized:
  4652. </p><dl class="table">
  4653. <dt><samp class="option">debug</samp></dt>
  4654. <dd><p>If set to 1, enables the validation layer, if installed.
  4655. </p></dd>
  4656. <dt><samp class="option">linear_images</samp></dt>
  4657. <dd><p>If set to 1, images allocated by the hwcontext will be linear and locally mappable.
  4658. </p></dd>
  4659. <dt><samp class="option">instance_extensions</samp></dt>
  4660. <dd><p>A plus separated list of additional instance extensions to enable.
  4661. </p></dd>
  4662. <dt><samp class="option">device_extensions</samp></dt>
  4663. <dd><p>A plus separated list of additional device extensions to enable.
  4664. </p></dd>
  4665. </dl>
  4666. <p>Examples:
  4667. </p><dl class="table">
  4668. <dt><em class="emph">-init_hw_device vulkan:1</em></dt>
  4669. <dd><p>Choose the second device on the system.
  4670. </p>
  4671. </dd>
  4672. <dt><em class="emph">-init_hw_device vulkan:RADV</em></dt>
  4673. <dd><p>Choose the first device with a name containing the string <em class="emph">RADV</em>.
  4674. </p>
  4675. </dd>
  4676. <dt><em class="emph">-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface</em></dt>
  4677. <dd><p>Choose the first device and enable the Wayland and XCB instance extensions.
  4678. </p></dd>
  4679. </dl>
  4680. </dd>
  4681. </dl>
  4682. </dd>
  4683. <dt><samp class="option">-init_hw_device <var class="var">type</var>[=<var class="var">name</var>]@<var class="var">source</var></samp></dt>
  4684. <dd><p>Initialise a new hardware device of type <var class="var">type</var> called <var class="var">name</var>,
  4685. deriving it from the existing device with the name <var class="var">source</var>.
  4686. </p>
  4687. </dd>
  4688. <dt><samp class="option">-init_hw_device list</samp></dt>
  4689. <dd><p>List all hardware device types supported in this build of ffmpeg.
  4690. </p>
  4691. </dd>
  4692. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  4693. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  4694. This can be used to set the device to upload to with the <code class="code">hwupload</code> filter,
  4695. or the device to map to with the <code class="code">hwmap</code> filter. Other filters may also
  4696. make use of this parameter when they require a hardware device. Note that this
  4697. is typically only required when the input is not already in hardware frames -
  4698. when it is, filters will derive the device they require from the context of the
  4699. frames they receive as input.
  4700. </p>
  4701. <p>This is a global setting, so all filters will receive the same device.
  4702. </p>
  4703. </dd>
  4704. <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>
  4705. <dd><p>Use hardware acceleration to decode the matching stream(s). The allowed values
  4706. of <var class="var">hwaccel</var> are:
  4707. </p><dl class="table">
  4708. <dt><samp class="option">none</samp></dt>
  4709. <dd><p>Do not use any hardware acceleration (the default).
  4710. </p>
  4711. </dd>
  4712. <dt><samp class="option">auto</samp></dt>
  4713. <dd><p>Automatically select the hardware acceleration method.
  4714. </p>
  4715. </dd>
  4716. <dt><samp class="option">vdpau</samp></dt>
  4717. <dd><p>Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
  4718. </p>
  4719. </dd>
  4720. <dt><samp class="option">dxva2</samp></dt>
  4721. <dd><p>Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
  4722. </p>
  4723. </dd>
  4724. <dt><samp class="option">d3d11va</samp></dt>
  4725. <dd><p>Use D3D11VA (DirectX Video Acceleration) hardware acceleration.
  4726. </p>
  4727. </dd>
  4728. <dt><samp class="option">vaapi</samp></dt>
  4729. <dd><p>Use VAAPI (Video Acceleration API) hardware acceleration.
  4730. </p>
  4731. </dd>
  4732. <dt><samp class="option">qsv</samp></dt>
  4733. <dd><p>Use the Intel QuickSync Video acceleration for video transcoding.
  4734. </p>
  4735. <p>Unlike most other values, this option does not enable accelerated decoding (that
  4736. is used automatically whenever a qsv decoder is selected), but accelerated
  4737. transcoding, without copying the frames into the system memory.
  4738. </p>
  4739. <p>For it to work, both the decoder and the encoder must support QSV acceleration
  4740. and no filters must be used.
  4741. </p></dd>
  4742. </dl>
  4743. <p>This option has no effect if the selected hwaccel is not available or not
  4744. supported by the chosen decoder.
  4745. </p>
  4746. <p>Note that most acceleration methods are intended for playback and will not be
  4747. faster than software decoding on modern CPUs. Additionally, <code class="command">ffmpeg</code>
  4748. will usually need to copy the decoded frames from the GPU memory into the system
  4749. memory, resulting in further performance loss. This option is thus mainly
  4750. useful for testing.
  4751. </p>
  4752. </dd>
  4753. <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>
  4754. <dd><p>Select a device to use for hardware acceleration.
  4755. </p>
  4756. <p>This option only makes sense when the <samp class="option">-hwaccel</samp> option is also specified.
  4757. It can either refer to an existing device created with <samp class="option">-init_hw_device</samp>
  4758. by name, or it can create a new device as if
  4759. &lsquo;<samp class="samp">-init_hw_device</samp>&rsquo; <var class="var">type</var>:<var class="var">hwaccel_device</var>
  4760. were called immediately before.
  4761. </p>
  4762. </dd>
  4763. <dt><samp class="option">-hwaccels</samp></dt>
  4764. <dd><p>List all hardware acceleration components enabled in this build of ffmpeg.
  4765. Actual runtime availability depends on the hardware and its suitable driver
  4766. being installed.
  4767. </p>
  4768. </dd>
  4769. <dt><samp class="option">-fix_sub_duration_heartbeat[:<var class="var">stream_specifier</var>]</samp></dt>
  4770. <dd><p>Set a specific output video stream as the heartbeat stream according to which
  4771. to split and push through currently in-progress subtitle upon receipt of a
  4772. random access packet.
  4773. </p>
  4774. <p>This lowers the latency of subtitles for which the end packet or the following
  4775. subtitle has not yet been received. As a drawback, this will most likely lead
  4776. to duplication of subtitle events in order to cover the full duration, so
  4777. when dealing with use cases where latency of when the subtitle event is passed
  4778. on to output is not relevant this option should not be utilized.
  4779. </p>
  4780. <p>Requires <samp class="option">-fix_sub_duration</samp> to be set for the relevant input subtitle
  4781. stream for this to have any effect, as well as for the input subtitle stream
  4782. having to be directly mapped to the same output in which the heartbeat stream
  4783. resides.
  4784. </p>
  4785. </dd>
  4786. </dl>
  4787. </div>
  4788. <div class="section-level-extent" id="Audio-Options">
  4789. <h3 class="section"><span>5.7 Audio Options<a class="copiable-link" href="#Audio-Options"> &para;</a></span></h3>
  4790. <dl class="table">
  4791. <dt><samp class="option">-aframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  4792. <dd><p>Set the number of audio frames to output. This is an obsolete alias for
  4793. <code class="code">-frames:a</code>, which you should use instead.
  4794. </p></dd>
  4795. <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>
  4796. <dd><p>Set the audio sampling frequency. For output streams it is set by
  4797. default to the frequency of the corresponding input stream. For input
  4798. streams this option only makes sense for audio grabbing devices and raw
  4799. demuxers and is mapped to the corresponding demuxer options.
  4800. </p></dd>
  4801. <dt><samp class="option">-aq <var class="var">q</var> (<em class="emph">output</em>)</samp></dt>
  4802. <dd><p>Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
  4803. </p></dd>
  4804. <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>
  4805. <dd><p>Set the number of audio channels. For output streams it is set by
  4806. default to the number of input audio channels. For input streams
  4807. this option only makes sense for audio grabbing devices and raw demuxers
  4808. and is mapped to the corresponding demuxer options.
  4809. </p></dd>
  4810. <dt><samp class="option">-an (<em class="emph">input/output</em>)</samp></dt>
  4811. <dd><p>As an input option, blocks all audio streams of a file from being filtered or
  4812. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  4813. option to disable streams individually.
  4814. </p>
  4815. <p>As an output option, disables audio recording i.e. automatic selection or
  4816. mapping of any audio stream. For full manual control see the <code class="code">-map</code>
  4817. option.
  4818. </p></dd>
  4819. <dt><samp class="option">-acodec <var class="var">codec</var> (<em class="emph">input/output</em>)</samp></dt>
  4820. <dd><p>Set the audio codec. This is an alias for <code class="code">-codec:a</code>.
  4821. </p></dd>
  4822. <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>
  4823. <dd><p>Set the audio sample format. Use <code class="code">-sample_fmts</code> to get a list
  4824. of supported sample formats.
  4825. </p>
  4826. </dd>
  4827. <dt><samp class="option">-af <var class="var">filtergraph</var> (<em class="emph">output</em>)</samp></dt>
  4828. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  4829. filter the stream.
  4830. </p>
  4831. <p>This is an alias for <code class="code">-filter:a</code>, see the <a class="ref" href="#filter_005foption">-filter option</a>.
  4832. </p></dd>
  4833. </dl>
  4834. </div>
  4835. <div class="section-level-extent" id="Advanced-Audio-options">
  4836. <h3 class="section"><span>5.8 Advanced Audio options<a class="copiable-link" href="#Advanced-Audio-options"> &para;</a></span></h3>
  4837. <dl class="table">
  4838. <dt><samp class="option">-atag <var class="var">fourcc/tag</var> (<em class="emph">output</em>)</samp></dt>
  4839. <dd><p>Force audio tag/fourcc. This is an alias for <code class="code">-tag:a</code>.
  4840. </p></dd>
  4841. <dt><samp class="option">-guess_layout_max <var class="var">channels</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  4842. <dd><p>If some input channel layout is not known, try to guess only if it
  4843. corresponds to at most the specified number of channels. For example, 2
  4844. tells to <code class="command">ffmpeg</code> to recognize 1 channel as mono and 2 channels as
  4845. stereo but not 6 channels as 5.1. The default is to always try to guess. Use
  4846. 0 to disable all guessing.
  4847. </p></dd>
  4848. </dl>
  4849. </div>
  4850. <div class="section-level-extent" id="Subtitle-options">
  4851. <h3 class="section"><span>5.9 Subtitle options<a class="copiable-link" href="#Subtitle-options"> &para;</a></span></h3>
  4852. <dl class="table">
  4853. <dt><samp class="option">-scodec <var class="var">codec</var> (<em class="emph">input/output</em>)</samp></dt>
  4854. <dd><p>Set the subtitle codec. This is an alias for <code class="code">-codec:s</code>.
  4855. </p></dd>
  4856. <dt><samp class="option">-sn (<em class="emph">input/output</em>)</samp></dt>
  4857. <dd><p>As an input option, blocks all subtitle streams of a file from being filtered or
  4858. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  4859. option to disable streams individually.
  4860. </p>
  4861. <p>As an output option, disables subtitle recording i.e. automatic selection or
  4862. mapping of any subtitle stream. For full manual control see the <code class="code">-map</code>
  4863. option.
  4864. </p></dd>
  4865. </dl>
  4866. </div>
  4867. <div class="section-level-extent" id="Advanced-Subtitle-options">
  4868. <h3 class="section"><span>5.10 Advanced Subtitle options<a class="copiable-link" href="#Advanced-Subtitle-options"> &para;</a></span></h3>
  4869. <dl class="table">
  4870. <dt><samp class="option">-fix_sub_duration</samp></dt>
  4871. <dd><p>Fix subtitles durations. For each subtitle, wait for the next packet in the
  4872. same stream and adjust the duration of the first to avoid overlap. This is
  4873. necessary with some subtitles codecs, especially DVB subtitles, because the
  4874. duration in the original packet is only a rough estimate and the end is
  4875. actually marked by an empty subtitle frame. Failing to use this option when
  4876. necessary can result in exaggerated durations or muxing failures due to
  4877. non-monotonic timestamps.
  4878. </p>
  4879. <p>Note that this option will delay the output of all data until the next
  4880. subtitle packet is decoded: it may increase memory consumption and latency a
  4881. lot.
  4882. </p>
  4883. </dd>
  4884. <dt><samp class="option">-canvas_size <var class="var">size</var></samp></dt>
  4885. <dd><p>Set the size of the canvas used to render subtitles.
  4886. </p>
  4887. </dd>
  4888. </dl>
  4889. </div>
  4890. <div class="section-level-extent" id="Advanced-options">
  4891. <h3 class="section"><span>5.11 Advanced options<a class="copiable-link" href="#Advanced-options"> &para;</a></span></h3>
  4892. <dl class="table">
  4893. <dt><samp class="option">-map [-]<var class="var">input_file_id</var>[:<var class="var">stream_specifier</var>][?] | <var class="var">[linklabel]</var> (<em class="emph">output</em>)</samp></dt>
  4894. <dd>
  4895. <p>Create one or more streams in the output file. This option has two forms for
  4896. specifying the data source(s): the first selects one or more streams from some
  4897. input file (specified with <code class="code">-i</code>), the second takes an output from some
  4898. complex filtergraph (specified with <code class="code">-filter_complex</code>).
  4899. </p>
  4900. <p>In the first form, an output stream is created for every stream from the input
  4901. file with the index <var class="var">input_file_id</var>. If <var class="var">stream_specifier</var> is given,
  4902. only those streams that match the specifier are used (see the
  4903. <a class="ref" href="#Stream-specifiers">Stream specifiers</a> section for the <var class="var">stream_specifier</var> syntax).
  4904. </p>
  4905. <p>A <code class="code">-</code> character before the stream identifier creates a &quot;negative&quot; mapping.
  4906. It disables matching streams from already created mappings.
  4907. </p>
  4908. <p>A trailing <code class="code">?</code> after the stream index will allow the map to be
  4909. optional: if the map matches no streams the map will be ignored instead
  4910. of failing. Note the map will still fail if an invalid input file index
  4911. is used; such as if the map refers to a non-existent input.
  4912. </p>
  4913. <p>An alternative <var class="var">[linklabel]</var> form will map outputs from complex filter
  4914. graphs (see the <samp class="option">-filter_complex</samp> option) to the output file.
  4915. <var class="var">linklabel</var> must correspond to a defined output link label in the graph.
  4916. </p>
  4917. <p>This option may be specified multiple times, each adding more streams to the
  4918. output file. Any given input stream may also be mapped any number of times as a
  4919. source for different output streams, e.g. in order to use different encoding
  4920. options and/or filters. The streams are created in the output in the same order
  4921. in which the <code class="code">-map</code> options are given on the commandline.
  4922. </p>
  4923. <p>Using this option disables the default mappings for this output file.
  4924. </p>
  4925. <p>Examples:
  4926. </p>
  4927. <dl class="table">
  4928. <dt><em class="emph">map everything</em></dt>
  4929. <dd><p>To map ALL streams from the first input file to output
  4930. </p><div class="example">
  4931. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 output
  4932. </pre></div>
  4933. </dd>
  4934. <dt><em class="emph">select specific stream</em></dt>
  4935. <dd><p>If you have two audio streams in the first input file, these streams are
  4936. 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
  4937. streams to place in an output file. For example:
  4938. </p><div class="example">
  4939. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:1 out.wav
  4940. </pre></div>
  4941. <p>will map the second input stream in <samp class="file">INPUT</samp> to the (single) output stream
  4942. in <samp class="file">out.wav</samp>.
  4943. </p>
  4944. </dd>
  4945. <dt><em class="emph">create multiple streams</em></dt>
  4946. <dd><p>To select the stream with index 2 from input file <samp class="file">a.mov</samp> (specified by the
  4947. identifier <var class="var">0:2</var>), and stream with index 6 from input <samp class="file">b.mov</samp>
  4948. (specified by the identifier <var class="var">1:6</var>), and copy them to the output file
  4949. <samp class="file">out.mov</samp>:
  4950. </p><div class="example">
  4951. <pre class="example-preformatted">ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
  4952. </pre></div>
  4953. </dd>
  4954. <dt><em class="emph">create multiple streams 2</em></dt>
  4955. <dd><p>To select all video and the third audio stream from an input file:
  4956. </p><div class="example">
  4957. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
  4958. </pre></div>
  4959. </dd>
  4960. <dt><em class="emph">negative map</em></dt>
  4961. <dd><p>To map all the streams except the second audio, use negative mappings
  4962. </p><div class="example">
  4963. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
  4964. </pre></div>
  4965. </dd>
  4966. <dt><em class="emph">optional map</em></dt>
  4967. <dd><p>To map the video and audio streams from the first input, and using the
  4968. trailing <code class="code">?</code>, ignore the audio mapping if no audio streams exist in
  4969. the first input:
  4970. </p><div class="example">
  4971. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
  4972. </pre></div>
  4973. </dd>
  4974. <dt><em class="emph">map by language</em></dt>
  4975. <dd><p>To pick the English audio stream:
  4976. </p><div class="example">
  4977. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
  4978. </pre></div>
  4979. </dd>
  4980. </dl>
  4981. </dd>
  4982. <dt><samp class="option">-ignore_unknown</samp></dt>
  4983. <dd><p>Ignore input streams with unknown type instead of failing if copying
  4984. such streams is attempted.
  4985. </p>
  4986. </dd>
  4987. <dt><samp class="option">-copy_unknown</samp></dt>
  4988. <dd><p>Allow input streams with unknown type to be copied instead of failing if copying
  4989. such streams is attempted.
  4990. </p>
  4991. </dd>
  4992. <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>
  4993. <dd><p>Set metadata information of the next output file from <var class="var">infile</var>. Note that
  4994. those are file indices (zero-based), not filenames.
  4995. Optional <var class="var">metadata_spec_in/out</var> parameters specify, which metadata to copy.
  4996. A metadata specifier can have the following forms:
  4997. </p><dl class="table">
  4998. <dt><samp class="option"><var class="var">g</var></samp></dt>
  4999. <dd><p>global metadata, i.e. metadata that applies to the whole file
  5000. </p>
  5001. </dd>
  5002. <dt><samp class="option"><var class="var">s</var>[:<var class="var">stream_spec</var>]</samp></dt>
  5003. <dd><p>per-stream metadata. <var class="var">stream_spec</var> is a stream specifier as described
  5004. in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. In an input metadata specifier, the first
  5005. matching stream is copied from. In an output metadata specifier, all matching
  5006. streams are copied to.
  5007. </p>
  5008. </dd>
  5009. <dt><samp class="option"><var class="var">c</var>:<var class="var">chapter_index</var></samp></dt>
  5010. <dd><p>per-chapter metadata. <var class="var">chapter_index</var> is the zero-based chapter index.
  5011. </p>
  5012. </dd>
  5013. <dt><samp class="option"><var class="var">p</var>:<var class="var">program_index</var></samp></dt>
  5014. <dd><p>per-program metadata. <var class="var">program_index</var> is the zero-based program index.
  5015. </p></dd>
  5016. </dl>
  5017. <p>If metadata specifier is omitted, it defaults to global.
  5018. </p>
  5019. <p>By default, global metadata is copied from the first input file,
  5020. per-stream and per-chapter metadata is copied along with streams/chapters. These
  5021. default mappings are disabled by creating any mapping of the relevant type. A negative
  5022. file index can be used to create a dummy mapping that just disables automatic copying.
  5023. </p>
  5024. <p>For example to copy metadata from the first stream of the input file to global metadata
  5025. of the output file:
  5026. </p><div class="example">
  5027. <pre class="example-preformatted">ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
  5028. </pre></div>
  5029. <p>To do the reverse, i.e. copy global metadata to all audio streams:
  5030. </p><div class="example">
  5031. <pre class="example-preformatted">ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
  5032. </pre></div>
  5033. <p>Note that simple <code class="code">0</code> would work as well in this example, since global
  5034. metadata is assumed by default.
  5035. </p>
  5036. </dd>
  5037. <dt><samp class="option">-map_chapters <var class="var">input_file_index</var> (<em class="emph">output</em>)</samp></dt>
  5038. <dd><p>Copy chapters from input file with index <var class="var">input_file_index</var> to the next
  5039. output file. If no chapter mapping is specified, then chapters are copied from
  5040. the first input file with at least one chapter. Use a negative file index to
  5041. disable any chapter copying.
  5042. </p>
  5043. </dd>
  5044. <dt><samp class="option">-benchmark (<em class="emph">global</em>)</samp></dt>
  5045. <dd><p>Show benchmarking information at the end of an encode.
  5046. Shows real, system and user time used and maximum memory consumption.
  5047. Maximum memory consumption is not supported on all systems,
  5048. it will usually display as 0 if not supported.
  5049. </p></dd>
  5050. <dt><samp class="option">-benchmark_all (<em class="emph">global</em>)</samp></dt>
  5051. <dd><p>Show benchmarking information during the encode.
  5052. Shows real, system and user time used in various steps (audio/video encode/decode).
  5053. </p></dd>
  5054. <dt><samp class="option">-timelimit <var class="var">duration</var> (<em class="emph">global</em>)</samp></dt>
  5055. <dd><p>Exit after ffmpeg has been running for <var class="var">duration</var> seconds in CPU user time.
  5056. </p></dd>
  5057. <dt><samp class="option">-dump (<em class="emph">global</em>)</samp></dt>
  5058. <dd><p>Dump each input packet to stderr.
  5059. </p></dd>
  5060. <dt><samp class="option">-hex (<em class="emph">global</em>)</samp></dt>
  5061. <dd><p>When dumping packets, also dump the payload.
  5062. </p></dd>
  5063. <dt><samp class="option">-readrate <var class="var">speed</var> (<em class="emph">input</em>)</samp></dt>
  5064. <dd><p>Limit input read speed.
  5065. </p>
  5066. <p>Its value is a floating-point positive number which represents the maximum duration of
  5067. media, in seconds, that should be ingested in one second of wallclock time.
  5068. Default value is zero and represents no imposed limitation on speed of ingestion.
  5069. Value <code class="code">1</code> represents real-time speed and is equivalent to <code class="code">-re</code>.
  5070. </p>
  5071. <p>Mainly used to simulate a capture device or live input stream (e.g. when reading from a file).
  5072. Should not be used with a low value when input is an actual capture device or live stream as
  5073. it may cause packet loss.
  5074. </p>
  5075. <p>It is useful for when flow speed of output packets is important, such as live streaming.
  5076. </p></dd>
  5077. <dt><samp class="option">-re (<em class="emph">input</em>)</samp></dt>
  5078. <dd><p>Read input at native frame rate. This is equivalent to setting <code class="code">-readrate 1</code>.
  5079. </p></dd>
  5080. <dt><samp class="option">-readrate_initial_burst <var class="var">seconds</var></samp></dt>
  5081. <dd><p>Set an initial read burst time, in seconds, after which <samp class="option">-re/-readrate</samp>
  5082. will be enforced.
  5083. </p></dd>
  5084. <dt><samp class="option">-vsync <var class="var">parameter</var> (<em class="emph">global</em>)</samp></dt>
  5085. <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>
  5086. <dd><p>Set video sync method / framerate mode. vsync is applied to all output video streams
  5087. but can be overridden for a stream by setting fps_mode. vsync is deprecated and will be
  5088. removed in the future.
  5089. </p>
  5090. <p>For compatibility reasons some of the values for vsync can be specified as numbers (shown
  5091. in parentheses in the following table).
  5092. </p>
  5093. <dl class="table">
  5094. <dt><samp class="option">passthrough (0)</samp></dt>
  5095. <dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
  5096. </p></dd>
  5097. <dt><samp class="option">cfr (1)</samp></dt>
  5098. <dd><p>Frames will be duplicated and dropped to achieve exactly the requested
  5099. constant frame rate.
  5100. </p></dd>
  5101. <dt><samp class="option">vfr (2)</samp></dt>
  5102. <dd><p>Frames are passed through with their timestamp or dropped so as to
  5103. prevent 2 frames from having the same timestamp.
  5104. </p></dd>
  5105. <dt><samp class="option">auto (-1)</samp></dt>
  5106. <dd><p>Chooses between cfr and vfr depending on muxer capabilities. This is the
  5107. default method.
  5108. </p></dd>
  5109. </dl>
  5110. <p>Note that the timestamps may be further modified by the muxer, after this.
  5111. For example, in the case that the format option <samp class="option">avoid_negative_ts</samp>
  5112. is enabled.
  5113. </p>
  5114. <p>With -map you can select from which stream the timestamps should be
  5115. taken. You can leave either video or audio unchanged and sync the
  5116. remaining stream(s) to the unchanged one.
  5117. </p>
  5118. </dd>
  5119. <dt><samp class="option">-frame_drop_threshold <var class="var">parameter</var></samp></dt>
  5120. <dd><p>Frame drop threshold, which specifies how much behind video frames can
  5121. be before they are dropped. In frame rate units, so 1.0 is one frame.
  5122. The default is -1.1. One possible usecase is to avoid framedrops in case
  5123. of noisy timestamps or to increase frame drop precision in case of exact
  5124. timestamps.
  5125. </p>
  5126. </dd>
  5127. <dt><samp class="option">-apad <var class="var">parameters</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5128. <dd><p>Pad the output audio stream(s). This is the same as applying <code class="code">-af apad</code>.
  5129. Argument is a string of filter parameters composed the same as with the <code class="code">apad</code> filter.
  5130. <code class="code">-shortest</code> must be set for this output for the option to take effect.
  5131. </p>
  5132. </dd>
  5133. <dt><samp class="option">-copyts</samp></dt>
  5134. <dd><p>Do not process input timestamps, but keep their values without trying
  5135. to sanitize them. In particular, do not remove the initial start time
  5136. offset value.
  5137. </p>
  5138. <p>Note that, depending on the <samp class="option">vsync</samp> option or on specific muxer
  5139. processing (e.g. in case the format option <samp class="option">avoid_negative_ts</samp>
  5140. is enabled) the output timestamps may mismatch with the input
  5141. timestamps even when this option is selected.
  5142. </p>
  5143. </dd>
  5144. <dt><samp class="option">-start_at_zero</samp></dt>
  5145. <dd><p>When used with <samp class="option">copyts</samp>, shift input timestamps so they start at zero.
  5146. </p>
  5147. <p>This means that using e.g. <code class="code">-ss 50</code> will make output timestamps start at
  5148. 50 seconds, regardless of what timestamp the input file started at.
  5149. </p>
  5150. </dd>
  5151. <dt><samp class="option">-copytb <var class="var">mode</var></samp></dt>
  5152. <dd><p>Specify how to set the encoder timebase when stream copying. <var class="var">mode</var> is an
  5153. integer numeric value, and can assume one of the following values:
  5154. </p>
  5155. <dl class="table">
  5156. <dt><samp class="option">1</samp></dt>
  5157. <dd><p>Use the demuxer timebase.
  5158. </p>
  5159. <p>The time base is copied to the output encoder from the corresponding input
  5160. demuxer. This is sometimes required to avoid non monotonically increasing
  5161. timestamps when copying video streams with variable frame rate.
  5162. </p>
  5163. </dd>
  5164. <dt><samp class="option">0</samp></dt>
  5165. <dd><p>Use the decoder timebase.
  5166. </p>
  5167. <p>The time base is copied to the output encoder from the corresponding input
  5168. decoder.
  5169. </p>
  5170. </dd>
  5171. <dt><samp class="option">-1</samp></dt>
  5172. <dd><p>Try to make the choice automatically, in order to generate a sane output.
  5173. </p></dd>
  5174. </dl>
  5175. <p>Default value is -1.
  5176. </p>
  5177. </dd>
  5178. <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>
  5179. <dd><p>Set the encoder timebase. <var class="var">timebase</var> can assume one of the following values:
  5180. </p>
  5181. <dl class="table">
  5182. <dt><samp class="option">0</samp></dt>
  5183. <dd><p>Assign a default value according to the media type.
  5184. </p>
  5185. <p>For video - use 1/framerate, for audio - use 1/samplerate.
  5186. </p>
  5187. </dd>
  5188. <dt><samp class="option">demux</samp></dt>
  5189. <dd><p>Use the timebase from the demuxer.
  5190. </p>
  5191. </dd>
  5192. <dt><samp class="option">filter</samp></dt>
  5193. <dd><p>Use the timebase from the filtergraph.
  5194. </p>
  5195. </dd>
  5196. <dt><samp class="option">a positive number</samp></dt>
  5197. <dd><p>Use the provided number as the timebase.
  5198. </p>
  5199. <p>This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000)
  5200. or as a decimal number (e.g. 0.04166, 2.0833e-5)
  5201. </p></dd>
  5202. </dl>
  5203. <p>Default value is 0.
  5204. </p>
  5205. </dd>
  5206. <dt><samp class="option">-bitexact (<em class="emph">input/output</em>)</samp></dt>
  5207. <dd><p>Enable bitexact mode for (de)muxer and (de/en)coder
  5208. </p></dd>
  5209. <dt><samp class="option">-shortest (<em class="emph">output</em>)</samp></dt>
  5210. <dd><p>Finish encoding when the shortest output stream ends.
  5211. </p>
  5212. <p>Note that this option may require buffering frames, which introduces extra
  5213. latency. The maximum amount of this latency may be controlled with the
  5214. <code class="code">-shortest_buf_duration</code> option.
  5215. </p>
  5216. </dd>
  5217. <dt><samp class="option">-shortest_buf_duration <var class="var">duration</var> (<em class="emph">output</em>)</samp></dt>
  5218. <dd><p>The <code class="code">-shortest</code> option may require buffering potentially large amounts
  5219. of data when at least one of the streams is &quot;sparse&quot; (i.e. has large gaps
  5220. between frames – this is typically the case for subtitles).
  5221. </p>
  5222. <p>This option controls the maximum duration of buffered frames in seconds.
  5223. Larger values may allow the <code class="code">-shortest</code> option to produce more accurate
  5224. results, but increase memory use and latency.
  5225. </p>
  5226. <p>The default value is 10 seconds.
  5227. </p>
  5228. </dd>
  5229. <dt><samp class="option">-dts_delta_threshold <var class="var">threshold</var></samp></dt>
  5230. <dd><p>Timestamp discontinuity delta threshold, expressed as a decimal number
  5231. of seconds.
  5232. </p>
  5233. <p>The timestamp discontinuity correction enabled by this option is only
  5234. applied to input formats accepting timestamp discontinuity (for which
  5235. the <code class="code">AVFMT_TS_DISCONT</code> flag is enabled), e.g. MPEG-TS and HLS, and
  5236. is automatically disabled when employing the <code class="code">-copyts</code> option
  5237. (unless wrapping is detected).
  5238. </p>
  5239. <p>If a timestamp discontinuity is detected whose absolute value is
  5240. greater than <var class="var">threshold</var>, ffmpeg will remove the discontinuity by
  5241. decreasing/increasing the current DTS and PTS by the corresponding
  5242. delta value.
  5243. </p>
  5244. <p>The default value is 10.
  5245. </p>
  5246. </dd>
  5247. <dt><samp class="option">-dts_error_threshold <var class="var">threshold</var></samp></dt>
  5248. <dd><p>Timestamp error delta threshold, expressed as a decimal number of
  5249. seconds.
  5250. </p>
  5251. <p>The timestamp correction enabled by this option is only applied to
  5252. input formats not accepting timestamp discontinuity (for which the
  5253. <code class="code">AVFMT_TS_DISCONT</code> flag is not enabled).
  5254. </p>
  5255. <p>If a timestamp discontinuity is detected whose absolute value is
  5256. greater than <var class="var">threshold</var>, ffmpeg will drop the PTS/DTS timestamp
  5257. value.
  5258. </p>
  5259. <p>The default value is <code class="code">3600*30</code> (30 hours), which is arbitrarily
  5260. picked and quite conservative.
  5261. </p>
  5262. </dd>
  5263. <dt><samp class="option">-muxdelay <var class="var">seconds</var> (<em class="emph">output</em>)</samp></dt>
  5264. <dd><p>Set the maximum demux-decode delay.
  5265. </p></dd>
  5266. <dt><samp class="option">-muxpreload <var class="var">seconds</var> (<em class="emph">output</em>)</samp></dt>
  5267. <dd><p>Set the initial demux-decode delay.
  5268. </p></dd>
  5269. <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>
  5270. <dd><p>Assign a new stream-id value to an output stream. This option should be
  5271. specified prior to the output filename to which it applies.
  5272. For the situation where multiple output files exist, a streamid
  5273. may be reassigned to a different value.
  5274. </p>
  5275. <p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
  5276. an output mpegts file:
  5277. </p><div class="example">
  5278. <pre class="example-preformatted">ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
  5279. </pre></div>
  5280. </dd>
  5281. <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>
  5282. <dd><p>Apply bitstream filters to matching streams. The filters are applied to each
  5283. packet as it is received from the demuxer (when used as an input option) or
  5284. before it is sent to the muxer (when used as an output option).
  5285. </p>
  5286. <p><var class="var">bitstream_filters</var> is a comma-separated list of bitstream filter
  5287. specifications, each of the form
  5288. </p><div class="example">
  5289. <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>:...]
  5290. </pre></div>
  5291. <p>Any of the &rsquo;,=:&rsquo; characters that are to be a part of an option value need to be
  5292. escaped with a backslash.
  5293. </p>
  5294. <p>Use the <code class="code">-bsfs</code> option to get the list of bitstream filters.
  5295. </p>
  5296. <p>E.g.
  5297. </p><div class="example">
  5298. <pre class="example-preformatted">ffmpeg -bsf:v h264_mp4toannexb -i h264.mp4 -c:v copy -an out.h264
  5299. </pre></div>
  5300. <p>applies the <code class="code">h264_mp4toannexb</code> bitstream filter (which converts
  5301. MP4-encapsulated H.264 stream to Annex B) to the <em class="emph">input</em> video stream.
  5302. </p>
  5303. <p>On the other hand,
  5304. </p><div class="example">
  5305. <pre class="example-preformatted">ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
  5306. </pre></div>
  5307. <p>applies the <code class="code">mov2textsub</code> bitstream filter (which extracts text from MOV
  5308. subtitles) to the <em class="emph">output</em> subtitle stream. Note, however, that since both
  5309. examples use <code class="code">-c copy</code>, it matters little whether the filters are applied
  5310. on input or output - that would change if transcoding was happening.
  5311. </p>
  5312. </dd>
  5313. <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>
  5314. <dd><p>Force a tag/fourcc for matching streams.
  5315. </p>
  5316. </dd>
  5317. <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>
  5318. <dd><p>Specify Timecode for writing. <var class="var">SEP</var> is &rsquo;:&rsquo; for non drop timecode and &rsquo;;&rsquo;
  5319. (or &rsquo;.&rsquo;) for drop.
  5320. </p><div class="example">
  5321. <pre class="example-preformatted">ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
  5322. </pre></div>
  5323. <a class="anchor" id="filter_005fcomplex_005foption"></a></dd>
  5324. <dt><samp class="option">-filter_complex <var class="var">filtergraph</var> (<em class="emph">global</em>)</samp></dt>
  5325. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  5326. outputs. For simple graphs &ndash; those with one input and one output of the same
  5327. type &ndash; see the <samp class="option">-filter</samp> options. <var class="var">filtergraph</var> is a description of
  5328. the filtergraph, as described in the &ldquo;Filtergraph syntax&rdquo; section of the
  5329. ffmpeg-filters manual.
  5330. </p>
  5331. <p>Input link labels must refer to either input streams or loopback decoders. For
  5332. input streams, use the <code class="code">[file_index:stream_specifier]</code> syntax (i.e. the
  5333. same as <samp class="option">-map</samp> uses). If <var class="var">stream_specifier</var> matches multiple streams,
  5334. the first one will be used.
  5335. </p>
  5336. <p>For decoders, the link label must be [dec:<var class="var">dec_idx</var>], where <var class="var">dec_idx</var> is
  5337. the index of the loopback decoder to be connected to given input.
  5338. </p>
  5339. <p>An unlabeled input will be connected to the first unused input stream of the
  5340. matching type.
  5341. </p>
  5342. <p>Output link labels are referred to with <samp class="option">-map</samp>. Unlabeled outputs are
  5343. added to the first output file.
  5344. </p>
  5345. <p>Note that with this option it is possible to use only lavfi sources without
  5346. normal input files.
  5347. </p>
  5348. <p>For example, to overlay an image over video
  5349. </p><div class="example">
  5350. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
  5351. '[out]' out.mkv
  5352. </pre></div>
  5353. <p>Here <code class="code">[0:v]</code> refers to the first video stream in the first input file,
  5354. which is linked to the first (main) input of the overlay filter. Similarly the
  5355. first video stream in the second input is linked to the second (overlay) input
  5356. of overlay.
  5357. </p>
  5358. <p>Assuming there is only one video stream in each input file, we can omit input
  5359. labels, so the above is equivalent to
  5360. </p><div class="example">
  5361. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
  5362. '[out]' out.mkv
  5363. </pre></div>
  5364. <p>Furthermore we can omit the output label and the single output from the filter
  5365. graph will be added to the output file automatically, so we can simply write
  5366. </p><div class="example">
  5367. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
  5368. </pre></div>
  5369. <p>As a special exception, you can use a bitmap subtitle stream as input: it
  5370. will be converted into a video with the same size as the largest video in
  5371. the file, or 720x576 if no video is present. Note that this is an
  5372. experimental and temporary solution. It will be removed once libavfilter has
  5373. proper support for subtitles.
  5374. </p>
  5375. <p>For example, to hardcode subtitles on top of a DVB-T recording stored in
  5376. MPEG-TS format, delaying the subtitles by 1 second:
  5377. </p><div class="example">
  5378. <pre class="example-preformatted">ffmpeg -i input.ts -filter_complex \
  5379. '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
  5380. -sn -map '#0x2dc' output.mkv
  5381. </pre></div>
  5382. <p>(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
  5383. audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
  5384. </p>
  5385. <p>To generate 5 seconds of pure red video using lavfi <code class="code">color</code> source:
  5386. </p><div class="example">
  5387. <pre class="example-preformatted">ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
  5388. </pre></div>
  5389. </dd>
  5390. <dt><samp class="option">-filter_complex_threads <var class="var">nb_threads</var> (<em class="emph">global</em>)</samp></dt>
  5391. <dd><p>Defines how many threads are used to process a filter_complex graph.
  5392. Similar to filter_threads but used for <code class="code">-filter_complex</code> graphs only.
  5393. The default is the number of available CPUs.
  5394. </p>
  5395. </dd>
  5396. <dt><samp class="option">-lavfi <var class="var">filtergraph</var> (<em class="emph">global</em>)</samp></dt>
  5397. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  5398. outputs. Equivalent to <samp class="option">-filter_complex</samp>.
  5399. </p>
  5400. </dd>
  5401. <dt><samp class="option">-accurate_seek (<em class="emph">input</em>)</samp></dt>
  5402. <dd><p>This option enables or disables accurate seeking in input files with the
  5403. <samp class="option">-ss</samp> option. It is enabled by default, so seeking is accurate when
  5404. transcoding. Use <samp class="option">-noaccurate_seek</samp> to disable it, which may be useful
  5405. e.g. when copying some streams and transcoding the others.
  5406. </p>
  5407. </dd>
  5408. <dt><samp class="option">-seek_timestamp (<em class="emph">input</em>)</samp></dt>
  5409. <dd><p>This option enables or disables seeking by timestamp in input files with the
  5410. <samp class="option">-ss</samp> option. It is disabled by default. If enabled, the argument
  5411. to the <samp class="option">-ss</samp> option is considered an actual timestamp, and is not
  5412. offset by the start time of the file. This matters only for files which do
  5413. not start from timestamp 0, such as transport streams.
  5414. </p>
  5415. </dd>
  5416. <dt><samp class="option">-thread_queue_size <var class="var">size</var> (<em class="emph">input/output</em>)</samp></dt>
  5417. <dd><p>For input, this option sets the maximum number of queued packets when reading
  5418. from the file or device. With low latency / high rate live streams, packets may
  5419. be discarded if they are not read in a timely manner; setting this value can
  5420. force ffmpeg to use a separate input thread and read packets as soon as they
  5421. arrive. By default ffmpeg only does this if multiple inputs are specified.
  5422. </p>
  5423. <p>For output, this option specified the maximum number of packets that may be
  5424. queued to each muxing thread.
  5425. </p>
  5426. </dd>
  5427. <dt><samp class="option">-sdp_file <var class="var">file</var> (<em class="emph">global</em>)</samp></dt>
  5428. <dd><p>Print sdp information for an output stream to <var class="var">file</var>.
  5429. This allows dumping sdp information when at least one output isn&rsquo;t an
  5430. rtp stream. (Requires at least one of the output formats to be rtp).
  5431. </p>
  5432. </dd>
  5433. <dt><samp class="option">-discard (<em class="emph">input</em>)</samp></dt>
  5434. <dd><p>Allows discarding specific streams or frames from streams.
  5435. Any input stream can be fully discarded, using value <code class="code">all</code> whereas
  5436. selective discarding of frames from a stream occurs at the demuxer
  5437. and is not supported by all demuxers.
  5438. </p>
  5439. <dl class="table">
  5440. <dt><samp class="option">none</samp></dt>
  5441. <dd><p>Discard no frame.
  5442. </p>
  5443. </dd>
  5444. <dt><samp class="option">default</samp></dt>
  5445. <dd><p>Default, which discards no frames.
  5446. </p>
  5447. </dd>
  5448. <dt><samp class="option">noref</samp></dt>
  5449. <dd><p>Discard all non-reference frames.
  5450. </p>
  5451. </dd>
  5452. <dt><samp class="option">bidir</samp></dt>
  5453. <dd><p>Discard all bidirectional frames.
  5454. </p>
  5455. </dd>
  5456. <dt><samp class="option">nokey</samp></dt>
  5457. <dd><p>Discard all frames excepts keyframes.
  5458. </p>
  5459. </dd>
  5460. <dt><samp class="option">all</samp></dt>
  5461. <dd><p>Discard all frames.
  5462. </p></dd>
  5463. </dl>
  5464. </dd>
  5465. <dt><samp class="option">-abort_on <var class="var">flags</var> (<em class="emph">global</em>)</samp></dt>
  5466. <dd><p>Stop and abort on various conditions. The following flags are available:
  5467. </p>
  5468. <dl class="table">
  5469. <dt><samp class="option">empty_output</samp></dt>
  5470. <dd><p>No packets were passed to the muxer, the output is empty.
  5471. </p></dd>
  5472. <dt><samp class="option">empty_output_stream</samp></dt>
  5473. <dd><p>No packets were passed to the muxer in some of the output streams.
  5474. </p></dd>
  5475. </dl>
  5476. </dd>
  5477. <dt><samp class="option">-max_error_rate (<em class="emph">global</em>)</samp></dt>
  5478. <dd><p>Set fraction of decoding frame failures across all inputs which when crossed
  5479. ffmpeg will return exit code 69. Crossing this threshold does not terminate
  5480. processing. Range is a floating-point number between 0 to 1. Default is 2/3.
  5481. </p>
  5482. </dd>
  5483. <dt><samp class="option">-xerror (<em class="emph">global</em>)</samp></dt>
  5484. <dd><p>Stop and exit on error
  5485. </p>
  5486. </dd>
  5487. <dt><samp class="option">-max_muxing_queue_size <var class="var">packets</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5488. <dd><p>When transcoding audio and/or video streams, ffmpeg will not begin writing into
  5489. the output until it has one packet for each such stream. While waiting for that
  5490. to happen, packets for other streams are buffered. This option sets the size of
  5491. this buffer, in packets, for the matching output stream.
  5492. </p>
  5493. <p>The default value of this option should be high enough for most uses, so only
  5494. touch this option if you are sure that you need it.
  5495. </p>
  5496. </dd>
  5497. <dt><samp class="option">-muxing_queue_data_threshold <var class="var">bytes</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  5498. <dd><p>This is a minimum threshold until which the muxing queue size is not taken into
  5499. account. Defaults to 50 megabytes per stream, and is based on the overall size
  5500. of packets passed to the muxer.
  5501. </p>
  5502. </dd>
  5503. <dt><samp class="option">-auto_conversion_filters (<em class="emph">global</em>)</samp></dt>
  5504. <dd><p>Enable automatically inserting format conversion filters in all filter
  5505. graphs, including those defined by <samp class="option">-vf</samp>, <samp class="option">-af</samp>,
  5506. <samp class="option">-filter_complex</samp> and <samp class="option">-lavfi</samp>. If filter format negotiation
  5507. requires a conversion, the initialization of the filters will fail.
  5508. Conversions can still be performed by inserting the relevant conversion
  5509. filter (scale, aresample) in the graph.
  5510. On by default, to explicitly disable it you need to specify
  5511. <code class="code">-noauto_conversion_filters</code>.
  5512. </p>
  5513. </dd>
  5514. <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>
  5515. <dd><p>Declare the number of bits per raw sample in the given output stream to be
  5516. <var class="var">value</var>. Note that this option sets the information provided to the
  5517. encoder/muxer, it does not change the stream to conform to this value. Setting
  5518. values that do not match the stream properties may result in encoding failures
  5519. or invalid output files.
  5520. </p>
  5521. <a class="anchor" id="stats_005fenc_005foptions"></a></dd>
  5522. <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>
  5523. <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>
  5524. <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>
  5525. <dd><p>Write per-frame encoding information about the matching streams into the file
  5526. given by <var class="var">path</var>.
  5527. </p>
  5528. <p><samp class="option">-stats_enc_pre</samp> writes information about raw video or audio frames right
  5529. before they are sent for encoding, while <samp class="option">-stats_enc_post</samp> writes
  5530. information about encoded packets as they are received from the encoder.
  5531. <samp class="option">-stats_mux_pre</samp> writes information about packets just as they are about to
  5532. be sent to the muxer. Every frame or packet produces one line in the specified
  5533. file. The format of this line is controlled by <samp class="option">-stats_enc_pre_fmt</samp> /
  5534. <samp class="option">-stats_enc_post_fmt</samp> / <samp class="option">-stats_mux_pre_fmt</samp>.
  5535. </p>
  5536. <p>When stats for multiple streams are written into a single file, the lines
  5537. corresponding to different streams will be interleaved. The precise order of
  5538. this interleaving is not specified and not guaranteed to remain stable between
  5539. different invocations of the program, even with the same options.
  5540. </p>
  5541. </dd>
  5542. <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>
  5543. <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>
  5544. <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>
  5545. <dd><p>Specify the format for the lines written with <samp class="option">-stats_enc_pre</samp> /
  5546. <samp class="option">-stats_enc_post</samp> / <samp class="option">-stats_mux_pre</samp>.
  5547. </p>
  5548. <p><var class="var">format_spec</var> is a string that may contain directives of the form
  5549. <var class="var">{fmt}</var>. <var class="var">format_spec</var> is backslash-escaped &mdash; use \{, \}, and \\
  5550. to write a literal {, }, or \, respectively, into the output.
  5551. </p>
  5552. <p>The directives given with <var class="var">fmt</var> may be one of the following:
  5553. </p><dl class="table">
  5554. <dt><samp class="option">fidx</samp></dt>
  5555. <dd><p>Index of the output file.
  5556. </p>
  5557. </dd>
  5558. <dt><samp class="option">sidx</samp></dt>
  5559. <dd><p>Index of the output stream in the file.
  5560. </p>
  5561. </dd>
  5562. <dt><samp class="option">n</samp></dt>
  5563. <dd><p>Frame number. Pre-encoding: number of frames sent to the encoder so far.
  5564. Post-encoding: number of packets received from the encoder so far.
  5565. Muxing: number of packets submitted to the muxer for this stream so far.
  5566. </p>
  5567. </dd>
  5568. <dt><samp class="option">ni</samp></dt>
  5569. <dd><p>Input frame number. Index of the input frame (i.e. output by a decoder) that
  5570. corresponds to this output frame or packet. -1 if unavailable.
  5571. </p>
  5572. </dd>
  5573. <dt><samp class="option">tb</samp></dt>
  5574. <dd><p>Timebase in which this frame/packet&rsquo;s timestamps are expressed, as a rational
  5575. number <var class="var">num/den</var>. Note that encoder and muxer may use different timebases.
  5576. </p>
  5577. </dd>
  5578. <dt><samp class="option">tbi</samp></dt>
  5579. <dd><p>Timebase for <var class="var">ptsi</var>, as a rational number <var class="var">num/den</var>. Available when
  5580. <var class="var">ptsi</var> is available, <var class="var">0/1</var> otherwise.
  5581. </p>
  5582. </dd>
  5583. <dt><samp class="option">pts</samp></dt>
  5584. <dd><p>Presentation timestamp of the frame or packet, as an integer. Should be
  5585. multiplied by the timebase to compute presentation time.
  5586. </p>
  5587. </dd>
  5588. <dt><samp class="option">ptsi</samp></dt>
  5589. <dd><p>Presentation timestamp of the input frame (see <var class="var">ni</var>), as an integer. Should
  5590. be multiplied by <var class="var">tbi</var> to compute presentation time. Printed as
  5591. (2^63 - 1 = 9223372036854775807) when not available.
  5592. </p>
  5593. </dd>
  5594. <dt><samp class="option">t</samp></dt>
  5595. <dd><p>Presentation time of the frame or packet, as a decimal number. Equal to
  5596. <var class="var">pts</var> multiplied by <var class="var">tb</var>.
  5597. </p>
  5598. </dd>
  5599. <dt><samp class="option">ti</samp></dt>
  5600. <dd><p>Presentation time of the input frame (see <var class="var">ni</var>), as a decimal number. Equal
  5601. to <var class="var">ptsi</var> multiplied by <var class="var">tbi</var>. Printed as inf when not available.
  5602. </p>
  5603. </dd>
  5604. <dt><samp class="option">dts (<em class="emph">packet</em>)</samp></dt>
  5605. <dd><p>Decoding timestamp of the packet, as an integer. Should be multiplied by the
  5606. timebase to compute presentation time.
  5607. </p>
  5608. </dd>
  5609. <dt><samp class="option">dt (<em class="emph">packet</em>)</samp></dt>
  5610. <dd><p>Decoding time of the frame or packet, as a decimal number. Equal to
  5611. <var class="var">dts</var> multiplied by <var class="var">tb</var>.
  5612. </p>
  5613. </dd>
  5614. <dt><samp class="option">sn (<em class="emph">frame,audio</em>)</samp></dt>
  5615. <dd><p>Number of audio samples sent to the encoder so far.
  5616. </p>
  5617. </dd>
  5618. <dt><samp class="option">samp (<em class="emph">frame,audio</em>)</samp></dt>
  5619. <dd><p>Number of audio samples in the frame.
  5620. </p>
  5621. </dd>
  5622. <dt><samp class="option">size (<em class="emph">packet</em>)</samp></dt>
  5623. <dd><p>Size of the encoded packet in bytes.
  5624. </p>
  5625. </dd>
  5626. <dt><samp class="option">br (<em class="emph">packet</em>)</samp></dt>
  5627. <dd><p>Current bitrate in bits per second.
  5628. </p>
  5629. </dd>
  5630. <dt><samp class="option">abr (<em class="emph">packet</em>)</samp></dt>
  5631. <dd><p>Average bitrate for the whole stream so far, in bits per second, -1 if it cannot
  5632. be determined at this point.
  5633. </p>
  5634. </dd>
  5635. <dt><samp class="option">key (<em class="emph">packet</em>)</samp></dt>
  5636. <dd><p>Character &rsquo;K&rsquo; if the packet contains a keyframe, character &rsquo;N&rsquo; otherwise.
  5637. </p></dd>
  5638. </dl>
  5639. <p>Directives tagged with <em class="emph">packet</em> may only be used with
  5640. <samp class="option">-stats_enc_post_fmt</samp> and <samp class="option">-stats_mux_pre_fmt</samp>.
  5641. </p>
  5642. <p>Directives tagged with <em class="emph">frame</em> may only be used with
  5643. <samp class="option">-stats_enc_pre_fmt</samp>.
  5644. </p>
  5645. <p>Directives tagged with <em class="emph">audio</em> may only be used with audio streams.
  5646. </p>
  5647. <p>The default format strings are:
  5648. </p><dl class="table">
  5649. <dt><samp class="option">pre-encoding</samp></dt>
  5650. <dd><p>{fidx} {sidx} {n} {t}
  5651. </p></dd>
  5652. <dt><samp class="option">post-encoding</samp></dt>
  5653. <dd><p>{fidx} {sidx} {n} {t}
  5654. </p></dd>
  5655. </dl>
  5656. <p>In the future, new items may be added to the end of the default formatting
  5657. strings. Users who depend on the format staying exactly the same, should
  5658. prescribe it manually.
  5659. </p>
  5660. <p>Note that stats for different streams written into the same file may have
  5661. different formats.
  5662. </p>
  5663. </dd>
  5664. </dl>
  5665. </div>
  5666. <div class="section-level-extent" id="Preset-files">
  5667. <h3 class="section"><span>5.12 Preset files<a class="copiable-link" href="#Preset-files"> &para;</a></span></h3>
  5668. <p>A preset file contains a sequence of <var class="var">option</var>=<var class="var">value</var> pairs,
  5669. one for each line, specifying a sequence of options which would be
  5670. awkward to specify on the command line. Lines starting with the hash
  5671. (&rsquo;#&rsquo;) character are ignored and are used to provide comments. Check
  5672. the <samp class="file">presets</samp> directory in the FFmpeg source tree for examples.
  5673. </p>
  5674. <p>There are two types of preset files: ffpreset and avpreset files.
  5675. </p>
  5676. <ul class="mini-toc">
  5677. <li><a href="#ffpreset-files" accesskey="1">ffpreset files</a></li>
  5678. <li><a href="#avpreset-files" accesskey="2">avpreset files</a></li>
  5679. </ul>
  5680. <div class="subsection-level-extent" id="ffpreset-files">
  5681. <h4 class="subsection"><span>5.12.1 ffpreset files<a class="copiable-link" href="#ffpreset-files"> &para;</a></span></h4>
  5682. <p>ffpreset files are specified with the <code class="code">vpre</code>, <code class="code">apre</code>,
  5683. <code class="code">spre</code>, and <code class="code">fpre</code> options. The <code class="code">fpre</code> option takes the
  5684. filename of the preset instead of a preset name as input and can be
  5685. used for any kind of codec. For the <code class="code">vpre</code>, <code class="code">apre</code>, and
  5686. <code class="code">spre</code> options, the options specified in a preset file are
  5687. applied to the currently selected codec of the same type as the preset
  5688. option.
  5689. </p>
  5690. <p>The argument passed to the <code class="code">vpre</code>, <code class="code">apre</code>, and <code class="code">spre</code>
  5691. preset options identifies the preset file to use according to the
  5692. following rules:
  5693. </p>
  5694. <p>First ffmpeg searches for a file named <var class="var">arg</var>.ffpreset in the
  5695. directories <samp class="file">$FFMPEG_DATADIR</samp> (if set), and <samp class="file">$HOME/.ffmpeg</samp>, and in
  5696. the datadir defined at configuration time (usually <samp class="file">PREFIX/share/ffmpeg</samp>)
  5697. or in a <samp class="file">ffpresets</samp> folder along the executable on win32,
  5698. in that order. For example, if the argument is <code class="code">libvpx-1080p</code>, it will
  5699. search for the file <samp class="file">libvpx-1080p.ffpreset</samp>.
  5700. </p>
  5701. <p>If no such file is found, then ffmpeg will search for a file named
  5702. <var class="var">codec_name</var>-<var class="var">arg</var>.ffpreset in the above-mentioned
  5703. directories, where <var class="var">codec_name</var> is the name of the codec to which
  5704. the preset file options will be applied. For example, if you select
  5705. the video codec with <code class="code">-vcodec libvpx</code> and use <code class="code">-vpre 1080p</code>,
  5706. then it will search for the file <samp class="file">libvpx-1080p.ffpreset</samp>.
  5707. </p>
  5708. </div>
  5709. <div class="subsection-level-extent" id="avpreset-files">
  5710. <h4 class="subsection"><span>5.12.2 avpreset files<a class="copiable-link" href="#avpreset-files"> &para;</a></span></h4>
  5711. <p>avpreset files are specified with the <code class="code">pre</code> option. They work similar to
  5712. ffpreset files, but they only allow encoder- specific options. Therefore, an
  5713. <var class="var">option</var>=<var class="var">value</var> pair specifying an encoder cannot be used.
  5714. </p>
  5715. <p>When the <code class="code">pre</code> option is specified, ffmpeg will look for files with the
  5716. suffix .avpreset in the directories <samp class="file">$AVCONV_DATADIR</samp> (if set), and
  5717. <samp class="file">$HOME/.avconv</samp>, and in the datadir defined at configuration time (usually
  5718. <samp class="file">PREFIX/share/ffmpeg</samp>), in that order.
  5719. </p>
  5720. <p>First ffmpeg searches for a file named <var class="var">codec_name</var>-<var class="var">arg</var>.avpreset in
  5721. the above-mentioned directories, where <var class="var">codec_name</var> is the name of the codec
  5722. to which the preset file options will be applied. For example, if you select the
  5723. video codec with <code class="code">-vcodec libvpx</code> and use <code class="code">-pre 1080p</code>, then it will
  5724. search for the file <samp class="file">libvpx-1080p.avpreset</samp>.
  5725. </p>
  5726. <p>If no such file is found, then ffmpeg will search for a file named
  5727. <var class="var">arg</var>.avpreset in the same directories.
  5728. </p>
  5729. <a class="anchor" id="vstats_005ffile_005fformat"></a></div>
  5730. </div>
  5731. <div class="section-level-extent" id="vstats-file-format">
  5732. <h3 class="section"><span>5.13 vstats file format<a class="copiable-link" href="#vstats-file-format"> &para;</a></span></h3>
  5733. <p>The <code class="code">-vstats</code> and <code class="code">-vstats_file</code> options enable generation of a file
  5734. containing statistics about the generated video outputs.
  5735. </p>
  5736. <p>The <code class="code">-vstats_version</code> option controls the format version of the generated
  5737. file.
  5738. </p>
  5739. <p>With version <code class="code">1</code> the format is:
  5740. </p><div class="example">
  5741. <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
  5742. </pre></div>
  5743. <p>With version <code class="code">2</code> the format is:
  5744. </p><div class="example">
  5745. <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
  5746. </pre></div>
  5747. <p>The value corresponding to each key is described below:
  5748. </p><dl class="table">
  5749. <dt><samp class="option">avg_br</samp></dt>
  5750. <dd><p>average bitrate expressed in Kbits/s
  5751. </p>
  5752. </dd>
  5753. <dt><samp class="option">br</samp></dt>
  5754. <dd><p>bitrate expressed in Kbits/s
  5755. </p>
  5756. </dd>
  5757. <dt><samp class="option">frame</samp></dt>
  5758. <dd><p>number of encoded frame
  5759. </p>
  5760. </dd>
  5761. <dt><samp class="option">out</samp></dt>
  5762. <dd><p>out file index
  5763. </p>
  5764. </dd>
  5765. <dt><samp class="option">PSNR</samp></dt>
  5766. <dd><p>Peak Signal to Noise Ratio
  5767. </p>
  5768. </dd>
  5769. <dt><samp class="option">q</samp></dt>
  5770. <dd><p>quality of the frame
  5771. </p>
  5772. </dd>
  5773. <dt><samp class="option">f_size</samp></dt>
  5774. <dd><p>encoded packet size expressed as number of bytes
  5775. </p>
  5776. </dd>
  5777. <dt><samp class="option">s_size</samp></dt>
  5778. <dd><p>stream size expressed in KiB
  5779. </p>
  5780. </dd>
  5781. <dt><samp class="option">st</samp></dt>
  5782. <dd><p>out file stream index
  5783. </p>
  5784. </dd>
  5785. <dt><samp class="option">time</samp></dt>
  5786. <dd><p>time of the packet
  5787. </p>
  5788. </dd>
  5789. <dt><samp class="option">type</samp></dt>
  5790. <dd><p>picture type
  5791. </p></dd>
  5792. </dl>
  5793. <p>See also the <a class="ref" href="#stats_005fenc_005foptions">-stats_enc options</a> for an alternative way
  5794. to show encoding statistics.
  5795. </p>
  5796. </div>
  5797. </div>
  5798. <div class="chapter-level-extent" id="Examples-1">
  5799. <h2 class="chapter"><span>6 Examples<a class="copiable-link" href="#Examples-1"> &para;</a></span></h2>
  5800. <ul class="mini-toc">
  5801. <li><a href="#Video-and-Audio-grabbing" accesskey="1">Video and Audio grabbing</a></li>
  5802. <li><a href="#X11-grabbing" accesskey="2">X11 grabbing</a></li>
  5803. <li><a href="#Video-and-Audio-file-format-conversion" accesskey="3">Video and Audio file format conversion</a></li>
  5804. </ul>
  5805. <div class="section-level-extent" id="Video-and-Audio-grabbing">
  5806. <h3 class="section"><span>6.1 Video and Audio grabbing<a class="copiable-link" href="#Video-and-Audio-grabbing"> &para;</a></span></h3>
  5807. <p>If you specify the input format and device then ffmpeg can grab video
  5808. and audio directly.
  5809. </p>
  5810. <div class="example">
  5811. <pre class="example-preformatted">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  5812. </pre></div>
  5813. <p>Or with an ALSA audio source (mono input, card id 1) instead of OSS:
  5814. </p><div class="example">
  5815. <pre class="example-preformatted">ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
  5816. </pre></div>
  5817. <p>Note that you must activate the right video source and channel before
  5818. launching ffmpeg with any TV viewer such as
  5819. <a class="uref" href="http://linux.bytesex.org/xawtv/">xawtv</a> by Gerd Knorr. You also
  5820. have to set the audio recording levels correctly with a
  5821. standard mixer.
  5822. </p>
  5823. </div>
  5824. <div class="section-level-extent" id="X11-grabbing">
  5825. <h3 class="section"><span>6.2 X11 grabbing<a class="copiable-link" href="#X11-grabbing"> &para;</a></span></h3>
  5826. <p>Grab the X11 display with ffmpeg via
  5827. </p>
  5828. <div class="example">
  5829. <pre class="example-preformatted">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
  5830. </pre></div>
  5831. <p>0.0 is display.screen number of your X11 server, same as
  5832. the DISPLAY environment variable.
  5833. </p>
  5834. <div class="example">
  5835. <pre class="example-preformatted">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
  5836. </pre></div>
  5837. <p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
  5838. variable. 10 is the x-offset and 20 the y-offset for the grabbing.
  5839. </p>
  5840. </div>
  5841. <div class="section-level-extent" id="Video-and-Audio-file-format-conversion">
  5842. <h3 class="section"><span>6.3 Video and Audio file format conversion<a class="copiable-link" href="#Video-and-Audio-file-format-conversion"> &para;</a></span></h3>
  5843. <p>Any supported file format and protocol can serve as input to ffmpeg:
  5844. </p>
  5845. <p>Examples:
  5846. </p><ul class="itemize mark-bullet">
  5847. <li>You can use YUV files as input:
  5848. <div class="example">
  5849. <pre class="example-preformatted">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  5850. </pre></div>
  5851. <p>It will use the files:
  5852. </p><div class="example">
  5853. <pre class="example-preformatted">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  5854. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  5855. </pre></div>
  5856. <p>The Y files use twice the resolution of the U and V files. They are
  5857. raw files, without header. They can be generated by all decent video
  5858. decoders. You must specify the size of the image with the <samp class="option">-s</samp> option
  5859. if ffmpeg cannot guess it.
  5860. </p>
  5861. </li><li>You can input from a raw YUV420P file:
  5862. <div class="example">
  5863. <pre class="example-preformatted">ffmpeg -i /tmp/test.yuv /tmp/out.avi
  5864. </pre></div>
  5865. <p>test.yuv is a file containing raw YUV planar data. Each frame is composed
  5866. of the Y plane followed by the U and V planes at half vertical and
  5867. horizontal resolution.
  5868. </p>
  5869. </li><li>You can output to a raw YUV420P file:
  5870. <div class="example">
  5871. <pre class="example-preformatted">ffmpeg -i mydivx.avi hugefile.yuv
  5872. </pre></div>
  5873. </li><li>You can set several input files and output files:
  5874. <div class="example">
  5875. <pre class="example-preformatted">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  5876. </pre></div>
  5877. <p>Converts the audio file a.wav and the raw YUV video file a.yuv
  5878. to MPEG file a.mpg.
  5879. </p>
  5880. </li><li>You can also do audio and video conversions at the same time:
  5881. <div class="example">
  5882. <pre class="example-preformatted">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  5883. </pre></div>
  5884. <p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
  5885. </p>
  5886. </li><li>You can encode to several formats at the same time and define a
  5887. mapping from input stream to output streams:
  5888. <div class="example">
  5889. <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
  5890. </pre></div>
  5891. <p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. &rsquo;-map
  5892. file:index&rsquo; specifies which input stream is used for each output
  5893. stream, in the order of the definition of output streams.
  5894. </p>
  5895. </li><li>You can transcode decrypted VOBs:
  5896. <div class="example">
  5897. <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
  5898. </pre></div>
  5899. <p>This is a typical DVD ripping example; the input is a VOB file, the
  5900. output an AVI file with MPEG-4 video and MP3 audio. Note that in this
  5901. command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
  5902. GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
  5903. input video. Furthermore, the audio stream is MP3-encoded so you need
  5904. to enable LAME support by passing <code class="code">--enable-libmp3lame</code> to configure.
  5905. The mapping is particularly useful for DVD transcoding
  5906. to get the desired audio language.
  5907. </p>
  5908. <p>NOTE: To see the supported input formats, use <code class="code">ffmpeg -demuxers</code>.
  5909. </p>
  5910. </li><li>You can extract images from a video, or create a video from many images:
  5911. <p>For extracting images from a video:
  5912. </p><div class="example">
  5913. <pre class="example-preformatted">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
  5914. </pre></div>
  5915. <p>This will extract one video frame per second from the video and will
  5916. output them in files named <samp class="file">foo-001.jpeg</samp>, <samp class="file">foo-002.jpeg</samp>,
  5917. etc. Images will be rescaled to fit the new WxH values.
  5918. </p>
  5919. <p>If you want to extract just a limited number of frames, you can use the
  5920. above command in combination with the <code class="code">-frames:v</code> or <code class="code">-t</code> option,
  5921. or in combination with -ss to start extracting from a certain point in time.
  5922. </p>
  5923. <p>For creating a video from many images:
  5924. </p><div class="example">
  5925. <pre class="example-preformatted">ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
  5926. </pre></div>
  5927. <p>The syntax <code class="code">foo-%03d.jpeg</code> specifies to use a decimal number
  5928. composed of three digits padded with zeroes to express the sequence
  5929. number. It is the same syntax supported by the C printf function, but
  5930. only formats accepting a normal integer are suitable.
  5931. </p>
  5932. <p>When importing an image sequence, -i also supports expanding
  5933. shell-like wildcard patterns (globbing) internally, by selecting the
  5934. image2-specific <code class="code">-pattern_type glob</code> option.
  5935. </p>
  5936. <p>For example, for creating a video from filenames matching the glob pattern
  5937. <code class="code">foo-*.jpeg</code>:
  5938. </p><div class="example">
  5939. <pre class="example-preformatted">ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
  5940. </pre></div>
  5941. </li><li>You can put many streams of the same type in the output:
  5942. <div class="example">
  5943. <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
  5944. </pre></div>
  5945. <p>The resulting output file <samp class="file">test12.nut</samp> will contain the first four streams
  5946. from the input files in reverse order.
  5947. </p>
  5948. </li><li>To force CBR video output:
  5949. <div class="example">
  5950. <pre class="example-preformatted">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  5951. </pre></div>
  5952. </li><li>The four options lmin, lmax, mblmin and mblmax use &rsquo;lambda&rsquo; units,
  5953. but you may use the QP2LAMBDA constant to easily convert from &rsquo;q&rsquo; units:
  5954. <div class="example">
  5955. <pre class="example-preformatted">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  5956. </pre></div>
  5957. </li></ul>
  5958. </div>
  5959. </div>
  5960. <div class="chapter-level-extent" id="Syntax">
  5961. <h2 class="chapter"><span>7 Syntax<a class="copiable-link" href="#Syntax"> &para;</a></span></h2>
  5962. <p>This section documents the syntax and formats employed by the FFmpeg
  5963. libraries and tools.
  5964. </p>
  5965. <a class="anchor" id="quoting_005fand_005fescaping"></a><ul class="mini-toc">
  5966. <li><a href="#Quoting-and-escaping" accesskey="1">Quoting and escaping</a></li>
  5967. <li><a href="#Date" accesskey="2">Date</a></li>
  5968. <li><a href="#Time-duration" accesskey="3">Time duration</a></li>
  5969. <li><a href="#Video-size" accesskey="4">Video size</a></li>
  5970. <li><a href="#Video-rate" accesskey="5">Video rate</a></li>
  5971. <li><a href="#Ratio" accesskey="6">Ratio</a></li>
  5972. <li><a href="#Color" accesskey="7">Color</a></li>
  5973. <li><a href="#Channel-Layout" accesskey="8">Channel Layout</a></li>
  5974. </ul>
  5975. <div class="section-level-extent" id="Quoting-and-escaping">
  5976. <h3 class="section"><span>7.1 Quoting and escaping<a class="copiable-link" href="#Quoting-and-escaping"> &para;</a></span></h3>
  5977. <p>FFmpeg adopts the following quoting and escaping mechanism, unless
  5978. explicitly specified. The following rules are applied:
  5979. </p>
  5980. <ul class="itemize mark-bullet">
  5981. <li>&lsquo;<samp class="samp">'</samp>&rsquo; and &lsquo;<samp class="samp">\</samp>&rsquo; are special characters (respectively used for
  5982. quoting and escaping). In addition to them, there might be other
  5983. special characters depending on the specific syntax where the escaping
  5984. and quoting are employed.
  5985. </li><li>A special character is escaped by prefixing it with a &lsquo;<samp class="samp">\</samp>&rsquo;.
  5986. </li><li>All characters enclosed between &lsquo;<samp class="samp">''</samp>&rsquo; are included literally in the
  5987. parsed string. The quote character &lsquo;<samp class="samp">'</samp>&rsquo; itself cannot be quoted,
  5988. so you may need to close the quote and escape it.
  5989. </li><li>Leading and trailing whitespaces, unless escaped or quoted, are
  5990. removed from the parsed string.
  5991. </li></ul>
  5992. <p>Note that you may need to add a second level of escaping when using
  5993. the command line or a script, which depends on the syntax of the
  5994. adopted shell language.
  5995. </p>
  5996. <p>The function <code class="code">av_get_token</code> defined in
  5997. <samp class="file">libavutil/avstring.h</samp> can be used to parse a token quoted or
  5998. escaped according to the rules defined above.
  5999. </p>
  6000. <p>The tool <samp class="file">tools/ffescape</samp> in the FFmpeg source tree can be used
  6001. to automatically quote or escape a string in a script.
  6002. </p>
  6003. <ul class="mini-toc">
  6004. <li><a href="#Examples-2" accesskey="1">Examples</a></li>
  6005. </ul>
  6006. <div class="subsection-level-extent" id="Examples-2">
  6007. <h4 class="subsection"><span>7.1.1 Examples<a class="copiable-link" href="#Examples-2"> &para;</a></span></h4>
  6008. <ul class="itemize mark-bullet">
  6009. <li>Escape the string <code class="code">Crime d'Amour</code> containing the <code class="code">'</code> special
  6010. character:
  6011. <div class="example">
  6012. <pre class="example-preformatted">Crime d\'Amour
  6013. </pre></div>
  6014. </li><li>The string above contains a quote, so the <code class="code">'</code> needs to be escaped
  6015. when quoting it:
  6016. <div class="example">
  6017. <pre class="example-preformatted">'Crime d'\''Amour'
  6018. </pre></div>
  6019. </li><li>Include leading or trailing whitespaces using quoting:
  6020. <div class="example">
  6021. <pre class="example-preformatted">' this string starts and ends with whitespaces '
  6022. </pre></div>
  6023. </li><li>Escaping and quoting can be mixed together:
  6024. <div class="example">
  6025. <pre class="example-preformatted">' The string '\'string\'' is a string '
  6026. </pre></div>
  6027. </li><li>To include a literal &lsquo;<samp class="samp">\</samp>&rsquo; you can use either escaping or quoting:
  6028. <div class="example">
  6029. <pre class="example-preformatted">'c:\foo' can be written as c:\\foo
  6030. </pre></div>
  6031. </li></ul>
  6032. <a class="anchor" id="date-syntax"></a></div>
  6033. </div>
  6034. <div class="section-level-extent" id="Date">
  6035. <h3 class="section"><span>7.2 Date<a class="copiable-link" href="#Date"> &para;</a></span></h3>
  6036. <p>The accepted syntax is:
  6037. </p><div class="example">
  6038. <pre class="example-preformatted">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
  6039. now
  6040. </pre></div>
  6041. <p>If the value is &quot;now&quot; it takes the current time.
  6042. </p>
  6043. <p>Time is local time unless Z is appended, in which case it is
  6044. interpreted as UTC.
  6045. If the year-month-day part is not specified it takes the current
  6046. year-month-day.
  6047. </p>
  6048. <a class="anchor" id="time-duration-syntax"></a></div>
  6049. <div class="section-level-extent" id="Time-duration">
  6050. <h3 class="section"><span>7.3 Time duration<a class="copiable-link" href="#Time-duration"> &para;</a></span></h3>
  6051. <p>There are two accepted syntaxes for expressing time duration.
  6052. </p>
  6053. <div class="example">
  6054. <pre class="example-preformatted">[-][<var class="var">HH</var>:]<var class="var">MM</var>:<var class="var">SS</var>[.<var class="var">m</var>...]
  6055. </pre></div>
  6056. <p><var class="var">HH</var> expresses the number of hours, <var class="var">MM</var> the number of minutes
  6057. for a maximum of 2 digits, and <var class="var">SS</var> the number of seconds for a
  6058. maximum of 2 digits. The <var class="var">m</var> at the end expresses decimal value for
  6059. <var class="var">SS</var>.
  6060. </p>
  6061. <p><em class="emph">or</em>
  6062. </p>
  6063. <div class="example">
  6064. <pre class="example-preformatted">[-]<var class="var">S</var>+[.<var class="var">m</var>...][s|ms|us]
  6065. </pre></div>
  6066. <p><var class="var">S</var> expresses the number of seconds, with the optional decimal part
  6067. <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;
  6068. indicate to interpret the value as seconds, milliseconds or microseconds,
  6069. respectively.
  6070. </p>
  6071. <p>In both expressions, the optional &lsquo;<samp class="samp">-</samp>&rsquo; indicates negative duration.
  6072. </p>
  6073. <ul class="mini-toc">
  6074. <li><a href="#Examples-3" accesskey="1">Examples</a></li>
  6075. </ul>
  6076. <div class="subsection-level-extent" id="Examples-3">
  6077. <h4 class="subsection"><span>7.3.1 Examples<a class="copiable-link" href="#Examples-3"> &para;</a></span></h4>
  6078. <p>The following examples are all valid time duration:
  6079. </p>
  6080. <dl class="table">
  6081. <dt>&lsquo;<samp class="samp">55</samp>&rsquo;</dt>
  6082. <dd><p>55 seconds
  6083. </p>
  6084. </dd>
  6085. <dt>&lsquo;<samp class="samp">0.2</samp>&rsquo;</dt>
  6086. <dd><p>0.2 seconds
  6087. </p>
  6088. </dd>
  6089. <dt>&lsquo;<samp class="samp">200ms</samp>&rsquo;</dt>
  6090. <dd><p>200 milliseconds, that&rsquo;s 0.2s
  6091. </p>
  6092. </dd>
  6093. <dt>&lsquo;<samp class="samp">200000us</samp>&rsquo;</dt>
  6094. <dd><p>200000 microseconds, that&rsquo;s 0.2s
  6095. </p>
  6096. </dd>
  6097. <dt>&lsquo;<samp class="samp">12:03:45</samp>&rsquo;</dt>
  6098. <dd><p>12 hours, 03 minutes and 45 seconds
  6099. </p>
  6100. </dd>
  6101. <dt>&lsquo;<samp class="samp">23.189</samp>&rsquo;</dt>
  6102. <dd><p>23.189 seconds
  6103. </p></dd>
  6104. </dl>
  6105. <a class="anchor" id="video-size-syntax"></a></div>
  6106. </div>
  6107. <div class="section-level-extent" id="Video-size">
  6108. <h3 class="section"><span>7.4 Video size<a class="copiable-link" href="#Video-size"> &para;</a></span></h3>
  6109. <p>Specify the size of the sourced video, it may be a string of the form
  6110. <var class="var">width</var>x<var class="var">height</var>, or the name of a size abbreviation.
  6111. </p>
  6112. <p>The following abbreviations are recognized:
  6113. </p><dl class="table">
  6114. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  6115. <dd><p>720x480
  6116. </p></dd>
  6117. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  6118. <dd><p>720x576
  6119. </p></dd>
  6120. <dt>&lsquo;<samp class="samp">qntsc</samp>&rsquo;</dt>
  6121. <dd><p>352x240
  6122. </p></dd>
  6123. <dt>&lsquo;<samp class="samp">qpal</samp>&rsquo;</dt>
  6124. <dd><p>352x288
  6125. </p></dd>
  6126. <dt>&lsquo;<samp class="samp">sntsc</samp>&rsquo;</dt>
  6127. <dd><p>640x480
  6128. </p></dd>
  6129. <dt>&lsquo;<samp class="samp">spal</samp>&rsquo;</dt>
  6130. <dd><p>768x576
  6131. </p></dd>
  6132. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  6133. <dd><p>352x240
  6134. </p></dd>
  6135. <dt>&lsquo;<samp class="samp">ntsc-film</samp>&rsquo;</dt>
  6136. <dd><p>352x240
  6137. </p></dd>
  6138. <dt>&lsquo;<samp class="samp">sqcif</samp>&rsquo;</dt>
  6139. <dd><p>128x96
  6140. </p></dd>
  6141. <dt>&lsquo;<samp class="samp">qcif</samp>&rsquo;</dt>
  6142. <dd><p>176x144
  6143. </p></dd>
  6144. <dt>&lsquo;<samp class="samp">cif</samp>&rsquo;</dt>
  6145. <dd><p>352x288
  6146. </p></dd>
  6147. <dt>&lsquo;<samp class="samp">4cif</samp>&rsquo;</dt>
  6148. <dd><p>704x576
  6149. </p></dd>
  6150. <dt>&lsquo;<samp class="samp">16cif</samp>&rsquo;</dt>
  6151. <dd><p>1408x1152
  6152. </p></dd>
  6153. <dt>&lsquo;<samp class="samp">qqvga</samp>&rsquo;</dt>
  6154. <dd><p>160x120
  6155. </p></dd>
  6156. <dt>&lsquo;<samp class="samp">qvga</samp>&rsquo;</dt>
  6157. <dd><p>320x240
  6158. </p></dd>
  6159. <dt>&lsquo;<samp class="samp">vga</samp>&rsquo;</dt>
  6160. <dd><p>640x480
  6161. </p></dd>
  6162. <dt>&lsquo;<samp class="samp">svga</samp>&rsquo;</dt>
  6163. <dd><p>800x600
  6164. </p></dd>
  6165. <dt>&lsquo;<samp class="samp">xga</samp>&rsquo;</dt>
  6166. <dd><p>1024x768
  6167. </p></dd>
  6168. <dt>&lsquo;<samp class="samp">uxga</samp>&rsquo;</dt>
  6169. <dd><p>1600x1200
  6170. </p></dd>
  6171. <dt>&lsquo;<samp class="samp">qxga</samp>&rsquo;</dt>
  6172. <dd><p>2048x1536
  6173. </p></dd>
  6174. <dt>&lsquo;<samp class="samp">sxga</samp>&rsquo;</dt>
  6175. <dd><p>1280x1024
  6176. </p></dd>
  6177. <dt>&lsquo;<samp class="samp">qsxga</samp>&rsquo;</dt>
  6178. <dd><p>2560x2048
  6179. </p></dd>
  6180. <dt>&lsquo;<samp class="samp">hsxga</samp>&rsquo;</dt>
  6181. <dd><p>5120x4096
  6182. </p></dd>
  6183. <dt>&lsquo;<samp class="samp">wvga</samp>&rsquo;</dt>
  6184. <dd><p>852x480
  6185. </p></dd>
  6186. <dt>&lsquo;<samp class="samp">wxga</samp>&rsquo;</dt>
  6187. <dd><p>1366x768
  6188. </p></dd>
  6189. <dt>&lsquo;<samp class="samp">wsxga</samp>&rsquo;</dt>
  6190. <dd><p>1600x1024
  6191. </p></dd>
  6192. <dt>&lsquo;<samp class="samp">wuxga</samp>&rsquo;</dt>
  6193. <dd><p>1920x1200
  6194. </p></dd>
  6195. <dt>&lsquo;<samp class="samp">woxga</samp>&rsquo;</dt>
  6196. <dd><p>2560x1600
  6197. </p></dd>
  6198. <dt>&lsquo;<samp class="samp">wqsxga</samp>&rsquo;</dt>
  6199. <dd><p>3200x2048
  6200. </p></dd>
  6201. <dt>&lsquo;<samp class="samp">wquxga</samp>&rsquo;</dt>
  6202. <dd><p>3840x2400
  6203. </p></dd>
  6204. <dt>&lsquo;<samp class="samp">whsxga</samp>&rsquo;</dt>
  6205. <dd><p>6400x4096
  6206. </p></dd>
  6207. <dt>&lsquo;<samp class="samp">whuxga</samp>&rsquo;</dt>
  6208. <dd><p>7680x4800
  6209. </p></dd>
  6210. <dt>&lsquo;<samp class="samp">cga</samp>&rsquo;</dt>
  6211. <dd><p>320x200
  6212. </p></dd>
  6213. <dt>&lsquo;<samp class="samp">ega</samp>&rsquo;</dt>
  6214. <dd><p>640x350
  6215. </p></dd>
  6216. <dt>&lsquo;<samp class="samp">hd480</samp>&rsquo;</dt>
  6217. <dd><p>852x480
  6218. </p></dd>
  6219. <dt>&lsquo;<samp class="samp">hd720</samp>&rsquo;</dt>
  6220. <dd><p>1280x720
  6221. </p></dd>
  6222. <dt>&lsquo;<samp class="samp">hd1080</samp>&rsquo;</dt>
  6223. <dd><p>1920x1080
  6224. </p></dd>
  6225. <dt>&lsquo;<samp class="samp">2k</samp>&rsquo;</dt>
  6226. <dd><p>2048x1080
  6227. </p></dd>
  6228. <dt>&lsquo;<samp class="samp">2kflat</samp>&rsquo;</dt>
  6229. <dd><p>1998x1080
  6230. </p></dd>
  6231. <dt>&lsquo;<samp class="samp">2kscope</samp>&rsquo;</dt>
  6232. <dd><p>2048x858
  6233. </p></dd>
  6234. <dt>&lsquo;<samp class="samp">4k</samp>&rsquo;</dt>
  6235. <dd><p>4096x2160
  6236. </p></dd>
  6237. <dt>&lsquo;<samp class="samp">4kflat</samp>&rsquo;</dt>
  6238. <dd><p>3996x2160
  6239. </p></dd>
  6240. <dt>&lsquo;<samp class="samp">4kscope</samp>&rsquo;</dt>
  6241. <dd><p>4096x1716
  6242. </p></dd>
  6243. <dt>&lsquo;<samp class="samp">nhd</samp>&rsquo;</dt>
  6244. <dd><p>640x360
  6245. </p></dd>
  6246. <dt>&lsquo;<samp class="samp">hqvga</samp>&rsquo;</dt>
  6247. <dd><p>240x160
  6248. </p></dd>
  6249. <dt>&lsquo;<samp class="samp">wqvga</samp>&rsquo;</dt>
  6250. <dd><p>400x240
  6251. </p></dd>
  6252. <dt>&lsquo;<samp class="samp">fwqvga</samp>&rsquo;</dt>
  6253. <dd><p>432x240
  6254. </p></dd>
  6255. <dt>&lsquo;<samp class="samp">hvga</samp>&rsquo;</dt>
  6256. <dd><p>480x320
  6257. </p></dd>
  6258. <dt>&lsquo;<samp class="samp">qhd</samp>&rsquo;</dt>
  6259. <dd><p>960x540
  6260. </p></dd>
  6261. <dt>&lsquo;<samp class="samp">2kdci</samp>&rsquo;</dt>
  6262. <dd><p>2048x1080
  6263. </p></dd>
  6264. <dt>&lsquo;<samp class="samp">4kdci</samp>&rsquo;</dt>
  6265. <dd><p>4096x2160
  6266. </p></dd>
  6267. <dt>&lsquo;<samp class="samp">uhd2160</samp>&rsquo;</dt>
  6268. <dd><p>3840x2160
  6269. </p></dd>
  6270. <dt>&lsquo;<samp class="samp">uhd4320</samp>&rsquo;</dt>
  6271. <dd><p>7680x4320
  6272. </p></dd>
  6273. </dl>
  6274. <a class="anchor" id="video-rate-syntax"></a></div>
  6275. <div class="section-level-extent" id="Video-rate">
  6276. <h3 class="section"><span>7.5 Video rate<a class="copiable-link" href="#Video-rate"> &para;</a></span></h3>
  6277. <p>Specify the frame rate of a video, expressed as the number of frames
  6278. generated per second. It has to be a string in the format
  6279. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a float
  6280. number or a valid video frame rate abbreviation.
  6281. </p>
  6282. <p>The following abbreviations are recognized:
  6283. </p><dl class="table">
  6284. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  6285. <dd><p>30000/1001
  6286. </p></dd>
  6287. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  6288. <dd><p>25/1
  6289. </p></dd>
  6290. <dt>&lsquo;<samp class="samp">qntsc</samp>&rsquo;</dt>
  6291. <dd><p>30000/1001
  6292. </p></dd>
  6293. <dt>&lsquo;<samp class="samp">qpal</samp>&rsquo;</dt>
  6294. <dd><p>25/1
  6295. </p></dd>
  6296. <dt>&lsquo;<samp class="samp">sntsc</samp>&rsquo;</dt>
  6297. <dd><p>30000/1001
  6298. </p></dd>
  6299. <dt>&lsquo;<samp class="samp">spal</samp>&rsquo;</dt>
  6300. <dd><p>25/1
  6301. </p></dd>
  6302. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  6303. <dd><p>24/1
  6304. </p></dd>
  6305. <dt>&lsquo;<samp class="samp">ntsc-film</samp>&rsquo;</dt>
  6306. <dd><p>24000/1001
  6307. </p></dd>
  6308. </dl>
  6309. <a class="anchor" id="ratio-syntax"></a></div>
  6310. <div class="section-level-extent" id="Ratio">
  6311. <h3 class="section"><span>7.6 Ratio<a class="copiable-link" href="#Ratio"> &para;</a></span></h3>
  6312. <p>A ratio can be expressed as an expression, or in the form
  6313. <var class="var">numerator</var>:<var class="var">denominator</var>.
  6314. </p>
  6315. <p>Note that a ratio with infinite (1/0) or negative value is
  6316. considered valid, so you should check on the returned value if you
  6317. want to exclude those values.
  6318. </p>
  6319. <p>The undefined value can be expressed using the &quot;0:0&quot; string.
  6320. </p>
  6321. <a class="anchor" id="color-syntax"></a></div>
  6322. <div class="section-level-extent" id="Color">
  6323. <h3 class="section"><span>7.7 Color<a class="copiable-link" href="#Color"> &para;</a></span></h3>
  6324. <p>It can be the name of a color as defined below (case insensitive match) or a
  6325. <code class="code">[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
  6326. representing the alpha component.
  6327. </p>
  6328. <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
  6329. hexadecimal number or a decimal number between 0.0 and 1.0, which
  6330. represents the opacity value (&lsquo;<samp class="samp">0x00</samp>&rsquo; or &lsquo;<samp class="samp">0.0</samp>&rsquo; means completely
  6331. transparent, &lsquo;<samp class="samp">0xff</samp>&rsquo; or &lsquo;<samp class="samp">1.0</samp>&rsquo; completely opaque). If the alpha
  6332. component is not specified then &lsquo;<samp class="samp">0xff</samp>&rsquo; is assumed.
  6333. </p>
  6334. <p>The string &lsquo;<samp class="samp">random</samp>&rsquo; will result in a random color.
  6335. </p>
  6336. <p>The following names of colors are recognized:
  6337. </p><dl class="table">
  6338. <dt>&lsquo;<samp class="samp">AliceBlue</samp>&rsquo;</dt>
  6339. <dd><p>0xF0F8FF
  6340. </p></dd>
  6341. <dt>&lsquo;<samp class="samp">AntiqueWhite</samp>&rsquo;</dt>
  6342. <dd><p>0xFAEBD7
  6343. </p></dd>
  6344. <dt>&lsquo;<samp class="samp">Aqua</samp>&rsquo;</dt>
  6345. <dd><p>0x00FFFF
  6346. </p></dd>
  6347. <dt>&lsquo;<samp class="samp">Aquamarine</samp>&rsquo;</dt>
  6348. <dd><p>0x7FFFD4
  6349. </p></dd>
  6350. <dt>&lsquo;<samp class="samp">Azure</samp>&rsquo;</dt>
  6351. <dd><p>0xF0FFFF
  6352. </p></dd>
  6353. <dt>&lsquo;<samp class="samp">Beige</samp>&rsquo;</dt>
  6354. <dd><p>0xF5F5DC
  6355. </p></dd>
  6356. <dt>&lsquo;<samp class="samp">Bisque</samp>&rsquo;</dt>
  6357. <dd><p>0xFFE4C4
  6358. </p></dd>
  6359. <dt>&lsquo;<samp class="samp">Black</samp>&rsquo;</dt>
  6360. <dd><p>0x000000
  6361. </p></dd>
  6362. <dt>&lsquo;<samp class="samp">BlanchedAlmond</samp>&rsquo;</dt>
  6363. <dd><p>0xFFEBCD
  6364. </p></dd>
  6365. <dt>&lsquo;<samp class="samp">Blue</samp>&rsquo;</dt>
  6366. <dd><p>0x0000FF
  6367. </p></dd>
  6368. <dt>&lsquo;<samp class="samp">BlueViolet</samp>&rsquo;</dt>
  6369. <dd><p>0x8A2BE2
  6370. </p></dd>
  6371. <dt>&lsquo;<samp class="samp">Brown</samp>&rsquo;</dt>
  6372. <dd><p>0xA52A2A
  6373. </p></dd>
  6374. <dt>&lsquo;<samp class="samp">BurlyWood</samp>&rsquo;</dt>
  6375. <dd><p>0xDEB887
  6376. </p></dd>
  6377. <dt>&lsquo;<samp class="samp">CadetBlue</samp>&rsquo;</dt>
  6378. <dd><p>0x5F9EA0
  6379. </p></dd>
  6380. <dt>&lsquo;<samp class="samp">Chartreuse</samp>&rsquo;</dt>
  6381. <dd><p>0x7FFF00
  6382. </p></dd>
  6383. <dt>&lsquo;<samp class="samp">Chocolate</samp>&rsquo;</dt>
  6384. <dd><p>0xD2691E
  6385. </p></dd>
  6386. <dt>&lsquo;<samp class="samp">Coral</samp>&rsquo;</dt>
  6387. <dd><p>0xFF7F50
  6388. </p></dd>
  6389. <dt>&lsquo;<samp class="samp">CornflowerBlue</samp>&rsquo;</dt>
  6390. <dd><p>0x6495ED
  6391. </p></dd>
  6392. <dt>&lsquo;<samp class="samp">Cornsilk</samp>&rsquo;</dt>
  6393. <dd><p>0xFFF8DC
  6394. </p></dd>
  6395. <dt>&lsquo;<samp class="samp">Crimson</samp>&rsquo;</dt>
  6396. <dd><p>0xDC143C
  6397. </p></dd>
  6398. <dt>&lsquo;<samp class="samp">Cyan</samp>&rsquo;</dt>
  6399. <dd><p>0x00FFFF
  6400. </p></dd>
  6401. <dt>&lsquo;<samp class="samp">DarkBlue</samp>&rsquo;</dt>
  6402. <dd><p>0x00008B
  6403. </p></dd>
  6404. <dt>&lsquo;<samp class="samp">DarkCyan</samp>&rsquo;</dt>
  6405. <dd><p>0x008B8B
  6406. </p></dd>
  6407. <dt>&lsquo;<samp class="samp">DarkGoldenRod</samp>&rsquo;</dt>
  6408. <dd><p>0xB8860B
  6409. </p></dd>
  6410. <dt>&lsquo;<samp class="samp">DarkGray</samp>&rsquo;</dt>
  6411. <dd><p>0xA9A9A9
  6412. </p></dd>
  6413. <dt>&lsquo;<samp class="samp">DarkGreen</samp>&rsquo;</dt>
  6414. <dd><p>0x006400
  6415. </p></dd>
  6416. <dt>&lsquo;<samp class="samp">DarkKhaki</samp>&rsquo;</dt>
  6417. <dd><p>0xBDB76B
  6418. </p></dd>
  6419. <dt>&lsquo;<samp class="samp">DarkMagenta</samp>&rsquo;</dt>
  6420. <dd><p>0x8B008B
  6421. </p></dd>
  6422. <dt>&lsquo;<samp class="samp">DarkOliveGreen</samp>&rsquo;</dt>
  6423. <dd><p>0x556B2F
  6424. </p></dd>
  6425. <dt>&lsquo;<samp class="samp">Darkorange</samp>&rsquo;</dt>
  6426. <dd><p>0xFF8C00
  6427. </p></dd>
  6428. <dt>&lsquo;<samp class="samp">DarkOrchid</samp>&rsquo;</dt>
  6429. <dd><p>0x9932CC
  6430. </p></dd>
  6431. <dt>&lsquo;<samp class="samp">DarkRed</samp>&rsquo;</dt>
  6432. <dd><p>0x8B0000
  6433. </p></dd>
  6434. <dt>&lsquo;<samp class="samp">DarkSalmon</samp>&rsquo;</dt>
  6435. <dd><p>0xE9967A
  6436. </p></dd>
  6437. <dt>&lsquo;<samp class="samp">DarkSeaGreen</samp>&rsquo;</dt>
  6438. <dd><p>0x8FBC8F
  6439. </p></dd>
  6440. <dt>&lsquo;<samp class="samp">DarkSlateBlue</samp>&rsquo;</dt>
  6441. <dd><p>0x483D8B
  6442. </p></dd>
  6443. <dt>&lsquo;<samp class="samp">DarkSlateGray</samp>&rsquo;</dt>
  6444. <dd><p>0x2F4F4F
  6445. </p></dd>
  6446. <dt>&lsquo;<samp class="samp">DarkTurquoise</samp>&rsquo;</dt>
  6447. <dd><p>0x00CED1
  6448. </p></dd>
  6449. <dt>&lsquo;<samp class="samp">DarkViolet</samp>&rsquo;</dt>
  6450. <dd><p>0x9400D3
  6451. </p></dd>
  6452. <dt>&lsquo;<samp class="samp">DeepPink</samp>&rsquo;</dt>
  6453. <dd><p>0xFF1493
  6454. </p></dd>
  6455. <dt>&lsquo;<samp class="samp">DeepSkyBlue</samp>&rsquo;</dt>
  6456. <dd><p>0x00BFFF
  6457. </p></dd>
  6458. <dt>&lsquo;<samp class="samp">DimGray</samp>&rsquo;</dt>
  6459. <dd><p>0x696969
  6460. </p></dd>
  6461. <dt>&lsquo;<samp class="samp">DodgerBlue</samp>&rsquo;</dt>
  6462. <dd><p>0x1E90FF
  6463. </p></dd>
  6464. <dt>&lsquo;<samp class="samp">FireBrick</samp>&rsquo;</dt>
  6465. <dd><p>0xB22222
  6466. </p></dd>
  6467. <dt>&lsquo;<samp class="samp">FloralWhite</samp>&rsquo;</dt>
  6468. <dd><p>0xFFFAF0
  6469. </p></dd>
  6470. <dt>&lsquo;<samp class="samp">ForestGreen</samp>&rsquo;</dt>
  6471. <dd><p>0x228B22
  6472. </p></dd>
  6473. <dt>&lsquo;<samp class="samp">Fuchsia</samp>&rsquo;</dt>
  6474. <dd><p>0xFF00FF
  6475. </p></dd>
  6476. <dt>&lsquo;<samp class="samp">Gainsboro</samp>&rsquo;</dt>
  6477. <dd><p>0xDCDCDC
  6478. </p></dd>
  6479. <dt>&lsquo;<samp class="samp">GhostWhite</samp>&rsquo;</dt>
  6480. <dd><p>0xF8F8FF
  6481. </p></dd>
  6482. <dt>&lsquo;<samp class="samp">Gold</samp>&rsquo;</dt>
  6483. <dd><p>0xFFD700
  6484. </p></dd>
  6485. <dt>&lsquo;<samp class="samp">GoldenRod</samp>&rsquo;</dt>
  6486. <dd><p>0xDAA520
  6487. </p></dd>
  6488. <dt>&lsquo;<samp class="samp">Gray</samp>&rsquo;</dt>
  6489. <dd><p>0x808080
  6490. </p></dd>
  6491. <dt>&lsquo;<samp class="samp">Green</samp>&rsquo;</dt>
  6492. <dd><p>0x008000
  6493. </p></dd>
  6494. <dt>&lsquo;<samp class="samp">GreenYellow</samp>&rsquo;</dt>
  6495. <dd><p>0xADFF2F
  6496. </p></dd>
  6497. <dt>&lsquo;<samp class="samp">HoneyDew</samp>&rsquo;</dt>
  6498. <dd><p>0xF0FFF0
  6499. </p></dd>
  6500. <dt>&lsquo;<samp class="samp">HotPink</samp>&rsquo;</dt>
  6501. <dd><p>0xFF69B4
  6502. </p></dd>
  6503. <dt>&lsquo;<samp class="samp">IndianRed</samp>&rsquo;</dt>
  6504. <dd><p>0xCD5C5C
  6505. </p></dd>
  6506. <dt>&lsquo;<samp class="samp">Indigo</samp>&rsquo;</dt>
  6507. <dd><p>0x4B0082
  6508. </p></dd>
  6509. <dt>&lsquo;<samp class="samp">Ivory</samp>&rsquo;</dt>
  6510. <dd><p>0xFFFFF0
  6511. </p></dd>
  6512. <dt>&lsquo;<samp class="samp">Khaki</samp>&rsquo;</dt>
  6513. <dd><p>0xF0E68C
  6514. </p></dd>
  6515. <dt>&lsquo;<samp class="samp">Lavender</samp>&rsquo;</dt>
  6516. <dd><p>0xE6E6FA
  6517. </p></dd>
  6518. <dt>&lsquo;<samp class="samp">LavenderBlush</samp>&rsquo;</dt>
  6519. <dd><p>0xFFF0F5
  6520. </p></dd>
  6521. <dt>&lsquo;<samp class="samp">LawnGreen</samp>&rsquo;</dt>
  6522. <dd><p>0x7CFC00
  6523. </p></dd>
  6524. <dt>&lsquo;<samp class="samp">LemonChiffon</samp>&rsquo;</dt>
  6525. <dd><p>0xFFFACD
  6526. </p></dd>
  6527. <dt>&lsquo;<samp class="samp">LightBlue</samp>&rsquo;</dt>
  6528. <dd><p>0xADD8E6
  6529. </p></dd>
  6530. <dt>&lsquo;<samp class="samp">LightCoral</samp>&rsquo;</dt>
  6531. <dd><p>0xF08080
  6532. </p></dd>
  6533. <dt>&lsquo;<samp class="samp">LightCyan</samp>&rsquo;</dt>
  6534. <dd><p>0xE0FFFF
  6535. </p></dd>
  6536. <dt>&lsquo;<samp class="samp">LightGoldenRodYellow</samp>&rsquo;</dt>
  6537. <dd><p>0xFAFAD2
  6538. </p></dd>
  6539. <dt>&lsquo;<samp class="samp">LightGreen</samp>&rsquo;</dt>
  6540. <dd><p>0x90EE90
  6541. </p></dd>
  6542. <dt>&lsquo;<samp class="samp">LightGrey</samp>&rsquo;</dt>
  6543. <dd><p>0xD3D3D3
  6544. </p></dd>
  6545. <dt>&lsquo;<samp class="samp">LightPink</samp>&rsquo;</dt>
  6546. <dd><p>0xFFB6C1
  6547. </p></dd>
  6548. <dt>&lsquo;<samp class="samp">LightSalmon</samp>&rsquo;</dt>
  6549. <dd><p>0xFFA07A
  6550. </p></dd>
  6551. <dt>&lsquo;<samp class="samp">LightSeaGreen</samp>&rsquo;</dt>
  6552. <dd><p>0x20B2AA
  6553. </p></dd>
  6554. <dt>&lsquo;<samp class="samp">LightSkyBlue</samp>&rsquo;</dt>
  6555. <dd><p>0x87CEFA
  6556. </p></dd>
  6557. <dt>&lsquo;<samp class="samp">LightSlateGray</samp>&rsquo;</dt>
  6558. <dd><p>0x778899
  6559. </p></dd>
  6560. <dt>&lsquo;<samp class="samp">LightSteelBlue</samp>&rsquo;</dt>
  6561. <dd><p>0xB0C4DE
  6562. </p></dd>
  6563. <dt>&lsquo;<samp class="samp">LightYellow</samp>&rsquo;</dt>
  6564. <dd><p>0xFFFFE0
  6565. </p></dd>
  6566. <dt>&lsquo;<samp class="samp">Lime</samp>&rsquo;</dt>
  6567. <dd><p>0x00FF00
  6568. </p></dd>
  6569. <dt>&lsquo;<samp class="samp">LimeGreen</samp>&rsquo;</dt>
  6570. <dd><p>0x32CD32
  6571. </p></dd>
  6572. <dt>&lsquo;<samp class="samp">Linen</samp>&rsquo;</dt>
  6573. <dd><p>0xFAF0E6
  6574. </p></dd>
  6575. <dt>&lsquo;<samp class="samp">Magenta</samp>&rsquo;</dt>
  6576. <dd><p>0xFF00FF
  6577. </p></dd>
  6578. <dt>&lsquo;<samp class="samp">Maroon</samp>&rsquo;</dt>
  6579. <dd><p>0x800000
  6580. </p></dd>
  6581. <dt>&lsquo;<samp class="samp">MediumAquaMarine</samp>&rsquo;</dt>
  6582. <dd><p>0x66CDAA
  6583. </p></dd>
  6584. <dt>&lsquo;<samp class="samp">MediumBlue</samp>&rsquo;</dt>
  6585. <dd><p>0x0000CD
  6586. </p></dd>
  6587. <dt>&lsquo;<samp class="samp">MediumOrchid</samp>&rsquo;</dt>
  6588. <dd><p>0xBA55D3
  6589. </p></dd>
  6590. <dt>&lsquo;<samp class="samp">MediumPurple</samp>&rsquo;</dt>
  6591. <dd><p>0x9370D8
  6592. </p></dd>
  6593. <dt>&lsquo;<samp class="samp">MediumSeaGreen</samp>&rsquo;</dt>
  6594. <dd><p>0x3CB371
  6595. </p></dd>
  6596. <dt>&lsquo;<samp class="samp">MediumSlateBlue</samp>&rsquo;</dt>
  6597. <dd><p>0x7B68EE
  6598. </p></dd>
  6599. <dt>&lsquo;<samp class="samp">MediumSpringGreen</samp>&rsquo;</dt>
  6600. <dd><p>0x00FA9A
  6601. </p></dd>
  6602. <dt>&lsquo;<samp class="samp">MediumTurquoise</samp>&rsquo;</dt>
  6603. <dd><p>0x48D1CC
  6604. </p></dd>
  6605. <dt>&lsquo;<samp class="samp">MediumVioletRed</samp>&rsquo;</dt>
  6606. <dd><p>0xC71585
  6607. </p></dd>
  6608. <dt>&lsquo;<samp class="samp">MidnightBlue</samp>&rsquo;</dt>
  6609. <dd><p>0x191970
  6610. </p></dd>
  6611. <dt>&lsquo;<samp class="samp">MintCream</samp>&rsquo;</dt>
  6612. <dd><p>0xF5FFFA
  6613. </p></dd>
  6614. <dt>&lsquo;<samp class="samp">MistyRose</samp>&rsquo;</dt>
  6615. <dd><p>0xFFE4E1
  6616. </p></dd>
  6617. <dt>&lsquo;<samp class="samp">Moccasin</samp>&rsquo;</dt>
  6618. <dd><p>0xFFE4B5
  6619. </p></dd>
  6620. <dt>&lsquo;<samp class="samp">NavajoWhite</samp>&rsquo;</dt>
  6621. <dd><p>0xFFDEAD
  6622. </p></dd>
  6623. <dt>&lsquo;<samp class="samp">Navy</samp>&rsquo;</dt>
  6624. <dd><p>0x000080
  6625. </p></dd>
  6626. <dt>&lsquo;<samp class="samp">OldLace</samp>&rsquo;</dt>
  6627. <dd><p>0xFDF5E6
  6628. </p></dd>
  6629. <dt>&lsquo;<samp class="samp">Olive</samp>&rsquo;</dt>
  6630. <dd><p>0x808000
  6631. </p></dd>
  6632. <dt>&lsquo;<samp class="samp">OliveDrab</samp>&rsquo;</dt>
  6633. <dd><p>0x6B8E23
  6634. </p></dd>
  6635. <dt>&lsquo;<samp class="samp">Orange</samp>&rsquo;</dt>
  6636. <dd><p>0xFFA500
  6637. </p></dd>
  6638. <dt>&lsquo;<samp class="samp">OrangeRed</samp>&rsquo;</dt>
  6639. <dd><p>0xFF4500
  6640. </p></dd>
  6641. <dt>&lsquo;<samp class="samp">Orchid</samp>&rsquo;</dt>
  6642. <dd><p>0xDA70D6
  6643. </p></dd>
  6644. <dt>&lsquo;<samp class="samp">PaleGoldenRod</samp>&rsquo;</dt>
  6645. <dd><p>0xEEE8AA
  6646. </p></dd>
  6647. <dt>&lsquo;<samp class="samp">PaleGreen</samp>&rsquo;</dt>
  6648. <dd><p>0x98FB98
  6649. </p></dd>
  6650. <dt>&lsquo;<samp class="samp">PaleTurquoise</samp>&rsquo;</dt>
  6651. <dd><p>0xAFEEEE
  6652. </p></dd>
  6653. <dt>&lsquo;<samp class="samp">PaleVioletRed</samp>&rsquo;</dt>
  6654. <dd><p>0xD87093
  6655. </p></dd>
  6656. <dt>&lsquo;<samp class="samp">PapayaWhip</samp>&rsquo;</dt>
  6657. <dd><p>0xFFEFD5
  6658. </p></dd>
  6659. <dt>&lsquo;<samp class="samp">PeachPuff</samp>&rsquo;</dt>
  6660. <dd><p>0xFFDAB9
  6661. </p></dd>
  6662. <dt>&lsquo;<samp class="samp">Peru</samp>&rsquo;</dt>
  6663. <dd><p>0xCD853F
  6664. </p></dd>
  6665. <dt>&lsquo;<samp class="samp">Pink</samp>&rsquo;</dt>
  6666. <dd><p>0xFFC0CB
  6667. </p></dd>
  6668. <dt>&lsquo;<samp class="samp">Plum</samp>&rsquo;</dt>
  6669. <dd><p>0xDDA0DD
  6670. </p></dd>
  6671. <dt>&lsquo;<samp class="samp">PowderBlue</samp>&rsquo;</dt>
  6672. <dd><p>0xB0E0E6
  6673. </p></dd>
  6674. <dt>&lsquo;<samp class="samp">Purple</samp>&rsquo;</dt>
  6675. <dd><p>0x800080
  6676. </p></dd>
  6677. <dt>&lsquo;<samp class="samp">Red</samp>&rsquo;</dt>
  6678. <dd><p>0xFF0000
  6679. </p></dd>
  6680. <dt>&lsquo;<samp class="samp">RosyBrown</samp>&rsquo;</dt>
  6681. <dd><p>0xBC8F8F
  6682. </p></dd>
  6683. <dt>&lsquo;<samp class="samp">RoyalBlue</samp>&rsquo;</dt>
  6684. <dd><p>0x4169E1
  6685. </p></dd>
  6686. <dt>&lsquo;<samp class="samp">SaddleBrown</samp>&rsquo;</dt>
  6687. <dd><p>0x8B4513
  6688. </p></dd>
  6689. <dt>&lsquo;<samp class="samp">Salmon</samp>&rsquo;</dt>
  6690. <dd><p>0xFA8072
  6691. </p></dd>
  6692. <dt>&lsquo;<samp class="samp">SandyBrown</samp>&rsquo;</dt>
  6693. <dd><p>0xF4A460
  6694. </p></dd>
  6695. <dt>&lsquo;<samp class="samp">SeaGreen</samp>&rsquo;</dt>
  6696. <dd><p>0x2E8B57
  6697. </p></dd>
  6698. <dt>&lsquo;<samp class="samp">SeaShell</samp>&rsquo;</dt>
  6699. <dd><p>0xFFF5EE
  6700. </p></dd>
  6701. <dt>&lsquo;<samp class="samp">Sienna</samp>&rsquo;</dt>
  6702. <dd><p>0xA0522D
  6703. </p></dd>
  6704. <dt>&lsquo;<samp class="samp">Silver</samp>&rsquo;</dt>
  6705. <dd><p>0xC0C0C0
  6706. </p></dd>
  6707. <dt>&lsquo;<samp class="samp">SkyBlue</samp>&rsquo;</dt>
  6708. <dd><p>0x87CEEB
  6709. </p></dd>
  6710. <dt>&lsquo;<samp class="samp">SlateBlue</samp>&rsquo;</dt>
  6711. <dd><p>0x6A5ACD
  6712. </p></dd>
  6713. <dt>&lsquo;<samp class="samp">SlateGray</samp>&rsquo;</dt>
  6714. <dd><p>0x708090
  6715. </p></dd>
  6716. <dt>&lsquo;<samp class="samp">Snow</samp>&rsquo;</dt>
  6717. <dd><p>0xFFFAFA
  6718. </p></dd>
  6719. <dt>&lsquo;<samp class="samp">SpringGreen</samp>&rsquo;</dt>
  6720. <dd><p>0x00FF7F
  6721. </p></dd>
  6722. <dt>&lsquo;<samp class="samp">SteelBlue</samp>&rsquo;</dt>
  6723. <dd><p>0x4682B4
  6724. </p></dd>
  6725. <dt>&lsquo;<samp class="samp">Tan</samp>&rsquo;</dt>
  6726. <dd><p>0xD2B48C
  6727. </p></dd>
  6728. <dt>&lsquo;<samp class="samp">Teal</samp>&rsquo;</dt>
  6729. <dd><p>0x008080
  6730. </p></dd>
  6731. <dt>&lsquo;<samp class="samp">Thistle</samp>&rsquo;</dt>
  6732. <dd><p>0xD8BFD8
  6733. </p></dd>
  6734. <dt>&lsquo;<samp class="samp">Tomato</samp>&rsquo;</dt>
  6735. <dd><p>0xFF6347
  6736. </p></dd>
  6737. <dt>&lsquo;<samp class="samp">Turquoise</samp>&rsquo;</dt>
  6738. <dd><p>0x40E0D0
  6739. </p></dd>
  6740. <dt>&lsquo;<samp class="samp">Violet</samp>&rsquo;</dt>
  6741. <dd><p>0xEE82EE
  6742. </p></dd>
  6743. <dt>&lsquo;<samp class="samp">Wheat</samp>&rsquo;</dt>
  6744. <dd><p>0xF5DEB3
  6745. </p></dd>
  6746. <dt>&lsquo;<samp class="samp">White</samp>&rsquo;</dt>
  6747. <dd><p>0xFFFFFF
  6748. </p></dd>
  6749. <dt>&lsquo;<samp class="samp">WhiteSmoke</samp>&rsquo;</dt>
  6750. <dd><p>0xF5F5F5
  6751. </p></dd>
  6752. <dt>&lsquo;<samp class="samp">Yellow</samp>&rsquo;</dt>
  6753. <dd><p>0xFFFF00
  6754. </p></dd>
  6755. <dt>&lsquo;<samp class="samp">YellowGreen</samp>&rsquo;</dt>
  6756. <dd><p>0x9ACD32
  6757. </p></dd>
  6758. </dl>
  6759. <a class="anchor" id="channel-layout-syntax"></a></div>
  6760. <div class="section-level-extent" id="Channel-Layout">
  6761. <h3 class="section"><span>7.8 Channel Layout<a class="copiable-link" href="#Channel-Layout"> &para;</a></span></h3>
  6762. <p>A channel layout specifies the spatial disposition of the channels in
  6763. a multi-channel audio stream. To specify a channel layout, FFmpeg
  6764. makes use of a special syntax.
  6765. </p>
  6766. <p>Individual channels are identified by an id, as given by the table
  6767. below:
  6768. </p><dl class="table">
  6769. <dt>&lsquo;<samp class="samp">FL</samp>&rsquo;</dt>
  6770. <dd><p>front left
  6771. </p></dd>
  6772. <dt>&lsquo;<samp class="samp">FR</samp>&rsquo;</dt>
  6773. <dd><p>front right
  6774. </p></dd>
  6775. <dt>&lsquo;<samp class="samp">FC</samp>&rsquo;</dt>
  6776. <dd><p>front center
  6777. </p></dd>
  6778. <dt>&lsquo;<samp class="samp">LFE</samp>&rsquo;</dt>
  6779. <dd><p>low frequency
  6780. </p></dd>
  6781. <dt>&lsquo;<samp class="samp">BL</samp>&rsquo;</dt>
  6782. <dd><p>back left
  6783. </p></dd>
  6784. <dt>&lsquo;<samp class="samp">BR</samp>&rsquo;</dt>
  6785. <dd><p>back right
  6786. </p></dd>
  6787. <dt>&lsquo;<samp class="samp">FLC</samp>&rsquo;</dt>
  6788. <dd><p>front left-of-center
  6789. </p></dd>
  6790. <dt>&lsquo;<samp class="samp">FRC</samp>&rsquo;</dt>
  6791. <dd><p>front right-of-center
  6792. </p></dd>
  6793. <dt>&lsquo;<samp class="samp">BC</samp>&rsquo;</dt>
  6794. <dd><p>back center
  6795. </p></dd>
  6796. <dt>&lsquo;<samp class="samp">SL</samp>&rsquo;</dt>
  6797. <dd><p>side left
  6798. </p></dd>
  6799. <dt>&lsquo;<samp class="samp">SR</samp>&rsquo;</dt>
  6800. <dd><p>side right
  6801. </p></dd>
  6802. <dt>&lsquo;<samp class="samp">TC</samp>&rsquo;</dt>
  6803. <dd><p>top center
  6804. </p></dd>
  6805. <dt>&lsquo;<samp class="samp">TFL</samp>&rsquo;</dt>
  6806. <dd><p>top front left
  6807. </p></dd>
  6808. <dt>&lsquo;<samp class="samp">TFC</samp>&rsquo;</dt>
  6809. <dd><p>top front center
  6810. </p></dd>
  6811. <dt>&lsquo;<samp class="samp">TFR</samp>&rsquo;</dt>
  6812. <dd><p>top front right
  6813. </p></dd>
  6814. <dt>&lsquo;<samp class="samp">TBL</samp>&rsquo;</dt>
  6815. <dd><p>top back left
  6816. </p></dd>
  6817. <dt>&lsquo;<samp class="samp">TBC</samp>&rsquo;</dt>
  6818. <dd><p>top back center
  6819. </p></dd>
  6820. <dt>&lsquo;<samp class="samp">TBR</samp>&rsquo;</dt>
  6821. <dd><p>top back right
  6822. </p></dd>
  6823. <dt>&lsquo;<samp class="samp">DL</samp>&rsquo;</dt>
  6824. <dd><p>downmix left
  6825. </p></dd>
  6826. <dt>&lsquo;<samp class="samp">DR</samp>&rsquo;</dt>
  6827. <dd><p>downmix right
  6828. </p></dd>
  6829. <dt>&lsquo;<samp class="samp">WL</samp>&rsquo;</dt>
  6830. <dd><p>wide left
  6831. </p></dd>
  6832. <dt>&lsquo;<samp class="samp">WR</samp>&rsquo;</dt>
  6833. <dd><p>wide right
  6834. </p></dd>
  6835. <dt>&lsquo;<samp class="samp">SDL</samp>&rsquo;</dt>
  6836. <dd><p>surround direct left
  6837. </p></dd>
  6838. <dt>&lsquo;<samp class="samp">SDR</samp>&rsquo;</dt>
  6839. <dd><p>surround direct right
  6840. </p></dd>
  6841. <dt>&lsquo;<samp class="samp">LFE2</samp>&rsquo;</dt>
  6842. <dd><p>low frequency 2
  6843. </p></dd>
  6844. </dl>
  6845. <p>Standard channel layout compositions can be specified by using the
  6846. following identifiers:
  6847. </p><dl class="table">
  6848. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  6849. <dd><p>FC
  6850. </p></dd>
  6851. <dt>&lsquo;<samp class="samp">stereo</samp>&rsquo;</dt>
  6852. <dd><p>FL+FR
  6853. </p></dd>
  6854. <dt>&lsquo;<samp class="samp">2.1</samp>&rsquo;</dt>
  6855. <dd><p>FL+FR+LFE
  6856. </p></dd>
  6857. <dt>&lsquo;<samp class="samp">3.0</samp>&rsquo;</dt>
  6858. <dd><p>FL+FR+FC
  6859. </p></dd>
  6860. <dt>&lsquo;<samp class="samp">3.0(back)</samp>&rsquo;</dt>
  6861. <dd><p>FL+FR+BC
  6862. </p></dd>
  6863. <dt>&lsquo;<samp class="samp">4.0</samp>&rsquo;</dt>
  6864. <dd><p>FL+FR+FC+BC
  6865. </p></dd>
  6866. <dt>&lsquo;<samp class="samp">quad</samp>&rsquo;</dt>
  6867. <dd><p>FL+FR+BL+BR
  6868. </p></dd>
  6869. <dt>&lsquo;<samp class="samp">quad(side)</samp>&rsquo;</dt>
  6870. <dd><p>FL+FR+SL+SR
  6871. </p></dd>
  6872. <dt>&lsquo;<samp class="samp">3.1</samp>&rsquo;</dt>
  6873. <dd><p>FL+FR+FC+LFE
  6874. </p></dd>
  6875. <dt>&lsquo;<samp class="samp">5.0</samp>&rsquo;</dt>
  6876. <dd><p>FL+FR+FC+BL+BR
  6877. </p></dd>
  6878. <dt>&lsquo;<samp class="samp">5.0(side)</samp>&rsquo;</dt>
  6879. <dd><p>FL+FR+FC+SL+SR
  6880. </p></dd>
  6881. <dt>&lsquo;<samp class="samp">4.1</samp>&rsquo;</dt>
  6882. <dd><p>FL+FR+FC+LFE+BC
  6883. </p></dd>
  6884. <dt>&lsquo;<samp class="samp">5.1</samp>&rsquo;</dt>
  6885. <dd><p>FL+FR+FC+LFE+BL+BR
  6886. </p></dd>
  6887. <dt>&lsquo;<samp class="samp">5.1(side)</samp>&rsquo;</dt>
  6888. <dd><p>FL+FR+FC+LFE+SL+SR
  6889. </p></dd>
  6890. <dt>&lsquo;<samp class="samp">6.0</samp>&rsquo;</dt>
  6891. <dd><p>FL+FR+FC+BC+SL+SR
  6892. </p></dd>
  6893. <dt>&lsquo;<samp class="samp">6.0(front)</samp>&rsquo;</dt>
  6894. <dd><p>FL+FR+FLC+FRC+SL+SR
  6895. </p></dd>
  6896. <dt>&lsquo;<samp class="samp">3.1.2</samp>&rsquo;</dt>
  6897. <dd><p>FL+FR+FC+LFE+TFL+TFR
  6898. </p></dd>
  6899. <dt>&lsquo;<samp class="samp">hexagonal</samp>&rsquo;</dt>
  6900. <dd><p>FL+FR+FC+BL+BR+BC
  6901. </p></dd>
  6902. <dt>&lsquo;<samp class="samp">6.1</samp>&rsquo;</dt>
  6903. <dd><p>FL+FR+FC+LFE+BC+SL+SR
  6904. </p></dd>
  6905. <dt>&lsquo;<samp class="samp">6.1</samp>&rsquo;</dt>
  6906. <dd><p>FL+FR+FC+LFE+BL+BR+BC
  6907. </p></dd>
  6908. <dt>&lsquo;<samp class="samp">6.1(front)</samp>&rsquo;</dt>
  6909. <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
  6910. </p></dd>
  6911. <dt>&lsquo;<samp class="samp">7.0</samp>&rsquo;</dt>
  6912. <dd><p>FL+FR+FC+BL+BR+SL+SR
  6913. </p></dd>
  6914. <dt>&lsquo;<samp class="samp">7.0(front)</samp>&rsquo;</dt>
  6915. <dd><p>FL+FR+FC+FLC+FRC+SL+SR
  6916. </p></dd>
  6917. <dt>&lsquo;<samp class="samp">7.1</samp>&rsquo;</dt>
  6918. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
  6919. </p></dd>
  6920. <dt>&lsquo;<samp class="samp">7.1(wide)</samp>&rsquo;</dt>
  6921. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
  6922. </p></dd>
  6923. <dt>&lsquo;<samp class="samp">7.1(wide-side)</samp>&rsquo;</dt>
  6924. <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
  6925. </p></dd>
  6926. <dt>&lsquo;<samp class="samp">5.1.2</samp>&rsquo;</dt>
  6927. <dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR
  6928. </p></dd>
  6929. <dt>&lsquo;<samp class="samp">octagonal</samp>&rsquo;</dt>
  6930. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
  6931. </p></dd>
  6932. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  6933. <dd><p>FL+FR+BL+BR+TFL+TFR+TBL+TBR
  6934. </p></dd>
  6935. <dt>&lsquo;<samp class="samp">5.1.4</samp>&rsquo;</dt>
  6936. <dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR+TBL+TBR
  6937. </p></dd>
  6938. <dt>&lsquo;<samp class="samp">7.1.2</samp>&rsquo;</dt>
  6939. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR
  6940. </p></dd>
  6941. <dt>&lsquo;<samp class="samp">7.1.4</samp>&rsquo;</dt>
  6942. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR
  6943. </p></dd>
  6944. <dt>&lsquo;<samp class="samp">7.2.3</samp>&rsquo;</dt>
  6945. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBC+LFE2
  6946. </p></dd>
  6947. <dt>&lsquo;<samp class="samp">9.1.4</samp>&rsquo;</dt>
  6948. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR
  6949. </p></dd>
  6950. <dt>&lsquo;<samp class="samp">hexadecagonal</samp>&rsquo;</dt>
  6951. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
  6952. </p></dd>
  6953. <dt>&lsquo;<samp class="samp">downmix</samp>&rsquo;</dt>
  6954. <dd><p>DL+DR
  6955. </p></dd>
  6956. <dt>&lsquo;<samp class="samp">22.2</samp>&rsquo;</dt>
  6957. <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
  6958. </p></dd>
  6959. </dl>
  6960. <p>A custom channel layout can be specified as a sequence of terms, separated by &rsquo;+&rsquo;.
  6961. Each term can be:
  6962. </p><ul class="itemize mark-bullet">
  6963. <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.),
  6964. each optionally containing a custom name after a &rsquo;@&rsquo;, (e.g. &lsquo;<samp class="samp">FL@Left</samp>&rsquo;,
  6965. &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.)
  6966. </li></ul>
  6967. <p>A standard channel layout can be specified by the following:
  6968. </p><ul class="itemize mark-bullet">
  6969. <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.)
  6970. </li><li>the name of a standard channel layout (e.g. &lsquo;<samp class="samp">mono</samp>&rsquo;,
  6971. &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.)
  6972. </li><li>a number of channels, in decimal, followed by &rsquo;c&rsquo;, yielding the default channel
  6973. layout for that number of channels (see the function
  6974. <code class="code">av_channel_layout_default</code>). Note that not all channel counts have a
  6975. default layout.
  6976. </li><li>a number of channels, in decimal, followed by &rsquo;C&rsquo;, yielding an unknown channel
  6977. layout with the specified number of channels. Note that not all channel layout
  6978. specification strings support unknown channel layouts.
  6979. </li><li>a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
  6980. <code class="code">AV_CH_*</code> macros in <samp class="file">libavutil/channel_layout.h</samp>.
  6981. </li></ul>
  6982. <p>Before libavutil version 53 the trailing character &quot;c&quot; to specify a number of
  6983. channels was optional, but now it is required, while a channel layout mask can
  6984. also be specified as a decimal number (if and only if not followed by &quot;c&quot; or &quot;C&quot;).
  6985. </p>
  6986. <p>See also the function <code class="code">av_channel_layout_from_string</code> defined in
  6987. <samp class="file">libavutil/channel_layout.h</samp>.
  6988. </p>
  6989. </div>
  6990. </div>
  6991. <div class="chapter-level-extent" id="Expression-Evaluation">
  6992. <h2 class="chapter"><span>8 Expression Evaluation<a class="copiable-link" href="#Expression-Evaluation"> &para;</a></span></h2>
  6993. <p>When evaluating an arithmetic expression, FFmpeg uses an internal
  6994. formula evaluator, implemented through the <samp class="file">libavutil/eval.h</samp>
  6995. interface.
  6996. </p>
  6997. <p>An expression may contain unary, binary operators, constants, and
  6998. functions.
  6999. </p>
  7000. <p>Two expressions <var class="var">expr1</var> and <var class="var">expr2</var> can be combined to form
  7001. another expression &quot;<var class="var">expr1</var>;<var class="var">expr2</var>&quot;.
  7002. <var class="var">expr1</var> and <var class="var">expr2</var> are evaluated in turn, and the new
  7003. expression evaluates to the value of <var class="var">expr2</var>.
  7004. </p>
  7005. <p>The following binary operators are available: <code class="code">+</code>, <code class="code">-</code>,
  7006. <code class="code">*</code>, <code class="code">/</code>, <code class="code">^</code>.
  7007. </p>
  7008. <p>The following unary operators are available: <code class="code">+</code>, <code class="code">-</code>.
  7009. </p>
  7010. <p>The following functions are available:
  7011. </p><dl class="table">
  7012. <dt><samp class="option">abs(x)</samp></dt>
  7013. <dd><p>Compute absolute value of <var class="var">x</var>.
  7014. </p>
  7015. </dd>
  7016. <dt><samp class="option">acos(x)</samp></dt>
  7017. <dd><p>Compute arccosine of <var class="var">x</var>.
  7018. </p>
  7019. </dd>
  7020. <dt><samp class="option">asin(x)</samp></dt>
  7021. <dd><p>Compute arcsine of <var class="var">x</var>.
  7022. </p>
  7023. </dd>
  7024. <dt><samp class="option">atan(x)</samp></dt>
  7025. <dd><p>Compute arctangent of <var class="var">x</var>.
  7026. </p>
  7027. </dd>
  7028. <dt><samp class="option">atan2(y, x)</samp></dt>
  7029. <dd><p>Compute principal value of the arc tangent of <var class="var">y</var>/<var class="var">x</var>.
  7030. </p>
  7031. </dd>
  7032. <dt><samp class="option">between(x, min, max)</samp></dt>
  7033. <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
  7034. equal to <var class="var">max</var>, 0 otherwise.
  7035. </p>
  7036. </dd>
  7037. <dt><samp class="option">bitand(x, y)</samp></dt>
  7038. <dt><samp class="option">bitor(x, y)</samp></dt>
  7039. <dd><p>Compute bitwise and/or operation on <var class="var">x</var> and <var class="var">y</var>.
  7040. </p>
  7041. <p>The results of the evaluation of <var class="var">x</var> and <var class="var">y</var> are converted to
  7042. integers before executing the bitwise operation.
  7043. </p>
  7044. <p>Note that both the conversion to integer and the conversion back to
  7045. floating point can lose precision. Beware of unexpected results for
  7046. large numbers (usually 2^53 and larger).
  7047. </p>
  7048. </dd>
  7049. <dt><samp class="option">ceil(expr)</samp></dt>
  7050. <dd><p>Round the value of expression <var class="var">expr</var> upwards to the nearest
  7051. integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
  7052. </p>
  7053. </dd>
  7054. <dt><samp class="option">clip(x, min, max)</samp></dt>
  7055. <dd><p>Return the value of <var class="var">x</var> clipped between <var class="var">min</var> and <var class="var">max</var>.
  7056. </p>
  7057. </dd>
  7058. <dt><samp class="option">cos(x)</samp></dt>
  7059. <dd><p>Compute cosine of <var class="var">x</var>.
  7060. </p>
  7061. </dd>
  7062. <dt><samp class="option">cosh(x)</samp></dt>
  7063. <dd><p>Compute hyperbolic cosine of <var class="var">x</var>.
  7064. </p>
  7065. </dd>
  7066. <dt><samp class="option">eq(x, y)</samp></dt>
  7067. <dd><p>Return 1 if <var class="var">x</var> and <var class="var">y</var> are equivalent, 0 otherwise.
  7068. </p>
  7069. </dd>
  7070. <dt><samp class="option">exp(x)</samp></dt>
  7071. <dd><p>Compute exponential of <var class="var">x</var> (with base <code class="code">e</code>, the Euler&rsquo;s number).
  7072. </p>
  7073. </dd>
  7074. <dt><samp class="option">floor(expr)</samp></dt>
  7075. <dd><p>Round the value of expression <var class="var">expr</var> downwards to the nearest
  7076. integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
  7077. </p>
  7078. </dd>
  7079. <dt><samp class="option">gauss(x)</samp></dt>
  7080. <dd><p>Compute Gauss function of <var class="var">x</var>, corresponding to
  7081. <code class="code">exp(-x*x/2) / sqrt(2*PI)</code>.
  7082. </p>
  7083. </dd>
  7084. <dt><samp class="option">gcd(x, y)</samp></dt>
  7085. <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
  7086. <var class="var">y</var> are 0 or either or both are less than zero then behavior is undefined.
  7087. </p>
  7088. </dd>
  7089. <dt><samp class="option">gt(x, y)</samp></dt>
  7090. <dd><p>Return 1 if <var class="var">x</var> is greater than <var class="var">y</var>, 0 otherwise.
  7091. </p>
  7092. </dd>
  7093. <dt><samp class="option">gte(x, y)</samp></dt>
  7094. <dd><p>Return 1 if <var class="var">x</var> is greater than or equal to <var class="var">y</var>, 0 otherwise.
  7095. </p>
  7096. </dd>
  7097. <dt><samp class="option">hypot(x, y)</samp></dt>
  7098. <dd><p>This function is similar to the C function with the same name; it returns
  7099. &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
  7100. right triangle with sides of length <var class="var">x</var> and <var class="var">y</var>, or the distance of the
  7101. point (<var class="var">x</var>, <var class="var">y</var>) from the origin.
  7102. </p>
  7103. </dd>
  7104. <dt><samp class="option">if(x, y)</samp></dt>
  7105. <dd><p>Evaluate <var class="var">x</var>, and if the result is non-zero return the result of
  7106. the evaluation of <var class="var">y</var>, return 0 otherwise.
  7107. </p>
  7108. </dd>
  7109. <dt><samp class="option">if(x, y, z)</samp></dt>
  7110. <dd><p>Evaluate <var class="var">x</var>, and if the result is non-zero return the evaluation
  7111. result of <var class="var">y</var>, otherwise the evaluation result of <var class="var">z</var>.
  7112. </p>
  7113. </dd>
  7114. <dt><samp class="option">ifnot(x, y)</samp></dt>
  7115. <dd><p>Evaluate <var class="var">x</var>, and if the result is zero return the result of the
  7116. evaluation of <var class="var">y</var>, return 0 otherwise.
  7117. </p>
  7118. </dd>
  7119. <dt><samp class="option">ifnot(x, y, z)</samp></dt>
  7120. <dd><p>Evaluate <var class="var">x</var>, and if the result is zero return the evaluation
  7121. result of <var class="var">y</var>, otherwise the evaluation result of <var class="var">z</var>.
  7122. </p>
  7123. </dd>
  7124. <dt><samp class="option">isinf(x)</samp></dt>
  7125. <dd><p>Return 1.0 if <var class="var">x</var> is +/-INFINITY, 0.0 otherwise.
  7126. </p>
  7127. </dd>
  7128. <dt><samp class="option">isnan(x)</samp></dt>
  7129. <dd><p>Return 1.0 if <var class="var">x</var> is NAN, 0.0 otherwise.
  7130. </p>
  7131. </dd>
  7132. <dt><samp class="option">ld(var)</samp></dt>
  7133. <dd><p>Load the value of the internal variable with number
  7134. <var class="var">var</var>, which was previously stored with st(<var class="var">var</var>, <var class="var">expr</var>).
  7135. The function returns the loaded value.
  7136. </p>
  7137. </dd>
  7138. <dt><samp class="option">lerp(x, y, z)</samp></dt>
  7139. <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>.
  7140. </p>
  7141. </dd>
  7142. <dt><samp class="option">log(x)</samp></dt>
  7143. <dd><p>Compute natural logarithm of <var class="var">x</var>.
  7144. </p>
  7145. </dd>
  7146. <dt><samp class="option">lt(x, y)</samp></dt>
  7147. <dd><p>Return 1 if <var class="var">x</var> is lesser than <var class="var">y</var>, 0 otherwise.
  7148. </p>
  7149. </dd>
  7150. <dt><samp class="option">lte(x, y)</samp></dt>
  7151. <dd><p>Return 1 if <var class="var">x</var> is lesser than or equal to <var class="var">y</var>, 0 otherwise.
  7152. </p>
  7153. </dd>
  7154. <dt><samp class="option">max(x, y)</samp></dt>
  7155. <dd><p>Return the maximum between <var class="var">x</var> and <var class="var">y</var>.
  7156. </p>
  7157. </dd>
  7158. <dt><samp class="option">min(x, y)</samp></dt>
  7159. <dd><p>Return the minimum between <var class="var">x</var> and <var class="var">y</var>.
  7160. </p>
  7161. </dd>
  7162. <dt><samp class="option">mod(x, y)</samp></dt>
  7163. <dd><p>Compute the remainder of division of <var class="var">x</var> by <var class="var">y</var>.
  7164. </p>
  7165. </dd>
  7166. <dt><samp class="option">not(expr)</samp></dt>
  7167. <dd><p>Return 1.0 if <var class="var">expr</var> is zero, 0.0 otherwise.
  7168. </p>
  7169. </dd>
  7170. <dt><samp class="option">pow(x, y)</samp></dt>
  7171. <dd><p>Compute the power of <var class="var">x</var> elevated <var class="var">y</var>, it is equivalent to
  7172. &quot;(<var class="var">x</var>)^(<var class="var">y</var>)&quot;.
  7173. </p>
  7174. </dd>
  7175. <dt><samp class="option">print(t)</samp></dt>
  7176. <dt><samp class="option">print(t, l)</samp></dt>
  7177. <dd><p>Print the value of expression <var class="var">t</var> with loglevel <var class="var">l</var>. If
  7178. <var class="var">l</var> is not specified then a default log level is used.
  7179. Returns the value of the expression printed.
  7180. </p>
  7181. <p>Prints t with loglevel l
  7182. </p>
  7183. </dd>
  7184. <dt><samp class="option">random(idx)</samp></dt>
  7185. <dd><p>Return a pseudo random value between 0.0 and 1.0. <var class="var">idx</var> is the
  7186. index of the internal variable which will be used to save the
  7187. seed/state.
  7188. </p>
  7189. </dd>
  7190. <dt><samp class="option">randomi(idx, min, max)</samp></dt>
  7191. <dd><p>Return a pseudo random value in the interval between <var class="var">min</var> and
  7192. <var class="var">max</var>. <var class="var">idx</var> is the index of the internal variable which will
  7193. be used to save the seed/state.
  7194. </p>
  7195. </dd>
  7196. <dt><samp class="option">root(expr, max)</samp></dt>
  7197. <dd><p>Find an input value for which the function represented by <var class="var">expr</var>
  7198. with argument <var class="var">ld(0)</var> is 0 in the interval 0..<var class="var">max</var>.
  7199. </p>
  7200. <p>The expression in <var class="var">expr</var> must denote a continuous function or the
  7201. result is undefined.
  7202. </p>
  7203. <p><var class="var">ld(0)</var> is used to represent the function input value, which means
  7204. that the given expression will be evaluated multiple times with
  7205. various input values that the expression can access through
  7206. <code class="code">ld(0)</code>. When the expression evaluates to 0 then the
  7207. corresponding input value will be returned.
  7208. </p>
  7209. </dd>
  7210. <dt><samp class="option">round(expr)</samp></dt>
  7211. <dd><p>Round the value of expression <var class="var">expr</var> to the nearest integer. For example, &quot;round(1.5)&quot; is &quot;2.0&quot;.
  7212. </p>
  7213. </dd>
  7214. <dt><samp class="option">sgn(x)</samp></dt>
  7215. <dd><p>Compute sign of <var class="var">x</var>.
  7216. </p>
  7217. </dd>
  7218. <dt><samp class="option">sin(x)</samp></dt>
  7219. <dd><p>Compute sine of <var class="var">x</var>.
  7220. </p>
  7221. </dd>
  7222. <dt><samp class="option">sinh(x)</samp></dt>
  7223. <dd><p>Compute hyperbolic sine of <var class="var">x</var>.
  7224. </p>
  7225. </dd>
  7226. <dt><samp class="option">sqrt(expr)</samp></dt>
  7227. <dd><p>Compute the square root of <var class="var">expr</var>. This is equivalent to
  7228. &quot;(<var class="var">expr</var>)^.5&quot;.
  7229. </p>
  7230. </dd>
  7231. <dt><samp class="option">squish(x)</samp></dt>
  7232. <dd><p>Compute expression <code class="code">1/(1 + exp(4*x))</code>.
  7233. </p>
  7234. </dd>
  7235. <dt><samp class="option">st(var, expr)</samp></dt>
  7236. <dd><p>Store the value of the expression <var class="var">expr</var> in an internal
  7237. variable. <var class="var">var</var> specifies the number of the variable where to
  7238. store the value, and it is a value ranging from 0 to 9. The function
  7239. returns the value stored in the internal variable.
  7240. Note, Variables are currently not shared between expressions.
  7241. </p>
  7242. </dd>
  7243. <dt><samp class="option">tan(x)</samp></dt>
  7244. <dd><p>Compute tangent of <var class="var">x</var>.
  7245. </p>
  7246. </dd>
  7247. <dt><samp class="option">tanh(x)</samp></dt>
  7248. <dd><p>Compute hyperbolic tangent of <var class="var">x</var>.
  7249. </p>
  7250. </dd>
  7251. <dt><samp class="option">taylor(expr, x)</samp></dt>
  7252. <dt><samp class="option">taylor(expr, x, id)</samp></dt>
  7253. <dd><p>Evaluate a Taylor series at <var class="var">x</var>, given an expression representing
  7254. the <code class="code">ld(id)</code>-th derivative of a function at 0.
  7255. </p>
  7256. <p>When the series does not converge the result is undefined.
  7257. </p>
  7258. <p><var class="var">ld(id)</var> is used to represent the derivative order in <var class="var">expr</var>,
  7259. which means that the given expression will be evaluated multiple times
  7260. with various input values that the expression can access through
  7261. <code class="code">ld(id)</code>. If <var class="var">id</var> is not specified then 0 is assumed.
  7262. </p>
  7263. <p>Note, when you have the derivatives at y instead of 0,
  7264. <code class="code">taylor(expr, x-y)</code> can be used.
  7265. </p>
  7266. </dd>
  7267. <dt><samp class="option">time(0)</samp></dt>
  7268. <dd><p>Return the current (wallclock) time in seconds.
  7269. </p>
  7270. </dd>
  7271. <dt><samp class="option">trunc(expr)</samp></dt>
  7272. <dd><p>Round the value of expression <var class="var">expr</var> towards zero to the nearest
  7273. integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
  7274. </p>
  7275. </dd>
  7276. <dt><samp class="option">while(cond, expr)</samp></dt>
  7277. <dd><p>Evaluate expression <var class="var">expr</var> while the expression <var class="var">cond</var> is
  7278. non-zero, and returns the value of the last <var class="var">expr</var> evaluation, or
  7279. NAN if <var class="var">cond</var> was always false.
  7280. </p></dd>
  7281. </dl>
  7282. <p>The following constants are available:
  7283. </p><dl class="table">
  7284. <dt><samp class="option">PI</samp></dt>
  7285. <dd><p>area of the unit disc, approximately 3.14
  7286. </p></dd>
  7287. <dt><samp class="option">E</samp></dt>
  7288. <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
  7289. </p></dd>
  7290. <dt><samp class="option">PHI</samp></dt>
  7291. <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
  7292. </p></dd>
  7293. </dl>
  7294. <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
  7295. value, note that:
  7296. </p>
  7297. <p><code class="code">*</code> works like AND
  7298. </p>
  7299. <p><code class="code">+</code> works like OR
  7300. </p>
  7301. <p>For example the construct:
  7302. </p><div class="example">
  7303. <pre class="example-preformatted">if (A AND B) then C
  7304. </pre></div>
  7305. <p>is equivalent to:
  7306. </p><div class="example">
  7307. <pre class="example-preformatted">if(A*B, C)
  7308. </pre></div>
  7309. <p>In your C code, you can extend the list of unary and binary functions,
  7310. and define recognized constants, so that they are available for your
  7311. expressions.
  7312. </p>
  7313. <p>The evaluator also recognizes the International System unit prefixes.
  7314. If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
  7315. are based on powers of 1024 instead of powers of 1000.
  7316. The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
  7317. unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
  7318. &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
  7319. </p>
  7320. <p>The list of available International System prefixes follows, with
  7321. indication of the corresponding powers of 10 and of 2.
  7322. </p><dl class="table">
  7323. <dt><samp class="option">y</samp></dt>
  7324. <dd><p>10^-24 / 2^-80
  7325. </p></dd>
  7326. <dt><samp class="option">z</samp></dt>
  7327. <dd><p>10^-21 / 2^-70
  7328. </p></dd>
  7329. <dt><samp class="option">a</samp></dt>
  7330. <dd><p>10^-18 / 2^-60
  7331. </p></dd>
  7332. <dt><samp class="option">f</samp></dt>
  7333. <dd><p>10^-15 / 2^-50
  7334. </p></dd>
  7335. <dt><samp class="option">p</samp></dt>
  7336. <dd><p>10^-12 / 2^-40
  7337. </p></dd>
  7338. <dt><samp class="option">n</samp></dt>
  7339. <dd><p>10^-9 / 2^-30
  7340. </p></dd>
  7341. <dt><samp class="option">u</samp></dt>
  7342. <dd><p>10^-6 / 2^-20
  7343. </p></dd>
  7344. <dt><samp class="option">m</samp></dt>
  7345. <dd><p>10^-3 / 2^-10
  7346. </p></dd>
  7347. <dt><samp class="option">c</samp></dt>
  7348. <dd><p>10^-2
  7349. </p></dd>
  7350. <dt><samp class="option">d</samp></dt>
  7351. <dd><p>10^-1
  7352. </p></dd>
  7353. <dt><samp class="option">h</samp></dt>
  7354. <dd><p>10^2
  7355. </p></dd>
  7356. <dt><samp class="option">k</samp></dt>
  7357. <dd><p>10^3 / 2^10
  7358. </p></dd>
  7359. <dt><samp class="option">K</samp></dt>
  7360. <dd><p>10^3 / 2^10
  7361. </p></dd>
  7362. <dt><samp class="option">M</samp></dt>
  7363. <dd><p>10^6 / 2^20
  7364. </p></dd>
  7365. <dt><samp class="option">G</samp></dt>
  7366. <dd><p>10^9 / 2^30
  7367. </p></dd>
  7368. <dt><samp class="option">T</samp></dt>
  7369. <dd><p>10^12 / 2^40
  7370. </p></dd>
  7371. <dt><samp class="option">P</samp></dt>
  7372. <dd><p>10^15 / 2^50
  7373. </p></dd>
  7374. <dt><samp class="option">E</samp></dt>
  7375. <dd><p>10^18 / 2^60
  7376. </p></dd>
  7377. <dt><samp class="option">Z</samp></dt>
  7378. <dd><p>10^21 / 2^70
  7379. </p></dd>
  7380. <dt><samp class="option">Y</samp></dt>
  7381. <dd><p>10^24 / 2^80
  7382. </p></dd>
  7383. </dl>
  7384. <a class="anchor" id="codec_002doptions"></a></div>
  7385. <div class="chapter-level-extent" id="Codec-Options">
  7386. <h2 class="chapter"><span>9 Codec Options<a class="copiable-link" href="#Codec-Options"> &para;</a></span></h2>
  7387. <p>libavcodec provides some generic global options, which can be set on
  7388. all the encoders and decoders. In addition, each codec may support
  7389. so-called private options, which are specific for a given codec.
  7390. </p>
  7391. <p>Sometimes, a global option may only affect a specific kind of codec,
  7392. and may be nonsensical or ignored by another, so you need to be aware
  7393. of the meaning of the specified options. Also some options are
  7394. meant only for decoding or encoding.
  7395. </p>
  7396. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  7397. FFmpeg tools, or by setting the value explicitly in the
  7398. <code class="code">AVCodecContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  7399. for programmatic use.
  7400. </p>
  7401. <p>The list of supported options follow:
  7402. </p>
  7403. <dl class="table">
  7404. <dt><samp class="option">b <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  7405. <dd><p>Set bitrate in bits/s. Default value is 200K.
  7406. </p>
  7407. </dd>
  7408. <dt><samp class="option">ab <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  7409. <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
  7410. </p>
  7411. </dd>
  7412. <dt><samp class="option">bt <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7413. <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
  7414. tolerance specifies how far ratecontrol is willing to deviate from the
  7415. target average bitrate value. This is not related to min/max
  7416. bitrate. Lowering tolerance too much has an adverse effect on quality.
  7417. </p>
  7418. </dd>
  7419. <dt><samp class="option">flags <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  7420. <dd><p>Set generic flags.
  7421. </p>
  7422. <p>Possible values:
  7423. </p><dl class="table">
  7424. <dt>&lsquo;<samp class="samp">mv4</samp>&rsquo;</dt>
  7425. <dd><p>Use four motion vector by macroblock (mpeg4).
  7426. </p></dd>
  7427. <dt>&lsquo;<samp class="samp">qpel</samp>&rsquo;</dt>
  7428. <dd><p>Use 1/4 pel motion compensation.
  7429. </p></dd>
  7430. <dt>&lsquo;<samp class="samp">loop</samp>&rsquo;</dt>
  7431. <dd><p>Use loop filter.
  7432. </p></dd>
  7433. <dt>&lsquo;<samp class="samp">qscale</samp>&rsquo;</dt>
  7434. <dd><p>Use fixed qscale.
  7435. </p></dd>
  7436. <dt>&lsquo;<samp class="samp">pass1</samp>&rsquo;</dt>
  7437. <dd><p>Use internal 2pass ratecontrol in first pass mode.
  7438. </p></dd>
  7439. <dt>&lsquo;<samp class="samp">pass2</samp>&rsquo;</dt>
  7440. <dd><p>Use internal 2pass ratecontrol in second pass mode.
  7441. </p></dd>
  7442. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  7443. <dd><p>Only decode/encode grayscale.
  7444. </p></dd>
  7445. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  7446. <dd><p>Set error[?] variables during encoding.
  7447. </p></dd>
  7448. <dt>&lsquo;<samp class="samp">truncated</samp>&rsquo;</dt>
  7449. <dd><p>Input bitstream might be randomly truncated.
  7450. </p></dd>
  7451. <dt>&lsquo;<samp class="samp">drop_changed</samp>&rsquo;</dt>
  7452. <dd><p>Don&rsquo;t output frames whose parameters differ from first decoded frame in stream.
  7453. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
  7454. </p>
  7455. </dd>
  7456. <dt>&lsquo;<samp class="samp">ildct</samp>&rsquo;</dt>
  7457. <dd><p>Use interlaced DCT.
  7458. </p></dd>
  7459. <dt>&lsquo;<samp class="samp">low_delay</samp>&rsquo;</dt>
  7460. <dd><p>Force low delay.
  7461. </p></dd>
  7462. <dt>&lsquo;<samp class="samp">global_header</samp>&rsquo;</dt>
  7463. <dd><p>Place global headers in extradata instead of every keyframe.
  7464. </p></dd>
  7465. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  7466. <dd><p>Only write platform-, build- and time-independent data. (except (I)DCT).
  7467. This ensures that file and data checksums are reproducible and match between
  7468. platforms. Its primary use is for regression testing.
  7469. </p></dd>
  7470. <dt>&lsquo;<samp class="samp">aic</samp>&rsquo;</dt>
  7471. <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
  7472. </p></dd>
  7473. <dt>&lsquo;<samp class="samp">ilme</samp>&rsquo;</dt>
  7474. <dd><p>Apply interlaced motion estimation.
  7475. </p></dd>
  7476. <dt>&lsquo;<samp class="samp">cgop</samp>&rsquo;</dt>
  7477. <dd><p>Use closed gop.
  7478. </p></dd>
  7479. <dt>&lsquo;<samp class="samp">output_corrupt</samp>&rsquo;</dt>
  7480. <dd><p>Output even potentially corrupted frames.
  7481. </p></dd>
  7482. </dl>
  7483. </dd>
  7484. <dt><samp class="option">time_base <var class="var">rational number</var></samp></dt>
  7485. <dd><p>Set codec time base.
  7486. </p>
  7487. <p>It is the fundamental unit of time (in seconds) in terms of which
  7488. frame timestamps are represented. For fixed-fps content, timebase
  7489. should be <code class="code">1 / frame_rate</code> and timestamp increments should be
  7490. identically 1.
  7491. </p>
  7492. </dd>
  7493. <dt><samp class="option">g <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7494. <dd><p>Set the group of picture (GOP) size. Default value is 12.
  7495. </p>
  7496. </dd>
  7497. <dt><samp class="option">ar <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  7498. <dd><p>Set audio sampling rate (in Hz).
  7499. </p>
  7500. </dd>
  7501. <dt><samp class="option">ac <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  7502. <dd><p>Set number of audio channels.
  7503. </p>
  7504. </dd>
  7505. <dt><samp class="option">cutoff <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  7506. <dd><p>Set cutoff bandwidth. (Supported only by selected encoders, see
  7507. their respective documentation sections.)
  7508. </p>
  7509. </dd>
  7510. <dt><samp class="option">frame_size <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  7511. <dd><p>Set audio frame size.
  7512. </p>
  7513. <p>Each submitted frame except the last must contain exactly frame_size
  7514. samples per channel. May be 0 when the codec has
  7515. CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
  7516. restricted. It is set by some decoders to indicate constant frame
  7517. size.
  7518. </p>
  7519. </dd>
  7520. <dt><samp class="option">frame_number <var class="var">integer</var></samp></dt>
  7521. <dd><p>Set the frame number.
  7522. </p>
  7523. </dd>
  7524. <dt><samp class="option">delay <var class="var">integer</var></samp></dt>
  7525. <dt><samp class="option">qcomp <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7526. <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
  7527. in the ratecontrol equation. Recommended range for default rc_eq:
  7528. 0.0-1.0.
  7529. </p>
  7530. </dd>
  7531. <dt><samp class="option">qblur <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7532. <dd><p>Set video quantizer scale blur (VBR).
  7533. </p>
  7534. </dd>
  7535. <dt><samp class="option">qmin <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7536. <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
  7537. 69, default value is 2.
  7538. </p>
  7539. </dd>
  7540. <dt><samp class="option">qmax <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7541. <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
  7542. 1024, default value is 31.
  7543. </p>
  7544. </dd>
  7545. <dt><samp class="option">qdiff <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7546. <dd><p>Set max difference between the quantizer scale (VBR).
  7547. </p>
  7548. </dd>
  7549. <dt><samp class="option">bf <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7550. <dd><p>Set max number of B frames between non-B-frames.
  7551. </p>
  7552. <p>Must be an integer between -1 and 16. 0 means that B-frames are
  7553. disabled. If a value of -1 is used, it will choose an automatic value
  7554. depending on the encoder.
  7555. </p>
  7556. <p>Default value is 0.
  7557. </p>
  7558. </dd>
  7559. <dt><samp class="option">b_qfactor <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7560. <dd><p>Set qp factor between P and B frames.
  7561. </p>
  7562. </dd>
  7563. <dt><samp class="option">codec_tag <var class="var">integer</var></samp></dt>
  7564. <dt><samp class="option">bug <var class="var">flags</var> (<em class="emph">decoding,video</em>)</samp></dt>
  7565. <dd><p>Workaround not auto detected encoder bugs.
  7566. </p>
  7567. <p>Possible values:
  7568. </p><dl class="table">
  7569. <dt>&lsquo;<samp class="samp">autodetect</samp>&rsquo;</dt>
  7570. <dt>&lsquo;<samp class="samp">xvid_ilace</samp>&rsquo;</dt>
  7571. <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
  7572. </p></dd>
  7573. <dt>&lsquo;<samp class="samp">ump4</samp>&rsquo;</dt>
  7574. <dd><p>(autodetected if fourcc==UMP4)
  7575. </p></dd>
  7576. <dt>&lsquo;<samp class="samp">no_padding</samp>&rsquo;</dt>
  7577. <dd><p>padding bug (autodetected)
  7578. </p></dd>
  7579. <dt>&lsquo;<samp class="samp">amv</samp>&rsquo;</dt>
  7580. <dt>&lsquo;<samp class="samp">qpel_chroma</samp>&rsquo;</dt>
  7581. <dt>&lsquo;<samp class="samp">std_qpel</samp>&rsquo;</dt>
  7582. <dd><p>old standard qpel (autodetected per fourcc/version)
  7583. </p></dd>
  7584. <dt>&lsquo;<samp class="samp">qpel_chroma2</samp>&rsquo;</dt>
  7585. <dt>&lsquo;<samp class="samp">direct_blocksize</samp>&rsquo;</dt>
  7586. <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
  7587. </p></dd>
  7588. <dt>&lsquo;<samp class="samp">edge</samp>&rsquo;</dt>
  7589. <dd><p>edge padding bug (autodetected per fourcc/version)
  7590. </p></dd>
  7591. <dt>&lsquo;<samp class="samp">hpel_chroma</samp>&rsquo;</dt>
  7592. <dt>&lsquo;<samp class="samp">dc_clip</samp>&rsquo;</dt>
  7593. <dt>&lsquo;<samp class="samp">ms</samp>&rsquo;</dt>
  7594. <dd><p>Workaround various bugs in microsoft broken decoders.
  7595. </p></dd>
  7596. <dt>&lsquo;<samp class="samp">trunc</samp>&rsquo;</dt>
  7597. <dd><p>trancated frames
  7598. </p></dd>
  7599. </dl>
  7600. </dd>
  7601. <dt><samp class="option">strict <var class="var">integer</var> (<em class="emph">decoding/encoding,audio,video</em>)</samp></dt>
  7602. <dd><p>Specify how strictly to follow the standards.
  7603. </p>
  7604. <p>Possible values:
  7605. </p><dl class="table">
  7606. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  7607. <dd><p>strictly conform to an older more strict version of the spec or reference software
  7608. </p></dd>
  7609. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  7610. <dd><p>strictly conform to all the things in the spec no matter what consequences
  7611. </p></dd>
  7612. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  7613. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  7614. <dd><p>allow unofficial extensions
  7615. </p></dd>
  7616. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  7617. <dd><p>allow non standardized experimental things, experimental
  7618. (unfinished/work in progress/not well tested) decoders and encoders.
  7619. Note: experimental decoders can pose a security risk, do not use this for
  7620. decoding untrusted input.
  7621. </p></dd>
  7622. </dl>
  7623. </dd>
  7624. <dt><samp class="option">b_qoffset <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7625. <dd><p>Set QP offset between P and B frames.
  7626. </p>
  7627. </dd>
  7628. <dt><samp class="option">err_detect <var class="var">flags</var> (<em class="emph">decoding,audio,video</em>)</samp></dt>
  7629. <dd><p>Set error detection flags.
  7630. </p>
  7631. <p>Possible values:
  7632. </p><dl class="table">
  7633. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  7634. <dd><p>verify embedded CRCs
  7635. </p></dd>
  7636. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  7637. <dd><p>detect bitstream specification deviations
  7638. </p></dd>
  7639. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  7640. <dd><p>detect improper bitstream length
  7641. </p></dd>
  7642. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  7643. <dd><p>abort decoding on minor error detection
  7644. </p></dd>
  7645. <dt>&lsquo;<samp class="samp">ignore_err</samp>&rsquo;</dt>
  7646. <dd><p>ignore decoding errors, and continue decoding.
  7647. This is useful if you want to analyze the content of a video and thus want
  7648. everything to be decoded no matter what. This option will not result in a video
  7649. that is pleasing to watch in case of errors.
  7650. </p></dd>
  7651. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  7652. <dd><p>consider things that violate the spec and have not been seen in the wild as errors
  7653. </p></dd>
  7654. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  7655. <dd><p>consider all spec non compliancies as errors
  7656. </p></dd>
  7657. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  7658. <dd><p>consider things that a sane encoder should not do as an error
  7659. </p></dd>
  7660. </dl>
  7661. </dd>
  7662. <dt><samp class="option">has_b_frames <var class="var">integer</var></samp></dt>
  7663. <dt><samp class="option">block_align <var class="var">integer</var></samp></dt>
  7664. <dt><samp class="option">rc_override_count <var class="var">integer</var></samp></dt>
  7665. <dt><samp class="option">maxrate <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  7666. <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
  7667. </p>
  7668. </dd>
  7669. <dt><samp class="option">minrate <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  7670. <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
  7671. encode. It is of little use elsewise.
  7672. </p>
  7673. </dd>
  7674. <dt><samp class="option">bufsize <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  7675. <dd><p>Set ratecontrol buffer size (in bits).
  7676. </p>
  7677. </dd>
  7678. <dt><samp class="option">i_qfactor <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7679. <dd><p>Set QP factor between P and I frames.
  7680. </p>
  7681. </dd>
  7682. <dt><samp class="option">i_qoffset <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7683. <dd><p>Set QP offset between P and I frames.
  7684. </p>
  7685. </dd>
  7686. <dt><samp class="option">dct <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7687. <dd><p>Set DCT algorithm.
  7688. </p>
  7689. <p>Possible values:
  7690. </p><dl class="table">
  7691. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  7692. <dd><p>autoselect a good one (default)
  7693. </p></dd>
  7694. <dt>&lsquo;<samp class="samp">fastint</samp>&rsquo;</dt>
  7695. <dd><p>fast integer
  7696. </p></dd>
  7697. <dt>&lsquo;<samp class="samp">int</samp>&rsquo;</dt>
  7698. <dd><p>accurate integer
  7699. </p></dd>
  7700. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  7701. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  7702. <dt>&lsquo;<samp class="samp">faan</samp>&rsquo;</dt>
  7703. <dd><p>floating point AAN DCT
  7704. </p></dd>
  7705. </dl>
  7706. </dd>
  7707. <dt><samp class="option">lumi_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7708. <dd><p>Compress bright areas stronger than medium ones.
  7709. </p>
  7710. </dd>
  7711. <dt><samp class="option">tcplx_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7712. <dd><p>Set temporal complexity masking.
  7713. </p>
  7714. </dd>
  7715. <dt><samp class="option">scplx_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7716. <dd><p>Set spatial complexity masking.
  7717. </p>
  7718. </dd>
  7719. <dt><samp class="option">p_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7720. <dd><p>Set inter masking.
  7721. </p>
  7722. </dd>
  7723. <dt><samp class="option">dark_mask <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7724. <dd><p>Compress dark areas stronger than medium ones.
  7725. </p>
  7726. </dd>
  7727. <dt><samp class="option">idct <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  7728. <dd><p>Select IDCT implementation.
  7729. </p>
  7730. <p>Possible values:
  7731. </p><dl class="table">
  7732. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  7733. <dt>&lsquo;<samp class="samp">int</samp>&rsquo;</dt>
  7734. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  7735. <dt>&lsquo;<samp class="samp">simplemmx</samp>&rsquo;</dt>
  7736. <dt>&lsquo;<samp class="samp">simpleauto</samp>&rsquo;</dt>
  7737. <dd><p>Automatically pick a IDCT compatible with the simple one
  7738. </p>
  7739. </dd>
  7740. <dt>&lsquo;<samp class="samp">arm</samp>&rsquo;</dt>
  7741. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  7742. <dt>&lsquo;<samp class="samp">sh4</samp>&rsquo;</dt>
  7743. <dt>&lsquo;<samp class="samp">simplearm</samp>&rsquo;</dt>
  7744. <dt>&lsquo;<samp class="samp">simplearmv5te</samp>&rsquo;</dt>
  7745. <dt>&lsquo;<samp class="samp">simplearmv6</samp>&rsquo;</dt>
  7746. <dt>&lsquo;<samp class="samp">simpleneon</samp>&rsquo;</dt>
  7747. <dt>&lsquo;<samp class="samp">xvid</samp>&rsquo;</dt>
  7748. <dt>&lsquo;<samp class="samp">faani</samp>&rsquo;</dt>
  7749. <dd><p>floating point AAN IDCT
  7750. </p></dd>
  7751. </dl>
  7752. </dd>
  7753. <dt><samp class="option">slice_count <var class="var">integer</var></samp></dt>
  7754. <dt><samp class="option">ec <var class="var">flags</var> (<em class="emph">decoding,video</em>)</samp></dt>
  7755. <dd><p>Set error concealment strategy.
  7756. </p>
  7757. <p>Possible values:
  7758. </p><dl class="table">
  7759. <dt>&lsquo;<samp class="samp">guess_mvs</samp>&rsquo;</dt>
  7760. <dd><p>iterative motion vector (MV) search (slow)
  7761. </p></dd>
  7762. <dt>&lsquo;<samp class="samp">deblock</samp>&rsquo;</dt>
  7763. <dd><p>use strong deblock filter for damaged MBs
  7764. </p></dd>
  7765. <dt>&lsquo;<samp class="samp">favor_inter</samp>&rsquo;</dt>
  7766. <dd><p>favor predicting from the previous frame instead of the current
  7767. </p></dd>
  7768. </dl>
  7769. </dd>
  7770. <dt><samp class="option">bits_per_coded_sample <var class="var">integer</var></samp></dt>
  7771. <dt><samp class="option">aspect <var class="var">rational number</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7772. <dd><p>Set sample aspect ratio.
  7773. </p>
  7774. </dd>
  7775. <dt><samp class="option">sar <var class="var">rational number</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7776. <dd><p>Set sample aspect ratio. Alias to <var class="var">aspect</var>.
  7777. </p>
  7778. </dd>
  7779. <dt><samp class="option">debug <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  7780. <dd><p>Print specific debug info.
  7781. </p>
  7782. <p>Possible values:
  7783. </p><dl class="table">
  7784. <dt>&lsquo;<samp class="samp">pict</samp>&rsquo;</dt>
  7785. <dd><p>picture info
  7786. </p></dd>
  7787. <dt>&lsquo;<samp class="samp">rc</samp>&rsquo;</dt>
  7788. <dd><p>rate control
  7789. </p></dd>
  7790. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  7791. <dt>&lsquo;<samp class="samp">mb_type</samp>&rsquo;</dt>
  7792. <dd><p>macroblock (MB) type
  7793. </p></dd>
  7794. <dt>&lsquo;<samp class="samp">qp</samp>&rsquo;</dt>
  7795. <dd><p>per-block quantization parameter (QP)
  7796. </p></dd>
  7797. <dt>&lsquo;<samp class="samp">dct_coeff</samp>&rsquo;</dt>
  7798. <dt>&lsquo;<samp class="samp">green_metadata</samp>&rsquo;</dt>
  7799. <dd><p>display complexity metadata for the upcoming frame, GoP or for a given duration.
  7800. </p>
  7801. </dd>
  7802. <dt>&lsquo;<samp class="samp">skip</samp>&rsquo;</dt>
  7803. <dt>&lsquo;<samp class="samp">startcode</samp>&rsquo;</dt>
  7804. <dt>&lsquo;<samp class="samp">er</samp>&rsquo;</dt>
  7805. <dd><p>error recognition
  7806. </p></dd>
  7807. <dt>&lsquo;<samp class="samp">mmco</samp>&rsquo;</dt>
  7808. <dd><p>memory management control operations (H.264)
  7809. </p></dd>
  7810. <dt>&lsquo;<samp class="samp">bugs</samp>&rsquo;</dt>
  7811. <dt>&lsquo;<samp class="samp">buffers</samp>&rsquo;</dt>
  7812. <dd><p>picture buffer allocations
  7813. </p></dd>
  7814. <dt>&lsquo;<samp class="samp">thread_ops</samp>&rsquo;</dt>
  7815. <dd><p>threading operations
  7816. </p></dd>
  7817. <dt>&lsquo;<samp class="samp">nomc</samp>&rsquo;</dt>
  7818. <dd><p>skip motion compensation
  7819. </p></dd>
  7820. </dl>
  7821. </dd>
  7822. <dt><samp class="option">cmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7823. <dd><p>Set full pel me compare function.
  7824. </p>
  7825. <p>Possible values:
  7826. </p><dl class="table">
  7827. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  7828. <dd><p>sum of absolute differences, fast (default)
  7829. </p></dd>
  7830. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  7831. <dd><p>sum of squared errors
  7832. </p></dd>
  7833. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  7834. <dd><p>sum of absolute Hadamard transformed differences
  7835. </p></dd>
  7836. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  7837. <dd><p>sum of absolute DCT transformed differences
  7838. </p></dd>
  7839. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  7840. <dd><p>sum of squared quantization errors (avoid, low quality)
  7841. </p></dd>
  7842. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  7843. <dd><p>number of bits needed for the block
  7844. </p></dd>
  7845. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  7846. <dd><p>rate distortion optimal, slow
  7847. </p></dd>
  7848. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  7849. <dd><p>0
  7850. </p></dd>
  7851. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  7852. <dd><p>sum of absolute vertical differences
  7853. </p></dd>
  7854. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  7855. <dd><p>sum of squared vertical differences
  7856. </p></dd>
  7857. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  7858. <dd><p>noise preserving sum of squared differences
  7859. </p></dd>
  7860. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  7861. <dd><p>5/3 wavelet, only used in snow
  7862. </p></dd>
  7863. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  7864. <dd><p>9/7 wavelet, only used in snow
  7865. </p></dd>
  7866. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  7867. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  7868. </dl>
  7869. </dd>
  7870. <dt><samp class="option">subcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7871. <dd><p>Set sub pel me compare function.
  7872. </p>
  7873. <p>Possible values:
  7874. </p><dl class="table">
  7875. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  7876. <dd><p>sum of absolute differences, fast (default)
  7877. </p></dd>
  7878. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  7879. <dd><p>sum of squared errors
  7880. </p></dd>
  7881. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  7882. <dd><p>sum of absolute Hadamard transformed differences
  7883. </p></dd>
  7884. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  7885. <dd><p>sum of absolute DCT transformed differences
  7886. </p></dd>
  7887. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  7888. <dd><p>sum of squared quantization errors (avoid, low quality)
  7889. </p></dd>
  7890. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  7891. <dd><p>number of bits needed for the block
  7892. </p></dd>
  7893. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  7894. <dd><p>rate distortion optimal, slow
  7895. </p></dd>
  7896. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  7897. <dd><p>0
  7898. </p></dd>
  7899. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  7900. <dd><p>sum of absolute vertical differences
  7901. </p></dd>
  7902. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  7903. <dd><p>sum of squared vertical differences
  7904. </p></dd>
  7905. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  7906. <dd><p>noise preserving sum of squared differences
  7907. </p></dd>
  7908. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  7909. <dd><p>5/3 wavelet, only used in snow
  7910. </p></dd>
  7911. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  7912. <dd><p>9/7 wavelet, only used in snow
  7913. </p></dd>
  7914. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  7915. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  7916. </dl>
  7917. </dd>
  7918. <dt><samp class="option">mbcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7919. <dd><p>Set macroblock compare function.
  7920. </p>
  7921. <p>Possible values:
  7922. </p><dl class="table">
  7923. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  7924. <dd><p>sum of absolute differences, fast (default)
  7925. </p></dd>
  7926. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  7927. <dd><p>sum of squared errors
  7928. </p></dd>
  7929. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  7930. <dd><p>sum of absolute Hadamard transformed differences
  7931. </p></dd>
  7932. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  7933. <dd><p>sum of absolute DCT transformed differences
  7934. </p></dd>
  7935. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  7936. <dd><p>sum of squared quantization errors (avoid, low quality)
  7937. </p></dd>
  7938. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  7939. <dd><p>number of bits needed for the block
  7940. </p></dd>
  7941. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  7942. <dd><p>rate distortion optimal, slow
  7943. </p></dd>
  7944. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  7945. <dd><p>0
  7946. </p></dd>
  7947. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  7948. <dd><p>sum of absolute vertical differences
  7949. </p></dd>
  7950. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  7951. <dd><p>sum of squared vertical differences
  7952. </p></dd>
  7953. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  7954. <dd><p>noise preserving sum of squared differences
  7955. </p></dd>
  7956. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  7957. <dd><p>5/3 wavelet, only used in snow
  7958. </p></dd>
  7959. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  7960. <dd><p>9/7 wavelet, only used in snow
  7961. </p></dd>
  7962. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  7963. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  7964. </dl>
  7965. </dd>
  7966. <dt><samp class="option">ildctcmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  7967. <dd><p>Set interlaced dct compare function.
  7968. </p>
  7969. <p>Possible values:
  7970. </p><dl class="table">
  7971. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  7972. <dd><p>sum of absolute differences, fast (default)
  7973. </p></dd>
  7974. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  7975. <dd><p>sum of squared errors
  7976. </p></dd>
  7977. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  7978. <dd><p>sum of absolute Hadamard transformed differences
  7979. </p></dd>
  7980. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  7981. <dd><p>sum of absolute DCT transformed differences
  7982. </p></dd>
  7983. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  7984. <dd><p>sum of squared quantization errors (avoid, low quality)
  7985. </p></dd>
  7986. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  7987. <dd><p>number of bits needed for the block
  7988. </p></dd>
  7989. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  7990. <dd><p>rate distortion optimal, slow
  7991. </p></dd>
  7992. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  7993. <dd><p>0
  7994. </p></dd>
  7995. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  7996. <dd><p>sum of absolute vertical differences
  7997. </p></dd>
  7998. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  7999. <dd><p>sum of squared vertical differences
  8000. </p></dd>
  8001. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  8002. <dd><p>noise preserving sum of squared differences
  8003. </p></dd>
  8004. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  8005. <dd><p>5/3 wavelet, only used in snow
  8006. </p></dd>
  8007. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  8008. <dd><p>9/7 wavelet, only used in snow
  8009. </p></dd>
  8010. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  8011. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  8012. </dl>
  8013. </dd>
  8014. <dt><samp class="option">dia_size <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8015. <dd><p>Set diamond type &amp; size for motion estimation.
  8016. </p><dl class="table">
  8017. <dt>&lsquo;<samp class="samp">(1024, INT_MAX)</samp>&rsquo;</dt>
  8018. <dd><p>full motion estimation(slowest)
  8019. </p></dd>
  8020. <dt>&lsquo;<samp class="samp">(768, 1024]</samp>&rsquo;</dt>
  8021. <dd><p>umh motion estimation
  8022. </p></dd>
  8023. <dt>&lsquo;<samp class="samp">(512, 768]</samp>&rsquo;</dt>
  8024. <dd><p>hex motion estimation
  8025. </p></dd>
  8026. <dt>&lsquo;<samp class="samp">(256, 512]</samp>&rsquo;</dt>
  8027. <dd><p>l2s diamond motion estimation
  8028. </p></dd>
  8029. <dt>&lsquo;<samp class="samp">[2,256]</samp>&rsquo;</dt>
  8030. <dd><p>var diamond motion estimation
  8031. </p></dd>
  8032. <dt>&lsquo;<samp class="samp">(-1, 2)</samp>&rsquo;</dt>
  8033. <dd><p>small diamond motion estimation
  8034. </p></dd>
  8035. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  8036. <dd><p>funny diamond motion estimation
  8037. </p></dd>
  8038. <dt>&lsquo;<samp class="samp">(INT_MIN, -1)</samp>&rsquo;</dt>
  8039. <dd><p>sab diamond motion estimation
  8040. </p></dd>
  8041. </dl>
  8042. </dd>
  8043. <dt><samp class="option">last_pred <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8044. <dd><p>Set amount of motion predictors from the previous frame.
  8045. </p>
  8046. </dd>
  8047. <dt><samp class="option">precmp <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8048. <dd><p>Set pre motion estimation compare function.
  8049. </p>
  8050. <p>Possible values:
  8051. </p><dl class="table">
  8052. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  8053. <dd><p>sum of absolute differences, fast (default)
  8054. </p></dd>
  8055. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  8056. <dd><p>sum of squared errors
  8057. </p></dd>
  8058. <dt>&lsquo;<samp class="samp">satd</samp>&rsquo;</dt>
  8059. <dd><p>sum of absolute Hadamard transformed differences
  8060. </p></dd>
  8061. <dt>&lsquo;<samp class="samp">dct</samp>&rsquo;</dt>
  8062. <dd><p>sum of absolute DCT transformed differences
  8063. </p></dd>
  8064. <dt>&lsquo;<samp class="samp">psnr</samp>&rsquo;</dt>
  8065. <dd><p>sum of squared quantization errors (avoid, low quality)
  8066. </p></dd>
  8067. <dt>&lsquo;<samp class="samp">bit</samp>&rsquo;</dt>
  8068. <dd><p>number of bits needed for the block
  8069. </p></dd>
  8070. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  8071. <dd><p>rate distortion optimal, slow
  8072. </p></dd>
  8073. <dt>&lsquo;<samp class="samp">zero</samp>&rsquo;</dt>
  8074. <dd><p>0
  8075. </p></dd>
  8076. <dt>&lsquo;<samp class="samp">vsad</samp>&rsquo;</dt>
  8077. <dd><p>sum of absolute vertical differences
  8078. </p></dd>
  8079. <dt>&lsquo;<samp class="samp">vsse</samp>&rsquo;</dt>
  8080. <dd><p>sum of squared vertical differences
  8081. </p></dd>
  8082. <dt>&lsquo;<samp class="samp">nsse</samp>&rsquo;</dt>
  8083. <dd><p>noise preserving sum of squared differences
  8084. </p></dd>
  8085. <dt>&lsquo;<samp class="samp">w53</samp>&rsquo;</dt>
  8086. <dd><p>5/3 wavelet, only used in snow
  8087. </p></dd>
  8088. <dt>&lsquo;<samp class="samp">w97</samp>&rsquo;</dt>
  8089. <dd><p>9/7 wavelet, only used in snow
  8090. </p></dd>
  8091. <dt>&lsquo;<samp class="samp">dctmax</samp>&rsquo;</dt>
  8092. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  8093. </dl>
  8094. </dd>
  8095. <dt><samp class="option">pre_dia_size <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8096. <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
  8097. </p>
  8098. </dd>
  8099. <dt><samp class="option">subq <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8100. <dd><p>Set sub pel motion estimation quality.
  8101. </p>
  8102. </dd>
  8103. <dt><samp class="option">me_range <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8104. <dd><p>Set limit motion vectors range (1023 for DivX player).
  8105. </p>
  8106. </dd>
  8107. <dt><samp class="option">global_quality <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8108. <dt><samp class="option">slice_flags <var class="var">integer</var></samp></dt>
  8109. <dt><samp class="option">mbd <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8110. <dd><p>Set macroblock decision algorithm (high quality mode).
  8111. </p>
  8112. <p>Possible values:
  8113. </p><dl class="table">
  8114. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  8115. <dd><p>use mbcmp (default)
  8116. </p></dd>
  8117. <dt>&lsquo;<samp class="samp">bits</samp>&rsquo;</dt>
  8118. <dd><p>use fewest bits
  8119. </p></dd>
  8120. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  8121. <dd><p>use best rate distortion
  8122. </p></dd>
  8123. </dl>
  8124. </dd>
  8125. <dt><samp class="option">rc_init_occupancy <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8126. <dd><p>Set number of bits which should be loaded into the rc buffer before
  8127. decoding starts.
  8128. </p>
  8129. </dd>
  8130. <dt><samp class="option">flags2 <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  8131. <dd>
  8132. <p>Possible values:
  8133. </p><dl class="table">
  8134. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  8135. <dd><p>Allow non spec compliant speedup tricks.
  8136. </p></dd>
  8137. <dt>&lsquo;<samp class="samp">noout</samp>&rsquo;</dt>
  8138. <dd><p>Skip bitstream encoding.
  8139. </p></dd>
  8140. <dt>&lsquo;<samp class="samp">ignorecrop</samp>&rsquo;</dt>
  8141. <dd><p>Ignore cropping information from sps.
  8142. </p></dd>
  8143. <dt>&lsquo;<samp class="samp">local_header</samp>&rsquo;</dt>
  8144. <dd><p>Place global headers at every keyframe instead of in extradata.
  8145. </p></dd>
  8146. <dt>&lsquo;<samp class="samp">chunks</samp>&rsquo;</dt>
  8147. <dd><p>Frame data might be split into multiple chunks.
  8148. </p></dd>
  8149. <dt>&lsquo;<samp class="samp">showall</samp>&rsquo;</dt>
  8150. <dd><p>Show all frames before the first keyframe.
  8151. </p></dd>
  8152. <dt>&lsquo;<samp class="samp">export_mvs</samp>&rsquo;</dt>
  8153. <dd><p>Export motion vectors into frame side-data (see <code class="code">AV_FRAME_DATA_MOTION_VECTORS</code>)
  8154. for codecs that support it. See also <samp class="file">doc/examples/export_mvs.c</samp>.
  8155. </p></dd>
  8156. <dt>&lsquo;<samp class="samp">skip_manual</samp>&rsquo;</dt>
  8157. <dd><p>Do not skip samples and export skip information as frame side data.
  8158. </p></dd>
  8159. <dt>&lsquo;<samp class="samp">ass_ro_flush_noop</samp>&rsquo;</dt>
  8160. <dd><p>Do not reset ASS ReadOrder field on flush.
  8161. </p></dd>
  8162. <dt>&lsquo;<samp class="samp">icc_profiles</samp>&rsquo;</dt>
  8163. <dd><p>Generate/parse embedded ICC profiles from/to colorimetry tags.
  8164. </p></dd>
  8165. </dl>
  8166. </dd>
  8167. <dt><samp class="option">export_side_data <var class="var">flags</var> (<em class="emph">decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  8168. <dd>
  8169. <p>Possible values:
  8170. </p><dl class="table">
  8171. <dt>&lsquo;<samp class="samp">mvs</samp>&rsquo;</dt>
  8172. <dd><p>Export motion vectors into frame side-data (see <code class="code">AV_FRAME_DATA_MOTION_VECTORS</code>)
  8173. for codecs that support it. See also <samp class="file">doc/examples/export_mvs.c</samp>.
  8174. </p></dd>
  8175. <dt>&lsquo;<samp class="samp">prft</samp>&rsquo;</dt>
  8176. <dd><p>Export encoder Producer Reference Time into packet side-data (see <code class="code">AV_PKT_DATA_PRFT</code>)
  8177. for codecs that support it.
  8178. </p></dd>
  8179. <dt>&lsquo;<samp class="samp">venc_params</samp>&rsquo;</dt>
  8180. <dd><p>Export video encoding parameters through frame side data (see <code class="code">AV_FRAME_DATA_VIDEO_ENC_PARAMS</code>)
  8181. for codecs that support it. At present, those are H.264 and VP9.
  8182. </p></dd>
  8183. <dt>&lsquo;<samp class="samp">film_grain</samp>&rsquo;</dt>
  8184. <dd><p>Export film grain parameters through frame side data (see <code class="code">AV_FRAME_DATA_FILM_GRAIN_PARAMS</code>).
  8185. Supported at present by AV1 decoders.
  8186. </p></dd>
  8187. </dl>
  8188. </dd>
  8189. <dt><samp class="option">threads <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8190. <dd><p>Set the number of threads to be used, in case the selected codec
  8191. implementation supports multi-threading.
  8192. </p>
  8193. <p>Possible values:
  8194. </p><dl class="table">
  8195. <dt>&lsquo;<samp class="samp">auto, 0</samp>&rsquo;</dt>
  8196. <dd><p>automatically select the number of threads to set
  8197. </p></dd>
  8198. </dl>
  8199. <p>Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  8200. </p>
  8201. </dd>
  8202. <dt><samp class="option">dc <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8203. <dd><p>Set intra_dc_precision.
  8204. </p>
  8205. </dd>
  8206. <dt><samp class="option">nssew <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8207. <dd><p>Set nsse weight.
  8208. </p>
  8209. </dd>
  8210. <dt><samp class="option">skip_top <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8211. <dd><p>Set number of macroblock rows at the top which are skipped.
  8212. </p>
  8213. </dd>
  8214. <dt><samp class="option">skip_bottom <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8215. <dd><p>Set number of macroblock rows at the bottom which are skipped.
  8216. </p>
  8217. </dd>
  8218. <dt><samp class="option">profile <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8219. <dd>
  8220. <p>Set encoder codec profile. Default value is &lsquo;<samp class="samp">unknown</samp>&rsquo;. Encoder specific
  8221. profiles are documented in the relevant encoder documentation.
  8222. </p>
  8223. </dd>
  8224. <dt><samp class="option">level <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8225. <dd>
  8226. <p>Set the encoder level. This level depends on the specific codec, and
  8227. might correspond to the profile level. It is set by default to
  8228. &lsquo;<samp class="samp">unknown</samp>&rsquo;.
  8229. </p>
  8230. <p>Possible values:
  8231. </p><dl class="table">
  8232. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  8233. </dl>
  8234. </dd>
  8235. <dt><samp class="option">lowres <var class="var">integer</var> (<em class="emph">decoding,audio,video</em>)</samp></dt>
  8236. <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
  8237. </p>
  8238. </dd>
  8239. <dt><samp class="option">mblmin <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8240. <dd><p>Set min macroblock lagrange factor (VBR).
  8241. </p>
  8242. </dd>
  8243. <dt><samp class="option">mblmax <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8244. <dd><p>Set max macroblock lagrange factor (VBR).
  8245. </p>
  8246. </dd>
  8247. <dt><samp class="option">skip_loop_filter <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8248. <dt><samp class="option">skip_idct <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8249. <dt><samp class="option">skip_frame <var class="var">integer</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8250. <dd>
  8251. <p>Make decoder discard processing depending on the frame type selected
  8252. by the option value.
  8253. </p>
  8254. <p><samp class="option">skip_loop_filter</samp> skips frame loop filtering, <samp class="option">skip_idct</samp>
  8255. skips frame IDCT/dequantization, <samp class="option">skip_frame</samp> skips decoding.
  8256. </p>
  8257. <p>Possible values:
  8258. </p><dl class="table">
  8259. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  8260. <dd><p>Discard no frame.
  8261. </p>
  8262. </dd>
  8263. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  8264. <dd><p>Discard useless frames like 0-sized frames.
  8265. </p>
  8266. </dd>
  8267. <dt>&lsquo;<samp class="samp">noref</samp>&rsquo;</dt>
  8268. <dd><p>Discard all non-reference frames.
  8269. </p>
  8270. </dd>
  8271. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  8272. <dd><p>Discard all bidirectional frames.
  8273. </p>
  8274. </dd>
  8275. <dt>&lsquo;<samp class="samp">nokey</samp>&rsquo;</dt>
  8276. <dd><p>Discard all frames excepts keyframes.
  8277. </p>
  8278. </dd>
  8279. <dt>&lsquo;<samp class="samp">nointra</samp>&rsquo;</dt>
  8280. <dd><p>Discard all frames except I frames.
  8281. </p>
  8282. </dd>
  8283. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  8284. <dd><p>Discard all frames.
  8285. </p></dd>
  8286. </dl>
  8287. <p>Default value is &lsquo;<samp class="samp">default</samp>&rsquo;.
  8288. </p>
  8289. </dd>
  8290. <dt><samp class="option">bidir_refine <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8291. <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
  8292. </p>
  8293. </dd>
  8294. <dt><samp class="option">keyint_min <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8295. <dd><p>Set minimum interval between IDR-frames.
  8296. </p>
  8297. </dd>
  8298. <dt><samp class="option">refs <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8299. <dd><p>Set reference frames to consider for motion compensation.
  8300. </p>
  8301. </dd>
  8302. <dt><samp class="option">trellis <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8303. <dd><p>Set rate-distortion optimal quantization.
  8304. </p>
  8305. </dd>
  8306. <dt><samp class="option">mv0_threshold <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8307. <dt><samp class="option">compression_level <var class="var">integer</var> (<em class="emph">encoding,audio,video</em>)</samp></dt>
  8308. <dt><samp class="option">bits_per_raw_sample <var class="var">integer</var></samp></dt>
  8309. <dt><samp class="option">channel_layout <var class="var">integer</var> (<em class="emph">decoding/encoding,audio</em>)</samp></dt>
  8310. <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>
  8311. for the required syntax.
  8312. </p>
  8313. </dd>
  8314. <dt><samp class="option">rc_max_vbv_use <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8315. <dt><samp class="option">rc_min_vbv_use <var class="var">float</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8316. <dt><samp class="option">color_primaries <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8317. <dd><p>Possible values:
  8318. </p><dl class="table">
  8319. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  8320. <dd><p>BT.709
  8321. </p></dd>
  8322. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  8323. <dd><p>BT.470 M
  8324. </p></dd>
  8325. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  8326. <dd><p>BT.470 BG
  8327. </p></dd>
  8328. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  8329. <dd><p>SMPTE 170 M
  8330. </p></dd>
  8331. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  8332. <dd><p>SMPTE 240 M
  8333. </p></dd>
  8334. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  8335. <dd><p>Film
  8336. </p></dd>
  8337. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  8338. <dd><p>BT.2020
  8339. </p></dd>
  8340. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  8341. <dt>&lsquo;<samp class="samp">smpte428_1</samp>&rsquo;</dt>
  8342. <dd><p>SMPTE ST 428-1
  8343. </p></dd>
  8344. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  8345. <dd><p>SMPTE 431-2
  8346. </p></dd>
  8347. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  8348. <dd><p>SMPTE 432-1
  8349. </p></dd>
  8350. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  8351. <dd><p>JEDEC P22
  8352. </p></dd>
  8353. </dl>
  8354. </dd>
  8355. <dt><samp class="option">color_trc <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8356. <dd><p>Possible values:
  8357. </p><dl class="table">
  8358. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  8359. <dd><p>BT.709
  8360. </p></dd>
  8361. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  8362. <dd><p>BT.470 M
  8363. </p></dd>
  8364. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  8365. <dd><p>BT.470 BG
  8366. </p></dd>
  8367. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  8368. <dd><p>SMPTE 170 M
  8369. </p></dd>
  8370. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  8371. <dd><p>SMPTE 240 M
  8372. </p></dd>
  8373. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  8374. <dd><p>Linear
  8375. </p></dd>
  8376. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  8377. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  8378. <dd><p>Log
  8379. </p></dd>
  8380. <dt>&lsquo;<samp class="samp">log_sqrt</samp>&rsquo;</dt>
  8381. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  8382. <dd><p>Log square root
  8383. </p></dd>
  8384. <dt>&lsquo;<samp class="samp">iec61966_2_4</samp>&rsquo;</dt>
  8385. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  8386. <dd><p>IEC 61966-2-4
  8387. </p></dd>
  8388. <dt>&lsquo;<samp class="samp">bt1361</samp>&rsquo;</dt>
  8389. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  8390. <dd><p>BT.1361
  8391. </p></dd>
  8392. <dt>&lsquo;<samp class="samp">iec61966_2_1</samp>&rsquo;</dt>
  8393. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  8394. <dd><p>IEC 61966-2-1
  8395. </p></dd>
  8396. <dt>&lsquo;<samp class="samp">bt2020_10</samp>&rsquo;</dt>
  8397. <dt>&lsquo;<samp class="samp">bt2020_10bit</samp>&rsquo;</dt>
  8398. <dd><p>BT.2020 - 10 bit
  8399. </p></dd>
  8400. <dt>&lsquo;<samp class="samp">bt2020_12</samp>&rsquo;</dt>
  8401. <dt>&lsquo;<samp class="samp">bt2020_12bit</samp>&rsquo;</dt>
  8402. <dd><p>BT.2020 - 12 bit
  8403. </p></dd>
  8404. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  8405. <dd><p>SMPTE ST 2084
  8406. </p></dd>
  8407. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  8408. <dt>&lsquo;<samp class="samp">smpte428_1</samp>&rsquo;</dt>
  8409. <dd><p>SMPTE ST 428-1
  8410. </p></dd>
  8411. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  8412. <dd><p>ARIB STD-B67
  8413. </p></dd>
  8414. </dl>
  8415. </dd>
  8416. <dt><samp class="option">colorspace <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8417. <dd><p>Possible values:
  8418. </p><dl class="table">
  8419. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  8420. <dd><p>RGB
  8421. </p></dd>
  8422. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  8423. <dd><p>BT.709
  8424. </p></dd>
  8425. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  8426. <dd><p>FCC
  8427. </p></dd>
  8428. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  8429. <dd><p>BT.470 BG
  8430. </p></dd>
  8431. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  8432. <dd><p>SMPTE 170 M
  8433. </p></dd>
  8434. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  8435. <dd><p>SMPTE 240 M
  8436. </p></dd>
  8437. <dt>&lsquo;<samp class="samp">ycocg</samp>&rsquo;</dt>
  8438. <dd><p>YCOCG
  8439. </p></dd>
  8440. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  8441. <dt>&lsquo;<samp class="samp">bt2020_ncl</samp>&rsquo;</dt>
  8442. <dd><p>BT.2020 NCL
  8443. </p></dd>
  8444. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  8445. <dt>&lsquo;<samp class="samp">bt2020_cl</samp>&rsquo;</dt>
  8446. <dd><p>BT.2020 CL
  8447. </p></dd>
  8448. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  8449. <dd><p>SMPTE 2085
  8450. </p></dd>
  8451. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  8452. <dd><p>Chroma-derived NCL
  8453. </p></dd>
  8454. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  8455. <dd><p>Chroma-derived CL
  8456. </p></dd>
  8457. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  8458. <dd><p>ICtCp
  8459. </p></dd>
  8460. </dl>
  8461. </dd>
  8462. <dt><samp class="option">color_range <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8463. <dd><p>If used as input parameter, it serves as a hint to the decoder, which
  8464. color_range the input has.
  8465. Possible values:
  8466. </p><dl class="table">
  8467. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  8468. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  8469. <dt>&lsquo;<samp class="samp">limited</samp>&rsquo;</dt>
  8470. <dd><p>MPEG (219*2^(n-8))
  8471. </p></dd>
  8472. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  8473. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  8474. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  8475. <dd><p>JPEG (2^n-1)
  8476. </p></dd>
  8477. </dl>
  8478. </dd>
  8479. <dt><samp class="option">chroma_sample_location <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8480. <dd><p>Possible values:
  8481. </p><dl class="table">
  8482. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  8483. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  8484. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  8485. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  8486. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  8487. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  8488. </dl>
  8489. </dd>
  8490. <dt><samp class="option">log_level_offset <var class="var">integer</var></samp></dt>
  8491. <dd><p>Set the log level offset.
  8492. </p>
  8493. </dd>
  8494. <dt><samp class="option">slices <var class="var">integer</var> (<em class="emph">encoding,video</em>)</samp></dt>
  8495. <dd><p>Number of slices, used in parallelized encoding.
  8496. </p>
  8497. </dd>
  8498. <dt><samp class="option">thread_type <var class="var">flags</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8499. <dd><p>Select which multithreading methods to use.
  8500. </p>
  8501. <p>Use of &lsquo;<samp class="samp">frame</samp>&rsquo; will increase decoding delay by one frame per
  8502. thread, so clients which cannot provide future frames should not use
  8503. it.
  8504. </p>
  8505. <p>Possible values:
  8506. </p><dl class="table">
  8507. <dt>&lsquo;<samp class="samp">slice</samp>&rsquo;</dt>
  8508. <dd><p>Decode more than one part of a single frame at once.
  8509. </p>
  8510. <p>Multithreading using slices works only when the video was encoded with
  8511. slices.
  8512. </p>
  8513. </dd>
  8514. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  8515. <dd><p>Decode more than one frame at once.
  8516. </p></dd>
  8517. </dl>
  8518. <p>Default value is &lsquo;<samp class="samp">slice+frame</samp>&rsquo;.
  8519. </p>
  8520. </dd>
  8521. <dt><samp class="option">audio_service_type <var class="var">integer</var> (<em class="emph">encoding,audio</em>)</samp></dt>
  8522. <dd><p>Set audio service type.
  8523. </p>
  8524. <p>Possible values:
  8525. </p><dl class="table">
  8526. <dt>&lsquo;<samp class="samp">ma</samp>&rsquo;</dt>
  8527. <dd><p>Main Audio Service
  8528. </p></dd>
  8529. <dt>&lsquo;<samp class="samp">ef</samp>&rsquo;</dt>
  8530. <dd><p>Effects
  8531. </p></dd>
  8532. <dt>&lsquo;<samp class="samp">vi</samp>&rsquo;</dt>
  8533. <dd><p>Visually Impaired
  8534. </p></dd>
  8535. <dt>&lsquo;<samp class="samp">hi</samp>&rsquo;</dt>
  8536. <dd><p>Hearing Impaired
  8537. </p></dd>
  8538. <dt>&lsquo;<samp class="samp">di</samp>&rsquo;</dt>
  8539. <dd><p>Dialogue
  8540. </p></dd>
  8541. <dt>&lsquo;<samp class="samp">co</samp>&rsquo;</dt>
  8542. <dd><p>Commentary
  8543. </p></dd>
  8544. <dt>&lsquo;<samp class="samp">em</samp>&rsquo;</dt>
  8545. <dd><p>Emergency
  8546. </p></dd>
  8547. <dt>&lsquo;<samp class="samp">vo</samp>&rsquo;</dt>
  8548. <dd><p>Voice Over
  8549. </p></dd>
  8550. <dt>&lsquo;<samp class="samp">ka</samp>&rsquo;</dt>
  8551. <dd><p>Karaoke
  8552. </p></dd>
  8553. </dl>
  8554. </dd>
  8555. <dt><samp class="option">request_sample_fmt <var class="var">sample_fmt</var> (<em class="emph">decoding,audio</em>)</samp></dt>
  8556. <dd><p>Set sample format audio decoders should prefer. Default value is
  8557. <code class="code">none</code>.
  8558. </p>
  8559. </dd>
  8560. <dt><samp class="option">pkt_timebase <var class="var">rational number</var></samp></dt>
  8561. <dt><samp class="option">sub_charenc <var class="var">encoding</var> (<em class="emph">decoding,subtitles</em>)</samp></dt>
  8562. <dd><p>Set the input subtitles character encoding.
  8563. </p>
  8564. </dd>
  8565. <dt><samp class="option">field_order <var class="var">field_order</var> (<em class="emph">video</em>)</samp></dt>
  8566. <dd><p>Set/override the field order of the video.
  8567. Possible values:
  8568. </p><dl class="table">
  8569. <dt>&lsquo;<samp class="samp">progressive</samp>&rsquo;</dt>
  8570. <dd><p>Progressive video
  8571. </p></dd>
  8572. <dt>&lsquo;<samp class="samp">tt</samp>&rsquo;</dt>
  8573. <dd><p>Interlaced video, top field coded and displayed first
  8574. </p></dd>
  8575. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  8576. <dd><p>Interlaced video, bottom field coded and displayed first
  8577. </p></dd>
  8578. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  8579. <dd><p>Interlaced video, top coded first, bottom displayed first
  8580. </p></dd>
  8581. <dt>&lsquo;<samp class="samp">bt</samp>&rsquo;</dt>
  8582. <dd><p>Interlaced video, bottom coded first, top displayed first
  8583. </p></dd>
  8584. </dl>
  8585. </dd>
  8586. <dt><samp class="option">skip_alpha <var class="var">bool</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8587. <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
  8588. &lsquo;<samp class="samp">gray</samp>&rsquo; flag in the <samp class="option">flags</samp> option which skips chroma information
  8589. instead of alpha. Default is 0.
  8590. </p>
  8591. </dd>
  8592. <dt><samp class="option">codec_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  8593. <dd><p>&quot;,&quot; separated list of allowed decoders. By default all are allowed.
  8594. </p>
  8595. </dd>
  8596. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  8597. <dd><p>Separator used to separate the fields printed on the command line about the
  8598. Stream parameters.
  8599. For example, to separate the fields with newlines and indentation:
  8600. </p><div class="example">
  8601. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  8602. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  8603. </pre></div>
  8604. </dd>
  8605. <dt><samp class="option">max_pixels <var class="var">integer</var> (<em class="emph">decoding/encoding,video</em>)</samp></dt>
  8606. <dd><p>Maximum number of pixels per image. This value can be used to avoid out of
  8607. memory failures due to large images.
  8608. </p>
  8609. </dd>
  8610. <dt><samp class="option">apply_cropping <var class="var">bool</var> (<em class="emph">decoding,video</em>)</samp></dt>
  8611. <dd><p>Enable cropping if cropping parameters are multiples of the required
  8612. alignment for the left and top parameters. If the alignment is not met the
  8613. cropping will be partially applied to maintain alignment.
  8614. Default is 1 (enabled).
  8615. Note: The required alignment depends on if <code class="code">AV_CODEC_FLAG_UNALIGNED</code> is set and the
  8616. CPU. <code class="code">AV_CODEC_FLAG_UNALIGNED</code> cannot be changed from the command line. Also hardware
  8617. decoders will not apply left/top Cropping.
  8618. </p>
  8619. </dd>
  8620. </dl>
  8621. </div>
  8622. <div class="chapter-level-extent" id="Decoders">
  8623. <h2 class="chapter"><span>10 Decoders<a class="copiable-link" href="#Decoders"> &para;</a></span></h2>
  8624. <p>Decoders are configured elements in FFmpeg which allow the decoding of
  8625. multimedia streams.
  8626. </p>
  8627. <p>When you configure your FFmpeg build, all the supported native decoders
  8628. are enabled by default. Decoders requiring an external library must be enabled
  8629. manually via the corresponding <code class="code">--enable-lib</code> option. You can list all
  8630. available decoders using the configure option <code class="code">--list-decoders</code>.
  8631. </p>
  8632. <p>You can disable all the decoders with the configure option
  8633. <code class="code">--disable-decoders</code> and selectively enable / disable single decoders
  8634. with the options <code class="code">--enable-decoder=<var class="var">DECODER</var></code> /
  8635. <code class="code">--disable-decoder=<var class="var">DECODER</var></code>.
  8636. </p>
  8637. <p>The option <code class="code">-decoders</code> of the ff* tools will display the list of
  8638. enabled decoders.
  8639. </p>
  8640. </div>
  8641. <div class="chapter-level-extent" id="Video-Decoders">
  8642. <h2 class="chapter"><span>11 Video Decoders<a class="copiable-link" href="#Video-Decoders"> &para;</a></span></h2>
  8643. <p>A description of some of the currently available video decoders
  8644. follows.
  8645. </p>
  8646. <ul class="mini-toc">
  8647. <li><a href="#av1" accesskey="1">av1</a></li>
  8648. <li><a href="#rawvideo" accesskey="2">rawvideo</a></li>
  8649. <li><a href="#libdav1d" accesskey="3">libdav1d</a></li>
  8650. <li><a href="#libdavs2" accesskey="4">libdavs2</a></li>
  8651. <li><a href="#libuavs3d" accesskey="5">libuavs3d</a></li>
  8652. <li><a href="#libxevd" accesskey="6">libxevd</a></li>
  8653. <li><a href="#QSV-Decoders" accesskey="7">QSV Decoders</a></li>
  8654. <li><a href="#v210" accesskey="8">v210</a></li>
  8655. </ul>
  8656. <div class="section-level-extent" id="av1">
  8657. <h3 class="section"><span>11.1 av1<a class="copiable-link" href="#av1"> &para;</a></span></h3>
  8658. <p>AOMedia Video 1 (AV1) decoder.
  8659. </p>
  8660. <ul class="mini-toc">
  8661. <li><a href="#Options-1" accesskey="1">Options</a></li>
  8662. </ul>
  8663. <div class="subsection-level-extent" id="Options-1">
  8664. <h4 class="subsection"><span>11.1.1 Options<a class="copiable-link" href="#Options-1"> &para;</a></span></h4>
  8665. <dl class="table">
  8666. <dt><samp class="option">operating_point</samp></dt>
  8667. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
  8668. </p>
  8669. </dd>
  8670. </dl>
  8671. </div>
  8672. </div>
  8673. <div class="section-level-extent" id="rawvideo">
  8674. <h3 class="section"><span>11.2 rawvideo<a class="copiable-link" href="#rawvideo"> &para;</a></span></h3>
  8675. <p>Raw video decoder.
  8676. </p>
  8677. <p>This decoder decodes rawvideo streams.
  8678. </p>
  8679. <ul class="mini-toc">
  8680. <li><a href="#Options-2" accesskey="1">Options</a></li>
  8681. </ul>
  8682. <div class="subsection-level-extent" id="Options-2">
  8683. <h4 class="subsection"><span>11.2.1 Options<a class="copiable-link" href="#Options-2"> &para;</a></span></h4>
  8684. <dl class="table">
  8685. <dt><samp class="option">top <var class="var">top_field_first</var></samp></dt>
  8686. <dd><p>Specify the assumed field type of the input video.
  8687. </p><dl class="table">
  8688. <dt><samp class="option">-1</samp></dt>
  8689. <dd><p>the video is assumed to be progressive (default)
  8690. </p></dd>
  8691. <dt><samp class="option">0</samp></dt>
  8692. <dd><p>bottom-field-first is assumed
  8693. </p></dd>
  8694. <dt><samp class="option">1</samp></dt>
  8695. <dd><p>top-field-first is assumed
  8696. </p></dd>
  8697. </dl>
  8698. </dd>
  8699. </dl>
  8700. </div>
  8701. </div>
  8702. <div class="section-level-extent" id="libdav1d">
  8703. <h3 class="section"><span>11.3 libdav1d<a class="copiable-link" href="#libdav1d"> &para;</a></span></h3>
  8704. <p>dav1d AV1 decoder.
  8705. </p>
  8706. <p>libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec.
  8707. Requires the presence of the libdav1d headers and library during configuration.
  8708. You need to explicitly configure the build with <code class="code">--enable-libdav1d</code>.
  8709. </p>
  8710. <ul class="mini-toc">
  8711. <li><a href="#Options-3" accesskey="1">Options</a></li>
  8712. </ul>
  8713. <div class="subsection-level-extent" id="Options-3">
  8714. <h4 class="subsection"><span>11.3.1 Options<a class="copiable-link" href="#Options-3"> &para;</a></span></h4>
  8715. <p>The following options are supported by the libdav1d wrapper.
  8716. </p>
  8717. <dl class="table">
  8718. <dt><samp class="option">framethreads</samp></dt>
  8719. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  8720. This option is deprecated for libdav1d &gt;= 1.0 and will be removed in the future. Use the
  8721. option <code class="code">max_frame_delay</code> and the global option <code class="code">threads</code> instead.
  8722. </p>
  8723. </dd>
  8724. <dt><samp class="option">tilethreads</samp></dt>
  8725. <dd><p>Set amount of tile threads to use during decoding. The default value is 0 (autodetect).
  8726. This option is deprecated for libdav1d &gt;= 1.0 and will be removed in the future. Use the
  8727. global option <code class="code">threads</code> instead.
  8728. </p>
  8729. </dd>
  8730. <dt><samp class="option">max_frame_delay</samp></dt>
  8731. <dd><p>Set max amount of frames the decoder may buffer internally. The default value is 0
  8732. (autodetect).
  8733. </p>
  8734. </dd>
  8735. <dt><samp class="option">filmgrain</samp></dt>
  8736. <dd><p>Apply film grain to the decoded video if present in the bitstream. Defaults to the
  8737. internal default of the library.
  8738. This option is deprecated and will be removed in the future. See the global option
  8739. <code class="code">export_side_data</code> to export Film Grain parameters instead of applying it.
  8740. </p>
  8741. </dd>
  8742. <dt><samp class="option">oppoint</samp></dt>
  8743. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
  8744. internal default of the library.
  8745. </p>
  8746. </dd>
  8747. <dt><samp class="option">alllayers</samp></dt>
  8748. <dd><p>Output all spatial layers of a scalable AV1 bitstream. The default value is false.
  8749. </p>
  8750. </dd>
  8751. </dl>
  8752. </div>
  8753. </div>
  8754. <div class="section-level-extent" id="libdavs2">
  8755. <h3 class="section"><span>11.4 libdavs2<a class="copiable-link" href="#libdavs2"> &para;</a></span></h3>
  8756. <p>AVS2-P2/IEEE1857.4 video decoder wrapper.
  8757. </p>
  8758. <p>This decoder allows libavcodec to decode AVS2 streams with davs2 library.
  8759. </p>
  8760. </div>
  8761. <div class="section-level-extent" id="libuavs3d">
  8762. <h3 class="section"><span>11.5 libuavs3d<a class="copiable-link" href="#libuavs3d"> &para;</a></span></h3>
  8763. <p>AVS3-P2/IEEE1857.10 video decoder.
  8764. </p>
  8765. <p>libuavs3d allows libavcodec to decode AVS3 streams.
  8766. Requires the presence of the libuavs3d headers and library during configuration.
  8767. You need to explicitly configure the build with <code class="code">--enable-libuavs3d</code>.
  8768. </p>
  8769. <ul class="mini-toc">
  8770. <li><a href="#Options-4" accesskey="1">Options</a></li>
  8771. </ul>
  8772. <div class="subsection-level-extent" id="Options-4">
  8773. <h4 class="subsection"><span>11.5.1 Options<a class="copiable-link" href="#Options-4"> &para;</a></span></h4>
  8774. <p>The following option is supported by the libuavs3d wrapper.
  8775. </p>
  8776. <dl class="table">
  8777. <dt><samp class="option">frame_threads</samp></dt>
  8778. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  8779. </p>
  8780. </dd>
  8781. </dl>
  8782. </div>
  8783. </div>
  8784. <div class="section-level-extent" id="libxevd">
  8785. <h3 class="section"><span>11.6 libxevd<a class="copiable-link" href="#libxevd"> &para;</a></span></h3>
  8786. <p>eXtra-fast Essential Video Decoder (XEVD) MPEG-5 EVC decoder wrapper.
  8787. </p>
  8788. <p>This decoder requires the presence of the libxevd headers and library
  8789. during configuration. You need to explicitly configure the build with
  8790. <samp class="option">--enable-libxevd</samp>.
  8791. </p>
  8792. <p>The xevd project website is at <a class="url" href="https://github.com/mpeg5/xevd">https://github.com/mpeg5/xevd</a>.
  8793. </p>
  8794. <ul class="mini-toc">
  8795. <li><a href="#Options-5" accesskey="1">Options</a></li>
  8796. </ul>
  8797. <div class="subsection-level-extent" id="Options-5">
  8798. <h4 class="subsection"><span>11.6.1 Options<a class="copiable-link" href="#Options-5"> &para;</a></span></h4>
  8799. <p>The following options are supported by the libxevd wrapper.
  8800. The xevd-equivalent options or values are listed in parentheses for easy migration.
  8801. </p>
  8802. <p>To get a more accurate and extensive documentation of the libxevd options,
  8803. invoke the command <code class="code">xevd_app --help</code> or consult the libxevd documentation.
  8804. </p>
  8805. <dl class="table">
  8806. <dt><samp class="option">threads (<em class="emph">threads</em>)</samp></dt>
  8807. <dd><p>Force to use a specific number of threads
  8808. </p>
  8809. </dd>
  8810. </dl>
  8811. </div>
  8812. </div>
  8813. <div class="section-level-extent" id="QSV-Decoders">
  8814. <h3 class="section"><span>11.7 QSV Decoders<a class="copiable-link" href="#QSV-Decoders"> &para;</a></span></h3>
  8815. <p>The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
  8816. JPEG/MJPEG, VP8, VP9, AV1).
  8817. </p>
  8818. <ul class="mini-toc">
  8819. <li><a href="#Common-Options" accesskey="1">Common Options</a></li>
  8820. <li><a href="#HEVC-Options" accesskey="2">HEVC Options</a></li>
  8821. </ul>
  8822. <div class="subsection-level-extent" id="Common-Options">
  8823. <h4 class="subsection"><span>11.7.1 Common Options<a class="copiable-link" href="#Common-Options"> &para;</a></span></h4>
  8824. <p>The following options are supported by all qsv decoders.
  8825. </p>
  8826. <dl class="table">
  8827. <dt><samp class="option"><var class="var">async_depth</var></samp></dt>
  8828. <dd><p>Internal parallelization depth, the higher the value the higher the latency.
  8829. </p>
  8830. </dd>
  8831. <dt><samp class="option"><var class="var">gpu_copy</var></samp></dt>
  8832. <dd><p>A GPU-accelerated copy between video and system memory
  8833. </p><dl class="table">
  8834. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  8835. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  8836. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  8837. </dl>
  8838. </dd>
  8839. </dl>
  8840. </div>
  8841. <div class="subsection-level-extent" id="HEVC-Options">
  8842. <h4 class="subsection"><span>11.7.2 HEVC Options<a class="copiable-link" href="#HEVC-Options"> &para;</a></span></h4>
  8843. <p>Extra options for hevc_qsv.
  8844. </p>
  8845. <dl class="table">
  8846. <dt><samp class="option"><var class="var">load_plugin</var></samp></dt>
  8847. <dd><p>A user plugin to load in an internal session
  8848. </p><dl class="table">
  8849. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  8850. <dt>&lsquo;<samp class="samp">hevc_sw</samp>&rsquo;</dt>
  8851. <dt>&lsquo;<samp class="samp">hevc_hw</samp>&rsquo;</dt>
  8852. </dl>
  8853. </dd>
  8854. <dt><samp class="option"><var class="var">load_plugins</var></samp></dt>
  8855. <dd><p>A :-separate list of hexadecimal plugin UIDs to load in an internal session
  8856. </p>
  8857. </dd>
  8858. </dl>
  8859. </div>
  8860. </div>
  8861. <div class="section-level-extent" id="v210">
  8862. <h3 class="section"><span>11.8 v210<a class="copiable-link" href="#v210"> &para;</a></span></h3>
  8863. <p>Uncompressed 4:2:2 10-bit decoder.
  8864. </p>
  8865. <ul class="mini-toc">
  8866. <li><a href="#Options-6" accesskey="1">Options</a></li>
  8867. </ul>
  8868. <div class="subsection-level-extent" id="Options-6">
  8869. <h4 class="subsection"><span>11.8.1 Options<a class="copiable-link" href="#Options-6"> &para;</a></span></h4>
  8870. <dl class="table">
  8871. <dt><samp class="option">custom_stride</samp></dt>
  8872. <dd><p>Set the line size of the v210 data in bytes. The default value is 0
  8873. (autodetect). You can use the special -1 value for a strideless v210 as seen in
  8874. BOXX files.
  8875. </p>
  8876. </dd>
  8877. </dl>
  8878. </div>
  8879. </div>
  8880. </div>
  8881. <div class="chapter-level-extent" id="Audio-Decoders">
  8882. <h2 class="chapter"><span>12 Audio Decoders<a class="copiable-link" href="#Audio-Decoders"> &para;</a></span></h2>
  8883. <p>A description of some of the currently available audio decoders
  8884. follows.
  8885. </p>
  8886. <ul class="mini-toc">
  8887. <li><a href="#ac3" accesskey="1">ac3</a></li>
  8888. <li><a href="#flac-1" accesskey="2">flac</a></li>
  8889. <li><a href="#ffwavesynth" accesskey="3">ffwavesynth</a></li>
  8890. <li><a href="#libcelt" accesskey="4">libcelt</a></li>
  8891. <li><a href="#libgsm" accesskey="5">libgsm</a></li>
  8892. <li><a href="#libilbc" accesskey="6">libilbc</a></li>
  8893. <li><a href="#libopencore_002damrnb" accesskey="7">libopencore-amrnb</a></li>
  8894. <li><a href="#libopencore_002damrwb" accesskey="8">libopencore-amrwb</a></li>
  8895. <li><a href="#libopus" accesskey="9">libopus</a></li>
  8896. </ul>
  8897. <div class="section-level-extent" id="ac3">
  8898. <h3 class="section"><span>12.1 ac3<a class="copiable-link" href="#ac3"> &para;</a></span></h3>
  8899. <p>AC-3 audio decoder.
  8900. </p>
  8901. <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  8902. the undocumented RealAudio 3 (a.k.a. dnet).
  8903. </p>
  8904. <ul class="mini-toc">
  8905. <li><a href="#AC_002d3-Decoder-Options" accesskey="1">AC-3 Decoder Options</a></li>
  8906. </ul>
  8907. <div class="subsection-level-extent" id="AC_002d3-Decoder-Options">
  8908. <h4 class="subsection"><span>12.1.1 AC-3 Decoder Options<a class="copiable-link" href="#AC_002d3-Decoder-Options"> &para;</a></span></h4>
  8909. <dl class="table">
  8910. <dt><samp class="option">-drc_scale <var class="var">value</var></samp></dt>
  8911. <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
  8912. from the AC-3 stream. This factor is applied exponentially. The default value is 1.
  8913. There are 3 notable scale factor ranges:
  8914. </p><dl class="table">
  8915. <dt><samp class="option">drc_scale == 0</samp></dt>
  8916. <dd><p>DRC disabled. Produces full range audio.
  8917. </p></dd>
  8918. <dt><samp class="option">0 &lt; drc_scale &lt;= 1</samp></dt>
  8919. <dd><p>DRC enabled. Applies a fraction of the stream DRC value.
  8920. Audio reproduction is between full range and full compression.
  8921. </p></dd>
  8922. <dt><samp class="option">drc_scale &gt; 1</samp></dt>
  8923. <dd><p>DRC enabled. Applies drc_scale asymmetrically.
  8924. Loud sounds are fully compressed. Soft sounds are enhanced.
  8925. </p></dd>
  8926. </dl>
  8927. </dd>
  8928. </dl>
  8929. </div>
  8930. </div>
  8931. <div class="section-level-extent" id="flac-1">
  8932. <h3 class="section"><span>12.2 flac<a class="copiable-link" href="#flac-1"> &para;</a></span></h3>
  8933. <p>FLAC audio decoder.
  8934. </p>
  8935. <p>This decoder aims to implement the complete FLAC specification from Xiph.
  8936. </p>
  8937. <ul class="mini-toc">
  8938. <li><a href="#FLAC-Decoder-options" accesskey="1">FLAC Decoder options</a></li>
  8939. </ul>
  8940. <div class="subsection-level-extent" id="FLAC-Decoder-options">
  8941. <h4 class="subsection"><span>12.2.1 FLAC Decoder options<a class="copiable-link" href="#FLAC-Decoder-options"> &para;</a></span></h4>
  8942. <dl class="table">
  8943. <dt><samp class="option">-use_buggy_lpc</samp></dt>
  8944. <dd><p>The lavc FLAC encoder used to produce buggy streams with high lpc values
  8945. (like the default value). This option makes it possible to decode such streams
  8946. correctly by using lavc&rsquo;s old buggy lpc logic for decoding.
  8947. </p>
  8948. </dd>
  8949. </dl>
  8950. </div>
  8951. </div>
  8952. <div class="section-level-extent" id="ffwavesynth">
  8953. <h3 class="section"><span>12.3 ffwavesynth<a class="copiable-link" href="#ffwavesynth"> &para;</a></span></h3>
  8954. <p>Internal wave synthesizer.
  8955. </p>
  8956. <p>This decoder generates wave patterns according to predefined sequences. Its
  8957. use is purely internal and the format of the data it accepts is not publicly
  8958. documented.
  8959. </p>
  8960. </div>
  8961. <div class="section-level-extent" id="libcelt">
  8962. <h3 class="section"><span>12.4 libcelt<a class="copiable-link" href="#libcelt"> &para;</a></span></h3>
  8963. <p>libcelt decoder wrapper.
  8964. </p>
  8965. <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
  8966. Requires the presence of the libcelt headers and library during configuration.
  8967. You need to explicitly configure the build with <code class="code">--enable-libcelt</code>.
  8968. </p>
  8969. </div>
  8970. <div class="section-level-extent" id="libgsm">
  8971. <h3 class="section"><span>12.5 libgsm<a class="copiable-link" href="#libgsm"> &para;</a></span></h3>
  8972. <p>libgsm decoder wrapper.
  8973. </p>
  8974. <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
  8975. the presence of the libgsm headers and library during configuration. You need
  8976. to explicitly configure the build with <code class="code">--enable-libgsm</code>.
  8977. </p>
  8978. <p>This decoder supports both the ordinary GSM and the Microsoft variant.
  8979. </p>
  8980. </div>
  8981. <div class="section-level-extent" id="libilbc">
  8982. <h3 class="section"><span>12.6 libilbc<a class="copiable-link" href="#libilbc"> &para;</a></span></h3>
  8983. <p>libilbc decoder wrapper.
  8984. </p>
  8985. <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
  8986. audio codec. Requires the presence of the libilbc headers and library during
  8987. configuration. You need to explicitly configure the build with
  8988. <code class="code">--enable-libilbc</code>.
  8989. </p>
  8990. <ul class="mini-toc">
  8991. <li><a href="#Options-7" accesskey="1">Options</a></li>
  8992. </ul>
  8993. <div class="subsection-level-extent" id="Options-7">
  8994. <h4 class="subsection"><span>12.6.1 Options<a class="copiable-link" href="#Options-7"> &para;</a></span></h4>
  8995. <p>The following option is supported by the libilbc wrapper.
  8996. </p>
  8997. <dl class="table">
  8998. <dt><samp class="option">enhance</samp></dt>
  8999. <dd>
  9000. <p>Enable the enhancement of the decoded audio when set to 1. The default
  9001. value is 0 (disabled).
  9002. </p>
  9003. </dd>
  9004. </dl>
  9005. </div>
  9006. </div>
  9007. <div class="section-level-extent" id="libopencore_002damrnb">
  9008. <h3 class="section"><span>12.7 libopencore-amrnb<a class="copiable-link" href="#libopencore_002damrnb"> &para;</a></span></h3>
  9009. <p>libopencore-amrnb decoder wrapper.
  9010. </p>
  9011. <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
  9012. Narrowband audio codec. Using it requires the presence of the
  9013. libopencore-amrnb headers and library during configuration. You need to
  9014. explicitly configure the build with <code class="code">--enable-libopencore-amrnb</code>.
  9015. </p>
  9016. <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
  9017. without this library.
  9018. </p>
  9019. </div>
  9020. <div class="section-level-extent" id="libopencore_002damrwb">
  9021. <h3 class="section"><span>12.8 libopencore-amrwb<a class="copiable-link" href="#libopencore_002damrwb"> &para;</a></span></h3>
  9022. <p>libopencore-amrwb decoder wrapper.
  9023. </p>
  9024. <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
  9025. Wideband audio codec. Using it requires the presence of the
  9026. libopencore-amrwb headers and library during configuration. You need to
  9027. explicitly configure the build with <code class="code">--enable-libopencore-amrwb</code>.
  9028. </p>
  9029. <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
  9030. without this library.
  9031. </p>
  9032. </div>
  9033. <div class="section-level-extent" id="libopus">
  9034. <h3 class="section"><span>12.9 libopus<a class="copiable-link" href="#libopus"> &para;</a></span></h3>
  9035. <p>libopus decoder wrapper.
  9036. </p>
  9037. <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
  9038. Requires the presence of the libopus headers and library during
  9039. configuration. You need to explicitly configure the build with
  9040. <code class="code">--enable-libopus</code>.
  9041. </p>
  9042. <p>An FFmpeg native decoder for Opus exists, so users can decode Opus
  9043. without this library.
  9044. </p>
  9045. </div>
  9046. </div>
  9047. <div class="chapter-level-extent" id="Subtitles-Decoders">
  9048. <h2 class="chapter"><span>13 Subtitles Decoders<a class="copiable-link" href="#Subtitles-Decoders"> &para;</a></span></h2>
  9049. <ul class="mini-toc">
  9050. <li><a href="#libaribb24" accesskey="1">libaribb24</a></li>
  9051. <li><a href="#libaribcaption" accesskey="2">libaribcaption</a></li>
  9052. <li><a href="#dvbsub" accesskey="3">dvbsub</a></li>
  9053. <li><a href="#dvdsub" accesskey="4">dvdsub</a></li>
  9054. <li><a href="#libzvbi_002dteletext" accesskey="5">libzvbi-teletext</a></li>
  9055. </ul>
  9056. <div class="section-level-extent" id="libaribb24">
  9057. <h3 class="section"><span>13.1 libaribb24<a class="copiable-link" href="#libaribb24"> &para;</a></span></h3>
  9058. <p>ARIB STD-B24 caption decoder.
  9059. </p>
  9060. <p>Implements profiles A and C of the ARIB STD-B24 standard.
  9061. </p>
  9062. <ul class="mini-toc">
  9063. <li><a href="#libaribb24-Decoder-Options" accesskey="1">libaribb24 Decoder Options</a></li>
  9064. </ul>
  9065. <div class="subsection-level-extent" id="libaribb24-Decoder-Options">
  9066. <h4 class="subsection"><span>13.1.1 libaribb24 Decoder Options<a class="copiable-link" href="#libaribb24-Decoder-Options"> &para;</a></span></h4>
  9067. <dl class="table">
  9068. <dt><samp class="option">-aribb24-base-path <var class="var">path</var></samp></dt>
  9069. <dd><p>Sets the base path for the libaribb24 library. This is utilized for reading of
  9070. configuration files (for custom unicode conversions), and for dumping of
  9071. non-text symbols as images under that location.
  9072. </p>
  9073. <p>Unset by default.
  9074. </p>
  9075. </dd>
  9076. <dt><samp class="option">-aribb24-skip-ruby-text <var class="var">boolean</var></samp></dt>
  9077. <dd><p>Tells the decoder wrapper to skip text blocks that contain half-height ruby
  9078. text.
  9079. </p>
  9080. <p>Enabled by default.
  9081. </p>
  9082. </dd>
  9083. </dl>
  9084. </div>
  9085. </div>
  9086. <div class="section-level-extent" id="libaribcaption">
  9087. <h3 class="section"><span>13.2 libaribcaption<a class="copiable-link" href="#libaribcaption"> &para;</a></span></h3>
  9088. <p>Yet another ARIB STD-B24 caption decoder using external <em class="dfn">libaribcaption</em>
  9089. library.
  9090. </p>
  9091. <p>Implements profiles A and C of the Japanse ARIB STD-B24 standard,
  9092. Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T.
  9093. </p>
  9094. <p>Requires the presence of the libaribcaption headers and library
  9095. (<a class="url" href="https://github.com/xqq/libaribcaption">https://github.com/xqq/libaribcaption</a>) during configuration.
  9096. You need to explicitly configure the build with <code class="code">--enable-libaribcaption</code>.
  9097. If both <em class="dfn">libaribb24</em> and <em class="dfn">libaribcaption</em> are enabled, <em class="dfn">libaribcaption</em>
  9098. decoder precedes.
  9099. </p>
  9100. <ul class="mini-toc">
  9101. <li><a href="#libaribcaption-Decoder-Options" accesskey="1">libaribcaption Decoder Options</a></li>
  9102. <li><a href="#libaribcaption-decoder-usage-examples" accesskey="2">libaribcaption decoder usage examples</a></li>
  9103. </ul>
  9104. <div class="subsection-level-extent" id="libaribcaption-Decoder-Options">
  9105. <h4 class="subsection"><span>13.2.1 libaribcaption Decoder Options<a class="copiable-link" href="#libaribcaption-Decoder-Options"> &para;</a></span></h4>
  9106. <dl class="table">
  9107. <dt><samp class="option">-sub_type <var class="var">subtitle_type</var></samp></dt>
  9108. <dd><p>Specifies the format of the decoded subtitles.
  9109. </p>
  9110. <dl class="table">
  9111. <dt>&lsquo;<samp class="samp">bitmap</samp>&rsquo;</dt>
  9112. <dd><p>Graphical image.
  9113. </p></dd>
  9114. <dt>&lsquo;<samp class="samp">ass</samp>&rsquo;</dt>
  9115. <dd><p>ASS formatted text.
  9116. </p></dd>
  9117. <dt>&lsquo;<samp class="samp">text</samp>&rsquo;</dt>
  9118. <dd><p>Simple text based output without formatting.
  9119. </p></dd>
  9120. </dl>
  9121. <p>The default is <em class="dfn">ass</em> as same as <em class="dfn">libaribb24</em> decoder.
  9122. Some present players (e.g., <em class="dfn">mpv</em>) expect ASS format for ARIB caption.
  9123. </p>
  9124. </dd>
  9125. <dt><samp class="option">-caption_encoding <var class="var">encoding_scheme</var></samp></dt>
  9126. <dd><p>Specifies the encoding scheme of input subtitle text.
  9127. </p>
  9128. <dl class="table">
  9129. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  9130. <dd><p>Automatically detect text encoding (default).
  9131. </p></dd>
  9132. <dt>&lsquo;<samp class="samp">jis</samp>&rsquo;</dt>
  9133. <dd><p>8bit-char JIS encoding defined in ARIB STD B24.
  9134. This encoding used in Japan for ISDB captions.
  9135. </p></dd>
  9136. <dt>&lsquo;<samp class="samp">utf8</samp>&rsquo;</dt>
  9137. <dd><p>UTF-8 encoding defined in ARIB STD B24.
  9138. This encoding is used in Philippines for ISDB-T captions.
  9139. </p></dd>
  9140. <dt>&lsquo;<samp class="samp">latin</samp>&rsquo;</dt>
  9141. <dd><p>Latin character encoding defined in ABNT NBR 15606-1.
  9142. This encoding is used in South America for SBTVD / ISDB-Tb captions.
  9143. </p></dd>
  9144. </dl>
  9145. </dd>
  9146. <dt><samp class="option">-font <var class="var">font_name[,font_name2,...]</var></samp></dt>
  9147. <dd><p>Specify comma-separated list of font family names to be used for <em class="dfn">bitmap</em>
  9148. or <em class="dfn">ass</em> type subtitle rendering.
  9149. Only first font name is used for <em class="dfn">ass</em> type subtitle.
  9150. </p>
  9151. <p>If not specified, use internaly defined default font family.
  9152. </p>
  9153. </dd>
  9154. <dt><samp class="option">-ass_single_rect <var class="var">boolean</var></samp></dt>
  9155. <dd><p>ARIB STD-B24 specifies that some captions may be displayed at different
  9156. positions at a time (multi-rectangle subtitle).
  9157. Since some players (e.g., old <em class="dfn">mpv</em>) can&rsquo;t handle multiple ASS rectangles
  9158. in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration
  9159. with the same start timestamp, this option can change the behavior so that
  9160. all the texts are displayed in a single ASS rectangle.
  9161. </p>
  9162. <p>The default is <var class="var">false</var>.
  9163. </p>
  9164. <p>If your player cannot handle AVSubtitles with multiple ASS rectangles properly,
  9165. set this option to <var class="var">true</var> or define <code class="env">ASS_SINGLE_RECT=1</code> to change
  9166. default behavior at compilation.
  9167. </p>
  9168. </dd>
  9169. <dt><samp class="option">-force_outline_text <var class="var">boolean</var></samp></dt>
  9170. <dd><p>Specify whether always render outline text for all characters regardless of
  9171. the indication by charactor style.
  9172. </p>
  9173. <p>The default is <var class="var">false</var>.
  9174. </p>
  9175. </dd>
  9176. <dt><samp class="option">-outline_width <var class="var">number</var> (0.0 - 3.0)</samp></dt>
  9177. <dd><p>Specify width for outline text, in dots (relative).
  9178. </p>
  9179. <p>The default is <var class="var">1.5</var>.
  9180. </p>
  9181. </dd>
  9182. <dt><samp class="option">-ignore_background <var class="var">boolean</var></samp></dt>
  9183. <dd><p>Specify whether to ignore background color rendering.
  9184. </p>
  9185. <p>The default is <var class="var">false</var>.
  9186. </p>
  9187. </dd>
  9188. <dt><samp class="option">-ignore_ruby <var class="var">boolean</var></samp></dt>
  9189. <dd><p>Specify whether to ignore rendering for ruby-like (furigana) characters.
  9190. </p>
  9191. <p>The default is <var class="var">false</var>.
  9192. </p>
  9193. </dd>
  9194. <dt><samp class="option">-replace_drcs <var class="var">boolean</var></samp></dt>
  9195. <dd><p>Specify whether to render replaced DRCS characters as Unicode characters.
  9196. </p>
  9197. <p>The default is <var class="var">true</var>.
  9198. </p>
  9199. </dd>
  9200. <dt><samp class="option">-replace_msz_ascii <var class="var">boolean</var></samp></dt>
  9201. <dd><p>Specify whether to replace MSZ (Middle Size; half width) fullwidth
  9202. alphanumerics with halfwidth alphanumerics.
  9203. </p>
  9204. <p>The default is <var class="var">true</var>.
  9205. </p>
  9206. </dd>
  9207. <dt><samp class="option">-replace_msz_japanese <var class="var">boolean</var></samp></dt>
  9208. <dd><p>Specify whether to replace some MSZ (Middle Size; half width) fullwidth
  9209. japanese special characters with halfwidth ones.
  9210. </p>
  9211. <p>The default is <var class="var">true</var>.
  9212. </p>
  9213. </dd>
  9214. <dt><samp class="option">-replace_msz_glyph <var class="var">boolean</var></samp></dt>
  9215. <dd><p>Specify whether to replace MSZ (Middle Size; half width) characters
  9216. with halfwidth glyphs if the fonts supports it.
  9217. This option works under FreeType or DirectWrite renderer
  9218. with Adobe-Japan1 compliant fonts.
  9219. e.g., IBM Plex Sans JP, Morisawa BIZ UDGothic, Morisawa BIZ UDMincho,
  9220. Yu Gothic, Yu Mincho, and Meiryo.
  9221. </p>
  9222. <p>The default is <var class="var">true</var>.
  9223. </p>
  9224. </dd>
  9225. <dt><samp class="option">-canvas_size <var class="var">image_size</var></samp></dt>
  9226. <dd><p>Specify the resolution of the canvas to render subtitles to; usually, this
  9227. should be frame size of input video.
  9228. This only applies when <code class="code">-subtitle_type</code> is set to <var class="var">bitmap</var>.
  9229. </p>
  9230. <p>The libaribcaption decoder assumes input frame size for bitmap rendering as below:
  9231. </p><ol class="enumerate">
  9232. <li> PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3
  9233. </li><li> PROFILE_C : 320 x 180 with SAR (PAR) 1:1
  9234. </li></ol>
  9235. <p>If actual frame size of input video does not match above assumption,
  9236. the rendered captions may be distorted.
  9237. To make the captions undistorted, add <code class="code">-canvas_size</code> option to specify
  9238. actual input video size.
  9239. </p>
  9240. <p>Note that the <code class="code">-canvas_size</code> option is not required for video with
  9241. different size but same aspect ratio.
  9242. In such cases, the caption will be stretched or shrunk to actual video size
  9243. if <code class="code">-canvas_size</code> option is not specified.
  9244. If <code class="code">-canvas_size</code> option is specified with different size,
  9245. the caption will be stretched or shrunk as specified size with calculated SAR.
  9246. </p>
  9247. </dd>
  9248. </dl>
  9249. </div>
  9250. <div class="subsection-level-extent" id="libaribcaption-decoder-usage-examples">
  9251. <h4 class="subsection"><span>13.2.2 libaribcaption decoder usage examples<a class="copiable-link" href="#libaribcaption-decoder-usage-examples"> &para;</a></span></h4>
  9252. <p>Display MPEG-TS file with ARIB subtitle by <code class="code">ffplay</code> tool:
  9253. </p><div class="example">
  9254. <pre class="example-preformatted">ffplay -sub_type bitmap MPEG.TS
  9255. </pre></div>
  9256. <p>Display MPEG-TS file with input frame size 1920x1080 by <code class="code">ffplay</code> tool:
  9257. </p><div class="example">
  9258. <pre class="example-preformatted">ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS
  9259. </pre></div>
  9260. <p>Embed ARIB subtitle in transcoded video:
  9261. </p><div class="example">
  9262. <pre class="example-preformatted">ffmpeg -sub_type bitmap -i src.m2t -filter_complex &quot;[0:v][0:s]overlay&quot; -vcodec h264 dest.mp4
  9263. </pre></div>
  9264. </div>
  9265. </div>
  9266. <div class="section-level-extent" id="dvbsub">
  9267. <h3 class="section"><span>13.3 dvbsub<a class="copiable-link" href="#dvbsub"> &para;</a></span></h3>
  9268. <ul class="mini-toc">
  9269. <li><a href="#Options-8" accesskey="1">Options</a></li>
  9270. </ul>
  9271. <div class="subsection-level-extent" id="Options-8">
  9272. <h4 class="subsection"><span>13.3.1 Options<a class="copiable-link" href="#Options-8"> &para;</a></span></h4>
  9273. <dl class="table">
  9274. <dt><samp class="option">compute_clut</samp></dt>
  9275. <dd><dl class="table">
  9276. <dt><samp class="option">-2</samp></dt>
  9277. <dd><p>Compute clut once if no matching CLUT is in the stream.
  9278. </p></dd>
  9279. <dt><samp class="option">-1</samp></dt>
  9280. <dd><p>Compute clut if no matching CLUT is in the stream.
  9281. </p></dd>
  9282. <dt><samp class="option">0</samp></dt>
  9283. <dd><p>Never compute CLUT
  9284. </p></dd>
  9285. <dt><samp class="option">1</samp></dt>
  9286. <dd><p>Always compute CLUT and override the one provided in the stream.
  9287. </p></dd>
  9288. </dl>
  9289. </dd>
  9290. <dt><samp class="option">dvb_substream</samp></dt>
  9291. <dd><p>Selects the dvb substream, or all substreams if -1 which is default.
  9292. </p>
  9293. </dd>
  9294. </dl>
  9295. </div>
  9296. </div>
  9297. <div class="section-level-extent" id="dvdsub">
  9298. <h3 class="section"><span>13.4 dvdsub<a class="copiable-link" href="#dvdsub"> &para;</a></span></h3>
  9299. <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
  9300. also be found in VobSub file pairs and in some Matroska files.
  9301. </p>
  9302. <ul class="mini-toc">
  9303. <li><a href="#Options-9" accesskey="1">Options</a></li>
  9304. </ul>
  9305. <div class="subsection-level-extent" id="Options-9">
  9306. <h4 class="subsection"><span>13.4.1 Options<a class="copiable-link" href="#Options-9"> &para;</a></span></h4>
  9307. <dl class="table">
  9308. <dt><samp class="option">palette</samp></dt>
  9309. <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
  9310. palette is normally specified in the index file; in Matroska, the palette is
  9311. stored in the codec extra-data in the same format as in VobSub. In DVDs, the
  9312. palette is stored in the IFO file, and therefore not available when reading
  9313. from dumped VOB files.
  9314. </p>
  9315. <p>The format for this option is a string containing 16 24-bits hexadecimal
  9316. numbers (without 0x prefix) separated by commas, for example <code class="code">0d00ee,
  9317. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  9318. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  9319. </p>
  9320. </dd>
  9321. <dt><samp class="option">ifo_palette</samp></dt>
  9322. <dd><p>Specify the IFO file from which the global palette is obtained.
  9323. (experimental)
  9324. </p>
  9325. </dd>
  9326. <dt><samp class="option">forced_subs_only</samp></dt>
  9327. <dd><p>Only decode subtitle entries marked as forced. Some titles have forced
  9328. and non-forced subtitles in the same track. Setting this flag to <code class="code">1</code>
  9329. will only keep the forced subtitles. Default value is <code class="code">0</code>.
  9330. </p></dd>
  9331. </dl>
  9332. </div>
  9333. </div>
  9334. <div class="section-level-extent" id="libzvbi_002dteletext">
  9335. <h3 class="section"><span>13.5 libzvbi-teletext<a class="copiable-link" href="#libzvbi_002dteletext"> &para;</a></span></h3>
  9336. <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
  9337. subtitles. Requires the presence of the libzvbi headers and library during
  9338. configuration. You need to explicitly configure the build with
  9339. <code class="code">--enable-libzvbi</code>.
  9340. </p>
  9341. <ul class="mini-toc">
  9342. <li><a href="#Options-10" accesskey="1">Options</a></li>
  9343. </ul>
  9344. <div class="subsection-level-extent" id="Options-10">
  9345. <h4 class="subsection"><span>13.5.1 Options<a class="copiable-link" href="#Options-10"> &para;</a></span></h4>
  9346. <dl class="table">
  9347. <dt><samp class="option">txt_page</samp></dt>
  9348. <dd><p>List of teletext page numbers to decode. Pages that do not match the specified
  9349. list are dropped. You may use the special <code class="code">*</code> string to match all pages,
  9350. or <code class="code">subtitle</code> to match all subtitle pages.
  9351. Default value is *.
  9352. </p></dd>
  9353. <dt><samp class="option">txt_default_region</samp></dt>
  9354. <dd><p>Set default character set used for decoding, a value between 0 and 87 (see
  9355. ETS 300 706, Section 15, Table 32). Default value is -1, which does not
  9356. override the libzvbi default. This option is needed for some legacy level 1.0
  9357. transmissions which cannot signal the proper charset.
  9358. </p></dd>
  9359. <dt><samp class="option">txt_chop_top</samp></dt>
  9360. <dd><p>Discards the top teletext line. Default value is 1.
  9361. </p></dd>
  9362. <dt><samp class="option">txt_format</samp></dt>
  9363. <dd><p>Specifies the format of the decoded subtitles.
  9364. </p><dl class="table">
  9365. <dt><samp class="option">bitmap</samp></dt>
  9366. <dd><p>The default format, you should use this for teletext pages, because certain
  9367. graphics and colors cannot be expressed in simple text or even ASS.
  9368. </p></dd>
  9369. <dt><samp class="option">text</samp></dt>
  9370. <dd><p>Simple text based output without formatting.
  9371. </p></dd>
  9372. <dt><samp class="option">ass</samp></dt>
  9373. <dd><p>Formatted ASS output, subtitle pages and teletext pages are returned in
  9374. different styles, subtitle pages are stripped down to text, but an effort is
  9375. made to keep the text alignment and the formatting.
  9376. </p></dd>
  9377. </dl>
  9378. </dd>
  9379. <dt><samp class="option">txt_left</samp></dt>
  9380. <dd><p>X offset of generated bitmaps, default is 0.
  9381. </p></dd>
  9382. <dt><samp class="option">txt_top</samp></dt>
  9383. <dd><p>Y offset of generated bitmaps, default is 0.
  9384. </p></dd>
  9385. <dt><samp class="option">txt_chop_spaces</samp></dt>
  9386. <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
  9387. text. This option is useful for teletext based subtitles where empty spaces may
  9388. be present at the start or at the end of the lines or empty lines may be
  9389. present between the subtitle lines because of double-sized teletext characters.
  9390. Default value is 1.
  9391. </p></dd>
  9392. <dt><samp class="option">txt_duration</samp></dt>
  9393. <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
  9394. milliseconds. Default value is -1 which means infinity or until the next
  9395. subtitle event comes.
  9396. </p></dd>
  9397. <dt><samp class="option">txt_transparent</samp></dt>
  9398. <dd><p>Force transparent background of the generated teletext bitmaps. Default value
  9399. is 0 which means an opaque background.
  9400. </p></dd>
  9401. <dt><samp class="option">txt_opacity</samp></dt>
  9402. <dd><p>Sets the opacity (0-255) of the teletext background. If
  9403. <samp class="option">txt_transparent</samp> is not set, it only affects characters between a start
  9404. box and an end box, typically subtitles. Default value is 0 if
  9405. <samp class="option">txt_transparent</samp> is set, 255 otherwise.
  9406. </p>
  9407. </dd>
  9408. </dl>
  9409. </div>
  9410. </div>
  9411. </div>
  9412. <div class="chapter-level-extent" id="Encoders">
  9413. <h2 class="chapter"><span>14 Encoders<a class="copiable-link" href="#Encoders"> &para;</a></span></h2>
  9414. <p>Encoders are configured elements in FFmpeg which allow the encoding of
  9415. multimedia streams.
  9416. </p>
  9417. <p>When you configure your FFmpeg build, all the supported native encoders
  9418. are enabled by default. Encoders requiring an external library must be enabled
  9419. manually via the corresponding <code class="code">--enable-lib</code> option. You can list all
  9420. available encoders using the configure option <code class="code">--list-encoders</code>.
  9421. </p>
  9422. <p>You can disable all the encoders with the configure option
  9423. <code class="code">--disable-encoders</code> and selectively enable / disable single encoders
  9424. with the options <code class="code">--enable-encoder=<var class="var">ENCODER</var></code> /
  9425. <code class="code">--disable-encoder=<var class="var">ENCODER</var></code>.
  9426. </p>
  9427. <p>The option <code class="code">-encoders</code> of the ff* tools will display the list of
  9428. enabled encoders.
  9429. </p>
  9430. </div>
  9431. <div class="chapter-level-extent" id="Audio-Encoders">
  9432. <h2 class="chapter"><span>15 Audio Encoders<a class="copiable-link" href="#Audio-Encoders"> &para;</a></span></h2>
  9433. <p>A description of some of the currently available audio encoders
  9434. follows.
  9435. </p>
  9436. <a class="anchor" id="aacenc"></a><ul class="mini-toc">
  9437. <li><a href="#aac" accesskey="1">aac</a></li>
  9438. <li><a href="#ac3-and-ac3_005ffixed" accesskey="2">ac3 and ac3_fixed</a></li>
  9439. <li><a href="#flac-2" accesskey="3">flac</a></li>
  9440. <li><a href="#opus" accesskey="4">opus</a></li>
  9441. <li><a href="#libfdk_005faac" accesskey="5">libfdk_aac</a></li>
  9442. <li><a href="#libmp3lame-1" accesskey="6">libmp3lame</a></li>
  9443. <li><a href="#libopencore_002damrnb-1" accesskey="7">libopencore-amrnb</a></li>
  9444. <li><a href="#libopus-1" accesskey="8">libopus</a></li>
  9445. <li><a href="#libshine-1" accesskey="9">libshine</a></li>
  9446. <li><a href="#libtwolame">libtwolame</a></li>
  9447. <li><a href="#libvo_002damrwbenc">libvo-amrwbenc</a></li>
  9448. <li><a href="#libvorbis">libvorbis</a></li>
  9449. <li><a href="#mjpeg">mjpeg</a></li>
  9450. <li><a href="#wavpack">wavpack</a></li>
  9451. </ul>
  9452. <div class="section-level-extent" id="aac">
  9453. <h3 class="section"><span>15.1 aac<a class="copiable-link" href="#aac"> &para;</a></span></h3>
  9454. <p>Advanced Audio Coding (AAC) encoder.
  9455. </p>
  9456. <p>This encoder is the default AAC encoder, natively implemented into FFmpeg.
  9457. </p>
  9458. <ul class="mini-toc">
  9459. <li><a href="#Options-11" accesskey="1">Options</a></li>
  9460. </ul>
  9461. <div class="subsection-level-extent" id="Options-11">
  9462. <h4 class="subsection"><span>15.1.1 Options<a class="copiable-link" href="#Options-11"> &para;</a></span></h4>
  9463. <dl class="table">
  9464. <dt><samp class="option">b</samp></dt>
  9465. <dd><p>Set bit rate in bits/s. Setting this automatically activates constant bit rate
  9466. (CBR) mode. If this option is unspecified it is set to 128kbps.
  9467. </p>
  9468. </dd>
  9469. <dt><samp class="option">q</samp></dt>
  9470. <dd><p>Set quality for variable bit rate (VBR) mode. This option is valid only using
  9471. the <code class="command">ffmpeg</code> command-line tool. For library interface users, use
  9472. <samp class="option">global_quality</samp>.
  9473. </p>
  9474. </dd>
  9475. <dt><samp class="option">cutoff</samp></dt>
  9476. <dd><p>Set cutoff frequency. If unspecified will allow the encoder to dynamically
  9477. adjust the cutoff to improve clarity on low bitrates.
  9478. </p>
  9479. </dd>
  9480. <dt><samp class="option">aac_coder</samp></dt>
  9481. <dd><p>Set AAC encoder coding method. Possible values:
  9482. </p>
  9483. <dl class="table">
  9484. <dt>&lsquo;<samp class="samp">twoloop</samp>&rsquo;</dt>
  9485. <dd><p>Two loop searching (TLS) method. This is the default method.
  9486. </p>
  9487. <p>This method first sets quantizers depending on band thresholds and then tries
  9488. to find an optimal combination by adding or subtracting a specific value from
  9489. all quantizers and adjusting some individual quantizer a little. Will tune
  9490. itself based on whether <samp class="option">aac_is</samp>, <samp class="option">aac_ms</samp> and <samp class="option">aac_pns</samp>
  9491. are enabled.
  9492. </p>
  9493. </dd>
  9494. <dt>&lsquo;<samp class="samp">anmr</samp>&rsquo;</dt>
  9495. <dd><p>Average noise to mask ratio (ANMR) trellis-based solution.
  9496. </p>
  9497. <p>This is an experimental coder which currently produces a lower quality, is more
  9498. unstable and is slower than the default twoloop coder but has potential.
  9499. Currently has no support for the <samp class="option">aac_is</samp> or <samp class="option">aac_pns</samp> options.
  9500. Not currently recommended.
  9501. </p>
  9502. </dd>
  9503. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  9504. <dd><p>Constant quantizer method.
  9505. </p>
  9506. <p>Uses a cheaper version of twoloop algorithm that doesn&rsquo;t try to do as many
  9507. clever adjustments. Worse with low bitrates (less than 64kbps), but is better
  9508. and much faster at higher bitrates.
  9509. </p>
  9510. </dd>
  9511. </dl>
  9512. </dd>
  9513. <dt><samp class="option">aac_ms</samp></dt>
  9514. <dd><p>Sets mid/side coding mode. The default value of &quot;auto&quot; will automatically use
  9515. M/S with bands which will benefit from such coding. Can be forced for all bands
  9516. using the value &quot;enable&quot;, which is mainly useful for debugging or disabled using
  9517. &quot;disable&quot;.
  9518. </p>
  9519. </dd>
  9520. <dt><samp class="option">aac_is</samp></dt>
  9521. <dd><p>Sets intensity stereo coding tool usage. By default, it&rsquo;s enabled and will
  9522. automatically toggle IS for similar pairs of stereo bands if it&rsquo;s beneficial.
  9523. Can be disabled for debugging by setting the value to &quot;disable&quot;.
  9524. </p>
  9525. </dd>
  9526. <dt><samp class="option">aac_pns</samp></dt>
  9527. <dd><p>Uses perceptual noise substitution to replace low entropy high frequency bands
  9528. with imperceptible white noise during the decoding process. By default, it&rsquo;s
  9529. enabled, but can be disabled for debugging purposes by using &quot;disable&quot;.
  9530. </p>
  9531. </dd>
  9532. <dt><samp class="option">aac_tns</samp></dt>
  9533. <dd><p>Enables the use of a multitap FIR filter which spans through the high frequency
  9534. bands to hide quantization noise during the encoding process and is reverted
  9535. by the decoder. As well as decreasing unpleasant artifacts in the high range
  9536. this also reduces the entropy in the high bands and allows for more bits to
  9537. be used by the mid-low bands. By default it&rsquo;s enabled but can be disabled for
  9538. debugging by setting the option to &quot;disable&quot;.
  9539. </p>
  9540. </dd>
  9541. <dt><samp class="option">aac_ltp</samp></dt>
  9542. <dd><p>Enables the use of the long term prediction extension which increases coding
  9543. efficiency in very low bandwidth situations such as encoding of voice or
  9544. solo piano music by extending constant harmonic peaks in bands throughout
  9545. frames. This option is implied by profile:a aac_low and is incompatible with
  9546. aac_pred. Use in conjunction with <samp class="option">-ar</samp> to decrease the samplerate.
  9547. </p>
  9548. </dd>
  9549. <dt><samp class="option">aac_pred</samp></dt>
  9550. <dd><p>Enables the use of a more traditional style of prediction where the spectral
  9551. coefficients transmitted are replaced by the difference of the current
  9552. coefficients minus the previous &quot;predicted&quot; coefficients. In theory and sometimes
  9553. in practice this can improve quality for low to mid bitrate audio.
  9554. This option implies the aac_main profile and is incompatible with aac_ltp.
  9555. </p>
  9556. </dd>
  9557. <dt><samp class="option">profile</samp></dt>
  9558. <dd><p>Sets the encoding profile, possible values:
  9559. </p>
  9560. <dl class="table">
  9561. <dt>&lsquo;<samp class="samp">aac_low</samp>&rsquo;</dt>
  9562. <dd><p>The default, AAC &quot;Low-complexity&quot; profile. Is the most compatible and produces
  9563. decent quality.
  9564. </p>
  9565. </dd>
  9566. <dt>&lsquo;<samp class="samp">mpeg2_aac_low</samp>&rsquo;</dt>
  9567. <dd><p>Equivalent to <code class="code">-profile:a aac_low -aac_pns 0</code>. PNS was introduced with the
  9568. MPEG4 specifications.
  9569. </p>
  9570. </dd>
  9571. <dt>&lsquo;<samp class="samp">aac_ltp</samp>&rsquo;</dt>
  9572. <dd><p>Long term prediction profile, is enabled by and will enable the <samp class="option">aac_ltp</samp>
  9573. option. Introduced in MPEG4.
  9574. </p>
  9575. </dd>
  9576. <dt>&lsquo;<samp class="samp">aac_main</samp>&rsquo;</dt>
  9577. <dd><p>Main-type prediction profile, is enabled by and will enable the <samp class="option">aac_pred</samp>
  9578. option. Introduced in MPEG2.
  9579. </p>
  9580. </dd>
  9581. </dl>
  9582. <p>If this option is unspecified it is set to &lsquo;<samp class="samp">aac_low</samp>&rsquo;.
  9583. </p></dd>
  9584. </dl>
  9585. </div>
  9586. </div>
  9587. <div class="section-level-extent" id="ac3-and-ac3_005ffixed">
  9588. <h3 class="section"><span>15.2 ac3 and ac3_fixed<a class="copiable-link" href="#ac3-and-ac3_005ffixed"> &para;</a></span></h3>
  9589. <p>AC-3 audio encoders.
  9590. </p>
  9591. <p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  9592. the undocumented RealAudio 3 (a.k.a. dnet).
  9593. </p>
  9594. <p>The <var class="var">ac3</var> encoder uses floating-point math, while the <var class="var">ac3_fixed</var>
  9595. encoder only uses fixed-point integer math. This does not mean that one is
  9596. always faster, just that one or the other may be better suited to a
  9597. particular system. The <var class="var">ac3_fixed</var> encoder is not the default codec for
  9598. any of the output formats, so it must be specified explicitly using the option
  9599. <code class="code">-acodec ac3_fixed</code> in order to use it.
  9600. </p>
  9601. <ul class="mini-toc">
  9602. <li><a href="#AC_002d3-Metadata" accesskey="1">AC-3 Metadata</a></li>
  9603. <li><a href="#Extended-Bitstream-Information" accesskey="2">Extended Bitstream Information</a></li>
  9604. <li><a href="#Other-AC_002d3-Encoding-Options" accesskey="3">Other AC-3 Encoding Options</a></li>
  9605. <li><a href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" accesskey="4">Floating-Point-Only AC-3 Encoding Options</a></li>
  9606. </ul>
  9607. <div class="subsection-level-extent" id="AC_002d3-Metadata">
  9608. <h4 class="subsection"><span>15.2.1 AC-3 Metadata<a class="copiable-link" href="#AC_002d3-Metadata"> &para;</a></span></h4>
  9609. <p>The AC-3 metadata options are used to set parameters that describe the audio,
  9610. but in most cases do not affect the audio encoding itself. Some of the options
  9611. do directly affect or influence the decoding and playback of the resulting
  9612. bitstream, while others are just for informational purposes. A few of the
  9613. options will add bits to the output stream that could otherwise be used for
  9614. audio data, and will thus affect the quality of the output. Those will be
  9615. indicated accordingly with a note in the option list below.
  9616. </p>
  9617. <p>These parameters are described in detail in several publicly-available
  9618. documents.
  9619. </p><ul class="itemize mark-bullet">
  9620. <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>
  9621. </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>
  9622. </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>
  9623. </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>
  9624. </li></ul>
  9625. <ul class="mini-toc">
  9626. <li><a href="#Metadata-Control-Options" accesskey="1">Metadata Control Options</a></li>
  9627. <li><a href="#Downmix-Levels" accesskey="2">Downmix Levels</a></li>
  9628. <li><a href="#Audio-Production-Information" accesskey="3">Audio Production Information</a></li>
  9629. <li><a href="#Other-Metadata-Options" accesskey="4">Other Metadata Options</a></li>
  9630. </ul>
  9631. <div class="subsubsection-level-extent" id="Metadata-Control-Options">
  9632. <h4 class="subsubsection"><span>15.2.1.1 Metadata Control Options<a class="copiable-link" href="#Metadata-Control-Options"> &para;</a></span></h4>
  9633. <dl class="table">
  9634. <dt><samp class="option">-per_frame_metadata <var class="var">boolean</var></samp></dt>
  9635. <dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  9636. metadata for each frame.
  9637. </p><dl class="table">
  9638. <dt><samp class="option">0</samp></dt>
  9639. <dd><p>The metadata values set at initialization will be used for every frame in the
  9640. stream. (default)
  9641. </p></dd>
  9642. <dt><samp class="option">1</samp></dt>
  9643. <dd><p>Metadata values can be changed before encoding each frame.
  9644. </p></dd>
  9645. </dl>
  9646. </dd>
  9647. </dl>
  9648. </div>
  9649. <div class="subsubsection-level-extent" id="Downmix-Levels">
  9650. <h4 class="subsubsection"><span>15.2.1.2 Downmix Levels<a class="copiable-link" href="#Downmix-Levels"> &para;</a></span></h4>
  9651. <dl class="table">
  9652. <dt><samp class="option">-center_mixlev <var class="var">level</var></samp></dt>
  9653. <dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
  9654. channel when downmixing to stereo. This field will only be written to the
  9655. bitstream if a center channel is present. The value is specified as a scale
  9656. factor. There are 3 valid values:
  9657. </p><dl class="table">
  9658. <dt><samp class="option">0.707</samp></dt>
  9659. <dd><p>Apply -3dB gain
  9660. </p></dd>
  9661. <dt><samp class="option">0.595</samp></dt>
  9662. <dd><p>Apply -4.5dB gain (default)
  9663. </p></dd>
  9664. <dt><samp class="option">0.500</samp></dt>
  9665. <dd><p>Apply -6dB gain
  9666. </p></dd>
  9667. </dl>
  9668. </dd>
  9669. <dt><samp class="option">-surround_mixlev <var class="var">level</var></samp></dt>
  9670. <dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
  9671. channel(s) when downmixing to stereo. This field will only be written to the
  9672. bitstream if one or more surround channels are present. The value is specified
  9673. as a scale factor. There are 3 valid values:
  9674. </p><dl class="table">
  9675. <dt><samp class="option">0.707</samp></dt>
  9676. <dd><p>Apply -3dB gain
  9677. </p></dd>
  9678. <dt><samp class="option">0.500</samp></dt>
  9679. <dd><p>Apply -6dB gain (default)
  9680. </p></dd>
  9681. <dt><samp class="option">0.000</samp></dt>
  9682. <dd><p>Silence Surround Channel(s)
  9683. </p></dd>
  9684. </dl>
  9685. </dd>
  9686. </dl>
  9687. </div>
  9688. <div class="subsubsection-level-extent" id="Audio-Production-Information">
  9689. <h4 class="subsubsection"><span>15.2.1.3 Audio Production Information<a class="copiable-link" href="#Audio-Production-Information"> &para;</a></span></h4>
  9690. <p>Audio Production Information is optional information describing the mixing
  9691. environment. Either none or both of the fields are written to the bitstream.
  9692. </p>
  9693. <dl class="table">
  9694. <dt><samp class="option">-mixing_level <var class="var">number</var></samp></dt>
  9695. <dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
  9696. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  9697. unknown or not indicated. The default value is -1, but that value cannot be
  9698. used if the Audio Production Information is written to the bitstream. Therefore,
  9699. if the <code class="code">room_type</code> option is not the default value, the <code class="code">mixing_level</code>
  9700. option must not be -1.
  9701. </p>
  9702. </dd>
  9703. <dt><samp class="option">-room_type <var class="var">type</var></samp></dt>
  9704. <dd><p>Room Type. Describes the equalization used during the final mixing session at
  9705. the studio or on the dubbing stage. A large room is a dubbing stage with the
  9706. industry standard X-curve equalization; a small room has flat equalization.
  9707. This field will not be written to the bitstream if both the <code class="code">mixing_level</code>
  9708. option and the <code class="code">room_type</code> option have the default values.
  9709. </p><dl class="table">
  9710. <dt><samp class="option">0</samp></dt>
  9711. <dt><samp class="option">notindicated</samp></dt>
  9712. <dd><p>Not Indicated (default)
  9713. </p></dd>
  9714. <dt><samp class="option">1</samp></dt>
  9715. <dt><samp class="option">large</samp></dt>
  9716. <dd><p>Large Room
  9717. </p></dd>
  9718. <dt><samp class="option">2</samp></dt>
  9719. <dt><samp class="option">small</samp></dt>
  9720. <dd><p>Small Room
  9721. </p></dd>
  9722. </dl>
  9723. </dd>
  9724. </dl>
  9725. </div>
  9726. <div class="subsubsection-level-extent" id="Other-Metadata-Options">
  9727. <h4 class="subsubsection"><span>15.2.1.4 Other Metadata Options<a class="copiable-link" href="#Other-Metadata-Options"> &para;</a></span></h4>
  9728. <dl class="table">
  9729. <dt><samp class="option">-copyright <var class="var">boolean</var></samp></dt>
  9730. <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
  9731. </p><dl class="table">
  9732. <dt><samp class="option">0</samp></dt>
  9733. <dt><samp class="option">off</samp></dt>
  9734. <dd><p>No Copyright Exists (default)
  9735. </p></dd>
  9736. <dt><samp class="option">1</samp></dt>
  9737. <dt><samp class="option">on</samp></dt>
  9738. <dd><p>Copyright Exists
  9739. </p></dd>
  9740. </dl>
  9741. </dd>
  9742. <dt><samp class="option">-dialnorm <var class="var">value</var></samp></dt>
  9743. <dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
  9744. program is below digital 100% full scale (0 dBFS). This parameter determines a
  9745. level shift during audio reproduction that sets the average volume of the
  9746. dialogue to a preset level. The goal is to match volume level between program
  9747. sources. A value of -31dB will result in no volume level change, relative to
  9748. the source volume, during audio reproduction. Valid values are whole numbers in
  9749. the range -31 to -1, with -31 being the default.
  9750. </p>
  9751. </dd>
  9752. <dt><samp class="option">-dsur_mode <var class="var">mode</var></samp></dt>
  9753. <dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  9754. (Pro Logic). This field will only be written to the bitstream if the audio
  9755. stream is stereo. Using this option does <b class="b">NOT</b> mean the encoder will actually
  9756. apply Dolby Surround processing.
  9757. </p><dl class="table">
  9758. <dt><samp class="option">0</samp></dt>
  9759. <dt><samp class="option">notindicated</samp></dt>
  9760. <dd><p>Not Indicated (default)
  9761. </p></dd>
  9762. <dt><samp class="option">1</samp></dt>
  9763. <dt><samp class="option">off</samp></dt>
  9764. <dd><p>Not Dolby Surround Encoded
  9765. </p></dd>
  9766. <dt><samp class="option">2</samp></dt>
  9767. <dt><samp class="option">on</samp></dt>
  9768. <dd><p>Dolby Surround Encoded
  9769. </p></dd>
  9770. </dl>
  9771. </dd>
  9772. <dt><samp class="option">-original <var class="var">boolean</var></samp></dt>
  9773. <dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
  9774. original source and not a copy.
  9775. </p><dl class="table">
  9776. <dt><samp class="option">0</samp></dt>
  9777. <dt><samp class="option">off</samp></dt>
  9778. <dd><p>Not Original Source
  9779. </p></dd>
  9780. <dt><samp class="option">1</samp></dt>
  9781. <dt><samp class="option">on</samp></dt>
  9782. <dd><p>Original Source (default)
  9783. </p></dd>
  9784. </dl>
  9785. </dd>
  9786. </dl>
  9787. </div>
  9788. </div>
  9789. <div class="subsection-level-extent" id="Extended-Bitstream-Information">
  9790. <h4 class="subsection"><span>15.2.2 Extended Bitstream Information<a class="copiable-link" href="#Extended-Bitstream-Information"> &para;</a></span></h4>
  9791. <p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
  9792. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  9793. If any one parameter in a group is specified, all values in that group will be
  9794. written to the bitstream. Default values are used for those that are written
  9795. but have not been specified. If the mixing levels are written, the decoder
  9796. will use these values instead of the ones specified in the <code class="code">center_mixlev</code>
  9797. and <code class="code">surround_mixlev</code> options if it supports the Alternate Bit Stream
  9798. Syntax.
  9799. </p>
  9800. <ul class="mini-toc">
  9801. <li><a href="#Extended-Bitstream-Information-_002d-Part-1" accesskey="1">Extended Bitstream Information - Part 1</a></li>
  9802. <li><a href="#Extended-Bitstream-Information-_002d-Part-2" accesskey="2">Extended Bitstream Information - Part 2</a></li>
  9803. </ul>
  9804. <div class="subsubsection-level-extent" id="Extended-Bitstream-Information-_002d-Part-1">
  9805. <h4 class="subsubsection"><span>15.2.2.1 Extended Bitstream Information - Part 1<a class="copiable-link" href="#Extended-Bitstream-Information-_002d-Part-1"> &para;</a></span></h4>
  9806. <dl class="table">
  9807. <dt><samp class="option">-dmix_mode <var class="var">mode</var></samp></dt>
  9808. <dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  9809. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  9810. </p><dl class="table">
  9811. <dt><samp class="option">0</samp></dt>
  9812. <dt><samp class="option">notindicated</samp></dt>
  9813. <dd><p>Not Indicated (default)
  9814. </p></dd>
  9815. <dt><samp class="option">1</samp></dt>
  9816. <dt><samp class="option">ltrt</samp></dt>
  9817. <dd><p>Lt/Rt Downmix Preferred
  9818. </p></dd>
  9819. <dt><samp class="option">2</samp></dt>
  9820. <dt><samp class="option">loro</samp></dt>
  9821. <dd><p>Lo/Ro Downmix Preferred
  9822. </p></dd>
  9823. </dl>
  9824. </dd>
  9825. <dt><samp class="option">-ltrt_cmixlev <var class="var">level</var></samp></dt>
  9826. <dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  9827. center channel when downmixing to stereo in Lt/Rt mode.
  9828. </p><dl class="table">
  9829. <dt><samp class="option">1.414</samp></dt>
  9830. <dd><p>Apply +3dB gain
  9831. </p></dd>
  9832. <dt><samp class="option">1.189</samp></dt>
  9833. <dd><p>Apply +1.5dB gain
  9834. </p></dd>
  9835. <dt><samp class="option">1.000</samp></dt>
  9836. <dd><p>Apply 0dB gain
  9837. </p></dd>
  9838. <dt><samp class="option">0.841</samp></dt>
  9839. <dd><p>Apply -1.5dB gain
  9840. </p></dd>
  9841. <dt><samp class="option">0.707</samp></dt>
  9842. <dd><p>Apply -3.0dB gain
  9843. </p></dd>
  9844. <dt><samp class="option">0.595</samp></dt>
  9845. <dd><p>Apply -4.5dB gain (default)
  9846. </p></dd>
  9847. <dt><samp class="option">0.500</samp></dt>
  9848. <dd><p>Apply -6.0dB gain
  9849. </p></dd>
  9850. <dt><samp class="option">0.000</samp></dt>
  9851. <dd><p>Silence Center Channel
  9852. </p></dd>
  9853. </dl>
  9854. </dd>
  9855. <dt><samp class="option">-ltrt_surmixlev <var class="var">level</var></samp></dt>
  9856. <dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  9857. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  9858. </p><dl class="table">
  9859. <dt><samp class="option">0.841</samp></dt>
  9860. <dd><p>Apply -1.5dB gain
  9861. </p></dd>
  9862. <dt><samp class="option">0.707</samp></dt>
  9863. <dd><p>Apply -3.0dB gain
  9864. </p></dd>
  9865. <dt><samp class="option">0.595</samp></dt>
  9866. <dd><p>Apply -4.5dB gain
  9867. </p></dd>
  9868. <dt><samp class="option">0.500</samp></dt>
  9869. <dd><p>Apply -6.0dB gain (default)
  9870. </p></dd>
  9871. <dt><samp class="option">0.000</samp></dt>
  9872. <dd><p>Silence Surround Channel(s)
  9873. </p></dd>
  9874. </dl>
  9875. </dd>
  9876. <dt><samp class="option">-loro_cmixlev <var class="var">level</var></samp></dt>
  9877. <dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  9878. center channel when downmixing to stereo in Lo/Ro mode.
  9879. </p><dl class="table">
  9880. <dt><samp class="option">1.414</samp></dt>
  9881. <dd><p>Apply +3dB gain
  9882. </p></dd>
  9883. <dt><samp class="option">1.189</samp></dt>
  9884. <dd><p>Apply +1.5dB gain
  9885. </p></dd>
  9886. <dt><samp class="option">1.000</samp></dt>
  9887. <dd><p>Apply 0dB gain
  9888. </p></dd>
  9889. <dt><samp class="option">0.841</samp></dt>
  9890. <dd><p>Apply -1.5dB gain
  9891. </p></dd>
  9892. <dt><samp class="option">0.707</samp></dt>
  9893. <dd><p>Apply -3.0dB gain
  9894. </p></dd>
  9895. <dt><samp class="option">0.595</samp></dt>
  9896. <dd><p>Apply -4.5dB gain (default)
  9897. </p></dd>
  9898. <dt><samp class="option">0.500</samp></dt>
  9899. <dd><p>Apply -6.0dB gain
  9900. </p></dd>
  9901. <dt><samp class="option">0.000</samp></dt>
  9902. <dd><p>Silence Center Channel
  9903. </p></dd>
  9904. </dl>
  9905. </dd>
  9906. <dt><samp class="option">-loro_surmixlev <var class="var">level</var></samp></dt>
  9907. <dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  9908. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  9909. </p><dl class="table">
  9910. <dt><samp class="option">0.841</samp></dt>
  9911. <dd><p>Apply -1.5dB gain
  9912. </p></dd>
  9913. <dt><samp class="option">0.707</samp></dt>
  9914. <dd><p>Apply -3.0dB gain
  9915. </p></dd>
  9916. <dt><samp class="option">0.595</samp></dt>
  9917. <dd><p>Apply -4.5dB gain
  9918. </p></dd>
  9919. <dt><samp class="option">0.500</samp></dt>
  9920. <dd><p>Apply -6.0dB gain (default)
  9921. </p></dd>
  9922. <dt><samp class="option">0.000</samp></dt>
  9923. <dd><p>Silence Surround Channel(s)
  9924. </p></dd>
  9925. </dl>
  9926. </dd>
  9927. </dl>
  9928. </div>
  9929. <div class="subsubsection-level-extent" id="Extended-Bitstream-Information-_002d-Part-2">
  9930. <h4 class="subsubsection"><span>15.2.2.2 Extended Bitstream Information - Part 2<a class="copiable-link" href="#Extended-Bitstream-Information-_002d-Part-2"> &para;</a></span></h4>
  9931. <dl class="table">
  9932. <dt><samp class="option">-dsurex_mode <var class="var">mode</var></samp></dt>
  9933. <dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  9934. (7.1 matrixed to 5.1). Using this option does <b class="b">NOT</b> mean the encoder will actually
  9935. apply Dolby Surround EX processing.
  9936. </p><dl class="table">
  9937. <dt><samp class="option">0</samp></dt>
  9938. <dt><samp class="option">notindicated</samp></dt>
  9939. <dd><p>Not Indicated (default)
  9940. </p></dd>
  9941. <dt><samp class="option">1</samp></dt>
  9942. <dt><samp class="option">on</samp></dt>
  9943. <dd><p>Dolby Surround EX Off
  9944. </p></dd>
  9945. <dt><samp class="option">2</samp></dt>
  9946. <dt><samp class="option">off</samp></dt>
  9947. <dd><p>Dolby Surround EX On
  9948. </p></dd>
  9949. </dl>
  9950. </dd>
  9951. <dt><samp class="option">-dheadphone_mode <var class="var">mode</var></samp></dt>
  9952. <dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  9953. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  9954. option does <b class="b">NOT</b> mean the encoder will actually apply Dolby Headphone
  9955. processing.
  9956. </p><dl class="table">
  9957. <dt><samp class="option">0</samp></dt>
  9958. <dt><samp class="option">notindicated</samp></dt>
  9959. <dd><p>Not Indicated (default)
  9960. </p></dd>
  9961. <dt><samp class="option">1</samp></dt>
  9962. <dt><samp class="option">on</samp></dt>
  9963. <dd><p>Dolby Headphone Off
  9964. </p></dd>
  9965. <dt><samp class="option">2</samp></dt>
  9966. <dt><samp class="option">off</samp></dt>
  9967. <dd><p>Dolby Headphone On
  9968. </p></dd>
  9969. </dl>
  9970. </dd>
  9971. <dt><samp class="option">-ad_conv_type <var class="var">type</var></samp></dt>
  9972. <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  9973. conversion.
  9974. </p><dl class="table">
  9975. <dt><samp class="option">0</samp></dt>
  9976. <dt><samp class="option">standard</samp></dt>
  9977. <dd><p>Standard A/D Converter (default)
  9978. </p></dd>
  9979. <dt><samp class="option">1</samp></dt>
  9980. <dt><samp class="option">hdcd</samp></dt>
  9981. <dd><p>HDCD A/D Converter
  9982. </p></dd>
  9983. </dl>
  9984. </dd>
  9985. </dl>
  9986. </div>
  9987. </div>
  9988. <div class="subsection-level-extent" id="Other-AC_002d3-Encoding-Options">
  9989. <h4 class="subsection"><span>15.2.3 Other AC-3 Encoding Options<a class="copiable-link" href="#Other-AC_002d3-Encoding-Options"> &para;</a></span></h4>
  9990. <dl class="table">
  9991. <dt><samp class="option">-stereo_rematrixing <var class="var">boolean</var></samp></dt>
  9992. <dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  9993. is an optional AC-3 feature that increases quality by selectively encoding
  9994. the left/right channels as mid/side. This option is enabled by default, and it
  9995. is highly recommended that it be left as enabled except for testing purposes.
  9996. </p>
  9997. </dd>
  9998. <dt><samp class="option">cutoff <var class="var">frequency</var></samp></dt>
  9999. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder selects a default
  10000. determined by various other encoding parameters.
  10001. </p>
  10002. </dd>
  10003. </dl>
  10004. </div>
  10005. <div class="subsection-level-extent" id="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">
  10006. <h4 class="subsection"><span>15.2.4 Floating-Point-Only AC-3 Encoding Options<a class="copiable-link" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"> &para;</a></span></h4>
  10007. <p>These options are only valid for the floating-point encoder and do not exist
  10008. for the fixed-point encoder due to the corresponding features not being
  10009. implemented in fixed-point.
  10010. </p>
  10011. <dl class="table">
  10012. <dt><samp class="option">-channel_coupling <var class="var">boolean</var></samp></dt>
  10013. <dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
  10014. that increases quality by combining high frequency information from multiple
  10015. channels into a single channel. The per-channel high frequency information is
  10016. sent with less accuracy in both the frequency and time domains. This allows
  10017. more bits to be used for lower frequencies while preserving enough information
  10018. to reconstruct the high frequencies. This option is enabled by default for the
  10019. floating-point encoder and should generally be left as enabled except for
  10020. testing purposes or to increase encoding speed.
  10021. </p><dl class="table">
  10022. <dt><samp class="option">-1</samp></dt>
  10023. <dt><samp class="option">auto</samp></dt>
  10024. <dd><p>Selected by Encoder (default)
  10025. </p></dd>
  10026. <dt><samp class="option">0</samp></dt>
  10027. <dt><samp class="option">off</samp></dt>
  10028. <dd><p>Disable Channel Coupling
  10029. </p></dd>
  10030. <dt><samp class="option">1</samp></dt>
  10031. <dt><samp class="option">on</samp></dt>
  10032. <dd><p>Enable Channel Coupling
  10033. </p></dd>
  10034. </dl>
  10035. </dd>
  10036. <dt><samp class="option">-cpl_start_band <var class="var">number</var></samp></dt>
  10037. <dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  10038. value higher than the bandwidth is used, it will be reduced to 1 less than the
  10039. coupling end band. If <var class="var">auto</var> is used, the start band will be determined by
  10040. the encoder based on the bit rate, sample rate, and channel layout. This option
  10041. has no effect if channel coupling is disabled.
  10042. </p><dl class="table">
  10043. <dt><samp class="option">-1</samp></dt>
  10044. <dt><samp class="option">auto</samp></dt>
  10045. <dd><p>Selected by Encoder (default)
  10046. </p></dd>
  10047. </dl>
  10048. </dd>
  10049. </dl>
  10050. <a class="anchor" id="flac"></a></div>
  10051. </div>
  10052. <div class="section-level-extent" id="flac-2">
  10053. <h3 class="section"><span>15.3 flac<a class="copiable-link" href="#flac-2"> &para;</a></span></h3>
  10054. <p>FLAC (Free Lossless Audio Codec) Encoder
  10055. </p>
  10056. <ul class="mini-toc">
  10057. <li><a href="#Options-12" accesskey="1">Options</a></li>
  10058. </ul>
  10059. <div class="subsection-level-extent" id="Options-12">
  10060. <h4 class="subsection"><span>15.3.1 Options<a class="copiable-link" href="#Options-12"> &para;</a></span></h4>
  10061. <p>The following options are supported by FFmpeg&rsquo;s flac encoder.
  10062. </p>
  10063. <dl class="table">
  10064. <dt><samp class="option">compression_level</samp></dt>
  10065. <dd><p>Sets the compression level, which chooses defaults for many other options
  10066. if they are not set explicitly. Valid values are from 0 to 12, 5 is the
  10067. default.
  10068. </p>
  10069. </dd>
  10070. <dt><samp class="option">frame_size</samp></dt>
  10071. <dd><p>Sets the size of the frames in samples per channel.
  10072. </p>
  10073. </dd>
  10074. <dt><samp class="option">lpc_coeff_precision</samp></dt>
  10075. <dd><p>Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  10076. default.
  10077. </p>
  10078. </dd>
  10079. <dt><samp class="option">lpc_type</samp></dt>
  10080. <dd><p>Sets the first stage LPC algorithm
  10081. </p><dl class="table">
  10082. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  10083. <dd><p>LPC is not used
  10084. </p>
  10085. </dd>
  10086. <dt>&lsquo;<samp class="samp">fixed</samp>&rsquo;</dt>
  10087. <dd><p>fixed LPC coefficients
  10088. </p>
  10089. </dd>
  10090. <dt>&lsquo;<samp class="samp">levinson</samp>&rsquo;</dt>
  10091. <dt>&lsquo;<samp class="samp">cholesky</samp>&rsquo;</dt>
  10092. </dl>
  10093. </dd>
  10094. <dt><samp class="option">lpc_passes</samp></dt>
  10095. <dd><p>Number of passes to use for Cholesky factorization during LPC analysis
  10096. </p>
  10097. </dd>
  10098. <dt><samp class="option">min_partition_order</samp></dt>
  10099. <dd><p>The minimum partition order
  10100. </p>
  10101. </dd>
  10102. <dt><samp class="option">max_partition_order</samp></dt>
  10103. <dd><p>The maximum partition order
  10104. </p>
  10105. </dd>
  10106. <dt><samp class="option">prediction_order_method</samp></dt>
  10107. <dd><dl class="table">
  10108. <dt>&lsquo;<samp class="samp">estimation</samp>&rsquo;</dt>
  10109. <dt>&lsquo;<samp class="samp">2level</samp>&rsquo;</dt>
  10110. <dt>&lsquo;<samp class="samp">4level</samp>&rsquo;</dt>
  10111. <dt>&lsquo;<samp class="samp">8level</samp>&rsquo;</dt>
  10112. <dt>&lsquo;<samp class="samp">search</samp>&rsquo;</dt>
  10113. <dd><p>Bruteforce search
  10114. </p></dd>
  10115. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  10116. </dl>
  10117. </dd>
  10118. <dt><samp class="option">ch_mode</samp></dt>
  10119. <dd><p>Channel mode
  10120. </p><dl class="table">
  10121. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  10122. <dd><p>The mode is chosen automatically for each frame
  10123. </p></dd>
  10124. <dt>&lsquo;<samp class="samp">indep</samp>&rsquo;</dt>
  10125. <dd><p>Channels are independently coded
  10126. </p></dd>
  10127. <dt>&lsquo;<samp class="samp">left_side</samp>&rsquo;</dt>
  10128. <dt>&lsquo;<samp class="samp">right_side</samp>&rsquo;</dt>
  10129. <dt>&lsquo;<samp class="samp">mid_side</samp>&rsquo;</dt>
  10130. </dl>
  10131. </dd>
  10132. <dt><samp class="option">exact_rice_parameters</samp></dt>
  10133. <dd><p>Chooses if rice parameters are calculated exactly or approximately.
  10134. if set to 1 then they are chosen exactly, which slows the code down slightly and
  10135. improves compression slightly.
  10136. </p>
  10137. </dd>
  10138. <dt><samp class="option">multi_dim_quant</samp></dt>
  10139. <dd><p>Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  10140. applied after the first stage to finetune the coefficients. This is quite slow
  10141. and slightly improves compression.
  10142. </p>
  10143. </dd>
  10144. </dl>
  10145. <a class="anchor" id="opusenc"></a></div>
  10146. </div>
  10147. <div class="section-level-extent" id="opus">
  10148. <h3 class="section"><span>15.4 opus<a class="copiable-link" href="#opus"> &para;</a></span></h3>
  10149. <p>Opus encoder.
  10150. </p>
  10151. <p>This is a native FFmpeg encoder for the Opus format. Currently, it&rsquo;s in development and
  10152. only implements the CELT part of the codec. Its quality is usually worse and at best
  10153. is equal to the libopus encoder.
  10154. </p>
  10155. <ul class="mini-toc">
  10156. <li><a href="#Options-13" accesskey="1">Options</a></li>
  10157. </ul>
  10158. <div class="subsection-level-extent" id="Options-13">
  10159. <h4 class="subsection"><span>15.4.1 Options<a class="copiable-link" href="#Options-13"> &para;</a></span></h4>
  10160. <dl class="table">
  10161. <dt><samp class="option">b</samp></dt>
  10162. <dd><p>Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
  10163. to make a good guess.
  10164. </p>
  10165. </dd>
  10166. <dt><samp class="option">opus_delay</samp></dt>
  10167. <dd><p>Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
  10168. decrease quality.
  10169. </p></dd>
  10170. </dl>
  10171. <a class="anchor" id="libfdk_002daac_002denc"></a></div>
  10172. </div>
  10173. <div class="section-level-extent" id="libfdk_005faac">
  10174. <h3 class="section"><span>15.5 libfdk_aac<a class="copiable-link" href="#libfdk_005faac"> &para;</a></span></h3>
  10175. <p>libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  10176. </p>
  10177. <p>The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  10178. the Android project.
  10179. </p>
  10180. <p>Requires the presence of the libfdk-aac headers and library during
  10181. configuration. You need to explicitly configure the build with
  10182. <code class="code">--enable-libfdk-aac</code>. The library is also incompatible with GPL,
  10183. so if you allow the use of GPL, you should configure with
  10184. <code class="code">--enable-gpl --enable-nonfree --enable-libfdk-aac</code>.
  10185. </p>
  10186. <p>This encoder has support for the AAC-HE profiles.
  10187. </p>
  10188. <p>VBR encoding, enabled through the <samp class="option">vbr</samp> or <samp class="option">flags
  10189. +qscale</samp> options, is experimental and only works with some
  10190. combinations of parameters.
  10191. </p>
  10192. <p>Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  10193. higher.
  10194. </p>
  10195. <p>For more information see the fdk-aac project at
  10196. <a class="url" href="http://sourceforge.net/p/opencore-amr/fdk-aac/">http://sourceforge.net/p/opencore-amr/fdk-aac/</a>.
  10197. </p>
  10198. <ul class="mini-toc">
  10199. <li><a href="#Options-14" accesskey="1">Options</a></li>
  10200. <li><a href="#Examples-4" accesskey="2">Examples</a></li>
  10201. </ul>
  10202. <div class="subsection-level-extent" id="Options-14">
  10203. <h4 class="subsection"><span>15.5.1 Options<a class="copiable-link" href="#Options-14"> &para;</a></span></h4>
  10204. <p>The following options are mapped on the shared FFmpeg codec options.
  10205. </p>
  10206. <dl class="table">
  10207. <dt><samp class="option">b</samp></dt>
  10208. <dd><p>Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  10209. is automatically set to a suitable value depending on the selected
  10210. profile.
  10211. </p>
  10212. <p>In case VBR mode is enabled the option is ignored.
  10213. </p>
  10214. </dd>
  10215. <dt><samp class="option">ar</samp></dt>
  10216. <dd><p>Set audio sampling rate (in Hz).
  10217. </p>
  10218. </dd>
  10219. <dt><samp class="option">channels</samp></dt>
  10220. <dd><p>Set the number of audio channels.
  10221. </p>
  10222. </dd>
  10223. <dt><samp class="option">flags +qscale</samp></dt>
  10224. <dd><p>Enable fixed quality, VBR (Variable Bit Rate) mode.
  10225. Note that VBR is implicitly enabled when the <samp class="option">vbr</samp> value is
  10226. positive.
  10227. </p>
  10228. </dd>
  10229. <dt><samp class="option">cutoff</samp></dt>
  10230. <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
  10231. will use a value automatically computed by the library. Default value
  10232. is 0.
  10233. </p>
  10234. </dd>
  10235. <dt><samp class="option">profile</samp></dt>
  10236. <dd><p>Set audio profile.
  10237. </p>
  10238. <p>The following profiles are recognized:
  10239. </p><dl class="table">
  10240. <dt>&lsquo;<samp class="samp">aac_low</samp>&rsquo;</dt>
  10241. <dd><p>Low Complexity AAC (LC)
  10242. </p>
  10243. </dd>
  10244. <dt>&lsquo;<samp class="samp">aac_he</samp>&rsquo;</dt>
  10245. <dd><p>High Efficiency AAC (HE-AAC)
  10246. </p>
  10247. </dd>
  10248. <dt>&lsquo;<samp class="samp">aac_he_v2</samp>&rsquo;</dt>
  10249. <dd><p>High Efficiency AAC version 2 (HE-AACv2)
  10250. </p>
  10251. </dd>
  10252. <dt>&lsquo;<samp class="samp">aac_ld</samp>&rsquo;</dt>
  10253. <dd><p>Low Delay AAC (LD)
  10254. </p>
  10255. </dd>
  10256. <dt>&lsquo;<samp class="samp">aac_eld</samp>&rsquo;</dt>
  10257. <dd><p>Enhanced Low Delay AAC (ELD)
  10258. </p></dd>
  10259. </dl>
  10260. <p>If not specified it is set to &lsquo;<samp class="samp">aac_low</samp>&rsquo;.
  10261. </p></dd>
  10262. </dl>
  10263. <p>The following are private options of the libfdk_aac encoder.
  10264. </p>
  10265. <dl class="table">
  10266. <dt><samp class="option">afterburner</samp></dt>
  10267. <dd><p>Enable afterburner feature if set to 1, disabled if set to 0. This
  10268. improves the quality but also the required processing power.
  10269. </p>
  10270. <p>Default value is 1.
  10271. </p>
  10272. </dd>
  10273. <dt><samp class="option">eld_sbr</samp></dt>
  10274. <dd><p>Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  10275. if set to 0.
  10276. </p>
  10277. <p>Default value is 0.
  10278. </p>
  10279. </dd>
  10280. <dt><samp class="option">eld_v2</samp></dt>
  10281. <dd><p>Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
  10282. disabled if set to 0.
  10283. </p>
  10284. <p>Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) &gt; (4.0.0).
  10285. </p>
  10286. <p>Default value is 0.
  10287. </p>
  10288. </dd>
  10289. <dt><samp class="option">signaling</samp></dt>
  10290. <dd><p>Set SBR/PS signaling style.
  10291. </p>
  10292. <p>It can assume one of the following values:
  10293. </p><dl class="table">
  10294. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  10295. <dd><p>choose signaling implicitly (explicit hierarchical by default,
  10296. implicit if global header is disabled)
  10297. </p>
  10298. </dd>
  10299. <dt>&lsquo;<samp class="samp">implicit</samp>&rsquo;</dt>
  10300. <dd><p>implicit backwards compatible signaling
  10301. </p>
  10302. </dd>
  10303. <dt>&lsquo;<samp class="samp">explicit_sbr</samp>&rsquo;</dt>
  10304. <dd><p>explicit SBR, implicit PS signaling
  10305. </p>
  10306. </dd>
  10307. <dt>&lsquo;<samp class="samp">explicit_hierarchical</samp>&rsquo;</dt>
  10308. <dd><p>explicit hierarchical signaling
  10309. </p></dd>
  10310. </dl>
  10311. <p>Default value is &lsquo;<samp class="samp">default</samp>&rsquo;.
  10312. </p>
  10313. </dd>
  10314. <dt><samp class="option">latm</samp></dt>
  10315. <dd><p>Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  10316. </p>
  10317. <p>Default value is 0.
  10318. </p>
  10319. </dd>
  10320. <dt><samp class="option">header_period</samp></dt>
  10321. <dd><p>Set StreamMuxConfig and PCE repetition period (in frames) for sending
  10322. in-band configuration buffers within LATM/LOAS transport layer.
  10323. </p>
  10324. <p>Must be a 16-bits non-negative integer.
  10325. </p>
  10326. <p>Default value is 0.
  10327. </p>
  10328. </dd>
  10329. <dt><samp class="option">vbr</samp></dt>
  10330. <dd><p>Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  10331. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  10332. (Constant Bit Rate) is enabled.
  10333. </p>
  10334. <p>Currently only the &lsquo;<samp class="samp">aac_low</samp>&rsquo; profile supports VBR encoding.
  10335. </p>
  10336. <p>VBR modes 1-5 correspond to roughly the following average bit rates:
  10337. </p>
  10338. <dl class="table">
  10339. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  10340. <dd><p>32 kbps/channel
  10341. </p></dd>
  10342. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  10343. <dd><p>40 kbps/channel
  10344. </p></dd>
  10345. <dt>&lsquo;<samp class="samp">3</samp>&rsquo;</dt>
  10346. <dd><p>48-56 kbps/channel
  10347. </p></dd>
  10348. <dt>&lsquo;<samp class="samp">4</samp>&rsquo;</dt>
  10349. <dd><p>64 kbps/channel
  10350. </p></dd>
  10351. <dt>&lsquo;<samp class="samp">5</samp>&rsquo;</dt>
  10352. <dd><p>about 80-96 kbps/channel
  10353. </p></dd>
  10354. </dl>
  10355. <p>Default value is 0.
  10356. </p>
  10357. </dd>
  10358. <dt><samp class="option">frame_length</samp></dt>
  10359. <dd><p>Set the audio frame length in samples. Default value is the internal
  10360. default of the library. Refer to the library&rsquo;s documentation for information
  10361. about supported values.
  10362. </p></dd>
  10363. </dl>
  10364. </div>
  10365. <div class="subsection-level-extent" id="Examples-4">
  10366. <h4 class="subsection"><span>15.5.2 Examples<a class="copiable-link" href="#Examples-4"> &para;</a></span></h4>
  10367. <ul class="itemize mark-bullet">
  10368. <li>Use <code class="command">ffmpeg</code> to convert an audio file to VBR AAC in an M4A (MP4)
  10369. container:
  10370. <div class="example">
  10371. <pre class="example-preformatted">ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  10372. </pre></div>
  10373. </li><li>Use <code class="command">ffmpeg</code> to convert an audio file to CBR 64k kbps AAC, using the
  10374. High-Efficiency AAC profile:
  10375. <div class="example">
  10376. <pre class="example-preformatted">ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  10377. </pre></div>
  10378. </li></ul>
  10379. <a class="anchor" id="libmp3lame"></a></div>
  10380. </div>
  10381. <div class="section-level-extent" id="libmp3lame-1">
  10382. <h3 class="section"><span>15.6 libmp3lame<a class="copiable-link" href="#libmp3lame-1"> &para;</a></span></h3>
  10383. <p>LAME (Lame Ain&rsquo;t an MP3 Encoder) MP3 encoder wrapper.
  10384. </p>
  10385. <p>Requires the presence of the libmp3lame headers and library during
  10386. configuration. You need to explicitly configure the build with
  10387. <code class="code">--enable-libmp3lame</code>.
  10388. </p>
  10389. <p>See <a class="ref" href="#libshine">libshine</a> for a fixed-point MP3 encoder, although with a
  10390. lower quality.
  10391. </p>
  10392. <ul class="mini-toc">
  10393. <li><a href="#Options-15" accesskey="1">Options</a></li>
  10394. </ul>
  10395. <div class="subsection-level-extent" id="Options-15">
  10396. <h4 class="subsection"><span>15.6.1 Options<a class="copiable-link" href="#Options-15"> &para;</a></span></h4>
  10397. <p>The following options are supported by the libmp3lame wrapper. The
  10398. <code class="command">lame</code>-equivalent of the options are listed in parentheses.
  10399. </p>
  10400. <dl class="table">
  10401. <dt><samp class="option">b (<em class="emph">-b</em>)</samp></dt>
  10402. <dd><p>Set bitrate expressed in bits/s for CBR or ABR. LAME <code class="code">bitrate</code> is
  10403. expressed in kilobits/s.
  10404. </p>
  10405. </dd>
  10406. <dt><samp class="option">q (<em class="emph">-V</em>)</samp></dt>
  10407. <dd><p>Set constant quality setting for VBR. This option is valid only
  10408. using the <code class="command">ffmpeg</code> command-line tool. For library interface
  10409. users, use <samp class="option">global_quality</samp>.
  10410. </p>
  10411. </dd>
  10412. <dt><samp class="option">compression_level (<em class="emph">-q</em>)</samp></dt>
  10413. <dd><p>Set algorithm quality. Valid arguments are integers in the 0-9 range,
  10414. with 0 meaning highest quality but slowest, and 9 meaning fastest
  10415. while producing the worst quality.
  10416. </p>
  10417. </dd>
  10418. <dt><samp class="option">cutoff (<em class="emph">--lowpass</em>)</samp></dt>
  10419. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder dynamically
  10420. adjusts the cutoff.
  10421. </p>
  10422. </dd>
  10423. <dt><samp class="option">reservoir</samp></dt>
  10424. <dd><p>Enable use of bit reservoir when set to 1. Default value is 1. LAME
  10425. has this enabled by default, but can be overridden by use
  10426. <samp class="option">--nores</samp> option.
  10427. </p>
  10428. </dd>
  10429. <dt><samp class="option">joint_stereo (<em class="emph">-m j</em>)</samp></dt>
  10430. <dd><p>Enable the encoder to use (on a frame by frame basis) either L/R
  10431. stereo or mid/side stereo. Default value is 1.
  10432. </p>
  10433. </dd>
  10434. <dt><samp class="option">abr (<em class="emph">--abr</em>)</samp></dt>
  10435. <dd><p>Enable the encoder to use ABR when set to 1. The <code class="command">lame</code>
  10436. <samp class="option">--abr</samp> sets the target bitrate, while this options only
  10437. tells FFmpeg to use ABR still relies on <samp class="option">b</samp> to set bitrate.
  10438. </p>
  10439. </dd>
  10440. <dt><samp class="option">copyright (<em class="emph">-c</em>)</samp></dt>
  10441. <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
  10442. (disabled).
  10443. </p>
  10444. </dd>
  10445. <dt><samp class="option">original (<em class="emph">-o</em>)</samp></dt>
  10446. <dd><p>Set MPEG audio original flag when set to 1. The default value is 1
  10447. (enabled).
  10448. </p></dd>
  10449. </dl>
  10450. </div>
  10451. </div>
  10452. <div class="section-level-extent" id="libopencore_002damrnb-1">
  10453. <h3 class="section"><span>15.7 libopencore-amrnb<a class="copiable-link" href="#libopencore_002damrnb-1"> &para;</a></span></h3>
  10454. <p>OpenCORE Adaptive Multi-Rate Narrowband encoder.
  10455. </p>
  10456. <p>Requires the presence of the libopencore-amrnb headers and library during
  10457. configuration. You need to explicitly configure the build with
  10458. <code class="code">--enable-libopencore-amrnb --enable-version3</code>.
  10459. </p>
  10460. <p>This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  10461. but you can override it by setting <samp class="option">strict</samp> to &lsquo;<samp class="samp">unofficial</samp>&rsquo; or
  10462. lower.
  10463. </p>
  10464. <ul class="mini-toc">
  10465. <li><a href="#Options-16" accesskey="1">Options</a></li>
  10466. </ul>
  10467. <div class="subsection-level-extent" id="Options-16">
  10468. <h4 class="subsection"><span>15.7.1 Options<a class="copiable-link" href="#Options-16"> &para;</a></span></h4>
  10469. <dl class="table">
  10470. <dt><samp class="option">b</samp></dt>
  10471. <dd><p>Set bitrate in bits per second. Only the following bitrates are supported,
  10472. otherwise libavcodec will round to the nearest valid bitrate.
  10473. </p>
  10474. <dl class="table">
  10475. <dt><samp class="option">4750</samp></dt>
  10476. <dt><samp class="option">5150</samp></dt>
  10477. <dt><samp class="option">5900</samp></dt>
  10478. <dt><samp class="option">6700</samp></dt>
  10479. <dt><samp class="option">7400</samp></dt>
  10480. <dt><samp class="option">7950</samp></dt>
  10481. <dt><samp class="option">10200</samp></dt>
  10482. <dt><samp class="option">12200</samp></dt>
  10483. </dl>
  10484. </dd>
  10485. <dt><samp class="option">dtx</samp></dt>
  10486. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  10487. default value is 0 (disabled).
  10488. </p>
  10489. </dd>
  10490. </dl>
  10491. </div>
  10492. </div>
  10493. <div class="section-level-extent" id="libopus-1">
  10494. <h3 class="section"><span>15.8 libopus<a class="copiable-link" href="#libopus-1"> &para;</a></span></h3>
  10495. <p>libopus Opus Interactive Audio Codec encoder wrapper.
  10496. </p>
  10497. <p>Requires the presence of the libopus headers and library during
  10498. configuration. You need to explicitly configure the build with
  10499. <code class="code">--enable-libopus</code>.
  10500. </p>
  10501. <ul class="mini-toc">
  10502. <li><a href="#Option-Mapping" accesskey="1">Option Mapping</a></li>
  10503. </ul>
  10504. <div class="subsection-level-extent" id="Option-Mapping">
  10505. <h4 class="subsection"><span>15.8.1 Option Mapping<a class="copiable-link" href="#Option-Mapping"> &para;</a></span></h4>
  10506. <p>Most libopus options are modelled after the <code class="command">opusenc</code> utility from
  10507. opus-tools. The following is an option mapping chart describing options
  10508. supported by the libopus wrapper, and their <code class="command">opusenc</code>-equivalent
  10509. in parentheses.
  10510. </p>
  10511. <dl class="table">
  10512. <dt><samp class="option">b (<em class="emph">bitrate</em>)</samp></dt>
  10513. <dd><p>Set the bit rate in bits/s. FFmpeg&rsquo;s <samp class="option">b</samp> option is
  10514. expressed in bits/s, while <code class="command">opusenc</code>&rsquo;s <samp class="option">bitrate</samp> in
  10515. kilobits/s.
  10516. </p>
  10517. </dd>
  10518. <dt><samp class="option">vbr (<em class="emph">vbr</em>, <em class="emph">hard-cbr</em>, and <em class="emph">cvbr</em>)</samp></dt>
  10519. <dd><p>Set VBR mode. The FFmpeg <samp class="option">vbr</samp> option has the following
  10520. valid arguments, with the <code class="command">opusenc</code> equivalent options
  10521. in parentheses:
  10522. </p>
  10523. <dl class="table">
  10524. <dt>&lsquo;<samp class="samp">off (<em class="emph">hard-cbr</em>)</samp>&rsquo;</dt>
  10525. <dd><p>Use constant bit rate encoding.
  10526. </p>
  10527. </dd>
  10528. <dt>&lsquo;<samp class="samp">on (<em class="emph">vbr</em>)</samp>&rsquo;</dt>
  10529. <dd><p>Use variable bit rate encoding (the default).
  10530. </p>
  10531. </dd>
  10532. <dt>&lsquo;<samp class="samp">constrained (<em class="emph">cvbr</em>)</samp>&rsquo;</dt>
  10533. <dd><p>Use constrained variable bit rate encoding.
  10534. </p></dd>
  10535. </dl>
  10536. </dd>
  10537. <dt><samp class="option">compression_level (<em class="emph">comp</em>)</samp></dt>
  10538. <dd><p>Set encoding algorithm complexity. Valid options are integers in
  10539. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  10540. gives the highest quality but slowest encoding. The default is 10.
  10541. </p>
  10542. </dd>
  10543. <dt><samp class="option">frame_duration (<em class="emph">framesize</em>)</samp></dt>
  10544. <dd><p>Set maximum frame size, or duration of a frame in milliseconds. The
  10545. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  10546. frame sizes achieve lower latency but less quality at a given bitrate.
  10547. Sizes greater than 20ms are only interesting at fairly low bitrates.
  10548. The default is 20ms.
  10549. </p>
  10550. </dd>
  10551. <dt><samp class="option">packet_loss (<em class="emph">expect-loss</em>)</samp></dt>
  10552. <dd><p>Set expected packet loss percentage. The default is 0.
  10553. </p>
  10554. </dd>
  10555. <dt><samp class="option">fec (<em class="emph">n/a</em>)</samp></dt>
  10556. <dd><p>Enable inband forward error correction. <samp class="option">packet_loss</samp> must be non-zero
  10557. to take advantage - frequency of FEC &rsquo;side-data&rsquo; is proportional to expected packet loss.
  10558. Default is disabled.
  10559. </p>
  10560. </dd>
  10561. <dt><samp class="option">application (N.A.)</samp></dt>
  10562. <dd><p>Set intended application type. Valid options are listed below:
  10563. </p>
  10564. <dl class="table">
  10565. <dt>&lsquo;<samp class="samp">voip</samp>&rsquo;</dt>
  10566. <dd><p>Favor improved speech intelligibility.
  10567. </p></dd>
  10568. <dt>&lsquo;<samp class="samp">audio</samp>&rsquo;</dt>
  10569. <dd><p>Favor faithfulness to the input (the default).
  10570. </p></dd>
  10571. <dt>&lsquo;<samp class="samp">lowdelay</samp>&rsquo;</dt>
  10572. <dd><p>Restrict to only the lowest delay modes by disabling voice-optimized
  10573. modes.
  10574. </p></dd>
  10575. </dl>
  10576. </dd>
  10577. <dt><samp class="option">cutoff (N.A.)</samp></dt>
  10578. <dd><p>Set cutoff bandwidth in Hz. The argument must be exactly one of the
  10579. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  10580. narrowband, mediumband, wideband, super wideband, and fullband
  10581. respectively. The default is 0 (cutoff disabled). Note that libopus
  10582. forces a wideband cutoff for bitrates &lt; 15 kbps, unless CELT-only
  10583. (<samp class="option">application</samp> set to &lsquo;<samp class="samp">lowdelay</samp>&rsquo;) mode is used.
  10584. </p>
  10585. </dd>
  10586. <dt><samp class="option">mapping_family (<em class="emph">mapping_family</em>)</samp></dt>
  10587. <dd><p>Set channel mapping family to be used by the encoder. The default value of -1
  10588. uses mapping family 0 for mono and stereo inputs, and mapping family 1
  10589. otherwise. The default also disables the surround masking and LFE bandwidth
  10590. optimzations in libopus, and requires that the input contains 8 channels or
  10591. fewer.
  10592. </p>
  10593. <p>Other values include 0 for mono and stereo, 1 for surround sound with masking
  10594. and LFE bandwidth optimizations, and 255 for independent streams with an
  10595. unspecified channel layout.
  10596. </p>
  10597. </dd>
  10598. <dt><samp class="option">apply_phase_inv (N.A.) (requires libopus &gt;= 1.2)</samp></dt>
  10599. <dd><p>If set to 0, disables the use of phase inversion for intensity stereo,
  10600. improving the quality of mono downmixes, but slightly reducing normal stereo
  10601. quality. The default is 1 (phase inversion enabled).
  10602. </p>
  10603. </dd>
  10604. </dl>
  10605. <a class="anchor" id="libshine"></a></div>
  10606. </div>
  10607. <div class="section-level-extent" id="libshine-1">
  10608. <h3 class="section"><span>15.9 libshine<a class="copiable-link" href="#libshine-1"> &para;</a></span></h3>
  10609. <p>Shine Fixed-Point MP3 encoder wrapper.
  10610. </p>
  10611. <p>Shine is a fixed-point MP3 encoder. It has a far better performance on
  10612. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  10613. However, as it is more targeted on performance than quality, it is not on par
  10614. with LAME and other production-grade encoders quality-wise. Also, according to
  10615. the project&rsquo;s homepage, this encoder may not be free of bugs as the code was
  10616. written a long time ago and the project was dead for at least 5 years.
  10617. </p>
  10618. <p>This encoder only supports stereo and mono input. This is also CBR-only.
  10619. </p>
  10620. <p>The original project (last updated in early 2007) is at
  10621. <a class="url" href="http://sourceforge.net/projects/libshine-fxp/">http://sourceforge.net/projects/libshine-fxp/</a>. We only support the
  10622. updated fork by the Savonet/Liquidsoap project at <a class="url" href="https://github.com/savonet/shine">https://github.com/savonet/shine</a>.
  10623. </p>
  10624. <p>Requires the presence of the libshine headers and library during
  10625. configuration. You need to explicitly configure the build with
  10626. <code class="code">--enable-libshine</code>.
  10627. </p>
  10628. <p>See also <a class="ref" href="#libmp3lame">libmp3lame</a>.
  10629. </p>
  10630. <ul class="mini-toc">
  10631. <li><a href="#Options-17" accesskey="1">Options</a></li>
  10632. </ul>
  10633. <div class="subsection-level-extent" id="Options-17">
  10634. <h4 class="subsection"><span>15.9.1 Options<a class="copiable-link" href="#Options-17"> &para;</a></span></h4>
  10635. <p>The following options are supported by the libshine wrapper. The
  10636. <code class="command">shineenc</code>-equivalent of the options are listed in parentheses.
  10637. </p>
  10638. <dl class="table">
  10639. <dt><samp class="option">b (<em class="emph">-b</em>)</samp></dt>
  10640. <dd><p>Set bitrate expressed in bits/s for CBR. <code class="command">shineenc</code> <samp class="option">-b</samp> option
  10641. is expressed in kilobits/s.
  10642. </p>
  10643. </dd>
  10644. </dl>
  10645. </div>
  10646. </div>
  10647. <div class="section-level-extent" id="libtwolame">
  10648. <h3 class="section"><span>15.10 libtwolame<a class="copiable-link" href="#libtwolame"> &para;</a></span></h3>
  10649. <p>TwoLAME MP2 encoder wrapper.
  10650. </p>
  10651. <p>Requires the presence of the libtwolame headers and library during
  10652. configuration. You need to explicitly configure the build with
  10653. <code class="code">--enable-libtwolame</code>.
  10654. </p>
  10655. <ul class="mini-toc">
  10656. <li><a href="#Options-18" accesskey="1">Options</a></li>
  10657. </ul>
  10658. <div class="subsection-level-extent" id="Options-18">
  10659. <h4 class="subsection"><span>15.10.1 Options<a class="copiable-link" href="#Options-18"> &para;</a></span></h4>
  10660. <p>The following options are supported by the libtwolame wrapper. The
  10661. <code class="command">twolame</code>-equivalent options follow the FFmpeg ones and are in
  10662. parentheses.
  10663. </p>
  10664. <dl class="table">
  10665. <dt><samp class="option">b (<em class="emph">-b</em>)</samp></dt>
  10666. <dd><p>Set bitrate expressed in bits/s for CBR. <code class="command">twolame</code> <samp class="option">b</samp>
  10667. option is expressed in kilobits/s. Default value is 128k.
  10668. </p>
  10669. </dd>
  10670. <dt><samp class="option">q (<em class="emph">-V</em>)</samp></dt>
  10671. <dd><p>Set quality for experimental VBR support. Maximum value range is
  10672. from -50 to 50, useful range is from -10 to 10. The higher the
  10673. value, the better the quality. This option is valid only using the
  10674. <code class="command">ffmpeg</code> command-line tool. For library interface users,
  10675. use <samp class="option">global_quality</samp>.
  10676. </p>
  10677. </dd>
  10678. <dt><samp class="option">mode (<em class="emph">--mode</em>)</samp></dt>
  10679. <dd><p>Set the mode of the resulting audio. Possible values:
  10680. </p>
  10681. <dl class="table">
  10682. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  10683. <dd><p>Choose mode automatically based on the input. This is the default.
  10684. </p></dd>
  10685. <dt>&lsquo;<samp class="samp">stereo</samp>&rsquo;</dt>
  10686. <dd><p>Stereo
  10687. </p></dd>
  10688. <dt>&lsquo;<samp class="samp">joint_stereo</samp>&rsquo;</dt>
  10689. <dd><p>Joint stereo
  10690. </p></dd>
  10691. <dt>&lsquo;<samp class="samp">dual_channel</samp>&rsquo;</dt>
  10692. <dd><p>Dual channel
  10693. </p></dd>
  10694. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  10695. <dd><p>Mono
  10696. </p></dd>
  10697. </dl>
  10698. </dd>
  10699. <dt><samp class="option">psymodel (<em class="emph">--psyc-mode</em>)</samp></dt>
  10700. <dd><p>Set psychoacoustic model to use in encoding. The argument must be
  10701. an integer between -1 and 4, inclusive. The higher the value, the
  10702. better the quality. The default value is 3.
  10703. </p>
  10704. </dd>
  10705. <dt><samp class="option">energy_levels (<em class="emph">--energy</em>)</samp></dt>
  10706. <dd><p>Enable energy levels extensions when set to 1. The default value is
  10707. 0 (disabled).
  10708. </p>
  10709. </dd>
  10710. <dt><samp class="option">error_protection (<em class="emph">--protect</em>)</samp></dt>
  10711. <dd><p>Enable CRC error protection when set to 1. The default value is 0
  10712. (disabled).
  10713. </p>
  10714. </dd>
  10715. <dt><samp class="option">copyright (<em class="emph">--copyright</em>)</samp></dt>
  10716. <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
  10717. (disabled).
  10718. </p>
  10719. </dd>
  10720. <dt><samp class="option">original (<em class="emph">--original</em>)</samp></dt>
  10721. <dd><p>Set MPEG audio original flag when set to 1. The default value is 0
  10722. (disabled).
  10723. </p>
  10724. </dd>
  10725. </dl>
  10726. </div>
  10727. </div>
  10728. <div class="section-level-extent" id="libvo_002damrwbenc">
  10729. <h3 class="section"><span>15.11 libvo-amrwbenc<a class="copiable-link" href="#libvo_002damrwbenc"> &para;</a></span></h3>
  10730. <p>VisualOn Adaptive Multi-Rate Wideband encoder.
  10731. </p>
  10732. <p>Requires the presence of the libvo-amrwbenc headers and library during
  10733. configuration. You need to explicitly configure the build with
  10734. <code class="code">--enable-libvo-amrwbenc --enable-version3</code>.
  10735. </p>
  10736. <p>This is a mono-only encoder. Officially it only supports 16000Hz sample
  10737. rate, but you can override it by setting <samp class="option">strict</samp> to
  10738. &lsquo;<samp class="samp">unofficial</samp>&rsquo; or lower.
  10739. </p>
  10740. <ul class="mini-toc">
  10741. <li><a href="#Options-19" accesskey="1">Options</a></li>
  10742. </ul>
  10743. <div class="subsection-level-extent" id="Options-19">
  10744. <h4 class="subsection"><span>15.11.1 Options<a class="copiable-link" href="#Options-19"> &para;</a></span></h4>
  10745. <dl class="table">
  10746. <dt><samp class="option">b</samp></dt>
  10747. <dd><p>Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  10748. libavcodec will round to the nearest valid bitrate.
  10749. </p>
  10750. <dl class="table">
  10751. <dt>&lsquo;<samp class="samp">6600</samp>&rsquo;</dt>
  10752. <dt>&lsquo;<samp class="samp">8850</samp>&rsquo;</dt>
  10753. <dt>&lsquo;<samp class="samp">12650</samp>&rsquo;</dt>
  10754. <dt>&lsquo;<samp class="samp">14250</samp>&rsquo;</dt>
  10755. <dt>&lsquo;<samp class="samp">15850</samp>&rsquo;</dt>
  10756. <dt>&lsquo;<samp class="samp">18250</samp>&rsquo;</dt>
  10757. <dt>&lsquo;<samp class="samp">19850</samp>&rsquo;</dt>
  10758. <dt>&lsquo;<samp class="samp">23050</samp>&rsquo;</dt>
  10759. <dt>&lsquo;<samp class="samp">23850</samp>&rsquo;</dt>
  10760. </dl>
  10761. </dd>
  10762. <dt><samp class="option">dtx</samp></dt>
  10763. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  10764. default value is 0 (disabled).
  10765. </p>
  10766. </dd>
  10767. </dl>
  10768. </div>
  10769. </div>
  10770. <div class="section-level-extent" id="libvorbis">
  10771. <h3 class="section"><span>15.12 libvorbis<a class="copiable-link" href="#libvorbis"> &para;</a></span></h3>
  10772. <p>libvorbis encoder wrapper.
  10773. </p>
  10774. <p>Requires the presence of the libvorbisenc headers and library during
  10775. configuration. You need to explicitly configure the build with
  10776. <code class="code">--enable-libvorbis</code>.
  10777. </p>
  10778. <ul class="mini-toc">
  10779. <li><a href="#Options-20" accesskey="1">Options</a></li>
  10780. </ul>
  10781. <div class="subsection-level-extent" id="Options-20">
  10782. <h4 class="subsection"><span>15.12.1 Options<a class="copiable-link" href="#Options-20"> &para;</a></span></h4>
  10783. <p>The following options are supported by the libvorbis wrapper. The
  10784. <code class="command">oggenc</code>-equivalent of the options are listed in parentheses.
  10785. </p>
  10786. <p>To get a more accurate and extensive documentation of the libvorbis
  10787. options, consult the libvorbisenc&rsquo;s and <code class="command">oggenc</code>&rsquo;s documentations.
  10788. See <a class="url" href="http://xiph.org/vorbis/">http://xiph.org/vorbis/</a>,
  10789. <a class="url" href="http://wiki.xiph.org/Vorbis-tools">http://wiki.xiph.org/Vorbis-tools</a>, and oggenc(1).
  10790. </p>
  10791. <dl class="table">
  10792. <dt><samp class="option">b (<em class="emph">-b</em>)</samp></dt>
  10793. <dd><p>Set bitrate expressed in bits/s for ABR. <code class="command">oggenc</code> <samp class="option">-b</samp> is
  10794. expressed in kilobits/s.
  10795. </p>
  10796. </dd>
  10797. <dt><samp class="option">q (<em class="emph">-q</em>)</samp></dt>
  10798. <dd><p>Set constant quality setting for VBR. The value should be a float
  10799. number in the range of -1.0 to 10.0. The higher the value, the better
  10800. the quality. The default value is &lsquo;<samp class="samp">3.0</samp>&rsquo;.
  10801. </p>
  10802. <p>This option is valid only using the <code class="command">ffmpeg</code> command-line tool.
  10803. For library interface users, use <samp class="option">global_quality</samp>.
  10804. </p>
  10805. </dd>
  10806. <dt><samp class="option">cutoff (<em class="emph">--advanced-encode-option lowpass_frequency=N</em>)</samp></dt>
  10807. <dd><p>Set cutoff bandwidth in Hz, a value of 0 disables cutoff. <code class="command">oggenc</code>&rsquo;s
  10808. related option is expressed in kHz. The default value is &lsquo;<samp class="samp">0</samp>&rsquo; (cutoff
  10809. disabled).
  10810. </p>
  10811. </dd>
  10812. <dt><samp class="option">minrate (<em class="emph">-m</em>)</samp></dt>
  10813. <dd><p>Set minimum bitrate expressed in bits/s. <code class="command">oggenc</code> <samp class="option">-m</samp> is
  10814. expressed in kilobits/s.
  10815. </p>
  10816. </dd>
  10817. <dt><samp class="option">maxrate (<em class="emph">-M</em>)</samp></dt>
  10818. <dd><p>Set maximum bitrate expressed in bits/s. <code class="command">oggenc</code> <samp class="option">-M</samp> is
  10819. expressed in kilobits/s. This only has effect on ABR mode.
  10820. </p>
  10821. </dd>
  10822. <dt><samp class="option">iblock (<em class="emph">--advanced-encode-option impulse_noisetune=N</em>)</samp></dt>
  10823. <dd><p>Set noise floor bias for impulse blocks. The value is a float number from
  10824. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  10825. to the crispness of transients in the encoded audio. The tradeoff for better
  10826. transient response is a higher bitrate.
  10827. </p>
  10828. </dd>
  10829. </dl>
  10830. <a class="anchor" id="mjpegenc"></a></div>
  10831. </div>
  10832. <div class="section-level-extent" id="mjpeg">
  10833. <h3 class="section"><span>15.13 mjpeg<a class="copiable-link" href="#mjpeg"> &para;</a></span></h3>
  10834. <p>Motion JPEG encoder.
  10835. </p>
  10836. <ul class="mini-toc">
  10837. <li><a href="#Options-21" accesskey="1">Options</a></li>
  10838. </ul>
  10839. <div class="subsection-level-extent" id="Options-21">
  10840. <h4 class="subsection"><span>15.13.1 Options<a class="copiable-link" href="#Options-21"> &para;</a></span></h4>
  10841. <dl class="table">
  10842. <dt><samp class="option">huffman</samp></dt>
  10843. <dd><p>Set the huffman encoding strategy. Possible values:
  10844. </p>
  10845. <dl class="table">
  10846. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  10847. <dd><p>Use the default huffman tables. This is the default strategy.
  10848. </p>
  10849. </dd>
  10850. <dt>&lsquo;<samp class="samp">optimal</samp>&rsquo;</dt>
  10851. <dd><p>Compute and use optimal huffman tables.
  10852. </p>
  10853. </dd>
  10854. </dl>
  10855. </dd>
  10856. </dl>
  10857. <a class="anchor" id="wavpackenc"></a></div>
  10858. </div>
  10859. <div class="section-level-extent" id="wavpack">
  10860. <h3 class="section"><span>15.14 wavpack<a class="copiable-link" href="#wavpack"> &para;</a></span></h3>
  10861. <p>WavPack lossless audio encoder.
  10862. </p>
  10863. <ul class="mini-toc">
  10864. <li><a href="#Options-22" accesskey="1">Options</a></li>
  10865. </ul>
  10866. <div class="subsection-level-extent" id="Options-22">
  10867. <h4 class="subsection"><span>15.14.1 Options<a class="copiable-link" href="#Options-22"> &para;</a></span></h4>
  10868. <p>The equivalent options for <code class="command">wavpack</code> command line utility are listed in
  10869. parentheses.
  10870. </p>
  10871. <ul class="mini-toc">
  10872. <li><a href="#Shared-options" accesskey="1">Shared options</a></li>
  10873. <li><a href="#Private-options" accesskey="2">Private options</a></li>
  10874. </ul>
  10875. <div class="subsubsection-level-extent" id="Shared-options">
  10876. <h4 class="subsubsection"><span>15.14.1.1 Shared options<a class="copiable-link" href="#Shared-options"> &para;</a></span></h4>
  10877. <p>The following shared options are effective for this encoder. Only special notes
  10878. about this particular encoder will be documented here. For the general meaning
  10879. of the options, see <a class="ref" href="#codec_002doptions">the Codec Options chapter</a>.
  10880. </p>
  10881. <dl class="table">
  10882. <dt><samp class="option">frame_size (<em class="emph">--blocksize</em>)</samp></dt>
  10883. <dd><p>For this encoder, the range for this option is between 128 and 131072. Default
  10884. is automatically decided based on sample rate and number of channel.
  10885. </p>
  10886. <p>For the complete formula of calculating default, see
  10887. <samp class="file">libavcodec/wavpackenc.c</samp>.
  10888. </p>
  10889. </dd>
  10890. <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>
  10891. </dl>
  10892. </div>
  10893. <div class="subsubsection-level-extent" id="Private-options">
  10894. <h4 class="subsubsection"><span>15.14.1.2 Private options<a class="copiable-link" href="#Private-options"> &para;</a></span></h4>
  10895. <dl class="table">
  10896. <dt><samp class="option">joint_stereo (<em class="emph">-j</em>)</samp></dt>
  10897. <dd><p>Set whether to enable joint stereo. Valid values are:
  10898. </p>
  10899. <dl class="table">
  10900. <dt>&lsquo;<samp class="samp">on (<em class="emph">1</em>)</samp>&rsquo;</dt>
  10901. <dd><p>Force mid/side audio encoding.
  10902. </p></dd>
  10903. <dt>&lsquo;<samp class="samp">off (<em class="emph">0</em>)</samp>&rsquo;</dt>
  10904. <dd><p>Force left/right audio encoding.
  10905. </p></dd>
  10906. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  10907. <dd><p>Let the encoder decide automatically.
  10908. </p></dd>
  10909. </dl>
  10910. </dd>
  10911. <dt><samp class="option">optimize_mono</samp></dt>
  10912. <dd><p>Set whether to enable optimization for mono. This option is only effective for
  10913. non-mono streams. Available values:
  10914. </p>
  10915. <dl class="table">
  10916. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  10917. <dd><p>enabled
  10918. </p></dd>
  10919. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  10920. <dd><p>disabled
  10921. </p></dd>
  10922. </dl>
  10923. </dd>
  10924. </dl>
  10925. </div>
  10926. </div>
  10927. </div>
  10928. </div>
  10929. <div class="chapter-level-extent" id="Video-Encoders">
  10930. <h2 class="chapter"><span>16 Video Encoders<a class="copiable-link" href="#Video-Encoders"> &para;</a></span></h2>
  10931. <p>A description of some of the currently available video encoders
  10932. follows.
  10933. </p>
  10934. <ul class="mini-toc">
  10935. <li><a href="#a64_005fmulti_002c-a64_005fmulti5" accesskey="1">a64_multi, a64_multi5</a></li>
  10936. <li><a href="#Cinepak" accesskey="2">Cinepak</a></li>
  10937. <li><a href="#GIF" accesskey="3">GIF</a></li>
  10938. <li><a href="#Hap" accesskey="4">Hap</a></li>
  10939. <li><a href="#jpeg2000" accesskey="5">jpeg2000</a></li>
  10940. <li><a href="#librav1e" accesskey="6">librav1e</a></li>
  10941. <li><a href="#libaom_002dav1" accesskey="7">libaom-av1</a></li>
  10942. <li><a href="#libsvtav1" accesskey="8">libsvtav1</a></li>
  10943. <li><a href="#libjxl" accesskey="9">libjxl</a></li>
  10944. <li><a href="#libkvazaar">libkvazaar</a></li>
  10945. <li><a href="#libopenh264">libopenh264</a></li>
  10946. <li><a href="#libtheora">libtheora</a></li>
  10947. <li><a href="#libvpx">libvpx</a></li>
  10948. <li><a href="#libwebp">libwebp</a></li>
  10949. <li><a href="#libx264_002c-libx264rgb">libx264, libx264rgb</a></li>
  10950. <li><a href="#libx265">libx265</a></li>
  10951. <li><a href="#libxavs2">libxavs2</a></li>
  10952. <li><a href="#libxeve">libxeve</a></li>
  10953. <li><a href="#libxvid">libxvid</a></li>
  10954. <li><a href="#MediaFoundation">MediaFoundation</a></li>
  10955. <li><a href="#Microsoft-RLE">Microsoft RLE</a></li>
  10956. <li><a href="#mpeg2">mpeg2</a></li>
  10957. <li><a href="#png">png</a></li>
  10958. <li><a href="#ProRes">ProRes</a></li>
  10959. <li><a href="#QSV-Encoders">QSV Encoders</a></li>
  10960. <li><a href="#snow">snow</a></li>
  10961. <li><a href="#VAAPI-encoders">VAAPI encoders</a></li>
  10962. <li><a href="#vbn">vbn</a></li>
  10963. <li><a href="#vc2">vc2</a></li>
  10964. </ul>
  10965. <div class="section-level-extent" id="a64_005fmulti_002c-a64_005fmulti5">
  10966. <h3 class="section"><span>16.1 a64_multi, a64_multi5<a class="copiable-link" href="#a64_005fmulti_002c-a64_005fmulti5"> &para;</a></span></h3>
  10967. <p>A64 / Commodore 64 multicolor charset encoder. <code class="code">a64_multi5</code> is extended with 5th color (colram).
  10968. </p>
  10969. </div>
  10970. <div class="section-level-extent" id="Cinepak">
  10971. <h3 class="section"><span>16.2 Cinepak<a class="copiable-link" href="#Cinepak"> &para;</a></span></h3>
  10972. <p>Cinepak aka CVID encoder.
  10973. Compatible with Windows 3.1 and vintage MacOS.
  10974. </p>
  10975. <ul class="mini-toc">
  10976. <li><a href="#Options-23" accesskey="1">Options</a></li>
  10977. </ul>
  10978. <div class="subsection-level-extent" id="Options-23">
  10979. <h4 class="subsection"><span>16.2.1 Options<a class="copiable-link" href="#Options-23"> &para;</a></span></h4>
  10980. <dl class="table">
  10981. <dt><samp class="option">g <var class="var">integer</var></samp></dt>
  10982. <dd><p>Keyframe interval.
  10983. A keyframe is inserted at least every <code class="code">-g</code> frames, sometimes sooner.
  10984. </p>
  10985. </dd>
  10986. <dt><samp class="option">q:v <var class="var">integer</var></samp></dt>
  10987. <dd><p>Quality factor. Lower is better. Higher gives lower bitrate.
  10988. 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>:
  10989. </p>
  10990. <dl class="table">
  10991. <dt><samp class="option"><code class="code">-q:v 1</code> 1918 kb/s</samp></dt>
  10992. <dt><samp class="option"><code class="code">-q:v 2</code> 1735 kb/s</samp></dt>
  10993. <dt><samp class="option"><code class="code">-q:v 4</code> 1500 kb/s</samp></dt>
  10994. <dt><samp class="option"><code class="code">-q:v 10</code> 1041 kb/s</samp></dt>
  10995. <dt><samp class="option"><code class="code">-q:v 20</code> 826 kb/s</samp></dt>
  10996. <dt><samp class="option"><code class="code">-q:v 40</code> 553 kb/s</samp></dt>
  10997. <dt><samp class="option"><code class="code">-q:v 100</code> 394 kb/s</samp></dt>
  10998. <dt><samp class="option"><code class="code">-q:v 200</code> 312 kb/s</samp></dt>
  10999. <dt><samp class="option"><code class="code">-q:v 400</code> 266 kb/s</samp></dt>
  11000. <dt><samp class="option"><code class="code">-q:v 1000</code> 237 kb/s</samp></dt>
  11001. </dl>
  11002. </dd>
  11003. <dt><samp class="option">max_extra_cb_iterations <var class="var">integer</var></samp></dt>
  11004. <dd><p>Max extra codebook recalculation passes, more is better and slower.
  11005. </p>
  11006. </dd>
  11007. <dt><samp class="option">skip_empty_cb <var class="var">boolean</var></samp></dt>
  11008. <dd><p>Avoid wasting bytes, ignore vintage MacOS decoder.
  11009. </p>
  11010. </dd>
  11011. <dt><samp class="option">max_strips <var class="var">integer</var></samp></dt>
  11012. <dt><samp class="option">min_strips <var class="var">integer</var></samp></dt>
  11013. <dd><p>The minimum and maximum number of strips to use.
  11014. Wider range sometimes improves quality.
  11015. More strips is generally better quality but costs more bits.
  11016. Fewer strips tend to yield more keyframes.
  11017. Vintage compatible is 1..3.
  11018. </p>
  11019. </dd>
  11020. <dt><samp class="option">strip_number_adaptivity <var class="var">integer</var></samp></dt>
  11021. <dd><p>How much number of strips is allowed to change between frames.
  11022. Higher is better but slower.
  11023. </p>
  11024. </dd>
  11025. </dl>
  11026. </div>
  11027. </div>
  11028. <div class="section-level-extent" id="GIF">
  11029. <h3 class="section"><span>16.3 GIF<a class="copiable-link" href="#GIF"> &para;</a></span></h3>
  11030. <p>GIF image/animation encoder.
  11031. </p>
  11032. <ul class="mini-toc">
  11033. <li><a href="#Options-24" accesskey="1">Options</a></li>
  11034. </ul>
  11035. <div class="subsection-level-extent" id="Options-24">
  11036. <h4 class="subsection"><span>16.3.1 Options<a class="copiable-link" href="#Options-24"> &para;</a></span></h4>
  11037. <dl class="table">
  11038. <dt><samp class="option">gifflags <var class="var">integer</var></samp></dt>
  11039. <dd><p>Sets the flags used for GIF encoding.
  11040. </p>
  11041. <dl class="table">
  11042. <dt><samp class="option">offsetting</samp></dt>
  11043. <dd><p>Enables picture offsetting.
  11044. </p>
  11045. <p>Default is enabled.
  11046. </p>
  11047. </dd>
  11048. <dt><samp class="option">transdiff</samp></dt>
  11049. <dd><p>Enables transparency detection between frames.
  11050. </p>
  11051. <p>Default is enabled.
  11052. </p>
  11053. </dd>
  11054. </dl>
  11055. </dd>
  11056. <dt><samp class="option">gifimage <var class="var">integer</var></samp></dt>
  11057. <dd><p>Enables encoding one full GIF image per frame, rather than an animated GIF.
  11058. </p>
  11059. <p>Default value is <samp class="option">0</samp>.
  11060. </p>
  11061. </dd>
  11062. <dt><samp class="option">global_palette <var class="var">integer</var></samp></dt>
  11063. <dd><p>Writes a palette to the global GIF header where feasible.
  11064. </p>
  11065. <p>If disabled, every frame will always have a palette written, even if there
  11066. is a global palette supplied.
  11067. </p>
  11068. <p>Default value is <samp class="option">1</samp>.
  11069. </p>
  11070. </dd>
  11071. </dl>
  11072. </div>
  11073. </div>
  11074. <div class="section-level-extent" id="Hap">
  11075. <h3 class="section"><span>16.4 Hap<a class="copiable-link" href="#Hap"> &para;</a></span></h3>
  11076. <p>Vidvox Hap video encoder.
  11077. </p>
  11078. <ul class="mini-toc">
  11079. <li><a href="#Options-25" accesskey="1">Options</a></li>
  11080. </ul>
  11081. <div class="subsection-level-extent" id="Options-25">
  11082. <h4 class="subsection"><span>16.4.1 Options<a class="copiable-link" href="#Options-25"> &para;</a></span></h4>
  11083. <dl class="table">
  11084. <dt><samp class="option">format <var class="var">integer</var></samp></dt>
  11085. <dd><p>Specifies the Hap format to encode.
  11086. </p>
  11087. <dl class="table">
  11088. <dt><samp class="option">hap</samp></dt>
  11089. <dt><samp class="option">hap_alpha</samp></dt>
  11090. <dt><samp class="option">hap_q</samp></dt>
  11091. </dl>
  11092. <p>Default value is <samp class="option">hap</samp>.
  11093. </p>
  11094. </dd>
  11095. <dt><samp class="option">chunks <var class="var">integer</var></samp></dt>
  11096. <dd><p>Specifies the number of chunks to split frames into, between 1 and 64. This
  11097. permits multithreaded decoding of large frames, potentially at the cost of
  11098. data-rate. The encoder may modify this value to divide frames evenly.
  11099. </p>
  11100. <p>Default value is <var class="var">1</var>.
  11101. </p>
  11102. </dd>
  11103. <dt><samp class="option">compressor <var class="var">integer</var></samp></dt>
  11104. <dd><p>Specifies the second-stage compressor to use. If set to <samp class="option">none</samp>,
  11105. <samp class="option">chunks</samp> will be limited to 1, as chunked uncompressed frames offer no
  11106. benefit.
  11107. </p>
  11108. <dl class="table">
  11109. <dt><samp class="option">none</samp></dt>
  11110. <dt><samp class="option">snappy</samp></dt>
  11111. </dl>
  11112. <p>Default value is <samp class="option">snappy</samp>.
  11113. </p>
  11114. </dd>
  11115. </dl>
  11116. </div>
  11117. </div>
  11118. <div class="section-level-extent" id="jpeg2000">
  11119. <h3 class="section"><span>16.5 jpeg2000<a class="copiable-link" href="#jpeg2000"> &para;</a></span></h3>
  11120. <p>The native jpeg 2000 encoder is lossy by default, the <code class="code">-q:v</code>
  11121. option can be used to set the encoding quality. Lossless encoding
  11122. can be selected with <code class="code">-pred 1</code>.
  11123. </p>
  11124. <ul class="mini-toc">
  11125. <li><a href="#Options-26" accesskey="1">Options</a></li>
  11126. </ul>
  11127. <div class="subsection-level-extent" id="Options-26">
  11128. <h4 class="subsection"><span>16.5.1 Options<a class="copiable-link" href="#Options-26"> &para;</a></span></h4>
  11129. <dl class="table">
  11130. <dt><samp class="option">format <var class="var">integer</var></samp></dt>
  11131. <dd><p>Can be set to either <code class="code">j2k</code> or <code class="code">jp2</code> (the default) that
  11132. makes it possible to store non-rgb pix_fmts.
  11133. </p>
  11134. </dd>
  11135. <dt><samp class="option">tile_width <var class="var">integer</var></samp></dt>
  11136. <dd><p>Sets tile width. Range is 1 to 1073741824. Default is 256.
  11137. </p>
  11138. </dd>
  11139. <dt><samp class="option">tile_height <var class="var">integer</var></samp></dt>
  11140. <dd><p>Sets tile height. Range is 1 to 1073741824. Default is 256.
  11141. </p>
  11142. </dd>
  11143. <dt><samp class="option">pred <var class="var">integer</var></samp></dt>
  11144. <dd><p>Allows setting the discrete wavelet transform (DWT) type
  11145. </p><dl class="table">
  11146. <dt><samp class="option">dwt97int (Lossy)</samp></dt>
  11147. <dt><samp class="option">dwt53 (Lossless)</samp></dt>
  11148. </dl>
  11149. <p>Default is <code class="code">dwt97int</code>
  11150. </p>
  11151. </dd>
  11152. <dt><samp class="option">sop <var class="var">boolean</var></samp></dt>
  11153. <dd><p>Enable this to add SOP marker at the start of each packet. Disabled by default.
  11154. </p>
  11155. </dd>
  11156. <dt><samp class="option">eph <var class="var">boolean</var></samp></dt>
  11157. <dd><p>Enable this to add EPH marker at the end of each packet header. Disabled by default.
  11158. </p>
  11159. </dd>
  11160. <dt><samp class="option">prog <var class="var">integer</var></samp></dt>
  11161. <dd><p>Sets the progression order to be used by the encoder.
  11162. Possible values are:
  11163. </p><dl class="table">
  11164. <dt><samp class="option">lrcp</samp></dt>
  11165. <dt><samp class="option">rlcp</samp></dt>
  11166. <dt><samp class="option">rpcl</samp></dt>
  11167. <dt><samp class="option">pcrl</samp></dt>
  11168. <dt><samp class="option">cprl</samp></dt>
  11169. </dl>
  11170. <p>Set to <code class="code">lrcp</code> by default.
  11171. </p>
  11172. </dd>
  11173. <dt><samp class="option">layer_rates <var class="var">string</var></samp></dt>
  11174. <dd><p>By default, when this option is not used, compression is done using the quality metric.
  11175. This option allows for compression using compression ratio. The compression ratio for each
  11176. level could be specified. The compression ratio of a layer <code class="code">l</code> species the what ratio of
  11177. total file size is contained in the first <code class="code">l</code> layers.
  11178. </p>
  11179. <p>Example usage:
  11180. </p>
  11181. <div class="example">
  11182. <pre class="example-preformatted">ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates &quot;100,10,1&quot; output.j2k
  11183. </pre></div>
  11184. <p>This would compress the image to contain 3 layers, where the data contained in the
  11185. first layer would be compressed by 1000 times, compressed by 100 in the first two layers,
  11186. and shall contain all data while using all 3 layers.
  11187. </p>
  11188. </dd>
  11189. </dl>
  11190. </div>
  11191. </div>
  11192. <div class="section-level-extent" id="librav1e">
  11193. <h3 class="section"><span>16.6 librav1e<a class="copiable-link" href="#librav1e"> &para;</a></span></h3>
  11194. <p>rav1e AV1 encoder wrapper.
  11195. </p>
  11196. <p>Requires the presence of the rav1e headers and library during configuration.
  11197. You need to explicitly configure the build with <code class="code">--enable-librav1e</code>.
  11198. </p>
  11199. <ul class="mini-toc">
  11200. <li><a href="#Options-27" accesskey="1">Options</a></li>
  11201. </ul>
  11202. <div class="subsection-level-extent" id="Options-27">
  11203. <h4 class="subsection"><span>16.6.1 Options<a class="copiable-link" href="#Options-27"> &para;</a></span></h4>
  11204. <dl class="table">
  11205. <dt><samp class="option">qmax</samp></dt>
  11206. <dd><p>Sets the maximum quantizer to use when using bitrate mode.
  11207. </p>
  11208. </dd>
  11209. <dt><samp class="option">qmin</samp></dt>
  11210. <dd><p>Sets the minimum quantizer to use when using bitrate mode.
  11211. </p>
  11212. </dd>
  11213. <dt><samp class="option">qp</samp></dt>
  11214. <dd><p>Uses quantizer mode to encode at the given quantizer (0-255).
  11215. </p>
  11216. </dd>
  11217. <dt><samp class="option">speed</samp></dt>
  11218. <dd><p>Selects the speed preset (0-10) to encode with.
  11219. </p>
  11220. </dd>
  11221. <dt><samp class="option">tiles</samp></dt>
  11222. <dd><p>Selects how many tiles to encode with.
  11223. </p>
  11224. </dd>
  11225. <dt><samp class="option">tile-rows</samp></dt>
  11226. <dd><p>Selects how many rows of tiles to encode with.
  11227. </p>
  11228. </dd>
  11229. <dt><samp class="option">tile-columns</samp></dt>
  11230. <dd><p>Selects how many columns of tiles to encode with.
  11231. </p>
  11232. </dd>
  11233. <dt><samp class="option">rav1e-params</samp></dt>
  11234. <dd><p>Set rav1e options using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated
  11235. by &quot;:&quot;. See <code class="command">rav1e --help</code> for a list of options.
  11236. </p>
  11237. <p>For example to specify librav1e encoding options with <samp class="option">-rav1e-params</samp>:
  11238. </p>
  11239. <div class="example">
  11240. <pre class="example-preformatted">ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
  11241. </pre></div>
  11242. </dd>
  11243. </dl>
  11244. </div>
  11245. </div>
  11246. <div class="section-level-extent" id="libaom_002dav1">
  11247. <h3 class="section"><span>16.7 libaom-av1<a class="copiable-link" href="#libaom_002dav1"> &para;</a></span></h3>
  11248. <p>libaom AV1 encoder wrapper.
  11249. </p>
  11250. <p>Requires the presence of the libaom headers and library during
  11251. configuration. You need to explicitly configure the build with
  11252. <code class="code">--enable-libaom</code>.
  11253. </p>
  11254. <ul class="mini-toc">
  11255. <li><a href="#Options-28" accesskey="1">Options</a></li>
  11256. </ul>
  11257. <div class="subsection-level-extent" id="Options-28">
  11258. <h4 class="subsection"><span>16.7.1 Options<a class="copiable-link" href="#Options-28"> &para;</a></span></h4>
  11259. <p>The wrapper supports the following standard libavcodec options:
  11260. </p>
  11261. <dl class="table">
  11262. <dt><samp class="option">b</samp></dt>
  11263. <dd><p>Set bitrate target in bits/second. By default this will use
  11264. variable-bitrate mode. If <samp class="option">maxrate</samp> and <samp class="option">minrate</samp> are
  11265. also set to the same value then it will use constant-bitrate mode,
  11266. otherwise if <samp class="option">crf</samp> is set as well then it will use
  11267. constrained-quality mode.
  11268. </p>
  11269. </dd>
  11270. <dt><samp class="option">g keyint_min</samp></dt>
  11271. <dd><p>Set key frame placement. The GOP size sets the maximum distance between
  11272. key frames; if zero the output stream will be intra-only. The minimum
  11273. distance is ignored unless it is the same as the GOP size, in which case
  11274. key frames will always appear at a fixed interval. Not set by default,
  11275. so without this option the library has completely free choice about
  11276. where to place key frames.
  11277. </p>
  11278. </dd>
  11279. <dt><samp class="option">qmin qmax</samp></dt>
  11280. <dd><p>Set minimum/maximum quantisation values. Valid range is from 0 to 63
  11281. (warning: this does not match the quantiser values actually used by AV1
  11282. - divide by four to map real quantiser values to this range). Defaults
  11283. to min/max (no constraint).
  11284. </p>
  11285. </dd>
  11286. <dt><samp class="option">minrate maxrate bufsize rc_init_occupancy</samp></dt>
  11287. <dd><p>Set rate control buffering parameters. Not used if not set - defaults
  11288. to unconstrained variable bitrate.
  11289. </p>
  11290. </dd>
  11291. <dt><samp class="option">threads</samp></dt>
  11292. <dd><p>Set the number of threads to use while encoding. This may require the
  11293. <samp class="option">tiles</samp> or <samp class="option">row-mt</samp> options to also be set to actually
  11294. use the specified number of threads fully. Defaults to the number of
  11295. hardware threads supported by the host machine.
  11296. </p>
  11297. </dd>
  11298. <dt><samp class="option">profile</samp></dt>
  11299. <dd><p>Set the encoding profile. Defaults to using the profile which matches
  11300. the bit depth and chroma subsampling of the input.
  11301. </p>
  11302. </dd>
  11303. </dl>
  11304. <p>The wrapper also has some specific options:
  11305. </p>
  11306. <dl class="table">
  11307. <dt><samp class="option">cpu-used</samp></dt>
  11308. <dd><p>Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
  11309. higher numbers indicating greater speed and lower quality. The default
  11310. value is 1, which will be slow and high quality.
  11311. </p>
  11312. </dd>
  11313. <dt><samp class="option">auto-alt-ref</samp></dt>
  11314. <dd><p>Enable use of alternate reference frames. Defaults to the internal
  11315. default of the library.
  11316. </p>
  11317. </dd>
  11318. <dt><samp class="option">arnr-max-frames (<em class="emph">frames</em>)</samp></dt>
  11319. <dd><p>Set altref noise reduction max frame count. Default is -1.
  11320. </p>
  11321. </dd>
  11322. <dt><samp class="option">arnr-strength (<em class="emph">strength</em>)</samp></dt>
  11323. <dd><p>Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
  11324. </p>
  11325. </dd>
  11326. <dt><samp class="option">aq-mode (<em class="emph">aq-mode</em>)</samp></dt>
  11327. <dd><p>Set adaptive quantization mode. Possible values:
  11328. </p>
  11329. <dl class="table">
  11330. <dt>&lsquo;<samp class="samp">none (<em class="emph">0</em>)</samp>&rsquo;</dt>
  11331. <dd><p>Disabled.
  11332. </p>
  11333. </dd>
  11334. <dt>&lsquo;<samp class="samp">variance (<em class="emph">1</em>)</samp>&rsquo;</dt>
  11335. <dd><p>Variance-based.
  11336. </p>
  11337. </dd>
  11338. <dt>&lsquo;<samp class="samp">complexity (<em class="emph">2</em>)</samp>&rsquo;</dt>
  11339. <dd><p>Complexity-based.
  11340. </p>
  11341. </dd>
  11342. <dt>&lsquo;<samp class="samp">cyclic (<em class="emph">3</em>)</samp>&rsquo;</dt>
  11343. <dd><p>Cyclic refresh.
  11344. </p></dd>
  11345. </dl>
  11346. </dd>
  11347. <dt><samp class="option">tune (<em class="emph">tune</em>)</samp></dt>
  11348. <dd><p>Set the distortion metric the encoder is tuned with. Default is <code class="code">psnr</code>.
  11349. </p>
  11350. <dl class="table">
  11351. <dt>&lsquo;<samp class="samp">psnr (<em class="emph">0</em>)</samp>&rsquo;</dt>
  11352. <dt>&lsquo;<samp class="samp">ssim (<em class="emph">1</em>)</samp>&rsquo;</dt>
  11353. </dl>
  11354. </dd>
  11355. <dt><samp class="option">lag-in-frames</samp></dt>
  11356. <dd><p>Set the maximum number of frames which the encoder may keep in flight
  11357. at any one time for lookahead purposes. Defaults to the internal
  11358. default of the library.
  11359. </p>
  11360. </dd>
  11361. <dt><samp class="option">error-resilience</samp></dt>
  11362. <dd><p>Enable error resilience features:
  11363. </p><dl class="table">
  11364. <dt><samp class="option">default</samp></dt>
  11365. <dd><p>Improve resilience against losses of whole frames.
  11366. </p></dd>
  11367. </dl>
  11368. <p>Not enabled by default.
  11369. </p>
  11370. </dd>
  11371. <dt><samp class="option">crf</samp></dt>
  11372. <dd><p>Set the quality/size tradeoff for constant-quality (no bitrate target)
  11373. and constrained-quality (with maximum bitrate target) modes. Valid
  11374. range is 0 to 63, higher numbers indicating lower quality and smaller
  11375. output size. Only used if set; by default only the bitrate target is
  11376. used.
  11377. </p>
  11378. </dd>
  11379. <dt><samp class="option">static-thresh</samp></dt>
  11380. <dd><p>Set a change threshold on blocks below which they will be skipped by
  11381. the encoder. Defined in arbitrary units as a nonnegative integer,
  11382. defaulting to zero (no blocks are skipped).
  11383. </p>
  11384. </dd>
  11385. <dt><samp class="option">drop-threshold</samp></dt>
  11386. <dd><p>Set a threshold for dropping frames when close to rate control bounds.
  11387. Defined as a percentage of the target buffer - when the rate control
  11388. buffer falls below this percentage, frames will be dropped until it
  11389. has refilled above the threshold. Defaults to zero (no frames are
  11390. dropped).
  11391. </p>
  11392. </dd>
  11393. <dt><samp class="option">denoise-noise-level (<em class="emph">level</em>)</samp></dt>
  11394. <dd><p>Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
  11395. this option is not set or set to 0.
  11396. </p>
  11397. </dd>
  11398. <dt><samp class="option">denoise-block-size (<em class="emph">pixels</em>)</samp></dt>
  11399. <dd><p>Block size used for denoising for grain synthesis. If not set, AV1 codec
  11400. uses the default value of 32.
  11401. </p>
  11402. </dd>
  11403. <dt><samp class="option">undershoot-pct (<em class="emph">pct</em>)</samp></dt>
  11404. <dd><p>Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
  11405. Default is -1.
  11406. </p>
  11407. </dd>
  11408. <dt><samp class="option">overshoot-pct (<em class="emph">pct</em>)</samp></dt>
  11409. <dd><p>Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
  11410. Default is -1.
  11411. </p>
  11412. </dd>
  11413. <dt><samp class="option">minsection-pct (<em class="emph">pct</em>)</samp></dt>
  11414. <dd><p>Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
  11415. is not set, the libaomenc wrapper computes it as follows: <code class="code">(minrate * 100 / bitrate)</code>.
  11416. Range is -1 to 100. Default is -1 (unset).
  11417. </p>
  11418. </dd>
  11419. <dt><samp class="option">maxsection-pct (<em class="emph">pct</em>)</samp></dt>
  11420. <dd><p>Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
  11421. is not set, the libaomenc wrapper computes it as follows: <code class="code">(maxrate * 100 / bitrate)</code>.
  11422. Range is -1 to 5000. Default is -1 (unset).
  11423. </p>
  11424. </dd>
  11425. <dt><samp class="option">frame-parallel (<em class="emph">boolean</em>)</samp></dt>
  11426. <dd><p>Enable frame parallel decodability features. Default is true.
  11427. </p>
  11428. </dd>
  11429. <dt><samp class="option">tiles</samp></dt>
  11430. <dd><p>Set the number of tiles to encode the input video with, as columns x
  11431. rows. Larger numbers allow greater parallelism in both encoding and
  11432. decoding, but may decrease coding efficiency. Defaults to the minimum
  11433. number of tiles required by the size of the input video (this is 1x1
  11434. (that is, a single tile) for sizes up to and including 4K).
  11435. </p>
  11436. </dd>
  11437. <dt><samp class="option">tile-columns tile-rows</samp></dt>
  11438. <dd><p>Set the number of tiles as log2 of the number of tile rows and columns.
  11439. Provided for compatibility with libvpx/VP9.
  11440. </p>
  11441. </dd>
  11442. <dt><samp class="option">row-mt (Requires libaom &gt;= 1.0.0-759-g90a15f4f2)</samp></dt>
  11443. <dd><p>Enable row based multi-threading. Disabled by default.
  11444. </p>
  11445. </dd>
  11446. <dt><samp class="option">enable-cdef (<em class="emph">boolean</em>)</samp></dt>
  11447. <dd><p>Enable Constrained Directional Enhancement Filter. The libaom-av1
  11448. encoder enables CDEF by default.
  11449. </p>
  11450. </dd>
  11451. <dt><samp class="option">enable-restoration (<em class="emph">boolean</em>)</samp></dt>
  11452. <dd><p>Enable Loop Restoration Filter. Default is true for libaom-av1.
  11453. </p>
  11454. </dd>
  11455. <dt><samp class="option">enable-global-motion (<em class="emph">boolean</em>)</samp></dt>
  11456. <dd><p>Enable the use of global motion for block prediction. Default is true.
  11457. </p>
  11458. </dd>
  11459. <dt><samp class="option">enable-intrabc (<em class="emph">boolean</em>)</samp></dt>
  11460. <dd><p>Enable block copy mode for intra block prediction. This mode is
  11461. useful for screen content. Default is true.
  11462. </p>
  11463. </dd>
  11464. <dt><samp class="option">enable-rect-partitions (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11465. <dd><p>Enable rectangular partitions. Default is true.
  11466. </p>
  11467. </dd>
  11468. <dt><samp class="option">enable-1to4-partitions (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11469. <dd><p>Enable 1:4/4:1 partitions. Default is true.
  11470. </p>
  11471. </dd>
  11472. <dt><samp class="option">enable-ab-partitions (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11473. <dd><p>Enable AB shape partitions. Default is true.
  11474. </p>
  11475. </dd>
  11476. <dt><samp class="option">enable-angle-delta (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11477. <dd><p>Enable angle delta intra prediction. Default is true.
  11478. </p>
  11479. </dd>
  11480. <dt><samp class="option">enable-cfl-intra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11481. <dd><p>Enable chroma predicted from luma intra prediction. Default is true.
  11482. </p>
  11483. </dd>
  11484. <dt><samp class="option">enable-filter-intra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11485. <dd><p>Enable filter intra predictor. Default is true.
  11486. </p>
  11487. </dd>
  11488. <dt><samp class="option">enable-intra-edge-filter (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11489. <dd><p>Enable intra edge filter. Default is true.
  11490. </p>
  11491. </dd>
  11492. <dt><samp class="option">enable-smooth-intra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11493. <dd><p>Enable smooth intra prediction mode. Default is true.
  11494. </p>
  11495. </dd>
  11496. <dt><samp class="option">enable-paeth-intra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11497. <dd><p>Enable paeth predictor in intra prediction. Default is true.
  11498. </p>
  11499. </dd>
  11500. <dt><samp class="option">enable-palette (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11501. <dd><p>Enable palette prediction mode. Default is true.
  11502. </p>
  11503. </dd>
  11504. <dt><samp class="option">enable-flip-idtx (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11505. <dd><p>Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST,
  11506. FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT,
  11507. V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true.
  11508. </p>
  11509. </dd>
  11510. <dt><samp class="option">enable-tx64 (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11511. <dd><p>Enable 64-pt transform. Default is true.
  11512. </p>
  11513. </dd>
  11514. <dt><samp class="option">reduced-tx-type-set (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11515. <dd><p>Use reduced set of transform types. Default is false.
  11516. </p>
  11517. </dd>
  11518. <dt><samp class="option">use-intra-dct-only (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11519. <dd><p>Use DCT only for INTRA modes. Default is false.
  11520. </p>
  11521. </dd>
  11522. <dt><samp class="option">use-inter-dct-only (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11523. <dd><p>Use DCT only for INTER modes. Default is false.
  11524. </p>
  11525. </dd>
  11526. <dt><samp class="option">use-intra-default-tx-only (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11527. <dd><p>Use Default-transform only for INTRA modes. Default is false.
  11528. </p>
  11529. </dd>
  11530. <dt><samp class="option">enable-ref-frame-mvs (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11531. <dd><p>Enable temporal mv prediction. Default is true.
  11532. </p>
  11533. </dd>
  11534. <dt><samp class="option">enable-reduced-reference-set (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11535. <dd><p>Use reduced set of single and compound references. Default is false.
  11536. </p>
  11537. </dd>
  11538. <dt><samp class="option">enable-obmc (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11539. <dd><p>Enable obmc. Default is true.
  11540. </p>
  11541. </dd>
  11542. <dt><samp class="option">enable-dual-filter (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11543. <dd><p>Enable dual filter. Default is true.
  11544. </p>
  11545. </dd>
  11546. <dt><samp class="option">enable-diff-wtd-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11547. <dd><p>Enable difference-weighted compound. Default is true.
  11548. </p>
  11549. </dd>
  11550. <dt><samp class="option">enable-dist-wtd-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11551. <dd><p>Enable distance-weighted compound. Default is true.
  11552. </p>
  11553. </dd>
  11554. <dt><samp class="option">enable-onesided-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11555. <dd><p>Enable one sided compound. Default is true.
  11556. </p>
  11557. </dd>
  11558. <dt><samp class="option">enable-interinter-wedge (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11559. <dd><p>Enable interinter wedge compound. Default is true.
  11560. </p>
  11561. </dd>
  11562. <dt><samp class="option">enable-interintra-wedge (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11563. <dd><p>Enable interintra wedge compound. Default is true.
  11564. </p>
  11565. </dd>
  11566. <dt><samp class="option">enable-masked-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11567. <dd><p>Enable masked compound. Default is true.
  11568. </p>
  11569. </dd>
  11570. <dt><samp class="option">enable-interintra-comp (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11571. <dd><p>Enable interintra compound. Default is true.
  11572. </p>
  11573. </dd>
  11574. <dt><samp class="option">enable-smooth-interintra (<em class="emph">boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  11575. <dd><p>Enable smooth interintra mode. Default is true.
  11576. </p>
  11577. </dd>
  11578. <dt><samp class="option">aom-params</samp></dt>
  11579. <dd><p>Set libaom options using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated
  11580. by &quot;:&quot;. For a list of supported options, see <code class="command">aomenc --help</code> under the
  11581. section &quot;AV1 Specific Options&quot;.
  11582. </p>
  11583. <p>For example to specify libaom encoding options with <samp class="option">-aom-params</samp>:
  11584. </p>
  11585. <div class="example">
  11586. <pre class="example-preformatted">ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
  11587. </pre></div>
  11588. </dd>
  11589. </dl>
  11590. </div>
  11591. </div>
  11592. <div class="section-level-extent" id="libsvtav1">
  11593. <h3 class="section"><span>16.8 libsvtav1<a class="copiable-link" href="#libsvtav1"> &para;</a></span></h3>
  11594. <p>SVT-AV1 encoder wrapper.
  11595. </p>
  11596. <p>Requires the presence of the SVT-AV1 headers and library during configuration.
  11597. You need to explicitly configure the build with <code class="code">--enable-libsvtav1</code>.
  11598. </p>
  11599. <ul class="mini-toc">
  11600. <li><a href="#Options-29" accesskey="1">Options</a></li>
  11601. </ul>
  11602. <div class="subsection-level-extent" id="Options-29">
  11603. <h4 class="subsection"><span>16.8.1 Options<a class="copiable-link" href="#Options-29"> &para;</a></span></h4>
  11604. <dl class="table">
  11605. <dt><samp class="option">profile</samp></dt>
  11606. <dd><p>Set the encoding profile.
  11607. </p><dl class="table">
  11608. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  11609. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  11610. <dt>&lsquo;<samp class="samp">professional</samp>&rsquo;</dt>
  11611. </dl>
  11612. </dd>
  11613. <dt><samp class="option">level</samp></dt>
  11614. <dd><p>Set the operating point level. For example: &rsquo;4.0&rsquo;
  11615. </p>
  11616. </dd>
  11617. <dt><samp class="option">hielevel</samp></dt>
  11618. <dd><p>Set the Hierarchical prediction levels.
  11619. </p><dl class="table">
  11620. <dt>&lsquo;<samp class="samp">3level</samp>&rsquo;</dt>
  11621. <dt>&lsquo;<samp class="samp">4level</samp>&rsquo;</dt>
  11622. <dd><p>This is the default.
  11623. </p></dd>
  11624. </dl>
  11625. </dd>
  11626. <dt><samp class="option">tier</samp></dt>
  11627. <dd><p>Set the operating point tier.
  11628. </p><dl class="table">
  11629. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  11630. <dd><p>This is the default.
  11631. </p></dd>
  11632. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  11633. </dl>
  11634. </dd>
  11635. <dt><samp class="option">qmax</samp></dt>
  11636. <dd><p>Set the maximum quantizer to use when using a bitrate mode.
  11637. </p>
  11638. </dd>
  11639. <dt><samp class="option">qmin</samp></dt>
  11640. <dd><p>Set the minimum quantizer to use when using a bitrate mode.
  11641. </p>
  11642. </dd>
  11643. <dt><samp class="option">crf</samp></dt>
  11644. <dd><p>Constant rate factor value used in crf rate control mode (0-63).
  11645. </p>
  11646. </dd>
  11647. <dt><samp class="option">qp</samp></dt>
  11648. <dd><p>Set the quantizer used in cqp rate control mode (0-63).
  11649. </p>
  11650. </dd>
  11651. <dt><samp class="option">sc_detection</samp></dt>
  11652. <dd><p>Enable scene change detection.
  11653. </p>
  11654. </dd>
  11655. <dt><samp class="option">la_depth</samp></dt>
  11656. <dd><p>Set number of frames to look ahead (0-120).
  11657. </p>
  11658. </dd>
  11659. <dt><samp class="option">preset</samp></dt>
  11660. <dd><p>Set the quality-speed tradeoff, in the range 0 to 13. Higher values are
  11661. faster but lower quality.
  11662. </p>
  11663. </dd>
  11664. <dt><samp class="option">tile_rows</samp></dt>
  11665. <dd><p>Set log2 of the number of rows of tiles to use (0-6).
  11666. </p>
  11667. </dd>
  11668. <dt><samp class="option">tile_columns</samp></dt>
  11669. <dd><p>Set log2 of the number of columns of tiles to use (0-4).
  11670. </p>
  11671. </dd>
  11672. <dt><samp class="option">svtav1-params</samp></dt>
  11673. <dd><p>Set SVT-AV1 options using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated
  11674. by &quot;:&quot;. See the SVT-AV1 encoder user guide for a list of accepted parameters.
  11675. </p>
  11676. </dd>
  11677. </dl>
  11678. </div>
  11679. </div>
  11680. <div class="section-level-extent" id="libjxl">
  11681. <h3 class="section"><span>16.9 libjxl<a class="copiable-link" href="#libjxl"> &para;</a></span></h3>
  11682. <p>libjxl JPEG XL encoder wrapper.
  11683. </p>
  11684. <p>Requires the presence of the libjxl headers and library during
  11685. configuration. You need to explicitly configure the build with
  11686. <code class="code">--enable-libjxl</code>.
  11687. </p>
  11688. <ul class="mini-toc">
  11689. <li><a href="#Options-30" accesskey="1">Options</a></li>
  11690. </ul>
  11691. <div class="subsection-level-extent" id="Options-30">
  11692. <h4 class="subsection"><span>16.9.1 Options<a class="copiable-link" href="#Options-30"> &para;</a></span></h4>
  11693. <p>The libjxl wrapper supports the following options:
  11694. </p>
  11695. <dl class="table">
  11696. <dt><samp class="option">distance</samp></dt>
  11697. <dd><p>Set the target Butteraugli distance. This is a quality setting: lower
  11698. distance yields higher quality, with distance=1.0 roughly comparable to
  11699. libjpeg Quality 90 for photographic content. Setting distance=0.0 yields
  11700. true lossless encoding. Valid values range between 0.0 and 15.0, and sane
  11701. values rarely exceed 5.0. Setting distance=0.1 usually attains
  11702. transparency for most input. The default is 1.0.
  11703. </p>
  11704. </dd>
  11705. <dt><samp class="option">effort</samp></dt>
  11706. <dd><p>Set the encoding effort used. Higher effort values produce more consistent
  11707. quality and usually produces a better quality/bpp curve, at the cost of
  11708. more CPU time required. Valid values range from 1 to 9, and the default is 7.
  11709. </p>
  11710. </dd>
  11711. <dt><samp class="option">modular</samp></dt>
  11712. <dd><p>Force the encoder to use Modular mode instead of choosing automatically. The
  11713. default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT
  11714. is generally superior to Modular for lossy encoding but does not support
  11715. lossless encoding.
  11716. </p>
  11717. </dd>
  11718. </dl>
  11719. </div>
  11720. </div>
  11721. <div class="section-level-extent" id="libkvazaar">
  11722. <h3 class="section"><span>16.10 libkvazaar<a class="copiable-link" href="#libkvazaar"> &para;</a></span></h3>
  11723. <p>Kvazaar H.265/HEVC encoder.
  11724. </p>
  11725. <p>Requires the presence of the libkvazaar headers and library during
  11726. configuration. You need to explicitly configure the build with
  11727. <samp class="option">--enable-libkvazaar</samp>.
  11728. </p>
  11729. <ul class="mini-toc">
  11730. <li><a href="#Options-31" accesskey="1">Options</a></li>
  11731. </ul>
  11732. <div class="subsection-level-extent" id="Options-31">
  11733. <h4 class="subsection"><span>16.10.1 Options<a class="copiable-link" href="#Options-31"> &para;</a></span></h4>
  11734. <dl class="table">
  11735. <dt><samp class="option">b</samp></dt>
  11736. <dd><p>Set target video bitrate in bit/s and enable rate control.
  11737. </p>
  11738. </dd>
  11739. <dt><samp class="option">kvazaar-params</samp></dt>
  11740. <dd><p>Set kvazaar parameters as a list of <var class="var">name</var>=<var class="var">value</var> pairs separated
  11741. by commas (,). See kvazaar documentation for a list of options.
  11742. </p>
  11743. </dd>
  11744. </dl>
  11745. </div>
  11746. </div>
  11747. <div class="section-level-extent" id="libopenh264">
  11748. <h3 class="section"><span>16.11 libopenh264<a class="copiable-link" href="#libopenh264"> &para;</a></span></h3>
  11749. <p>Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  11750. </p>
  11751. <p>This encoder requires the presence of the libopenh264 headers and
  11752. library during configuration. You need to explicitly configure the
  11753. build with <code class="code">--enable-libopenh264</code>. The library is detected using
  11754. <code class="command">pkg-config</code>.
  11755. </p>
  11756. <p>For more information about the library see
  11757. <a class="url" href="http://www.openh264.org">http://www.openh264.org</a>.
  11758. </p>
  11759. <ul class="mini-toc">
  11760. <li><a href="#Options-32" accesskey="1">Options</a></li>
  11761. </ul>
  11762. <div class="subsection-level-extent" id="Options-32">
  11763. <h4 class="subsection"><span>16.11.1 Options<a class="copiable-link" href="#Options-32"> &para;</a></span></h4>
  11764. <p>The following FFmpeg global options affect the configurations of the
  11765. libopenh264 encoder.
  11766. </p>
  11767. <dl class="table">
  11768. <dt><samp class="option">b</samp></dt>
  11769. <dd><p>Set the bitrate (as a number of bits per second).
  11770. </p>
  11771. </dd>
  11772. <dt><samp class="option">g</samp></dt>
  11773. <dd><p>Set the GOP size.
  11774. </p>
  11775. </dd>
  11776. <dt><samp class="option">maxrate</samp></dt>
  11777. <dd><p>Set the max bitrate (as a number of bits per second).
  11778. </p>
  11779. </dd>
  11780. <dt><samp class="option">flags +global_header</samp></dt>
  11781. <dd><p>Set global header in the bitstream.
  11782. </p>
  11783. </dd>
  11784. <dt><samp class="option">slices</samp></dt>
  11785. <dd><p>Set the number of slices, used in parallelized encoding. Default value
  11786. is 0. This is only used when <samp class="option">slice_mode</samp> is set to
  11787. &lsquo;<samp class="samp">fixed</samp>&rsquo;.
  11788. </p>
  11789. </dd>
  11790. <dt><samp class="option">loopfilter</samp></dt>
  11791. <dd><p>Enable loop filter, if set to 1 (automatically enabled). To disable
  11792. set a value of 0.
  11793. </p>
  11794. </dd>
  11795. <dt><samp class="option">profile</samp></dt>
  11796. <dd><p>Set profile restrictions. If set to the value of &lsquo;<samp class="samp">main</samp>&rsquo; enable
  11797. CABAC (set the <code class="code">SEncParamExt.iEntropyCodingModeFlag</code> flag to 1).
  11798. </p>
  11799. </dd>
  11800. <dt><samp class="option">max_nal_size</samp></dt>
  11801. <dd><p>Set maximum NAL size in bytes.
  11802. </p>
  11803. </dd>
  11804. <dt><samp class="option">allow_skip_frames</samp></dt>
  11805. <dd><p>Allow skipping frames to hit the target bitrate if set to 1.
  11806. </p></dd>
  11807. </dl>
  11808. </div>
  11809. </div>
  11810. <div class="section-level-extent" id="libtheora">
  11811. <h3 class="section"><span>16.12 libtheora<a class="copiable-link" href="#libtheora"> &para;</a></span></h3>
  11812. <p>libtheora Theora encoder wrapper.
  11813. </p>
  11814. <p>Requires the presence of the libtheora headers and library during
  11815. configuration. You need to explicitly configure the build with
  11816. <code class="code">--enable-libtheora</code>.
  11817. </p>
  11818. <p>For more information about the libtheora project see
  11819. <a class="url" href="http://www.theora.org/">http://www.theora.org/</a>.
  11820. </p>
  11821. <ul class="mini-toc">
  11822. <li><a href="#Options-33" accesskey="1">Options</a></li>
  11823. <li><a href="#Examples-5" accesskey="2">Examples</a></li>
  11824. </ul>
  11825. <div class="subsection-level-extent" id="Options-33">
  11826. <h4 class="subsection"><span>16.12.1 Options<a class="copiable-link" href="#Options-33"> &para;</a></span></h4>
  11827. <p>The following global options are mapped to internal libtheora options
  11828. which affect the quality and the bitrate of the encoded stream.
  11829. </p>
  11830. <dl class="table">
  11831. <dt><samp class="option">b</samp></dt>
  11832. <dd><p>Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  11833. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  11834. </p>
  11835. </dd>
  11836. <dt><samp class="option">flags</samp></dt>
  11837. <dd><p>Used to enable constant quality mode (VBR) encoding through the
  11838. <samp class="option">qscale</samp> flag, and to enable the <code class="code">pass1</code> and <code class="code">pass2</code>
  11839. modes.
  11840. </p>
  11841. </dd>
  11842. <dt><samp class="option">g</samp></dt>
  11843. <dd><p>Set the GOP size.
  11844. </p>
  11845. </dd>
  11846. <dt><samp class="option">global_quality</samp></dt>
  11847. <dd><p>Set the global quality as an integer in lambda units.
  11848. </p>
  11849. <p>Only relevant when VBR mode is enabled with <code class="code">flags +qscale</code>. The
  11850. value is converted to QP units by dividing it by <code class="code">FF_QP2LAMBDA</code>,
  11851. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  11852. value in the native libtheora range [0-63]. A higher value corresponds
  11853. to a higher quality.
  11854. </p>
  11855. </dd>
  11856. <dt><samp class="option">q</samp></dt>
  11857. <dd><p>Enable VBR mode when set to a non-negative value, and set constant
  11858. quality value as a double floating point value in QP units.
  11859. </p>
  11860. <p>The value is clipped in the [0-10] range, and then multiplied by 6.3
  11861. to get a value in the native libtheora range [0-63].
  11862. </p>
  11863. <p>This option is valid only using the <code class="command">ffmpeg</code> command-line
  11864. tool. For library interface users, use <samp class="option">global_quality</samp>.
  11865. </p></dd>
  11866. </dl>
  11867. </div>
  11868. <div class="subsection-level-extent" id="Examples-5">
  11869. <h4 class="subsection"><span>16.12.2 Examples<a class="copiable-link" href="#Examples-5"> &para;</a></span></h4>
  11870. <ul class="itemize mark-bullet">
  11871. <li>Set maximum constant quality (VBR) encoding with <code class="command">ffmpeg</code>:
  11872. <div class="example">
  11873. <pre class="example-preformatted">ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  11874. </pre></div>
  11875. </li><li>Use <code class="command">ffmpeg</code> to convert a CBR 1000 kbps Theora video stream:
  11876. <div class="example">
  11877. <pre class="example-preformatted">ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  11878. </pre></div>
  11879. </li></ul>
  11880. </div>
  11881. </div>
  11882. <div class="section-level-extent" id="libvpx">
  11883. <h3 class="section"><span>16.13 libvpx<a class="copiable-link" href="#libvpx"> &para;</a></span></h3>
  11884. <p>VP8/VP9 format supported through libvpx.
  11885. </p>
  11886. <p>Requires the presence of the libvpx headers and library during configuration.
  11887. You need to explicitly configure the build with <code class="code">--enable-libvpx</code>.
  11888. </p>
  11889. <ul class="mini-toc">
  11890. <li><a href="#Options-34" accesskey="1">Options</a></li>
  11891. </ul>
  11892. <div class="subsection-level-extent" id="Options-34">
  11893. <h4 class="subsection"><span>16.13.1 Options<a class="copiable-link" href="#Options-34"> &para;</a></span></h4>
  11894. <p>The following options are supported by the libvpx wrapper. The
  11895. <code class="command">vpxenc</code>-equivalent options or values are listed in parentheses
  11896. for easy migration.
  11897. </p>
  11898. <p>To reduce the duplication of documentation, only the private options
  11899. and some others requiring special attention are documented here. For
  11900. the documentation of the undocumented generic options, see
  11901. <a class="ref" href="#codec_002doptions">the Codec Options chapter</a>.
  11902. </p>
  11903. <p>To get more documentation of the libvpx options, invoke the command
  11904. <code class="command">ffmpeg -h encoder=libvpx</code>, <code class="command">ffmpeg -h encoder=libvpx-vp9</code> or
  11905. <code class="command">vpxenc --help</code>. Further information is available in the libvpx API
  11906. documentation.
  11907. </p>
  11908. <dl class="table">
  11909. <dt><samp class="option">b (<em class="emph">target-bitrate</em>)</samp></dt>
  11910. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s <samp class="option">b</samp> option is
  11911. expressed in bits/s, while <code class="command">vpxenc</code>&rsquo;s <samp class="option">target-bitrate</samp> is in
  11912. kilobits/s.
  11913. </p>
  11914. </dd>
  11915. <dt><samp class="option">g (<em class="emph">kf-max-dist</em>)</samp></dt>
  11916. <dt><samp class="option">keyint_min (<em class="emph">kf-min-dist</em>)</samp></dt>
  11917. <dt><samp class="option">qmin (<em class="emph">min-q</em>)</samp></dt>
  11918. <dd><p>Minimum (Best Quality) Quantizer.
  11919. </p>
  11920. </dd>
  11921. <dt><samp class="option">qmax (<em class="emph">max-q</em>)</samp></dt>
  11922. <dd><p>Maximum (Worst Quality) Quantizer.
  11923. Can be changed per-frame.
  11924. </p>
  11925. </dd>
  11926. <dt><samp class="option">bufsize (<em class="emph">buf-sz</em>, <em class="emph">buf-optimal-sz</em>)</samp></dt>
  11927. <dd><p>Set ratecontrol buffer size (in bits). Note <code class="command">vpxenc</code>&rsquo;s options are
  11928. specified in milliseconds, the libvpx wrapper converts this value as follows:
  11929. <code class="code">buf-sz = bufsize * 1000 / bitrate</code>,
  11930. <code class="code">buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6</code>.
  11931. </p>
  11932. </dd>
  11933. <dt><samp class="option">rc_init_occupancy (<em class="emph">buf-initial-sz</em>)</samp></dt>
  11934. <dd><p>Set number of bits which should be loaded into the rc buffer before decoding
  11935. starts. Note <code class="command">vpxenc</code>&rsquo;s option is specified in milliseconds, the libvpx
  11936. wrapper converts this value as follows:
  11937. <code class="code">rc_init_occupancy * 1000 / bitrate</code>.
  11938. </p>
  11939. </dd>
  11940. <dt><samp class="option">undershoot-pct</samp></dt>
  11941. <dd><p>Set datarate undershoot (min) percentage of the target bitrate.
  11942. </p>
  11943. </dd>
  11944. <dt><samp class="option">overshoot-pct</samp></dt>
  11945. <dd><p>Set datarate overshoot (max) percentage of the target bitrate.
  11946. </p>
  11947. </dd>
  11948. <dt><samp class="option">skip_threshold (<em class="emph">drop-frame</em>)</samp></dt>
  11949. <dt><samp class="option">qcomp (<em class="emph">bias-pct</em>)</samp></dt>
  11950. <dt><samp class="option">maxrate (<em class="emph">maxsection-pct</em>)</samp></dt>
  11951. <dd><p>Set GOP max bitrate in bits/s. Note <code class="command">vpxenc</code>&rsquo;s option is specified as a
  11952. percentage of the target bitrate, the libvpx wrapper converts this value as
  11953. follows: <code class="code">(maxrate * 100 / bitrate)</code>.
  11954. </p>
  11955. </dd>
  11956. <dt><samp class="option">minrate (<em class="emph">minsection-pct</em>)</samp></dt>
  11957. <dd><p>Set GOP min bitrate in bits/s. Note <code class="command">vpxenc</code>&rsquo;s option is specified as a
  11958. percentage of the target bitrate, the libvpx wrapper converts this value as
  11959. follows: <code class="code">(minrate * 100 / bitrate)</code>.
  11960. </p>
  11961. </dd>
  11962. <dt><samp class="option">minrate, maxrate, b <em class="emph">end-usage=cbr</em></samp></dt>
  11963. <dd><p><code class="code">(minrate == maxrate == bitrate)</code>.
  11964. </p>
  11965. </dd>
  11966. <dt><samp class="option">crf (<em class="emph">end-usage=cq</em>, <em class="emph">cq-level</em>)</samp></dt>
  11967. <dt><samp class="option">tune (<em class="emph">tune</em>)</samp></dt>
  11968. <dd><dl class="table">
  11969. <dt>&lsquo;<samp class="samp">psnr (<em class="emph">psnr</em>)</samp>&rsquo;</dt>
  11970. <dt>&lsquo;<samp class="samp">ssim (<em class="emph">ssim</em>)</samp>&rsquo;</dt>
  11971. </dl>
  11972. </dd>
  11973. <dt><samp class="option">quality, deadline (<em class="emph">deadline</em>)</samp></dt>
  11974. <dd><dl class="table">
  11975. <dt>&lsquo;<samp class="samp">best</samp>&rsquo;</dt>
  11976. <dd><p>Use best quality deadline. Poorly named and quite slow, this option should be
  11977. avoided as it may give worse quality output than good.
  11978. </p></dd>
  11979. <dt>&lsquo;<samp class="samp">good</samp>&rsquo;</dt>
  11980. <dd><p>Use good quality deadline. This is a good trade-off between speed and quality
  11981. when used with the <samp class="option">cpu-used</samp> option.
  11982. </p></dd>
  11983. <dt>&lsquo;<samp class="samp">realtime</samp>&rsquo;</dt>
  11984. <dd><p>Use realtime quality deadline.
  11985. </p></dd>
  11986. </dl>
  11987. </dd>
  11988. <dt><samp class="option">speed, cpu-used (<em class="emph">cpu-used</em>)</samp></dt>
  11989. <dd><p>Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  11990. of quality.
  11991. </p>
  11992. </dd>
  11993. <dt><samp class="option">nr (<em class="emph">noise-sensitivity</em>)</samp></dt>
  11994. <dt><samp class="option">static-thresh</samp></dt>
  11995. <dd><p>Set a change threshold on blocks below which they will be skipped by the
  11996. encoder.
  11997. </p>
  11998. </dd>
  11999. <dt><samp class="option">slices (<em class="emph">token-parts</em>)</samp></dt>
  12000. <dd><p>Note that FFmpeg&rsquo;s <samp class="option">slices</samp> option gives the total number of partitions,
  12001. while <code class="command">vpxenc</code>&rsquo;s <samp class="option">token-parts</samp> is given as
  12002. <code class="code">log2(partitions)</code>.
  12003. </p>
  12004. </dd>
  12005. <dt><samp class="option">max-intra-rate</samp></dt>
  12006. <dd><p>Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  12007. means unlimited.
  12008. </p>
  12009. </dd>
  12010. <dt><samp class="option">force_key_frames</samp></dt>
  12011. <dd><p><code class="code">VPX_EFLAG_FORCE_KF</code>
  12012. </p>
  12013. </dd>
  12014. <dt><samp class="option">Alternate reference frame related</samp></dt>
  12015. <dd><dl class="table">
  12016. <dt><samp class="option">auto-alt-ref</samp></dt>
  12017. <dd><p>Enable use of alternate reference frames (2-pass only).
  12018. Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
  12019. </p></dd>
  12020. <dt><samp class="option">arnr-maxframes</samp></dt>
  12021. <dd><p>Set altref noise reduction max frame count.
  12022. </p></dd>
  12023. <dt><samp class="option">arnr-type</samp></dt>
  12024. <dd><p>Set altref noise reduction filter type: backward, forward, centered.
  12025. </p></dd>
  12026. <dt><samp class="option">arnr-strength</samp></dt>
  12027. <dd><p>Set altref noise reduction filter strength.
  12028. </p></dd>
  12029. <dt><samp class="option">rc-lookahead, lag-in-frames (<em class="emph">lag-in-frames</em>)</samp></dt>
  12030. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  12031. </p></dd>
  12032. <dt><samp class="option">min-gf-interval</samp></dt>
  12033. <dd><p>Set minimum golden/alternate reference frame interval (VP9 only).
  12034. </p></dd>
  12035. </dl>
  12036. </dd>
  12037. <dt><samp class="option">error-resilient</samp></dt>
  12038. <dd><p>Enable error resiliency features.
  12039. </p>
  12040. </dd>
  12041. <dt><samp class="option">sharpness <var class="var">integer</var></samp></dt>
  12042. <dd><p>Increase sharpness at the expense of lower PSNR.
  12043. The valid range is [0, 7].
  12044. </p>
  12045. </dd>
  12046. <dt><samp class="option">ts-parameters</samp></dt>
  12047. <dd><p>Sets the temporal scalability configuration using a :-separated list of
  12048. key=value pairs. For example, to specify temporal scalability parameters
  12049. with <code class="code">ffmpeg</code>:
  12050. </p><div class="example">
  12051. <pre class="example-preformatted">ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
  12052. ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
  12053. ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
  12054. </pre></div>
  12055. <p>Below is a brief explanation of each of the parameters, please
  12056. refer to <code class="code">struct vpx_codec_enc_cfg</code> in <code class="code">vpx/vpx_encoder.h</code> for more
  12057. details.
  12058. </p><dl class="table">
  12059. <dt><samp class="option">ts_number_layers</samp></dt>
  12060. <dd><p>Number of temporal coding layers.
  12061. </p></dd>
  12062. <dt><samp class="option">ts_target_bitrate</samp></dt>
  12063. <dd><p>Target bitrate for each temporal layer (in kbps).
  12064. (bitrate should be inclusive of the lower temporal layer).
  12065. </p></dd>
  12066. <dt><samp class="option">ts_rate_decimator</samp></dt>
  12067. <dd><p>Frame rate decimation factor for each temporal layer.
  12068. </p></dd>
  12069. <dt><samp class="option">ts_periodicity</samp></dt>
  12070. <dd><p>Length of the sequence defining frame temporal layer membership.
  12071. </p></dd>
  12072. <dt><samp class="option">ts_layer_id</samp></dt>
  12073. <dd><p>Template defining the membership of frames to temporal layers.
  12074. </p></dd>
  12075. <dt><samp class="option">ts_layering_mode</samp></dt>
  12076. <dd><p>(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
  12077. Currently supports the following options.
  12078. </p><dl class="table">
  12079. <dt><samp class="option">0</samp></dt>
  12080. <dd><p>No temporal layering flags are provided internally,
  12081. relies on flags being passed in using <code class="code">metadata</code> field in <code class="code">AVFrame</code>
  12082. with following keys.
  12083. </p><dl class="table">
  12084. <dt><samp class="option">vp8-flags</samp></dt>
  12085. <dd><p>Sets the flags passed into the encoder to indicate the referencing scheme for
  12086. the current frame.
  12087. Refer to function <code class="code">vpx_codec_encode</code> in <code class="code">vpx/vpx_encoder.h</code> for more
  12088. details.
  12089. </p></dd>
  12090. <dt><samp class="option">temporal_id</samp></dt>
  12091. <dd><p>Explicitly sets the temporal id of the current frame to encode.
  12092. </p></dd>
  12093. </dl>
  12094. </dd>
  12095. <dt><samp class="option">2</samp></dt>
  12096. <dd><p>Two temporal layers. 0-1...
  12097. </p></dd>
  12098. <dt><samp class="option">3</samp></dt>
  12099. <dd><p>Three temporal layers. 0-2-1-2...; with single reference frame.
  12100. </p></dd>
  12101. <dt><samp class="option">4</samp></dt>
  12102. <dd><p>Same as option &quot;3&quot;, except there is a dependency between
  12103. the two temporal layer 2 frames within the temporal period.
  12104. </p></dd>
  12105. </dl>
  12106. </dd>
  12107. </dl>
  12108. </dd>
  12109. <dt><samp class="option">VP8-specific options</samp></dt>
  12110. <dd><dl class="table">
  12111. <dt><samp class="option">screen-content-mode</samp></dt>
  12112. <dd><p>Screen content mode, one of: 0 (off), 1 (screen), 2 (screen with more aggressive rate control).
  12113. </p></dd>
  12114. </dl>
  12115. </dd>
  12116. <dt><samp class="option">VP9-specific options</samp></dt>
  12117. <dd><dl class="table">
  12118. <dt><samp class="option">lossless</samp></dt>
  12119. <dd><p>Enable lossless mode.
  12120. </p></dd>
  12121. <dt><samp class="option">tile-columns</samp></dt>
  12122. <dd><p>Set number of tile columns to use. Note this is given as
  12123. <code class="code">log2(tile_columns)</code>. For example, 8 tile columns would be requested by
  12124. setting the <samp class="option">tile-columns</samp> option to 3.
  12125. </p></dd>
  12126. <dt><samp class="option">tile-rows</samp></dt>
  12127. <dd><p>Set number of tile rows to use. Note this is given as <code class="code">log2(tile_rows)</code>.
  12128. For example, 4 tile rows would be requested by setting the <samp class="option">tile-rows</samp>
  12129. option to 2.
  12130. </p></dd>
  12131. <dt><samp class="option">frame-parallel</samp></dt>
  12132. <dd><p>Enable frame parallel decodability features.
  12133. </p></dd>
  12134. <dt><samp class="option">aq-mode</samp></dt>
  12135. <dd><p>Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  12136. cyclic refresh, 4: equator360).
  12137. </p></dd>
  12138. <dt><samp class="option">colorspace <em class="emph">color-space</em></samp></dt>
  12139. <dd><p>Set input color space. The VP9 bitstream supports signaling the following
  12140. colorspaces:
  12141. </p><dl class="table">
  12142. <dt><samp class="option">&lsquo;<samp class="samp">rgb</samp>&rsquo; <em class="emph">sRGB</em></samp></dt>
  12143. <dt><samp class="option">&lsquo;<samp class="samp">bt709</samp>&rsquo; <em class="emph">bt709</em></samp></dt>
  12144. <dt><samp class="option">&lsquo;<samp class="samp">unspecified</samp>&rsquo; <em class="emph">unknown</em></samp></dt>
  12145. <dt><samp class="option">&lsquo;<samp class="samp">bt470bg</samp>&rsquo; <em class="emph">bt601</em></samp></dt>
  12146. <dt><samp class="option">&lsquo;<samp class="samp">smpte170m</samp>&rsquo; <em class="emph">smpte170</em></samp></dt>
  12147. <dt><samp class="option">&lsquo;<samp class="samp">smpte240m</samp>&rsquo; <em class="emph">smpte240</em></samp></dt>
  12148. <dt><samp class="option">&lsquo;<samp class="samp">bt2020_ncl</samp>&rsquo; <em class="emph">bt2020</em></samp></dt>
  12149. </dl>
  12150. </dd>
  12151. <dt><samp class="option">row-mt <var class="var">boolean</var></samp></dt>
  12152. <dd><p>Enable row based multi-threading.
  12153. </p></dd>
  12154. <dt><samp class="option">tune-content</samp></dt>
  12155. <dd><p>Set content type: default (0), screen (1), film (2).
  12156. </p></dd>
  12157. <dt><samp class="option">corpus-complexity</samp></dt>
  12158. <dd><p>Corpus VBR mode is a variant of standard VBR where the complexity distribution
  12159. midpoint is passed in rather than calculated for a specific clip or chunk.
  12160. </p>
  12161. <p>The valid range is [0, 10000]. 0 (default) uses standard VBR.
  12162. </p></dd>
  12163. <dt><samp class="option">enable-tpl <var class="var">boolean</var></samp></dt>
  12164. <dd><p>Enable temporal dependency model.
  12165. </p></dd>
  12166. <dt><samp class="option">ref-frame-config</samp></dt>
  12167. <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.
  12168. <br>Use a :-separated list of key=value pairs.
  12169. For example,
  12170. </p><div class="example">
  12171. <pre class="example-preformatted">av_dict_set(&amp;av_frame-&gt;metadata, &quot;ref-frame-config&quot;, \
  12172. &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;);
  12173. </pre></div>
  12174. <dl class="table">
  12175. <dt><samp class="option">rfc_update_buffer_slot</samp></dt>
  12176. <dd><p>Indicates the buffer slot number to update
  12177. </p></dd>
  12178. <dt><samp class="option">rfc_update_last</samp></dt>
  12179. <dd><p>Indicates whether to update the LAST frame
  12180. </p></dd>
  12181. <dt><samp class="option">rfc_update_golden</samp></dt>
  12182. <dd><p>Indicates whether to update GOLDEN frame
  12183. </p></dd>
  12184. <dt><samp class="option">rfc_update_alt_ref</samp></dt>
  12185. <dd><p>Indicates whether to update ALT_REF frame
  12186. </p></dd>
  12187. <dt><samp class="option">rfc_lst_fb_idx</samp></dt>
  12188. <dd><p>LAST frame buffer index
  12189. </p></dd>
  12190. <dt><samp class="option">rfc_gld_fb_idx</samp></dt>
  12191. <dd><p>GOLDEN frame buffer index
  12192. </p></dd>
  12193. <dt><samp class="option">rfc_alt_fb_idx</samp></dt>
  12194. <dd><p>ALT_REF frame buffer index
  12195. </p></dd>
  12196. <dt><samp class="option">rfc_reference_last</samp></dt>
  12197. <dd><p>Indicates whether to reference LAST frame
  12198. </p></dd>
  12199. <dt><samp class="option">rfc_reference_golden</samp></dt>
  12200. <dd><p>Indicates whether to reference GOLDEN frame
  12201. </p></dd>
  12202. <dt><samp class="option">rfc_reference_alt_ref</samp></dt>
  12203. <dd><p>Indicates whether to reference ALT_REF frame
  12204. </p></dd>
  12205. <dt><samp class="option">rfc_reference_duration</samp></dt>
  12206. <dd><p>Indicates frame duration
  12207. </p></dd>
  12208. </dl>
  12209. </dd>
  12210. </dl>
  12211. </dd>
  12212. </dl>
  12213. <p>For more information about libvpx see:
  12214. <a class="url" href="http://www.webmproject.org/">http://www.webmproject.org/</a>
  12215. </p>
  12216. </div>
  12217. </div>
  12218. <div class="section-level-extent" id="libwebp">
  12219. <h3 class="section"><span>16.14 libwebp<a class="copiable-link" href="#libwebp"> &para;</a></span></h3>
  12220. <p>libwebp WebP Image encoder wrapper
  12221. </p>
  12222. <p>libwebp is Google&rsquo;s official encoder for WebP images. It can encode in either
  12223. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  12224. frame. Lossless images are a separate codec developed by Google.
  12225. </p>
  12226. <ul class="mini-toc">
  12227. <li><a href="#Pixel-Format" accesskey="1">Pixel Format</a></li>
  12228. <li><a href="#Options-35" accesskey="2">Options</a></li>
  12229. </ul>
  12230. <div class="subsection-level-extent" id="Pixel-Format">
  12231. <h4 class="subsection"><span>16.14.1 Pixel Format<a class="copiable-link" href="#Pixel-Format"> &para;</a></span></h4>
  12232. <p>Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  12233. to limitations of the format and libwebp. Alpha is supported for either mode.
  12234. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  12235. passed in for encoding lossless, the pixel format will automatically be
  12236. converted using functions from libwebp. This is not ideal and is done only for
  12237. convenience.
  12238. </p>
  12239. </div>
  12240. <div class="subsection-level-extent" id="Options-35">
  12241. <h4 class="subsection"><span>16.14.2 Options<a class="copiable-link" href="#Options-35"> &para;</a></span></h4>
  12242. <dl class="table">
  12243. <dt><samp class="option">-lossless <var class="var">boolean</var></samp></dt>
  12244. <dd><p>Enables/Disables use of lossless mode. Default is 0.
  12245. </p>
  12246. </dd>
  12247. <dt><samp class="option">-compression_level <var class="var">integer</var></samp></dt>
  12248. <dd><p>For lossy, this is a quality/speed tradeoff. Higher values give better quality
  12249. for a given size at the cost of increased encoding time. For lossless, this is
  12250. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  12251. encoding time. More specifically, it controls the number of extra algorithms
  12252. and compression tools used, and varies the combination of these tools. This
  12253. maps to the <var class="var">method</var> option in libwebp. The valid range is 0 to 6.
  12254. Default is 4.
  12255. </p>
  12256. </dd>
  12257. <dt><samp class="option">-quality <var class="var">float</var></samp></dt>
  12258. <dd><p>For lossy encoding, this controls image quality. For lossless encoding, this
  12259. controls the effort and time spent in compression.
  12260. Range is 0 to 100. Default is 75.
  12261. </p>
  12262. </dd>
  12263. <dt><samp class="option">-preset <var class="var">type</var></samp></dt>
  12264. <dd><p>Configuration preset. This does some automatic settings based on the general
  12265. type of the image.
  12266. </p><dl class="table">
  12267. <dt><samp class="option">none</samp></dt>
  12268. <dd><p>Do not use a preset.
  12269. </p></dd>
  12270. <dt><samp class="option">default</samp></dt>
  12271. <dd><p>Use the encoder default.
  12272. </p></dd>
  12273. <dt><samp class="option">picture</samp></dt>
  12274. <dd><p>Digital picture, like portrait, inner shot
  12275. </p></dd>
  12276. <dt><samp class="option">photo</samp></dt>
  12277. <dd><p>Outdoor photograph, with natural lighting
  12278. </p></dd>
  12279. <dt><samp class="option">drawing</samp></dt>
  12280. <dd><p>Hand or line drawing, with high-contrast details
  12281. </p></dd>
  12282. <dt><samp class="option">icon</samp></dt>
  12283. <dd><p>Small-sized colorful images
  12284. </p></dd>
  12285. <dt><samp class="option">text</samp></dt>
  12286. <dd><p>Text-like
  12287. </p></dd>
  12288. </dl>
  12289. </dd>
  12290. </dl>
  12291. </div>
  12292. </div>
  12293. <div class="section-level-extent" id="libx264_002c-libx264rgb">
  12294. <h3 class="section"><span>16.15 libx264, libx264rgb<a class="copiable-link" href="#libx264_002c-libx264rgb"> &para;</a></span></h3>
  12295. <p>x264 H.264/MPEG-4 AVC encoder wrapper.
  12296. </p>
  12297. <p>This encoder requires the presence of the libx264 headers and library
  12298. during configuration. You need to explicitly configure the build with
  12299. <code class="code">--enable-libx264</code>.
  12300. </p>
  12301. <p>libx264 supports an impressive number of features, including 8x8 and
  12302. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  12303. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  12304. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  12305. </p>
  12306. <p>Many libx264 encoder options are mapped to FFmpeg global codec
  12307. options, while unique encoder options are provided through private
  12308. options. Additionally the <samp class="option">x264opts</samp> and <samp class="option">x264-params</samp>
  12309. private options allows one to pass a list of key=value tuples as accepted
  12310. by the libx264 <code class="code">x264_param_parse</code> function.
  12311. </p>
  12312. <p>The x264 project website is at
  12313. <a class="url" href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>.
  12314. </p>
  12315. <p>The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  12316. pixel formats as input instead of YUV.
  12317. </p>
  12318. <ul class="mini-toc">
  12319. <li><a href="#Supported-Pixel-Formats" accesskey="1">Supported Pixel Formats</a></li>
  12320. <li><a href="#Options-36" accesskey="2">Options</a></li>
  12321. </ul>
  12322. <div class="subsection-level-extent" id="Supported-Pixel-Formats">
  12323. <h4 class="subsection"><span>16.15.1 Supported Pixel Formats<a class="copiable-link" href="#Supported-Pixel-Formats"> &para;</a></span></h4>
  12324. <p>x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  12325. x264&rsquo;s configure time.
  12326. </p>
  12327. </div>
  12328. <div class="subsection-level-extent" id="Options-36">
  12329. <h4 class="subsection"><span>16.15.2 Options<a class="copiable-link" href="#Options-36"> &para;</a></span></h4>
  12330. <p>The following options are supported by the libx264 wrapper. The
  12331. <code class="command">x264</code>-equivalent options or values are listed in parentheses
  12332. for easy migration.
  12333. </p>
  12334. <p>To reduce the duplication of documentation, only the private options
  12335. and some others requiring special attention are documented here. For
  12336. the documentation of the undocumented generic options, see
  12337. <a class="ref" href="#codec_002doptions">the Codec Options chapter</a>.
  12338. </p>
  12339. <p>To get a more accurate and extensive documentation of the libx264
  12340. options, invoke the command <code class="command">x264 --fullhelp</code> or consult
  12341. the libx264 documentation.
  12342. </p>
  12343. <p>In the list below, note that the <code class="command">x264</code> option name is shown
  12344. in parentheses after the libavcodec corresponding name, in case there
  12345. is a direct mapping.
  12346. </p>
  12347. <dl class="table">
  12348. <dt><samp class="option">b (<em class="emph">bitrate</em>)</samp></dt>
  12349. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s <samp class="option">b</samp> option is
  12350. expressed in bits/s, while <code class="command">x264</code>&rsquo;s <samp class="option">bitrate</samp> is in
  12351. kilobits/s.
  12352. </p>
  12353. </dd>
  12354. <dt><samp class="option">bf (<em class="emph">bframes</em>)</samp></dt>
  12355. <dd><p>Number of B-frames between I and P-frames
  12356. </p>
  12357. </dd>
  12358. <dt><samp class="option">g (<em class="emph">keyint</em>)</samp></dt>
  12359. <dd><p>Maximum GOP size
  12360. </p>
  12361. </dd>
  12362. <dt><samp class="option">qmin (<em class="emph">qpmin</em>)</samp></dt>
  12363. <dd><p>Minimum quantizer scale
  12364. </p>
  12365. </dd>
  12366. <dt><samp class="option">qmax (<em class="emph">qpmax</em>)</samp></dt>
  12367. <dd><p>Maximum quantizer scale
  12368. </p>
  12369. </dd>
  12370. <dt><samp class="option">qdiff (<em class="emph">qpstep</em>)</samp></dt>
  12371. <dd><p>Maximum difference between quantizer scales
  12372. </p>
  12373. </dd>
  12374. <dt><samp class="option">qblur (<em class="emph">qblur</em>)</samp></dt>
  12375. <dd><p>Quantizer curve blur
  12376. </p>
  12377. </dd>
  12378. <dt><samp class="option">qcomp (<em class="emph">qcomp</em>)</samp></dt>
  12379. <dd><p>Quantizer curve compression factor
  12380. </p>
  12381. </dd>
  12382. <dt><samp class="option">refs (<em class="emph">ref</em>)</samp></dt>
  12383. <dd><p>Number of reference frames each P-frame can use. The range is <var class="var">0-16</var>.
  12384. </p>
  12385. </dd>
  12386. <dt><samp class="option">level (<em class="emph">level</em>)</samp></dt>
  12387. <dd><p>Set the <code class="code">x264_param_t.i_level_idc</code> value in case the value is
  12388. positive, it is ignored otherwise.
  12389. </p>
  12390. <p>This value can be set using the <code class="code">AVCodecContext</code> API (e.g. by
  12391. setting the <code class="code">AVCodecContext</code> value directly), and is specified as
  12392. an integer mapped on a corresponding level (e.g. the value 31 maps
  12393. to H.264 level IDC &quot;3.1&quot;, as defined in the <code class="code">x264_levels</code>
  12394. table). It is ignored when set to a non positive value.
  12395. </p>
  12396. <p>Alternatively it can be set as a private option, overriding the value
  12397. set in <code class="code">AVCodecContext</code>, and in this case must be specified as
  12398. the level IDC identifier (e.g. &quot;3.1&quot;), as defined by H.264 Annex A.
  12399. </p>
  12400. </dd>
  12401. <dt><samp class="option">sc_threshold (<em class="emph">scenecut</em>)</samp></dt>
  12402. <dd><p>Sets the threshold for the scene change detection.
  12403. </p>
  12404. </dd>
  12405. <dt><samp class="option">trellis (<em class="emph">trellis</em>)</samp></dt>
  12406. <dd><p>Performs Trellis quantization to increase efficiency. Enabled by default.
  12407. </p>
  12408. </dd>
  12409. <dt><samp class="option">nr (<em class="emph">nr</em>)</samp></dt>
  12410. <dd><p>Noise reduction
  12411. </p>
  12412. </dd>
  12413. <dt><samp class="option">me_range (<em class="emph">merange</em>)</samp></dt>
  12414. <dd><p>Maximum range of the motion search in pixels.
  12415. </p>
  12416. </dd>
  12417. <dt><samp class="option">me_method (<em class="emph">me</em>)</samp></dt>
  12418. <dd><p>Set motion estimation method. Possible values in the decreasing order
  12419. of speed:
  12420. </p>
  12421. <dl class="table">
  12422. <dt>&lsquo;<samp class="samp">dia (<em class="emph">dia</em>)</samp>&rsquo;</dt>
  12423. <dt>&lsquo;<samp class="samp">epzs (<em class="emph">dia</em>)</samp>&rsquo;</dt>
  12424. <dd><p>Diamond search with radius 1 (fastest). &lsquo;<samp class="samp">epzs</samp>&rsquo; is an alias for
  12425. &lsquo;<samp class="samp">dia</samp>&rsquo;.
  12426. </p></dd>
  12427. <dt>&lsquo;<samp class="samp">hex (<em class="emph">hex</em>)</samp>&rsquo;</dt>
  12428. <dd><p>Hexagonal search with radius 2.
  12429. </p></dd>
  12430. <dt>&lsquo;<samp class="samp">umh (<em class="emph">umh</em>)</samp>&rsquo;</dt>
  12431. <dd><p>Uneven multi-hexagon search.
  12432. </p></dd>
  12433. <dt>&lsquo;<samp class="samp">esa (<em class="emph">esa</em>)</samp>&rsquo;</dt>
  12434. <dd><p>Exhaustive search.
  12435. </p></dd>
  12436. <dt>&lsquo;<samp class="samp">tesa (<em class="emph">tesa</em>)</samp>&rsquo;</dt>
  12437. <dd><p>Hadamard exhaustive search (slowest).
  12438. </p></dd>
  12439. </dl>
  12440. </dd>
  12441. <dt><samp class="option">forced-idr</samp></dt>
  12442. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  12443. of I-frame. This option forces it to choose an IDR-frame.
  12444. </p>
  12445. </dd>
  12446. <dt><samp class="option">subq (<em class="emph">subme</em>)</samp></dt>
  12447. <dd><p>Sub-pixel motion estimation method.
  12448. </p>
  12449. </dd>
  12450. <dt><samp class="option">b_strategy (<em class="emph">b-adapt</em>)</samp></dt>
  12451. <dd><p>Adaptive B-frame placement decision algorithm. Use only on first-pass.
  12452. </p>
  12453. </dd>
  12454. <dt><samp class="option">keyint_min (<em class="emph">min-keyint</em>)</samp></dt>
  12455. <dd><p>Minimum GOP size.
  12456. </p>
  12457. </dd>
  12458. <dt><samp class="option">coder</samp></dt>
  12459. <dd><p>Set entropy encoder. Possible values:
  12460. </p>
  12461. <dl class="table">
  12462. <dt>&lsquo;<samp class="samp">ac</samp>&rsquo;</dt>
  12463. <dd><p>Enable CABAC.
  12464. </p>
  12465. </dd>
  12466. <dt>&lsquo;<samp class="samp">vlc</samp>&rsquo;</dt>
  12467. <dd><p>Enable CAVLC and disable CABAC. It generates the same effect as
  12468. <code class="command">x264</code>&rsquo;s <samp class="option">--no-cabac</samp> option.
  12469. </p></dd>
  12470. </dl>
  12471. </dd>
  12472. <dt><samp class="option">cmp</samp></dt>
  12473. <dd><p>Set full pixel motion estimation comparison algorithm. Possible values:
  12474. </p>
  12475. <dl class="table">
  12476. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  12477. <dd><p>Enable chroma in motion estimation.
  12478. </p>
  12479. </dd>
  12480. <dt>&lsquo;<samp class="samp">sad</samp>&rsquo;</dt>
  12481. <dd><p>Ignore chroma in motion estimation. It generates the same effect as
  12482. <code class="command">x264</code>&rsquo;s <samp class="option">--no-chroma-me</samp> option.
  12483. </p></dd>
  12484. </dl>
  12485. </dd>
  12486. <dt><samp class="option">threads (<em class="emph">threads</em>)</samp></dt>
  12487. <dd><p>Number of encoding threads.
  12488. </p>
  12489. </dd>
  12490. <dt><samp class="option">thread_type</samp></dt>
  12491. <dd><p>Set multithreading technique. Possible values:
  12492. </p>
  12493. <dl class="table">
  12494. <dt>&lsquo;<samp class="samp">slice</samp>&rsquo;</dt>
  12495. <dd><p>Slice-based multithreading. It generates the same effect as
  12496. <code class="command">x264</code>&rsquo;s <samp class="option">--sliced-threads</samp> option.
  12497. </p></dd>
  12498. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  12499. <dd><p>Frame-based multithreading.
  12500. </p></dd>
  12501. </dl>
  12502. </dd>
  12503. <dt><samp class="option">flags</samp></dt>
  12504. <dd><p>Set encoding flags. It can be used to disable closed GOP and enable
  12505. open GOP by setting it to <code class="code">-cgop</code>. The result is similar to
  12506. the behavior of <code class="command">x264</code>&rsquo;s <samp class="option">--open-gop</samp> option.
  12507. </p>
  12508. </dd>
  12509. <dt><samp class="option">rc_init_occupancy (<em class="emph">vbv-init</em>)</samp></dt>
  12510. <dd><p>Initial VBV buffer occupancy
  12511. </p>
  12512. </dd>
  12513. <dt><samp class="option">preset (<em class="emph">preset</em>)</samp></dt>
  12514. <dd><p>Set the encoding preset.
  12515. </p>
  12516. </dd>
  12517. <dt><samp class="option">tune (<em class="emph">tune</em>)</samp></dt>
  12518. <dd><p>Set tuning of the encoding params.
  12519. </p>
  12520. </dd>
  12521. <dt><samp class="option">profile (<em class="emph">profile</em>)</samp></dt>
  12522. <dd><p>Set profile restrictions.
  12523. </p>
  12524. </dd>
  12525. <dt><samp class="option">fastfirstpass</samp></dt>
  12526. <dd><p>Enable fast settings when encoding first pass, when set to 1. When set
  12527. to 0, it has the same effect of <code class="command">x264</code>&rsquo;s
  12528. <samp class="option">--slow-firstpass</samp> option.
  12529. </p>
  12530. </dd>
  12531. <dt><samp class="option">crf (<em class="emph">crf</em>)</samp></dt>
  12532. <dd><p>Set the quality for constant quality mode.
  12533. </p>
  12534. </dd>
  12535. <dt><samp class="option">crf_max (<em class="emph">crf-max</em>)</samp></dt>
  12536. <dd><p>In CRF mode, prevents VBV from lowering quality beyond this point.
  12537. </p>
  12538. </dd>
  12539. <dt><samp class="option">qp (<em class="emph">qp</em>)</samp></dt>
  12540. <dd><p>Set constant quantization rate control method parameter.
  12541. </p>
  12542. </dd>
  12543. <dt><samp class="option">aq-mode (<em class="emph">aq-mode</em>)</samp></dt>
  12544. <dd><p>Set AQ method. Possible values:
  12545. </p>
  12546. <dl class="table">
  12547. <dt>&lsquo;<samp class="samp">none (<em class="emph">0</em>)</samp>&rsquo;</dt>
  12548. <dd><p>Disabled.
  12549. </p>
  12550. </dd>
  12551. <dt>&lsquo;<samp class="samp">variance (<em class="emph">1</em>)</samp>&rsquo;</dt>
  12552. <dd><p>Variance AQ (complexity mask).
  12553. </p>
  12554. </dd>
  12555. <dt>&lsquo;<samp class="samp">autovariance (<em class="emph">2</em>)</samp>&rsquo;</dt>
  12556. <dd><p>Auto-variance AQ (experimental).
  12557. </p></dd>
  12558. </dl>
  12559. </dd>
  12560. <dt><samp class="option">aq-strength (<em class="emph">aq-strength</em>)</samp></dt>
  12561. <dd><p>Set AQ strength, reduce blocking and blurring in flat and textured areas.
  12562. </p>
  12563. </dd>
  12564. <dt><samp class="option">psy</samp></dt>
  12565. <dd><p>Use psychovisual optimizations when set to 1. When set to 0, it has the
  12566. same effect as <code class="command">x264</code>&rsquo;s <samp class="option">--no-psy</samp> option.
  12567. </p>
  12568. </dd>
  12569. <dt><samp class="option">psy-rd (<em class="emph">psy-rd</em>)</samp></dt>
  12570. <dd><p>Set strength of psychovisual optimization, in
  12571. <var class="var">psy-rd</var>:<var class="var">psy-trellis</var> format.
  12572. </p>
  12573. </dd>
  12574. <dt><samp class="option">rc-lookahead (<em class="emph">rc-lookahead</em>)</samp></dt>
  12575. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  12576. </p>
  12577. </dd>
  12578. <dt><samp class="option">weightb</samp></dt>
  12579. <dd><p>Enable weighted prediction for B-frames when set to 1. When set to 0,
  12580. it has the same effect as <code class="command">x264</code>&rsquo;s <samp class="option">--no-weightb</samp> option.
  12581. </p>
  12582. </dd>
  12583. <dt><samp class="option">weightp (<em class="emph">weightp</em>)</samp></dt>
  12584. <dd><p>Set weighted prediction method for P-frames. Possible values:
  12585. </p>
  12586. <dl class="table">
  12587. <dt>&lsquo;<samp class="samp">none (<em class="emph">0</em>)</samp>&rsquo;</dt>
  12588. <dd><p>Disabled
  12589. </p></dd>
  12590. <dt>&lsquo;<samp class="samp">simple (<em class="emph">1</em>)</samp>&rsquo;</dt>
  12591. <dd><p>Enable only weighted refs
  12592. </p></dd>
  12593. <dt>&lsquo;<samp class="samp">smart (<em class="emph">2</em>)</samp>&rsquo;</dt>
  12594. <dd><p>Enable both weighted refs and duplicates
  12595. </p></dd>
  12596. </dl>
  12597. </dd>
  12598. <dt><samp class="option">ssim (<em class="emph">ssim</em>)</samp></dt>
  12599. <dd><p>Enable calculation and printing SSIM stats after the encoding.
  12600. </p>
  12601. </dd>
  12602. <dt><samp class="option">intra-refresh (<em class="emph">intra-refresh</em>)</samp></dt>
  12603. <dd><p>Enable the use of Periodic Intra Refresh instead of IDR frames when set
  12604. to 1.
  12605. </p>
  12606. </dd>
  12607. <dt><samp class="option">avcintra-class (<em class="emph">class</em>)</samp></dt>
  12608. <dd><p>Configure the encoder to generate AVC-Intra.
  12609. Valid values are 50, 100 and 200
  12610. </p>
  12611. </dd>
  12612. <dt><samp class="option">bluray-compat (<em class="emph">bluray-compat</em>)</samp></dt>
  12613. <dd><p>Configure the encoder to be compatible with the bluray standard.
  12614. It is a shorthand for setting &quot;bluray-compat=1 force-cfr=1&quot;.
  12615. </p>
  12616. </dd>
  12617. <dt><samp class="option">b-bias (<em class="emph">b-bias</em>)</samp></dt>
  12618. <dd><p>Set the influence on how often B-frames are used.
  12619. </p>
  12620. </dd>
  12621. <dt><samp class="option">b-pyramid (<em class="emph">b-pyramid</em>)</samp></dt>
  12622. <dd><p>Set method for keeping of some B-frames as references. Possible values:
  12623. </p>
  12624. <dl class="table">
  12625. <dt>&lsquo;<samp class="samp">none (<em class="emph">none</em>)</samp>&rsquo;</dt>
  12626. <dd><p>Disabled.
  12627. </p></dd>
  12628. <dt>&lsquo;<samp class="samp">strict (<em class="emph">strict</em>)</samp>&rsquo;</dt>
  12629. <dd><p>Strictly hierarchical pyramid.
  12630. </p></dd>
  12631. <dt>&lsquo;<samp class="samp">normal (<em class="emph">normal</em>)</samp>&rsquo;</dt>
  12632. <dd><p>Non-strict (not Blu-ray compatible).
  12633. </p></dd>
  12634. </dl>
  12635. </dd>
  12636. <dt><samp class="option">mixed-refs</samp></dt>
  12637. <dd><p>Enable the use of one reference per partition, as opposed to one
  12638. reference per macroblock when set to 1. When set to 0, it has the
  12639. same effect as <code class="command">x264</code>&rsquo;s <samp class="option">--no-mixed-refs</samp> option.
  12640. </p>
  12641. </dd>
  12642. <dt><samp class="option">8x8dct</samp></dt>
  12643. <dd><p>Enable adaptive spatial transform (high profile 8x8 transform)
  12644. when set to 1. When set to 0, it has the same effect as
  12645. <code class="command">x264</code>&rsquo;s <samp class="option">--no-8x8dct</samp> option.
  12646. </p>
  12647. </dd>
  12648. <dt><samp class="option">fast-pskip</samp></dt>
  12649. <dd><p>Enable early SKIP detection on P-frames when set to 1. When set
  12650. to 0, it has the same effect as <code class="command">x264</code>&rsquo;s
  12651. <samp class="option">--no-fast-pskip</samp> option.
  12652. </p>
  12653. </dd>
  12654. <dt><samp class="option">aud (<em class="emph">aud</em>)</samp></dt>
  12655. <dd><p>Enable use of access unit delimiters when set to 1.
  12656. </p>
  12657. </dd>
  12658. <dt><samp class="option">mbtree</samp></dt>
  12659. <dd><p>Enable use macroblock tree ratecontrol when set to 1. When set
  12660. to 0, it has the same effect as <code class="command">x264</code>&rsquo;s
  12661. <samp class="option">--no-mbtree</samp> option.
  12662. </p>
  12663. </dd>
  12664. <dt><samp class="option">deblock (<em class="emph">deblock</em>)</samp></dt>
  12665. <dd><p>Set loop filter parameters, in <var class="var">alpha</var>:<var class="var">beta</var> form.
  12666. </p>
  12667. </dd>
  12668. <dt><samp class="option">cplxblur (<em class="emph">cplxblur</em>)</samp></dt>
  12669. <dd><p>Set fluctuations reduction in QP (before curve compression).
  12670. </p>
  12671. </dd>
  12672. <dt><samp class="option">partitions (<em class="emph">partitions</em>)</samp></dt>
  12673. <dd><p>Set partitions to consider as a comma-separated list of values.
  12674. Possible values in the list:
  12675. </p>
  12676. <dl class="table">
  12677. <dt>&lsquo;<samp class="samp">p8x8</samp>&rsquo;</dt>
  12678. <dd><p>8x8 P-frame partition.
  12679. </p></dd>
  12680. <dt>&lsquo;<samp class="samp">p4x4</samp>&rsquo;</dt>
  12681. <dd><p>4x4 P-frame partition.
  12682. </p></dd>
  12683. <dt>&lsquo;<samp class="samp">b8x8</samp>&rsquo;</dt>
  12684. <dd><p>4x4 B-frame partition.
  12685. </p></dd>
  12686. <dt>&lsquo;<samp class="samp">i8x8</samp>&rsquo;</dt>
  12687. <dd><p>8x8 I-frame partition.
  12688. </p></dd>
  12689. <dt>&lsquo;<samp class="samp">i4x4</samp>&rsquo;</dt>
  12690. <dd><p>4x4 I-frame partition.
  12691. (Enabling &lsquo;<samp class="samp">p4x4</samp>&rsquo; requires &lsquo;<samp class="samp">p8x8</samp>&rsquo; to be enabled. Enabling
  12692. &lsquo;<samp class="samp">i8x8</samp>&rsquo; requires adaptive spatial transform (<samp class="option">8x8dct</samp>
  12693. option) to be enabled.)
  12694. </p></dd>
  12695. <dt>&lsquo;<samp class="samp">none (<em class="emph">none</em>)</samp>&rsquo;</dt>
  12696. <dd><p>Do not consider any partitions.
  12697. </p></dd>
  12698. <dt>&lsquo;<samp class="samp">all (<em class="emph">all</em>)</samp>&rsquo;</dt>
  12699. <dd><p>Consider every partition.
  12700. </p></dd>
  12701. </dl>
  12702. </dd>
  12703. <dt><samp class="option">direct-pred (<em class="emph">direct</em>)</samp></dt>
  12704. <dd><p>Set direct MV prediction mode. Possible values:
  12705. </p>
  12706. <dl class="table">
  12707. <dt>&lsquo;<samp class="samp">none (<em class="emph">none</em>)</samp>&rsquo;</dt>
  12708. <dd><p>Disable MV prediction.
  12709. </p></dd>
  12710. <dt>&lsquo;<samp class="samp">spatial (<em class="emph">spatial</em>)</samp>&rsquo;</dt>
  12711. <dd><p>Enable spatial predicting.
  12712. </p></dd>
  12713. <dt>&lsquo;<samp class="samp">temporal (<em class="emph">temporal</em>)</samp>&rsquo;</dt>
  12714. <dd><p>Enable temporal predicting.
  12715. </p></dd>
  12716. <dt>&lsquo;<samp class="samp">auto (<em class="emph">auto</em>)</samp>&rsquo;</dt>
  12717. <dd><p>Automatically decided.
  12718. </p></dd>
  12719. </dl>
  12720. </dd>
  12721. <dt><samp class="option">slice-max-size (<em class="emph">slice-max-size</em>)</samp></dt>
  12722. <dd><p>Set the limit of the size of each slice in bytes. If not specified
  12723. but RTP payload size (<samp class="option">ps</samp>) is specified, that is used.
  12724. </p>
  12725. </dd>
  12726. <dt><samp class="option">stats (<em class="emph">stats</em>)</samp></dt>
  12727. <dd><p>Set the file name for multi-pass stats.
  12728. </p>
  12729. </dd>
  12730. <dt><samp class="option">nal-hrd (<em class="emph">nal-hrd</em>)</samp></dt>
  12731. <dd><p>Set signal HRD information (requires <samp class="option">vbv-bufsize</samp> to be set).
  12732. Possible values:
  12733. </p>
  12734. <dl class="table">
  12735. <dt>&lsquo;<samp class="samp">none (<em class="emph">none</em>)</samp>&rsquo;</dt>
  12736. <dd><p>Disable HRD information signaling.
  12737. </p></dd>
  12738. <dt>&lsquo;<samp class="samp">vbr (<em class="emph">vbr</em>)</samp>&rsquo;</dt>
  12739. <dd><p>Variable bit rate.
  12740. </p></dd>
  12741. <dt>&lsquo;<samp class="samp">cbr (<em class="emph">cbr</em>)</samp>&rsquo;</dt>
  12742. <dd><p>Constant bit rate (not allowed in MP4 container).
  12743. </p></dd>
  12744. </dl>
  12745. </dd>
  12746. <dt><samp class="option">x264opts <var class="var">opts</var></samp></dt>
  12747. <dt><samp class="option">x264-params <var class="var">opts</var></samp></dt>
  12748. <dd><p>Override the x264 configuration using a :-separated list of key=value
  12749. options.
  12750. </p>
  12751. <p>The argument for both options is a list of <var class="var">key</var>=<var class="var">value</var>
  12752. couples separated by &quot;:&quot;. With <samp class="option">x264opts</samp> the value can be
  12753. omitted, and the value <code class="code">1</code> is assumed in that case.
  12754. </p>
  12755. <p>For <var class="var">filter</var> and <var class="var">psy-rd</var> options values that use &quot;:&quot; as a
  12756. separator themselves, use &quot;,&quot; instead. They accept it as well since
  12757. long ago but this is kept undocumented for some reason.
  12758. </p>
  12759. <p>For example, the options might be provided as:
  12760. </p><div class="example">
  12761. <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
  12762. </pre></div>
  12763. <p>For example to specify libx264 encoding options with <code class="command">ffmpeg</code>:
  12764. </p><div class="example">
  12765. <pre class="example-preformatted">ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  12766. </pre></div>
  12767. <p>To get the complete list of the libx264 options, invoke the command
  12768. <code class="command">x264 --fullhelp</code> or consult the libx264 documentation.
  12769. </p>
  12770. </dd>
  12771. <dt><samp class="option">a53cc <var class="var">boolean</var></samp></dt>
  12772. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  12773. Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
  12774. </p>
  12775. </dd>
  12776. <dt><samp class="option">udu_sei <var class="var">boolean</var></samp></dt>
  12777. <dd><p>Import user data unregistered SEI if available into output. Default is 0 (off).
  12778. </p>
  12779. </dd>
  12780. <dt><samp class="option">mb_info <var class="var">boolean</var></samp></dt>
  12781. <dd><p>Set mb_info data through AVFrameSideData, only useful when used from the
  12782. API. Default is 0 (off).
  12783. </p></dd>
  12784. </dl>
  12785. <p>Encoding ffpresets for common usages are provided so they can be used with the
  12786. general presets system (e.g. passing the <samp class="option">pre</samp> option).
  12787. </p>
  12788. </div>
  12789. </div>
  12790. <div class="section-level-extent" id="libx265">
  12791. <h3 class="section"><span>16.16 libx265<a class="copiable-link" href="#libx265"> &para;</a></span></h3>
  12792. <p>x265 H.265/HEVC encoder wrapper.
  12793. </p>
  12794. <p>This encoder requires the presence of the libx265 headers and library
  12795. during configuration. You need to explicitly configure the build with
  12796. <samp class="option">--enable-libx265</samp>.
  12797. </p>
  12798. <ul class="mini-toc">
  12799. <li><a href="#Options-37" accesskey="1">Options</a></li>
  12800. </ul>
  12801. <div class="subsection-level-extent" id="Options-37">
  12802. <h4 class="subsection"><span>16.16.1 Options<a class="copiable-link" href="#Options-37"> &para;</a></span></h4>
  12803. <dl class="table">
  12804. <dt><samp class="option">b</samp></dt>
  12805. <dd><p>Sets target video bitrate.
  12806. </p>
  12807. </dd>
  12808. <dt><samp class="option">bf</samp></dt>
  12809. <dt><samp class="option">g</samp></dt>
  12810. <dd><p>Set the GOP size.
  12811. </p>
  12812. </dd>
  12813. <dt><samp class="option">keyint_min</samp></dt>
  12814. <dd><p>Minimum GOP size.
  12815. </p>
  12816. </dd>
  12817. <dt><samp class="option">refs</samp></dt>
  12818. <dd><p>Number of reference frames each P-frame can use. The range is from <var class="var">1-16</var>.
  12819. </p>
  12820. </dd>
  12821. <dt><samp class="option">preset</samp></dt>
  12822. <dd><p>Set the x265 preset.
  12823. </p>
  12824. </dd>
  12825. <dt><samp class="option">tune</samp></dt>
  12826. <dd><p>Set the x265 tune parameter.
  12827. </p>
  12828. </dd>
  12829. <dt><samp class="option">profile</samp></dt>
  12830. <dd><p>Set profile restrictions.
  12831. </p>
  12832. </dd>
  12833. <dt><samp class="option">crf</samp></dt>
  12834. <dd><p>Set the quality for constant quality mode.
  12835. </p>
  12836. </dd>
  12837. <dt><samp class="option">qp</samp></dt>
  12838. <dd><p>Set constant quantization rate control method parameter.
  12839. </p>
  12840. </dd>
  12841. <dt><samp class="option">qmin</samp></dt>
  12842. <dd><p>Minimum quantizer scale.
  12843. </p>
  12844. </dd>
  12845. <dt><samp class="option">qmax</samp></dt>
  12846. <dd><p>Maximum quantizer scale.
  12847. </p>
  12848. </dd>
  12849. <dt><samp class="option">qdiff</samp></dt>
  12850. <dd><p>Maximum difference between quantizer scales.
  12851. </p>
  12852. </dd>
  12853. <dt><samp class="option">qblur</samp></dt>
  12854. <dd><p>Quantizer curve blur
  12855. </p>
  12856. </dd>
  12857. <dt><samp class="option">qcomp</samp></dt>
  12858. <dd><p>Quantizer curve compression factor
  12859. </p>
  12860. </dd>
  12861. <dt><samp class="option">i_qfactor</samp></dt>
  12862. <dt><samp class="option">b_qfactor</samp></dt>
  12863. <dt><samp class="option">forced-idr</samp></dt>
  12864. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  12865. of I-frame. This option forces it to choose an IDR-frame.
  12866. </p>
  12867. </dd>
  12868. <dt><samp class="option">udu_sei <var class="var">boolean</var></samp></dt>
  12869. <dd><p>Import user data unregistered SEI if available into output. Default is 0 (off).
  12870. </p>
  12871. </dd>
  12872. <dt><samp class="option">x265-params</samp></dt>
  12873. <dd><p>Set x265 options using a list of <var class="var">key</var>=<var class="var">value</var> couples separated
  12874. by &quot;:&quot;. See <code class="command">x265 --help</code> for a list of options.
  12875. </p>
  12876. <p>For example to specify libx265 encoding options with <samp class="option">-x265-params</samp>:
  12877. </p>
  12878. <div class="example">
  12879. <pre class="example-preformatted">ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  12880. </pre></div>
  12881. </dd>
  12882. </dl>
  12883. </div>
  12884. </div>
  12885. <div class="section-level-extent" id="libxavs2">
  12886. <h3 class="section"><span>16.17 libxavs2<a class="copiable-link" href="#libxavs2"> &para;</a></span></h3>
  12887. <p>xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
  12888. </p>
  12889. <p>This encoder requires the presence of the libxavs2 headers and library
  12890. during configuration. You need to explicitly configure the build with
  12891. <samp class="option">--enable-libxavs2</samp>.
  12892. </p>
  12893. <p>The following standard libavcodec options are used:
  12894. </p><ul class="itemize mark-bullet">
  12895. <li><samp class="option">b</samp> / <samp class="option">bit_rate</samp>
  12896. </li><li><samp class="option">g</samp> / <samp class="option">gop_size</samp>
  12897. </li><li><samp class="option">bf</samp> / <samp class="option">max_b_frames</samp>
  12898. </li></ul>
  12899. <p>The encoder also has its own specific options:
  12900. </p><ul class="mini-toc">
  12901. <li><a href="#Options-38" accesskey="1">Options</a></li>
  12902. </ul>
  12903. <div class="subsection-level-extent" id="Options-38">
  12904. <h4 class="subsection"><span>16.17.1 Options<a class="copiable-link" href="#Options-38"> &para;</a></span></h4>
  12905. <dl class="table">
  12906. <dt><samp class="option">lcu_row_threads</samp></dt>
  12907. <dd><p>Set the number of parallel threads for rows from 1 to 8 (default 5).
  12908. </p>
  12909. </dd>
  12910. <dt><samp class="option">initial_qp</samp></dt>
  12911. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  12912. used to set the initial qp for the first frame.
  12913. </p>
  12914. </dd>
  12915. <dt><samp class="option">qp</samp></dt>
  12916. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  12917. used to set the qp value under constant-QP mode.
  12918. </p>
  12919. </dd>
  12920. <dt><samp class="option">max_qp</samp></dt>
  12921. <dd><p>Set the max qp for rate control from 1 to 63 (default 55).
  12922. </p>
  12923. </dd>
  12924. <dt><samp class="option">min_qp</samp></dt>
  12925. <dd><p>Set the min qp for rate control from 1 to 63 (default 20).
  12926. </p>
  12927. </dd>
  12928. <dt><samp class="option">speed_level</samp></dt>
  12929. <dd><p>Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
  12930. </p>
  12931. </dd>
  12932. <dt><samp class="option">log_level</samp></dt>
  12933. <dd><p>Set the log level from -1 to 3 (default 0). -1: none, 0: error,
  12934. 1: warning, 2: info, 3: debug.
  12935. </p>
  12936. </dd>
  12937. <dt><samp class="option">xavs2-params</samp></dt>
  12938. <dd><p>Set xavs2 options using a list of <var class="var">key</var>=<var class="var">value</var> couples separated
  12939. by &quot;:&quot;.
  12940. </p>
  12941. <p>For example to specify libxavs2 encoding options with <samp class="option">-xavs2-params</samp>:
  12942. </p>
  12943. <div class="example">
  12944. <pre class="example-preformatted">ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
  12945. </pre></div>
  12946. </dd>
  12947. </dl>
  12948. </div>
  12949. </div>
  12950. <div class="section-level-extent" id="libxeve">
  12951. <h3 class="section"><span>16.18 libxeve<a class="copiable-link" href="#libxeve"> &para;</a></span></h3>
  12952. <p>eXtra-fast Essential Video Encoder (XEVE) MPEG-5 EVC encoder wrapper.
  12953. The xeve-equivalent options or values are listed in parentheses for easy migration.
  12954. </p>
  12955. <p>This encoder requires the presence of the libxeve headers and library
  12956. during configuration. You need to explicitly configure the build with
  12957. <samp class="option">--enable-libxeve</samp>.
  12958. </p>
  12959. <div class="info">
  12960. <p>Many libxeve encoder options are mapped to FFmpeg global codec options,
  12961. while unique encoder options are provided through private options.
  12962. Additionally the xeve-params private options allows one to pass a list
  12963. of key=value tuples as accepted by the libxeve <code class="code">parse_xeve_params</code> function.
  12964. </p></div>
  12965. <p>The xeve project website is at <a class="url" href="https://github.com/mpeg5/xeve">https://github.com/mpeg5/xeve</a>.
  12966. </p>
  12967. <ul class="mini-toc">
  12968. <li><a href="#Options-39" accesskey="1">Options</a></li>
  12969. </ul>
  12970. <div class="subsection-level-extent" id="Options-39">
  12971. <h4 class="subsection"><span>16.18.1 Options<a class="copiable-link" href="#Options-39"> &para;</a></span></h4>
  12972. <p>The following options are supported by the libxeve wrapper.
  12973. The xeve-equivalent options or values are listed in parentheses for easy migration.
  12974. </p>
  12975. <div class="info">
  12976. <p>To reduce the duplication of documentation, only the private options
  12977. and some others requiring special attention are documented here. For
  12978. the documentation of the undocumented generic options, see
  12979. <a class="ref" href="#codec_002doptions">the Codec Options chapter</a>.
  12980. </p></div>
  12981. <div class="info">
  12982. <p>To get a more accurate and extensive documentation of the libxeve options,
  12983. invoke the command <code class="code">xeve_app --help</code> or consult the libxeve documentation.
  12984. </p></div>
  12985. <dl class="table">
  12986. <dt><samp class="option">b (<em class="emph">bitrate</em>)</samp></dt>
  12987. <dd><p>Set target video bitrate in bits/s.
  12988. Note that FFmpeg&rsquo;s b option is expressed in bits/s, while xeve&rsquo;s bitrate is in kilobits/s.
  12989. </p>
  12990. </dd>
  12991. <dt><samp class="option">bf (<em class="emph">bframes</em>)</samp></dt>
  12992. <dd><p>Set the maximum number of B frames (1,3,7,15).
  12993. </p>
  12994. </dd>
  12995. <dt><samp class="option">g (<em class="emph">keyint</em>)</samp></dt>
  12996. <dd><p>Set the GOP size (I-picture period).
  12997. </p>
  12998. </dd>
  12999. <dt><samp class="option">preset (<em class="emph">preset</em>)</samp></dt>
  13000. <dd><p>Set the xeve preset.
  13001. Set the encoder preset value to determine encoding speed [fast, medium, slow, placebo]
  13002. </p>
  13003. </dd>
  13004. <dt><samp class="option">tune (<em class="emph">tune</em>)</samp></dt>
  13005. <dd><p>Set the encoder tune parameter [psnr, zerolatency]
  13006. </p>
  13007. </dd>
  13008. <dt><samp class="option">profile (<em class="emph">profile</em>)</samp></dt>
  13009. <dd><p>Set the encoder profile [0: baseline; 1: main]
  13010. </p>
  13011. </dd>
  13012. <dt><samp class="option">crf (<em class="emph">crf</em>)</samp></dt>
  13013. <dd><p>Set the quality for constant quality mode.
  13014. Constant rate factor &lt;10..49&gt; [default: 32]
  13015. </p>
  13016. </dd>
  13017. <dt><samp class="option">qp (<em class="emph">qp</em>)</samp></dt>
  13018. <dd><p>Set constant quantization rate control method parameter.
  13019. Quantization parameter qp &lt;0..51&gt; [default: 32]
  13020. </p>
  13021. </dd>
  13022. <dt><samp class="option">threads (<em class="emph">threads</em>)</samp></dt>
  13023. <dd><p>Force to use a specific number of threads
  13024. </p>
  13025. </dd>
  13026. </dl>
  13027. </div>
  13028. </div>
  13029. <div class="section-level-extent" id="libxvid">
  13030. <h3 class="section"><span>16.19 libxvid<a class="copiable-link" href="#libxvid"> &para;</a></span></h3>
  13031. <p>Xvid MPEG-4 Part 2 encoder wrapper.
  13032. </p>
  13033. <p>This encoder requires the presence of the libxvidcore headers and library
  13034. during configuration. You need to explicitly configure the build with
  13035. <code class="code">--enable-libxvid --enable-gpl</code>.
  13036. </p>
  13037. <p>The native <code class="code">mpeg4</code> encoder supports the MPEG-4 Part 2 format, so
  13038. users can encode to this format without this library.
  13039. </p>
  13040. <ul class="mini-toc">
  13041. <li><a href="#Options-40" accesskey="1">Options</a></li>
  13042. </ul>
  13043. <div class="subsection-level-extent" id="Options-40">
  13044. <h4 class="subsection"><span>16.19.1 Options<a class="copiable-link" href="#Options-40"> &para;</a></span></h4>
  13045. <p>The following options are supported by the libxvid wrapper. Some of
  13046. the following options are listed but are not documented, and
  13047. correspond to shared codec options. See <a class="ref" href="#codec_002doptions">the Codec
  13048. Options chapter</a> for their documentation. The other shared options
  13049. which are not listed have no effect for the libxvid encoder.
  13050. </p>
  13051. <dl class="table">
  13052. <dt><samp class="option">b</samp></dt>
  13053. <dt><samp class="option">g</samp></dt>
  13054. <dt><samp class="option">qmin</samp></dt>
  13055. <dt><samp class="option">qmax</samp></dt>
  13056. <dt><samp class="option">mpeg_quant</samp></dt>
  13057. <dt><samp class="option">threads</samp></dt>
  13058. <dt><samp class="option">bf</samp></dt>
  13059. <dt><samp class="option">b_qfactor</samp></dt>
  13060. <dt><samp class="option">b_qoffset</samp></dt>
  13061. <dt><samp class="option">flags</samp></dt>
  13062. <dd><p>Set specific encoding flags. Possible values:
  13063. </p>
  13064. <dl class="table">
  13065. <dt>&lsquo;<samp class="samp">mv4</samp>&rsquo;</dt>
  13066. <dd><p>Use four motion vector by macroblock.
  13067. </p>
  13068. </dd>
  13069. <dt>&lsquo;<samp class="samp">aic</samp>&rsquo;</dt>
  13070. <dd><p>Enable high quality AC prediction.
  13071. </p>
  13072. </dd>
  13073. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  13074. <dd><p>Only encode grayscale.
  13075. </p>
  13076. </dd>
  13077. <dt>&lsquo;<samp class="samp">qpel</samp>&rsquo;</dt>
  13078. <dd><p>Enable quarter-pixel motion compensation.
  13079. </p>
  13080. </dd>
  13081. <dt>&lsquo;<samp class="samp">cgop</samp>&rsquo;</dt>
  13082. <dd><p>Enable closed GOP.
  13083. </p>
  13084. </dd>
  13085. <dt>&lsquo;<samp class="samp">global_header</samp>&rsquo;</dt>
  13086. <dd><p>Place global headers in extradata instead of every keyframe.
  13087. </p>
  13088. </dd>
  13089. </dl>
  13090. </dd>
  13091. <dt><samp class="option">gmc</samp></dt>
  13092. <dd><p>Enable the use of global motion compensation (GMC). Default is 0
  13093. (disabled).
  13094. </p>
  13095. </dd>
  13096. <dt><samp class="option">me_quality</samp></dt>
  13097. <dd><p>Set motion estimation quality level. Possible values in decreasing order of
  13098. speed and increasing order of quality:
  13099. </p>
  13100. <dl class="table">
  13101. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  13102. <dd><p>Use no motion estimation (default).
  13103. </p>
  13104. </dd>
  13105. <dt>&lsquo;<samp class="samp">1, 2</samp>&rsquo;</dt>
  13106. <dd><p>Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  13107. refinement for 16x16 blocks.
  13108. </p>
  13109. </dd>
  13110. <dt>&lsquo;<samp class="samp">3, 4</samp>&rsquo;</dt>
  13111. <dd><p>Enable all of the things described above, plus advanced diamond zonal
  13112. search for 8x8 blocks and half-pixel refinement for 8x8 blocks, also
  13113. enable motion estimation on chroma planes for P and B-frames.
  13114. </p>
  13115. </dd>
  13116. <dt>&lsquo;<samp class="samp">5, 6</samp>&rsquo;</dt>
  13117. <dd><p>Enable all of the things described above, plus extended 16x16 and 8x8
  13118. blocks search.
  13119. </p></dd>
  13120. </dl>
  13121. </dd>
  13122. <dt><samp class="option">mbd</samp></dt>
  13123. <dd><p>Set macroblock decision algorithm. Possible values in the increasing
  13124. order of quality:
  13125. </p>
  13126. <dl class="table">
  13127. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  13128. <dd><p>Use macroblock comparing function algorithm (default).
  13129. </p>
  13130. </dd>
  13131. <dt>&lsquo;<samp class="samp">bits</samp>&rsquo;</dt>
  13132. <dd><p>Enable rate distortion-based half pixel and quarter pixel refinement for
  13133. 16x16 blocks.
  13134. </p>
  13135. </dd>
  13136. <dt>&lsquo;<samp class="samp">rd</samp>&rsquo;</dt>
  13137. <dd><p>Enable all of the things described above, plus rate distortion-based
  13138. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  13139. distortion-based search using square pattern.
  13140. </p></dd>
  13141. </dl>
  13142. </dd>
  13143. <dt><samp class="option">lumi_aq</samp></dt>
  13144. <dd><p>Enable lumi masking adaptive quantization when set to 1. Default is 0
  13145. (disabled).
  13146. </p>
  13147. </dd>
  13148. <dt><samp class="option">variance_aq</samp></dt>
  13149. <dd><p>Enable variance adaptive quantization when set to 1. Default is 0
  13150. (disabled).
  13151. </p>
  13152. <p>When combined with <samp class="option">lumi_aq</samp>, the resulting quality will not
  13153. be better than any of the two specified individually. In other
  13154. words, the resulting quality will be the worse one of the two
  13155. effects.
  13156. </p>
  13157. </dd>
  13158. <dt><samp class="option">trellis</samp></dt>
  13159. <dd><p>Set rate-distortion optimal quantization.
  13160. </p>
  13161. </dd>
  13162. <dt><samp class="option">ssim</samp></dt>
  13163. <dd><p>Set structural similarity (SSIM) displaying method. Possible values:
  13164. </p>
  13165. <dl class="table">
  13166. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  13167. <dd><p>Disable displaying of SSIM information.
  13168. </p>
  13169. </dd>
  13170. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  13171. <dd><p>Output average SSIM at the end of encoding to stdout. The format of
  13172. showing the average SSIM is:
  13173. </p>
  13174. <div class="example">
  13175. <pre class="example-preformatted">Average SSIM: %f
  13176. </pre></div>
  13177. <p>For users who are not familiar with C, %f means a float number, or
  13178. a decimal (e.g. 0.939232).
  13179. </p>
  13180. </dd>
  13181. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  13182. <dd><p>Output both per-frame SSIM data during encoding and average SSIM at
  13183. the end of encoding to stdout. The format of per-frame information
  13184. is:
  13185. </p>
  13186. <div class="example">
  13187. <pre class="example-preformatted"> SSIM: avg: %1.3f min: %1.3f max: %1.3f
  13188. </pre></div>
  13189. <p>For users who are not familiar with C, %1.3f means a float number
  13190. rounded to 3 digits after the dot (e.g. 0.932).
  13191. </p>
  13192. </dd>
  13193. </dl>
  13194. </dd>
  13195. <dt><samp class="option">ssim_acc</samp></dt>
  13196. <dd><p>Set SSIM accuracy. Valid options are integers within the range of
  13197. 0-4, while 0 gives the most accurate result and 4 computes the
  13198. fastest.
  13199. </p>
  13200. </dd>
  13201. </dl>
  13202. </div>
  13203. </div>
  13204. <div class="section-level-extent" id="MediaFoundation">
  13205. <h3 class="section"><span>16.20 MediaFoundation<a class="copiable-link" href="#MediaFoundation"> &para;</a></span></h3>
  13206. <p>This provides wrappers to encoders (both audio and video) in the
  13207. MediaFoundation framework. It can access both SW and HW encoders.
  13208. Video encoders can take input in either of nv12 or yuv420p form
  13209. (some encoders support both, some support only either - in practice,
  13210. nv12 is the safer choice, especially among HW encoders).
  13211. </p>
  13212. </div>
  13213. <div class="section-level-extent" id="Microsoft-RLE">
  13214. <h3 class="section"><span>16.21 Microsoft RLE<a class="copiable-link" href="#Microsoft-RLE"> &para;</a></span></h3>
  13215. <p>Microsoft RLE aka MSRLE encoder.
  13216. Only 8-bit palette mode supported.
  13217. Compatible with Windows 3.1 and Windows 95.
  13218. </p>
  13219. <ul class="mini-toc">
  13220. <li><a href="#Options-41" accesskey="1">Options</a></li>
  13221. </ul>
  13222. <div class="subsection-level-extent" id="Options-41">
  13223. <h4 class="subsection"><span>16.21.1 Options<a class="copiable-link" href="#Options-41"> &para;</a></span></h4>
  13224. <dl class="table">
  13225. <dt><samp class="option">g <var class="var">integer</var></samp></dt>
  13226. <dd><p>Keyframe interval.
  13227. A keyframe is inserted at least every <code class="code">-g</code> frames, sometimes sooner.
  13228. </p></dd>
  13229. </dl>
  13230. </div>
  13231. </div>
  13232. <div class="section-level-extent" id="mpeg2">
  13233. <h3 class="section"><span>16.22 mpeg2<a class="copiable-link" href="#mpeg2"> &para;</a></span></h3>
  13234. <p>MPEG-2 video encoder.
  13235. </p>
  13236. <ul class="mini-toc">
  13237. <li><a href="#Options-42" accesskey="1">Options</a></li>
  13238. </ul>
  13239. <div class="subsection-level-extent" id="Options-42">
  13240. <h4 class="subsection"><span>16.22.1 Options<a class="copiable-link" href="#Options-42"> &para;</a></span></h4>
  13241. <dl class="table">
  13242. <dt><samp class="option">profile</samp></dt>
  13243. <dd><p>Select the mpeg2 profile to encode:
  13244. </p>
  13245. <dl class="table">
  13246. <dt>&lsquo;<samp class="samp">422</samp>&rsquo;</dt>
  13247. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  13248. <dt>&lsquo;<samp class="samp">ss</samp>&rsquo;</dt>
  13249. <dd><p>Spatially Scalable
  13250. </p></dd>
  13251. <dt>&lsquo;<samp class="samp">snr</samp>&rsquo;</dt>
  13252. <dd><p>SNR Scalable
  13253. </p></dd>
  13254. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  13255. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  13256. </dl>
  13257. </dd>
  13258. <dt><samp class="option">level</samp></dt>
  13259. <dd><p>Select the mpeg2 level to encode:
  13260. </p>
  13261. <dl class="table">
  13262. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  13263. <dt>&lsquo;<samp class="samp">high1440</samp>&rsquo;</dt>
  13264. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  13265. <dt>&lsquo;<samp class="samp">low</samp>&rsquo;</dt>
  13266. </dl>
  13267. </dd>
  13268. <dt><samp class="option">seq_disp_ext <var class="var">integer</var></samp></dt>
  13269. <dd><p>Specifies if the encoder should write a sequence_display_extension to the
  13270. output.
  13271. </p><dl class="table">
  13272. <dt><samp class="option">-1</samp></dt>
  13273. <dt><samp class="option">auto</samp></dt>
  13274. <dd><p>Decide automatically to write it or not (this is the default) by checking if
  13275. the data to be written is different from the default or unspecified values.
  13276. </p></dd>
  13277. <dt><samp class="option">0</samp></dt>
  13278. <dt><samp class="option">never</samp></dt>
  13279. <dd><p>Never write it.
  13280. </p></dd>
  13281. <dt><samp class="option">1</samp></dt>
  13282. <dt><samp class="option">always</samp></dt>
  13283. <dd><p>Always write it.
  13284. </p></dd>
  13285. </dl>
  13286. </dd>
  13287. <dt><samp class="option">video_format <var class="var">integer</var></samp></dt>
  13288. <dd><p>Specifies the video_format written into the sequence display extension
  13289. indicating the source of the video pictures. The default is &lsquo;<samp class="samp">unspecified</samp>&rsquo;,
  13290. 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;.
  13291. For maximum compatibility, use &lsquo;<samp class="samp">component</samp>&rsquo;.
  13292. </p></dd>
  13293. <dt><samp class="option">a53cc <var class="var">boolean</var></samp></dt>
  13294. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  13295. Default is 1 (on).
  13296. </p></dd>
  13297. </dl>
  13298. </div>
  13299. </div>
  13300. <div class="section-level-extent" id="png">
  13301. <h3 class="section"><span>16.23 png<a class="copiable-link" href="#png"> &para;</a></span></h3>
  13302. <p>PNG image encoder.
  13303. </p>
  13304. <ul class="mini-toc">
  13305. <li><a href="#Private-options-1" accesskey="1">Private options</a></li>
  13306. </ul>
  13307. <div class="subsection-level-extent" id="Private-options-1">
  13308. <h4 class="subsection"><span>16.23.1 Private options<a class="copiable-link" href="#Private-options-1"> &para;</a></span></h4>
  13309. <dl class="table">
  13310. <dt><samp class="option">dpi <var class="var">integer</var></samp></dt>
  13311. <dd><p>Set physical density of pixels, in dots per inch, unset by default
  13312. </p></dd>
  13313. <dt><samp class="option">dpm <var class="var">integer</var></samp></dt>
  13314. <dd><p>Set physical density of pixels, in dots per meter, unset by default
  13315. </p></dd>
  13316. </dl>
  13317. </div>
  13318. </div>
  13319. <div class="section-level-extent" id="ProRes">
  13320. <h3 class="section"><span>16.24 ProRes<a class="copiable-link" href="#ProRes"> &para;</a></span></h3>
  13321. <p>Apple ProRes encoder.
  13322. </p>
  13323. <p>FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  13324. The used encoder can be chosen with the <code class="code">-vcodec</code> option.
  13325. </p>
  13326. <ul class="mini-toc">
  13327. <li><a href="#Private-Options-for-prores_002dks" accesskey="1">Private Options for prores-ks</a></li>
  13328. <li><a href="#Speed-considerations" accesskey="2">Speed considerations</a></li>
  13329. </ul>
  13330. <div class="subsection-level-extent" id="Private-Options-for-prores_002dks">
  13331. <h4 class="subsection"><span>16.24.1 Private Options for prores-ks<a class="copiable-link" href="#Private-Options-for-prores_002dks"> &para;</a></span></h4>
  13332. <dl class="table">
  13333. <dt><samp class="option">profile <var class="var">integer</var></samp></dt>
  13334. <dd><p>Select the ProRes profile to encode
  13335. </p><dl class="table">
  13336. <dt>&lsquo;<samp class="samp">proxy</samp>&rsquo;</dt>
  13337. <dt>&lsquo;<samp class="samp">lt</samp>&rsquo;</dt>
  13338. <dt>&lsquo;<samp class="samp">standard</samp>&rsquo;</dt>
  13339. <dt>&lsquo;<samp class="samp">hq</samp>&rsquo;</dt>
  13340. <dt>&lsquo;<samp class="samp">4444</samp>&rsquo;</dt>
  13341. <dt>&lsquo;<samp class="samp">4444xq</samp>&rsquo;</dt>
  13342. </dl>
  13343. </dd>
  13344. <dt><samp class="option">quant_mat <var class="var">integer</var></samp></dt>
  13345. <dd><p>Select quantization matrix.
  13346. </p><dl class="table">
  13347. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  13348. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  13349. <dt>&lsquo;<samp class="samp">proxy</samp>&rsquo;</dt>
  13350. <dt>&lsquo;<samp class="samp">lt</samp>&rsquo;</dt>
  13351. <dt>&lsquo;<samp class="samp">standard</samp>&rsquo;</dt>
  13352. <dt>&lsquo;<samp class="samp">hq</samp>&rsquo;</dt>
  13353. </dl>
  13354. <p>If set to <var class="var">auto</var>, the matrix matching the profile will be picked.
  13355. If not set, the matrix providing the highest quality, <var class="var">default</var>, will be
  13356. picked.
  13357. </p>
  13358. </dd>
  13359. <dt><samp class="option">bits_per_mb <var class="var">integer</var></samp></dt>
  13360. <dd><p>How many bits to allot for coding one macroblock. Different profiles use
  13361. between 200 and 2400 bits per macroblock, the maximum is 8000.
  13362. </p>
  13363. </dd>
  13364. <dt><samp class="option">mbs_per_slice <var class="var">integer</var></samp></dt>
  13365. <dd><p>Number of macroblocks in each slice (1-8); the default value (8)
  13366. should be good in almost all situations.
  13367. </p>
  13368. </dd>
  13369. <dt><samp class="option">vendor <var class="var">string</var></samp></dt>
  13370. <dd><p>Override the 4-byte vendor ID.
  13371. A custom vendor ID like <var class="var">apl0</var> would claim the stream was produced by
  13372. the Apple encoder.
  13373. </p>
  13374. </dd>
  13375. <dt><samp class="option">alpha_bits <var class="var">integer</var></samp></dt>
  13376. <dd><p>Specify number of bits for alpha component.
  13377. Possible values are <var class="var">0</var>, <var class="var">8</var> and <var class="var">16</var>.
  13378. Use <var class="var">0</var> to disable alpha plane coding.
  13379. </p>
  13380. </dd>
  13381. </dl>
  13382. </div>
  13383. <div class="subsection-level-extent" id="Speed-considerations">
  13384. <h4 class="subsection"><span>16.24.2 Speed considerations<a class="copiable-link" href="#Speed-considerations"> &para;</a></span></h4>
  13385. <p>In the default mode of operation the encoder has to honor frame constraints
  13386. (i.e. not produce frames with size bigger than requested) while still making
  13387. output picture as good as possible.
  13388. A frame containing a lot of small details is harder to compress and the encoder
  13389. would spend more time searching for appropriate quantizers for each slice.
  13390. </p>
  13391. <p>Setting a higher <samp class="option">bits_per_mb</samp> limit will improve the speed.
  13392. </p>
  13393. <p>For the fastest encoding speed set the <samp class="option">qscale</samp> parameter (4 is the
  13394. recommended value) and do not set a size constraint.
  13395. </p>
  13396. </div>
  13397. </div>
  13398. <div class="section-level-extent" id="QSV-Encoders">
  13399. <h3 class="section"><span>16.25 QSV Encoders<a class="copiable-link" href="#QSV-Encoders"> &para;</a></span></h3>
  13400. <p>The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG,
  13401. VP9, AV1)
  13402. </p>
  13403. <ul class="mini-toc">
  13404. <li><a href="#Ratecontrol-Method" accesskey="1">Ratecontrol Method</a></li>
  13405. <li><a href="#Global-Options-_002d_003e-MSDK-Options" accesskey="2">Global Options -&gt; MSDK Options</a></li>
  13406. <li><a href="#Common-Options-1" accesskey="3">Common Options</a></li>
  13407. <li><a href="#Runtime-Options" accesskey="4">Runtime Options</a></li>
  13408. <li><a href="#H264-options" accesskey="5">H264 options</a></li>
  13409. <li><a href="#HEVC-Options-1" accesskey="6">HEVC Options</a></li>
  13410. <li><a href="#MPEG2-Options" accesskey="7">MPEG2 Options</a></li>
  13411. <li><a href="#VP9-Options" accesskey="8">VP9 Options</a></li>
  13412. <li><a href="#AV1-Options" accesskey="9">AV1 Options</a></li>
  13413. </ul>
  13414. <div class="subsection-level-extent" id="Ratecontrol-Method">
  13415. <h4 class="subsection"><span>16.25.1 Ratecontrol Method<a class="copiable-link" href="#Ratecontrol-Method"> &para;</a></span></h4>
  13416. <p>The ratecontrol method is selected as follows:
  13417. </p><ul class="itemize mark-bullet">
  13418. <li>When <samp class="option">global_quality</samp> is specified, a quality-based mode is used.
  13419. Specifically this means either
  13420. <ul class="itemize mark-minus">
  13421. <li><var class="var">CQP</var> - constant quantizer scale, when the <samp class="option">qscale</samp> codec flag is
  13422. also set (the <samp class="option">-qscale</samp> ffmpeg option).
  13423. </li><li><var class="var">LA_ICQ</var> - intelligent constant quality with lookahead, when the
  13424. <samp class="option">look_ahead</samp> option is also set.
  13425. </li><li><var class="var">ICQ</var> &ndash; intelligent constant quality otherwise. For the ICQ modes, global
  13426. quality range is 1 to 51, with 1 being the best quality.
  13427. </li></ul>
  13428. </li><li>Otherwise when the desired average bitrate is specified with the <samp class="option">b</samp>
  13429. option, a bitrate-based mode is used.
  13430. <ul class="itemize mark-minus">
  13431. <li><var class="var">LA</var> - VBR with lookahead, when the <samp class="option">look_ahead</samp> option is specified.
  13432. </li><li><var class="var">VCM</var> - video conferencing mode, when the <samp class="option">vcm</samp> option is set.
  13433. </li><li><var class="var">CBR</var> - constant bitrate, when <samp class="option">maxrate</samp> is specified and equal to
  13434. the average bitrate.
  13435. </li><li><var class="var">VBR</var> - variable bitrate, when <samp class="option">maxrate</samp> is specified, but is higher
  13436. than the average bitrate.
  13437. </li><li><var class="var">AVBR</var> - average VBR mode, when <samp class="option">maxrate</samp> is not specified, both
  13438. <samp class="option">avbr_accuracy</samp> and <samp class="option">avbr_convergence</samp> are set to non-zero. This
  13439. mode is available for H264 and HEVC on Windows.
  13440. </li></ul>
  13441. </li><li>Otherwise the default ratecontrol method <var class="var">CQP</var> is used.
  13442. </li></ul>
  13443. <p>Note that depending on your system, a different mode than the one you specified
  13444. may be selected by the encoder. Set the verbosity level to <var class="var">verbose</var> or
  13445. higher to see the actual settings used by the QSV runtime.
  13446. </p>
  13447. </div>
  13448. <div class="subsection-level-extent" id="Global-Options-_002d_003e-MSDK-Options">
  13449. <h4 class="subsection"><span>16.25.2 Global Options -&gt; MSDK Options<a class="copiable-link" href="#Global-Options-_002d_003e-MSDK-Options"> &para;</a></span></h4>
  13450. <p>Additional libavcodec global options are mapped to MSDK options as follows:
  13451. </p>
  13452. <ul class="itemize mark-bullet">
  13453. <li><samp class="option">g/gop_size</samp> -&gt; <samp class="option">GopPicSize</samp>
  13454. </li><li><samp class="option">bf/max_b_frames</samp>+1 -&gt; <samp class="option">GopRefDist</samp>
  13455. </li><li><samp class="option">rc_init_occupancy/rc_initial_buffer_occupancy</samp> -&gt;
  13456. <samp class="option">InitialDelayInKB</samp>
  13457. </li><li><samp class="option">slices</samp> -&gt; <samp class="option">NumSlice</samp>
  13458. </li><li><samp class="option">refs</samp> -&gt; <samp class="option">NumRefFrame</samp>
  13459. </li><li><samp class="option">b_strategy/b_frame_strategy</samp> -&gt; <samp class="option">BRefType</samp>
  13460. </li><li><samp class="option">cgop/CLOSED_GOP</samp> codec flag -&gt; <samp class="option">GopOptFlag</samp>
  13461. </li><li>For the <var class="var">CQP</var> mode, the <samp class="option">i_qfactor/i_qoffset</samp> and
  13462. <samp class="option">b_qfactor/b_qoffset</samp> set the difference between <var class="var">QPP</var> and <var class="var">QPI</var>,
  13463. and <var class="var">QPP</var> and <var class="var">QPB</var> respectively.
  13464. </li><li>Setting the <samp class="option">coder</samp> option to the value <var class="var">vlc</var> will make the H.264
  13465. encoder use CAVLC instead of CABAC.
  13466. </li></ul>
  13467. </div>
  13468. <div class="subsection-level-extent" id="Common-Options-1">
  13469. <h4 class="subsection"><span>16.25.3 Common Options<a class="copiable-link" href="#Common-Options-1"> &para;</a></span></h4>
  13470. <p>Following options are used by all qsv encoders.
  13471. </p>
  13472. <dl class="table">
  13473. <dt><samp class="option"><var class="var">async_depth</var></samp></dt>
  13474. <dd><p>Specifies how many asynchronous operations an application performs
  13475. before the application explicitly synchronizes the result. If zero,
  13476. the value is not specified.
  13477. </p>
  13478. </dd>
  13479. <dt><samp class="option"><var class="var">preset</var></samp></dt>
  13480. <dd><p>This option itemizes a range of choices from veryfast (best speed) to veryslow
  13481. (best quality).
  13482. </p><dl class="table">
  13483. <dt>&lsquo;<samp class="samp">veryfast</samp>&rsquo;</dt>
  13484. <dt>&lsquo;<samp class="samp">faster</samp>&rsquo;</dt>
  13485. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  13486. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  13487. <dt>&lsquo;<samp class="samp">slow</samp>&rsquo;</dt>
  13488. <dt>&lsquo;<samp class="samp">slower</samp>&rsquo;</dt>
  13489. <dt>&lsquo;<samp class="samp">veryslow</samp>&rsquo;</dt>
  13490. </dl>
  13491. </dd>
  13492. <dt><samp class="option"><var class="var">forced_idr</var></samp></dt>
  13493. <dd><p>Forcing I frames as IDR frames.
  13494. </p>
  13495. </dd>
  13496. <dt><samp class="option"><var class="var">low_power</var></samp></dt>
  13497. <dd><p>For encoders set this flag to ON to reduce power consumption and GPU usage.
  13498. </p></dd>
  13499. </dl>
  13500. </div>
  13501. <div class="subsection-level-extent" id="Runtime-Options">
  13502. <h4 class="subsection"><span>16.25.4 Runtime Options<a class="copiable-link" href="#Runtime-Options"> &para;</a></span></h4>
  13503. <p>Following options can be used durning qsv encoding.
  13504. </p>
  13505. <dl class="table">
  13506. <dt><samp class="option"><var class="var">global_quality</var></samp></dt>
  13507. <dt><samp class="option"><var class="var">i_quant_factor</var></samp></dt>
  13508. <dt><samp class="option"><var class="var">i_quant_offset</var></samp></dt>
  13509. <dt><samp class="option"><var class="var">b_quant_factor</var></samp></dt>
  13510. <dt><samp class="option"><var class="var">b_quant_offset</var></samp></dt>
  13511. <dd><p>Supported in h264_qsv and hevc_qsv.
  13512. Change these value to reset qsv codec&rsquo;s qp configuration.
  13513. </p>
  13514. </dd>
  13515. <dt><samp class="option"><var class="var">max_frame_size</var></samp></dt>
  13516. <dd><p>Supported in h264_qsv and hevc_qsv.
  13517. Change this value to reset qsv codec&rsquo;s MaxFrameSize configuration.
  13518. </p>
  13519. </dd>
  13520. <dt><samp class="option"><var class="var">gop_size</var></samp></dt>
  13521. <dd><p>Change this value to reset qsv codec&rsquo;s gop configuration.
  13522. </p>
  13523. </dd>
  13524. <dt><samp class="option"><var class="var">int_ref_type</var></samp></dt>
  13525. <dt><samp class="option"><var class="var">int_ref_cycle_size</var></samp></dt>
  13526. <dt><samp class="option"><var class="var">int_ref_qp_delta</var></samp></dt>
  13527. <dt><samp class="option"><var class="var">int_ref_cycle_dist</var></samp></dt>
  13528. <dd><p>Supported in h264_qsv and hevc_qsv.
  13529. Change these value to reset qsv codec&rsquo;s Intra Refresh configuration.
  13530. </p>
  13531. </dd>
  13532. <dt><samp class="option"><var class="var">qmax</var></samp></dt>
  13533. <dt><samp class="option"><var class="var">qmin</var></samp></dt>
  13534. <dt><samp class="option"><var class="var">max_qp_i</var></samp></dt>
  13535. <dt><samp class="option"><var class="var">min_qp_i</var></samp></dt>
  13536. <dt><samp class="option"><var class="var">max_qp_p</var></samp></dt>
  13537. <dt><samp class="option"><var class="var">min_qp_p</var></samp></dt>
  13538. <dt><samp class="option"><var class="var">max_qp_b</var></samp></dt>
  13539. <dt><samp class="option"><var class="var">min_qp_b</var></samp></dt>
  13540. <dd><p>Supported in h264_qsv.
  13541. Change these value to reset qsv codec&rsquo;s max/min qp configuration.
  13542. </p>
  13543. </dd>
  13544. <dt><samp class="option"><var class="var">low_delay_brc</var></samp></dt>
  13545. <dd><p>Supported in h264_qsv, hevc_qsv and av1_qsv.
  13546. Change this value to reset qsv codec&rsquo;s low_delay_brc configuration.
  13547. </p>
  13548. </dd>
  13549. <dt><samp class="option"><var class="var">framerate</var></samp></dt>
  13550. <dd><p>Change this value to reset qsv codec&rsquo;s framerate configuration.
  13551. </p>
  13552. </dd>
  13553. <dt><samp class="option"><var class="var">bit_rate</var></samp></dt>
  13554. <dt><samp class="option"><var class="var">rc_buffer_size</var></samp></dt>
  13555. <dt><samp class="option"><var class="var">rc_initial_buffer_occupancy</var></samp></dt>
  13556. <dt><samp class="option"><var class="var">rc_max_rate</var></samp></dt>
  13557. <dd><p>Change these value to reset qsv codec&rsquo;s bitrate control configuration.
  13558. </p>
  13559. </dd>
  13560. <dt><samp class="option"><var class="var">pic_timing_sei</var></samp></dt>
  13561. <dd><p>Supported in h264_qsv and hevc_qsv.
  13562. Change this value to reset qsv codec&rsquo;s pic_timing_sei configuration.
  13563. </p></dd>
  13564. </dl>
  13565. </div>
  13566. <div class="subsection-level-extent" id="H264-options">
  13567. <h4 class="subsection"><span>16.25.5 H264 options<a class="copiable-link" href="#H264-options"> &para;</a></span></h4>
  13568. <p>These options are used by h264_qsv
  13569. </p>
  13570. <dl class="table">
  13571. <dt><samp class="option"><var class="var">extbrc</var></samp></dt>
  13572. <dd><p>Extended bitrate control.
  13573. </p>
  13574. </dd>
  13575. <dt><samp class="option"><var class="var">recovery_point_sei</var></samp></dt>
  13576. <dd><p>Set this flag to insert the recovery point SEI message at the beginning of every
  13577. intra refresh cycle.
  13578. </p>
  13579. </dd>
  13580. <dt><samp class="option"><var class="var">rdo</var></samp></dt>
  13581. <dd><p>Enable rate distortion optimization.
  13582. </p>
  13583. </dd>
  13584. <dt><samp class="option"><var class="var">max_frame_size</var></samp></dt>
  13585. <dd><p>Maximum encoded frame size in bytes.
  13586. </p>
  13587. </dd>
  13588. <dt><samp class="option"><var class="var">max_frame_size_i</var></samp></dt>
  13589. <dd><p>Maximum encoded frame size for I frames in bytes. If this value is set as larger
  13590. than zero, then for I frames the value set by max_frame_size is ignored.
  13591. </p>
  13592. </dd>
  13593. <dt><samp class="option"><var class="var">max_frame_size_p</var></samp></dt>
  13594. <dd><p>Maximum encoded frame size for P frames in bytes. If this value is set as larger
  13595. than zero, then for P frames the value set by max_frame_size is ignored.
  13596. </p>
  13597. </dd>
  13598. <dt><samp class="option"><var class="var">max_slice_size</var></samp></dt>
  13599. <dd><p>Maximum encoded slice size in bytes.
  13600. </p>
  13601. </dd>
  13602. <dt><samp class="option"><var class="var">bitrate_limit</var></samp></dt>
  13603. <dd><p>Toggle bitrate limitations.
  13604. Modifies bitrate to be in the range imposed by the QSV encoder. Setting this
  13605. flag off may lead to violation of HRD conformance. Mind that specifying bitrate
  13606. below the QSV encoder range might significantly affect quality. If on this
  13607. option takes effect in non CQP modes: if bitrate is not in the range imposed
  13608. by the QSV encoder, it will be changed to be in the range.
  13609. </p>
  13610. </dd>
  13611. <dt><samp class="option"><var class="var">mbbrc</var></samp></dt>
  13612. <dd><p>Setting this flag enables macroblock level bitrate control that generally
  13613. improves subjective visual quality. Enabling this flag may have negative impact
  13614. on performance and objective visual quality metric.
  13615. </p>
  13616. </dd>
  13617. <dt><samp class="option"><var class="var">low_delay_brc</var></samp></dt>
  13618. <dd><p>Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
  13619. more accurate bitrate control to minimize the variance of bitstream size frame
  13620. by frame. Value: -1-default 0-off 1-on
  13621. </p>
  13622. </dd>
  13623. <dt><samp class="option"><var class="var">adaptive_i</var></samp></dt>
  13624. <dd><p>This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  13625. to allow changing of frame type from P and B to I.
  13626. </p>
  13627. </dd>
  13628. <dt><samp class="option"><var class="var">adaptive_b</var></samp></dt>
  13629. <dd><p>This flag controls changing of frame type from B to P.
  13630. </p>
  13631. </dd>
  13632. <dt><samp class="option"><var class="var">p_strategy</var></samp></dt>
  13633. <dd><p>Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
  13634. </p>
  13635. </dd>
  13636. <dt><samp class="option"><var class="var">b_strategy</var></samp></dt>
  13637. <dd><p>This option controls usage of B frames as reference.
  13638. </p>
  13639. </dd>
  13640. <dt><samp class="option"><var class="var">dblk_idc</var></samp></dt>
  13641. <dd><p>This option disable deblocking. It has value in range 0~2.
  13642. </p>
  13643. </dd>
  13644. <dt><samp class="option"><var class="var">cavlc</var></samp></dt>
  13645. <dd><p>If set, CAVLC is used; if unset, CABAC is used for encoding.
  13646. </p>
  13647. </dd>
  13648. <dt><samp class="option"><var class="var">vcm</var></samp></dt>
  13649. <dd><p>Video conferencing mode, please see ratecontrol method.
  13650. </p>
  13651. </dd>
  13652. <dt><samp class="option"><var class="var">idr_interval</var></samp></dt>
  13653. <dd><p>Distance (in I-frames) between IDR frames.
  13654. </p>
  13655. </dd>
  13656. <dt><samp class="option"><var class="var">pic_timing_sei</var></samp></dt>
  13657. <dd><p>Insert picture timing SEI with pic_struct_syntax element.
  13658. </p>
  13659. </dd>
  13660. <dt><samp class="option"><var class="var">single_sei_nal_unit</var></samp></dt>
  13661. <dd><p>Put all the SEI messages into one NALU.
  13662. </p>
  13663. </dd>
  13664. <dt><samp class="option"><var class="var">max_dec_frame_buffering</var></samp></dt>
  13665. <dd><p>Maximum number of frames buffered in the DPB.
  13666. </p>
  13667. </dd>
  13668. <dt><samp class="option"><var class="var">look_ahead</var></samp></dt>
  13669. <dd><p>Use VBR algorithm with look ahead.
  13670. </p>
  13671. </dd>
  13672. <dt><samp class="option"><var class="var">look_ahead_depth</var></samp></dt>
  13673. <dd><p>Depth of look ahead in number frames.
  13674. </p>
  13675. </dd>
  13676. <dt><samp class="option"><var class="var">look_ahead_downsampling</var></samp></dt>
  13677. <dd><p>Downscaling factor for the frames saved for the lookahead analysis.
  13678. </p><dl class="table">
  13679. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  13680. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  13681. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  13682. <dt>&lsquo;<samp class="samp">2x</samp>&rsquo;</dt>
  13683. <dt>&lsquo;<samp class="samp">4x</samp>&rsquo;</dt>
  13684. </dl>
  13685. </dd>
  13686. <dt><samp class="option"><var class="var">int_ref_type</var></samp></dt>
  13687. <dd><p>Specifies intra refresh type. The major goal of intra refresh is improvement of
  13688. error resilience without significant impact on encoded bitstream size caused by
  13689. I frames. The SDK encoder achieves this by encoding part of each frame in
  13690. refresh cycle using intra MBs. <var class="var">none</var> means no refresh. <var class="var">vertical</var> means
  13691. vertical refresh, by column of MBs. <var class="var">horizontal</var> means horizontal refresh,
  13692. by rows of MBs. <var class="var">slice</var> means horizontal refresh by slices without
  13693. overlapping. In case of <var class="var">slice</var>, in_ref_cycle_size is ignored. To enable
  13694. intra refresh, B frame should be set to 0.
  13695. </p>
  13696. </dd>
  13697. <dt><samp class="option"><var class="var">int_ref_cycle_size</var></samp></dt>
  13698. <dd><p>Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
  13699. invalid values.
  13700. </p>
  13701. </dd>
  13702. <dt><samp class="option"><var class="var">int_ref_qp_delta</var></samp></dt>
  13703. <dd><p>Specifies QP difference for inserted intra MBs. This is signed value in
  13704. [-51, 51] range if target encoding bit-depth for luma samples is 8 and this
  13705. range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
  13706. </p>
  13707. </dd>
  13708. <dt><samp class="option"><var class="var">int_ref_cycle_dist</var></samp></dt>
  13709. <dd><p>Distance between the beginnings of the intra-refresh cycles in frames.
  13710. </p>
  13711. </dd>
  13712. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  13713. <dd><dl class="table">
  13714. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  13715. <dt>&lsquo;<samp class="samp">baseline</samp>&rsquo;</dt>
  13716. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  13717. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  13718. </dl>
  13719. </dd>
  13720. <dt><samp class="option"><var class="var">a53cc</var></samp></dt>
  13721. <dd><p>Use A53 Closed Captions (if available).
  13722. </p>
  13723. </dd>
  13724. <dt><samp class="option"><var class="var">aud</var></samp></dt>
  13725. <dd><p>Insert the Access Unit Delimiter NAL.
  13726. </p>
  13727. </dd>
  13728. <dt><samp class="option"><var class="var">mfmode</var></samp></dt>
  13729. <dd><p>Multi-Frame Mode.
  13730. </p><dl class="table">
  13731. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  13732. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  13733. </dl>
  13734. </dd>
  13735. <dt><samp class="option"><var class="var">repeat_pps</var></samp></dt>
  13736. <dd><p>Repeat pps for every frame.
  13737. </p>
  13738. </dd>
  13739. <dt><samp class="option"><var class="var">max_qp_i</var></samp></dt>
  13740. <dd><p>Maximum video quantizer scale for I frame.
  13741. </p>
  13742. </dd>
  13743. <dt><samp class="option"><var class="var">min_qp_i</var></samp></dt>
  13744. <dd><p>Minimum video quantizer scale for I frame.
  13745. </p>
  13746. </dd>
  13747. <dt><samp class="option"><var class="var">max_qp_p</var></samp></dt>
  13748. <dd><p>Maximum video quantizer scale for P frame.
  13749. </p>
  13750. </dd>
  13751. <dt><samp class="option"><var class="var">min_qp_p</var></samp></dt>
  13752. <dd><p>Minimum video quantizer scale for P frame.
  13753. </p>
  13754. </dd>
  13755. <dt><samp class="option"><var class="var">max_qp_b</var></samp></dt>
  13756. <dd><p>Maximum video quantizer scale for B frame.
  13757. </p>
  13758. </dd>
  13759. <dt><samp class="option"><var class="var">min_qp_b</var></samp></dt>
  13760. <dd><p>Minimum video quantizer scale for B frame.
  13761. </p>
  13762. </dd>
  13763. <dt><samp class="option"><var class="var">scenario</var></samp></dt>
  13764. <dd><p>Provides a hint to encoder about the scenario for the encoding session.
  13765. </p><dl class="table">
  13766. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  13767. <dt>&lsquo;<samp class="samp">displayremoting</samp>&rsquo;</dt>
  13768. <dt>&lsquo;<samp class="samp">videoconference</samp>&rsquo;</dt>
  13769. <dt>&lsquo;<samp class="samp">archive</samp>&rsquo;</dt>
  13770. <dt>&lsquo;<samp class="samp">livestreaming</samp>&rsquo;</dt>
  13771. <dt>&lsquo;<samp class="samp">cameracapture</samp>&rsquo;</dt>
  13772. <dt>&lsquo;<samp class="samp">videosurveillance</samp>&rsquo;</dt>
  13773. <dt>&lsquo;<samp class="samp">gamestreaming</samp>&rsquo;</dt>
  13774. <dt>&lsquo;<samp class="samp">remotegaming</samp>&rsquo;</dt>
  13775. </dl>
  13776. </dd>
  13777. <dt><samp class="option"><var class="var">avbr_accuracy</var></samp></dt>
  13778. <dd><p>Accuracy of the AVBR ratecontrol (unit of tenth of percent).
  13779. </p>
  13780. </dd>
  13781. <dt><samp class="option"><var class="var">avbr_convergence</var></samp></dt>
  13782. <dd><p>Convergence of the AVBR ratecontrol (unit of 100 frames)
  13783. </p>
  13784. <p>The parameters <var class="var">avbr_accuracy</var> and <var class="var">avbr_convergence</var> are for the
  13785. average variable bitrate control (AVBR) algorithm.
  13786. The algorithm focuses on overall encoding quality while meeting the specified
  13787. bitrate, <var class="var">target_bitrate</var>, within the accuracy range <var class="var">avbr_accuracy</var>,
  13788. after a <var class="var">avbr_Convergence</var> period. This method does not follow HRD and the
  13789. instant bitrate is not capped or padded.
  13790. </p>
  13791. </dd>
  13792. <dt><samp class="option"><var class="var">skip_frame</var></samp></dt>
  13793. <dd><p>Use per-frame metadata &quot;qsv_skip_frame&quot; to skip frame when encoding. This option
  13794. defines the usage of this metadata.
  13795. </p><dl class="table">
  13796. <dt>&lsquo;<samp class="samp">no_skip</samp>&rsquo;</dt>
  13797. <dd><p>Frame skipping is disabled.
  13798. </p></dd>
  13799. <dt>&lsquo;<samp class="samp">insert_dummy</samp>&rsquo;</dt>
  13800. <dd><p>Encoder inserts into bitstream frame where all macroblocks are encoded as
  13801. skipped.
  13802. </p></dd>
  13803. <dt>&lsquo;<samp class="samp">insert_nothing</samp>&rsquo;</dt>
  13804. <dd><p>Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped
  13805. frames are still used in brc. For example, gop still include skipped frames, and
  13806. the frames after skipped frames will be larger in size.
  13807. </p></dd>
  13808. <dt>&lsquo;<samp class="samp">brc_only</samp>&rsquo;</dt>
  13809. <dd><p>skip_frame metadata indicates the number of missed frames before the current
  13810. frame.
  13811. </p></dd>
  13812. </dl>
  13813. </dd>
  13814. </dl>
  13815. </div>
  13816. <div class="subsection-level-extent" id="HEVC-Options-1">
  13817. <h4 class="subsection"><span>16.25.6 HEVC Options<a class="copiable-link" href="#HEVC-Options-1"> &para;</a></span></h4>
  13818. <p>These options are used by hevc_qsv
  13819. </p>
  13820. <dl class="table">
  13821. <dt><samp class="option"><var class="var">extbrc</var></samp></dt>
  13822. <dd><p>Extended bitrate control.
  13823. </p>
  13824. </dd>
  13825. <dt><samp class="option"><var class="var">recovery_point_sei</var></samp></dt>
  13826. <dd><p>Set this flag to insert the recovery point SEI message at the beginning of every
  13827. intra refresh cycle.
  13828. </p>
  13829. </dd>
  13830. <dt><samp class="option"><var class="var">rdo</var></samp></dt>
  13831. <dd><p>Enable rate distortion optimization.
  13832. </p>
  13833. </dd>
  13834. <dt><samp class="option"><var class="var">max_frame_size</var></samp></dt>
  13835. <dd><p>Maximum encoded frame size in bytes.
  13836. </p>
  13837. </dd>
  13838. <dt><samp class="option"><var class="var">max_frame_size_i</var></samp></dt>
  13839. <dd><p>Maximum encoded frame size for I frames in bytes. If this value is set as larger
  13840. than zero, then for I frames the value set by max_frame_size is ignored.
  13841. </p>
  13842. </dd>
  13843. <dt><samp class="option"><var class="var">max_frame_size_p</var></samp></dt>
  13844. <dd><p>Maximum encoded frame size for P frames in bytes. If this value is set as larger
  13845. than zero, then for P frames the value set by max_frame_size is ignored.
  13846. </p>
  13847. </dd>
  13848. <dt><samp class="option"><var class="var">max_slice_size</var></samp></dt>
  13849. <dd><p>Maximum encoded slice size in bytes.
  13850. </p>
  13851. </dd>
  13852. <dt><samp class="option"><var class="var">mbbrc</var></samp></dt>
  13853. <dd><p>Setting this flag enables macroblock level bitrate control that generally
  13854. improves subjective visual quality. Enabling this flag may have negative impact
  13855. on performance and objective visual quality metric.
  13856. </p>
  13857. </dd>
  13858. <dt><samp class="option"><var class="var">low_delay_brc</var></samp></dt>
  13859. <dd><p>Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
  13860. more accurate bitrate control to minimize the variance of bitstream size frame
  13861. by frame. Value: -1-default 0-off 1-on
  13862. </p>
  13863. </dd>
  13864. <dt><samp class="option"><var class="var">adaptive_i</var></samp></dt>
  13865. <dd><p>This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  13866. to allow changing of frame type from P and B to I.
  13867. </p>
  13868. </dd>
  13869. <dt><samp class="option"><var class="var">adaptive_b</var></samp></dt>
  13870. <dd><p>This flag controls changing of frame type from B to P.
  13871. </p>
  13872. </dd>
  13873. <dt><samp class="option"><var class="var">p_strategy</var></samp></dt>
  13874. <dd><p>Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).
  13875. </p>
  13876. </dd>
  13877. <dt><samp class="option"><var class="var">b_strategy</var></samp></dt>
  13878. <dd><p>This option controls usage of B frames as reference.
  13879. </p>
  13880. </dd>
  13881. <dt><samp class="option"><var class="var">dblk_idc</var></samp></dt>
  13882. <dd><p>This option disable deblocking. It has value in range 0~2.
  13883. </p>
  13884. </dd>
  13885. <dt><samp class="option"><var class="var">idr_interval</var></samp></dt>
  13886. <dd><p>Distance (in I-frames) between IDR frames.
  13887. </p><dl class="table">
  13888. <dt>&lsquo;<samp class="samp">begin_only</samp>&rsquo;</dt>
  13889. <dd><p>Output an IDR-frame only at the beginning of the stream.
  13890. </p></dd>
  13891. </dl>
  13892. </dd>
  13893. <dt><samp class="option"><var class="var">load_plugin</var></samp></dt>
  13894. <dd><p>A user plugin to load in an internal session.
  13895. </p><dl class="table">
  13896. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  13897. <dt>&lsquo;<samp class="samp">hevc_sw</samp>&rsquo;</dt>
  13898. <dt>&lsquo;<samp class="samp">hevc_hw</samp>&rsquo;</dt>
  13899. </dl>
  13900. </dd>
  13901. <dt><samp class="option"><var class="var">load_plugins</var></samp></dt>
  13902. <dd><p>A :-separate list of hexadecimal plugin UIDs to load in
  13903. an internal session.
  13904. </p>
  13905. </dd>
  13906. <dt><samp class="option"><var class="var">look_ahead_depth</var></samp></dt>
  13907. <dd><p>Depth of look ahead in number frames, available when extbrc option is enabled.
  13908. </p>
  13909. </dd>
  13910. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  13911. <dd><p>Set the encoding profile (scc requires libmfx &gt;= 1.32).
  13912. </p>
  13913. <dl class="table">
  13914. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  13915. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  13916. <dt>&lsquo;<samp class="samp">main10</samp>&rsquo;</dt>
  13917. <dt>&lsquo;<samp class="samp">mainsp</samp>&rsquo;</dt>
  13918. <dt>&lsquo;<samp class="samp">rext</samp>&rsquo;</dt>
  13919. <dt>&lsquo;<samp class="samp">scc</samp>&rsquo;</dt>
  13920. </dl>
  13921. </dd>
  13922. <dt><samp class="option"><var class="var">tier</var></samp></dt>
  13923. <dd><p>Set the encoding tier (only level &gt;= 4 can support high tier).
  13924. This option only takes effect when the level option is specified.
  13925. </p>
  13926. <dl class="table">
  13927. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  13928. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  13929. </dl>
  13930. </dd>
  13931. <dt><samp class="option"><var class="var">gpb</var></samp></dt>
  13932. <dd><p>1: GPB (generalized P/B frame)
  13933. </p>
  13934. <p>0: regular P frame.
  13935. </p>
  13936. </dd>
  13937. <dt><samp class="option"><var class="var">tile_cols</var></samp></dt>
  13938. <dd><p>Number of columns for tiled encoding.
  13939. </p>
  13940. </dd>
  13941. <dt><samp class="option"><var class="var">tile_rows</var></samp></dt>
  13942. <dd><p>Number of rows for tiled encoding.
  13943. </p>
  13944. </dd>
  13945. <dt><samp class="option"><var class="var">aud</var></samp></dt>
  13946. <dd><p>Insert the Access Unit Delimiter NAL.
  13947. </p>
  13948. </dd>
  13949. <dt><samp class="option"><var class="var">pic_timing_sei</var></samp></dt>
  13950. <dd><p>Insert picture timing SEI with pic_struct_syntax element.
  13951. </p>
  13952. </dd>
  13953. <dt><samp class="option"><var class="var">transform_skip</var></samp></dt>
  13954. <dd><p>Turn this option ON to enable transformskip. It is supported on platform equal
  13955. or newer than ICL.
  13956. </p>
  13957. </dd>
  13958. <dt><samp class="option"><var class="var">int_ref_type</var></samp></dt>
  13959. <dd><p>Specifies intra refresh type. The major goal of intra refresh is improvement of
  13960. error resilience without significant impact on encoded bitstream size caused by
  13961. I frames. The SDK encoder achieves this by encoding part of each frame in
  13962. refresh cycle using intra MBs. <var class="var">none</var> means no refresh. <var class="var">vertical</var> means
  13963. vertical refresh, by column of MBs. <var class="var">horizontal</var> means horizontal refresh,
  13964. by rows of MBs. <var class="var">slice</var> means horizontal refresh by slices without
  13965. overlapping. In case of <var class="var">slice</var>, in_ref_cycle_size is ignored. To enable
  13966. intra refresh, B frame should be set to 0.
  13967. </p>
  13968. </dd>
  13969. <dt><samp class="option"><var class="var">int_ref_cycle_size</var></samp></dt>
  13970. <dd><p>Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are
  13971. invalid values.
  13972. </p>
  13973. </dd>
  13974. <dt><samp class="option"><var class="var">int_ref_qp_delta</var></samp></dt>
  13975. <dd><p>Specifies QP difference for inserted intra MBs. This is signed value in
  13976. [-51, 51] range if target encoding bit-depth for luma samples is 8 and this
  13977. range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively.
  13978. </p>
  13979. </dd>
  13980. <dt><samp class="option"><var class="var">int_ref_cycle_dist</var></samp></dt>
  13981. <dd><p>Distance between the beginnings of the intra-refresh cycles in frames.
  13982. </p>
  13983. </dd>
  13984. <dt><samp class="option"><var class="var">max_qp_i</var></samp></dt>
  13985. <dd><p>Maximum video quantizer scale for I frame.
  13986. </p>
  13987. </dd>
  13988. <dt><samp class="option"><var class="var">min_qp_i</var></samp></dt>
  13989. <dd><p>Minimum video quantizer scale for I frame.
  13990. </p>
  13991. </dd>
  13992. <dt><samp class="option"><var class="var">max_qp_p</var></samp></dt>
  13993. <dd><p>Maximum video quantizer scale for P frame.
  13994. </p>
  13995. </dd>
  13996. <dt><samp class="option"><var class="var">min_qp_p</var></samp></dt>
  13997. <dd><p>Minimum video quantizer scale for P frame.
  13998. </p>
  13999. </dd>
  14000. <dt><samp class="option"><var class="var">max_qp_b</var></samp></dt>
  14001. <dd><p>Maximum video quantizer scale for B frame.
  14002. </p>
  14003. </dd>
  14004. <dt><samp class="option"><var class="var">min_qp_b</var></samp></dt>
  14005. <dd><p>Minimum video quantizer scale for B frame.
  14006. </p>
  14007. </dd>
  14008. <dt><samp class="option"><var class="var">scenario</var></samp></dt>
  14009. <dd><p>Provides a hint to encoder about the scenario for the encoding session.
  14010. </p><dl class="table">
  14011. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14012. <dt>&lsquo;<samp class="samp">displayremoting</samp>&rsquo;</dt>
  14013. <dt>&lsquo;<samp class="samp">videoconference</samp>&rsquo;</dt>
  14014. <dt>&lsquo;<samp class="samp">archive</samp>&rsquo;</dt>
  14015. <dt>&lsquo;<samp class="samp">livestreaming</samp>&rsquo;</dt>
  14016. <dt>&lsquo;<samp class="samp">cameracapture</samp>&rsquo;</dt>
  14017. <dt>&lsquo;<samp class="samp">videosurveillance</samp>&rsquo;</dt>
  14018. <dt>&lsquo;<samp class="samp">gamestreaming</samp>&rsquo;</dt>
  14019. <dt>&lsquo;<samp class="samp">remotegaming</samp>&rsquo;</dt>
  14020. </dl>
  14021. </dd>
  14022. <dt><samp class="option"><var class="var">avbr_accuracy</var></samp></dt>
  14023. <dd><p>Accuracy of the AVBR ratecontrol (unit of tenth of percent).
  14024. </p>
  14025. </dd>
  14026. <dt><samp class="option"><var class="var">avbr_convergence</var></samp></dt>
  14027. <dd><p>Convergence of the AVBR ratecontrol (unit of 100 frames)
  14028. </p>
  14029. <p>The parameters <var class="var">avbr_accuracy</var> and <var class="var">avbr_convergence</var> are for the
  14030. average variable bitrate control (AVBR) algorithm.
  14031. The algorithm focuses on overall encoding quality while meeting the specified
  14032. bitrate, <var class="var">target_bitrate</var>, within the accuracy range <var class="var">avbr_accuracy</var>,
  14033. after a <var class="var">avbr_Convergence</var> period. This method does not follow HRD and the
  14034. instant bitrate is not capped or padded.
  14035. </p>
  14036. </dd>
  14037. <dt><samp class="option"><var class="var">skip_frame</var></samp></dt>
  14038. <dd><p>Use per-frame metadata &quot;qsv_skip_frame&quot; to skip frame when encoding. This option
  14039. defines the usage of this metadata.
  14040. </p><dl class="table">
  14041. <dt>&lsquo;<samp class="samp">no_skip</samp>&rsquo;</dt>
  14042. <dd><p>Frame skipping is disabled.
  14043. </p></dd>
  14044. <dt>&lsquo;<samp class="samp">insert_dummy</samp>&rsquo;</dt>
  14045. <dd><p>Encoder inserts into bitstream frame where all macroblocks are encoded as
  14046. skipped.
  14047. </p></dd>
  14048. <dt>&lsquo;<samp class="samp">insert_nothing</samp>&rsquo;</dt>
  14049. <dd><p>Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped
  14050. frames are still used in brc. For example, gop still include skipped frames, and
  14051. the frames after skipped frames will be larger in size.
  14052. </p></dd>
  14053. <dt>&lsquo;<samp class="samp">brc_only</samp>&rsquo;</dt>
  14054. <dd><p>skip_frame metadata indicates the number of missed frames before the current
  14055. frame.
  14056. </p></dd>
  14057. </dl>
  14058. </dd>
  14059. </dl>
  14060. </div>
  14061. <div class="subsection-level-extent" id="MPEG2-Options">
  14062. <h4 class="subsection"><span>16.25.7 MPEG2 Options<a class="copiable-link" href="#MPEG2-Options"> &para;</a></span></h4>
  14063. <p>These options are used by mpeg2_qsv
  14064. </p><dl class="table">
  14065. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  14066. <dd><dl class="table">
  14067. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14068. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  14069. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  14070. <dt>&lsquo;<samp class="samp">high</samp>&rsquo;</dt>
  14071. </dl>
  14072. </dd>
  14073. </dl>
  14074. </div>
  14075. <div class="subsection-level-extent" id="VP9-Options">
  14076. <h4 class="subsection"><span>16.25.8 VP9 Options<a class="copiable-link" href="#VP9-Options"> &para;</a></span></h4>
  14077. <p>These options are used by vp9_qsv
  14078. </p><dl class="table">
  14079. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  14080. <dd><dl class="table">
  14081. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14082. <dt>&lsquo;<samp class="samp">profile0</samp>&rsquo;</dt>
  14083. <dt>&lsquo;<samp class="samp">profile1</samp>&rsquo;</dt>
  14084. <dt>&lsquo;<samp class="samp">profile2</samp>&rsquo;</dt>
  14085. <dt>&lsquo;<samp class="samp">profile3</samp>&rsquo;</dt>
  14086. </dl>
  14087. </dd>
  14088. <dt><samp class="option"><var class="var">tile_cols</var></samp></dt>
  14089. <dd><p>Number of columns for tiled encoding (requires libmfx &gt;= 1.29).
  14090. </p>
  14091. </dd>
  14092. <dt><samp class="option"><var class="var">tile_rows</var></samp></dt>
  14093. <dd><p>Number of rows for tiled encoding (requires libmfx &gt;= 1.29).
  14094. </p></dd>
  14095. </dl>
  14096. </div>
  14097. <div class="subsection-level-extent" id="AV1-Options">
  14098. <h4 class="subsection"><span>16.25.9 AV1 Options<a class="copiable-link" href="#AV1-Options"> &para;</a></span></h4>
  14099. <p>These options are used by av1_qsv (requires libvpl).
  14100. </p><dl class="table">
  14101. <dt><samp class="option"><var class="var">profile</var></samp></dt>
  14102. <dd><dl class="table">
  14103. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  14104. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  14105. </dl>
  14106. </dd>
  14107. <dt><samp class="option"><var class="var">tile_cols</var></samp></dt>
  14108. <dd><p>Number of columns for tiled encoding.
  14109. </p>
  14110. </dd>
  14111. <dt><samp class="option"><var class="var">tile_rows</var></samp></dt>
  14112. <dd><p>Number of rows for tiled encoding.
  14113. </p>
  14114. </dd>
  14115. <dt><samp class="option"><var class="var">adaptive_i</var></samp></dt>
  14116. <dd><p>This flag controls insertion of I frames by the QSV encoder. Turn ON this flag
  14117. to allow changing of frame type from P and B to I.
  14118. </p>
  14119. </dd>
  14120. <dt><samp class="option"><var class="var">adaptive_b</var></samp></dt>
  14121. <dd><p>This flag controls changing of frame type from B to P.
  14122. </p>
  14123. </dd>
  14124. <dt><samp class="option"><var class="var">b_strategy</var></samp></dt>
  14125. <dd><p>This option controls usage of B frames as reference.
  14126. </p>
  14127. </dd>
  14128. <dt><samp class="option"><var class="var">extbrc</var></samp></dt>
  14129. <dd><p>Extended bitrate control.
  14130. </p>
  14131. </dd>
  14132. <dt><samp class="option"><var class="var">look_ahead_depth</var></samp></dt>
  14133. <dd><p>Depth of look ahead in number frames, available when extbrc option is enabled.
  14134. </p>
  14135. </dd>
  14136. <dt><samp class="option"><var class="var">low_delay_brc</var></samp></dt>
  14137. <dd><p>Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides
  14138. more accurate bitrate control to minimize the variance of bitstream size frame
  14139. by frame. Value: -1-default 0-off 1-on
  14140. </p>
  14141. </dd>
  14142. <dt><samp class="option">max_frame_size</samp></dt>
  14143. <dd><p>Set the allowed max size in bytes for each frame. If the frame size exceeds
  14144. the limitation, encoder will adjust the QP value to control the frame size.
  14145. Invalid in CQP rate control mode.
  14146. </p></dd>
  14147. </dl>
  14148. </div>
  14149. </div>
  14150. <div class="section-level-extent" id="snow">
  14151. <h3 class="section"><span>16.26 snow<a class="copiable-link" href="#snow"> &para;</a></span></h3>
  14152. <ul class="mini-toc">
  14153. <li><a href="#Options-43" accesskey="1">Options</a></li>
  14154. </ul>
  14155. <div class="subsection-level-extent" id="Options-43">
  14156. <h4 class="subsection"><span>16.26.1 Options<a class="copiable-link" href="#Options-43"> &para;</a></span></h4>
  14157. <dl class="table">
  14158. <dt><samp class="option">iterative_dia_size</samp></dt>
  14159. <dd><p>dia size for the iterative motion estimation
  14160. </p></dd>
  14161. </dl>
  14162. </div>
  14163. </div>
  14164. <div class="section-level-extent" id="VAAPI-encoders">
  14165. <h3 class="section"><span>16.27 VAAPI encoders<a class="copiable-link" href="#VAAPI-encoders"> &para;</a></span></h3>
  14166. <p>Wrappers for hardware encoders accessible via VAAPI.
  14167. </p>
  14168. <p>These encoders only accept input in VAAPI hardware surfaces. If you have input
  14169. in software frames, use the <samp class="option">hwupload</samp> filter to upload them to the GPU.
  14170. </p>
  14171. <p>The following standard libavcodec options are used:
  14172. </p><ul class="itemize mark-bullet">
  14173. <li><samp class="option">g</samp> / <samp class="option">gop_size</samp>
  14174. </li><li><samp class="option">bf</samp> / <samp class="option">max_b_frames</samp>
  14175. </li><li><samp class="option">profile</samp>
  14176. <p>If not set, this will be determined automatically from the format of the input
  14177. frames and the profiles supported by the driver.
  14178. </p></li><li><samp class="option">level</samp>
  14179. </li><li><samp class="option">b</samp> / <samp class="option">bit_rate</samp>
  14180. </li><li><samp class="option">maxrate</samp> / <samp class="option">rc_max_rate</samp>
  14181. </li><li><samp class="option">bufsize</samp> / <samp class="option">rc_buffer_size</samp>
  14182. </li><li><samp class="option">rc_init_occupancy</samp> / <samp class="option">rc_initial_buffer_occupancy</samp>
  14183. </li><li><samp class="option">compression_level</samp>
  14184. <p>Speed / quality tradeoff: higher values are faster / worse quality.
  14185. </p></li><li><samp class="option">q</samp> / <samp class="option">global_quality</samp>
  14186. <p>Size / quality tradeoff: higher values are smaller / worse quality.
  14187. </p></li><li><samp class="option">qmin</samp>
  14188. </li><li><samp class="option">qmax</samp>
  14189. </li><li><samp class="option">i_qfactor</samp> / <samp class="option">i_quant_factor</samp>
  14190. </li><li><samp class="option">i_qoffset</samp> / <samp class="option">i_quant_offset</samp>
  14191. </li><li><samp class="option">b_qfactor</samp> / <samp class="option">b_quant_factor</samp>
  14192. </li><li><samp class="option">b_qoffset</samp> / <samp class="option">b_quant_offset</samp>
  14193. </li><li><samp class="option">slices</samp>
  14194. </li></ul>
  14195. <p>All encoders support the following options:
  14196. </p><dl class="table">
  14197. <dt><samp class="option">low_power</samp></dt>
  14198. <dd><p>Some drivers/platforms offer a second encoder for some codecs intended to use
  14199. less power than the default encoder; setting this option will attempt to use
  14200. that encoder. Note that it may support a reduced feature set, so some other
  14201. options may not be available in this mode.
  14202. </p>
  14203. </dd>
  14204. <dt><samp class="option">idr_interval</samp></dt>
  14205. <dd><p>Set the number of normal intra frames between full-refresh (IDR) frames in
  14206. open-GOP mode. The intra frames are still IRAPs, but will not include global
  14207. headers and may have non-decodable leading pictures.
  14208. </p>
  14209. </dd>
  14210. <dt><samp class="option">b_depth</samp></dt>
  14211. <dd><p>Set the B-frame reference depth. When set to one (the default), all B-frames
  14212. will refer only to P- or I-frames. When set to greater values multiple layers
  14213. of B-frames will be present, frames in each layer only referring to frames in
  14214. higher layers.
  14215. </p>
  14216. </dd>
  14217. <dt><samp class="option">async_depth</samp></dt>
  14218. <dd><p>Maximum processing parallelism. Increase this to improve single channel
  14219. performance. This option doesn&rsquo;t work if driver doesn&rsquo;t implement vaSyncBuffer
  14220. function. Please make sure there are enough hw_frames allocated if a large
  14221. number of async_depth is used.
  14222. </p>
  14223. </dd>
  14224. <dt><samp class="option">max_frame_size</samp></dt>
  14225. <dd><p>Set the allowed max size in bytes for each frame. If the frame size exceeds
  14226. the limitation, encoder will adjust the QP value to control the frame size.
  14227. Invalid in CQP rate control mode.
  14228. </p>
  14229. </dd>
  14230. <dt><samp class="option">rc_mode</samp></dt>
  14231. <dd><p>Set the rate control mode to use. A given driver may only support a subset of
  14232. modes.
  14233. </p>
  14234. <p>Possible modes:
  14235. </p><dl class="table">
  14236. <dt><samp class="option">auto</samp></dt>
  14237. <dd><p>Choose the mode automatically based on driver support and the other options.
  14238. This is the default.
  14239. </p></dd>
  14240. <dt><samp class="option">CQP</samp></dt>
  14241. <dd><p>Constant-quality.
  14242. </p></dd>
  14243. <dt><samp class="option">CBR</samp></dt>
  14244. <dd><p>Constant-bitrate.
  14245. </p></dd>
  14246. <dt><samp class="option">VBR</samp></dt>
  14247. <dd><p>Variable-bitrate.
  14248. </p></dd>
  14249. <dt><samp class="option">ICQ</samp></dt>
  14250. <dd><p>Intelligent constant-quality.
  14251. </p></dd>
  14252. <dt><samp class="option">QVBR</samp></dt>
  14253. <dd><p>Quality-defined variable-bitrate.
  14254. </p></dd>
  14255. <dt><samp class="option">AVBR</samp></dt>
  14256. <dd><p>Average variable bitrate.
  14257. </p></dd>
  14258. </dl>
  14259. </dd>
  14260. <dt><samp class="option">blbrc</samp></dt>
  14261. <dd><p>Enable block level rate control, which assigns different bitrate block by block.
  14262. Invalid for CQP mode.
  14263. </p>
  14264. </dd>
  14265. </dl>
  14266. <p>Each encoder also has its own specific options:
  14267. </p><dl class="table">
  14268. <dt><samp class="option">av1_vaapi</samp></dt>
  14269. <dd><p><samp class="option">profile</samp> sets the value of <em class="emph">seq_profile</em>.
  14270. <samp class="option">tier</samp> sets the value of <em class="emph">seq_tier</em>.
  14271. <samp class="option">level</samp> sets the value of <em class="emph">seq_level_idx</em>.
  14272. </p>
  14273. <dl class="table">
  14274. <dt><samp class="option">tiles</samp></dt>
  14275. <dd><p>Set the number of tiles to encode the input video with, as columns x rows.
  14276. (default is auto, which means use minimal tile column/row number).
  14277. </p></dd>
  14278. <dt><samp class="option">tile_groups</samp></dt>
  14279. <dd><p>Set tile groups number. All the tiles will be distributed as evenly as possible to
  14280. each tile group. (default is 1).
  14281. </p></dd>
  14282. </dl>
  14283. </dd>
  14284. <dt><samp class="option">h264_vaapi</samp></dt>
  14285. <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.
  14286. <samp class="option">level</samp> sets the value of <em class="emph">level_idc</em>.
  14287. </p>
  14288. <dl class="table">
  14289. <dt><samp class="option">coder</samp></dt>
  14290. <dd><p>Set entropy encoder (default is <em class="emph">cabac</em>). Possible values:
  14291. </p>
  14292. <dl class="table">
  14293. <dt>&lsquo;<samp class="samp">ac</samp>&rsquo;</dt>
  14294. <dt>&lsquo;<samp class="samp">cabac</samp>&rsquo;</dt>
  14295. <dd><p>Use CABAC.
  14296. </p>
  14297. </dd>
  14298. <dt>&lsquo;<samp class="samp">vlc</samp>&rsquo;</dt>
  14299. <dt>&lsquo;<samp class="samp">cavlc</samp>&rsquo;</dt>
  14300. <dd><p>Use CAVLC.
  14301. </p></dd>
  14302. </dl>
  14303. </dd>
  14304. <dt><samp class="option">aud</samp></dt>
  14305. <dd><p>Include access unit delimiters in the stream (not included by default).
  14306. </p>
  14307. </dd>
  14308. <dt><samp class="option">sei</samp></dt>
  14309. <dd><p>Set SEI message types to include.
  14310. Some combination of the following values:
  14311. </p><dl class="table">
  14312. <dt>&lsquo;<samp class="samp">identifier</samp>&rsquo;</dt>
  14313. <dd><p>Include a <em class="emph">user_data_unregistered</em> message containing information about
  14314. the encoder.
  14315. </p></dd>
  14316. <dt>&lsquo;<samp class="samp">timing</samp>&rsquo;</dt>
  14317. <dd><p>Include picture timing parameters (<em class="emph">buffering_period</em> and
  14318. <em class="emph">pic_timing</em> messages).
  14319. </p></dd>
  14320. <dt>&lsquo;<samp class="samp">recovery_point</samp>&rsquo;</dt>
  14321. <dd><p>Include recovery points where appropriate (<em class="emph">recovery_point</em> messages).
  14322. </p></dd>
  14323. </dl>
  14324. </dd>
  14325. </dl>
  14326. </dd>
  14327. <dt><samp class="option">hevc_vaapi</samp></dt>
  14328. <dd><p><samp class="option">profile</samp> and <samp class="option">level</samp> set the values of
  14329. <em class="emph">general_profile_idc</em> and <em class="emph">general_level_idc</em> respectively.
  14330. </p>
  14331. <dl class="table">
  14332. <dt><samp class="option">aud</samp></dt>
  14333. <dd><p>Include access unit delimiters in the stream (not included by default).
  14334. </p>
  14335. </dd>
  14336. <dt><samp class="option">tier</samp></dt>
  14337. <dd><p>Set <em class="emph">general_tier_flag</em>. This may affect the level chosen for the stream
  14338. if it is not explicitly specified.
  14339. </p>
  14340. </dd>
  14341. <dt><samp class="option">sei</samp></dt>
  14342. <dd><p>Set SEI message types to include.
  14343. Some combination of the following values:
  14344. </p><dl class="table">
  14345. <dt>&lsquo;<samp class="samp">hdr</samp>&rsquo;</dt>
  14346. <dd><p>Include HDR metadata if the input frames have it
  14347. (<em class="emph">mastering_display_colour_volume</em> and <em class="emph">content_light_level</em>
  14348. messages).
  14349. </p></dd>
  14350. </dl>
  14351. </dd>
  14352. <dt><samp class="option">tiles</samp></dt>
  14353. <dd><p>Set the number of tiles to encode the input video with, as columns x rows.
  14354. Larger numbers allow greater parallelism in both encoding and decoding, but
  14355. may decrease coding efficiency.
  14356. </p>
  14357. </dd>
  14358. </dl>
  14359. </dd>
  14360. <dt><samp class="option">mjpeg_vaapi</samp></dt>
  14361. <dd><p>Only baseline DCT encoding is supported. The encoder always uses the standard
  14362. quantisation and huffman tables - <samp class="option">global_quality</samp> scales the standard
  14363. quantisation table (range 1-100).
  14364. </p>
  14365. <p>For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
  14366. supported, and will create an RGB JPEG.
  14367. </p>
  14368. <dl class="table">
  14369. <dt><samp class="option">jfif</samp></dt>
  14370. <dd><p>Include JFIF header in each frame (not included by default).
  14371. </p></dd>
  14372. <dt><samp class="option">huffman</samp></dt>
  14373. <dd><p>Include standard huffman tables (on by default). Turning this off will save
  14374. a few hundred bytes in each output frame, but may lose compatibility with some
  14375. JPEG decoders which don&rsquo;t fully handle MJPEG.
  14376. </p></dd>
  14377. </dl>
  14378. </dd>
  14379. <dt><samp class="option">mpeg2_vaapi</samp></dt>
  14380. <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>.
  14381. </p>
  14382. </dd>
  14383. <dt><samp class="option">vp8_vaapi</samp></dt>
  14384. <dd><p>B-frames are not supported.
  14385. </p>
  14386. <p><samp class="option">global_quality</samp> sets the <em class="emph">q_idx</em> used for non-key frames (range 0-127).
  14387. </p>
  14388. <dl class="table">
  14389. <dt><samp class="option">loop_filter_level</samp></dt>
  14390. <dt><samp class="option">loop_filter_sharpness</samp></dt>
  14391. <dd><p>Manually set the loop filter parameters.
  14392. </p></dd>
  14393. </dl>
  14394. </dd>
  14395. <dt><samp class="option">vp9_vaapi</samp></dt>
  14396. <dd><p><samp class="option">global_quality</samp> sets the <em class="emph">q_idx</em> used for P-frames (range 0-255).
  14397. </p>
  14398. <dl class="table">
  14399. <dt><samp class="option">loop_filter_level</samp></dt>
  14400. <dt><samp class="option">loop_filter_sharpness</samp></dt>
  14401. <dd><p>Manually set the loop filter parameters.
  14402. </p></dd>
  14403. </dl>
  14404. <p>B-frames are supported, but the output stream is always in encode order rather than display
  14405. order. If B-frames are enabled, it may be necessary to use the <samp class="option">vp9_raw_reorder</samp>
  14406. bitstream filter to modify the output stream to display frames in the correct order.
  14407. </p>
  14408. <p>Only normal frames are produced - the <samp class="option">vp9_superframe</samp> bitstream filter may be
  14409. required to produce a stream usable with all decoders.
  14410. </p>
  14411. </dd>
  14412. </dl>
  14413. </div>
  14414. <div class="section-level-extent" id="vbn">
  14415. <h3 class="section"><span>16.28 vbn<a class="copiable-link" href="#vbn"> &para;</a></span></h3>
  14416. <p>Vizrt Binary Image encoder.
  14417. </p>
  14418. <p>This format is used by the broadcast vendor Vizrt for quick texture streaming.
  14419. Advanced features of the format such as LZW compression of texture data or
  14420. generation of mipmaps are not supported.
  14421. </p>
  14422. <ul class="mini-toc">
  14423. <li><a href="#Options-44" accesskey="1">Options</a></li>
  14424. </ul>
  14425. <div class="subsection-level-extent" id="Options-44">
  14426. <h4 class="subsection"><span>16.28.1 Options<a class="copiable-link" href="#Options-44"> &para;</a></span></h4>
  14427. <dl class="table">
  14428. <dt><samp class="option">format <var class="var">string</var></samp></dt>
  14429. <dd><p>Sets the texture compression used by the VBN file. Can be <var class="var">dxt1</var>,
  14430. <var class="var">dxt5</var> or <var class="var">raw</var>. Default is <var class="var">dxt5</var>.
  14431. </p></dd>
  14432. </dl>
  14433. </div>
  14434. </div>
  14435. <div class="section-level-extent" id="vc2">
  14436. <h3 class="section"><span>16.29 vc2<a class="copiable-link" href="#vc2"> &para;</a></span></h3>
  14437. <p>SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  14438. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  14439. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  14440. other tasks which require low overhead and low compression (like screen
  14441. recording).
  14442. </p>
  14443. <ul class="mini-toc">
  14444. <li><a href="#Options-45" accesskey="1">Options</a></li>
  14445. </ul>
  14446. <div class="subsection-level-extent" id="Options-45">
  14447. <h4 class="subsection"><span>16.29.1 Options<a class="copiable-link" href="#Options-45"> &para;</a></span></h4>
  14448. <dl class="table">
  14449. <dt><samp class="option">b</samp></dt>
  14450. <dd><p>Sets target video bitrate. Usually that&rsquo;s around 1:6 of the uncompressed
  14451. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that&rsquo;s around 400Mbps). Higher
  14452. values (close to the uncompressed bitrate) turn on lossless compression mode.
  14453. </p>
  14454. </dd>
  14455. <dt><samp class="option">field_order</samp></dt>
  14456. <dd><p>Enables field coding when set (e.g. to tt - top field first) for interlaced
  14457. inputs. Should increase compression with interlaced content as it splits the
  14458. fields and encodes each separately.
  14459. </p>
  14460. </dd>
  14461. <dt><samp class="option">wavelet_depth</samp></dt>
  14462. <dd><p>Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  14463. Lower values reduce compression and quality. Less capable decoders may not be
  14464. able to handle values of <samp class="option">wavelet_depth</samp> over 3.
  14465. </p>
  14466. </dd>
  14467. <dt><samp class="option">wavelet_type</samp></dt>
  14468. <dd><p>Sets the transform type. Currently only <var class="var">5_3</var> (LeGall) and <var class="var">9_7</var>
  14469. (Deslauriers-Dubuc)
  14470. are implemented, with 9_7 being the one with better compression and thus
  14471. is the default.
  14472. </p>
  14473. </dd>
  14474. <dt><samp class="option">slice_width</samp></dt>
  14475. <dt><samp class="option">slice_height</samp></dt>
  14476. <dd><p>Sets the slice size for each slice. Larger values result in better compression.
  14477. For compatibility with other more limited decoders use <samp class="option">slice_width</samp> of
  14478. 32 and <samp class="option">slice_height</samp> of 8.
  14479. </p>
  14480. </dd>
  14481. <dt><samp class="option">tolerance</samp></dt>
  14482. <dd><p>Sets the undershoot tolerance of the rate control system in percent. This is
  14483. to prevent an expensive search from being run.
  14484. </p>
  14485. </dd>
  14486. <dt><samp class="option">qm</samp></dt>
  14487. <dd><p>Sets the quantization matrix preset to use by default or when <samp class="option">wavelet_depth</samp>
  14488. is set to 5
  14489. </p><ul class="itemize mark-minus">
  14490. <li><var class="var">default</var>
  14491. Uses the default quantization matrix from the specifications, extended with
  14492. values for the fifth level. This provides a good balance between keeping detail
  14493. and omitting artifacts.
  14494. </li><li><var class="var">flat</var>
  14495. Use a completely zeroed out quantization matrix. This increases PSNR but might
  14496. reduce perception. Use in bogus benchmarks.
  14497. </li><li><var class="var">color</var>
  14498. Reduces detail but attempts to preserve color at extremely low bitrates.
  14499. </li></ul>
  14500. </dd>
  14501. </dl>
  14502. </div>
  14503. </div>
  14504. </div>
  14505. <div class="chapter-level-extent" id="Subtitles-Encoders">
  14506. <h2 class="chapter"><span>17 Subtitles Encoders<a class="copiable-link" href="#Subtitles-Encoders"> &para;</a></span></h2>
  14507. <ul class="mini-toc">
  14508. <li><a href="#dvdsub-1" accesskey="1">dvdsub</a></li>
  14509. </ul>
  14510. <div class="section-level-extent" id="dvdsub-1">
  14511. <h3 class="section"><span>17.1 dvdsub<a class="copiable-link" href="#dvdsub-1"> &para;</a></span></h3>
  14512. <p>This codec encodes the bitmap subtitle format that is used in DVDs.
  14513. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  14514. and they can also be used in Matroska files.
  14515. </p>
  14516. <ul class="mini-toc">
  14517. <li><a href="#Options-46" accesskey="1">Options</a></li>
  14518. </ul>
  14519. <div class="subsection-level-extent" id="Options-46">
  14520. <h4 class="subsection"><span>17.1.1 Options<a class="copiable-link" href="#Options-46"> &para;</a></span></h4>
  14521. <dl class="table">
  14522. <dt><samp class="option">palette</samp></dt>
  14523. <dd><p>Specify the global palette used by the bitmaps.
  14524. </p>
  14525. <p>The format for this option is a string containing 16 24-bits hexadecimal
  14526. numbers (without 0x prefix) separated by commas, for example <code class="code">0d00ee,
  14527. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  14528. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  14529. </p>
  14530. </dd>
  14531. <dt><samp class="option">even_rows_fix</samp></dt>
  14532. <dd><p>When set to 1, enable a work-around that makes the number of pixel rows
  14533. even in all subtitles. This fixes a problem with some players that
  14534. cut off the bottom row if the number is odd. The work-around just adds
  14535. a fully transparent row if needed. The overhead is low, typically
  14536. one byte per subtitle on average.
  14537. </p>
  14538. <p>By default, this work-around is disabled.
  14539. </p></dd>
  14540. </dl>
  14541. </div>
  14542. </div>
  14543. </div>
  14544. <div class="chapter-level-extent" id="Bitstream-Filters">
  14545. <h2 class="chapter"><span>18 Bitstream Filters<a class="copiable-link" href="#Bitstream-Filters"> &para;</a></span></h2>
  14546. <p>When you configure your FFmpeg build, all the supported bitstream
  14547. filters are enabled by default. You can list all available ones using
  14548. the configure option <code class="code">--list-bsfs</code>.
  14549. </p>
  14550. <p>You can disable all the bitstream filters using the configure option
  14551. <code class="code">--disable-bsfs</code>, and selectively enable any bitstream filter using
  14552. the option <code class="code">--enable-bsf=BSF</code>, or you can disable a particular
  14553. bitstream filter using the option <code class="code">--disable-bsf=BSF</code>.
  14554. </p>
  14555. <p>The option <code class="code">-bsfs</code> of the ff* tools will display the list of
  14556. all the supported bitstream filters included in your build.
  14557. </p>
  14558. <p>The ff* tools have a -bsf option applied per stream, taking a
  14559. comma-separated list of filters, whose parameters follow the filter
  14560. name after a &rsquo;=&rsquo;.
  14561. </p>
  14562. <div class="example">
  14563. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  14564. </pre></div>
  14565. <p>Below is a description of the currently available bitstream filters,
  14566. with their parameters, if any.
  14567. </p>
  14568. <ul class="mini-toc">
  14569. <li><a href="#aac_005fadtstoasc" accesskey="1">aac_adtstoasc</a></li>
  14570. <li><a href="#av1_005fmetadata" accesskey="2">av1_metadata</a></li>
  14571. <li><a href="#chomp" accesskey="3">chomp</a></li>
  14572. <li><a href="#dca_005fcore" accesskey="4">dca_core</a></li>
  14573. <li><a href="#dump_005fextra" accesskey="5">dump_extra</a></li>
  14574. <li><a href="#dv_005ferror_005fmarker" accesskey="6">dv_error_marker</a></li>
  14575. <li><a href="#eac3_005fcore" accesskey="7">eac3_core</a></li>
  14576. <li><a href="#extract_005fextradata" accesskey="8">extract_extradata</a></li>
  14577. <li><a href="#filter_005funits" accesskey="9">filter_units</a></li>
  14578. <li><a href="#hapqa_005fextract">hapqa_extract</a></li>
  14579. <li><a href="#h264_005fmetadata">h264_metadata</a></li>
  14580. <li><a href="#h264_005fmp4toannexb">h264_mp4toannexb</a></li>
  14581. <li><a href="#h264_005fredundant_005fpps">h264_redundant_pps</a></li>
  14582. <li><a href="#hevc_005fmetadata">hevc_metadata</a></li>
  14583. <li><a href="#hevc_005fmp4toannexb">hevc_mp4toannexb</a></li>
  14584. <li><a href="#imxdump">imxdump</a></li>
  14585. <li><a href="#mjpeg2jpeg">mjpeg2jpeg</a></li>
  14586. <li><a href="#mjpegadump">mjpegadump</a></li>
  14587. <li><a href="#mov2textsub-1">mov2textsub</a></li>
  14588. <li><a href="#mpeg2_005fmetadata">mpeg2_metadata</a></li>
  14589. <li><a href="#mpeg4_005funpack_005fbframes">mpeg4_unpack_bframes</a></li>
  14590. <li><a href="#noise">noise</a></li>
  14591. <li><a href="#null">null</a></li>
  14592. <li><a href="#pcm_005frechunk">pcm_rechunk</a></li>
  14593. <li><a href="#pgs_005fframe_005fmerge">pgs_frame_merge</a></li>
  14594. <li><a href="#prores_005fmetadata">prores_metadata</a></li>
  14595. <li><a href="#remove_005fextra">remove_extra</a></li>
  14596. <li><a href="#setts">setts</a></li>
  14597. <li><a href="#showinfo">showinfo</a></li>
  14598. <li><a href="#text2movsub-1">text2movsub</a></li>
  14599. <li><a href="#trace_005fheaders">trace_headers</a></li>
  14600. <li><a href="#truehd_005fcore">truehd_core</a></li>
  14601. <li><a href="#vp9_005fmetadata">vp9_metadata</a></li>
  14602. <li><a href="#vp9_005fsuperframe">vp9_superframe</a></li>
  14603. <li><a href="#vp9_005fsuperframe_005fsplit">vp9_superframe_split</a></li>
  14604. <li><a href="#vp9_005fraw_005freorder">vp9_raw_reorder</a></li>
  14605. </ul>
  14606. <div class="section-level-extent" id="aac_005fadtstoasc">
  14607. <h3 class="section"><span>18.1 aac_adtstoasc<a class="copiable-link" href="#aac_005fadtstoasc"> &para;</a></span></h3>
  14608. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  14609. bitstream.
  14610. </p>
  14611. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  14612. ADTS header and removes the ADTS header.
  14613. </p>
  14614. <p>This filter is required for example when copying an AAC stream from a
  14615. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  14616. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  14617. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  14618. </p>
  14619. </div>
  14620. <div class="section-level-extent" id="av1_005fmetadata">
  14621. <h3 class="section"><span>18.2 av1_metadata<a class="copiable-link" href="#av1_005fmetadata"> &para;</a></span></h3>
  14622. <p>Modify metadata embedded in an AV1 stream.
  14623. </p>
  14624. <dl class="table">
  14625. <dt><samp class="option">td</samp></dt>
  14626. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  14627. stream.
  14628. </p>
  14629. <dl class="table">
  14630. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  14631. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  14632. </p></dd>
  14633. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  14634. <dd><p>Remove the TD from the beginning of every TU which has one.
  14635. </p></dd>
  14636. </dl>
  14637. </dd>
  14638. <dt><samp class="option">color_primaries</samp></dt>
  14639. <dt><samp class="option">transfer_characteristics</samp></dt>
  14640. <dt><samp class="option">matrix_coefficients</samp></dt>
  14641. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  14642. </p>
  14643. </dd>
  14644. <dt><samp class="option">color_range</samp></dt>
  14645. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  14646. this cannot be set for streams using BT.709 primaries, sRGB transfer
  14647. characteristic and identity (RGB) matrix coefficients).
  14648. </p><dl class="table">
  14649. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  14650. <dd><p>Limited range.
  14651. </p></dd>
  14652. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  14653. <dd><p>Full range.
  14654. </p></dd>
  14655. </dl>
  14656. </dd>
  14657. <dt><samp class="option">chroma_sample_position</samp></dt>
  14658. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  14659. This can only be set for 4:2:0 streams.
  14660. </p>
  14661. <dl class="table">
  14662. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  14663. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  14664. </p></dd>
  14665. <dt>&lsquo;<samp class="samp">colocated</samp>&rsquo;</dt>
  14666. <dd><p>Top-left position.
  14667. </p></dd>
  14668. </dl>
  14669. </dd>
  14670. <dt><samp class="option">tick_rate</samp></dt>
  14671. <dd><p>Set the tick rate (<em class="emph">time_scale / num_units_in_display_tick</em>) in
  14672. the timing info in the sequence header.
  14673. </p></dd>
  14674. <dt><samp class="option">num_ticks_per_picture</samp></dt>
  14675. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  14676. has a fixed framerate. Ignored if <samp class="option">tick_rate</samp> is not also set.
  14677. </p>
  14678. </dd>
  14679. <dt><samp class="option">delete_padding</samp></dt>
  14680. <dd><p>Deletes Padding OBUs.
  14681. </p>
  14682. </dd>
  14683. </dl>
  14684. </div>
  14685. <div class="section-level-extent" id="chomp">
  14686. <h3 class="section"><span>18.3 chomp<a class="copiable-link" href="#chomp"> &para;</a></span></h3>
  14687. <p>Remove zero padding at the end of a packet.
  14688. </p>
  14689. </div>
  14690. <div class="section-level-extent" id="dca_005fcore">
  14691. <h3 class="section"><span>18.4 dca_core<a class="copiable-link" href="#dca_005fcore"> &para;</a></span></h3>
  14692. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  14693. DTS-HD.
  14694. </p>
  14695. </div>
  14696. <div class="section-level-extent" id="dump_005fextra">
  14697. <h3 class="section"><span>18.5 dump_extra<a class="copiable-link" href="#dump_005fextra"> &para;</a></span></h3>
  14698. <p>Add extradata to the beginning of the filtered packets except when
  14699. said packets already exactly begin with the extradata that is intended
  14700. to be added.
  14701. </p>
  14702. <dl class="table">
  14703. <dt><samp class="option">freq</samp></dt>
  14704. <dd><p>The additional argument specifies which packets should be filtered.
  14705. It accepts the values:
  14706. </p><dl class="table">
  14707. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  14708. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  14709. <dd><p>add extradata to all key packets
  14710. </p>
  14711. </dd>
  14712. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  14713. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  14714. <dd><p>add extradata to all packets
  14715. </p></dd>
  14716. </dl>
  14717. </dd>
  14718. </dl>
  14719. <p>If not specified it is assumed &lsquo;<samp class="samp">k</samp>&rsquo;.
  14720. </p>
  14721. <p>For example the following <code class="command">ffmpeg</code> command forces a global
  14722. header (thus disabling individual packet headers) in the H.264 packets
  14723. generated by the <code class="code">libx264</code> encoder, but corrects them by adding
  14724. the header stored in extradata to the key packets:
  14725. </p><div class="example">
  14726. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  14727. </pre></div>
  14728. </div>
  14729. <div class="section-level-extent" id="dv_005ferror_005fmarker">
  14730. <h3 class="section"><span>18.6 dv_error_marker<a class="copiable-link" href="#dv_005ferror_005fmarker"> &para;</a></span></h3>
  14731. <p>Blocks in DV which are marked as damaged are replaced by blocks of the specified color.
  14732. </p>
  14733. <dl class="table">
  14734. <dt><samp class="option">color</samp></dt>
  14735. <dd><p>The color to replace damaged blocks by
  14736. </p></dd>
  14737. <dt><samp class="option">sta</samp></dt>
  14738. <dd><p>A 16 bit mask which specifies which of the 16 possible error status values are
  14739. to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0
  14740. error status values.
  14741. </p><dl class="table">
  14742. <dt>&lsquo;<samp class="samp">ok</samp>&rsquo;</dt>
  14743. <dd><p>No error, no concealment
  14744. </p></dd>
  14745. <dt>&lsquo;<samp class="samp">err</samp>&rsquo;</dt>
  14746. <dd><p>Error, No concealment
  14747. </p></dd>
  14748. <dt>&lsquo;<samp class="samp">res</samp>&rsquo;</dt>
  14749. <dd><p>Reserved
  14750. </p></dd>
  14751. <dt>&lsquo;<samp class="samp">notok</samp>&rsquo;</dt>
  14752. <dd><p>Error or concealment
  14753. </p></dd>
  14754. <dt>&lsquo;<samp class="samp">notres</samp>&rsquo;</dt>
  14755. <dd><p>Not reserved
  14756. </p></dd>
  14757. <dt>&lsquo;<samp class="samp">Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru</samp>&rsquo;</dt>
  14758. <dd><p>The specific error status code
  14759. </p></dd>
  14760. </dl>
  14761. <p>see page 44-46 or section 5.5 of
  14762. <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>
  14763. </p>
  14764. </dd>
  14765. </dl>
  14766. </div>
  14767. <div class="section-level-extent" id="eac3_005fcore">
  14768. <h3 class="section"><span>18.7 eac3_core<a class="copiable-link" href="#eac3_005fcore"> &para;</a></span></h3>
  14769. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  14770. </p>
  14771. </div>
  14772. <div class="section-level-extent" id="extract_005fextradata">
  14773. <h3 class="section"><span>18.8 extract_extradata<a class="copiable-link" href="#extract_005fextradata"> &para;</a></span></h3>
  14774. <p>Extract the in-band extradata.
  14775. </p>
  14776. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  14777. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  14778. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  14779. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  14780. </p>
  14781. <p>This bitstream filter detects the in-band headers and makes them available as
  14782. extradata.
  14783. </p>
  14784. <dl class="table">
  14785. <dt><samp class="option">remove</samp></dt>
  14786. <dd><p>When this option is enabled, the long-term headers are removed from the
  14787. bitstream after extraction.
  14788. </p></dd>
  14789. </dl>
  14790. </div>
  14791. <div class="section-level-extent" id="filter_005funits">
  14792. <h3 class="section"><span>18.9 filter_units<a class="copiable-link" href="#filter_005funits"> &para;</a></span></h3>
  14793. <p>Remove units with types in or not in a given set from the stream.
  14794. </p>
  14795. <dl class="table">
  14796. <dt><samp class="option">pass_types</samp></dt>
  14797. <dd><p>List of unit types or ranges of unit types to pass through while removing
  14798. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  14799. or ranges of values with &rsquo;-&rsquo;.
  14800. </p>
  14801. </dd>
  14802. <dt><samp class="option">remove_types</samp></dt>
  14803. <dd><p>Identical to <samp class="option">pass_types</samp>, except the units in the given set
  14804. removed and all others passed through.
  14805. </p></dd>
  14806. </dl>
  14807. <p>The types used by pass_types and remove_types correspond to NAL unit types
  14808. (nal_unit_type) in H.264, HEVC and H.266 (see Table 7-1 in the H.264
  14809. and HEVC specifications or Table 5 in the H.266 specification), to
  14810. marker values for JPEG (without 0xFF prefix) and to start codes without
  14811. start code prefix (i.e. the byte following the 0x000001) for MPEG-2.
  14812. For VP8 and VP9, every unit has type zero.
  14813. </p>
  14814. <p>Extradata is unchanged by this transformation, but note that if the stream
  14815. contains inline parameter sets then the output may be unusable if they are
  14816. removed.
  14817. </p>
  14818. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  14819. </p><div class="example">
  14820. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  14821. </pre></div>
  14822. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  14823. </p><div class="example">
  14824. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  14825. </pre></div>
  14826. <p>To remove all user data from a MPEG-2 stream, including Closed Captions:
  14827. </p><div class="example">
  14828. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=178' OUTPUT
  14829. </pre></div>
  14830. <p>To remove all SEI from a H264 stream, including Closed Captions:
  14831. </p><div class="example">
  14832. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=6' OUTPUT
  14833. </pre></div>
  14834. <p>To remove all prefix and suffix SEI from a HEVC stream, including Closed Captions and dynamic HDR:
  14835. </p><div class="example">
  14836. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=39|40' OUTPUT
  14837. </pre></div>
  14838. </div>
  14839. <div class="section-level-extent" id="hapqa_005fextract">
  14840. <h3 class="section"><span>18.10 hapqa_extract<a class="copiable-link" href="#hapqa_005fextract"> &para;</a></span></h3>
  14841. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  14842. </p>
  14843. <dl class="table">
  14844. <dt><samp class="option">texture</samp></dt>
  14845. <dd><p>Specifies the texture to keep.
  14846. </p>
  14847. <dl class="table">
  14848. <dt><samp class="option">color</samp></dt>
  14849. <dt><samp class="option">alpha</samp></dt>
  14850. </dl>
  14851. </dd>
  14852. </dl>
  14853. <p>Convert HAPQA to HAPQ
  14854. </p><div class="example">
  14855. <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
  14856. </pre></div>
  14857. <p>Convert HAPQA to HAPAlphaOnly
  14858. </p><div class="example">
  14859. <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
  14860. </pre></div>
  14861. </div>
  14862. <div class="section-level-extent" id="h264_005fmetadata">
  14863. <h3 class="section"><span>18.11 h264_metadata<a class="copiable-link" href="#h264_005fmetadata"> &para;</a></span></h3>
  14864. <p>Modify metadata embedded in an H.264 stream.
  14865. </p>
  14866. <dl class="table">
  14867. <dt><samp class="option">aud</samp></dt>
  14868. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  14869. </p>
  14870. <dl class="table">
  14871. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  14872. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  14873. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  14874. </dl>
  14875. <p>Default is pass.
  14876. </p>
  14877. </dd>
  14878. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  14879. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  14880. See H.264 table E-1.
  14881. </p>
  14882. </dd>
  14883. <dt><samp class="option">overscan_appropriate_flag</samp></dt>
  14884. <dd><p>Set whether the stream is suitable for display using overscan
  14885. or not (see H.264 section E.2.1).
  14886. </p>
  14887. </dd>
  14888. <dt><samp class="option">video_format</samp></dt>
  14889. <dt><samp class="option">video_full_range_flag</samp></dt>
  14890. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  14891. table E-2).
  14892. </p>
  14893. </dd>
  14894. <dt><samp class="option">colour_primaries</samp></dt>
  14895. <dt><samp class="option">transfer_characteristics</samp></dt>
  14896. <dt><samp class="option">matrix_coefficients</samp></dt>
  14897. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  14898. and tables E-3, E-4 and E-5).
  14899. </p>
  14900. </dd>
  14901. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  14902. <dd><p>Set the chroma sample location in the stream (see H.264 section
  14903. E.2.1 and figure E-1).
  14904. </p>
  14905. </dd>
  14906. <dt><samp class="option">tick_rate</samp></dt>
  14907. <dd><p>Set the tick rate (time_scale / num_units_in_tick) in the VUI
  14908. parameters. This is the smallest time unit representable in the
  14909. stream, and in many cases represents the field rate of the stream
  14910. (double the frame rate).
  14911. </p></dd>
  14912. <dt><samp class="option">fixed_frame_rate_flag</samp></dt>
  14913. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  14914. that the framerate is exactly half the tick rate, but the exact
  14915. meaning is dependent on interlacing and the picture structure (see
  14916. H.264 section E.2.1 and table E-6).
  14917. </p></dd>
  14918. <dt><samp class="option">zero_new_constraint_set_flags</samp></dt>
  14919. <dd><p>Zero constraint_set4_flag and constraint_set5_flag in the SPS. These
  14920. bits were reserved in a previous version of the H.264 spec, and thus
  14921. some hardware decoders require these to be zero. The result of zeroing
  14922. this is still a valid bitstream.
  14923. </p>
  14924. </dd>
  14925. <dt><samp class="option">crop_left</samp></dt>
  14926. <dt><samp class="option">crop_right</samp></dt>
  14927. <dt><samp class="option">crop_top</samp></dt>
  14928. <dt><samp class="option">crop_bottom</samp></dt>
  14929. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  14930. the current ones if the stream is already cropped.
  14931. </p>
  14932. <p>These fields are set in pixels. Note that some sizes may not be
  14933. representable if the chroma is subsampled or the stream is interlaced
  14934. (see H.264 section 7.4.2.1.1).
  14935. </p>
  14936. </dd>
  14937. <dt><samp class="option">sei_user_data</samp></dt>
  14938. <dd><p>Insert a string as SEI unregistered user data. The argument must
  14939. be of the form <em class="emph">UUID+string</em>, where the UUID is as hex digits
  14940. possibly separated by hyphens, and the string can be anything.
  14941. </p>
  14942. <p>For example, &lsquo;<samp class="samp">086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  14943. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  14944. </p>
  14945. </dd>
  14946. <dt><samp class="option">delete_filler</samp></dt>
  14947. <dd><p>Deletes both filler NAL units and filler SEI messages.
  14948. </p>
  14949. </dd>
  14950. <dt><samp class="option">display_orientation</samp></dt>
  14951. <dd><p>Insert, extract or remove Display orientation SEI messages.
  14952. See H.264 section D.1.27 and D.2.27 for syntax and semantics.
  14953. </p>
  14954. <dl class="table">
  14955. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  14956. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  14957. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  14958. <dt>&lsquo;<samp class="samp">extract</samp>&rsquo;</dt>
  14959. </dl>
  14960. <p>Default is pass.
  14961. </p>
  14962. <p>Insert mode works in conjunction with <code class="code">rotate</code> and <code class="code">flip</code> options.
  14963. Any pre-existing Display orientation messages will be removed in insert or remove mode.
  14964. Extract mode attaches the display matrix to the packet as side data.
  14965. </p>
  14966. </dd>
  14967. <dt><samp class="option">rotate</samp></dt>
  14968. <dd><p>Set rotation in display orientation SEI (anticlockwise angle in degrees).
  14969. Range is -360 to +360. Default is NaN.
  14970. </p>
  14971. </dd>
  14972. <dt><samp class="option">flip</samp></dt>
  14973. <dd><p>Set flip in display orientation SEI.
  14974. </p>
  14975. <dl class="table">
  14976. <dt>&lsquo;<samp class="samp">horizontal</samp>&rsquo;</dt>
  14977. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  14978. </dl>
  14979. <p>Default is unset.
  14980. </p>
  14981. </dd>
  14982. <dt><samp class="option">level</samp></dt>
  14983. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  14984. to A-5.
  14985. </p>
  14986. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">4.2</samp>&rsquo;), a
  14987. level_idc value (for example, &lsquo;<samp class="samp">42</samp>&rsquo;), or the special name &lsquo;<samp class="samp">auto</samp>&rsquo;
  14988. indicating that the filter should attempt to guess the level from the
  14989. input stream properties.
  14990. </p>
  14991. </dd>
  14992. </dl>
  14993. </div>
  14994. <div class="section-level-extent" id="h264_005fmp4toannexb">
  14995. <h3 class="section"><span>18.12 h264_mp4toannexb<a class="copiable-link" href="#h264_005fmp4toannexb"> &para;</a></span></h3>
  14996. <p>Convert an H.264 bitstream from length prefixed mode to start code
  14997. prefixed mode (as defined in the Annex B of the ITU-T H.264
  14998. specification).
  14999. </p>
  15000. <p>This is required by some streaming formats, typically the MPEG-2
  15001. transport stream format (muxer <code class="code">mpegts</code>).
  15002. </p>
  15003. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  15004. format with <code class="command">ffmpeg</code>, you can use the command:
  15005. </p>
  15006. <div class="example">
  15007. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  15008. </pre></div>
  15009. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  15010. <code class="code">mpegts</code>) and raw H.264 (muxer <code class="code">h264</code>) output formats.
  15011. </p>
  15012. </div>
  15013. <div class="section-level-extent" id="h264_005fredundant_005fpps">
  15014. <h3 class="section"><span>18.13 h264_redundant_pps<a class="copiable-link" href="#h264_005fredundant_005fpps"> &para;</a></span></h3>
  15015. <p>This applies a specific fixup to some Blu-ray streams which contain
  15016. redundant PPSs modifying irrelevant parameters of the stream which
  15017. confuse other transformations which require correct extradata.
  15018. </p>
  15019. </div>
  15020. <div class="section-level-extent" id="hevc_005fmetadata">
  15021. <h3 class="section"><span>18.14 hevc_metadata<a class="copiable-link" href="#hevc_005fmetadata"> &para;</a></span></h3>
  15022. <p>Modify metadata embedded in an HEVC stream.
  15023. </p>
  15024. <dl class="table">
  15025. <dt><samp class="option">aud</samp></dt>
  15026. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  15027. </p>
  15028. <dl class="table">
  15029. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  15030. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  15031. </dl>
  15032. </dd>
  15033. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  15034. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  15035. </p>
  15036. </dd>
  15037. <dt><samp class="option">video_format</samp></dt>
  15038. <dt><samp class="option">video_full_range_flag</samp></dt>
  15039. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  15040. table E.2).
  15041. </p>
  15042. </dd>
  15043. <dt><samp class="option">colour_primaries</samp></dt>
  15044. <dt><samp class="option">transfer_characteristics</samp></dt>
  15045. <dt><samp class="option">matrix_coefficients</samp></dt>
  15046. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  15047. and tables E.3, E.4 and E.5).
  15048. </p>
  15049. </dd>
  15050. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  15051. <dd><p>Set the chroma sample location in the stream (see H.265 section
  15052. E.3.1 and figure E.1).
  15053. </p>
  15054. </dd>
  15055. <dt><samp class="option">tick_rate</samp></dt>
  15056. <dd><p>Set the tick rate in the VPS and VUI parameters (time_scale /
  15057. num_units_in_tick). Combined with <samp class="option">num_ticks_poc_diff_one</samp>, this can
  15058. set a constant framerate in the stream. Note that it is likely to be
  15059. overridden by container parameters when the stream is in a container.
  15060. </p>
  15061. </dd>
  15062. <dt><samp class="option">num_ticks_poc_diff_one</samp></dt>
  15063. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  15064. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  15065. E.3.1). Ignored if <samp class="option">tick_rate</samp> is not also set.
  15066. </p>
  15067. </dd>
  15068. <dt><samp class="option">crop_left</samp></dt>
  15069. <dt><samp class="option">crop_right</samp></dt>
  15070. <dt><samp class="option">crop_top</samp></dt>
  15071. <dt><samp class="option">crop_bottom</samp></dt>
  15072. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  15073. will replace the current ones if the stream is already cropped.
  15074. </p>
  15075. <p>These fields are set in pixels. Note that some sizes may not be
  15076. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  15077. </p>
  15078. </dd>
  15079. <dt><samp class="option">level</samp></dt>
  15080. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  15081. A.6 and A.7.
  15082. </p>
  15083. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">5.1</samp>&rsquo;), a
  15084. <em class="emph">general_level_idc</em> value (for example, &lsquo;<samp class="samp">153</samp>&rsquo; for level 5.1),
  15085. or the special name &lsquo;<samp class="samp">auto</samp>&rsquo; indicating that the filter should
  15086. attempt to guess the level from the input stream properties.
  15087. </p>
  15088. </dd>
  15089. </dl>
  15090. </div>
  15091. <div class="section-level-extent" id="hevc_005fmp4toannexb">
  15092. <h3 class="section"><span>18.15 hevc_mp4toannexb<a class="copiable-link" href="#hevc_005fmp4toannexb"> &para;</a></span></h3>
  15093. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  15094. prefixed mode (as defined in the Annex B of the ITU-T H.265
  15095. specification).
  15096. </p>
  15097. <p>This is required by some streaming formats, typically the MPEG-2
  15098. transport stream format (muxer <code class="code">mpegts</code>).
  15099. </p>
  15100. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  15101. format with <code class="command">ffmpeg</code>, you can use the command:
  15102. </p>
  15103. <div class="example">
  15104. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  15105. </pre></div>
  15106. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  15107. <code class="code">mpegts</code>) and raw HEVC/H.265 (muxer <code class="code">h265</code> or
  15108. <code class="code">hevc</code>) output formats.
  15109. </p>
  15110. </div>
  15111. <div class="section-level-extent" id="imxdump">
  15112. <h3 class="section"><span>18.16 imxdump<a class="copiable-link" href="#imxdump"> &para;</a></span></h3>
  15113. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  15114. Pro decoder. This filter only applies to the mpeg2video codec, and is
  15115. likely not needed for Final Cut Pro 7 and newer with the appropriate
  15116. <samp class="option">-tag:v</samp>.
  15117. </p>
  15118. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  15119. </p>
  15120. <div class="example">
  15121. <pre class="example-preformatted">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  15122. </pre></div>
  15123. </div>
  15124. <div class="section-level-extent" id="mjpeg2jpeg">
  15125. <h3 class="section"><span>18.17 mjpeg2jpeg<a class="copiable-link" href="#mjpeg2jpeg"> &para;</a></span></h3>
  15126. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  15127. </p>
  15128. <p>MJPEG is a video codec wherein each video frame is essentially a
  15129. JPEG image. The individual frames can be extracted without loss,
  15130. e.g. by
  15131. </p>
  15132. <div class="example">
  15133. <pre class="example-preformatted">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  15134. </pre></div>
  15135. <p>Unfortunately, these chunks are incomplete JPEG images, because
  15136. they lack the DHT segment required for decoding. Quoting from
  15137. <a class="url" href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  15138. </p>
  15139. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  15140. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  15141. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  15142. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  15143. and it must use basic Huffman encoding, not arithmetic or
  15144. progressive. . . . You can indeed extract the MJPEG frames and
  15145. decode them with a regular JPEG decoder, but you have to prepend
  15146. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  15147. how to decompress the data. The exact table necessary is given in
  15148. the OpenDML spec.&quot;
  15149. </p>
  15150. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  15151. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  15152. produce fully qualified JPEG images.
  15153. </p>
  15154. <div class="example">
  15155. <pre class="example-preformatted">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  15156. exiftran -i -9 frame*.jpg
  15157. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  15158. </pre></div>
  15159. </div>
  15160. <div class="section-level-extent" id="mjpegadump">
  15161. <h3 class="section"><span>18.18 mjpegadump<a class="copiable-link" href="#mjpegadump"> &para;</a></span></h3>
  15162. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  15163. Quicktime.
  15164. </p>
  15165. <a class="anchor" id="mov2textsub"></a></div>
  15166. <div class="section-level-extent" id="mov2textsub-1">
  15167. <h3 class="section"><span>18.19 mov2textsub<a class="copiable-link" href="#mov2textsub-1"> &para;</a></span></h3>
  15168. <p>Extract a representable text file from MOV subtitles, stripping the
  15169. metadata header from each subtitle packet.
  15170. </p>
  15171. <p>See also the <a class="ref" href="#text2movsub">text2movsub</a> filter.
  15172. </p>
  15173. </div>
  15174. <div class="section-level-extent" id="mpeg2_005fmetadata">
  15175. <h3 class="section"><span>18.20 mpeg2_metadata<a class="copiable-link" href="#mpeg2_005fmetadata"> &para;</a></span></h3>
  15176. <p>Modify metadata embedded in an MPEG-2 stream.
  15177. </p>
  15178. <dl class="table">
  15179. <dt><samp class="option">display_aspect_ratio</samp></dt>
  15180. <dd><p>Set the display aspect ratio in the stream.
  15181. </p>
  15182. <p>The following fixed values are supported:
  15183. </p><dl class="table">
  15184. <dt><samp class="option">4/3</samp></dt>
  15185. <dt><samp class="option">16/9</samp></dt>
  15186. <dt><samp class="option">221/100</samp></dt>
  15187. </dl>
  15188. <p>Any other value will result in square pixels being signalled instead
  15189. (see H.262 section 6.3.3 and table 6-3).
  15190. </p>
  15191. </dd>
  15192. <dt><samp class="option">frame_rate</samp></dt>
  15193. <dd><p>Set the frame rate in the stream. This is constructed from a table
  15194. of known values combined with a small multiplier and divisor - if
  15195. the supplied value is not exactly representable, the nearest
  15196. representable value will be used instead (see H.262 section 6.3.3
  15197. and table 6-4).
  15198. </p>
  15199. </dd>
  15200. <dt><samp class="option">video_format</samp></dt>
  15201. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  15202. table 6-6).
  15203. </p>
  15204. </dd>
  15205. <dt><samp class="option">colour_primaries</samp></dt>
  15206. <dt><samp class="option">transfer_characteristics</samp></dt>
  15207. <dt><samp class="option">matrix_coefficients</samp></dt>
  15208. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  15209. and tables 6-7, 6-8 and 6-9).
  15210. </p>
  15211. </dd>
  15212. </dl>
  15213. </div>
  15214. <div class="section-level-extent" id="mpeg4_005funpack_005fbframes">
  15215. <h3 class="section"><span>18.21 mpeg4_unpack_bframes<a class="copiable-link" href="#mpeg4_005funpack_005fbframes"> &para;</a></span></h3>
  15216. <p>Unpack DivX-style packed B-frames.
  15217. </p>
  15218. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  15219. workaround for the broken Video for Windows subsystem.
  15220. They use more space, can cause minor AV sync issues, require more
  15221. CPU power to decode (unless the player has some decoded picture queue
  15222. to compensate the 2,0,2,0 frame per packet style) and cause
  15223. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  15224. because MPEG-4 decoders may not be able to decode them, since they are
  15225. not valid MPEG-4.
  15226. </p>
  15227. <p>For example to fix an AVI file containing an MPEG-4 stream with
  15228. DivX-style packed B-frames using <code class="command">ffmpeg</code>, you can use the command:
  15229. </p>
  15230. <div class="example">
  15231. <pre class="example-preformatted">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  15232. </pre></div>
  15233. </div>
  15234. <div class="section-level-extent" id="noise">
  15235. <h3 class="section"><span>18.22 noise<a class="copiable-link" href="#noise"> &para;</a></span></h3>
  15236. <p>Damages the contents of packets or simply drops them without damaging the
  15237. container. Can be used for fuzzing or testing error resilience/concealment.
  15238. </p>
  15239. <p>Parameters:
  15240. </p><dl class="table">
  15241. <dt><samp class="option">amount</samp></dt>
  15242. <dd><p>Accepts an expression whose evaluation per-packet determines how often bytes in that
  15243. packet will be modified. A value below 0 will result in a variable frequency.
  15244. Default is 0 which results in no modification. However, if neither amount nor drop is specified,
  15245. amount will be set to <var class="var">-1</var>. See below for accepted variables.
  15246. </p></dd>
  15247. <dt><samp class="option">drop</samp></dt>
  15248. <dd><p>Accepts an expression evaluated per-packet whose value determines whether that packet is dropped.
  15249. Evaluation to a positive value results in the packet being dropped. Evaluation to a negative
  15250. value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude
  15251. of the value. Default is 0 which results in no drops. See below for accepted variables.
  15252. </p></dd>
  15253. <dt><samp class="option">dropamount</samp></dt>
  15254. <dd><p>Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse
  15255. in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards
  15256. compatibility and is equivalent to setting drop to a negative value with the same magnitude
  15257. i.e. <code class="code">dropamount=4</code> is the same as <code class="code">drop=-4</code>. Ignored if drop is also specified.
  15258. </p></dd>
  15259. </dl>
  15260. <p>Both <code class="code">amount</code> and <code class="code">drop</code> accept expressions containing the following variables:
  15261. </p>
  15262. <dl class="table">
  15263. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  15264. <dd><p>The index of the packet, starting from zero.
  15265. </p></dd>
  15266. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  15267. <dd><p>The timebase for packet timestamps.
  15268. </p></dd>
  15269. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  15270. <dd><p>Packet presentation timestamp.
  15271. </p></dd>
  15272. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  15273. <dd><p>Packet decoding timestamp.
  15274. </p></dd>
  15275. <dt>&lsquo;<samp class="samp">nopts</samp>&rsquo;</dt>
  15276. <dd><p>Constant representing AV_NOPTS_VALUE.
  15277. </p></dd>
  15278. <dt>&lsquo;<samp class="samp">startpts</samp>&rsquo;</dt>
  15279. <dd><p>First non-AV_NOPTS_VALUE PTS seen in the stream.
  15280. </p></dd>
  15281. <dt>&lsquo;<samp class="samp">startdts</samp>&rsquo;</dt>
  15282. <dd><p>First non-AV_NOPTS_VALUE DTS seen in the stream.
  15283. </p></dd>
  15284. <dt>&lsquo;<samp class="samp">duration</samp>&rsquo;</dt>
  15285. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  15286. <dd><p>Packet duration, in timebase units.
  15287. </p></dd>
  15288. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  15289. <dd><p>Packet position in input; may be -1 when unknown or not set.
  15290. </p></dd>
  15291. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  15292. <dd><p>Packet size, in bytes.
  15293. </p></dd>
  15294. <dt>&lsquo;<samp class="samp">key</samp>&rsquo;</dt>
  15295. <dd><p>Whether packet is marked as a keyframe.
  15296. </p></dd>
  15297. <dt>&lsquo;<samp class="samp">state</samp>&rsquo;</dt>
  15298. <dd><p>A pseudo random integer, primarily derived from the content of packet payload.
  15299. </p></dd>
  15300. </dl>
  15301. <ul class="mini-toc">
  15302. <li><a href="#Examples-6" accesskey="1">Examples</a></li>
  15303. </ul>
  15304. <div class="subsection-level-extent" id="Examples-6">
  15305. <h4 class="subsection"><span>18.22.1 Examples<a class="copiable-link" href="#Examples-6"> &para;</a></span></h4>
  15306. <p>Apply modification to every byte but don&rsquo;t drop any packets.
  15307. </p><div class="example">
  15308. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
  15309. </pre></div>
  15310. <p>Drop every video packet not marked as a keyframe after timestamp 30s but do not
  15311. modify any of the remaining packets.
  15312. </p><div class="example">
  15313. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
  15314. </pre></div>
  15315. <p>Drop one second of audio every 10 seconds and add some random noise to the rest.
  15316. </p><div class="example">
  15317. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
  15318. </pre></div>
  15319. </div>
  15320. </div>
  15321. <div class="section-level-extent" id="null">
  15322. <h3 class="section"><span>18.23 null<a class="copiable-link" href="#null"> &para;</a></span></h3>
  15323. <p>This bitstream filter passes the packets through unchanged.
  15324. </p>
  15325. </div>
  15326. <div class="section-level-extent" id="pcm_005frechunk">
  15327. <h3 class="section"><span>18.24 pcm_rechunk<a class="copiable-link" href="#pcm_005frechunk"> &para;</a></span></h3>
  15328. <p>Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
  15329. rate per second. This is similar to the <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#asetnsamples">asetnsamples audio
  15330. filter</a> but works on audio packets instead of audio frames.
  15331. </p>
  15332. <dl class="table">
  15333. <dt><samp class="option">nb_out_samples, n</samp></dt>
  15334. <dd><p>Set the number of samples per each output audio packet. The number is intended
  15335. as the number of samples <em class="emph">per each channel</em>. Default value is 1024.
  15336. </p>
  15337. </dd>
  15338. <dt><samp class="option">pad, p</samp></dt>
  15339. <dd><p>If set to 1, the filter will pad the last audio packet with silence, so that it
  15340. will contain the same number of samples (or roughly the same number of samples,
  15341. see <samp class="option">frame_rate</samp>) as the previous ones. Default value is 1.
  15342. </p>
  15343. </dd>
  15344. <dt><samp class="option">frame_rate, r</samp></dt>
  15345. <dd><p>This option makes the filter output a fixed number of packets per second instead
  15346. of a fixed number of samples per packet. If the audio sample rate is not
  15347. divisible by the frame rate then the number of samples will not be constant but
  15348. will vary slightly so that each packet will start as close to the frame
  15349. boundary as possible. Using this option has precedence over <samp class="option">nb_out_samples</samp>.
  15350. </p></dd>
  15351. </dl>
  15352. <p>You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
  15353. for NTSC frame rate using the <samp class="option">frame_rate</samp> option.
  15354. </p><div class="example">
  15355. <pre class="example-preformatted">ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
  15356. </pre></div>
  15357. </div>
  15358. <div class="section-level-extent" id="pgs_005fframe_005fmerge">
  15359. <h3 class="section"><span>18.25 pgs_frame_merge<a class="copiable-link" href="#pgs_005fframe_005fmerge"> &para;</a></span></h3>
  15360. <p>Merge a sequence of PGS Subtitle segments ending with an &quot;end of display set&quot;
  15361. segment into a single packet.
  15362. </p>
  15363. <p>This is required by some containers that support PGS subtitles
  15364. (muxer <code class="code">matroska</code>).
  15365. </p>
  15366. </div>
  15367. <div class="section-level-extent" id="prores_005fmetadata">
  15368. <h3 class="section"><span>18.26 prores_metadata<a class="copiable-link" href="#prores_005fmetadata"> &para;</a></span></h3>
  15369. <p>Modify color property metadata embedded in prores stream.
  15370. </p>
  15371. <dl class="table">
  15372. <dt><samp class="option">color_primaries</samp></dt>
  15373. <dd><p>Set the color primaries.
  15374. Available values are:
  15375. </p>
  15376. <dl class="table">
  15377. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  15378. <dd><p>Keep the same color primaries property (default).
  15379. </p>
  15380. </dd>
  15381. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  15382. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  15383. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  15384. <dd><p>BT601 625
  15385. </p>
  15386. </dd>
  15387. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  15388. <dd><p>BT601 525
  15389. </p>
  15390. </dd>
  15391. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  15392. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  15393. <dd><p>DCI P3
  15394. </p>
  15395. </dd>
  15396. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  15397. <dd><p>P3 D65
  15398. </p>
  15399. </dd>
  15400. </dl>
  15401. </dd>
  15402. <dt><samp class="option">transfer_characteristics</samp></dt>
  15403. <dd><p>Set the color transfer.
  15404. Available values are:
  15405. </p>
  15406. <dl class="table">
  15407. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  15408. <dd><p>Keep the same transfer characteristics property (default).
  15409. </p>
  15410. </dd>
  15411. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  15412. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  15413. <dd><p>BT 601, BT 709, BT 2020
  15414. </p></dd>
  15415. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  15416. <dd><p>SMPTE ST 2084
  15417. </p></dd>
  15418. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  15419. <dd><p>ARIB STD-B67
  15420. </p></dd>
  15421. </dl>
  15422. </dd>
  15423. <dt><samp class="option">matrix_coefficients</samp></dt>
  15424. <dd><p>Set the matrix coefficient.
  15425. Available values are:
  15426. </p>
  15427. <dl class="table">
  15428. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  15429. <dd><p>Keep the same colorspace property (default).
  15430. </p>
  15431. </dd>
  15432. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  15433. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  15434. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  15435. <dd><p>BT 601
  15436. </p>
  15437. </dd>
  15438. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  15439. </dl>
  15440. </dd>
  15441. </dl>
  15442. <p>Set Rec709 colorspace for each frame of the file
  15443. </p><div class="example">
  15444. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  15445. </pre></div>
  15446. <p>Set Hybrid Log-Gamma parameters for each frame of the file
  15447. </p><div class="example">
  15448. <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
  15449. </pre></div>
  15450. </div>
  15451. <div class="section-level-extent" id="remove_005fextra">
  15452. <h3 class="section"><span>18.27 remove_extra<a class="copiable-link" href="#remove_005fextra"> &para;</a></span></h3>
  15453. <p>Remove extradata from packets.
  15454. </p>
  15455. <p>It accepts the following parameter:
  15456. </p><dl class="table">
  15457. <dt><samp class="option">freq</samp></dt>
  15458. <dd><p>Set which frame types to remove extradata from.
  15459. </p>
  15460. <dl class="table">
  15461. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  15462. <dd><p>Remove extradata from non-keyframes only.
  15463. </p>
  15464. </dd>
  15465. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  15466. <dd><p>Remove extradata from keyframes only.
  15467. </p>
  15468. </dd>
  15469. <dt>&lsquo;<samp class="samp">e, all</samp>&rsquo;</dt>
  15470. <dd><p>Remove extradata from all frames.
  15471. </p>
  15472. </dd>
  15473. </dl>
  15474. </dd>
  15475. </dl>
  15476. </div>
  15477. <div class="section-level-extent" id="setts">
  15478. <h3 class="section"><span>18.28 setts<a class="copiable-link" href="#setts"> &para;</a></span></h3>
  15479. <p>Set PTS and DTS in packets.
  15480. </p>
  15481. <p>It accepts the following parameters:
  15482. </p><dl class="table">
  15483. <dt><samp class="option">ts</samp></dt>
  15484. <dt><samp class="option">pts</samp></dt>
  15485. <dt><samp class="option">dts</samp></dt>
  15486. <dd><p>Set expressions for PTS, DTS or both.
  15487. </p></dd>
  15488. <dt><samp class="option">duration</samp></dt>
  15489. <dd><p>Set expression for duration.
  15490. </p></dd>
  15491. <dt><samp class="option">time_base</samp></dt>
  15492. <dd><p>Set output time base.
  15493. </p></dd>
  15494. </dl>
  15495. <p>The expressions are evaluated through the eval API and can contain the following
  15496. constants:
  15497. </p>
  15498. <dl class="table">
  15499. <dt><samp class="option">N</samp></dt>
  15500. <dd><p>The count of the input packet. Starting from 0.
  15501. </p>
  15502. </dd>
  15503. <dt><samp class="option">TS</samp></dt>
  15504. <dd><p>The demux timestamp in input in case of <code class="code">ts</code> or <code class="code">dts</code> option or presentation
  15505. timestamp in case of <code class="code">pts</code> option.
  15506. </p>
  15507. </dd>
  15508. <dt><samp class="option">POS</samp></dt>
  15509. <dd><p>The original position in the file of the packet, or undefined if undefined
  15510. for the current packet
  15511. </p>
  15512. </dd>
  15513. <dt><samp class="option">DTS</samp></dt>
  15514. <dd><p>The demux timestamp in input.
  15515. </p>
  15516. </dd>
  15517. <dt><samp class="option">PTS</samp></dt>
  15518. <dd><p>The presentation timestamp in input.
  15519. </p>
  15520. </dd>
  15521. <dt><samp class="option">DURATION</samp></dt>
  15522. <dd><p>The duration in input.
  15523. </p>
  15524. </dd>
  15525. <dt><samp class="option">STARTDTS</samp></dt>
  15526. <dd><p>The DTS of the first packet.
  15527. </p>
  15528. </dd>
  15529. <dt><samp class="option">STARTPTS</samp></dt>
  15530. <dd><p>The PTS of the first packet.
  15531. </p>
  15532. </dd>
  15533. <dt><samp class="option">PREV_INDTS</samp></dt>
  15534. <dd><p>The previous input DTS.
  15535. </p>
  15536. </dd>
  15537. <dt><samp class="option">PREV_INPTS</samp></dt>
  15538. <dd><p>The previous input PTS.
  15539. </p>
  15540. </dd>
  15541. <dt><samp class="option">PREV_INDURATION</samp></dt>
  15542. <dd><p>The previous input duration.
  15543. </p>
  15544. </dd>
  15545. <dt><samp class="option">PREV_OUTDTS</samp></dt>
  15546. <dd><p>The previous output DTS.
  15547. </p>
  15548. </dd>
  15549. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  15550. <dd><p>The previous output PTS.
  15551. </p>
  15552. </dd>
  15553. <dt><samp class="option">PREV_OUTDURATION</samp></dt>
  15554. <dd><p>The previous output duration.
  15555. </p>
  15556. </dd>
  15557. <dt><samp class="option">NEXT_DTS</samp></dt>
  15558. <dd><p>The next input DTS.
  15559. </p>
  15560. </dd>
  15561. <dt><samp class="option">NEXT_PTS</samp></dt>
  15562. <dd><p>The next input PTS.
  15563. </p>
  15564. </dd>
  15565. <dt><samp class="option">NEXT_DURATION</samp></dt>
  15566. <dd><p>The next input duration.
  15567. </p>
  15568. </dd>
  15569. <dt><samp class="option">TB</samp></dt>
  15570. <dd><p>The timebase of stream packet belongs.
  15571. </p>
  15572. </dd>
  15573. <dt><samp class="option">TB_OUT</samp></dt>
  15574. <dd><p>The output timebase.
  15575. </p>
  15576. </dd>
  15577. <dt><samp class="option">SR</samp></dt>
  15578. <dd><p>The sample rate of stream packet belongs.
  15579. </p>
  15580. </dd>
  15581. <dt><samp class="option">NOPTS</samp></dt>
  15582. <dd><p>The AV_NOPTS_VALUE constant.
  15583. </p></dd>
  15584. </dl>
  15585. <p>For example, to set PTS equal to DTS (not recommended if B-frames are involved):
  15586. </p><div class="example">
  15587. <pre class="example-preformatted">ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
  15588. </pre></div>
  15589. </div>
  15590. <div class="section-level-extent" id="showinfo">
  15591. <h3 class="section"><span>18.29 showinfo<a class="copiable-link" href="#showinfo"> &para;</a></span></h3>
  15592. <p>Log basic packet information. Mainly useful for testing, debugging,
  15593. and development.
  15594. </p>
  15595. <a class="anchor" id="text2movsub"></a></div>
  15596. <div class="section-level-extent" id="text2movsub-1">
  15597. <h3 class="section"><span>18.30 text2movsub<a class="copiable-link" href="#text2movsub-1"> &para;</a></span></h3>
  15598. <p>Convert text subtitles to MOV subtitles (as used by the <code class="code">mov_text</code>
  15599. codec) with metadata headers.
  15600. </p>
  15601. <p>See also the <a class="ref" href="#mov2textsub">mov2textsub</a> filter.
  15602. </p>
  15603. </div>
  15604. <div class="section-level-extent" id="trace_005fheaders">
  15605. <h3 class="section"><span>18.31 trace_headers<a class="copiable-link" href="#trace_005fheaders"> &para;</a></span></h3>
  15606. <p>Log trace output containing all syntax elements in the coded stream
  15607. headers (everything above the level of individual coded blocks).
  15608. This can be useful for debugging low-level stream issues.
  15609. </p>
  15610. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  15611. on the build only a subset of these may be available.
  15612. </p>
  15613. </div>
  15614. <div class="section-level-extent" id="truehd_005fcore">
  15615. <h3 class="section"><span>18.32 truehd_core<a class="copiable-link" href="#truehd_005fcore"> &para;</a></span></h3>
  15616. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  15617. </p>
  15618. </div>
  15619. <div class="section-level-extent" id="vp9_005fmetadata">
  15620. <h3 class="section"><span>18.33 vp9_metadata<a class="copiable-link" href="#vp9_005fmetadata"> &para;</a></span></h3>
  15621. <p>Modify metadata embedded in a VP9 stream.
  15622. </p>
  15623. <dl class="table">
  15624. <dt><samp class="option">color_space</samp></dt>
  15625. <dd><p>Set the color space value in the frame header. Note that any frame
  15626. set to RGB will be implicitly set to PC range and that RGB is
  15627. incompatible with profiles 0 and 2.
  15628. </p><dl class="table">
  15629. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  15630. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  15631. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  15632. <dt>&lsquo;<samp class="samp">smpte170</samp>&rsquo;</dt>
  15633. <dt>&lsquo;<samp class="samp">smpte240</samp>&rsquo;</dt>
  15634. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  15635. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  15636. </dl>
  15637. </dd>
  15638. <dt><samp class="option">color_range</samp></dt>
  15639. <dd><p>Set the color range value in the frame header. Note that any value
  15640. imposed by the color space will take precedence over this value.
  15641. </p><dl class="table">
  15642. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  15643. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  15644. </dl>
  15645. </dd>
  15646. </dl>
  15647. </div>
  15648. <div class="section-level-extent" id="vp9_005fsuperframe">
  15649. <h3 class="section"><span>18.34 vp9_superframe<a class="copiable-link" href="#vp9_005fsuperframe"> &para;</a></span></h3>
  15650. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  15651. fixes merging of split/segmented VP9 streams where the alt-ref frame
  15652. was split from its visible counterpart.
  15653. </p>
  15654. </div>
  15655. <div class="section-level-extent" id="vp9_005fsuperframe_005fsplit">
  15656. <h3 class="section"><span>18.35 vp9_superframe_split<a class="copiable-link" href="#vp9_005fsuperframe_005fsplit"> &para;</a></span></h3>
  15657. <p>Split VP9 superframes into single frames.
  15658. </p>
  15659. </div>
  15660. <div class="section-level-extent" id="vp9_005fraw_005freorder">
  15661. <h3 class="section"><span>18.36 vp9_raw_reorder<a class="copiable-link" href="#vp9_005fraw_005freorder"> &para;</a></span></h3>
  15662. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  15663. insert additional show-existing-frame packets to correct the ordering.
  15664. </p>
  15665. </div>
  15666. </div>
  15667. <div class="chapter-level-extent" id="Format-Options">
  15668. <h2 class="chapter"><span>19 Format Options<a class="copiable-link" href="#Format-Options"> &para;</a></span></h2>
  15669. <p>The libavformat library provides some generic global options, which
  15670. can be set on all the muxers and demuxers. In addition each muxer or
  15671. demuxer may support so-called private options, which are specific for
  15672. that component.
  15673. </p>
  15674. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  15675. FFmpeg tools, or by setting the value explicitly in the
  15676. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  15677. for programmatic use.
  15678. </p>
  15679. <p>The list of supported options follows:
  15680. </p>
  15681. <dl class="table">
  15682. <dt><samp class="option">avioflags <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  15683. <dd><p>Possible values:
  15684. </p><dl class="table">
  15685. <dt>&lsquo;<samp class="samp">direct</samp>&rsquo;</dt>
  15686. <dd><p>Reduce buffering.
  15687. </p></dd>
  15688. </dl>
  15689. </dd>
  15690. <dt><samp class="option">probesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15691. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  15692. stream information. A higher value will enable detecting more
  15693. information in case it is dispersed into the stream, but will increase
  15694. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  15695. </p>
  15696. </dd>
  15697. <dt><samp class="option">max_probe_packets <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15698. <dd><p>Set the maximum number of buffered packets when probing a codec.
  15699. Default is 2500 packets.
  15700. </p>
  15701. </dd>
  15702. <dt><samp class="option">packetsize <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  15703. <dd><p>Set packet size.
  15704. </p>
  15705. </dd>
  15706. <dt><samp class="option">fflags <var class="var">flags</var></samp></dt>
  15707. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  15708. </p>
  15709. <p>Possible values for input files:
  15710. </p><dl class="table">
  15711. <dt>&lsquo;<samp class="samp">discardcorrupt</samp>&rsquo;</dt>
  15712. <dd><p>Discard corrupted packets.
  15713. </p></dd>
  15714. <dt>&lsquo;<samp class="samp">fastseek</samp>&rsquo;</dt>
  15715. <dd><p>Enable fast, but inaccurate seeks for some formats.
  15716. </p></dd>
  15717. <dt>&lsquo;<samp class="samp">genpts</samp>&rsquo;</dt>
  15718. <dd><p>Generate missing PTS if DTS is present.
  15719. </p></dd>
  15720. <dt>&lsquo;<samp class="samp">igndts</samp>&rsquo;</dt>
  15721. <dd><p>Ignore DTS if PTS is also set. In case the PTS is set, the DTS value
  15722. is set to NOPTS. This is ignored when the <code class="code">nofillin</code> flag is set.
  15723. </p></dd>
  15724. <dt>&lsquo;<samp class="samp">ignidx</samp>&rsquo;</dt>
  15725. <dd><p>Ignore index.
  15726. </p></dd>
  15727. <dt>&lsquo;<samp class="samp">nobuffer</samp>&rsquo;</dt>
  15728. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  15729. </p></dd>
  15730. <dt>&lsquo;<samp class="samp">nofillin</samp>&rsquo;</dt>
  15731. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  15732. </p></dd>
  15733. <dt>&lsquo;<samp class="samp">noparse</samp>&rsquo;</dt>
  15734. <dd><p>Disable AVParsers, this needs <code class="code">+nofillin</code> too.
  15735. </p></dd>
  15736. <dt>&lsquo;<samp class="samp">sortdts</samp>&rsquo;</dt>
  15737. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  15738. </p></dd>
  15739. </dl>
  15740. <p>Possible values for output files:
  15741. </p><dl class="table">
  15742. <dt>&lsquo;<samp class="samp">autobsf</samp>&rsquo;</dt>
  15743. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  15744. </p></dd>
  15745. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  15746. <dd><p>Only write platform-, build- and time-independent data.
  15747. This ensures that file and data checksums are reproducible and match between
  15748. platforms. Its primary use is for regression testing.
  15749. </p></dd>
  15750. <dt>&lsquo;<samp class="samp">flush_packets</samp>&rsquo;</dt>
  15751. <dd><p>Write out packets immediately.
  15752. </p></dd>
  15753. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  15754. <dd><p>Stop muxing at the end of the shortest stream.
  15755. It may be needed to increase max_interleave_delta to avoid flushing the longer
  15756. streams before EOF.
  15757. </p></dd>
  15758. </dl>
  15759. </dd>
  15760. <dt><samp class="option">seek2any <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15761. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  15762. Default is 0.
  15763. </p>
  15764. </dd>
  15765. <dt><samp class="option">analyzeduration <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15766. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  15767. higher value will enable detecting more accurate information, but will
  15768. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  15769. </p>
  15770. </dd>
  15771. <dt><samp class="option">cryptokey <var class="var">hexadecimal string</var> (<em class="emph">input</em>)</samp></dt>
  15772. <dd><p>Set decryption key.
  15773. </p>
  15774. </dd>
  15775. <dt><samp class="option">indexmem <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15776. <dd><p>Set max memory used for timestamp index (per stream).
  15777. </p>
  15778. </dd>
  15779. <dt><samp class="option">rtbufsize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15780. <dd><p>Set max memory used for buffering real-time frames.
  15781. </p>
  15782. </dd>
  15783. <dt><samp class="option">fdebug <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  15784. <dd><p>Print specific debug info.
  15785. </p>
  15786. <p>Possible values:
  15787. </p><dl class="table">
  15788. <dt>&lsquo;<samp class="samp">ts</samp>&rsquo;</dt>
  15789. </dl>
  15790. </dd>
  15791. <dt><samp class="option">max_delay <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  15792. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  15793. </p>
  15794. </dd>
  15795. <dt><samp class="option">fpsprobesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15796. <dd><p>Set number of frames used to probe fps.
  15797. </p>
  15798. </dd>
  15799. <dt><samp class="option">audio_preload <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  15800. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  15801. </p>
  15802. </dd>
  15803. <dt><samp class="option">chunk_duration <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  15804. <dd><p>Set microseconds for each chunk.
  15805. </p>
  15806. </dd>
  15807. <dt><samp class="option">chunk_size <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  15808. <dd><p>Set size in bytes for each chunk.
  15809. </p>
  15810. </dd>
  15811. <dt><samp class="option">err_detect, f_err_detect <var class="var">flags</var> (<em class="emph">input</em>)</samp></dt>
  15812. <dd><p>Set error detection flags. <code class="code">f_err_detect</code> is deprecated and
  15813. should be used only via the <code class="command">ffmpeg</code> tool.
  15814. </p>
  15815. <p>Possible values:
  15816. </p><dl class="table">
  15817. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  15818. <dd><p>Verify embedded CRCs.
  15819. </p></dd>
  15820. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  15821. <dd><p>Detect bitstream specification deviations.
  15822. </p></dd>
  15823. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  15824. <dd><p>Detect improper bitstream length.
  15825. </p></dd>
  15826. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  15827. <dd><p>Abort decoding on minor error detection.
  15828. </p></dd>
  15829. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  15830. <dd><p>Consider things that violate the spec and have not been seen in the
  15831. wild as errors.
  15832. </p></dd>
  15833. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  15834. <dd><p>Consider all spec non compliancies as errors.
  15835. </p></dd>
  15836. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  15837. <dd><p>Consider things that a sane encoder should not do as an error.
  15838. </p></dd>
  15839. </dl>
  15840. </dd>
  15841. <dt><samp class="option">max_interleave_delta <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  15842. <dd><p>Set maximum buffering duration for interleaving. The duration is
  15843. expressed in microseconds, and defaults to 10000000 (10 seconds).
  15844. </p>
  15845. <p>To ensure all the streams are interleaved correctly, libavformat will
  15846. wait until it has at least one packet for each stream before actually
  15847. writing any packets to the output file. When some streams are
  15848. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  15849. can result in excessive buffering.
  15850. </p>
  15851. <p>This field specifies the maximum difference between the timestamps of the
  15852. first and the last packet in the muxing queue, above which libavformat
  15853. will output a packet regardless of whether it has queued a packet for all
  15854. the streams.
  15855. </p>
  15856. <p>If set to 0, libavformat will continue buffering packets until it has
  15857. a packet for each stream, regardless of the maximum timestamp
  15858. difference between the buffered packets.
  15859. </p>
  15860. </dd>
  15861. <dt><samp class="option">use_wallclock_as_timestamps <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15862. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  15863. </p>
  15864. </dd>
  15865. <dt><samp class="option">avoid_negative_ts <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  15866. <dd>
  15867. <p>Possible values:
  15868. </p><dl class="table">
  15869. <dt>&lsquo;<samp class="samp">make_non_negative</samp>&rsquo;</dt>
  15870. <dd><p>Shift timestamps to make them non-negative.
  15871. Also note that this affects only leading negative timestamps, and not
  15872. non-monotonic negative timestamps.
  15873. </p></dd>
  15874. <dt>&lsquo;<samp class="samp">make_zero</samp>&rsquo;</dt>
  15875. <dd><p>Shift timestamps so that the first timestamp is 0.
  15876. </p></dd>
  15877. <dt>&lsquo;<samp class="samp">auto (default)</samp>&rsquo;</dt>
  15878. <dd><p>Enables shifting when required by the target format.
  15879. </p></dd>
  15880. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  15881. <dd><p>Disables shifting of timestamp.
  15882. </p></dd>
  15883. </dl>
  15884. <p>When shifting is enabled, all output timestamps are shifted by the
  15885. same amount. Audio, video, and subtitles desynching and relative
  15886. timestamp differences are preserved compared to how they would have
  15887. been without shifting.
  15888. </p>
  15889. </dd>
  15890. <dt><samp class="option">skip_initial_bytes <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15891. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  15892. Default is 0.
  15893. </p>
  15894. </dd>
  15895. <dt><samp class="option">correct_ts_overflow <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15896. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  15897. </p>
  15898. </dd>
  15899. <dt><samp class="option">flush_packets <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  15900. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  15901. means that the underlying protocol will decide, 1 enables it, and has the
  15902. effect of reducing the latency, 0 disables it and may increase IO throughput in
  15903. some cases.
  15904. </p>
  15905. </dd>
  15906. <dt><samp class="option">output_ts_offset <var class="var">offset</var> (<em class="emph">output</em>)</samp></dt>
  15907. <dd><p>Set the output time offset.
  15908. </p>
  15909. <p><var class="var">offset</var> must be a time duration specification,
  15910. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  15911. </p>
  15912. <p>The offset is added by the muxer to the output timestamps.
  15913. </p>
  15914. <p>Specifying a positive offset means that the corresponding streams are
  15915. delayed bt the time duration specified in <var class="var">offset</var>. Default value
  15916. is <code class="code">0</code> (meaning that no offset is applied).
  15917. </p>
  15918. </dd>
  15919. <dt><samp class="option">format_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  15920. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  15921. </p>
  15922. </dd>
  15923. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  15924. <dd><p>Separator used to separate the fields printed on the command line about the
  15925. Stream parameters.
  15926. For example, to separate the fields with newlines and indentation:
  15927. </p><div class="example">
  15928. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  15929. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  15930. </pre></div>
  15931. </dd>
  15932. <dt><samp class="option">max_streams <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  15933. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  15934. would require too many resources due to a large number of streams.
  15935. </p>
  15936. </dd>
  15937. <dt><samp class="option">skip_estimate_duration_from_pts <var class="var">bool</var> (<em class="emph">input</em>)</samp></dt>
  15938. <dd><p>Skip estimation of input duration when calculated using PTS.
  15939. At present, applicable for MPEG-PS and MPEG-TS.
  15940. </p>
  15941. </dd>
  15942. <dt><samp class="option">strict, f_strict <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  15943. <dd><p>Specify how strictly to follow the standards. <code class="code">f_strict</code> is deprecated and
  15944. should be used only via the <code class="command">ffmpeg</code> tool.
  15945. </p>
  15946. <p>Possible values:
  15947. </p><dl class="table">
  15948. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  15949. <dd><p>strictly conform to an older more strict version of the spec or reference software
  15950. </p></dd>
  15951. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  15952. <dd><p>strictly conform to all the things in the spec no matter what consequences
  15953. </p></dd>
  15954. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  15955. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  15956. <dd><p>allow unofficial extensions
  15957. </p></dd>
  15958. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  15959. <dd><p>allow non standardized experimental things, experimental
  15960. (unfinished/work in progress/not well tested) decoders and encoders.
  15961. Note: experimental decoders can pose a security risk, do not use this for
  15962. decoding untrusted input.
  15963. </p></dd>
  15964. </dl>
  15965. </dd>
  15966. </dl>
  15967. <a class="anchor" id="Format-stream-specifiers"></a><ul class="mini-toc">
  15968. <li><a href="#Format-stream-specifiers-1" accesskey="1">Format stream specifiers</a></li>
  15969. </ul>
  15970. <div class="section-level-extent" id="Format-stream-specifiers-1">
  15971. <h3 class="section"><span>19.1 Format stream specifiers<a class="copiable-link" href="#Format-stream-specifiers-1"> &para;</a></span></h3>
  15972. <p>Format stream specifiers allow selection of one or more streams that
  15973. match specific properties.
  15974. </p>
  15975. <p>The exact semantics of stream specifiers is defined by the
  15976. <code class="code">avformat_match_stream_specifier()</code> function declared in the
  15977. <samp class="file">libavformat/avformat.h</samp> header and documented in the
  15978. <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">Stream specifiers section in the ffmpeg(1) manual</a>.
  15979. </p>
  15980. </div>
  15981. </div>
  15982. <div class="chapter-level-extent" id="Demuxers">
  15983. <h2 class="chapter"><span>20 Demuxers<a class="copiable-link" href="#Demuxers"> &para;</a></span></h2>
  15984. <p>Demuxers are configured elements in FFmpeg that can read the
  15985. multimedia streams from a particular type of file.
  15986. </p>
  15987. <p>When you configure your FFmpeg build, all the supported demuxers
  15988. are enabled by default. You can list all available ones using the
  15989. configure option <code class="code">--list-demuxers</code>.
  15990. </p>
  15991. <p>You can disable all the demuxers using the configure option
  15992. <code class="code">--disable-demuxers</code>, and selectively enable a single demuxer with
  15993. the option <code class="code">--enable-demuxer=<var class="var">DEMUXER</var></code>, or disable it
  15994. with the option <code class="code">--disable-demuxer=<var class="var">DEMUXER</var></code>.
  15995. </p>
  15996. <p>The option <code class="code">-demuxers</code> of the ff* tools will display the list of
  15997. enabled demuxers. Use <code class="code">-formats</code> to view a combined list of
  15998. enabled demuxers and muxers.
  15999. </p>
  16000. <p>The description of some of the currently available demuxers follows.
  16001. </p>
  16002. <ul class="mini-toc">
  16003. <li><a href="#aa" accesskey="1">aa</a></li>
  16004. <li><a href="#aac-1" accesskey="2">aac</a></li>
  16005. <li><a href="#apng" accesskey="3">apng</a></li>
  16006. <li><a href="#asf-1" accesskey="4">asf</a></li>
  16007. <li><a href="#concat-1" accesskey="5">concat</a></li>
  16008. <li><a href="#dash-1" accesskey="6">dash</a></li>
  16009. <li><a href="#dvdvideo" accesskey="7">dvdvideo</a></li>
  16010. <li><a href="#ea" accesskey="8">ea</a></li>
  16011. <li><a href="#imf" accesskey="9">imf</a></li>
  16012. <li><a href="#flv_002c-live_005fflv_002c-kux">flv, live_flv, kux</a></li>
  16013. <li><a href="#gif-1">gif</a></li>
  16014. <li><a href="#hls-1">hls</a></li>
  16015. <li><a href="#image2-1">image2</a></li>
  16016. <li><a href="#libgme">libgme</a></li>
  16017. <li><a href="#libmodplug">libmodplug</a></li>
  16018. <li><a href="#libopenmpt">libopenmpt</a></li>
  16019. <li><a href="#mov_002fmp4_002f3gp">mov/mp4/3gp</a></li>
  16020. <li><a href="#mpegts">mpegts</a></li>
  16021. <li><a href="#mpjpeg">mpjpeg</a></li>
  16022. <li><a href="#rawvideo-1">rawvideo</a></li>
  16023. <li><a href="#sbg">sbg</a></li>
  16024. <li><a href="#tedcaptions">tedcaptions</a></li>
  16025. <li><a href="#vapoursynth">vapoursynth</a></li>
  16026. <li><a href="#w64">w64</a></li>
  16027. <li><a href="#wav-1">wav</a></li>
  16028. </ul>
  16029. <div class="section-level-extent" id="aa">
  16030. <h3 class="section"><span>20.1 aa<a class="copiable-link" href="#aa"> &para;</a></span></h3>
  16031. <p>Audible Format 2, 3, and 4 demuxer.
  16032. </p>
  16033. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  16034. </p>
  16035. </div>
  16036. <div class="section-level-extent" id="aac-1">
  16037. <h3 class="section"><span>20.2 aac<a class="copiable-link" href="#aac-1"> &para;</a></span></h3>
  16038. <p>Raw Audio Data Transport Stream AAC demuxer.
  16039. </p>
  16040. <p>This demuxer is used to demux an ADTS input containing a single AAC stream
  16041. alongwith any ID3v1/2 or APE tags in it.
  16042. </p>
  16043. </div>
  16044. <div class="section-level-extent" id="apng">
  16045. <h3 class="section"><span>20.3 apng<a class="copiable-link" href="#apng"> &para;</a></span></h3>
  16046. <p>Animated Portable Network Graphics demuxer.
  16047. </p>
  16048. <p>This demuxer is used to demux APNG files.
  16049. All headers, but the PNG signature, up to (but not including) the first
  16050. fcTL chunk are transmitted as extradata.
  16051. Frames are then split as being all the chunks between two fcTL ones, or
  16052. between the last fcTL and IEND chunks.
  16053. </p>
  16054. <dl class="table">
  16055. <dt><samp class="option">-ignore_loop <var class="var">bool</var></samp></dt>
  16056. <dd><p>Ignore the loop variable in the file if set. Default is enabled.
  16057. </p>
  16058. </dd>
  16059. <dt><samp class="option">-max_fps <var class="var">int</var></samp></dt>
  16060. <dd><p>Maximum framerate in frames per second. Default of 0 imposes no limit.
  16061. </p>
  16062. </dd>
  16063. <dt><samp class="option">-default_fps <var class="var">int</var></samp></dt>
  16064. <dd><p>Default framerate in frames per second when none is specified in the file
  16065. (0 meaning as fast as possible). Default is 15.
  16066. </p>
  16067. </dd>
  16068. </dl>
  16069. </div>
  16070. <div class="section-level-extent" id="asf-1">
  16071. <h3 class="section"><span>20.4 asf<a class="copiable-link" href="#asf-1"> &para;</a></span></h3>
  16072. <p>Advanced Systems Format demuxer.
  16073. </p>
  16074. <p>This demuxer is used to demux ASF files and MMS network streams.
  16075. </p>
  16076. <dl class="table">
  16077. <dt><samp class="option">-no_resync_search <var class="var">bool</var></samp></dt>
  16078. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  16079. </p></dd>
  16080. </dl>
  16081. <a class="anchor" id="concat"></a></div>
  16082. <div class="section-level-extent" id="concat-1">
  16083. <h3 class="section"><span>20.5 concat<a class="copiable-link" href="#concat-1"> &para;</a></span></h3>
  16084. <p>Virtual concatenation script demuxer.
  16085. </p>
  16086. <p>This demuxer reads a list of files and other directives from a text file and
  16087. demuxes them one after the other, as if all their packets had been muxed
  16088. together.
  16089. </p>
  16090. <p>The timestamps in the files are adjusted so that the first file starts at 0
  16091. and each next file starts where the previous one finishes. Note that it is
  16092. done globally and may cause gaps if all streams do not have exactly the same
  16093. length.
  16094. </p>
  16095. <p>All files must have the same streams (same codecs, same time base, etc.).
  16096. </p>
  16097. <p>The duration of each file is used to adjust the timestamps of the next file:
  16098. if the duration is incorrect (because it was computed using the bit-rate or
  16099. because the file is truncated, for example), it can cause artifacts. The
  16100. <code class="code">duration</code> directive can be used to override the duration stored in
  16101. each file.
  16102. </p>
  16103. <ul class="mini-toc">
  16104. <li><a href="#Syntax-1" accesskey="1">Syntax</a></li>
  16105. <li><a href="#Options-47" accesskey="2">Options</a></li>
  16106. <li><a href="#Examples-7" accesskey="3">Examples</a></li>
  16107. </ul>
  16108. <div class="subsection-level-extent" id="Syntax-1">
  16109. <h4 class="subsection"><span>20.5.1 Syntax<a class="copiable-link" href="#Syntax-1"> &para;</a></span></h4>
  16110. <p>The script is a text file in extended-ASCII, with one directive per line.
  16111. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  16112. following directive is recognized:
  16113. </p>
  16114. <dl class="table">
  16115. <dt><samp class="option"><code class="code">file <var class="var">path</var></code></samp></dt>
  16116. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  16117. backslash or single quotes.
  16118. </p>
  16119. <p>All subsequent file-related directives apply to that file.
  16120. </p>
  16121. </dd>
  16122. <dt><samp class="option"><code class="code">ffconcat version 1.0</code></samp></dt>
  16123. <dd><p>Identify the script type and version.
  16124. </p>
  16125. <p>To make FFmpeg recognize the format automatically, this directive must
  16126. appear exactly as is (no extra space or byte-order-mark) on the very first
  16127. line of the script.
  16128. </p>
  16129. </dd>
  16130. <dt><samp class="option"><code class="code">duration <var class="var">dur</var></code></samp></dt>
  16131. <dd><p>Duration of the file. This information can be specified from the file;
  16132. specifying it here may be more efficient or help if the information from the
  16133. file is not available or accurate.
  16134. </p>
  16135. <p>If the duration is set for all files, then it is possible to seek in the
  16136. whole concatenated video.
  16137. </p>
  16138. </dd>
  16139. <dt><samp class="option"><code class="code">inpoint <var class="var">timestamp</var></code></samp></dt>
  16140. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  16141. specified timestamp. Seeking is done so that all streams can be presented
  16142. successfully at In point.
  16143. </p>
  16144. <p>This directive works best with intra frame codecs, because for non-intra frame
  16145. ones you will usually get extra packets before the actual In point and the
  16146. decoded content will most likely contain frames before In point too.
  16147. </p>
  16148. <p>For each file, packets before the file In point will have timestamps less than
  16149. the calculated start timestamp of the file (negative in case of the first
  16150. file), and the duration of the files (if not specified by the <code class="code">duration</code>
  16151. directive) will be reduced based on their specified In point.
  16152. </p>
  16153. <p>Because of potential packets before the specified In point, packet timestamps
  16154. may overlap between two concatenated files.
  16155. </p>
  16156. </dd>
  16157. <dt><samp class="option"><code class="code">outpoint <var class="var">timestamp</var></code></samp></dt>
  16158. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  16159. timestamp in any of the streams, it handles it as an end of file condition and
  16160. skips the current and all the remaining packets from all streams.
  16161. </p>
  16162. <p>Out point is exclusive, which means that the demuxer will not output packets
  16163. with a decoding timestamp greater or equal to Out point.
  16164. </p>
  16165. <p>This directive works best with intra frame codecs and formats where all streams
  16166. are tightly interleaved. For non-intra frame codecs you will usually get
  16167. additional packets with presentation timestamp after Out point therefore the
  16168. decoded content will most likely contain frames after Out point too. If your
  16169. streams are not tightly interleaved you may not get all the packets from all
  16170. streams before Out point and you may only will be able to decode the earliest
  16171. stream until Out point.
  16172. </p>
  16173. <p>The duration of the files (if not specified by the <code class="code">duration</code>
  16174. directive) will be reduced based on their specified Out point.
  16175. </p>
  16176. </dd>
  16177. <dt><samp class="option"><code class="code">file_packet_metadata <var class="var">key=value</var></code></samp></dt>
  16178. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  16179. each file packet. You can specify this directive multiple times to add multiple
  16180. metadata entries.
  16181. This directive is deprecated, use <code class="code">file_packet_meta</code> instead.
  16182. </p>
  16183. </dd>
  16184. <dt><samp class="option"><code class="code">file_packet_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  16185. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  16186. each file packet. You can specify this directive multiple times to add multiple
  16187. metadata entries.
  16188. </p>
  16189. </dd>
  16190. <dt><samp class="option"><code class="code">option <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  16191. <dd><p>Option to access, open and probe the file.
  16192. Can be present multiple times.
  16193. </p>
  16194. </dd>
  16195. <dt><samp class="option"><code class="code">stream</code></samp></dt>
  16196. <dd><p>Introduce a stream in the virtual file.
  16197. All subsequent stream-related directives apply to the last introduced
  16198. stream.
  16199. Some streams properties must be set in order to allow identifying the
  16200. matching streams in the subfiles.
  16201. If no streams are defined in the script, the streams from the first file are
  16202. copied.
  16203. </p>
  16204. </dd>
  16205. <dt><samp class="option"><code class="code">exact_stream_id <var class="var">id</var></code></samp></dt>
  16206. <dd><p>Set the id of the stream.
  16207. If this directive is given, the string with the corresponding id in the
  16208. subfiles will be used.
  16209. This is especially useful for MPEG-PS (VOB) files, where the order of the
  16210. streams is not reliable.
  16211. </p>
  16212. </dd>
  16213. <dt><samp class="option"><code class="code">stream_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  16214. <dd><p>Metadata for the stream.
  16215. Can be present multiple times.
  16216. </p>
  16217. </dd>
  16218. <dt><samp class="option"><code class="code">stream_codec <var class="var">value</var></code></samp></dt>
  16219. <dd><p>Codec for the stream.
  16220. </p>
  16221. </dd>
  16222. <dt><samp class="option"><code class="code">stream_extradata <var class="var">hex_string</var></code></samp></dt>
  16223. <dd><p>Extradata for the string, encoded in hexadecimal.
  16224. </p>
  16225. </dd>
  16226. <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>
  16227. <dd><p>Add a chapter. <var class="var">id</var> is an unique identifier, possibly small and
  16228. consecutive.
  16229. </p>
  16230. </dd>
  16231. </dl>
  16232. </div>
  16233. <div class="subsection-level-extent" id="Options-47">
  16234. <h4 class="subsection"><span>20.5.2 Options<a class="copiable-link" href="#Options-47"> &para;</a></span></h4>
  16235. <p>This demuxer accepts the following option:
  16236. </p>
  16237. <dl class="table">
  16238. <dt><samp class="option">safe</samp></dt>
  16239. <dd><p>If set to 1, reject unsafe file paths and directives.
  16240. A file path is considered safe if it
  16241. does not contain a protocol specification and is relative and all components
  16242. only contain characters from the portable character set (letters, digits,
  16243. period, underscore and hyphen) and have no period at the beginning of a
  16244. component.
  16245. </p>
  16246. <p>If set to 0, any file name is accepted.
  16247. </p>
  16248. <p>The default is 1.
  16249. </p>
  16250. </dd>
  16251. <dt><samp class="option">auto_convert</samp></dt>
  16252. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  16253. streams concatenable.
  16254. The default is 1.
  16255. </p>
  16256. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  16257. filter to H.264 streams in MP4 format. This is necessary in particular if
  16258. there are resolution changes.
  16259. </p>
  16260. </dd>
  16261. <dt><samp class="option">segment_time_metadata</samp></dt>
  16262. <dd><p>If set to 1, every packet will contain the <var class="var">lavf.concat.start_time</var> and the
  16263. <var class="var">lavf.concat.duration</var> packet metadata values which are the start_time and
  16264. the duration of the respective file segments in the concatenated output
  16265. expressed in microseconds. The duration metadata is only set if it is known
  16266. based on the concat file.
  16267. The default is 0.
  16268. </p>
  16269. </dd>
  16270. </dl>
  16271. </div>
  16272. <div class="subsection-level-extent" id="Examples-7">
  16273. <h4 class="subsection"><span>20.5.3 Examples<a class="copiable-link" href="#Examples-7"> &para;</a></span></h4>
  16274. <ul class="itemize mark-bullet">
  16275. <li>Use absolute filenames and include some comments:
  16276. <div class="example">
  16277. <pre class="example-preformatted"># my first filename
  16278. file /mnt/share/file-1.wav
  16279. # my second filename including whitespace
  16280. file '/mnt/share/file 2.wav'
  16281. # my third filename including whitespace plus single quote
  16282. file '/mnt/share/file 3'\''.wav'
  16283. </pre></div>
  16284. </li><li>Allow for input format auto-probing, use safe filenames and set the duration of
  16285. the first file:
  16286. <div class="example">
  16287. <pre class="example-preformatted">ffconcat version 1.0
  16288. file file-1.wav
  16289. duration 20.0
  16290. file subdir/file-2.wav
  16291. </pre></div>
  16292. </li></ul>
  16293. </div>
  16294. </div>
  16295. <div class="section-level-extent" id="dash-1">
  16296. <h3 class="section"><span>20.6 dash<a class="copiable-link" href="#dash-1"> &para;</a></span></h3>
  16297. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  16298. </p>
  16299. <p>This demuxer presents all AVStreams found in the manifest.
  16300. By setting the discard flags on AVStreams the caller can decide
  16301. which streams to actually receive.
  16302. Each stream mirrors the <code class="code">id</code> and <code class="code">bandwidth</code> properties from the
  16303. <code class="code">&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  16304. </p>
  16305. <ul class="mini-toc">
  16306. <li><a href="#Options-48" accesskey="1">Options</a></li>
  16307. </ul>
  16308. <div class="subsection-level-extent" id="Options-48">
  16309. <h4 class="subsection"><span>20.6.1 Options<a class="copiable-link" href="#Options-48"> &para;</a></span></h4>
  16310. <p>This demuxer accepts the following option:
  16311. </p>
  16312. <dl class="table">
  16313. <dt><samp class="option">cenc_decryption_key</samp></dt>
  16314. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  16315. </p>
  16316. </dd>
  16317. </dl>
  16318. </div>
  16319. </div>
  16320. <div class="section-level-extent" id="dvdvideo">
  16321. <h3 class="section"><span>20.7 dvdvideo<a class="copiable-link" href="#dvdvideo"> &para;</a></span></h3>
  16322. <p>DVD-Video demuxer, powered by libdvdnav and libdvdread.
  16323. </p>
  16324. <p>Can directly ingest DVD titles, specifically sequential PGCs, into
  16325. a conversion pipeline. Menu assets, such as background video or audio,
  16326. can also be demuxed given the menu&rsquo;s coordinates (at best effort).
  16327. Seeking is not supported at this time.
  16328. </p>
  16329. <p>Block devices (DVD drives), ISO files, and directory structures are accepted.
  16330. Activate with <code class="code">-f dvdvideo</code> in front of one of these inputs.
  16331. </p>
  16332. <p>This demuxer does NOT have decryption code of any kind. You are on your own
  16333. working with encrypted DVDs, and should not expect support on the matter.
  16334. </p>
  16335. <p>Underlying playback is handled by libdvdnav, and structure parsing by libdvdread.
  16336. FFmpeg must be built with GPL library support available as well as the
  16337. configure switches <code class="code">--enable-libdvdnav</code> and <code class="code">--enable-libdvdread</code>.
  16338. </p>
  16339. <p>You will need to provide either the desired &quot;title number&quot; or exact PGC/PG coordinates.
  16340. Many open-source DVD players and tools can aid in providing this information.
  16341. If not specified, the demuxer will default to title 1 which works for many discs.
  16342. However, due to the flexibility of the format, it is recommended to check manually.
  16343. There are many discs that are authored strangely or with invalid headers.
  16344. </p>
  16345. <p>If the input is a real DVD drive, please note that there are some drives which may
  16346. silently fail on reading bad sectors from the disc, returning random bits instead
  16347. which is effectively corrupt data. This is especially prominent on aging or rotting discs.
  16348. A second pass and integrity checks would be needed to detect the corruption.
  16349. This is not an FFmpeg issue.
  16350. </p>
  16351. <ul class="mini-toc">
  16352. <li><a href="#Background" accesskey="1">Background</a></li>
  16353. <li><a href="#Options-49" accesskey="2">Options</a></li>
  16354. <li><a href="#Examples-8" accesskey="3">Examples</a></li>
  16355. </ul>
  16356. <div class="subsection-level-extent" id="Background">
  16357. <h4 class="subsection"><span>20.7.1 Background<a class="copiable-link" href="#Background"> &para;</a></span></h4>
  16358. <p>DVD-Video is not a directly accessible, linear container format in the
  16359. traditional sense. Instead, it allows for complex and programmatic playback of
  16360. carefully muxed MPEG-PS streams that are stored in headerless VOB files.
  16361. To the end-user, these streams are known simply as &quot;titles&quot;, but the actual
  16362. logical playback sequence is defined by one or more &quot;PGCs&quot;, or Program Group Chains,
  16363. within the title. The PGC is in turn comprised of multiple &quot;PGs&quot;, or Programs&quot;,
  16364. which are the actual video segments (and for a typical video feature, sequentially
  16365. ordered). The PGC structure, along with stream layout and metadata, are stored in
  16366. IFO files that need to be parsed. PGCs can be thought of as playlists in easier terms.
  16367. </p>
  16368. <p>An actual DVD player relies on user GUI interaction via menus and an internal VM
  16369. to drive the direction of demuxing. Generally, the user would either navigate (via menus)
  16370. or automatically be redirected to the PGC of their choice. During this process and
  16371. the subsequent playback, the DVD player&rsquo;s internal VM also maintains a state and
  16372. executes instructions that can create jumps to different sectors during playback.
  16373. This is why libdvdnav is involved, as a linear read of the MPEG-PS blobs on the
  16374. disc (VOBs) is not enough to produce the right sequence in many cases.
  16375. </p>
  16376. <p>There are many other DVD structures (a long subject) that will not be discussed here.
  16377. NAV packets, in particular, are handled by this demuxer to build accurate timing
  16378. but not emitted as a stream. For a good high-level understanding, refer to:
  16379. <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>
  16380. </p>
  16381. </div>
  16382. <div class="subsection-level-extent" id="Options-49">
  16383. <h4 class="subsection"><span>20.7.2 Options<a class="copiable-link" href="#Options-49"> &para;</a></span></h4>
  16384. <p>This demuxer accepts the following options:
  16385. </p>
  16386. <dl class="table">
  16387. <dt><samp class="option">title <var class="var">int</var></samp></dt>
  16388. <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.
  16389. Not applicable to menus.
  16390. Default is 0 (auto), which currently only selects the first available title (title 1)
  16391. and notifies the user about the implications.
  16392. </p>
  16393. </dd>
  16394. <dt><samp class="option">chapter_start <var class="var">int</var></samp></dt>
  16395. <dd><p>The chapter, or PTT (part-of-title), number to start at. Not applicable to menus.
  16396. Default is 1.
  16397. </p>
  16398. </dd>
  16399. <dt><samp class="option">chapter_end <var class="var">int</var></samp></dt>
  16400. <dd><p>The chapter, or PTT (part-of-title), number to end at. Not applicable to menus.
  16401. Default is 0, which is a special value to signal end at the last possible chapter.
  16402. </p>
  16403. </dd>
  16404. <dt><samp class="option">angle <var class="var">int</var></samp></dt>
  16405. <dd><p>The video angle number, referring to what is essentially an additional
  16406. video stream that is composed from alternate frames interleaved in the VOBs.
  16407. Not applicable to menus.
  16408. Default is 1.
  16409. </p>
  16410. </dd>
  16411. <dt><samp class="option">region <var class="var">int</var></samp></dt>
  16412. <dd><p>The region code to use for playback. Some discs may use this to default playback
  16413. at a particular angle in different regions. This option will not affect the region code
  16414. of a real DVD drive, if used as an input. Not applicable to menus.
  16415. Default is 0, &quot;world&quot;.
  16416. </p>
  16417. </dd>
  16418. <dt><samp class="option">menu <var class="var">bool</var></samp></dt>
  16419. <dd><p>Demux menu assets instead of navigating a title. Requires exact coordinates
  16420. 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>).
  16421. Default is false.
  16422. </p>
  16423. </dd>
  16424. <dt><samp class="option">menu_lu <var class="var">int</var></samp></dt>
  16425. <dd><p>The menu language to demux. In DVD, menus are grouped by language.
  16426. Default is 0, the first language unit.
  16427. </p>
  16428. </dd>
  16429. <dt><samp class="option">menu_vts <var class="var">int</var></samp></dt>
  16430. <dd><p>The VTS where the menu lives, or 0 if it is a VMG menu (root-level).
  16431. Default is 0, VMG menu.
  16432. </p>
  16433. </dd>
  16434. <dt><samp class="option">pgc <var class="var">int</var></samp></dt>
  16435. <dd><p>The entry PGC to start playback, in conjunction with <samp class="option">pg</samp>.
  16436. Alternative to setting <samp class="option">title</samp>.
  16437. Chapter markers are not supported at this time.
  16438. Must be explicitly set for menus.
  16439. Default is 0, automatically resolve from value of <samp class="option">title</samp>.
  16440. </p>
  16441. </dd>
  16442. <dt><samp class="option">pg <var class="var">int</var></samp></dt>
  16443. <dd><p>The entry PG to start playback, in conjunction with <samp class="option">pgc</samp>.
  16444. Alternative to setting <samp class="option">title</samp>.
  16445. Chapter markers are not supported at this time.
  16446. Default is 0, automatically resolve from value of <samp class="option">title</samp>, or
  16447. start from the beginning (PG 1) of the menu.
  16448. </p>
  16449. </dd>
  16450. <dt><samp class="option">preindex <var class="var">bool</var></samp></dt>
  16451. <dd><p>Enable this to have accurate chapter (PTT) markers and duration measurement,
  16452. which requires a slow second pass read in order to index the chapter marker
  16453. timestamps from NAV packets. This is non-ideal extra work for real optical drives.
  16454. It is recommended and faster to use this option with a backup of the DVD structure
  16455. stored on a hard drive. Not compatible with <samp class="option">pgc</samp> and <samp class="option">pg</samp>.
  16456. Not applicable to menus.
  16457. Default is 0, false.
  16458. </p>
  16459. </dd>
  16460. <dt><samp class="option">trim <var class="var">bool</var></samp></dt>
  16461. <dd><p>Skip padding cells (i.e. cells shorter than 1 second) from the beginning.
  16462. There exist many discs with filler segments at the beginning of the PGC,
  16463. often with junk data intended for controlling a real DVD player&rsquo;s
  16464. buffering speed and with no other material data value.
  16465. Not applicable to menus.
  16466. Default is 1, true.
  16467. </p>
  16468. </dd>
  16469. </dl>
  16470. </div>
  16471. <div class="subsection-level-extent" id="Examples-8">
  16472. <h4 class="subsection"><span>20.7.3 Examples<a class="copiable-link" href="#Examples-8"> &para;</a></span></h4>
  16473. <ul class="itemize mark-bullet">
  16474. <li>Open title 3 from a given DVD structure:
  16475. <div class="example">
  16476. <pre class="example-preformatted">ffmpeg -f dvdvideo -title 3 -i &lt;path to DVD&gt; ...
  16477. </pre></div>
  16478. </li><li>Open chapters 3-6 from title 1 from a given DVD structure:
  16479. <div class="example">
  16480. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 3 -chapter_end 6 -title 1 -i &lt;path to DVD&gt; ...
  16481. </pre></div>
  16482. </li><li>Open only chapter 5 from title 1 from a given DVD structure:
  16483. <div class="example">
  16484. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 5 -chapter_end 5 -title 1 -i &lt;path to DVD&gt; ...
  16485. </pre></div>
  16486. </li><li>Demux menu with language 1 from VTS 1, PGC 1, starting at PG 1:
  16487. <div class="example">
  16488. <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; ...
  16489. </pre></div>
  16490. </li></ul>
  16491. </div>
  16492. </div>
  16493. <div class="section-level-extent" id="ea">
  16494. <h3 class="section"><span>20.8 ea<a class="copiable-link" href="#ea"> &para;</a></span></h3>
  16495. <p>Electronic Arts Multimedia format demuxer.
  16496. </p>
  16497. <p>This format is used by various Electronic Arts games.
  16498. </p>
  16499. <ul class="mini-toc">
  16500. <li><a href="#Options-50" accesskey="1">Options</a></li>
  16501. </ul>
  16502. <div class="subsection-level-extent" id="Options-50">
  16503. <h4 class="subsection"><span>20.8.1 Options<a class="copiable-link" href="#Options-50"> &para;</a></span></h4>
  16504. <dl class="table">
  16505. <dt><samp class="option">merge_alpha <var class="var">bool</var></samp></dt>
  16506. <dd>
  16507. <p>Normally the VP6 alpha channel (if exists) is returned as a secondary video
  16508. stream, by setting this option you can make the demuxer return a single video
  16509. stream which contains the alpha channel in addition to the ordinary video.
  16510. </p>
  16511. </dd>
  16512. </dl>
  16513. </div>
  16514. </div>
  16515. <div class="section-level-extent" id="imf">
  16516. <h3 class="section"><span>20.9 imf<a class="copiable-link" href="#imf"> &para;</a></span></h3>
  16517. <p>Interoperable Master Format demuxer.
  16518. </p>
  16519. <p>This demuxer presents audio and video streams found in an IMF Composition, as
  16520. specified in <a class="url" href="https://doi.org/10.5594/SMPTE.ST2067-2.2020">SMPTE ST 2067-2</a>.
  16521. </p>
  16522. <div class="example">
  16523. <pre class="example-preformatted">ffmpeg [-assetmaps &lt;path of ASSETMAP1&gt;,&lt;path of ASSETMAP2&gt;,...] -i &lt;path of CPL&gt; ...
  16524. </pre></div>
  16525. <p>If <code class="code">-assetmaps</code> is not specified, the demuxer looks for a file called
  16526. <samp class="file">ASSETMAP.xml</samp> in the same directory as the CPL.
  16527. </p>
  16528. </div>
  16529. <div class="section-level-extent" id="flv_002c-live_005fflv_002c-kux">
  16530. <h3 class="section"><span>20.10 flv, live_flv, kux<a class="copiable-link" href="#flv_002c-live_005fflv_002c-kux"> &para;</a></span></h3>
  16531. <p>Adobe Flash Video Format demuxer.
  16532. </p>
  16533. <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.
  16534. KUX is a flv variant used on the Youku platform.
  16535. </p>
  16536. <div class="example">
  16537. <pre class="example-preformatted">ffmpeg -f flv -i myfile.flv ...
  16538. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  16539. </pre></div>
  16540. <dl class="table">
  16541. <dt><samp class="option">-flv_metadata <var class="var">bool</var></samp></dt>
  16542. <dd><p>Allocate the streams according to the onMetaData array content.
  16543. </p>
  16544. </dd>
  16545. <dt><samp class="option">-flv_ignore_prevtag <var class="var">bool</var></samp></dt>
  16546. <dd><p>Ignore the size of previous tag value.
  16547. </p>
  16548. </dd>
  16549. <dt><samp class="option">-flv_full_metadata <var class="var">bool</var></samp></dt>
  16550. <dd><p>Output all context of the onMetadata.
  16551. </p></dd>
  16552. </dl>
  16553. </div>
  16554. <div class="section-level-extent" id="gif-1">
  16555. <h3 class="section"><span>20.11 gif<a class="copiable-link" href="#gif-1"> &para;</a></span></h3>
  16556. <p>Animated GIF demuxer.
  16557. </p>
  16558. <p>It accepts the following options:
  16559. </p>
  16560. <dl class="table">
  16561. <dt><samp class="option">min_delay</samp></dt>
  16562. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  16563. Range is 0 to 6000. Default value is 2.
  16564. </p>
  16565. </dd>
  16566. <dt><samp class="option">max_gif_delay</samp></dt>
  16567. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  16568. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  16569. the maximum value allowed by the specification.
  16570. </p>
  16571. </dd>
  16572. <dt><samp class="option">default_delay</samp></dt>
  16573. <dd><p>Set the default delay between frames in hundredths of seconds.
  16574. Range is 0 to 6000. Default value is 10.
  16575. </p>
  16576. </dd>
  16577. <dt><samp class="option">ignore_loop</samp></dt>
  16578. <dd><p>GIF files can contain information to loop a certain number of times (or
  16579. infinitely). If <samp class="option">ignore_loop</samp> is set to 1, then the loop setting
  16580. from the input will be ignored and looping will not occur. If set to 0,
  16581. then looping will occur and will cycle the number of times according to
  16582. the GIF. Default value is 1.
  16583. </p></dd>
  16584. </dl>
  16585. <p>For example, with the overlay filter, place an infinitely looping GIF
  16586. over another video:
  16587. </p><div class="example">
  16588. <pre class="example-preformatted">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  16589. </pre></div>
  16590. <p>Note that in the above example the shortest option for overlay filter is
  16591. used to end the output video at the length of the shortest input file,
  16592. which in this case is <samp class="file">input.mp4</samp> as the GIF in this example loops
  16593. infinitely.
  16594. </p>
  16595. </div>
  16596. <div class="section-level-extent" id="hls-1">
  16597. <h3 class="section"><span>20.12 hls<a class="copiable-link" href="#hls-1"> &para;</a></span></h3>
  16598. <p>HLS demuxer
  16599. </p>
  16600. <p>Apple HTTP Live Streaming demuxer.
  16601. </p>
  16602. <p>This demuxer presents all AVStreams from all variant streams.
  16603. The id field is set to the bitrate variant index number. By setting
  16604. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  16605. the caller can decide which variant streams to actually receive.
  16606. The total bitrate of the variant that the stream belongs to is
  16607. available in a metadata key named &quot;variant_bitrate&quot;.
  16608. </p>
  16609. <p>It accepts the following options:
  16610. </p>
  16611. <dl class="table">
  16612. <dt><samp class="option">live_start_index</samp></dt>
  16613. <dd><p>segment index to start live streams at (negative values are from the end).
  16614. </p>
  16615. </dd>
  16616. <dt><samp class="option">prefer_x_start</samp></dt>
  16617. <dd><p>prefer to use #EXT-X-START if it&rsquo;s in playlist instead of live_start_index.
  16618. </p>
  16619. </dd>
  16620. <dt><samp class="option">allowed_extensions</samp></dt>
  16621. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  16622. </p>
  16623. </dd>
  16624. <dt><samp class="option">max_reload</samp></dt>
  16625. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  16626. Default value is 1000.
  16627. </p>
  16628. </dd>
  16629. <dt><samp class="option">m3u8_hold_counters</samp></dt>
  16630. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  16631. Default value is 1000.
  16632. </p>
  16633. </dd>
  16634. <dt><samp class="option">http_persistent</samp></dt>
  16635. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  16636. Enabled by default.
  16637. </p>
  16638. </dd>
  16639. <dt><samp class="option">http_multiple</samp></dt>
  16640. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  16641. Enabled by default for HTTP/1.1 servers.
  16642. </p>
  16643. </dd>
  16644. <dt><samp class="option">http_seekable</samp></dt>
  16645. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  16646. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  16647. </p>
  16648. </dd>
  16649. <dt><samp class="option">seg_format_options</samp></dt>
  16650. <dd><p>Set options for the demuxer of media segments using a list of key=value pairs separated by <code class="code">:</code>.
  16651. </p>
  16652. </dd>
  16653. <dt><samp class="option">seg_max_retry</samp></dt>
  16654. <dd><p>Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired.
  16655. Default value is 0.
  16656. </p></dd>
  16657. </dl>
  16658. </div>
  16659. <div class="section-level-extent" id="image2-1">
  16660. <h3 class="section"><span>20.13 image2<a class="copiable-link" href="#image2-1"> &para;</a></span></h3>
  16661. <p>Image file demuxer.
  16662. </p>
  16663. <p>This demuxer reads from a list of image files specified by a pattern.
  16664. The syntax and meaning of the pattern is specified by the
  16665. option <var class="var">pattern_type</var>.
  16666. </p>
  16667. <p>The pattern may contain a suffix which is used to automatically
  16668. determine the format of the images contained in the files.
  16669. </p>
  16670. <p>The size, the pixel format, and the format of each image must be the
  16671. same for all the files in the sequence.
  16672. </p>
  16673. <p>This demuxer accepts the following options:
  16674. </p><dl class="table">
  16675. <dt><samp class="option">framerate</samp></dt>
  16676. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  16677. </p></dd>
  16678. <dt><samp class="option">loop</samp></dt>
  16679. <dd><p>If set to 1, loop over the input. Default value is 0.
  16680. </p></dd>
  16681. <dt><samp class="option">pattern_type</samp></dt>
  16682. <dd><p>Select the pattern type used to interpret the provided filename.
  16683. </p>
  16684. <p><var class="var">pattern_type</var> accepts one of the following values.
  16685. </p><dl class="table">
  16686. <dt><samp class="option">none</samp></dt>
  16687. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  16688. image. You should use this option if you do not want to create sequences from
  16689. multiple images and your filenames may contain special pattern characters.
  16690. </p></dd>
  16691. <dt><samp class="option">sequence</samp></dt>
  16692. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  16693. indexed by sequential numbers.
  16694. </p>
  16695. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, which
  16696. specifies the position of the characters representing a sequential
  16697. number in each filename matched by the pattern. If the form
  16698. &quot;%d0<var class="var">N</var>d&quot; is used, the string representing the number in each
  16699. filename is 0-padded and <var class="var">N</var> is the total number of 0-padded
  16700. digits representing the number. The literal character &rsquo;%&rsquo; can be
  16701. specified in the pattern with the string &quot;%%&quot;.
  16702. </p>
  16703. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, the first filename of
  16704. the file list specified by the pattern must contain a number
  16705. inclusively contained between <var class="var">start_number</var> and
  16706. <var class="var">start_number</var>+<var class="var">start_number_range</var>-1, and all the following
  16707. numbers must be sequential.
  16708. </p>
  16709. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  16710. filenames of the form <samp class="file">img-001.bmp</samp>, <samp class="file">img-002.bmp</samp>, ...,
  16711. <samp class="file">img-010.bmp</samp>, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  16712. sequence of filenames of the form <samp class="file">i%m%g-1.jpg</samp>,
  16713. <samp class="file">i%m%g-2.jpg</samp>, ..., <samp class="file">i%m%g-10.jpg</samp>, etc.
  16714. </p>
  16715. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  16716. &quot;%0<var class="var">N</var>d&quot;, for example to convert a single image file
  16717. <samp class="file">img.jpeg</samp> you can employ the command:
  16718. </p><div class="example">
  16719. <pre class="example-preformatted">ffmpeg -i img.jpeg img.png
  16720. </pre></div>
  16721. </dd>
  16722. <dt><samp class="option">glob</samp></dt>
  16723. <dd><p>Select a glob wildcard pattern type.
  16724. </p>
  16725. <p>The pattern is interpreted like a <code class="code">glob()</code> pattern. This is only
  16726. selectable if libavformat was compiled with globbing support.
  16727. </p>
  16728. </dd>
  16729. <dt><samp class="option">glob_sequence <em class="emph">(deprecated, will be removed)</em></samp></dt>
  16730. <dd><p>Select a mixed glob wildcard/sequence pattern.
  16731. </p>
  16732. <p>If your version of libavformat was compiled with globbing support, and
  16733. the provided pattern contains at least one glob meta character among
  16734. <code class="code">%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
  16735. interpreted like a <code class="code">glob()</code> pattern, otherwise it is interpreted
  16736. like a sequence pattern.
  16737. </p>
  16738. <p>All glob special characters <code class="code">%*?[]{}</code> must be prefixed
  16739. with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
  16740. </p>
  16741. <p>For example the pattern <code class="code">foo-%*.jpeg</code> will match all the
  16742. filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
  16743. <code class="code">foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
  16744. &quot;foo-&quot;, followed by a sequence of three characters, and terminating
  16745. with &quot;.jpeg&quot;.
  16746. </p>
  16747. <p>This pattern type is deprecated in favor of <var class="var">glob</var> and
  16748. <var class="var">sequence</var>.
  16749. </p></dd>
  16750. </dl>
  16751. <p>Default value is <var class="var">glob_sequence</var>.
  16752. </p></dd>
  16753. <dt><samp class="option">pixel_format</samp></dt>
  16754. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  16755. format is guessed from the first image file in the sequence.
  16756. </p></dd>
  16757. <dt><samp class="option">start_number</samp></dt>
  16758. <dd><p>Set the index of the file matched by the image file pattern to start
  16759. to read from. Default value is 0.
  16760. </p></dd>
  16761. <dt><samp class="option">start_number_range</samp></dt>
  16762. <dd><p>Set the index interval range to check when looking for the first image
  16763. file in the sequence, starting from <var class="var">start_number</var>. Default value
  16764. is 5.
  16765. </p></dd>
  16766. <dt><samp class="option">ts_from_file</samp></dt>
  16767. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  16768. that monotonity of timestamps is not provided: images go in the same order as
  16769. without this option. Default value is 0.
  16770. If set to 2, will set frame timestamp to the modification time of the image file in
  16771. nanosecond precision.
  16772. </p></dd>
  16773. <dt><samp class="option">video_size</samp></dt>
  16774. <dd><p>Set the video size of the images to read. If not specified the video
  16775. size is guessed from the first image file in the sequence.
  16776. </p></dd>
  16777. <dt><samp class="option">export_path_metadata</samp></dt>
  16778. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  16779. also available for other filters (see <var class="var">drawtext</var> filter for examples). Default
  16780. value is 0. The extra fields are described below:
  16781. </p><dl class="table">
  16782. <dt><samp class="option">lavf.image2dec.source_path</samp></dt>
  16783. <dd><p>Corresponds to the full path to the input file being read.
  16784. </p></dd>
  16785. <dt><samp class="option">lavf.image2dec.source_basename</samp></dt>
  16786. <dd><p>Corresponds to the name of the file being read.
  16787. </p></dd>
  16788. </dl>
  16789. </dd>
  16790. </dl>
  16791. <ul class="mini-toc">
  16792. <li><a href="#Examples-9" accesskey="1">Examples</a></li>
  16793. </ul>
  16794. <div class="subsection-level-extent" id="Examples-9">
  16795. <h4 class="subsection"><span>20.13.1 Examples<a class="copiable-link" href="#Examples-9"> &para;</a></span></h4>
  16796. <ul class="itemize mark-bullet">
  16797. <li>Use <code class="command">ffmpeg</code> for creating a video from the images in the file
  16798. sequence <samp class="file">img-001.jpeg</samp>, <samp class="file">img-002.jpeg</samp>, ..., assuming an
  16799. input frame rate of 10 frames per second:
  16800. <div class="example">
  16801. <pre class="example-preformatted">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  16802. </pre></div>
  16803. </li><li>As above, but start by reading from a file with index 100 in the sequence:
  16804. <div class="example">
  16805. <pre class="example-preformatted">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  16806. </pre></div>
  16807. </li><li>Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  16808. terminating with the &quot;.png&quot; suffix:
  16809. <div class="example">
  16810. <pre class="example-preformatted">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  16811. </pre></div>
  16812. </li></ul>
  16813. </div>
  16814. </div>
  16815. <div class="section-level-extent" id="libgme">
  16816. <h3 class="section"><span>20.14 libgme<a class="copiable-link" href="#libgme"> &para;</a></span></h3>
  16817. <p>The Game Music Emu library is a collection of video game music file emulators.
  16818. </p>
  16819. <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.
  16820. </p>
  16821. <p>It accepts the following options:
  16822. </p>
  16823. <dl class="table">
  16824. <dt><samp class="option">track_index</samp></dt>
  16825. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  16826. Track indexes start at 0. Default is to pick the first track. Number of tracks
  16827. is exported as <var class="var">tracks</var> metadata entry.
  16828. </p>
  16829. </dd>
  16830. <dt><samp class="option">sample_rate</samp></dt>
  16831. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  16832. </p>
  16833. </dd>
  16834. <dt><samp class="option">max_size <em class="emph">(bytes)</em></samp></dt>
  16835. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  16836. which in turn, acts as a ceiling for the size of files that can be read.
  16837. Default is 50 MiB.
  16838. </p>
  16839. </dd>
  16840. </dl>
  16841. </div>
  16842. <div class="section-level-extent" id="libmodplug">
  16843. <h3 class="section"><span>20.15 libmodplug<a class="copiable-link" href="#libmodplug"> &para;</a></span></h3>
  16844. <p>ModPlug based module demuxer
  16845. </p>
  16846. <p>See <a class="url" href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  16847. </p>
  16848. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  16849. Optionally, a <code class="code">pal8</code> 16-color video stream can be exported with or without printed metadata.
  16850. </p>
  16851. <p>It accepts the following options:
  16852. </p>
  16853. <dl class="table">
  16854. <dt><samp class="option">noise_reduction</samp></dt>
  16855. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  16856. </p>
  16857. </dd>
  16858. <dt><samp class="option">reverb_depth</samp></dt>
  16859. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  16860. </p>
  16861. </dd>
  16862. <dt><samp class="option">reverb_delay</samp></dt>
  16863. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  16864. </p>
  16865. </dd>
  16866. <dt><samp class="option">bass_amount</samp></dt>
  16867. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  16868. </p>
  16869. </dd>
  16870. <dt><samp class="option">bass_range</samp></dt>
  16871. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  16872. </p>
  16873. </dd>
  16874. <dt><samp class="option">surround_depth</samp></dt>
  16875. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  16876. </p>
  16877. </dd>
  16878. <dt><samp class="option">surround_delay</samp></dt>
  16879. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  16880. </p>
  16881. </dd>
  16882. <dt><samp class="option">max_size</samp></dt>
  16883. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  16884. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  16885. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  16886. </p>
  16887. </dd>
  16888. <dt><samp class="option">video_stream_expr</samp></dt>
  16889. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  16890. 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>,
  16891. <code class="code">tempo</code>, <code class="code">order</code>, <code class="code">pattern</code> and <code class="code">row</code>.
  16892. </p>
  16893. </dd>
  16894. <dt><samp class="option">video_stream</samp></dt>
  16895. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  16896. </p>
  16897. </dd>
  16898. <dt><samp class="option">video_stream_w</samp></dt>
  16899. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  16900. </p>
  16901. </dd>
  16902. <dt><samp class="option">video_stream_h</samp></dt>
  16903. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  16904. </p>
  16905. </dd>
  16906. <dt><samp class="option">video_stream_ptxt</samp></dt>
  16907. <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>,
  16908. <code class="code">row</code> and <code class="code">ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  16909. </p>
  16910. </dd>
  16911. </dl>
  16912. </div>
  16913. <div class="section-level-extent" id="libopenmpt">
  16914. <h3 class="section"><span>20.16 libopenmpt<a class="copiable-link" href="#libopenmpt"> &para;</a></span></h3>
  16915. <p>libopenmpt based module demuxer
  16916. </p>
  16917. <p>See <a class="url" href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  16918. </p>
  16919. <p>Some files have multiple subsongs (tracks) this can be set with the <samp class="option">subsong</samp>
  16920. option.
  16921. </p>
  16922. <p>It accepts the following options:
  16923. </p>
  16924. <dl class="table">
  16925. <dt><samp class="option">subsong</samp></dt>
  16926. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  16927. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  16928. </p>
  16929. <p>The default value is to let libopenmpt choose.
  16930. </p>
  16931. </dd>
  16932. <dt><samp class="option">layout</samp></dt>
  16933. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  16934. The default value is STEREO.
  16935. </p>
  16936. </dd>
  16937. <dt><samp class="option">sample_rate</samp></dt>
  16938. <dd><p>Set the sample rate for libopenmpt to output.
  16939. Range is from 1000 to INT_MAX. The value default is 48000.
  16940. </p></dd>
  16941. </dl>
  16942. </div>
  16943. <div class="section-level-extent" id="mov_002fmp4_002f3gp">
  16944. <h3 class="section"><span>20.17 mov/mp4/3gp<a class="copiable-link" href="#mov_002fmp4_002f3gp"> &para;</a></span></h3>
  16945. <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).
  16946. </p>
  16947. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  16948. </p>
  16949. <ul class="mini-toc">
  16950. <li><a href="#Options-51" accesskey="1">Options</a></li>
  16951. <li><a href="#Audible-AAX" accesskey="2">Audible AAX</a></li>
  16952. </ul>
  16953. <div class="subsection-level-extent" id="Options-51">
  16954. <h4 class="subsection"><span>20.17.1 Options<a class="copiable-link" href="#Options-51"> &para;</a></span></h4>
  16955. <p>This demuxer accepts the following options:
  16956. </p><dl class="table">
  16957. <dt><samp class="option">enable_drefs</samp></dt>
  16958. <dd><p>Enable loading of external tracks, disabled by default.
  16959. Enabling this can theoretically leak information in some use cases.
  16960. </p>
  16961. </dd>
  16962. <dt><samp class="option">use_absolute_path</samp></dt>
  16963. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  16964. Enabling this poses a security risk. It should only be enabled if the source
  16965. is known to be non-malicious.
  16966. </p>
  16967. </dd>
  16968. <dt><samp class="option">seek_streams_individually</samp></dt>
  16969. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  16970. that stream from identified point. This can lead to a different sequence of packets compared
  16971. to demuxing linearly from the beginning. Default is true.
  16972. </p>
  16973. </dd>
  16974. <dt><samp class="option">ignore_editlist</samp></dt>
  16975. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  16976. timeline described by the edit list. Default is false.
  16977. </p>
  16978. </dd>
  16979. <dt><samp class="option">advanced_editlist</samp></dt>
  16980. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code class="code">ignore_editlist</code>
  16981. must be set to false for this option to be effective.
  16982. If both <code class="code">ignore_editlist</code> and this option are set to false, then only the
  16983. start of the stream index is modified to reflect initial dwell time or starting timestamp
  16984. described by the edit list. Default is true.
  16985. </p>
  16986. </dd>
  16987. <dt><samp class="option">ignore_chapters</samp></dt>
  16988. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  16989. only parsed when input is seekable. Default is false.
  16990. </p>
  16991. </dd>
  16992. <dt><samp class="option">use_mfra_for</samp></dt>
  16993. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  16994. </p>
  16995. <p>Following options are available:
  16996. </p><dl class="table">
  16997. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  16998. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em class="emph">(default)</em>
  16999. </p>
  17000. </dd>
  17001. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  17002. <dd><p>Set mfra timestamps as DTS
  17003. </p>
  17004. </dd>
  17005. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  17006. <dd><p>Set mfra timestamps as PTS
  17007. </p>
  17008. </dd>
  17009. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  17010. <dd><p>Don&rsquo;t use mfra box to set timestamps
  17011. </p></dd>
  17012. </dl>
  17013. </dd>
  17014. <dt><samp class="option">use_tfdt</samp></dt>
  17015. <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.
  17016. 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.
  17017. 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
  17018. set to pts or dts.
  17019. </p>
  17020. </dd>
  17021. <dt><samp class="option">export_all</samp></dt>
  17022. <dd><p>Export unrecognized boxes within the <var class="var">udta</var> box as metadata entries. The first four
  17023. characters of the box type are set as the key. Default is false.
  17024. </p>
  17025. </dd>
  17026. <dt><samp class="option">export_xmp</samp></dt>
  17027. <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
  17028. 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
  17029. but with key <code class="code">XMP_</code>. Default is false.
  17030. </p>
  17031. </dd>
  17032. <dt><samp class="option">activation_bytes</samp></dt>
  17033. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  17034. </p>
  17035. </dd>
  17036. <dt><samp class="option">audible_fixed_key</samp></dt>
  17037. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  17038. specify.
  17039. </p>
  17040. </dd>
  17041. <dt><samp class="option">decryption_key</samp></dt>
  17042. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  17043. </p>
  17044. </dd>
  17045. <dt><samp class="option">max_stts_delta</samp></dt>
  17046. <dd><p>Very high sample deltas written in a trak&rsquo;s stts box may occasionally be intended but usually they are written in
  17047. error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets
  17048. the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when
  17049. cast to int32 are used to adjust onward dts.
  17050. </p>
  17051. <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
  17052. a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of <code class="code">uint32</code> range.
  17053. </p>
  17054. </dd>
  17055. <dt><samp class="option">interleaved_read</samp></dt>
  17056. <dd><p>Interleave packets from multiple tracks at demuxer level. For badly interleaved files, this prevents playback issues
  17057. caused by large gaps between packets in different tracks, as MOV/MP4 do not have packet placement requirements.
  17058. However, this can cause excessive seeking on very badly interleaved files, due to seeking between tracks, so disabling
  17059. it may prevent I/O issues, at the expense of playback.
  17060. </p>
  17061. </dd>
  17062. </dl>
  17063. </div>
  17064. <div class="subsection-level-extent" id="Audible-AAX">
  17065. <h4 class="subsection"><span>20.17.2 Audible AAX<a class="copiable-link" href="#Audible-AAX"> &para;</a></span></h4>
  17066. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  17067. </p><div class="example">
  17068. <pre class="example-preformatted">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  17069. </pre></div>
  17070. </div>
  17071. </div>
  17072. <div class="section-level-extent" id="mpegts">
  17073. <h3 class="section"><span>20.18 mpegts<a class="copiable-link" href="#mpegts"> &para;</a></span></h3>
  17074. <p>MPEG-2 transport stream demuxer.
  17075. </p>
  17076. <p>This demuxer accepts the following options:
  17077. </p><dl class="table">
  17078. <dt><samp class="option">resync_size</samp></dt>
  17079. <dd><p>Set size limit for looking up a new synchronization. Default value is
  17080. 65536.
  17081. </p>
  17082. </dd>
  17083. <dt><samp class="option">skip_unknown_pmt</samp></dt>
  17084. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  17085. </p>
  17086. </dd>
  17087. <dt><samp class="option">fix_teletext_pts</samp></dt>
  17088. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  17089. from the PCR of the first program which the teletext stream is part of and is
  17090. not discarded. Default value is 1, set this option to 0 if you want your
  17091. teletext packet PTS and DTS values untouched.
  17092. </p>
  17093. </dd>
  17094. <dt><samp class="option">ts_packetsize</samp></dt>
  17095. <dd><p>Output option carrying the raw packet size in bytes.
  17096. Show the detected raw packet size, cannot be set by the user.
  17097. </p>
  17098. </dd>
  17099. <dt><samp class="option">scan_all_pmts</samp></dt>
  17100. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  17101. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  17102. disabled). Default value is -1.
  17103. </p>
  17104. </dd>
  17105. <dt><samp class="option">merge_pmt_versions</samp></dt>
  17106. <dd><p>Re-use existing streams when a PMT&rsquo;s version is updated and elementary
  17107. streams move to different PIDs. Default value is 0.
  17108. </p>
  17109. </dd>
  17110. <dt><samp class="option">max_packet_size</samp></dt>
  17111. <dd><p>Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size
  17112. are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes.
  17113. </p></dd>
  17114. </dl>
  17115. </div>
  17116. <div class="section-level-extent" id="mpjpeg">
  17117. <h3 class="section"><span>20.19 mpjpeg<a class="copiable-link" href="#mpjpeg"> &para;</a></span></h3>
  17118. <p>MJPEG encapsulated in multi-part MIME demuxer.
  17119. </p>
  17120. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  17121. multipart/x-mixed-replace stream.
  17122. </p><dl class="table">
  17123. <dt><samp class="option">strict_mime_boundary</samp></dt>
  17124. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  17125. to prevent regression with numerous existing endpoints not generating a proper MIME
  17126. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  17127. of the boundary value.
  17128. </p></dd>
  17129. </dl>
  17130. </div>
  17131. <div class="section-level-extent" id="rawvideo-1">
  17132. <h3 class="section"><span>20.20 rawvideo<a class="copiable-link" href="#rawvideo-1"> &para;</a></span></h3>
  17133. <p>Raw video demuxer.
  17134. </p>
  17135. <p>This demuxer allows one to read raw video data. Since there is no header
  17136. specifying the assumed video parameters, the user must specify them
  17137. in order to be able to decode the data correctly.
  17138. </p>
  17139. <p>This demuxer accepts the following options:
  17140. </p><dl class="table">
  17141. <dt><samp class="option">framerate</samp></dt>
  17142. <dd><p>Set input video frame rate. Default value is 25.
  17143. </p>
  17144. </dd>
  17145. <dt><samp class="option">pixel_format</samp></dt>
  17146. <dd><p>Set the input video pixel format. Default value is <code class="code">yuv420p</code>.
  17147. </p>
  17148. </dd>
  17149. <dt><samp class="option">video_size</samp></dt>
  17150. <dd><p>Set the input video size. This value must be specified explicitly.
  17151. </p></dd>
  17152. </dl>
  17153. <p>For example to read a rawvideo file <samp class="file">input.raw</samp> with
  17154. <code class="command">ffplay</code>, assuming a pixel format of <code class="code">rgb24</code>, a video
  17155. size of <code class="code">320x240</code>, and a frame rate of 10 images per second, use
  17156. the command:
  17157. </p><div class="example">
  17158. <pre class="example-preformatted">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  17159. </pre></div>
  17160. </div>
  17161. <div class="section-level-extent" id="sbg">
  17162. <h3 class="section"><span>20.21 sbg<a class="copiable-link" href="#sbg"> &para;</a></span></h3>
  17163. <p>SBaGen script demuxer.
  17164. </p>
  17165. <p>This demuxer reads the script language used by SBaGen
  17166. <a class="url" href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  17167. script looks like that:
  17168. </p><div class="example">
  17169. <pre class="example-preformatted">-SE
  17170. a: 300-2.5/3 440+4.5/0
  17171. b: 300-2.5/0 440+4.5/3
  17172. off: -
  17173. NOW == a
  17174. +0:07:00 == b
  17175. +0:14:00 == a
  17176. +0:21:00 == b
  17177. +0:30:00 off
  17178. </pre></div>
  17179. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  17180. either only absolute timestamps (including the script start time) or only
  17181. relative ones, then its layout is fixed, and the conversion is
  17182. straightforward. On the other hand, if the script mixes both kind of
  17183. timestamps, then the <var class="var">NOW</var> reference for relative timestamps will be
  17184. taken from the current time of day at the time the script is read, and the
  17185. script layout will be frozen according to that reference. That means that if
  17186. the script is directly played, the actual times will match the absolute
  17187. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  17188. somehow pauses the playback or seeks, all times will be shifted accordingly.
  17189. </p>
  17190. </div>
  17191. <div class="section-level-extent" id="tedcaptions">
  17192. <h3 class="section"><span>20.22 tedcaptions<a class="copiable-link" href="#tedcaptions"> &para;</a></span></h3>
  17193. <p>JSON captions used for <a class="url" href="http://www.ted.com/">TED Talks</a>.
  17194. </p>
  17195. <p>TED does not provide links to the captions, but they can be guessed from the
  17196. page. The file <samp class="file">tools/bookmarklets.html</samp> from the FFmpeg source tree
  17197. contains a bookmarklet to expose them.
  17198. </p>
  17199. <p>This demuxer accepts the following option:
  17200. </p><dl class="table">
  17201. <dt><samp class="option">start_time</samp></dt>
  17202. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  17203. (15s). It is used to sync the captions with the downloadable videos, because
  17204. they include a 15s intro.
  17205. </p></dd>
  17206. </dl>
  17207. <p>Example: convert the captions to a format most players understand:
  17208. </p><div class="example">
  17209. <pre class="example-preformatted">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  17210. </pre></div>
  17211. </div>
  17212. <div class="section-level-extent" id="vapoursynth">
  17213. <h3 class="section"><span>20.23 vapoursynth<a class="copiable-link" href="#vapoursynth"> &para;</a></span></h3>
  17214. <p>Vapoursynth wrapper.
  17215. </p>
  17216. <p>Due to security concerns, Vapoursynth scripts will not
  17217. be autodetected so the input format has to be forced. For ff* CLI tools,
  17218. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  17219. </p>
  17220. <p>This demuxer accepts the following option:
  17221. </p><dl class="table">
  17222. <dt><samp class="option">max_script_size</samp></dt>
  17223. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  17224. which in turn, acts as a ceiling for the size of scripts that can be read.
  17225. Default is 1 MiB.
  17226. </p></dd>
  17227. </dl>
  17228. </div>
  17229. <div class="section-level-extent" id="w64">
  17230. <h3 class="section"><span>20.24 w64<a class="copiable-link" href="#w64"> &para;</a></span></h3>
  17231. <p>Sony Wave64 Audio demuxer.
  17232. </p>
  17233. <p>This demuxer accepts the following options:
  17234. </p><dl class="table">
  17235. <dt><samp class="option">max_size</samp></dt>
  17236. <dd><p>See the same option for the <a class="ref" href="#wav">wav</a> demuxer.
  17237. </p></dd>
  17238. </dl>
  17239. <a class="anchor" id="wav"></a></div>
  17240. <div class="section-level-extent" id="wav-1">
  17241. <h3 class="section"><span>20.25 wav<a class="copiable-link" href="#wav-1"> &para;</a></span></h3>
  17242. <p>RIFF Wave Audio demuxer.
  17243. </p>
  17244. <p>This demuxer accepts the following options:
  17245. </p><dl class="table">
  17246. <dt><samp class="option">max_size</samp></dt>
  17247. <dd><p>Specify the maximum packet size in bytes for the demuxed packets. By default
  17248. this is set to 0, which means that a sensible value is chosen based on the
  17249. input format.
  17250. </p></dd>
  17251. </dl>
  17252. </div>
  17253. </div>
  17254. <div class="chapter-level-extent" id="Muxers">
  17255. <h2 class="chapter"><span>21 Muxers<a class="copiable-link" href="#Muxers"> &para;</a></span></h2>
  17256. <p>Muxers are configured elements in FFmpeg which allow writing
  17257. multimedia streams to a particular type of file.
  17258. </p>
  17259. <p>When you configure your FFmpeg build, all the supported muxers
  17260. are enabled by default. You can list all available muxers using the
  17261. configure option <code class="code">--list-muxers</code>.
  17262. </p>
  17263. <p>You can disable all the muxers with the configure option
  17264. <code class="code">--disable-muxers</code> and selectively enable / disable single muxers
  17265. with the options <code class="code">--enable-muxer=<var class="var">MUXER</var></code> /
  17266. <code class="code">--disable-muxer=<var class="var">MUXER</var></code>.
  17267. </p>
  17268. <p>The option <code class="code">-muxers</code> of the ff* tools will display the list of
  17269. enabled muxers. Use <code class="code">-formats</code> to view a combined list of
  17270. enabled demuxers and muxers.
  17271. </p>
  17272. <p>A description of some of the currently available muxers follows.
  17273. </p>
  17274. <a class="anchor" id="raw-muxers"></a><ul class="mini-toc">
  17275. <li><a href="#Raw-muxers" accesskey="1">Raw muxers</a></li>
  17276. <li><a href="#Raw-PCM-muxers" accesskey="2">Raw PCM muxers</a></li>
  17277. <li><a href="#MPEG_002d1_002fMPEG_002d2-program-stream-muxers" accesskey="3">MPEG-1/MPEG-2 program stream muxers</a></li>
  17278. <li><a href="#MOV_002fMPEG_002d4_002fISOMBFF-muxers" accesskey="4">MOV/MPEG-4/ISOMBFF muxers</a></li>
  17279. <li><a href="#a64-1" accesskey="5">a64</a></li>
  17280. <li><a href="#ac4" accesskey="6">ac4</a></li>
  17281. <li><a href="#adts-1" accesskey="7">adts</a></li>
  17282. <li><a href="#aea-1" accesskey="8">aea</a></li>
  17283. <li><a href="#aiff-1" accesskey="9">aiff</a></li>
  17284. <li><a href="#alp-1">alp</a></li>
  17285. <li><a href="#amr">amr</a></li>
  17286. <li><a href="#amv">amv</a></li>
  17287. <li><a href="#apm">apm</a></li>
  17288. <li><a href="#apng-1">apng</a></li>
  17289. <li><a href="#argo_005fasf">argo_asf</a></li>
  17290. <li><a href="#argo_005fcvg">argo_cvg</a></li>
  17291. <li><a href="#asf_002c-asf_005fstream">asf, asf_stream</a></li>
  17292. <li><a href="#ass">ass</a></li>
  17293. <li><a href="#ast">ast</a></li>
  17294. <li><a href="#au">au</a></li>
  17295. <li><a href="#avi-1">avi</a></li>
  17296. <li><a href="#avif">avif</a></li>
  17297. <li><a href="#avm2">avm2</a></li>
  17298. <li><a href="#bit">bit</a></li>
  17299. <li><a href="#caf">caf</a></li>
  17300. <li><a href="#codec2">codec2</a></li>
  17301. <li><a href="#chromaprint-1">chromaprint</a></li>
  17302. <li><a href="#crc-1">crc</a></li>
  17303. <li><a href="#dash-2">dash</a></li>
  17304. <li><a href="#daud">daud</a></li>
  17305. <li><a href="#dv">dv</a></li>
  17306. <li><a href="#ffmetadata">ffmetadata</a></li>
  17307. <li><a href="#fifo-1">fifo</a></li>
  17308. <li><a href="#film_005fcpk">film_cpk</a></li>
  17309. <li><a href="#filmstrip">filmstrip</a></li>
  17310. <li><a href="#fits">fits</a></li>
  17311. <li><a href="#flac-3">flac</a></li>
  17312. <li><a href="#flv">flv</a></li>
  17313. <li><a href="#framecrc-1">framecrc</a></li>
  17314. <li><a href="#framehash-1">framehash</a></li>
  17315. <li><a href="#framemd5-1">framemd5</a></li>
  17316. <li><a href="#gif-2">gif</a></li>
  17317. <li><a href="#gxf">gxf</a></li>
  17318. <li><a href="#hash-1">hash</a></li>
  17319. <li><a href="#hds-1">hds</a></li>
  17320. <li><a href="#hls-2">hls</a></li>
  17321. <li><a href="#ico-1">ico</a></li>
  17322. <li><a href="#image2-2">image2</a></li>
  17323. <li><a href="#matroska">matroska</a></li>
  17324. <li><a href="#md5-1">md5</a></li>
  17325. <li><a href="#mp3">mp3</a></li>
  17326. <li><a href="#mpegts-1">mpegts</a></li>
  17327. <li><a href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">mxf, mxf_d10, mxf_opatom</a></li>
  17328. <li><a href="#null-1">null</a></li>
  17329. <li><a href="#nut">nut</a></li>
  17330. <li><a href="#ogg">ogg</a></li>
  17331. <li><a href="#rcwt-1">rcwt</a></li>
  17332. <li><a href="#segment_002c-stream_005fsegment_002c-ssegment">segment, stream_segment, ssegment</a></li>
  17333. <li><a href="#smoothstreaming">smoothstreaming</a></li>
  17334. <li><a href="#streamhash-1">streamhash</a></li>
  17335. <li><a href="#tee-1">tee</a></li>
  17336. <li><a href="#webm_005fchunk">webm_chunk</a></li>
  17337. <li><a href="#webm_005fdash_005fmanifest">webm_dash_manifest</a></li>
  17338. </ul>
  17339. <div class="section-level-extent" id="Raw-muxers">
  17340. <h3 class="section"><span>21.1 Raw muxers<a class="copiable-link" href="#Raw-muxers"> &para;</a></span></h3>
  17341. <p>This section covers raw muxers. They accept a single stream matching
  17342. the designated codec. They do not store timestamps or metadata. The
  17343. recognized extension is the same as the muxer name unless indicated
  17344. otherwise.
  17345. </p>
  17346. <p>It comprises the following muxers. The media type and the eventual
  17347. extensions used to automatically selects the muxer from the output
  17348. extensions are also shown.
  17349. </p>
  17350. <dl class="table">
  17351. <dt>&lsquo;<samp class="samp">ac3 <em class="emph">audio</em></samp>&rsquo;</dt>
  17352. <dd><p>Dolby Digital, also known as AC-3.
  17353. </p>
  17354. </dd>
  17355. <dt>&lsquo;<samp class="samp">adx <em class="emph">audio</em></samp>&rsquo;</dt>
  17356. <dd><p>CRI Middleware ADX audio.
  17357. </p>
  17358. <p>This muxer will write out the total sample count near the start of the
  17359. first packet when the output is seekable and the count can be stored
  17360. in 32 bits.
  17361. </p>
  17362. </dd>
  17363. <dt>&lsquo;<samp class="samp">aptx <em class="emph">audio</em></samp>&rsquo;</dt>
  17364. <dd><p>aptX (Audio Processing Technology for Bluetooth)
  17365. </p>
  17366. </dd>
  17367. <dt>&lsquo;<samp class="samp">aptx_hd <em class="emph">audio</em> (aptxdh)</samp>&rsquo;</dt>
  17368. <dd><p>aptX HD (Audio Processing Technology for Bluetooth) audio
  17369. </p>
  17370. </dd>
  17371. <dt>&lsquo;<samp class="samp">avs2 <em class="emph">video</em> (avs, avs2)</samp>&rsquo;</dt>
  17372. <dd><p>AVS2-P2 (Audio Video Standard - Second generation - Part 2) /
  17373. IEEE 1857.4 video
  17374. </p>
  17375. </dd>
  17376. <dt>&lsquo;<samp class="samp">avs3 <em class="emph">video</em> (avs3)</samp>&rsquo;</dt>
  17377. <dd><p>AVS3-P2 (Audio Video Standard - Third generation - Part 2) /
  17378. IEEE 1857.10 video
  17379. </p>
  17380. </dd>
  17381. <dt>&lsquo;<samp class="samp">cavsvideo <em class="emph">video</em> (cavs)</samp>&rsquo;</dt>
  17382. <dd><p>Chinese AVS (Audio Video Standard - First generation)
  17383. </p>
  17384. </dd>
  17385. <dt>&lsquo;<samp class="samp">codec2raw <em class="emph">audio</em></samp>&rsquo;</dt>
  17386. <dd><p>Codec 2 audio.
  17387. </p>
  17388. <p>No extension is registered so format name has to be supplied e.g. with
  17389. the ffmpeg CLI tool <code class="code">-f codec2raw</code>.
  17390. </p>
  17391. </dd>
  17392. <dt>&lsquo;<samp class="samp">data <em class="emph">any</em></samp>&rsquo;</dt>
  17393. <dd><p>Generic data muxer.
  17394. </p>
  17395. <p>This muxer accepts a single stream with any codec of any type. The
  17396. input stream has to be selected using the <code class="code">-map</code> option with the
  17397. <code class="command">ffmpeg</code> CLI tool.
  17398. </p>
  17399. <p>No extension is registered so format name has to be supplied e.g. with
  17400. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f data</code>.
  17401. </p>
  17402. </dd>
  17403. <dt>&lsquo;<samp class="samp">dfpwm <em class="emph">audio</em> (dfpwm)</samp>&rsquo;</dt>
  17404. <dd><p>Raw DFPWM1a (Dynamic Filter Pulse With Modulation) audio muxer.
  17405. </p>
  17406. </dd>
  17407. <dt>&lsquo;<samp class="samp">dirac <em class="emph">video</em> (drc, vc2)</samp>&rsquo;</dt>
  17408. <dd><p>BBC Dirac video.
  17409. </p>
  17410. <p>The Dirac Pro codec is a subset and is standardized as SMPTE VC-2.
  17411. </p>
  17412. </dd>
  17413. <dt>&lsquo;<samp class="samp">dnxhd <em class="emph">video</em> (dnxhd, dnxhr)</samp>&rsquo;</dt>
  17414. <dd><p>Avid DNxHD video.
  17415. </p>
  17416. <p>It is standardized as SMPTE VC-3. Accepts DNxHR streams.
  17417. </p>
  17418. </dd>
  17419. <dt>&lsquo;<samp class="samp">dts <em class="emph">audio</em></samp>&rsquo;</dt>
  17420. <dd><p>DTS Coherent Acoustics (DCA) audio
  17421. </p>
  17422. </dd>
  17423. <dt>&lsquo;<samp class="samp">eac3 <em class="emph">audio</em></samp>&rsquo;</dt>
  17424. <dd><p>Dolby Digital Plus, also known as Enhanced AC-3
  17425. </p>
  17426. </dd>
  17427. <dt>&lsquo;<samp class="samp">evc <em class="emph">video</em> (evc)</samp>&rsquo;</dt>
  17428. <dd><p>MPEG-5 Essential Video Coding (EVC) / EVC / MPEG-5 Part 1 EVC video
  17429. </p>
  17430. </dd>
  17431. <dt>&lsquo;<samp class="samp">g722 <em class="emph">audio</em></samp>&rsquo;</dt>
  17432. <dd><p>ITU-T G.722 audio
  17433. </p>
  17434. </dd>
  17435. <dt>&lsquo;<samp class="samp">g723_1 <em class="emph">audio</em> (tco, rco)</samp>&rsquo;</dt>
  17436. <dd><p>ITU-T G.723.1 audio
  17437. </p>
  17438. </dd>
  17439. <dt>&lsquo;<samp class="samp">g726 <em class="emph">audio</em></samp>&rsquo;</dt>
  17440. <dd><p>ITU-T G.726 big-endian (&quot;left-justified&quot;) audio.
  17441. </p>
  17442. <p>No extension is registered so format name has to be supplied e.g. with
  17443. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f g726</code>.
  17444. </p>
  17445. </dd>
  17446. <dt>&lsquo;<samp class="samp">g726le <em class="emph">audio</em></samp>&rsquo;</dt>
  17447. <dd><p>ITU-T G.726 little-endian (&quot;right-justified&quot;) audio.
  17448. </p>
  17449. <p>No extension is registered so format name has to be supplied e.g. with
  17450. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f g726le</code>.
  17451. </p>
  17452. </dd>
  17453. <dt>&lsquo;<samp class="samp">gsm <em class="emph">audio</em></samp>&rsquo;</dt>
  17454. <dd><p>Global System for Mobile Communications audio
  17455. </p>
  17456. </dd>
  17457. <dt>&lsquo;<samp class="samp">h261 <em class="emph">video</em></samp>&rsquo;</dt>
  17458. <dd><p>ITU-T H.261 video
  17459. </p>
  17460. </dd>
  17461. <dt>&lsquo;<samp class="samp">h263 <em class="emph">video</em></samp>&rsquo;</dt>
  17462. <dd><p>ITU-T H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 video
  17463. </p>
  17464. </dd>
  17465. <dt>&lsquo;<samp class="samp">h264 <em class="emph">video</em> (h264, 264)</samp>&rsquo;</dt>
  17466. <dd><p>ITU-T H.264 / MPEG-4 Part 10 AVC video. Bitstream shall be converted
  17467. to Annex B syntax if it&rsquo;s in length-prefixed mode.
  17468. </p>
  17469. </dd>
  17470. <dt>&lsquo;<samp class="samp">hevc <em class="emph">video</em> (hevc, h265, 265)</samp>&rsquo;</dt>
  17471. <dd><p>ITU-T H.265 / MPEG-H Part 2 HEVC video. Bitstream shall be converted
  17472. to Annex B syntax if it&rsquo;s in length-prefixed mode.
  17473. </p>
  17474. </dd>
  17475. <dt>&lsquo;<samp class="samp">m4v <em class="emph">video</em></samp>&rsquo;</dt>
  17476. <dd><p>MPEG-4 Part 2 video
  17477. </p>
  17478. </dd>
  17479. <dt>&lsquo;<samp class="samp">mjpeg <em class="emph">video</em> (mjpg, mjpeg)</samp>&rsquo;</dt>
  17480. <dd><p>Motion JPEG video
  17481. </p>
  17482. </dd>
  17483. <dt>&lsquo;<samp class="samp">mlp <em class="emph">audio</em></samp>&rsquo;</dt>
  17484. <dd><p>Meridian Lossless Packing, also known as Packed PCM
  17485. </p>
  17486. </dd>
  17487. <dt>&lsquo;<samp class="samp">mp2 <em class="emph">audio</em> (mp2, m2a, mpa)</samp>&rsquo;</dt>
  17488. <dd><p>MPEG-1 Audio Layer II audio
  17489. </p>
  17490. </dd>
  17491. <dt>&lsquo;<samp class="samp">mpeg1video <em class="emph">video</em> (mpg, mpeg, m1v)</samp>&rsquo;</dt>
  17492. <dd><p>MPEG-1 Part 2 video.
  17493. </p>
  17494. </dd>
  17495. <dt>&lsquo;<samp class="samp">mpeg2video <em class="emph">video</em> (m2v)</samp>&rsquo;</dt>
  17496. <dd><p>ITU-T H.262 / MPEG-2 Part 2 video
  17497. </p>
  17498. </dd>
  17499. <dt>&lsquo;<samp class="samp">obu <em class="emph">video</em></samp>&rsquo;</dt>
  17500. <dd><p>AV1 low overhead Open Bitstream Units muxer.
  17501. </p>
  17502. <p>Temporal delimiter OBUs will be inserted in all temporal units of the
  17503. stream.
  17504. </p>
  17505. </dd>
  17506. <dt>&lsquo;<samp class="samp">rawvideo <em class="emph">video</em> (yuv, rgb)</samp>&rsquo;</dt>
  17507. <dd><p>Raw uncompressed video.
  17508. </p>
  17509. </dd>
  17510. <dt>&lsquo;<samp class="samp">sbc <em class="emph">audio</em> (sbc, msbc)</samp>&rsquo;</dt>
  17511. <dd><p>Bluetooth SIG low-complexity subband codec audio
  17512. </p>
  17513. </dd>
  17514. <dt>&lsquo;<samp class="samp">truehd <em class="emph">audio</em> (thd)</samp>&rsquo;</dt>
  17515. <dd><p>Dolby TrueHD audio
  17516. </p>
  17517. </dd>
  17518. <dt>&lsquo;<samp class="samp">vc1 <em class="emph">video</em></samp>&rsquo;</dt>
  17519. <dd><p>SMPTE 421M / VC-1 video
  17520. </p></dd>
  17521. </dl>
  17522. <ul class="mini-toc">
  17523. <li><a href="#Examples-10" accesskey="1">Examples</a></li>
  17524. </ul>
  17525. <div class="subsection-level-extent" id="Examples-10">
  17526. <h4 class="subsection"><span>21.1.1 Examples<a class="copiable-link" href="#Examples-10"> &para;</a></span></h4>
  17527. <ul class="itemize mark-bullet">
  17528. <li>Store raw video frames with the &lsquo;<samp class="samp">rawvideo</samp>&rsquo; muxer using <code class="command">ffmpeg</code>:
  17529. <div class="example">
  17530. <pre class="example-preformatted">ffmpeg -f lavfi -i testsrc -t 10 -s hd1080p testsrc.yuv
  17531. </pre></div>
  17532. <p>Since the rawvideo muxer do not store the information related to size
  17533. and format, this information must be provided when demuxing the file:
  17534. </p><div class="example">
  17535. <pre class="example-preformatted">ffplay -video_size 1920x1080 -pixel_format rgb24 -f rawvideo testsrc.rgb
  17536. </pre></div>
  17537. </li></ul>
  17538. </div>
  17539. </div>
  17540. <div class="section-level-extent" id="Raw-PCM-muxers">
  17541. <h3 class="section"><span>21.2 Raw PCM muxers<a class="copiable-link" href="#Raw-PCM-muxers"> &para;</a></span></h3>
  17542. <p>This section covers raw PCM (Pulse-Code Modulation) audio muxers.
  17543. </p>
  17544. <p>They accept a single stream matching the designated codec. They do not
  17545. store timestamps or metadata. The recognized extension is the same as
  17546. the muxer name.
  17547. </p>
  17548. <p>It comprises the following muxers. The optional additional extension
  17549. used to automatically select the muxer from the output extension is
  17550. also shown in parentheses.
  17551. </p>
  17552. <dl class="table">
  17553. <dt>&lsquo;<samp class="samp">alaw (al)</samp>&rsquo;</dt>
  17554. <dd><p>PCM A-law
  17555. </p>
  17556. </dd>
  17557. <dt>&lsquo;<samp class="samp">f32be</samp>&rsquo;</dt>
  17558. <dd><p>PCM 32-bit floating-point big-endian
  17559. </p>
  17560. </dd>
  17561. <dt>&lsquo;<samp class="samp">f32le</samp>&rsquo;</dt>
  17562. <dd><p>PCM 32-bit floating-point little-endian
  17563. </p>
  17564. </dd>
  17565. <dt>&lsquo;<samp class="samp">f64be</samp>&rsquo;</dt>
  17566. <dd><p>PCM 64-bit floating-point big-endian
  17567. </p>
  17568. </dd>
  17569. <dt>&lsquo;<samp class="samp">f64le</samp>&rsquo;</dt>
  17570. <dd><p>PCM 64-bit floating-point little-endian
  17571. </p>
  17572. </dd>
  17573. <dt>&lsquo;<samp class="samp">mulaw (ul)</samp>&rsquo;</dt>
  17574. <dd><p>PCM mu-law
  17575. </p>
  17576. </dd>
  17577. <dt>&lsquo;<samp class="samp">s16be</samp>&rsquo;</dt>
  17578. <dd><p>PCM signed 16-bit big-endian
  17579. </p>
  17580. </dd>
  17581. <dt>&lsquo;<samp class="samp">s16le</samp>&rsquo;</dt>
  17582. <dd><p>PCM signed 16-bit little-endian
  17583. </p>
  17584. </dd>
  17585. <dt>&lsquo;<samp class="samp">s24be</samp>&rsquo;</dt>
  17586. <dd><p>PCM signed 24-bit big-endian
  17587. </p>
  17588. </dd>
  17589. <dt>&lsquo;<samp class="samp">s24le</samp>&rsquo;</dt>
  17590. <dd><p>PCM signed 24-bit little-endian
  17591. </p>
  17592. </dd>
  17593. <dt>&lsquo;<samp class="samp">s32be</samp>&rsquo;</dt>
  17594. <dd><p>PCM signed 32-bit big-endian
  17595. </p>
  17596. </dd>
  17597. <dt>&lsquo;<samp class="samp">s32le</samp>&rsquo;</dt>
  17598. <dd><p>PCM signed 32-bit little-endian
  17599. </p>
  17600. </dd>
  17601. <dt>&lsquo;<samp class="samp">s8 (sb)</samp>&rsquo;</dt>
  17602. <dd><p>PCM signed 8-bit
  17603. </p>
  17604. </dd>
  17605. <dt>&lsquo;<samp class="samp">u16be</samp>&rsquo;</dt>
  17606. <dd><p>PCM unsigned 16-bit big-endian
  17607. </p>
  17608. </dd>
  17609. <dt>&lsquo;<samp class="samp">u16le</samp>&rsquo;</dt>
  17610. <dd><p>PCM unsigned 16-bit little-endian
  17611. </p>
  17612. </dd>
  17613. <dt>&lsquo;<samp class="samp">u24be</samp>&rsquo;</dt>
  17614. <dd><p>PCM unsigned 24-bit big-endian
  17615. </p>
  17616. </dd>
  17617. <dt>&lsquo;<samp class="samp">u24le</samp>&rsquo;</dt>
  17618. <dd><p>PCM unsigned 24-bit little-endian
  17619. </p>
  17620. </dd>
  17621. <dt>&lsquo;<samp class="samp">u32be</samp>&rsquo;</dt>
  17622. <dd><p>PCM unsigned 32-bit big-endian
  17623. </p>
  17624. </dd>
  17625. <dt>&lsquo;<samp class="samp">u32le</samp>&rsquo;</dt>
  17626. <dd><p>PCM unsigned 32-bit little-endian
  17627. </p>
  17628. </dd>
  17629. <dt>&lsquo;<samp class="samp">u8 (ub)</samp>&rsquo;</dt>
  17630. <dd><p>PCM unsigned 8-bit
  17631. </p>
  17632. </dd>
  17633. <dt>&lsquo;<samp class="samp">vidc</samp>&rsquo;</dt>
  17634. <dd><p>PCM Archimedes VIDC
  17635. </p></dd>
  17636. </dl>
  17637. </div>
  17638. <div class="section-level-extent" id="MPEG_002d1_002fMPEG_002d2-program-stream-muxers">
  17639. <h3 class="section"><span>21.3 MPEG-1/MPEG-2 program stream muxers<a class="copiable-link" href="#MPEG_002d1_002fMPEG_002d2-program-stream-muxers"> &para;</a></span></h3>
  17640. <p>This section covers formats belonging to the MPEG-1 and MPEG-2 Systems
  17641. family.
  17642. </p>
  17643. <p>The MPEG-1 Systems format (also known as ISO/IEEC 11172-1 or MPEG-1
  17644. program stream) has been adopted for the format of media track stored
  17645. in VCD (Video Compact Disc).
  17646. </p>
  17647. <p>The MPEG-2 Systems standard (also known as ISO/IEEC 13818-1) covers
  17648. two containers formats, one known as transport stream and one known as
  17649. program stream; only the latter is covered here.
  17650. </p>
  17651. <p>The MPEG-2 program stream format (also known as VOB due to the
  17652. corresponding file extension) is an extension of MPEG-1 program
  17653. stream: in addition to support different codecs for the audio and
  17654. video streams, it also stores subtitles and navigation metadata.
  17655. MPEG-2 program stream has been adopted for storing media streams in
  17656. SVCD and DVD storage devices.
  17657. </p>
  17658. <p>This section comprises the following muxers.
  17659. </p>
  17660. <dl class="table">
  17661. <dt>&lsquo;<samp class="samp">mpeg (mpg,mpeg)</samp>&rsquo;</dt>
  17662. <dd><p>MPEG-1 Systems / MPEG-1 program stream muxer.
  17663. </p>
  17664. </dd>
  17665. <dt>&lsquo;<samp class="samp">vcd</samp>&rsquo;</dt>
  17666. <dd><p>MPEG-1 Systems / MPEG-1 program stream (VCD) muxer.
  17667. </p>
  17668. <p>This muxer can be used to generate tracks in the format accepted by
  17669. the VCD (Video Compact Disc) storage devices.
  17670. </p>
  17671. <p>It is the same as the &lsquo;<samp class="samp">mpeg</samp>&rsquo; muxer with a few differences.
  17672. </p>
  17673. </dd>
  17674. <dt>&lsquo;<samp class="samp">vob</samp>&rsquo;</dt>
  17675. <dd><p>MPEG-2 program stream (VOB) muxer.
  17676. </p>
  17677. </dd>
  17678. <dt>&lsquo;<samp class="samp">dvd</samp>&rsquo;</dt>
  17679. <dd><p>MPEG-2 program stream (DVD VOB) muxer.
  17680. </p>
  17681. <p>This muxer can be used to generate tracks in the format accepted by
  17682. the DVD (Digital Versatile Disc) storage devices.
  17683. </p>
  17684. <p>This is the same as the &lsquo;<samp class="samp">vob</samp>&rsquo; muxer with a few differences.
  17685. </p>
  17686. </dd>
  17687. <dt>&lsquo;<samp class="samp">svcd (vob)</samp>&rsquo;</dt>
  17688. <dd><p>MPEG-2 program stream (SVCD VOB) muxer.
  17689. </p>
  17690. <p>This muxer can be used to generate tracks in the format accepted by
  17691. the SVCD (Super Video Compact Disc) storage devices.
  17692. </p>
  17693. <p>This is the same as the &lsquo;<samp class="samp">vob</samp>&rsquo; muxer with a few differences.
  17694. </p></dd>
  17695. </dl>
  17696. <ul class="mini-toc">
  17697. <li><a href="#Options-52" accesskey="1">Options</a></li>
  17698. </ul>
  17699. <div class="subsection-level-extent" id="Options-52">
  17700. <h4 class="subsection"><span>21.3.1 Options<a class="copiable-link" href="#Options-52"> &para;</a></span></h4>
  17701. <dl class="table">
  17702. <dt><samp class="option">muxrate <var class="var">rate</var></samp></dt>
  17703. <dd><p>Set user-defined mux rate expressed as a number of bits/s. If not
  17704. specied the automatically computed mux rate is employed. Default value
  17705. is <code class="code">0</code>.
  17706. </p>
  17707. </dd>
  17708. <dt><samp class="option">preload <var class="var">delay</var></samp></dt>
  17709. <dd><p>Set initial demux-decode delay in microseconds. Default value is
  17710. <code class="code">500000</code>.
  17711. </p></dd>
  17712. </dl>
  17713. </div>
  17714. </div>
  17715. <div class="section-level-extent" id="MOV_002fMPEG_002d4_002fISOMBFF-muxers">
  17716. <h3 class="section"><span>21.4 MOV/MPEG-4/ISOMBFF muxers<a class="copiable-link" href="#MOV_002fMPEG_002d4_002fISOMBFF-muxers"> &para;</a></span></h3>
  17717. <p>This section covers formats belonging to the QuickTime / MOV family,
  17718. including the MPEG-4 Part 14 format and ISO base media file format
  17719. (ISOBMFF). These formats share a common structure based on the ISO
  17720. base media file format (ISOBMFF).
  17721. </p>
  17722. <p>The MOV format was originally developed for use with Apple QuickTime.
  17723. It was later used as the basis for the MPEG-4 Part 1 (later Part 14)
  17724. format, also known as ISO/IEC 14496-1. That format was then
  17725. generalized into ISOBMFF, also named MPEG-4 Part 12 format, ISO/IEC
  17726. 14496-12, or ISO/IEC 15444-12.
  17727. </p>
  17728. <p>It comprises the following muxers.
  17729. </p>
  17730. <dl class="table">
  17731. <dt>&lsquo;<samp class="samp">3gp</samp>&rsquo;</dt>
  17732. <dd><p>Third Generation Partnership Project (3GPP) format for 3G UMTS
  17733. multimedia services
  17734. </p>
  17735. </dd>
  17736. <dt>&lsquo;<samp class="samp">3g2</samp>&rsquo;</dt>
  17737. <dd><p>Third Generation Partnership Project 2 (3GP2 or 3GPP2) format for 3G
  17738. CDMA2000 multimedia services, similar to &lsquo;<samp class="samp">3gp</samp>&rsquo; with extensions
  17739. and limitations
  17740. </p>
  17741. </dd>
  17742. <dt>&lsquo;<samp class="samp">f4v</samp>&rsquo;</dt>
  17743. <dd><p>Adobe Flash Video format
  17744. </p>
  17745. </dd>
  17746. <dt>&lsquo;<samp class="samp">ipod</samp>&rsquo;</dt>
  17747. <dd><p>MPEG-4 audio file format, as MOV/MP4 but limited to contain only audio
  17748. streams, typically played with the Apple ipod device
  17749. </p>
  17750. </dd>
  17751. <dt>&lsquo;<samp class="samp">ismv</samp>&rsquo;</dt>
  17752. <dd><p>Microsoft IIS (Internet Information Services) Smooth Streaming
  17753. Audio/Video (ISMV or ISMA) format. This is based on MPEG-4 Part 14
  17754. format with a few incompatible variants, used to stream media files
  17755. for the Microsoft IIS server.
  17756. </p>
  17757. </dd>
  17758. <dt>&lsquo;<samp class="samp">mov</samp>&rsquo;</dt>
  17759. <dd><p>QuickTime player format identified by the <code class="code">.mov</code> extension
  17760. </p>
  17761. </dd>
  17762. <dt>&lsquo;<samp class="samp">mp4</samp>&rsquo;</dt>
  17763. <dd><p>MP4 or MPEG-4 Part 14 format
  17764. </p>
  17765. </dd>
  17766. <dt>&lsquo;<samp class="samp">psp</samp>&rsquo;</dt>
  17767. <dd><p>PlayStation Portable MP4/MPEG-4 Part 14 format variant. This is based
  17768. on MPEG-4 Part 14 format with a few incompatible variants, used to
  17769. play files on PlayStation devices.
  17770. </p></dd>
  17771. </dl>
  17772. <ul class="mini-toc">
  17773. <li><a href="#Fragmentation" accesskey="1">Fragmentation</a></li>
  17774. <li><a href="#Options-53" accesskey="2">Options</a></li>
  17775. <li><a href="#Examples-11" accesskey="3">Examples</a></li>
  17776. </ul>
  17777. <div class="subsection-level-extent" id="Fragmentation">
  17778. <h4 class="subsection"><span>21.4.1 Fragmentation<a class="copiable-link" href="#Fragmentation"> &para;</a></span></h4>
  17779. <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
  17780. fragmentation. Normally, a MOV/MP4 file has all the metadata about all
  17781. packets stored in one location.
  17782. </p>
  17783. <p>This data is usually written at the end of the file, but it can be
  17784. moved to the start for better playback by adding <code class="code">+faststart</code> to
  17785. the <code class="code">-movflags</code>, or using the <code class="command">qt-faststart</code> tool).
  17786. </p>
  17787. <p>A fragmented file consists of a number of fragments, where packets and
  17788. metadata about these packets are stored together. Writing a fragmented
  17789. file has the advantage that the file is decodable even if the writing
  17790. is interrupted (while a normal MOV/MP4 is undecodable if it is not
  17791. properly finished), and it requires less memory when writing very long
  17792. files (since writing normal MOV/MP4 files stores info about every
  17793. single packet in memory until the file is closed). The downside is
  17794. that it is less compatible with other applications.
  17795. </p>
  17796. <p>Fragmentation is enabled by setting one of the options that define
  17797. how to cut the file into fragments:
  17798. </p><dl class="table">
  17799. <dt><samp class="option">frag_duration</samp></dt>
  17800. <dt><samp class="option">frag_size</samp></dt>
  17801. <dt><samp class="option">min_frag_duration</samp></dt>
  17802. <dt><samp class="option">movflags +frag_keyframe</samp></dt>
  17803. <dt><samp class="option">movflags +frag_custom</samp></dt>
  17804. </dl>
  17805. <p>If more than one condition is specified, fragments are cut when one of
  17806. the specified conditions is fulfilled. The exception to this is the
  17807. option <samp class="option">min_frag_duration</samp>, which has to be fulfilled for any
  17808. of the other conditions to apply.
  17809. </p>
  17810. </div>
  17811. <div class="subsection-level-extent" id="Options-53">
  17812. <h4 class="subsection"><span>21.4.2 Options<a class="copiable-link" href="#Options-53"> &para;</a></span></h4>
  17813. <dl class="table">
  17814. <dt><samp class="option">brand <var class="var">brand_string</var></samp></dt>
  17815. <dd><p>Override major brand.
  17816. </p>
  17817. </dd>
  17818. <dt><samp class="option">empty_hdlr_name <var class="var">bool</var></samp></dt>
  17819. <dd><p>Enable to skip writing the name inside a <code class="code">hdlr</code> box.
  17820. Default is <code class="code">false</code>.
  17821. </p>
  17822. </dd>
  17823. <dt><samp class="option">encryption_key <var class="var">key</var></samp></dt>
  17824. <dd><p>set the media encryption key in hexadecimal format
  17825. </p>
  17826. </dd>
  17827. <dt><samp class="option">encryption_kid <var class="var">kid</var></samp></dt>
  17828. <dd><p>set the media encryption key identifier in hexadecimal format
  17829. </p>
  17830. </dd>
  17831. <dt><samp class="option">encryption_scheme <var class="var">scheme</var></samp></dt>
  17832. <dd><p>configure the encryption scheme, allowed values are &lsquo;<samp class="samp">none</samp>&rsquo;, and
  17833. &lsquo;<samp class="samp">cenc-aes-ctr</samp>&rsquo;
  17834. </p>
  17835. </dd>
  17836. <dt><samp class="option">frag_duration <var class="var">duration</var></samp></dt>
  17837. <dd><p>Create fragments that are <var class="var">duration</var> microseconds long.
  17838. </p>
  17839. </dd>
  17840. <dt><samp class="option">frag_interleave <var class="var">number</var></samp></dt>
  17841. <dd><p>Interleave samples within fragments (max number of consecutive
  17842. samples, lower is tighter interleaving, but with more overhead. It is
  17843. set to <code class="code">0</code> by default.
  17844. </p>
  17845. </dd>
  17846. <dt><samp class="option">frag_size <var class="var">size</var></samp></dt>
  17847. <dd><p>create fragments that contain up to <var class="var">size</var> bytes of payload data
  17848. </p>
  17849. </dd>
  17850. <dt><samp class="option">iods_audio_profile <var class="var">profile</var></samp></dt>
  17851. <dd><p>specify iods number for the audio profile atom (from -1 to 255),
  17852. default is <code class="code">-1</code>
  17853. </p>
  17854. </dd>
  17855. <dt><samp class="option">iods_video_profile <var class="var">profile</var></samp></dt>
  17856. <dd><p>specify iods number for the video profile atom (from -1 to 255),
  17857. default is <code class="code">-1</code>
  17858. </p>
  17859. </dd>
  17860. <dt><samp class="option">ism_lookahead <var class="var">num_entries</var></samp></dt>
  17861. <dd><p>specify number of lookahead entries for ISM files (from 0 to 255),
  17862. default is <code class="code">0</code>
  17863. </p>
  17864. </dd>
  17865. <dt><samp class="option">min_frag_duration <var class="var">duration</var></samp></dt>
  17866. <dd><p>do not create fragments that are shorter than <var class="var">duration</var> microseconds long
  17867. </p>
  17868. </dd>
  17869. <dt><samp class="option">moov_size <var class="var">bytes</var></samp></dt>
  17870. <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
  17871. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  17872. </p>
  17873. </dd>
  17874. <dt><samp class="option">mov_gamma <var class="var">gamma</var></samp></dt>
  17875. <dd><p>specify gamma value for gama atom (as a decimal number from 0 to 10),
  17876. default is <code class="code">0.0</code>, must be set together with <code class="code">+ movflags</code>
  17877. </p>
  17878. </dd>
  17879. <dt><samp class="option">movflags <var class="var">flags</var></samp></dt>
  17880. <dd><p>Set various muxing switches. The following flags can be used:
  17881. </p><dl class="table">
  17882. <dt>&lsquo;<samp class="samp">cmaf</samp>&rsquo;</dt>
  17883. <dd><p>write CMAF (Common Media Application Format) compatible fragmented
  17884. MP4 output
  17885. </p>
  17886. </dd>
  17887. <dt>&lsquo;<samp class="samp">dash</samp>&rsquo;</dt>
  17888. <dd><p>write DASH (Dynamic Adaptive Streaming over HTTP) compatible fragmented
  17889. MP4 output
  17890. </p>
  17891. </dd>
  17892. <dt>&lsquo;<samp class="samp">default_base_moof</samp>&rsquo;</dt>
  17893. <dd><p>Similarly to the &lsquo;<samp class="samp">omit_tfhd_offset</samp>&rsquo; flag, this flag avoids
  17894. writing the absolute base_data_offset field in tfhd atoms, but does so
  17895. by using the new default-base-is-moof flag instead. This flag is new
  17896. from 14496-12:2012. This may make the fragments easier to parse in
  17897. certain circumstances (avoiding basing track fragment location
  17898. calculations on the implicit end of the previous track fragment).
  17899. </p>
  17900. </dd>
  17901. <dt>&lsquo;<samp class="samp">delay_moov</samp>&rsquo;</dt>
  17902. <dd><p>delay writing the initial moov until the first fragment is cut, or
  17903. until the first fragment flush
  17904. </p>
  17905. </dd>
  17906. <dt>&lsquo;<samp class="samp">disable_chpl</samp>&rsquo;</dt>
  17907. <dd><p>Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  17908. and a QuickTime chapter track are written to the file. With this
  17909. option set, only the QuickTime chapter track will be written. Nero
  17910. chapters can cause failures when the file is reprocessed with certain
  17911. tagging programs, like mp3Tag 2.61a and iTunes 11.3, most likely other
  17912. versions are affected as well.
  17913. </p>
  17914. </dd>
  17915. <dt>&lsquo;<samp class="samp">faststart</samp>&rsquo;</dt>
  17916. <dd><p>Run a second pass moving the index (moov atom) to the beginning of the
  17917. file. This operation can take a while, and will not work in various
  17918. situations such as fragmented output, thus it is not enabled by
  17919. default.
  17920. </p>
  17921. </dd>
  17922. <dt>&lsquo;<samp class="samp">frag_custom</samp>&rsquo;</dt>
  17923. <dd><p>Allow the caller to manually choose when to cut fragments, by calling
  17924. <code class="code">av_write_frame(ctx, NULL)</code> to write a fragment with the packets
  17925. written so far. (This is only useful with other applications
  17926. integrating libavformat, not from <code class="command">ffmpeg</code>.)
  17927. </p>
  17928. </dd>
  17929. <dt>&lsquo;<samp class="samp">frag_discont</samp>&rsquo;</dt>
  17930. <dd><p>signal that the next fragment is discontinuous from earlier ones
  17931. </p>
  17932. </dd>
  17933. <dt>&lsquo;<samp class="samp">frag_every_frame</samp>&rsquo;</dt>
  17934. <dd><p>fragment at every frame
  17935. </p>
  17936. </dd>
  17937. <dt>&lsquo;<samp class="samp">frag_keyframe</samp>&rsquo;</dt>
  17938. <dd><p>start a new fragment at each video keyframe
  17939. </p>
  17940. </dd>
  17941. <dt>&lsquo;<samp class="samp">global_sidx</samp>&rsquo;</dt>
  17942. <dd><p>write a global sidx index at the start of the file
  17943. </p>
  17944. </dd>
  17945. <dt>&lsquo;<samp class="samp">isml</samp>&rsquo;</dt>
  17946. <dd><p>create a live smooth streaming feed (for pushing to a publishing point)
  17947. </p>
  17948. </dd>
  17949. <dt>&lsquo;<samp class="samp">negative_cts_offsets</samp>&rsquo;</dt>
  17950. <dd><p>Enables utilization of version 1 of the CTTS box, in which the CTS offsets can
  17951. be negative. This enables the initial sample to have DTS/CTS of zero, and
  17952. reduces the need for edit lists for some cases such as video tracks with
  17953. B-frames. Additionally, eases conformance with the DASH-IF interoperability
  17954. guidelines.
  17955. </p>
  17956. <p>This option is implicitly set when writing &lsquo;<samp class="samp">ismv</samp>&rsquo; (Smooth
  17957. Streaming) files.
  17958. </p>
  17959. </dd>
  17960. <dt>&lsquo;<samp class="samp">omit_tfhd_offset</samp>&rsquo;</dt>
  17961. <dd><p>Do not write any absolute base_data_offset in tfhd atoms. This avoids
  17962. tying fragments to absolute byte positions in the file/streams.
  17963. </p>
  17964. </dd>
  17965. <dt>&lsquo;<samp class="samp">prefer_icc</samp>&rsquo;</dt>
  17966. <dd><p>If writing colr atom prioritise usage of ICC profile if it exists in
  17967. stream packet side data.
  17968. </p>
  17969. </dd>
  17970. <dt>&lsquo;<samp class="samp">rtphint</samp>&rsquo;</dt>
  17971. <dd><p>add RTP hinting tracks to the output file
  17972. </p>
  17973. </dd>
  17974. <dt>&lsquo;<samp class="samp">separate_moof</samp>&rsquo;</dt>
  17975. <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
  17976. packets for all tracks are written in a moof atom (which is slightly
  17977. more efficient), but with this option set, the muxer writes one
  17978. moof/mdat pair for each track, making it easier to separate tracks.
  17979. </p>
  17980. </dd>
  17981. <dt>&lsquo;<samp class="samp">skip_sidx</samp>&rsquo;</dt>
  17982. <dd><p>Skip writing of sidx atom. When bitrate overhead due to sidx atom is
  17983. high, this option could be used for cases where sidx atom is not
  17984. mandatory. When the &lsquo;<samp class="samp">global_sidx</samp>&rsquo; flag is enabled, this option
  17985. is ignored.
  17986. </p>
  17987. </dd>
  17988. <dt>&lsquo;<samp class="samp">skip_trailer</samp>&rsquo;</dt>
  17989. <dd><p>skip writing the mfra/tfra/mfro trailer for fragmented files
  17990. </p>
  17991. </dd>
  17992. <dt>&lsquo;<samp class="samp">use_metadata_tags</samp>&rsquo;</dt>
  17993. <dd><p>use mdta atom for metadata
  17994. </p>
  17995. </dd>
  17996. <dt>&lsquo;<samp class="samp">write_colr</samp>&rsquo;</dt>
  17997. <dd><p>write colr atom even if the color info is unspecified. This flag is
  17998. experimental, may be renamed or changed, do not use from scripts.
  17999. </p>
  18000. </dd>
  18001. <dt>&lsquo;<samp class="samp">write_gama</samp>&rsquo;</dt>
  18002. <dd><p>write deprecated gama atom
  18003. </p></dd>
  18004. </dl>
  18005. </dd>
  18006. <dt><samp class="option">movie_timescale <var class="var">scale</var></samp></dt>
  18007. <dd><p>Set the timescale written in the movie header box (<code class="code">mvhd</code>).
  18008. Range is 1 to INT_MAX. Default is <code class="code">1000</code>.
  18009. </p>
  18010. </dd>
  18011. <dt><samp class="option">rtpflags <var class="var">flags</var></samp></dt>
  18012. <dd><p>Add RTP hinting tracks to the output file.
  18013. </p>
  18014. <p>The following flags can be used:
  18015. </p><dl class="table">
  18016. <dt>&lsquo;<samp class="samp">h264_mode0</samp>&rsquo;</dt>
  18017. <dd><p>use mode 0 for H.264 in RTP
  18018. </p>
  18019. </dd>
  18020. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  18021. <dd><p>use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC
  18022. </p>
  18023. </dd>
  18024. <dt>&lsquo;<samp class="samp">rfc2190</samp>&rsquo;</dt>
  18025. <dd><p>use RFC 2190 packetization instead of RFC 4629 for H.263
  18026. </p>
  18027. </dd>
  18028. <dt>&lsquo;<samp class="samp">send_bye</samp>&rsquo;</dt>
  18029. <dd><p>send RTCP BYE packets when finishing
  18030. </p>
  18031. </dd>
  18032. <dt>&lsquo;<samp class="samp">skip_rtcp</samp>&rsquo;</dt>
  18033. <dd><p>do not send RTCP sender reports
  18034. </p></dd>
  18035. </dl>
  18036. </dd>
  18037. <dt><samp class="option">skip_iods <var class="var">bool</var></samp></dt>
  18038. <dd><p>skip writing iods atom (default value is <code class="code">true</code>)
  18039. </p>
  18040. </dd>
  18041. <dt><samp class="option">use_editlist <var class="var">bool</var></samp></dt>
  18042. <dd><p>use edit list (default value is <code class="code">auto</code>)
  18043. </p>
  18044. </dd>
  18045. <dt><samp class="option">use_stream_ids_as_track_ids <var class="var">bool</var></samp></dt>
  18046. <dd><p>use stream ids as track ids (default value is <code class="code">false</code>)
  18047. </p>
  18048. </dd>
  18049. <dt><samp class="option">video_track_timescale <var class="var">scale</var></samp></dt>
  18050. <dd><p>Set the timescale used for video tracks. Range is <code class="code">0</code> to INT_MAX. If
  18051. set to <code class="code">0</code>, the timescale is automatically set based on the
  18052. native stream time base. Default is <code class="code">0</code>.
  18053. </p>
  18054. </dd>
  18055. <dt><samp class="option">write_btrt <var class="var">bool</var></samp></dt>
  18056. <dd><p>Force or disable writing bitrate box inside stsd box of a track. The
  18057. box contains decoding buffer size (in bytes), maximum bitrate and
  18058. average bitrate for the track. The box will be skipped if none of
  18059. these values can be computed. Default is <code class="code">-1</code> or <code class="code">auto</code>,
  18060. which will write the box only in MP4 mode.
  18061. </p>
  18062. </dd>
  18063. <dt><samp class="option">write_prft <var class="var">option</var></samp></dt>
  18064. <dd><p>Write producer time reference box (PRFT) with a specified time source for the
  18065. NTP field in the PRFT box. Set value as &lsquo;<samp class="samp">wallclock</samp>&rsquo; to specify timesource
  18066. as wallclock time and &lsquo;<samp class="samp">pts</samp>&rsquo; to specify timesource as input packets&rsquo; PTS
  18067. values.
  18068. </p>
  18069. </dd>
  18070. <dt><samp class="option">write_tmcd <var class="var">bool</var></samp></dt>
  18071. <dd><p>Specify <code class="code">on</code> to force writing a timecode track, <code class="code">off</code> to disable it
  18072. and <code class="code">auto</code> to write a timecode track only for mov and mp4 output (default).
  18073. </p>
  18074. <p>Setting value to &lsquo;<samp class="samp">pts</samp>&rsquo; is applicable only for a live encoding use case,
  18075. where PTS values are set as as wallclock time at the source. For example, an
  18076. encoding use case with decklink capture source where <samp class="option">video_pts</samp> and
  18077. <samp class="option">audio_pts</samp> are set to &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  18078. </p></dd>
  18079. </dl>
  18080. </div>
  18081. <div class="subsection-level-extent" id="Examples-11">
  18082. <h4 class="subsection"><span>21.4.3 Examples<a class="copiable-link" href="#Examples-11"> &para;</a></span></h4>
  18083. <ul class="itemize mark-bullet">
  18084. <li>Push Smooth Streaming content in real time to a publishing point on
  18085. IIS with the &lsquo;<samp class="samp">ismv</samp>&rsquo; muxer using <code class="command">ffmpeg</code>:
  18086. <div class="example">
  18087. <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)
  18088. </pre></div>
  18089. </li></ul>
  18090. <a class="anchor" id="a64"></a></div>
  18091. </div>
  18092. <div class="section-level-extent" id="a64-1">
  18093. <h3 class="section"><span>21.5 a64<a class="copiable-link" href="#a64-1"> &para;</a></span></h3>
  18094. <p>A64 Commodore 64 video muxer.
  18095. </p>
  18096. <p>This muxer accepts a single <code class="code">a64_multi</code> or <code class="code">a64_multi5</code>
  18097. codec video stream.
  18098. </p>
  18099. </div>
  18100. <div class="section-level-extent" id="ac4">
  18101. <h3 class="section"><span>21.6 ac4<a class="copiable-link" href="#ac4"> &para;</a></span></h3>
  18102. <p>Raw AC-4 audio muxer.
  18103. </p>
  18104. <p>This muxer accepts a single <code class="code">ac4</code> audio stream.
  18105. </p>
  18106. <ul class="mini-toc">
  18107. <li><a href="#Options-54" accesskey="1">Options</a></li>
  18108. </ul>
  18109. <div class="subsection-level-extent" id="Options-54">
  18110. <h4 class="subsection"><span>21.6.1 Options<a class="copiable-link" href="#Options-54"> &para;</a></span></h4>
  18111. <dl class="table">
  18112. <dt><samp class="option">write_crc <var class="var">bool</var></samp></dt>
  18113. <dd><p>when enabled, write a CRC checksum for each packet to the output,
  18114. default is <code class="code">false</code>
  18115. </p></dd>
  18116. </dl>
  18117. <a class="anchor" id="adts"></a></div>
  18118. </div>
  18119. <div class="section-level-extent" id="adts-1">
  18120. <h3 class="section"><span>21.7 adts<a class="copiable-link" href="#adts-1"> &para;</a></span></h3>
  18121. <p>Audio Data Transport Stream muxer.
  18122. </p>
  18123. <p>It accepts a single AAC stream.
  18124. </p>
  18125. <ul class="mini-toc">
  18126. <li><a href="#Options-55" accesskey="1">Options</a></li>
  18127. </ul>
  18128. <div class="subsection-level-extent" id="Options-55">
  18129. <h4 class="subsection"><span>21.7.1 Options<a class="copiable-link" href="#Options-55"> &para;</a></span></h4>
  18130. <dl class="table">
  18131. <dt><samp class="option">write_id3v2 <var class="var">bool</var></samp></dt>
  18132. <dd><p>Enable to write ID3v2.4 tags at the start of the stream. Default is
  18133. disabled.
  18134. </p>
  18135. </dd>
  18136. <dt><samp class="option">write_apetag <var class="var">bool</var></samp></dt>
  18137. <dd><p>Enable to write APE tags at the end of the stream. Default is
  18138. disabled.
  18139. </p>
  18140. </dd>
  18141. <dt><samp class="option">write_mpeg2 <var class="var">bool</var></samp></dt>
  18142. <dd><p>Enable to set MPEG version bit in the ADTS frame header to 1 which
  18143. indicates MPEG-2. Default is 0, which indicates MPEG-4.
  18144. </p></dd>
  18145. </dl>
  18146. <a class="anchor" id="aea"></a></div>
  18147. </div>
  18148. <div class="section-level-extent" id="aea-1">
  18149. <h3 class="section"><span>21.8 aea<a class="copiable-link" href="#aea-1"> &para;</a></span></h3>
  18150. <p>MD STUDIO audio muxer.
  18151. </p>
  18152. <p>This muxer accepts a single ATRAC1 audio stream with either one or two channels
  18153. and a sample rate of 44100Hz.
  18154. </p>
  18155. <p>As AEA supports storing the track title, this muxer will also write
  18156. the title from stream&rsquo;s metadata to the container.
  18157. </p>
  18158. <a class="anchor" id="aiff"></a></div>
  18159. <div class="section-level-extent" id="aiff-1">
  18160. <h3 class="section"><span>21.9 aiff<a class="copiable-link" href="#aiff-1"> &para;</a></span></h3>
  18161. <p>Audio Interchange File Format muxer.
  18162. </p>
  18163. <ul class="mini-toc">
  18164. <li><a href="#Options-56" accesskey="1">Options</a></li>
  18165. </ul>
  18166. <div class="subsection-level-extent" id="Options-56">
  18167. <h4 class="subsection"><span>21.9.1 Options<a class="copiable-link" href="#Options-56"> &para;</a></span></h4>
  18168. <dl class="table">
  18169. <dt><samp class="option">write_id3v2 <var class="var">bool</var></samp></dt>
  18170. <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  18171. </p>
  18172. </dd>
  18173. <dt><samp class="option">id3v2_version <var class="var">bool</var></samp></dt>
  18174. <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  18175. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  18176. </p></dd>
  18177. </dl>
  18178. <a class="anchor" id="alp"></a></div>
  18179. </div>
  18180. <div class="section-level-extent" id="alp-1">
  18181. <h3 class="section"><span>21.10 alp<a class="copiable-link" href="#alp-1"> &para;</a></span></h3>
  18182. <p>High Voltage Software&rsquo;s Lego Racers game audio muxer.
  18183. </p>
  18184. <p>It accepts a single ADPCM_IMA_ALP stream with no more than 2 channels
  18185. and a sample rate not greater than 44100 Hz.
  18186. </p>
  18187. <p>Extensions: <code class="code">tun</code>, <code class="code">pcm</code>
  18188. </p>
  18189. <ul class="mini-toc">
  18190. <li><a href="#Options-57" accesskey="1">Options</a></li>
  18191. </ul>
  18192. <div class="subsection-level-extent" id="Options-57">
  18193. <h4 class="subsection"><span>21.10.1 Options<a class="copiable-link" href="#Options-57"> &para;</a></span></h4>
  18194. <dl class="table">
  18195. <dt><samp class="option">type <var class="var">type</var></samp></dt>
  18196. <dd><p>Set file type.
  18197. </p>
  18198. <p><var class="var">type</var> accepts the following values:
  18199. </p><dl class="table">
  18200. <dt>&lsquo;<samp class="samp">tun</samp>&rsquo;</dt>
  18201. <dd><p>Set file type as music. Must have a sample rate of 22050 Hz.
  18202. </p>
  18203. </dd>
  18204. <dt>&lsquo;<samp class="samp">pcm</samp>&rsquo;</dt>
  18205. <dd><p>Set file type as sfx.
  18206. </p>
  18207. </dd>
  18208. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  18209. <dd><p>Set file type as per output file extension. <code class="code">.pcm</code> results in
  18210. type <code class="code">pcm</code> else type <code class="code">tun</code> is set. <var class="var">(default)</var>
  18211. </p></dd>
  18212. </dl>
  18213. </dd>
  18214. </dl>
  18215. </div>
  18216. </div>
  18217. <div class="section-level-extent" id="amr">
  18218. <h3 class="section"><span>21.11 amr<a class="copiable-link" href="#amr"> &para;</a></span></h3>
  18219. <p>3GPP AMR (Adaptive Multi-Rate) audio muxer.
  18220. </p>
  18221. <p>It accepts a single audio stream containing an AMR NB stream.
  18222. </p>
  18223. </div>
  18224. <div class="section-level-extent" id="amv">
  18225. <h3 class="section"><span>21.12 amv<a class="copiable-link" href="#amv"> &para;</a></span></h3>
  18226. <p>AMV (Actions Media Video) format muxer.
  18227. </p>
  18228. </div>
  18229. <div class="section-level-extent" id="apm">
  18230. <h3 class="section"><span>21.13 apm<a class="copiable-link" href="#apm"> &para;</a></span></h3>
  18231. <p>Ubisoft Rayman 2 APM audio muxer.
  18232. </p>
  18233. <p>It accepts a single ADPCM IMA APM audio stream.
  18234. </p>
  18235. </div>
  18236. <div class="section-level-extent" id="apng-1">
  18237. <h3 class="section"><span>21.14 apng<a class="copiable-link" href="#apng-1"> &para;</a></span></h3>
  18238. <p>Animated Portable Network Graphics muxer.
  18239. </p>
  18240. <p>It accepts a single APNG video stream.
  18241. </p>
  18242. <ul class="mini-toc">
  18243. <li><a href="#Options-58" accesskey="1">Options</a></li>
  18244. <li><a href="#Examples-12" accesskey="2">Examples</a></li>
  18245. </ul>
  18246. <div class="subsection-level-extent" id="Options-58">
  18247. <h4 class="subsection"><span>21.14.1 Options<a class="copiable-link" href="#Options-58"> &para;</a></span></h4>
  18248. <dl class="table">
  18249. <dt><samp class="option">final_delay <var class="var">delay</var></samp></dt>
  18250. <dd><p>Force a delay expressed in seconds after the last frame of each
  18251. repetition. Default value is <code class="code">0.0</code>.
  18252. </p>
  18253. </dd>
  18254. <dt><samp class="option">plays <var class="var">repetitions</var></samp></dt>
  18255. <dd><p>specify how many times to play the content, <code class="code">0</code> causes an infinte
  18256. loop, with <code class="code">1</code> there is no loop
  18257. </p></dd>
  18258. </dl>
  18259. </div>
  18260. <div class="subsection-level-extent" id="Examples-12">
  18261. <h4 class="subsection"><span>21.14.2 Examples<a class="copiable-link" href="#Examples-12"> &para;</a></span></h4>
  18262. <ul class="itemize mark-bullet">
  18263. <li>Use <code class="command">ffmpeg</code> to generate an APNG output with 2 repetitions,
  18264. and with a delay of half a second after the first repetition:
  18265. <div class="example">
  18266. <pre class="example-preformatted">ffmpeg -i INPUT -final_delay 0.5 -plays 2 out.apng
  18267. </pre></div>
  18268. </li></ul>
  18269. </div>
  18270. </div>
  18271. <div class="section-level-extent" id="argo_005fasf">
  18272. <h3 class="section"><span>21.15 argo_asf<a class="copiable-link" href="#argo_005fasf"> &para;</a></span></h3>
  18273. <p>Argonaut Games ASF audio muxer.
  18274. </p>
  18275. <p>It accepts a single ADPCM audio stream.
  18276. </p>
  18277. <ul class="mini-toc">
  18278. <li><a href="#Options-59" accesskey="1">Options</a></li>
  18279. </ul>
  18280. <div class="subsection-level-extent" id="Options-59">
  18281. <h4 class="subsection"><span>21.15.1 Options<a class="copiable-link" href="#Options-59"> &para;</a></span></h4>
  18282. <dl class="table">
  18283. <dt><samp class="option">version_major <var class="var">version</var></samp></dt>
  18284. <dd><p>override file major version, specified as an integer, default value is
  18285. <code class="code">2</code>
  18286. </p>
  18287. </dd>
  18288. <dt><samp class="option">version_minor <var class="var">version</var></samp></dt>
  18289. <dd><p>override file minor version, specified as an integer, default value is
  18290. <code class="code">1</code>
  18291. </p>
  18292. </dd>
  18293. <dt><samp class="option">name <var class="var">name</var></samp></dt>
  18294. <dd><p>Embed file name into file, if not specified use the output file
  18295. name. The name is truncated to 8 characters.
  18296. </p></dd>
  18297. </dl>
  18298. </div>
  18299. </div>
  18300. <div class="section-level-extent" id="argo_005fcvg">
  18301. <h3 class="section"><span>21.16 argo_cvg<a class="copiable-link" href="#argo_005fcvg"> &para;</a></span></h3>
  18302. <p>Argonaut Games CVG audio muxer.
  18303. </p>
  18304. <p>It accepts a single one-channel ADPCM 22050Hz audio stream.
  18305. </p>
  18306. <p>The <samp class="option">loop</samp> and <samp class="option">reverb</samp> options set the corresponding
  18307. flags in the header which can be later retrieved to process the audio
  18308. stream accordingly.
  18309. </p>
  18310. <ul class="mini-toc">
  18311. <li><a href="#Options-60" accesskey="1">Options</a></li>
  18312. </ul>
  18313. <div class="subsection-level-extent" id="Options-60">
  18314. <h4 class="subsection"><span>21.16.1 Options<a class="copiable-link" href="#Options-60"> &para;</a></span></h4>
  18315. <dl class="table">
  18316. <dt><samp class="option">skip_rate_check <var class="var">bool</var></samp></dt>
  18317. <dd><p>skip sample rate check (default is <code class="code">false</code>)
  18318. </p>
  18319. </dd>
  18320. <dt><samp class="option">loop <var class="var">bool</var></samp></dt>
  18321. <dd><p>set loop flag (default is <code class="code">false</code>)
  18322. </p>
  18323. </dd>
  18324. <dt><samp class="option">reverb <var class="var">boolean</var></samp></dt>
  18325. <dd><p>set reverb flag (default is <code class="code">true</code>)
  18326. </p></dd>
  18327. </dl>
  18328. <a class="anchor" id="asf"></a></div>
  18329. </div>
  18330. <div class="section-level-extent" id="asf_002c-asf_005fstream">
  18331. <h3 class="section"><span>21.17 asf, asf_stream<a class="copiable-link" href="#asf_002c-asf_005fstream"> &para;</a></span></h3>
  18332. <p>Advanced / Active Systems (or Streaming) Format audio muxer.
  18333. </p>
  18334. <p>The &lsquo;<samp class="samp">asf_stream</samp>&rsquo; variant should be selected for streaming.
  18335. </p>
  18336. <p>Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
  18337. muxer too.
  18338. </p>
  18339. <ul class="mini-toc">
  18340. <li><a href="#Options-61" accesskey="1">Options</a></li>
  18341. </ul>
  18342. <div class="subsection-level-extent" id="Options-61">
  18343. <h4 class="subsection"><span>21.17.1 Options<a class="copiable-link" href="#Options-61"> &para;</a></span></h4>
  18344. <dl class="table">
  18345. <dt><samp class="option">packet_size <var class="var">size</var></samp></dt>
  18346. <dd><p>Set the muxer packet size as a number of bytes. By tuning this setting
  18347. you may reduce data fragmentation or muxer overhead depending on your
  18348. source. Default value is <code class="code">3200</code>, minimum is <code class="code">100</code>, maximum
  18349. is <code class="code">64Ki</code>.
  18350. </p></dd>
  18351. </dl>
  18352. </div>
  18353. </div>
  18354. <div class="section-level-extent" id="ass">
  18355. <h3 class="section"><span>21.18 ass<a class="copiable-link" href="#ass"> &para;</a></span></h3>
  18356. <p>ASS/SSA (SubStation Alpha) subtitles muxer.
  18357. </p>
  18358. <p>It accepts a single ASS subtitles stream.
  18359. </p>
  18360. <ul class="mini-toc">
  18361. <li><a href="#Options-62" accesskey="1">Options</a></li>
  18362. </ul>
  18363. <div class="subsection-level-extent" id="Options-62">
  18364. <h4 class="subsection"><span>21.18.1 Options<a class="copiable-link" href="#Options-62"> &para;</a></span></h4>
  18365. <dl class="table">
  18366. <dt><samp class="option">ignore_readorder <var class="var">bool</var></samp></dt>
  18367. <dd><p>Write dialogue events immediately, even if they are out-of-order,
  18368. default is <code class="code">false</code>, otherwise they are cached until the expected
  18369. time event is found.
  18370. </p></dd>
  18371. </dl>
  18372. </div>
  18373. </div>
  18374. <div class="section-level-extent" id="ast">
  18375. <h3 class="section"><span>21.19 ast<a class="copiable-link" href="#ast"> &para;</a></span></h3>
  18376. <p>AST (Audio Stream) muxer.
  18377. </p>
  18378. <p>This format is used to play audio on some Nintendo Wii games.
  18379. </p>
  18380. <p>It accepts a single audio stream.
  18381. </p>
  18382. <p>The <samp class="option">loopstart</samp> and <samp class="option">loopend</samp> options can be used to
  18383. define a section of the file to loop for players honoring such
  18384. options.
  18385. </p>
  18386. <ul class="mini-toc">
  18387. <li><a href="#Options-63" accesskey="1">Options</a></li>
  18388. </ul>
  18389. <div class="subsection-level-extent" id="Options-63">
  18390. <h4 class="subsection"><span>21.19.1 Options<a class="copiable-link" href="#Options-63"> &para;</a></span></h4>
  18391. <dl class="table">
  18392. <dt><samp class="option">loopstart <var class="var">start</var></samp></dt>
  18393. <dd><p>Specify loop start position expressesd in milliseconds, from <code class="code">-1</code>
  18394. to <code class="code">INT_MAX</code>, in case <code class="code">-1</code> is set then no loop is specified
  18395. (default -1) and the <samp class="option">loopend</samp> value is ignored.
  18396. </p>
  18397. </dd>
  18398. <dt><samp class="option">loopend <var class="var">end</var></samp></dt>
  18399. <dd><p>Specify loop end position expressed in milliseconds, from <code class="code">0</code> to
  18400. <code class="code">INT_MAX</code>, default is <code class="code">0</code>, in case <code class="code">0</code> is set it
  18401. assumes the total stream duration.
  18402. </p></dd>
  18403. </dl>
  18404. </div>
  18405. </div>
  18406. <div class="section-level-extent" id="au">
  18407. <h3 class="section"><span>21.20 au<a class="copiable-link" href="#au"> &para;</a></span></h3>
  18408. <p>SUN AU audio muxer.
  18409. </p>
  18410. <p>It accepts a single audio stream.
  18411. </p>
  18412. <a class="anchor" id="avi"></a></div>
  18413. <div class="section-level-extent" id="avi-1">
  18414. <h3 class="section"><span>21.21 avi<a class="copiable-link" href="#avi-1"> &para;</a></span></h3>
  18415. <p>Audio Video Interleaved muxer.
  18416. </p>
  18417. <p>AVI is a proprietary format developed by Microsoft, and later formally specified
  18418. through the Open DML specification.
  18419. </p>
  18420. <p>Because of differences in players implementations, it might be required to set
  18421. some options to make sure that the generated output can be correctly played by
  18422. the target player.
  18423. </p>
  18424. <ul class="mini-toc">
  18425. <li><a href="#Options-64" accesskey="1">Options</a></li>
  18426. </ul>
  18427. <div class="subsection-level-extent" id="Options-64">
  18428. <h4 class="subsection"><span>21.21.1 Options<a class="copiable-link" href="#Options-64"> &para;</a></span></h4>
  18429. <dl class="table">
  18430. <dt><samp class="option">flipped_raw_rgb <var class="var">bool</var></samp></dt>
  18431. <dd><p>If set to <code class="code">true</code>, store positive height for raw RGB bitmaps, which
  18432. indicates bitmap is stored bottom-up. Note that this option does not flip the
  18433. bitmap which has to be done manually beforehand, e.g. by using the &lsquo;<samp class="samp">vflip</samp>&rsquo;
  18434. filter. Default is <code class="code">false</code> and indicates bitmap is stored top down.
  18435. </p>
  18436. </dd>
  18437. <dt><samp class="option">reserve_index_space <var class="var">size</var></samp></dt>
  18438. <dd><p>Reserve the specified amount of bytes for the OpenDML master index of each
  18439. stream within the file header. By default additional master indexes are
  18440. embedded within the data packets if there is no space left in the first master
  18441. index and are linked together as a chain of indexes. This index structure can
  18442. cause problems for some use cases, e.g. third-party software strictly relying
  18443. on the OpenDML index specification or when file seeking is slow. Reserving
  18444. enough index space in the file header avoids these problems.
  18445. </p>
  18446. <p>The required index space depends on the output file size and should be about 16
  18447. bytes per gigabyte. When this option is omitted or set to zero the necessary
  18448. index space is guessed.
  18449. </p>
  18450. <p>Default value is <code class="code">0</code>.
  18451. </p>
  18452. </dd>
  18453. <dt><samp class="option">write_channel_mask <var class="var">bool</var></samp></dt>
  18454. <dd><p>Write the channel layout mask into the audio stream header.
  18455. </p>
  18456. <p>This option is enabled by default. Disabling the channel mask can be useful in
  18457. specific scenarios, e.g. when merging multiple audio streams into one for
  18458. compatibility with software that only supports a single audio stream in AVI
  18459. (see <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#amerge">the &quot;amerge&quot; section in the ffmpeg-filters manual</a>).
  18460. </p></dd>
  18461. </dl>
  18462. </div>
  18463. </div>
  18464. <div class="section-level-extent" id="avif">
  18465. <h3 class="section"><span>21.22 avif<a class="copiable-link" href="#avif"> &para;</a></span></h3>
  18466. <p>AV1 (Alliance for Open Media Video codec 1) image format muxer.
  18467. </p>
  18468. <p>This muxers stores images encoded using the AV1 codec.
  18469. </p>
  18470. <p>It accepts one or two video streams. In case two video streams are
  18471. provided, the second one shall contain a single plane storing the
  18472. alpha mask.
  18473. </p>
  18474. <p>In case more than one image is provided, the generated output is
  18475. considered an animated AVIF and the number of loops can be specified
  18476. with the <samp class="option">loop</samp> option.
  18477. </p>
  18478. <p>This is based on the specification by Alliance for Open Media at url
  18479. <a class="url" href="https://aomediacodec.github.io/av1-avif">https://aomediacodec.github.io/av1-avif</a>.
  18480. </p>
  18481. <ul class="mini-toc">
  18482. <li><a href="#Options-65" accesskey="1">Options</a></li>
  18483. </ul>
  18484. <div class="subsection-level-extent" id="Options-65">
  18485. <h4 class="subsection"><span>21.22.1 Options<a class="copiable-link" href="#Options-65"> &para;</a></span></h4>
  18486. <dl class="table">
  18487. <dt><samp class="option">loop <var class="var">count</var></samp></dt>
  18488. <dd><p>number of times to loop an animated AVIF, <code class="code">0</code> specify an infinite
  18489. loop, default is <code class="code">0</code>
  18490. </p>
  18491. </dd>
  18492. <dt><samp class="option">movie_timescale <var class="var">timescale</var></samp></dt>
  18493. <dd><p>Set the timescale written in the movie header box (<code class="code">mvhd</code>).
  18494. Range is 1 to INT_MAX. Default is <code class="code">1000</code>.
  18495. </p></dd>
  18496. </dl>
  18497. </div>
  18498. </div>
  18499. <div class="section-level-extent" id="avm2">
  18500. <h3 class="section"><span>21.23 avm2<a class="copiable-link" href="#avm2"> &para;</a></span></h3>
  18501. <p>ShockWave Flash (SWF) / ActionScript Virtual Machine 2 (AVM2) format muxer.
  18502. </p>
  18503. <p>It accepts one audio stream, one video stream, or both.
  18504. </p>
  18505. </div>
  18506. <div class="section-level-extent" id="bit">
  18507. <h3 class="section"><span>21.24 bit<a class="copiable-link" href="#bit"> &para;</a></span></h3>
  18508. <p>G.729 (.bit) file format muxer.
  18509. </p>
  18510. <p>It accepts a single G.729 audio stream.
  18511. </p>
  18512. </div>
  18513. <div class="section-level-extent" id="caf">
  18514. <h3 class="section"><span>21.25 caf<a class="copiable-link" href="#caf"> &para;</a></span></h3>
  18515. <p>Apple CAF (Core Audio Format) muxer.
  18516. </p>
  18517. <p>It accepts a single audio stream.
  18518. </p>
  18519. </div>
  18520. <div class="section-level-extent" id="codec2">
  18521. <h3 class="section"><span>21.26 codec2<a class="copiable-link" href="#codec2"> &para;</a></span></h3>
  18522. <p>Codec2 audio audio muxer.
  18523. </p>
  18524. <p>It accepts a single codec2 audio stream.
  18525. </p>
  18526. <a class="anchor" id="chromaprint"></a></div>
  18527. <div class="section-level-extent" id="chromaprint-1">
  18528. <h3 class="section"><span>21.27 chromaprint<a class="copiable-link" href="#chromaprint-1"> &para;</a></span></h3>
  18529. <p>Chromaprint fingerprinter muxers.
  18530. </p>
  18531. <p>To enable compilation of this filter you need to configure FFmpeg with
  18532. <code class="code">--enable-chromaprint</code>.
  18533. </p>
  18534. <p>This muxer feeds audio data to the Chromaprint library, which
  18535. generates a fingerprint for the provided audio data. See:
  18536. <a class="url" href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>
  18537. </p>
  18538. <p>It takes a single signed native-endian 16-bit raw audio stream of at
  18539. most 2 channels.
  18540. </p>
  18541. <ul class="mini-toc">
  18542. <li><a href="#Options-66" accesskey="1">Options</a></li>
  18543. </ul>
  18544. <div class="subsection-level-extent" id="Options-66">
  18545. <h4 class="subsection"><span>21.27.1 Options<a class="copiable-link" href="#Options-66"> &para;</a></span></h4>
  18546. <dl class="table">
  18547. <dt><samp class="option">algorithm <var class="var">version</var></samp></dt>
  18548. <dd><p>Select version of algorithm to fingerprint with. Range is <code class="code">0</code> to
  18549. <code class="code">4</code>. Version <code class="code">3</code> enables silence detection. Default is <code class="code">1</code>.
  18550. </p>
  18551. </dd>
  18552. <dt><samp class="option">fp_format <var class="var">format</var></samp></dt>
  18553. <dd><p>Format to output the fingerprint as. Accepts the following options:
  18554. </p><dl class="table">
  18555. <dt>&lsquo;<samp class="samp">base64</samp>&rsquo;</dt>
  18556. <dd><p>Base64 compressed fingerprint <em class="emph">(default)</em>
  18557. </p>
  18558. </dd>
  18559. <dt>&lsquo;<samp class="samp">compressed</samp>&rsquo;</dt>
  18560. <dd><p>Binary compressed fingerprint
  18561. </p>
  18562. </dd>
  18563. <dt>&lsquo;<samp class="samp">raw</samp>&rsquo;</dt>
  18564. <dd><p>Binary raw fingerprint
  18565. </p></dd>
  18566. </dl>
  18567. </dd>
  18568. <dt><samp class="option">silence_threshold <var class="var">threshold</var></samp></dt>
  18569. <dd><p>Threshold for detecting silence. Range is from <code class="code">-1</code> to
  18570. <code class="code">32767</code>, where <code class="code">-1</code> disables silence detection. Silence
  18571. detection can only be used with version <code class="code">3</code> of the algorithm.
  18572. </p>
  18573. <p>Silence detection must be disabled for use with the AcoustID
  18574. service. Default is <code class="code">-1</code>.
  18575. </p></dd>
  18576. </dl>
  18577. <a class="anchor" id="crc"></a></div>
  18578. </div>
  18579. <div class="section-level-extent" id="crc-1">
  18580. <h3 class="section"><span>21.28 crc<a class="copiable-link" href="#crc-1"> &para;</a></span></h3>
  18581. <p>CRC (Cyclic Redundancy Check) muxer.
  18582. </p>
  18583. <p>This muxer computes and prints the Adler-32 CRC of all the input audio
  18584. and video frames. By default audio frames are converted to signed
  18585. 16-bit raw audio and video frames to raw video before computing the
  18586. CRC.
  18587. </p>
  18588. <p>The output of the muxer consists of a single line of the form:
  18589. CRC=0x<var class="var">CRC</var>, where <var class="var">CRC</var> is a hexadecimal number 0-padded to
  18590. 8 digits containing the CRC for all the decoded input frames.
  18591. </p>
  18592. <p>See also the <a class="ref" href="#framecrc">framecrc</a> muxer.
  18593. </p>
  18594. <ul class="mini-toc">
  18595. <li><a href="#Examples-13" accesskey="1">Examples</a></li>
  18596. </ul>
  18597. <div class="subsection-level-extent" id="Examples-13">
  18598. <h4 class="subsection"><span>21.28.1 Examples<a class="copiable-link" href="#Examples-13"> &para;</a></span></h4>
  18599. <ul class="itemize mark-bullet">
  18600. <li>Use <code class="command">ffmpeg</code> to compute the CRC of the input, and store it in
  18601. the file <samp class="file">out.crc</samp>:
  18602. <div class="example">
  18603. <pre class="example-preformatted">ffmpeg -i INPUT -f crc out.crc
  18604. </pre></div>
  18605. </li><li>Use <code class="command">ffmpeg</code> to print the CRC to stdout with the command:
  18606. <div class="example">
  18607. <pre class="example-preformatted">ffmpeg -i INPUT -f crc -
  18608. </pre></div>
  18609. </li><li>You can select the output format of each frame with <code class="command">ffmpeg</code> by
  18610. specifying the audio and video codec and format. For example, to
  18611. compute the CRC of the input audio converted to PCM unsigned 8-bit
  18612. and the input video converted to MPEG-2 video, use the command:
  18613. <div class="example">
  18614. <pre class="example-preformatted">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  18615. </pre></div>
  18616. </li></ul>
  18617. <a class="anchor" id="dash"></a></div>
  18618. </div>
  18619. <div class="section-level-extent" id="dash-2">
  18620. <h3 class="section"><span>21.29 dash<a class="copiable-link" href="#dash-2"> &para;</a></span></h3>
  18621. <p>Dynamic Adaptive Streaming over HTTP (DASH) muxer.
  18622. </p>
  18623. <p>This muxer creates segments and manifest files according to the
  18624. MPEG-DASH standard ISO/IEC 23009-1:2014 and following standard
  18625. updates.
  18626. </p>
  18627. <p>For more information see:
  18628. </p><ul class="itemize mark-bullet">
  18629. <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>
  18630. </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>
  18631. </li></ul>
  18632. <p>This muxer creates an MPD (Media Presentation Description) manifest
  18633. file and segment files for each stream. Segment files are placed in
  18634. the same directory of the MPD manifest file.
  18635. </p>
  18636. <p>The segment filename might contain pre-defined identifiers used in the
  18637. manifest <code class="code">SegmentTemplate</code> section as defined in section
  18638. 5.3.9.4.4 of the standard.
  18639. </p>
  18640. <p>Available identifiers are <code class="code">$RepresentationID$</code>, <code class="code">$Number$</code>,
  18641. <code class="code">$Bandwidth$</code>, and <code class="code">$Time$</code>. In addition to the standard
  18642. identifiers, an ffmpeg-specific <code class="code">$ext$</code> identifier is also
  18643. supported. When specified, <code class="command">ffmpeg</code> will replace <code class="code">$ext$</code>
  18644. in the file name with muxing format&rsquo;s extensions such as <code class="code">mp4</code>,
  18645. <code class="code">webm</code> etc.
  18646. </p>
  18647. <ul class="mini-toc">
  18648. <li><a href="#Options-67" accesskey="1">Options</a></li>
  18649. <li><a href="#Example" accesskey="2">Example</a></li>
  18650. </ul>
  18651. <div class="subsection-level-extent" id="Options-67">
  18652. <h4 class="subsection"><span>21.29.1 Options<a class="copiable-link" href="#Options-67"> &para;</a></span></h4>
  18653. <dl class="table">
  18654. <dt><samp class="option">adaptation_sets <var class="var">adaptation_sets</var></samp></dt>
  18655. <dd><p>Assign streams to adaptation sets, specified in the MPD manifest
  18656. <code class="code">AdaptationSets</code> section.
  18657. </p>
  18658. <p>An adaptation set contains a set of one or more streams accessed as a
  18659. single subset, e.g. corresponding streams encoded at different size
  18660. selectable by the user depending on the available bandwidth, or to
  18661. different audio streams with a different language.
  18662. </p>
  18663. <p>Each adaptation set is specified with the syntax:
  18664. </p><div class="example">
  18665. <pre class="example-preformatted">id=<var class="var">index</var>,streams=<var class="var">streams</var>
  18666. </pre></div>
  18667. <p>where <var class="var">index</var> must be a numerical index, and <var class="var">streams</var> is a
  18668. sequence of <code class="code">,</code>-separated stream indices. Multiple adaptation
  18669. sets can be specified, separated by spaces.
  18670. </p>
  18671. <p>To map all video (or audio) streams to an adaptation set, <code class="code">v</code> (or
  18672. <code class="code">a</code>) can be used as stream identifier instead of IDs.
  18673. </p>
  18674. <p>When no assignment is defined, this defaults to an adaptation set for
  18675. each stream.
  18676. </p>
  18677. <p>The following optional fields can also be specified:
  18678. </p>
  18679. <dl class="table">
  18680. <dt><samp class="option">descriptor</samp></dt>
  18681. <dd><p>Define the descriptor as defined by ISO/IEC 23009-1:2014/Amd.2:2015.
  18682. </p>
  18683. <p>For example:
  18684. </p><div class="example">
  18685. <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;
  18686. </pre></div>
  18687. <p>The descriptor string should be a self-closing XML tag.
  18688. </p>
  18689. </dd>
  18690. <dt><samp class="option">frag_duration</samp></dt>
  18691. <dd><p>Override the global fragment duration specified with the
  18692. <samp class="option">frag_duration</samp> option.
  18693. </p>
  18694. </dd>
  18695. <dt><samp class="option">frag_type</samp></dt>
  18696. <dd><p>Override the global fragment type specified with the
  18697. <samp class="option">frag_type</samp> option.
  18698. </p>
  18699. </dd>
  18700. <dt><samp class="option">seg_duration</samp></dt>
  18701. <dd><p>Override the global segment duration specified with the
  18702. <samp class="option">seg_duration</samp> option.
  18703. </p>
  18704. </dd>
  18705. <dt><samp class="option">trick_id</samp></dt>
  18706. <dd><p>Mark an adaptation set as containing streams meant to be used for
  18707. Trick Mode for the referenced adaptation set.
  18708. </p></dd>
  18709. </dl>
  18710. <p>A few examples of possible values for the <samp class="option">adaptation_sets</samp>
  18711. option follow:
  18712. </p><div class="example">
  18713. <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
  18714. </pre></div>
  18715. <div class="example">
  18716. <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
  18717. </pre></div>
  18718. </dd>
  18719. <dt><samp class="option">dash_segment_type <var class="var">type</var></samp></dt>
  18720. <dd><p>Set DASH segment files type.
  18721. </p>
  18722. <p>Possible values:
  18723. </p><dl class="table">
  18724. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  18725. <dd><p>The dash segment files format will be selected based on the stream
  18726. codec. This is the default mode.
  18727. </p></dd>
  18728. <dt>&lsquo;<samp class="samp">mp4</samp>&rsquo;</dt>
  18729. <dd><p>the dash segment files will be in ISOBMFF/MP4 format
  18730. </p></dd>
  18731. <dt>&lsquo;<samp class="samp">webm</samp>&rsquo;</dt>
  18732. <dd><p>the dash segment files will be in WebM format
  18733. </p></dd>
  18734. </dl>
  18735. </dd>
  18736. <dt><samp class="option">extra_window_size <var class="var">size</var></samp></dt>
  18737. <dd><p>Set the maximum number of segments kept outside of the manifest before
  18738. removing from disk.
  18739. </p>
  18740. </dd>
  18741. <dt><samp class="option">format_options <var class="var">options_list</var></samp></dt>
  18742. <dd><p>Set container format (mp4/webm) options using a <code class="code">:</code>-separated list of
  18743. key=value parameters. Values containing <code class="code">:</code> special characters must be
  18744. escaped.
  18745. </p>
  18746. </dd>
  18747. <dt><samp class="option">frag_duration <var class="var">duration</var></samp></dt>
  18748. <dd><p>Set the length in seconds of fragments within segments, fractional
  18749. value can also be set.
  18750. </p>
  18751. </dd>
  18752. <dt><samp class="option">frag_type <var class="var">type</var></samp></dt>
  18753. <dd><p>Set the type of interval for fragmentation.
  18754. </p>
  18755. <p>Possible values:
  18756. </p><dl class="table">
  18757. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  18758. <dd><p>set one fragment per segment
  18759. </p>
  18760. </dd>
  18761. <dt>&lsquo;<samp class="samp">every_frame</samp>&rsquo;</dt>
  18762. <dd><p>fragment at every frame
  18763. </p>
  18764. </dd>
  18765. <dt>&lsquo;<samp class="samp">duration</samp>&rsquo;</dt>
  18766. <dd><p>fragment at specific time intervals
  18767. </p>
  18768. </dd>
  18769. <dt>&lsquo;<samp class="samp">pframes</samp>&rsquo;</dt>
  18770. <dd><p>fragment at keyframes and following P-Frame reordering (Video only,
  18771. experimental)
  18772. </p></dd>
  18773. </dl>
  18774. </dd>
  18775. <dt><samp class="option">global_sidx <var class="var">bool</var></samp></dt>
  18776. <dd><p>Write global <code class="code">SIDX</code> atom. Applicable only for single file, mp4
  18777. output, non-streaming mode.
  18778. </p>
  18779. </dd>
  18780. <dt><samp class="option">hls_master_name <var class="var">file_name</var></samp></dt>
  18781. <dd><p>HLS master playlist name. Default is <samp class="file">master.m3u8</samp>.
  18782. </p>
  18783. </dd>
  18784. <dt><samp class="option">hls_playlist <var class="var">bool</var></samp></dt>
  18785. <dd><p>Generate HLS playlist files. The master playlist is generated with
  18786. filename specified by the <samp class="option">hls_master_name</samp> option. One media
  18787. playlist file is generated for each stream with filenames
  18788. <samp class="file">media_0.m3u8</samp>, <samp class="file">media_1.m3u8</samp>, etc.
  18789. </p>
  18790. </dd>
  18791. <dt><samp class="option">http_opts <var class="var">http_opts</var></samp></dt>
  18792. <dd><p>Specify a list of <code class="code">:</code>-separated key=value options to pass to the
  18793. underlying HTTP protocol. Applicable only for HTTP output.
  18794. </p>
  18795. </dd>
  18796. <dt><samp class="option">http_persistent <var class="var">bool</var></samp></dt>
  18797. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  18798. </p>
  18799. </dd>
  18800. <dt><samp class="option">http_user_agent <var class="var">user_agent</var></samp></dt>
  18801. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP
  18802. output.
  18803. </p>
  18804. </dd>
  18805. <dt><samp class="option">ignore_io_errors <var class="var">bool</var></samp></dt>
  18806. <dd><p>Ignore IO errors during open and write. Useful for long-duration runs
  18807. with network output. This is disabled by default.
  18808. </p>
  18809. </dd>
  18810. <dt><samp class="option">index_correction <var class="var">bool</var></samp></dt>
  18811. <dd><p>Enable or disable segment index correction logic. Applicable only when
  18812. <samp class="option">use_template</samp> is enabled and <samp class="option">use_timeline</samp> is
  18813. disabled. This is disabled by default.
  18814. </p>
  18815. <p>When enabled, the logic monitors the flow of segment indexes. If a
  18816. streams&rsquo;s segment index value is not at the expected real time
  18817. position, then the logic corrects that index value.
  18818. </p>
  18819. <p>Typically this logic is needed in live streaming use cases. The
  18820. network bandwidth fluctuations are common during long run
  18821. streaming. Each fluctuation can cause the segment indexes fall behind
  18822. the expected real time position.
  18823. </p>
  18824. </dd>
  18825. <dt><samp class="option">init_seg_name <var class="var">init_name</var></samp></dt>
  18826. <dd><p>DASH-templated name to use for the initialization segment. Default is
  18827. <code class="code">init-stream$RepresentationID$.$ext$</code>. <code class="code">$ext$</code> is replaced
  18828. with the file name extension specific for the segment format.
  18829. </p>
  18830. </dd>
  18831. <dt><samp class="option">ldash <var class="var">bool</var></samp></dt>
  18832. <dd><p>Enable Low-latency Dash by constraining the presence and values of
  18833. some elements. This is disabled by default.
  18834. </p>
  18835. </dd>
  18836. <dt><samp class="option">lhls <var class="var">bool</var></samp></dt>
  18837. <dd><p>Enable Low-latency HLS (LHLS). Add <code class="code">#EXT-X-PREFETCH</code> tag with
  18838. current segment&rsquo;s URI. hls.js player folks are trying to standardize
  18839. an open LHLS spec. The draft spec is available at
  18840. <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>.
  18841. </p>
  18842. <p>This option tries to comply with the above open spec. It enables
  18843. <samp class="option">streaming</samp> and <samp class="option">hls_playlist</samp> options automatically.
  18844. This is an experimental feature.
  18845. </p>
  18846. <p>Note: This is not Apple&rsquo;s version LHLS. See
  18847. <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>
  18848. </p>
  18849. </dd>
  18850. <dt><samp class="option">master_m3u8_publish_rate <var class="var">segment_intervals_count</var></samp></dt>
  18851. <dd><p>Publish master playlist repeatedly every after specified number of
  18852. segment intervals.
  18853. </p>
  18854. </dd>
  18855. <dt><samp class="option">max_playback_rate <var class="var">rate</var></samp></dt>
  18856. <dd><p>Set the maximum playback rate indicated as appropriate for the
  18857. purposes of automatically adjusting playback latency and buffer
  18858. occupancy during normal playback by clients.
  18859. </p>
  18860. </dd>
  18861. <dt><samp class="option">media_seg_name <var class="var">segment_name</var></samp></dt>
  18862. <dd><p>DASH-templated name to use for the media segments. Default is
  18863. <code class="code">chunk-stream$RepresentationID$-$Number%05d$.$ext$</code>. <code class="code">$ext$</code>
  18864. is replaced with the file name extension specific for the segment
  18865. format.
  18866. </p>
  18867. </dd>
  18868. <dt><samp class="option">method <var class="var">method</var></samp></dt>
  18869. <dd><p>Use the given HTTP method to create output files. Generally set to <code class="code">PUT</code>
  18870. or <code class="code">POST</code>.
  18871. </p>
  18872. </dd>
  18873. <dt><samp class="option">min_playback_rate <var class="var">rate</var></samp></dt>
  18874. <dd><p>Set the minimum playback rate indicated as appropriate for the
  18875. purposes of automatically adjusting playback latency and buffer
  18876. occupancy during normal playback by clients.
  18877. </p>
  18878. </dd>
  18879. <dt><samp class="option">mpd_profile <var class="var">flags</var></samp></dt>
  18880. <dd><p>Set one or more MPD manifest profiles.
  18881. </p>
  18882. <p>Possible values:
  18883. </p><dl class="table">
  18884. <dt>&lsquo;<samp class="samp">dash</samp>&rsquo;</dt>
  18885. <dd><p>MPEG-DASH ISO Base media file format live profile
  18886. </p></dd>
  18887. <dt>&lsquo;<samp class="samp">dvb_dash</samp>&rsquo;</dt>
  18888. <dd><p>DVB-DASH profile
  18889. </p></dd>
  18890. </dl>
  18891. <p>Default value is <code class="code">dash</code>.
  18892. </p>
  18893. </dd>
  18894. <dt><samp class="option">remove_at_exit <var class="var">bool</var></samp></dt>
  18895. <dd><p>Enable or disable removal of all segments when finished. This is
  18896. disabled by default.
  18897. </p>
  18898. </dd>
  18899. <dt><samp class="option">seg_duration <var class="var">duration</var></samp></dt>
  18900. <dd><p>Set the segment length in seconds (fractional value can be set). The
  18901. value is treated as average segment duration when the
  18902. <samp class="option">use_template</samp> option is enabled and the <samp class="option">use_timeline</samp>
  18903. option is disabled and as minimum segment duration for all the other
  18904. use cases.
  18905. </p>
  18906. <p>Default value is <code class="code">5</code>.
  18907. </p>
  18908. </dd>
  18909. <dt><samp class="option">single_file <var class="var">bool</var></samp></dt>
  18910. <dd><p>Enable or disable storing all segments in one file, accessed using
  18911. byte ranges. This is disabled by default.
  18912. </p>
  18913. <p>The name of the single file can be specified with the
  18914. <samp class="option">single_file_name</samp> option, if not specified assume the basename
  18915. of the manifest file with the output format extension.
  18916. </p>
  18917. </dd>
  18918. <dt><samp class="option">single_file_name <var class="var">file_name</var></samp></dt>
  18919. <dd><p>DASH-templated name to use for the manifest <code class="code">baseURL</code>
  18920. element. Imply that the <samp class="option">single_file</samp> option is set to
  18921. <var class="var">true</var>. In the template, <code class="code">$ext$</code> is replaced with the file
  18922. name extension specific for the segment format.
  18923. </p>
  18924. </dd>
  18925. <dt><samp class="option">streaming <var class="var">bool</var></samp></dt>
  18926. <dd><p>Enable or disable chunk streaming mode of output. In chunk streaming
  18927. mode, each frame will be a <code class="code">moof</code> fragment which forms a
  18928. chunk. This is disabled by default.
  18929. </p>
  18930. </dd>
  18931. <dt><samp class="option">target_latency <var class="var">target_latency</var></samp></dt>
  18932. <dd><p>Set an intended target latency in seconds for serving (fractional
  18933. value can be set). Applicable only when the <samp class="option">streaming</samp> and
  18934. <samp class="option">write_prft</samp> options are enabled. This is an informative fields
  18935. clients can use to measure the latency of the service.
  18936. </p>
  18937. </dd>
  18938. <dt><samp class="option">timeout <var class="var">timeout</var></samp></dt>
  18939. <dd><p>Set timeout for socket I/O operations expressed in seconds (fractional
  18940. value can be set). Applicable only for HTTP output.
  18941. </p>
  18942. </dd>
  18943. <dt><samp class="option">update_period <var class="var">period</var></samp></dt>
  18944. <dd><p>Set the MPD update period, for dynamic content. The unit is
  18945. second. If set to <code class="code">0</code>, the period is automatically computed.
  18946. </p>
  18947. <p>Default value is <code class="code">0</code>.
  18948. </p>
  18949. </dd>
  18950. <dt><samp class="option">use_template <var class="var">bool</var></samp></dt>
  18951. <dd><p>Enable or disable use of <code class="code">SegmentTemplate</code> instead of
  18952. <code class="code">SegmentList</code> in the manifest. This is enabled by default.
  18953. </p>
  18954. </dd>
  18955. <dt><samp class="option">use_timeline <var class="var">bool</var></samp></dt>
  18956. <dd><p>Enable or disable use of <code class="code">SegmentTimeline</code> within the
  18957. <code class="code">SegmentTemplate</code> manifest section. This is enabled by default.
  18958. </p>
  18959. </dd>
  18960. <dt><samp class="option">utc_timing_url <var class="var">url</var></samp></dt>
  18961. <dd><p>URL of the page that will return the UTC timestamp in ISO
  18962. format, for example <code class="code">https://time.akamai.com/?iso</code>
  18963. </p>
  18964. </dd>
  18965. <dt><samp class="option">window_size <var class="var">size</var></samp></dt>
  18966. <dd><p>Set the maximum number of segments kept in the manifest, discard the
  18967. oldest one. This is useful for live streaming.
  18968. </p>
  18969. <p>If the value is <code class="code">0</code>, all segments are kept in the
  18970. manifest. Default value is <code class="code">0</code>.
  18971. </p>
  18972. </dd>
  18973. <dt><samp class="option">write_prft <var class="var">write_prft</var></samp></dt>
  18974. <dd><p>Write Producer Reference Time elements on supported streams. This also
  18975. enables writing prft boxes in the underlying muxer. Applicable only
  18976. when the <var class="var">utc_url</var> option is enabled. It is set to <var class="var">auto</var> by
  18977. default, in which case the muxer will attempt to enable it only in
  18978. modes that require it.
  18979. </p></dd>
  18980. </dl>
  18981. </div>
  18982. <div class="subsection-level-extent" id="Example">
  18983. <h4 class="subsection"><span>21.29.2 Example<a class="copiable-link" href="#Example"> &para;</a></span></h4>
  18984. <p>Generate a DASH output reading from an input source in realtime using
  18985. <code class="command">ffmpeg</code>.
  18986. </p>
  18987. <p>Two multimedia streams are generated from the input file, both
  18988. containing a video stream encoded through &lsquo;<samp class="samp">libx264</samp>&rsquo;, and an audio
  18989. stream encoded with &lsquo;<samp class="samp">libfdk_aac</samp>&rsquo;. The first multimedia stream
  18990. contains video with a bitrate of 800k and audio at the default rate,
  18991. the second with video scaled to 320x170 pixels at 300k and audio
  18992. resampled at 22005 Hz.
  18993. </p>
  18994. <p>The <samp class="option">window_size</samp> option keeps only the latest 5 segments with
  18995. the default duration of 5 seconds.
  18996. </p>
  18997. <div class="example">
  18998. <pre class="example-preformatted">ffmpeg -re -i &lt;input&gt; -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
  18999. -b:v:0 800k -profile:v:0 main \
  19000. -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -ar:a:1 22050 \
  19001. -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 \
  19002. -use_timeline 1 -use_template 1 -window_size 5 \
  19003. -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; \
  19004. -f dash /path/to/out.mpd
  19005. </pre></div>
  19006. </div>
  19007. </div>
  19008. <div class="section-level-extent" id="daud">
  19009. <h3 class="section"><span>21.30 daud<a class="copiable-link" href="#daud"> &para;</a></span></h3>
  19010. <p>D-Cinema audio muxer.
  19011. </p>
  19012. <p>It accepts a single 6-channels audio stream resampled at 96000 Hz
  19013. encoded with the &lsquo;<samp class="samp">pcm_24daud</samp>&rsquo; codec.
  19014. </p>
  19015. <ul class="mini-toc">
  19016. <li><a href="#Example-1" accesskey="1">Example</a></li>
  19017. </ul>
  19018. <div class="subsection-level-extent" id="Example-1">
  19019. <h4 class="subsection"><span>21.30.1 Example<a class="copiable-link" href="#Example-1"> &para;</a></span></h4>
  19020. <p>Use <code class="command">ffmpeg</code> to mux input audio to a &lsquo;<samp class="samp">5.1</samp>&rsquo; channel layout
  19021. resampled at 96000Hz:
  19022. </p><div class="example">
  19023. <pre class="example-preformatted">ffmpeg -i INPUT -af aresample=96000,pan=5.1 slow.302
  19024. </pre></div>
  19025. <p>For ffmpeg versions before 7.0 you might have to use the &lsquo;<samp class="samp">asetnsamples</samp>&rsquo;
  19026. filter to limit the muxed packet size, because this format does not support
  19027. muxing packets larger than 65535 bytes (3640 samples). For newer ffmpeg
  19028. versions audio is automatically packetized to 36000 byte (2000 sample) packets.
  19029. </p>
  19030. </div>
  19031. </div>
  19032. <div class="section-level-extent" id="dv">
  19033. <h3 class="section"><span>21.31 dv<a class="copiable-link" href="#dv"> &para;</a></span></h3>
  19034. <p>DV (Digital Video) muxer.
  19035. </p>
  19036. <p>It accepts exactly one &lsquo;<samp class="samp">dvvideo</samp>&rsquo; video stream and at most two
  19037. &lsquo;<samp class="samp">pcm_s16</samp>&rsquo; audio streams. More constraints are defined by the
  19038. property of the video, which must correspond to a DV video supported
  19039. profile, and on the framerate.
  19040. </p>
  19041. <ul class="mini-toc">
  19042. <li><a href="#Example-2" accesskey="1">Example</a></li>
  19043. </ul>
  19044. <div class="subsection-level-extent" id="Example-2">
  19045. <h4 class="subsection"><span>21.31.1 Example<a class="copiable-link" href="#Example-2"> &para;</a></span></h4>
  19046. <p>Use <code class="command">ffmpeg</code> to convert the input:
  19047. </p><div class="example">
  19048. <pre class="example-preformatted">ffmpeg -i INPUT -s:v 720x480 -pix_fmt yuv411p -r 29.97 -ac 2 -ar 48000 -y out.dv
  19049. </pre></div>
  19050. </div>
  19051. </div>
  19052. <div class="section-level-extent" id="ffmetadata">
  19053. <h3 class="section"><span>21.32 ffmetadata<a class="copiable-link" href="#ffmetadata"> &para;</a></span></h3>
  19054. <p>FFmpeg metadata muxer.
  19055. </p>
  19056. <p>This muxer writes the streams metadata in the &lsquo;<samp class="samp">ffmetadata</samp>&rsquo;
  19057. format.
  19058. </p>
  19059. <p>See <a data-manual="ffmpeg-formats" href="ffmpeg-formats.html#metadata">the Metadata chapter</a> for
  19060. information about the format.
  19061. </p>
  19062. <ul class="mini-toc">
  19063. <li><a href="#Example-3" accesskey="1">Example</a></li>
  19064. </ul>
  19065. <div class="subsection-level-extent" id="Example-3">
  19066. <h4 class="subsection"><span>21.32.1 Example<a class="copiable-link" href="#Example-3"> &para;</a></span></h4>
  19067. <p>Use <code class="command">ffmpeg</code> to extract metadata from an input file to a <samp class="file">metadata.ffmeta</samp>
  19068. file in &lsquo;<samp class="samp">ffmetadata</samp>&rsquo; format:
  19069. </p><div class="example">
  19070. <pre class="example-preformatted">ffmpeg -i INPUT -f ffmetadata metadata.ffmeta
  19071. </pre></div>
  19072. <a class="anchor" id="fifo"></a></div>
  19073. </div>
  19074. <div class="section-level-extent" id="fifo-1">
  19075. <h3 class="section"><span>21.33 fifo<a class="copiable-link" href="#fifo-1"> &para;</a></span></h3>
  19076. <p>FIFO (First-In First-Out) muxer.
  19077. </p>
  19078. <p>The &lsquo;<samp class="samp">fifo</samp>&rsquo; pseudo-muxer allows the separation of encoding and
  19079. muxing by using a first-in-first-out queue and running the actual muxer
  19080. in a separate thread.
  19081. </p>
  19082. <p>This is especially useful in combination with
  19083. the <a class="ref" href="#tee">tee</a> muxer and can be used to send data to several
  19084. destinations with different reliability/writing speed/latency.
  19085. </p>
  19086. <p>The target muxer is either selected from the output name or specified
  19087. through the <samp class="option">fifo_format</samp> option.
  19088. </p>
  19089. <p>The behavior of the &lsquo;<samp class="samp">fifo</samp>&rsquo; muxer if the queue fills up or if the
  19090. output fails (e.g. if a packet cannot be written to the output) is
  19091. selectable:
  19092. </p><ul class="itemize mark-bullet">
  19093. <li>Output can be transparently restarted with configurable delay between
  19094. retries based on real time or time of the processed stream.
  19095. </li><li>Encoding can be blocked during temporary failure, or continue transparently
  19096. dropping packets in case the FIFO queue fills up.
  19097. </li></ul>
  19098. <p>API users should be aware that callback functions
  19099. (<code class="code">interrupt_callback</code>, <code class="code">io_open</code> and <code class="code">io_close</code>) used
  19100. within its <code class="code">AVFormatContext</code> must be thread-safe.
  19101. </p>
  19102. <ul class="mini-toc">
  19103. <li><a href="#Options-68" accesskey="1">Options</a></li>
  19104. <li><a href="#Example-4" accesskey="2">Example</a></li>
  19105. </ul>
  19106. <div class="subsection-level-extent" id="Options-68">
  19107. <h4 class="subsection"><span>21.33.1 Options<a class="copiable-link" href="#Options-68"> &para;</a></span></h4>
  19108. <dl class="table">
  19109. <dt><samp class="option">attempt_recovery <var class="var">bool</var></samp></dt>
  19110. <dd><p>If failure occurs, attempt to recover the output. This is especially
  19111. useful when used with network output, since it makes it possible to
  19112. restart streaming transparently. By default this option is set to
  19113. <code class="code">false</code>.
  19114. </p>
  19115. </dd>
  19116. <dt><samp class="option">drop_pkts_on_overflow <var class="var">bool</var></samp></dt>
  19117. <dd><p>If set to <code class="code">true</code>, in case the fifo queue fills up, packets will
  19118. be dropped rather than blocking the encoder. This makes it possible to
  19119. continue streaming without delaying the input, at the cost of omitting
  19120. part of the stream. By default this option is set to <code class="code">false</code>, so in
  19121. such cases the encoder will be blocked until the muxer processes some
  19122. of the packets and none of them is lost.
  19123. </p>
  19124. </dd>
  19125. <dt><samp class="option">fifo_format <var class="var">format_name</var></samp></dt>
  19126. <dd><p>Specify the format name. Useful if it cannot be guessed from the
  19127. output name suffix.
  19128. </p>
  19129. </dd>
  19130. <dt><samp class="option">format_opts <var class="var">options</var></samp></dt>
  19131. <dd><p>Specify format options for the underlying muxer. Muxer options can be
  19132. specified as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;.
  19133. </p>
  19134. </dd>
  19135. <dt><samp class="option">max_recovery_attempts <var class="var">count</var></samp></dt>
  19136. <dd><p>Set maximum number of successive unsuccessful recovery attempts after
  19137. which the output fails permanently. By default this option is set to
  19138. <code class="code">0</code> (unlimited).
  19139. </p>
  19140. </dd>
  19141. <dt><samp class="option">queue_size <var class="var">size</var></samp></dt>
  19142. <dd><p>Specify size of the queue as a number of packets. Default value is
  19143. <code class="code">60</code>.
  19144. </p>
  19145. </dd>
  19146. <dt><samp class="option">recover_any_error <var class="var">bool</var></samp></dt>
  19147. <dd><p>If set to <code class="code">true</code>, recovery will be attempted regardless of type
  19148. of the error causing the failure. By default this option is set to
  19149. <code class="code">false</code> and in case of certain (usually permanent) errors the
  19150. recovery is not attempted even when the <samp class="option">attempt_recovery</samp>
  19151. option is set to <code class="code">true</code>.
  19152. </p>
  19153. </dd>
  19154. <dt><samp class="option">recovery_wait_streamtime <var class="var">bool</var></samp></dt>
  19155. <dd><p>If set to <code class="code">false</code>, the real time is used when waiting for the
  19156. recovery attempt (i.e. the recovery will be attempted after the time
  19157. specified by the <samp class="option">recovery_wait_time</samp> option).
  19158. </p>
  19159. <p>If set to <code class="code">true</code>, the time of the processed stream is taken into
  19160. account instead (i.e. the recovery will be attempted after discarding
  19161. the packets corresponding to the <samp class="option">recovery_wait_time</samp> option).
  19162. </p>
  19163. <p>By default this option is set to <code class="code">false</code>.
  19164. </p>
  19165. </dd>
  19166. <dt><samp class="option">recovery_wait_time <var class="var">duration</var></samp></dt>
  19167. <dd><p>Specify waiting time in seconds before the next recovery attempt after
  19168. previous unsuccessful recovery attempt. Default value is <code class="code">5</code>.
  19169. </p>
  19170. </dd>
  19171. <dt><samp class="option">restart_with_keyframe <var class="var">bool</var></samp></dt>
  19172. <dd><p>Specify whether to wait for the keyframe after recovering from
  19173. queue overflow or failure. This option is set to <code class="code">false</code> by default.
  19174. </p>
  19175. </dd>
  19176. <dt><samp class="option">timeshift <var class="var">duration</var></samp></dt>
  19177. <dd><p>Buffer the specified amount of packets and delay writing the
  19178. output. Note that the value of the <samp class="option">queue_size</samp> option must be
  19179. big enough to store the packets for timeshift. At the end of the input
  19180. the fifo buffer is flushed at realtime speed.
  19181. </p></dd>
  19182. </dl>
  19183. </div>
  19184. <div class="subsection-level-extent" id="Example-4">
  19185. <h4 class="subsection"><span>21.33.2 Example<a class="copiable-link" href="#Example-4"> &para;</a></span></h4>
  19186. <p>Use <code class="command">ffmpeg</code> to stream to an RTMP server, continue processing
  19187. the stream at real-time rate even in case of temporary failure
  19188. (network outage) and attempt to recover streaming every second
  19189. indefinitely:
  19190. </p><div class="example">
  19191. <pre class="example-preformatted">ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv \
  19192. -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 \
  19193. -map 0:v -map 0:a rtmp://example.com/live/stream_name
  19194. </pre></div>
  19195. </div>
  19196. </div>
  19197. <div class="section-level-extent" id="film_005fcpk">
  19198. <h3 class="section"><span>21.34 film_cpk<a class="copiable-link" href="#film_005fcpk"> &para;</a></span></h3>
  19199. <p>Sega film (.cpk) muxer.
  19200. </p>
  19201. <p>This format was used as internal format for several Sega games.
  19202. </p>
  19203. <p>For more information regarding the Sega film file format, visit
  19204. <a class="url" href="http://wiki.multimedia.cx/index.php?title=Sega_FILM">http://wiki.multimedia.cx/index.php?title=Sega_FILM</a>.
  19205. </p>
  19206. <p>It accepts at maximum one &lsquo;<samp class="samp">cinepak</samp>&rsquo; or raw video stream, and at
  19207. maximum one audio stream.
  19208. </p>
  19209. </div>
  19210. <div class="section-level-extent" id="filmstrip">
  19211. <h3 class="section"><span>21.35 filmstrip<a class="copiable-link" href="#filmstrip"> &para;</a></span></h3>
  19212. <p>Adobe Filmstrip muxer.
  19213. </p>
  19214. <p>This format is used by several Adobe tools to store a generated filmstrip export. It
  19215. accepts a single raw video stream.
  19216. </p>
  19217. </div>
  19218. <div class="section-level-extent" id="fits">
  19219. <h3 class="section"><span>21.36 fits<a class="copiable-link" href="#fits"> &para;</a></span></h3>
  19220. <p>Flexible Image Transport System (FITS) muxer.
  19221. </p>
  19222. <p>This image format is used to store astronomical data.
  19223. </p>
  19224. <p>For more information regarding the format, visit
  19225. <a class="url" href="https://fits.gsfc.nasa.gov">https://fits.gsfc.nasa.gov</a>.
  19226. </p>
  19227. </div>
  19228. <div class="section-level-extent" id="flac-3">
  19229. <h3 class="section"><span>21.37 flac<a class="copiable-link" href="#flac-3"> &para;</a></span></h3>
  19230. <p>Raw FLAC audio muxer.
  19231. </p>
  19232. <p>This muxer accepts exactly one FLAC audio stream. Additionally, it is possible to add
  19233. images with disposition &lsquo;<samp class="samp">attached_pic</samp>&rsquo;.
  19234. </p>
  19235. <ul class="mini-toc">
  19236. <li><a href="#Options-69" accesskey="1">Options</a></li>
  19237. <li><a href="#Example-5" accesskey="2">Example</a></li>
  19238. </ul>
  19239. <div class="subsection-level-extent" id="Options-69">
  19240. <h4 class="subsection"><span>21.37.1 Options<a class="copiable-link" href="#Options-69"> &para;</a></span></h4>
  19241. <dl class="table">
  19242. <dt><samp class="option">write_header <var class="var">bool</var></samp></dt>
  19243. <dd><p>write the file header if set to <code class="code">true</code>, default is <code class="code">true</code>
  19244. </p></dd>
  19245. </dl>
  19246. </div>
  19247. <div class="subsection-level-extent" id="Example-5">
  19248. <h4 class="subsection"><span>21.37.2 Example<a class="copiable-link" href="#Example-5"> &para;</a></span></h4>
  19249. <p>Use <code class="command">ffmpeg</code> to store the audio stream from an input file,
  19250. together with several pictures used with &lsquo;<samp class="samp">attached_pic</samp>&rsquo;
  19251. disposition:
  19252. </p><div class="example">
  19253. <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
  19254. </pre></div>
  19255. </div>
  19256. </div>
  19257. <div class="section-level-extent" id="flv">
  19258. <h3 class="section"><span>21.38 flv<a class="copiable-link" href="#flv"> &para;</a></span></h3>
  19259. <p>Adobe Flash Video Format muxer.
  19260. </p>
  19261. <ul class="mini-toc">
  19262. <li><a href="#Options-70" accesskey="1">Options</a></li>
  19263. </ul>
  19264. <div class="subsection-level-extent" id="Options-70">
  19265. <h4 class="subsection"><span>21.38.1 Options<a class="copiable-link" href="#Options-70"> &para;</a></span></h4>
  19266. <dl class="table">
  19267. <dt><samp class="option">flvflags <var class="var">flags</var></samp></dt>
  19268. <dd><p>Possible values:
  19269. </p>
  19270. <dl class="table">
  19271. <dt>&lsquo;<samp class="samp">aac_seq_header_detect</samp>&rsquo;</dt>
  19272. <dd><p>Place AAC sequence header based on audio stream data.
  19273. </p>
  19274. </dd>
  19275. <dt>&lsquo;<samp class="samp">no_sequence_end</samp>&rsquo;</dt>
  19276. <dd><p>Disable sequence end tag.
  19277. </p>
  19278. </dd>
  19279. <dt>&lsquo;<samp class="samp">no_metadata</samp>&rsquo;</dt>
  19280. <dd><p>Disable metadata tag.
  19281. </p>
  19282. </dd>
  19283. <dt>&lsquo;<samp class="samp">no_duration_filesize</samp>&rsquo;</dt>
  19284. <dd><p>Disable duration and filesize in metadata when they are equal to zero
  19285. at the end of stream. (Be used to non-seekable living stream).
  19286. </p>
  19287. </dd>
  19288. <dt>&lsquo;<samp class="samp">add_keyframe_index</samp>&rsquo;</dt>
  19289. <dd><p>Used to facilitate seeking; particularly for HTTP pseudo streaming.
  19290. </p></dd>
  19291. </dl>
  19292. </dd>
  19293. </dl>
  19294. <a class="anchor" id="framecrc"></a></div>
  19295. </div>
  19296. <div class="section-level-extent" id="framecrc-1">
  19297. <h3 class="section"><span>21.39 framecrc<a class="copiable-link" href="#framecrc-1"> &para;</a></span></h3>
  19298. <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
  19299. </p>
  19300. <p>This muxer computes and prints the Adler-32 CRC for each audio
  19301. and video packet. By default audio frames are converted to signed
  19302. 16-bit raw audio and video frames to raw video before computing the
  19303. CRC.
  19304. </p>
  19305. <p>The output of the muxer consists of a line for each audio and video
  19306. packet of the form:
  19307. </p><div class="example">
  19308. <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>
  19309. </pre></div>
  19310. <p><var class="var">CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
  19311. CRC of the packet.
  19312. </p>
  19313. <ul class="mini-toc">
  19314. <li><a href="#Examples-14" accesskey="1">Examples</a></li>
  19315. </ul>
  19316. <div class="subsection-level-extent" id="Examples-14">
  19317. <h4 class="subsection"><span>21.39.1 Examples<a class="copiable-link" href="#Examples-14"> &para;</a></span></h4>
  19318. <p>For example to compute the CRC of the audio and video frames in
  19319. <samp class="file">INPUT</samp>, converted to raw audio and video packets, and store it
  19320. in the file <samp class="file">out.crc</samp>:
  19321. </p><div class="example">
  19322. <pre class="example-preformatted">ffmpeg -i INPUT -f framecrc out.crc
  19323. </pre></div>
  19324. <p>To print the information to stdout, use the command:
  19325. </p><div class="example">
  19326. <pre class="example-preformatted">ffmpeg -i INPUT -f framecrc -
  19327. </pre></div>
  19328. <p>With <code class="command">ffmpeg</code>, you can select the output format to which the
  19329. audio and video frames are encoded before computing the CRC for each
  19330. packet by specifying the audio and video codec. For example, to
  19331. compute the CRC of each decoded input audio frame converted to PCM
  19332. unsigned 8-bit and of each decoded input video frame converted to
  19333. MPEG-2 video, use the command:
  19334. </p><div class="example">
  19335. <pre class="example-preformatted">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  19336. </pre></div>
  19337. <p>See also the <a class="ref" href="#crc">crc</a> muxer.
  19338. </p>
  19339. <a class="anchor" id="framehash"></a></div>
  19340. </div>
  19341. <div class="section-level-extent" id="framehash-1">
  19342. <h3 class="section"><span>21.40 framehash<a class="copiable-link" href="#framehash-1"> &para;</a></span></h3>
  19343. <p>Per-packet hash testing format.
  19344. </p>
  19345. <p>This muxer computes and prints a cryptographic hash for each audio
  19346. and video packet. This can be used for packet-by-packet equality
  19347. checks without having to individually do a binary comparison on each.
  19348. </p>
  19349. <p>By default audio frames are converted to signed 16-bit raw audio and
  19350. video frames to raw video before computing the hash, but the output
  19351. of explicit conversions to other codecs can also be used. It uses the
  19352. SHA-256 cryptographic hash function by default, but supports several
  19353. other algorithms.
  19354. </p>
  19355. <p>The output of the muxer consists of a line for each audio and video
  19356. packet of the form:
  19357. </p><div class="example">
  19358. <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>
  19359. </pre></div>
  19360. <p><var class="var">hash</var> is a hexadecimal number representing the computed hash
  19361. for the packet.
  19362. </p>
  19363. <dl class="table">
  19364. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  19365. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  19366. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  19367. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  19368. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  19369. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  19370. </p>
  19371. </dd>
  19372. </dl>
  19373. <ul class="mini-toc">
  19374. <li><a href="#Examples-15" accesskey="1">Examples</a></li>
  19375. </ul>
  19376. <div class="subsection-level-extent" id="Examples-15">
  19377. <h4 class="subsection"><span>21.40.1 Examples<a class="copiable-link" href="#Examples-15"> &para;</a></span></h4>
  19378. <p>To compute the SHA-256 hash of the audio and video frames in <samp class="file">INPUT</samp>,
  19379. converted to raw audio and video packets, and store it in the file
  19380. <samp class="file">out.sha256</samp>:
  19381. </p><div class="example">
  19382. <pre class="example-preformatted">ffmpeg -i INPUT -f framehash out.sha256
  19383. </pre></div>
  19384. <p>To print the information to stdout, using the MD5 hash function, use
  19385. the command:
  19386. </p><div class="example">
  19387. <pre class="example-preformatted">ffmpeg -i INPUT -f framehash -hash md5 -
  19388. </pre></div>
  19389. <p>See also the <a class="ref" href="#hash">hash</a> muxer.
  19390. </p>
  19391. <a class="anchor" id="framemd5"></a></div>
  19392. </div>
  19393. <div class="section-level-extent" id="framemd5-1">
  19394. <h3 class="section"><span>21.41 framemd5<a class="copiable-link" href="#framemd5-1"> &para;</a></span></h3>
  19395. <p>Per-packet MD5 testing format.
  19396. </p>
  19397. <p>This is a variant of the <a class="ref" href="#framehash">framehash</a> muxer. Unlike that muxer,
  19398. it defaults to using the MD5 hash function.
  19399. </p>
  19400. <ul class="mini-toc">
  19401. <li><a href="#Examples-16" accesskey="1">Examples</a></li>
  19402. </ul>
  19403. <div class="subsection-level-extent" id="Examples-16">
  19404. <h4 class="subsection"><span>21.41.1 Examples<a class="copiable-link" href="#Examples-16"> &para;</a></span></h4>
  19405. <p>To compute the MD5 hash of the audio and video frames in <samp class="file">INPUT</samp>,
  19406. converted to raw audio and video packets, and store it in the file
  19407. <samp class="file">out.md5</samp>:
  19408. </p><div class="example">
  19409. <pre class="example-preformatted">ffmpeg -i INPUT -f framemd5 out.md5
  19410. </pre></div>
  19411. <p>To print the information to stdout, use the command:
  19412. </p><div class="example">
  19413. <pre class="example-preformatted">ffmpeg -i INPUT -f framemd5 -
  19414. </pre></div>
  19415. <p>See also the <a class="ref" href="#framehash">framehash</a> and <a class="ref" href="#md5">md5</a> muxers.
  19416. </p>
  19417. <a class="anchor" id="gif"></a></div>
  19418. </div>
  19419. <div class="section-level-extent" id="gif-2">
  19420. <h3 class="section"><span>21.42 gif<a class="copiable-link" href="#gif-2"> &para;</a></span></h3>
  19421. <p>Animated GIF muxer.
  19422. </p>
  19423. <p>Note that the GIF format has a very large time base: the delay between two frames can
  19424. therefore not be smaller than one centi second.
  19425. </p>
  19426. <ul class="mini-toc">
  19427. <li><a href="#Options-71" accesskey="1">Options</a></li>
  19428. <li><a href="#Example-6" accesskey="2">Example</a></li>
  19429. </ul>
  19430. <div class="subsection-level-extent" id="Options-71">
  19431. <h4 class="subsection"><span>21.42.1 Options<a class="copiable-link" href="#Options-71"> &para;</a></span></h4>
  19432. <dl class="table">
  19433. <dt><samp class="option">loop <var class="var">bool</var></samp></dt>
  19434. <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>
  19435. for looping indefinitely (default).
  19436. </p>
  19437. </dd>
  19438. <dt><samp class="option">final_delay <var class="var">delay</var></samp></dt>
  19439. <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
  19440. ends with a delay until the next frame. The default is <code class="code">-1</code>, which is a
  19441. special value to tell the muxer to re-use the previous delay. In case of a
  19442. loop, you might want to customize this value to mark a pause for instance.
  19443. </p></dd>
  19444. </dl>
  19445. </div>
  19446. <div class="subsection-level-extent" id="Example-6">
  19447. <h4 class="subsection"><span>21.42.2 Example<a class="copiable-link" href="#Example-6"> &para;</a></span></h4>
  19448. <p>Encode a gif looping 10 times, with a 5 seconds delay between
  19449. the loops:
  19450. </p><div class="example">
  19451. <pre class="example-preformatted">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  19452. </pre></div>
  19453. <p>Note 1: if you wish to extract the frames into separate GIF files, you need to
  19454. force the <a class="ref" href="#image2">image2</a> muxer:
  19455. </p><div class="example">
  19456. <pre class="example-preformatted">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
  19457. </pre></div>
  19458. </div>
  19459. </div>
  19460. <div class="section-level-extent" id="gxf">
  19461. <h3 class="section"><span>21.43 gxf<a class="copiable-link" href="#gxf"> &para;</a></span></h3>
  19462. <p>General eXchange Format (GXF) muxer.
  19463. </p>
  19464. <p>GXF was developed by Grass Valley Group, then standardized by SMPTE as SMPTE
  19465. 360M and was extended in SMPTE RDD 14-2007 to include high-definition video
  19466. resolutions.
  19467. </p>
  19468. <p>It accepts at most one video stream with codec &lsquo;<samp class="samp">mjpeg</samp>&rsquo;, or
  19469. &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
  19470. &lsquo;<samp class="samp">512x480</samp>&rsquo; or &lsquo;<samp class="samp">608x576</samp>&rsquo;, and several audio streams with rate 48000Hz
  19471. and codec &lsquo;<samp class="samp">pcm16_le</samp>&rsquo;.
  19472. </p>
  19473. <a class="anchor" id="hash"></a></div>
  19474. <div class="section-level-extent" id="hash-1">
  19475. <h3 class="section"><span>21.44 hash<a class="copiable-link" href="#hash-1"> &para;</a></span></h3>
  19476. <p>Hash testing format.
  19477. </p>
  19478. <p>This muxer computes and prints a cryptographic hash of all the input
  19479. audio and video frames. This can be used for equality checks without
  19480. having to do a complete binary comparison.
  19481. </p>
  19482. <p>By default audio frames are converted to signed 16-bit raw audio and
  19483. video frames to raw video before computing the hash, but the output
  19484. of explicit conversions to other codecs can also be used. Timestamps
  19485. are ignored. It uses the SHA-256 cryptographic hash function by default,
  19486. but supports several other algorithms.
  19487. </p>
  19488. <p>The output of the muxer consists of a single line of the form:
  19489. <var class="var">algo</var>=<var class="var">hash</var>, where <var class="var">algo</var> is a short string representing
  19490. the hash function used, and <var class="var">hash</var> is a hexadecimal number
  19491. representing the computed hash.
  19492. </p>
  19493. <dl class="table">
  19494. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  19495. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  19496. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  19497. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  19498. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  19499. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  19500. </p>
  19501. </dd>
  19502. </dl>
  19503. <ul class="mini-toc">
  19504. <li><a href="#Examples-17" accesskey="1">Examples</a></li>
  19505. </ul>
  19506. <div class="subsection-level-extent" id="Examples-17">
  19507. <h4 class="subsection"><span>21.44.1 Examples<a class="copiable-link" href="#Examples-17"> &para;</a></span></h4>
  19508. <p>To compute the SHA-256 hash of the input converted to raw audio and
  19509. video, and store it in the file <samp class="file">out.sha256</samp>:
  19510. </p><div class="example">
  19511. <pre class="example-preformatted">ffmpeg -i INPUT -f hash out.sha256
  19512. </pre></div>
  19513. <p>To print an MD5 hash to stdout use the command:
  19514. </p><div class="example">
  19515. <pre class="example-preformatted">ffmpeg -i INPUT -f hash -hash md5 -
  19516. </pre></div>
  19517. <p>See also the <a class="ref" href="#framehash">framehash</a> muxer.
  19518. </p>
  19519. <a class="anchor" id="hds"></a></div>
  19520. </div>
  19521. <div class="section-level-extent" id="hds-1">
  19522. <h3 class="section"><span>21.45 hds<a class="copiable-link" href="#hds-1"> &para;</a></span></h3>
  19523. <p>HTTP Dynamic Streaming (HDS) muxer.
  19524. </p>
  19525. <p>HTTP dynamic streaming, or HDS, is an adaptive bitrate streaming method
  19526. developed by Adobe. HDS delivers MP4 video content over HTTP connections. HDS
  19527. can be used for on-demand streaming or live streaming.
  19528. </p>
  19529. <p>This muxer creates an .f4m (Adobe Flash Media Manifest File) manifest, an .abst
  19530. (Adobe Bootstrap File) for each stream, and segment files in a directory
  19531. specified as the output.
  19532. </p>
  19533. <p>These needs to be accessed by an HDS player throuhg HTTPS for it to be able to
  19534. perform playback on the generated stream.
  19535. </p>
  19536. <ul class="mini-toc">
  19537. <li><a href="#Options-72" accesskey="1">Options</a></li>
  19538. <li><a href="#Example-7" accesskey="2">Example</a></li>
  19539. </ul>
  19540. <div class="subsection-level-extent" id="Options-72">
  19541. <h4 class="subsection"><span>21.45.1 Options<a class="copiable-link" href="#Options-72"> &para;</a></span></h4>
  19542. <dl class="table">
  19543. <dt><samp class="option">extra_window_size <var class="var">int</var></samp></dt>
  19544. <dd><p>number of fragments kept outside of the manifest before removing from disk
  19545. </p>
  19546. </dd>
  19547. <dt><samp class="option">min_frag_duration <var class="var">microseconds</var></samp></dt>
  19548. <dd><p>minimum fragment duration (in microseconds), default value is 1 second
  19549. (<code class="code">10000000</code>)
  19550. </p>
  19551. </dd>
  19552. <dt><samp class="option">remove_at_exit <var class="var">bool</var></samp></dt>
  19553. <dd><p>remove all fragments when finished when set to <code class="code">true</code>
  19554. </p>
  19555. </dd>
  19556. <dt><samp class="option">window_size <var class="var">int</var></samp></dt>
  19557. <dd><p>number of fragments kept in the manifest, if set to a value different from
  19558. <code class="code">0</code>. By default all segments are kept in the output directory.
  19559. </p></dd>
  19560. </dl>
  19561. </div>
  19562. <div class="subsection-level-extent" id="Example-7">
  19563. <h4 class="subsection"><span>21.45.2 Example<a class="copiable-link" href="#Example-7"> &para;</a></span></h4>
  19564. <p>Use <code class="command">ffmpeg</code> to generate HDS files to the <samp class="file">output.hds</samp> directory in
  19565. real-time rate:
  19566. </p><div class="example">
  19567. <pre class="example-preformatted">ffmpeg -re -i INPUT -f hds -b:v 200k output.hds
  19568. </pre></div>
  19569. <a class="anchor" id="hls"></a></div>
  19570. </div>
  19571. <div class="section-level-extent" id="hls-2">
  19572. <h3 class="section"><span>21.46 hls<a class="copiable-link" href="#hls-2"> &para;</a></span></h3>
  19573. <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  19574. the HTTP Live Streaming (HLS) specification.
  19575. </p>
  19576. <p>It creates a playlist file, and one or more segment files. The output filename
  19577. specifies the playlist filename.
  19578. </p>
  19579. <p>By default, the muxer creates a file for each segment produced. These files
  19580. have the same name as the playlist, followed by a sequential number and a
  19581. .ts extension.
  19582. </p>
  19583. <p>Make sure to require a closed GOP when encoding and to set the GOP
  19584. size to fit your segment time constraint.
  19585. </p>
  19586. <p>For example, to convert an input file with <code class="command">ffmpeg</code>:
  19587. </p><div class="example">
  19588. <pre class="example-preformatted">ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  19589. </pre></div>
  19590. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  19591. <samp class="file">out0.ts</samp>, <samp class="file">out1.ts</samp>, <samp class="file">out2.ts</samp>, etc.
  19592. </p>
  19593. <p>See also the <a class="ref" href="#segment">segment</a> muxer, which provides a more generic and
  19594. flexible implementation of a segmenter, and can be used to perform HLS
  19595. segmentation.
  19596. </p>
  19597. <ul class="mini-toc">
  19598. <li><a href="#Options-73" accesskey="1">Options</a></li>
  19599. </ul>
  19600. <div class="subsection-level-extent" id="Options-73">
  19601. <h4 class="subsection"><span>21.46.1 Options<a class="copiable-link" href="#Options-73"> &para;</a></span></h4>
  19602. <p>This muxer supports the following options:
  19603. </p>
  19604. <dl class="table">
  19605. <dt><samp class="option">hls_init_time <var class="var">duration</var></samp></dt>
  19606. <dd><p>Set the initial target segment length. Default value is <var class="var">0</var>.
  19607. </p>
  19608. <p><var class="var">duration</var> must be a time duration specification,
  19609. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  19610. </p>
  19611. <p>Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
  19612. After the initial playlist is filled <code class="command">ffmpeg</code> will cut segments
  19613. at duration equal to <code class="code">hls_time</code>
  19614. </p>
  19615. </dd>
  19616. <dt><samp class="option">hls_time <var class="var">duration</var></samp></dt>
  19617. <dd><p>Set the target segment length. Default value is 2.
  19618. </p>
  19619. <p><var class="var">duration</var> must be a time duration specification,
  19620. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  19621. Segment will be cut on the next key frame after this time has passed.
  19622. </p>
  19623. </dd>
  19624. <dt><samp class="option">hls_list_size <var class="var">size</var></samp></dt>
  19625. <dd><p>Set the maximum number of playlist entries. If set to 0 the list file
  19626. will contain all the segments. Default value is 5.
  19627. </p>
  19628. </dd>
  19629. <dt><samp class="option">hls_delete_threshold <var class="var">size</var></samp></dt>
  19630. <dd><p>Set the number of unreferenced segments to keep on disk before <code class="code">hls_flags delete_segments</code>
  19631. deletes them. Increase this to allow continue clients to download segments which
  19632. were recently referenced in the playlist. Default value is 1, meaning segments older than
  19633. <code class="code">hls_list_size+1</code> will be deleted.
  19634. </p>
  19635. </dd>
  19636. <dt><samp class="option">hls_start_number_source</samp></dt>
  19637. <dd><p>Start the playlist sequence number (<code class="code">#EXT-X-MEDIA-SEQUENCE</code>) according to the specified source.
  19638. Unless <code class="code">hls_flags single_file</code> is set, it also specifies source of starting sequence numbers of
  19639. segment and subtitle filenames. In any case, if <code class="code">hls_flags append_list</code>
  19640. is set and read playlist sequence number is greater than the specified start sequence number,
  19641. then that value will be used as start value.
  19642. </p>
  19643. <p>It accepts the following values:
  19644. </p>
  19645. <dl class="table">
  19646. <dt><samp class="option">generic (default)</samp></dt>
  19647. <dd><p>Set the starting sequence numbers according to <var class="var">start_number</var> option value.
  19648. </p>
  19649. </dd>
  19650. <dt><samp class="option">epoch</samp></dt>
  19651. <dd><p>The start number will be the seconds since epoch (1970-01-01 00:00:00)
  19652. </p>
  19653. </dd>
  19654. <dt><samp class="option">epoch_us</samp></dt>
  19655. <dd><p>The start number will be the microseconds since epoch (1970-01-01 00:00:00)
  19656. </p>
  19657. </dd>
  19658. <dt><samp class="option">datetime</samp></dt>
  19659. <dd><p>The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
  19660. </p>
  19661. </dd>
  19662. </dl>
  19663. </dd>
  19664. <dt><samp class="option">start_number <var class="var">number</var></samp></dt>
  19665. <dd><p>Start the playlist sequence number (<code class="code">#EXT-X-MEDIA-SEQUENCE</code>) from the specified <var class="var">number</var>
  19666. when <var class="var">hls_start_number_source</var> value is <var class="var">generic</var>. (This is the default case.)
  19667. Unless <code class="code">hls_flags single_file</code> is set, it also specifies starting sequence numbers of segment and subtitle filenames.
  19668. Default value is 0.
  19669. </p>
  19670. </dd>
  19671. <dt><samp class="option">hls_allow_cache <var class="var">allowcache</var></samp></dt>
  19672. <dd><p>Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  19673. </p>
  19674. </dd>
  19675. <dt><samp class="option">hls_base_url <var class="var">baseurl</var></samp></dt>
  19676. <dd><p>Append <var class="var">baseurl</var> to every entry in the playlist.
  19677. Useful to generate playlists with absolute paths.
  19678. </p>
  19679. <p>Note that the playlist sequence number must be unique for each segment
  19680. and it is not to be confused with the segment filename sequence number
  19681. which can be cyclic, for example if the <samp class="option">wrap</samp> option is
  19682. specified.
  19683. </p>
  19684. </dd>
  19685. <dt><samp class="option">hls_segment_filename <var class="var">filename</var></samp></dt>
  19686. <dd><p>Set the segment filename. Unless <code class="code">hls_flags single_file</code> is set,
  19687. <var class="var">filename</var> is used as a string format with the segment number:
  19688. </p><div class="example">
  19689. <pre class="example-preformatted">ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  19690. </pre></div>
  19691. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  19692. <samp class="file">file000.ts</samp>, <samp class="file">file001.ts</samp>, <samp class="file">file002.ts</samp>, etc.
  19693. </p>
  19694. <p><var class="var">filename</var> may contain full path or relative path specification,
  19695. but only the file name part without any path info will be contained in the m3u8 segment list.
  19696. Should a relative path be specified, the path of the created segment
  19697. files will be relative to the current working directory.
  19698. When strftime_mkdir is set, the whole expanded value of <var class="var">filename</var> will be written into the m3u8 segment list.
  19699. </p>
  19700. <p>When <code class="code">var_stream_map</code> is set with two or more variant streams, the
  19701. <var class="var">filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  19702. the position of variant stream index in the generated segment file names.
  19703. </p><div class="example">
  19704. <pre class="example-preformatted">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  19705. -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; \
  19706. -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
  19707. </pre></div>
  19708. <p>This example will produce the playlists segment file sets:
  19709. <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
  19710. <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.
  19711. </p>
  19712. <p>The string &quot;%v&quot; may be present in the filename or in the last directory name
  19713. containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
  19714. sub-directory or filename.) If the string %v is present in the directory name, then
  19715. sub-directories are created after expanding the directory name pattern. This
  19716. enables creation of segments corresponding to different variant streams in
  19717. subdirectories.
  19718. </p><div class="example">
  19719. <pre class="example-preformatted">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  19720. -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; \
  19721. -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
  19722. </pre></div>
  19723. <p>This example will produce the playlists segment file sets:
  19724. <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
  19725. <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.
  19726. </p>
  19727. </dd>
  19728. <dt><samp class="option">strftime</samp></dt>
  19729. <dd><p>Use strftime() on <var class="var">filename</var> to expand the segment filename with localtime.
  19730. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index
  19731. hls_flag and %%d will be the specifier.
  19732. </p><div class="example">
  19733. <pre class="example-preformatted">ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
  19734. </pre></div>
  19735. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  19736. <samp class="file">file-20160215-1455569023.ts</samp>, <samp class="file">file-20160215-1455569024.ts</samp>, etc.
  19737. Note: On some systems/environments, the <code class="code">%s</code> specifier is not available. See
  19738. <code class="code">strftime()</code> documentation.
  19739. </p><div class="example">
  19740. <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
  19741. </pre></div>
  19742. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  19743. <samp class="file">file-20160215-0001.ts</samp>, <samp class="file">file-20160215-0002.ts</samp>, etc.
  19744. </p>
  19745. </dd>
  19746. <dt><samp class="option">strftime_mkdir</samp></dt>
  19747. <dd><p>Used together with -strftime_mkdir, it will create all subdirectories which
  19748. is expanded in <var class="var">filename</var>.
  19749. </p><div class="example">
  19750. <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
  19751. </pre></div>
  19752. <p>This example will create a directory 201560215 (if it does not exist), and then
  19753. produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  19754. <samp class="file">20160215/file-20160215-1455569023.ts</samp>, <samp class="file">20160215/file-20160215-1455569024.ts</samp>, etc.
  19755. </p>
  19756. <div class="example">
  19757. <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
  19758. </pre></div>
  19759. <p>This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then
  19760. produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  19761. <samp class="file">2016/02/15/file-20160215-1455569023.ts</samp>, <samp class="file">2016/02/15/file-20160215-1455569024.ts</samp>, etc.
  19762. </p>
  19763. </dd>
  19764. <dt><samp class="option">hls_segment_options <var class="var">options_list</var></samp></dt>
  19765. <dd><p>Set output format options using a :-separated list of key=value
  19766. parameters. Values containing <code class="code">:</code> special characters must be
  19767. escaped.
  19768. </p>
  19769. </dd>
  19770. <dt><samp class="option">hls_key_info_file <var class="var">key_info_file</var></samp></dt>
  19771. <dd><p>Use the information in <var class="var">key_info_file</var> for segment encryption. The first
  19772. line of <var class="var">key_info_file</var> specifies the key URI written to the playlist. The
  19773. key URL is used to access the encryption key during playback. The second line
  19774. specifies the path to the key file used to obtain the key during the encryption
  19775. process. The key file is read as a single packed array of 16 octets in binary
  19776. format. The optional third line specifies the initialization vector (IV) as a
  19777. hexadecimal string to be used instead of the segment sequence number (default)
  19778. for encryption. Changes to <var class="var">key_info_file</var> will result in segment
  19779. encryption with the new key/IV and an entry in the playlist for the new key
  19780. URI/IV if <code class="code">hls_flags periodic_rekey</code> is enabled.
  19781. </p>
  19782. <p>Key info file format:
  19783. </p><div class="example">
  19784. <pre class="example-preformatted"><var class="var">key URI</var>
  19785. <var class="var">key file path</var>
  19786. <var class="var">IV</var> (optional)
  19787. </pre></div>
  19788. <p>Example key URIs:
  19789. </p><div class="example">
  19790. <pre class="example-preformatted">http://server/file.key
  19791. /path/to/file.key
  19792. file.key
  19793. </pre></div>
  19794. <p>Example key file paths:
  19795. </p><div class="example">
  19796. <pre class="example-preformatted">file.key
  19797. /path/to/file.key
  19798. </pre></div>
  19799. <p>Example IV:
  19800. </p><div class="example">
  19801. <pre class="example-preformatted">0123456789ABCDEF0123456789ABCDEF
  19802. </pre></div>
  19803. <p>Key info file example:
  19804. </p><div class="example">
  19805. <pre class="example-preformatted">http://server/file.key
  19806. /path/to/file.key
  19807. 0123456789ABCDEF0123456789ABCDEF
  19808. </pre></div>
  19809. <p>Example shell script:
  19810. </p><div class="example">
  19811. <pre class="example-preformatted">#!/bin/sh
  19812. BASE_URL=${1:-'.'}
  19813. openssl rand 16 &gt; file.key
  19814. echo $BASE_URL/file.key &gt; file.keyinfo
  19815. echo file.key &gt;&gt; file.keyinfo
  19816. echo $(openssl rand -hex 16) &gt;&gt; file.keyinfo
  19817. ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  19818. -hls_key_info_file file.keyinfo out.m3u8
  19819. </pre></div>
  19820. </dd>
  19821. <dt><samp class="option">-hls_enc <var class="var">enc</var></samp></dt>
  19822. <dd><p>Enable (1) or disable (0) the AES128 encryption.
  19823. When enabled every segment generated is encrypted and the encryption key
  19824. is saved as <var class="var">playlist name</var>.key.
  19825. </p>
  19826. </dd>
  19827. <dt><samp class="option">-hls_enc_key <var class="var">key</var></samp></dt>
  19828. <dd><p>16-octet key to encrypt the segments, by default it
  19829. is randomly generated.
  19830. </p>
  19831. </dd>
  19832. <dt><samp class="option">-hls_enc_key_url <var class="var">keyurl</var></samp></dt>
  19833. <dd><p>If set, <var class="var">keyurl</var> is prepended instead of <var class="var">baseurl</var> to the key filename
  19834. in the playlist.
  19835. </p>
  19836. </dd>
  19837. <dt><samp class="option">-hls_enc_iv <var class="var">iv</var></samp></dt>
  19838. <dd><p>16-octet initialization vector for every segment instead
  19839. of the autogenerated ones.
  19840. </p>
  19841. </dd>
  19842. <dt><samp class="option">hls_segment_type <var class="var">flags</var></samp></dt>
  19843. <dd><p>Possible values:
  19844. </p>
  19845. <dl class="table">
  19846. <dt>&lsquo;<samp class="samp">mpegts</samp>&rsquo;</dt>
  19847. <dd><p>Output segment files in MPEG-2 Transport Stream format. This is
  19848. compatible with all HLS versions.
  19849. </p>
  19850. </dd>
  19851. <dt>&lsquo;<samp class="samp">fmp4</samp>&rsquo;</dt>
  19852. <dd><p>Output segment files in fragmented MP4 format, similar to MPEG-DASH.
  19853. fmp4 files may be used in HLS version 7 and above.
  19854. </p>
  19855. </dd>
  19856. </dl>
  19857. </dd>
  19858. <dt><samp class="option">hls_fmp4_init_filename <var class="var">filename</var></samp></dt>
  19859. <dd><p>Set filename to the fragment files header file, default filename is <samp class="file">init.mp4</samp>.
  19860. </p>
  19861. <p>Use <code class="code">-strftime 1</code> on <var class="var">filename</var> to expand the segment filename with localtime.
  19862. </p><div class="example">
  19863. <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
  19864. </pre></div>
  19865. <p>This will produce init like this
  19866. <samp class="file">1602678741_init.mp4</samp>
  19867. </p>
  19868. </dd>
  19869. <dt><samp class="option">hls_fmp4_init_resend</samp></dt>
  19870. <dd><p>Resend init file after m3u8 file refresh every time, default is <var class="var">0</var>.
  19871. </p>
  19872. <p>When <code class="code">var_stream_map</code> is set with two or more variant streams, the
  19873. <var class="var">filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  19874. the position of variant stream index in the generated init file names.
  19875. The string &quot;%v&quot; may be present in the filename or in the last directory name
  19876. containing the file. If the string is present in the directory name, then
  19877. sub-directories are created after expanding the directory name pattern. This
  19878. enables creation of init files corresponding to different variant streams in
  19879. subdirectories.
  19880. </p>
  19881. </dd>
  19882. <dt><samp class="option">hls_flags <var class="var">flags</var></samp></dt>
  19883. <dd><p>Possible values:
  19884. </p>
  19885. <dl class="table">
  19886. <dt>&lsquo;<samp class="samp">single_file</samp>&rsquo;</dt>
  19887. <dd><p>If this flag is set, the muxer will store all segments in a single MPEG-TS
  19888. file, and will use byte ranges in the playlist. HLS playlists generated with
  19889. this way will have the version number 4.
  19890. For example:
  19891. </p><div class="example">
  19892. <pre class="example-preformatted">ffmpeg -i in.nut -hls_flags single_file out.m3u8
  19893. </pre></div>
  19894. <p>Will produce the playlist, <samp class="file">out.m3u8</samp>, and a single segment file,
  19895. <samp class="file">out.ts</samp>.
  19896. </p>
  19897. </dd>
  19898. <dt>&lsquo;<samp class="samp">delete_segments</samp>&rsquo;</dt>
  19899. <dd><p>Segment files removed from the playlist are deleted after a period of time
  19900. equal to the duration of the segment plus the duration of the playlist.
  19901. </p>
  19902. </dd>
  19903. <dt>&lsquo;<samp class="samp">append_list</samp>&rsquo;</dt>
  19904. <dd><p>Append new segments into the end of old segment list,
  19905. and remove the <code class="code">#EXT-X-ENDLIST</code> from the old segment list.
  19906. </p>
  19907. </dd>
  19908. <dt>&lsquo;<samp class="samp">round_durations</samp>&rsquo;</dt>
  19909. <dd><p>Round the duration info in the playlist file segment info to integer
  19910. values, instead of using floating point.
  19911. If there are no other features requiring higher HLS versions be used,
  19912. then this will allow ffmpeg to output a HLS version 2 m3u8.
  19913. </p>
  19914. </dd>
  19915. <dt>&lsquo;<samp class="samp">discont_start</samp>&rsquo;</dt>
  19916. <dd><p>Add the <code class="code">#EXT-X-DISCONTINUITY</code> tag to the playlist, before the
  19917. first segment&rsquo;s information.
  19918. </p>
  19919. </dd>
  19920. <dt>&lsquo;<samp class="samp">omit_endlist</samp>&rsquo;</dt>
  19921. <dd><p>Do not append the <code class="code">EXT-X-ENDLIST</code> tag at the end of the playlist.
  19922. </p>
  19923. </dd>
  19924. <dt>&lsquo;<samp class="samp">periodic_rekey</samp>&rsquo;</dt>
  19925. <dd><p>The file specified by <code class="code">hls_key_info_file</code> will be checked periodically and
  19926. detect updates to the encryption info. Be sure to replace this file atomically,
  19927. including the file containing the AES encryption key.
  19928. </p>
  19929. </dd>
  19930. <dt>&lsquo;<samp class="samp">independent_segments</samp>&rsquo;</dt>
  19931. <dd><p>Add the <code class="code">#EXT-X-INDEPENDENT-SEGMENTS</code> to playlists that has video segments
  19932. and when all the segments of that playlist are guaranteed to start with a Key frame.
  19933. </p>
  19934. </dd>
  19935. <dt>&lsquo;<samp class="samp">iframes_only</samp>&rsquo;</dt>
  19936. <dd><p>Add the <code class="code">#EXT-X-I-FRAMES-ONLY</code> to playlists that has video segments
  19937. and can play only I-frames in the <code class="code">#EXT-X-BYTERANGE</code> mode.
  19938. </p>
  19939. </dd>
  19940. <dt>&lsquo;<samp class="samp">split_by_time</samp>&rsquo;</dt>
  19941. <dd><p>Allow segments to start on frames other than keyframes. This improves
  19942. behavior on some players when the time between keyframes is inconsistent,
  19943. but may make things worse on others, and can cause some oddities during
  19944. seeking. This flag should be used with the <code class="code">hls_time</code> option.
  19945. </p>
  19946. </dd>
  19947. <dt>&lsquo;<samp class="samp">program_date_time</samp>&rsquo;</dt>
  19948. <dd><p>Generate <code class="code">EXT-X-PROGRAM-DATE-TIME</code> tags.
  19949. </p>
  19950. </dd>
  19951. <dt>&lsquo;<samp class="samp">second_level_segment_index</samp>&rsquo;</dt>
  19952. <dd><p>Makes it possible to use segment indexes as %%d in hls_segment_filename expression
  19953. besides date/time values when strftime is on.
  19954. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width.
  19955. </p>
  19956. </dd>
  19957. <dt>&lsquo;<samp class="samp">second_level_segment_size</samp>&rsquo;</dt>
  19958. <dd><p>Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename
  19959. expression besides date/time values when strftime is on.
  19960. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width.
  19961. </p>
  19962. </dd>
  19963. <dt>&lsquo;<samp class="samp">second_level_segment_duration</samp>&rsquo;</dt>
  19964. <dd><p>Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename
  19965. expression besides date/time values when strftime is on.
  19966. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width.
  19967. </p>
  19968. <div class="example">
  19969. <pre class="example-preformatted">ffmpeg -i sample.mpeg \
  19970. -f hls -hls_time 3 -hls_list_size 5 \
  19971. -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
  19972. -strftime 1 -strftime_mkdir 1 -hls_segment_filename &quot;segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts&quot; stream.m3u8
  19973. </pre></div>
  19974. <p>This will produce segments like this:
  19975. <samp class="file">segment_20170102194334_0003_00122200_0000003000000.ts</samp>, <samp class="file">segment_20170102194334_0004_00120072_0000003000000.ts</samp> etc.
  19976. </p>
  19977. </dd>
  19978. <dt>&lsquo;<samp class="samp">temp_file</samp>&rsquo;</dt>
  19979. <dd><p>Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
  19980. serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
  19981. before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
  19982. If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
  19983. But playlists with <code class="code">file</code> protocol and with type (<code class="code">hls_playlist_type</code>) other than <code class="code">vod</code>
  19984. are always written into temporary file regardless of this flag. Master playlist files (<code class="code">master_pl_name</code>), if any, with <code class="code">file</code> protocol,
  19985. are always written into temporary file regardless of this flag if <code class="code">master_pl_publish_rate</code> value is other than zero.
  19986. </p>
  19987. </dd>
  19988. </dl>
  19989. </dd>
  19990. <dt><samp class="option">hls_playlist_type event</samp></dt>
  19991. <dd><p>Emit <code class="code">#EXT-X-PLAYLIST-TYPE:EVENT</code> in the m3u8 header. Forces
  19992. <samp class="option">hls_list_size</samp> to 0; the playlist can only be appended to.
  19993. </p>
  19994. </dd>
  19995. <dt><samp class="option">hls_playlist_type vod</samp></dt>
  19996. <dd><p>Emit <code class="code">#EXT-X-PLAYLIST-TYPE:VOD</code> in the m3u8 header. Forces
  19997. <samp class="option">hls_list_size</samp> to 0; the playlist must not change.
  19998. </p>
  19999. </dd>
  20000. <dt><samp class="option">method</samp></dt>
  20001. <dd><p>Use the given HTTP method to create the hls files.
  20002. </p><div class="example">
  20003. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
  20004. </pre></div>
  20005. <p>This example will upload all the mpegts segment files to the HTTP
  20006. server using the HTTP PUT method, and update the m3u8 files every
  20007. <code class="code">refresh</code> times using the same method.
  20008. Note that the HTTP server must support the given method for uploading
  20009. files.
  20010. </p>
  20011. </dd>
  20012. <dt><samp class="option">http_user_agent</samp></dt>
  20013. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  20014. </p>
  20015. </dd>
  20016. <dt><samp class="option">var_stream_map</samp></dt>
  20017. <dd><p>Map string which specifies how to group the audio, video and subtitle streams
  20018. into different variant streams. The variant stream groups are separated
  20019. by space.
  20020. Expected string format is like this &quot;a:0,v:0 a:1,v:1 ....&quot;. Here a:, v:, s: are
  20021. the keys to specify audio, video and subtitle streams respectively.
  20022. Allowed values are 0 to 9 (limited just based on practical usage).
  20023. </p>
  20024. <p>When there are two or more variant streams, the output filename pattern must
  20025. contain the string &quot;%v&quot;, this string specifies the position of variant stream
  20026. index in the output media playlist filenames. The string &quot;%v&quot; may be present in
  20027. the filename or in the last directory name containing the file. If the string is
  20028. present in the directory name, then sub-directories are created after expanding
  20029. the directory name pattern. This enables creation of variant streams in
  20030. subdirectories.
  20031. </p>
  20032. <div class="example">
  20033. <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 \
  20034. -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; \
  20035. http://example.com/live/out_%v.m3u8
  20036. </pre></div>
  20037. <p>This example creates two hls variant streams. The first variant stream will
  20038. contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
  20039. second variant stream will contain video stream of bitrate 256k and audio
  20040. stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
  20041. out_1.m3u8 will be created. If you want something meaningful text instead of indexes
  20042. in result names, you may specify names for each or some of the variants
  20043. as in the following example.
  20044. </p>
  20045. <div class="example">
  20046. <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 \
  20047. -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; \
  20048. http://example.com/live/out_%v.m3u8
  20049. </pre></div>
  20050. <p>This example creates two hls variant streams as in the previous one.
  20051. But here, the two media playlist with file names out_my_hd.m3u8 and
  20052. out_my_sd.m3u8 will be created.
  20053. </p>
  20054. <div class="example">
  20055. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
  20056. -map 0:v -map 0:a -map 0:v -f hls -var_stream_map &quot;v:0 a:0 v:1&quot; \
  20057. http://example.com/live/out_%v.m3u8
  20058. </pre></div>
  20059. <p>This example creates three hls variant streams. The first variant stream will
  20060. be a video only stream with video bitrate 1000k, the second variant stream will
  20061. be an audio only stream with bitrate 64k and the third variant stream will be a
  20062. video only stream with bitrate 256k. Here, three media playlist with file names
  20063. out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created.
  20064. </p><div class="example">
  20065. <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 \
  20066. -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; \
  20067. http://example.com/live/vs_%v/out.m3u8
  20068. </pre></div>
  20069. <p>This example creates the variant streams in subdirectories. Here, the first
  20070. media playlist is created at <samp class="file">http://example.com/live/vs_0/out.m3u8</samp> and
  20071. the second one at <samp class="file">http://example.com/live/vs_1/out.m3u8</samp>.
  20072. </p><div class="example">
  20073. <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 \
  20074. -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
  20075. -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; \
  20076. -master_pl_name master.m3u8 \
  20077. http://example.com/live/out_%v.m3u8
  20078. </pre></div>
  20079. <p>This example creates two audio only and two video only variant streams. In
  20080. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  20081. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  20082. and they are mapped to the two video only variant streams with audio group names
  20083. &rsquo;aud_low&rsquo; and &rsquo;aud_high&rsquo;.
  20084. </p>
  20085. <p>By default, a single hls variant containing all the encoded streams is created.
  20086. </p>
  20087. <div class="example">
  20088. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  20089. -map 0:a -map 0:a -map 0:v -f hls \
  20090. -var_stream_map &quot;a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low&quot; \
  20091. -master_pl_name master.m3u8 \
  20092. http://example.com/live/out_%v.m3u8
  20093. </pre></div>
  20094. <p>This example creates two audio only and one video only variant streams. In
  20095. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  20096. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  20097. and they are mapped to the one video only variant streams with audio group name
  20098. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES.
  20099. </p>
  20100. <p>By default, a single hls variant containing all the encoded streams is created.
  20101. </p>
  20102. <div class="example">
  20103. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  20104. -map 0:a -map 0:a -map 0:v -f hls \
  20105. -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; \
  20106. -master_pl_name master.m3u8 \
  20107. http://example.com/live/out_%v.m3u8
  20108. </pre></div>
  20109. <p>This example creates two audio only and one video only variant streams. In
  20110. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  20111. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  20112. and they are mapped to the one video only variant streams with audio group name
  20113. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES, and one audio
  20114. have and language is named ENG, the other audio language is named CHN.
  20115. </p>
  20116. <p>By default, a single hls variant containing all the encoded streams is created.
  20117. </p>
  20118. <div class="example">
  20119. <pre class="example-preformatted">ffmpeg -y -i input_with_subtitle.mkv \
  20120. -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
  20121. -b:a:0 256k \
  20122. -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
  20123. -f hls -var_stream_map &quot;v:0,a:0,s:0,sgroup:subtitle&quot; \
  20124. -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
  20125. 10 -master_pl_publish_rate 10 -hls_flags \
  20126. delete_segments+discont_start+split_by_time ./tmp/video.m3u8
  20127. </pre></div>
  20128. <p>This example adds <code class="code">#EXT-X-MEDIA</code> tag with <code class="code">TYPE=SUBTITLES</code> in
  20129. the master playlist with webvtt subtitle group name &rsquo;subtitle&rsquo;. Please make sure
  20130. the input file has one text subtitle stream at least.
  20131. </p>
  20132. </dd>
  20133. <dt><samp class="option">cc_stream_map</samp></dt>
  20134. <dd><p>Map string which specifies different closed captions groups and their
  20135. attributes. The closed captions stream groups are separated by space.
  20136. Expected string format is like this
  20137. &quot;ccgroup:&lt;group name&gt;,instreamid:&lt;INSTREAM-ID&gt;,language:&lt;language code&gt; ....&quot;.
  20138. &rsquo;ccgroup&rsquo; and &rsquo;instreamid&rsquo; are mandatory attributes. &rsquo;language&rsquo; is an optional
  20139. attribute.
  20140. The closed captions groups configured using this option are mapped to different
  20141. variant streams by providing the same &rsquo;ccgroup&rsquo; name in the
  20142. <code class="code">var_stream_map</code> string. If <code class="code">var_stream_map</code> is not set, then the
  20143. first available ccgroup in <code class="code">cc_stream_map</code> is mapped to the output variant
  20144. stream. The examples for these two use cases are given below.
  20145. </p>
  20146. <div class="example">
  20147. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
  20148. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en&quot; \
  20149. -master_pl_name master.m3u8 \
  20150. http://example.com/live/out.m3u8
  20151. </pre></div>
  20152. <p>This example adds <code class="code">#EXT-X-MEDIA</code> tag with <code class="code">TYPE=CLOSED-CAPTIONS</code> in
  20153. the master playlist with group name &rsquo;cc&rsquo;, language &rsquo;en&rsquo; (english) and
  20154. INSTREAM-ID &rsquo;CC1&rsquo;. Also, it adds <code class="code">CLOSED-CAPTIONS</code> attribute with group
  20155. name &rsquo;cc&rsquo; for the output variant stream.
  20156. </p><div class="example">
  20157. <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 \
  20158. -a53cc:0 1 -a53cc:1 1\
  20159. -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
  20160. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp&quot; \
  20161. -var_stream_map &quot;v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc&quot; \
  20162. -master_pl_name master.m3u8 \
  20163. http://example.com/live/out_%v.m3u8
  20164. </pre></div>
  20165. <p>This example adds two <code class="code">#EXT-X-MEDIA</code> tags with <code class="code">TYPE=CLOSED-CAPTIONS</code> in
  20166. the master playlist for the INSTREAM-IDs &rsquo;CC1&rsquo; and &rsquo;CC2&rsquo;. Also, it adds
  20167. <code class="code">CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo; for the two output variant
  20168. streams.
  20169. </p>
  20170. </dd>
  20171. <dt><samp class="option">master_pl_name</samp></dt>
  20172. <dd><p>Create HLS master playlist with the given name.
  20173. </p>
  20174. <div class="example">
  20175. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
  20176. </pre></div>
  20177. <p>This example creates HLS master playlist with name master.m3u8 and it is
  20178. published at http://example.com/live/
  20179. </p>
  20180. </dd>
  20181. <dt><samp class="option">master_pl_publish_rate</samp></dt>
  20182. <dd><p>Publish master play list repeatedly every after specified number of segment intervals.
  20183. </p>
  20184. <div class="example">
  20185. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
  20186. -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
  20187. </pre></div>
  20188. <p>This example creates HLS master playlist with name master.m3u8 and keep
  20189. publishing it repeatedly every after 30 segments i.e. every after 60s.
  20190. </p>
  20191. </dd>
  20192. <dt><samp class="option">http_persistent</samp></dt>
  20193. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  20194. </p>
  20195. </dd>
  20196. <dt><samp class="option">timeout</samp></dt>
  20197. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  20198. </p>
  20199. </dd>
  20200. <dt><samp class="option">ignore_io_errors</samp></dt>
  20201. <dd><p>Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
  20202. </p>
  20203. </dd>
  20204. <dt><samp class="option">headers</samp></dt>
  20205. <dd><p>Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
  20206. </p>
  20207. </dd>
  20208. </dl>
  20209. <a class="anchor" id="ico"></a></div>
  20210. </div>
  20211. <div class="section-level-extent" id="ico-1">
  20212. <h3 class="section"><span>21.47 ico<a class="copiable-link" href="#ico-1"> &para;</a></span></h3>
  20213. <p>ICO file muxer.
  20214. </p>
  20215. <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
  20216. </p>
  20217. <ul class="itemize mark-bullet">
  20218. <li>Size cannot exceed 256 pixels in any dimension
  20219. </li><li>Only BMP and PNG images can be stored
  20220. </li><li>If a BMP image is used, it must be one of the following pixel formats:
  20221. <div class="example">
  20222. <pre class="example-preformatted">BMP Bit Depth FFmpeg Pixel Format
  20223. 1bit pal8
  20224. 4bit pal8
  20225. 8bit pal8
  20226. 16bit rgb555le
  20227. 24bit bgr24
  20228. 32bit bgra
  20229. </pre></div>
  20230. </li><li>If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  20231. </li><li>If a PNG image is used, it must use the rgba pixel format
  20232. </li></ul>
  20233. <a class="anchor" id="image2"></a></div>
  20234. <div class="section-level-extent" id="image2-2">
  20235. <h3 class="section"><span>21.48 image2<a class="copiable-link" href="#image2-2"> &para;</a></span></h3>
  20236. <p>Image file muxer.
  20237. </p>
  20238. <p>The image file muxer writes video frames to image files.
  20239. </p>
  20240. <p>The output filenames are specified by a pattern, which can be used to
  20241. produce sequentially numbered series of files.
  20242. The pattern may contain the string &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, this string
  20243. specifies the position of the characters representing a numbering in
  20244. the filenames. If the form &quot;%0<var class="var">N</var>d&quot; is used, the string
  20245. representing the number in each filename is 0-padded to <var class="var">N</var>
  20246. digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
  20247. the string &quot;%%&quot;.
  20248. </p>
  20249. <p>If the pattern contains &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, the first filename of
  20250. the file list specified will contain the number 1, all the following
  20251. numbers will be sequential.
  20252. </p>
  20253. <p>The pattern may contain a suffix which is used to automatically
  20254. determine the format of the image files to write.
  20255. </p>
  20256. <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
  20257. filenames of the form <samp class="file">img-001.bmp</samp>, <samp class="file">img-002.bmp</samp>, ...,
  20258. <samp class="file">img-010.bmp</samp>, etc.
  20259. The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
  20260. form <samp class="file">img%-1.jpg</samp>, <samp class="file">img%-2.jpg</samp>, ..., <samp class="file">img%-10.jpg</samp>,
  20261. etc.
  20262. </p>
  20263. <p>The image muxer supports the .Y.U.V image file format. This format is
  20264. special in that each image frame consists of three files, for
  20265. each of the YUV420P components. To read or write this image file format,
  20266. specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
  20267. &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
  20268. </p>
  20269. <ul class="mini-toc">
  20270. <li><a href="#Options-74" accesskey="1">Options</a></li>
  20271. <li><a href="#Examples-18" accesskey="2">Examples</a></li>
  20272. </ul>
  20273. <div class="subsection-level-extent" id="Options-74">
  20274. <h4 class="subsection"><span>21.48.1 Options<a class="copiable-link" href="#Options-74"> &para;</a></span></h4>
  20275. <dl class="table">
  20276. <dt><samp class="option">frame_pts</samp></dt>
  20277. <dd><p>If set to 1, expand the filename with pts from pkt-&gt;pts.
  20278. Default value is 0.
  20279. </p>
  20280. </dd>
  20281. <dt><samp class="option">start_number</samp></dt>
  20282. <dd><p>Start the sequence from the specified number. Default value is 1.
  20283. </p>
  20284. </dd>
  20285. <dt><samp class="option">update</samp></dt>
  20286. <dd><p>If set to 1, the filename will always be interpreted as just a
  20287. filename, not a pattern, and the corresponding file will be continuously
  20288. overwritten with new images. Default value is 0.
  20289. </p>
  20290. </dd>
  20291. <dt><samp class="option">strftime</samp></dt>
  20292. <dd><p>If set to 1, expand the filename with date and time information from
  20293. <code class="code">strftime()</code>. Default value is 0.
  20294. </p>
  20295. </dd>
  20296. <dt><samp class="option">atomic_writing</samp></dt>
  20297. <dd><p>Write output to a temporary file, which is renamed to target filename once
  20298. writing is completed. Default is disabled.
  20299. </p>
  20300. </dd>
  20301. <dt><samp class="option">protocol_opts <var class="var">options_list</var></samp></dt>
  20302. <dd><p>Set protocol options as a :-separated list of key=value parameters. Values
  20303. containing the <code class="code">:</code> special character must be escaped.
  20304. </p>
  20305. </dd>
  20306. </dl>
  20307. </div>
  20308. <div class="subsection-level-extent" id="Examples-18">
  20309. <h4 class="subsection"><span>21.48.2 Examples<a class="copiable-link" href="#Examples-18"> &para;</a></span></h4>
  20310. <p>The following example shows how to use <code class="command">ffmpeg</code> for creating a
  20311. sequence of files <samp class="file">img-001.jpeg</samp>, <samp class="file">img-002.jpeg</samp>, ...,
  20312. taking one image every second from the input video:
  20313. </p><div class="example">
  20314. <pre class="example-preformatted">ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
  20315. </pre></div>
  20316. <p>Note that with <code class="command">ffmpeg</code>, if the format is not specified with the
  20317. <code class="code">-f</code> option and the output filename specifies an image file
  20318. format, the image2 muxer is automatically selected, so the previous
  20319. command can be written as:
  20320. </p><div class="example">
  20321. <pre class="example-preformatted">ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
  20322. </pre></div>
  20323. <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
  20324. &quot;%0<var class="var">N</var>d&quot;, for example to create a single image file
  20325. <samp class="file">img.jpeg</samp> from the start of the input video you can employ the command:
  20326. </p><div class="example">
  20327. <pre class="example-preformatted">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  20328. </pre></div>
  20329. <p>The <samp class="option">strftime</samp> option allows you to expand the filename with
  20330. date and time information. Check the documentation of
  20331. the <code class="code">strftime()</code> function for the syntax.
  20332. </p>
  20333. <p>For example to generate image files from the <code class="code">strftime()</code>
  20334. &quot;%Y-%m-%d_%H-%M-%S&quot; pattern, the following <code class="command">ffmpeg</code> command
  20335. can be used:
  20336. </p><div class="example">
  20337. <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;
  20338. </pre></div>
  20339. <p>You can set the file name with current frame&rsquo;s PTS:
  20340. </p><div class="example">
  20341. <pre class="example-preformatted">ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg
  20342. </pre></div>
  20343. <p>A more complex example is to publish contents of your desktop directly to a
  20344. WebDAV server every second:
  20345. </p><div class="example">
  20346. <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
  20347. </pre></div>
  20348. </div>
  20349. </div>
  20350. <div class="section-level-extent" id="matroska">
  20351. <h3 class="section"><span>21.49 matroska<a class="copiable-link" href="#matroska"> &para;</a></span></h3>
  20352. <p>Matroska container muxer.
  20353. </p>
  20354. <p>This muxer implements the matroska and webm container specs.
  20355. </p>
  20356. <ul class="mini-toc">
  20357. <li><a href="#Metadata" accesskey="1">Metadata</a></li>
  20358. <li><a href="#Options-75" accesskey="2">Options</a></li>
  20359. </ul>
  20360. <div class="subsection-level-extent" id="Metadata">
  20361. <h4 class="subsection"><span>21.49.1 Metadata<a class="copiable-link" href="#Metadata"> &para;</a></span></h4>
  20362. <p>The recognized metadata settings in this muxer are:
  20363. </p>
  20364. <dl class="table">
  20365. <dt><samp class="option">title</samp></dt>
  20366. <dd><p>Set title name provided to a single track. This gets mapped to
  20367. the FileDescription element for a stream written as attachment.
  20368. </p>
  20369. </dd>
  20370. <dt><samp class="option">language</samp></dt>
  20371. <dd><p>Specify the language of the track in the Matroska languages form.
  20372. </p>
  20373. <p>The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  20374. 639-2/B) form (like &quot;fre&quot; for French), or a language code mixed with a
  20375. country code for specialities in languages (like &quot;fre-ca&quot; for Canadian
  20376. French).
  20377. </p>
  20378. </dd>
  20379. <dt><samp class="option">stereo_mode</samp></dt>
  20380. <dd><p>Set stereo 3D video layout of two views in a single video track.
  20381. </p>
  20382. <p>The following values are recognized:
  20383. </p><dl class="table">
  20384. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  20385. <dd><p>video is not stereo
  20386. </p></dd>
  20387. <dt>&lsquo;<samp class="samp">left_right</samp>&rsquo;</dt>
  20388. <dd><p>Both views are arranged side by side, Left-eye view is on the left
  20389. </p></dd>
  20390. <dt>&lsquo;<samp class="samp">bottom_top</samp>&rsquo;</dt>
  20391. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  20392. </p></dd>
  20393. <dt>&lsquo;<samp class="samp">top_bottom</samp>&rsquo;</dt>
  20394. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
  20395. </p></dd>
  20396. <dt>&lsquo;<samp class="samp">checkerboard_rl</samp>&rsquo;</dt>
  20397. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  20398. </p></dd>
  20399. <dt>&lsquo;<samp class="samp">checkerboard_lr</samp>&rsquo;</dt>
  20400. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  20401. </p></dd>
  20402. <dt>&lsquo;<samp class="samp">row_interleaved_rl</samp>&rsquo;</dt>
  20403. <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
  20404. </p></dd>
  20405. <dt>&lsquo;<samp class="samp">row_interleaved_lr</samp>&rsquo;</dt>
  20406. <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
  20407. </p></dd>
  20408. <dt>&lsquo;<samp class="samp">col_interleaved_rl</samp>&rsquo;</dt>
  20409. <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
  20410. </p></dd>
  20411. <dt>&lsquo;<samp class="samp">col_interleaved_lr</samp>&rsquo;</dt>
  20412. <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
  20413. </p></dd>
  20414. <dt>&lsquo;<samp class="samp">anaglyph_cyan_red</samp>&rsquo;</dt>
  20415. <dd><p>All frames are in anaglyph format viewable through red-cyan filters
  20416. </p></dd>
  20417. <dt>&lsquo;<samp class="samp">right_left</samp>&rsquo;</dt>
  20418. <dd><p>Both views are arranged side by side, Right-eye view is on the left
  20419. </p></dd>
  20420. <dt>&lsquo;<samp class="samp">anaglyph_green_magenta</samp>&rsquo;</dt>
  20421. <dd><p>All frames are in anaglyph format viewable through green-magenta filters
  20422. </p></dd>
  20423. <dt>&lsquo;<samp class="samp">block_lr</samp>&rsquo;</dt>
  20424. <dd><p>Both eyes laced in one Block, Left-eye view is first
  20425. </p></dd>
  20426. <dt>&lsquo;<samp class="samp">block_rl</samp>&rsquo;</dt>
  20427. <dd><p>Both eyes laced in one Block, Right-eye view is first
  20428. </p></dd>
  20429. </dl>
  20430. </dd>
  20431. </dl>
  20432. <p>For example a 3D WebM clip can be created using the following command line:
  20433. </p><div class="example">
  20434. <pre class="example-preformatted">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  20435. </pre></div>
  20436. </div>
  20437. <div class="subsection-level-extent" id="Options-75">
  20438. <h4 class="subsection"><span>21.49.2 Options<a class="copiable-link" href="#Options-75"> &para;</a></span></h4>
  20439. <p>This muxer supports the following options:
  20440. </p>
  20441. <dl class="table">
  20442. <dt><samp class="option">reserve_index_space</samp></dt>
  20443. <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
  20444. terms) at the end of the file, because it cannot know in advance how much space
  20445. to leave for the index at the beginning of the file. However for some use cases
  20446. &ndash; e.g. streaming where seeking is possible but slow &ndash; it is useful to put the
  20447. index at the beginning of the file.
  20448. </p>
  20449. <p>If this option is set to a non-zero value, the muxer will reserve a given amount
  20450. of space in the file header and then try to write the cues there when the muxing
  20451. finishes. If the reserved space does not suffice, no Cues will be written, the
  20452. file will be finalized and writing the trailer will return an error.
  20453. A safe size for most use cases should be about 50kB per hour of video.
  20454. </p>
  20455. <p>Note that cues are only written if the output is seekable and this option will
  20456. have no effect if it is not.
  20457. </p>
  20458. </dd>
  20459. <dt><samp class="option">cues_to_front</samp></dt>
  20460. <dd><p>If set, the muxer will write the index at the beginning of the file
  20461. by shifting the main data if necessary. This can be combined with
  20462. reserve_index_space in which case the data is only shifted if
  20463. the initially reserved space turns out to be insufficient.
  20464. </p>
  20465. <p>This option is ignored if the output is unseekable.
  20466. </p>
  20467. </dd>
  20468. <dt><samp class="option">default_mode</samp></dt>
  20469. <dd><p>This option controls how the FlagDefault of the output tracks will be set.
  20470. It influences which tracks players should play by default. The default mode
  20471. is &lsquo;<samp class="samp">passthrough</samp>&rsquo;.
  20472. </p><dl class="table">
  20473. <dt>&lsquo;<samp class="samp">infer</samp>&rsquo;</dt>
  20474. <dd><p>Every track with disposition default will have the FlagDefault set.
  20475. Additionally, for each type of track (audio, video or subtitle), if no track
  20476. with disposition default of this type exists, then the first track of this type
  20477. will be marked as default (if existing). This ensures that the default flag
  20478. is set in a sensible way even if the input originated from containers that
  20479. lack the concept of default tracks.
  20480. </p></dd>
  20481. <dt>&lsquo;<samp class="samp">infer_no_subs</samp>&rsquo;</dt>
  20482. <dd><p>This mode is the same as infer except that if no subtitle track with
  20483. disposition default exists, no subtitle track will be marked as default.
  20484. </p></dd>
  20485. <dt>&lsquo;<samp class="samp">passthrough</samp>&rsquo;</dt>
  20486. <dd><p>In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT
  20487. flag is set in the disposition of the corresponding stream.
  20488. </p></dd>
  20489. </dl>
  20490. </dd>
  20491. <dt><samp class="option">flipped_raw_rgb</samp></dt>
  20492. <dd><p>If set to true, store positive height for raw RGB bitmaps, which indicates
  20493. bitmap is stored bottom-up. Note that this option does not flip the bitmap
  20494. which has to be done manually beforehand, e.g. by using the vflip filter.
  20495. Default is <var class="var">false</var> and indicates bitmap is stored top down.
  20496. </p>
  20497. </dd>
  20498. </dl>
  20499. <a class="anchor" id="md5"></a></div>
  20500. </div>
  20501. <div class="section-level-extent" id="md5-1">
  20502. <h3 class="section"><span>21.50 md5<a class="copiable-link" href="#md5-1"> &para;</a></span></h3>
  20503. <p>MD5 testing format.
  20504. </p>
  20505. <p>This is a variant of the <a class="ref" href="#hash">hash</a> muxer. Unlike that muxer, it
  20506. defaults to using the MD5 hash function.
  20507. </p>
  20508. <ul class="mini-toc">
  20509. <li><a href="#Examples-19" accesskey="1">Examples</a></li>
  20510. </ul>
  20511. <div class="subsection-level-extent" id="Examples-19">
  20512. <h4 class="subsection"><span>21.50.1 Examples<a class="copiable-link" href="#Examples-19"> &para;</a></span></h4>
  20513. <p>To compute the MD5 hash of the input converted to raw
  20514. audio and video, and store it in the file <samp class="file">out.md5</samp>:
  20515. </p><div class="example">
  20516. <pre class="example-preformatted">ffmpeg -i INPUT -f md5 out.md5
  20517. </pre></div>
  20518. <p>You can print the MD5 to stdout with the command:
  20519. </p><div class="example">
  20520. <pre class="example-preformatted">ffmpeg -i INPUT -f md5 -
  20521. </pre></div>
  20522. <p>See also the <a class="ref" href="#hash">hash</a> and <a class="ref" href="#framemd5">framemd5</a> muxers.
  20523. </p>
  20524. </div>
  20525. </div>
  20526. <div class="section-level-extent" id="mp3">
  20527. <h3 class="section"><span>21.51 mp3<a class="copiable-link" href="#mp3"> &para;</a></span></h3>
  20528. <p>The MP3 muxer writes a raw MP3 stream with the following optional features:
  20529. </p><ul class="itemize mark-bullet">
  20530. <li>An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  20531. 2.4 are supported, the <code class="code">id3v2_version</code> private option controls which one is
  20532. used (3 or 4). Setting <code class="code">id3v2_version</code> to 0 disables the ID3v2 header
  20533. completely.
  20534. <p>The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  20535. The pictures are supplied to the muxer in form of a video stream with a single
  20536. packet. There can be any number of those streams, each will correspond to a
  20537. single APIC frame. The stream metadata tags <var class="var">title</var> and <var class="var">comment</var> map
  20538. to APIC <var class="var">description</var> and <var class="var">picture type</var> respectively. See
  20539. <a class="url" href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
  20540. </p>
  20541. <p>Note that the APIC frames must be written at the beginning, so the muxer will
  20542. buffer the audio frames until it gets all the pictures. It is therefore advised
  20543. to provide the pictures as soon as possible to avoid excessive buffering.
  20544. </p>
  20545. </li><li>A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  20546. default, but will be written only if the output is seekable. The
  20547. <code class="code">write_xing</code> private option can be used to disable it. The frame contains
  20548. various information that may be useful to the decoder, like the audio duration
  20549. or encoder delay.
  20550. </li><li>A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  20551. enabled with the <code class="code">write_id3v1</code> private option, but as its capabilities are
  20552. very limited, its usage is not recommended.
  20553. </li></ul>
  20554. <p>Examples:
  20555. </p>
  20556. <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  20557. </p><div class="example">
  20558. <pre class="example-preformatted">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  20559. </pre></div>
  20560. <p>To attach a picture to an mp3 file select both the audio and the picture stream
  20561. with <code class="code">map</code>:
  20562. </p><div class="example">
  20563. <pre class="example-preformatted">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  20564. -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
  20565. </pre></div>
  20566. <p>Write a &quot;clean&quot; MP3 without any extra features:
  20567. </p><div class="example">
  20568. <pre class="example-preformatted">ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  20569. </pre></div>
  20570. </div>
  20571. <div class="section-level-extent" id="mpegts-1">
  20572. <h3 class="section"><span>21.52 mpegts<a class="copiable-link" href="#mpegts-1"> &para;</a></span></h3>
  20573. <p>MPEG transport stream muxer.
  20574. </p>
  20575. <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  20576. </p>
  20577. <p>The recognized metadata settings in mpegts muxer are <code class="code">service_provider</code>
  20578. and <code class="code">service_name</code>. If they are not set the default for
  20579. <code class="code">service_provider</code> is &lsquo;<samp class="samp">FFmpeg</samp>&rsquo; and the default for
  20580. <code class="code">service_name</code> is &lsquo;<samp class="samp">Service01</samp>&rsquo;.
  20581. </p>
  20582. <ul class="mini-toc">
  20583. <li><a href="#Options-76" accesskey="1">Options</a></li>
  20584. <li><a href="#Example-8" accesskey="2">Example</a></li>
  20585. </ul>
  20586. <div class="subsection-level-extent" id="Options-76">
  20587. <h4 class="subsection"><span>21.52.1 Options<a class="copiable-link" href="#Options-76"> &para;</a></span></h4>
  20588. <p>The muxer options are:
  20589. </p>
  20590. <dl class="table">
  20591. <dt><samp class="option">mpegts_transport_stream_id <var class="var">integer</var></samp></dt>
  20592. <dd><p>Set the &lsquo;<samp class="samp">transport_stream_id</samp>&rsquo;. This identifies a transponder in DVB.
  20593. Default is <code class="code">0x0001</code>.
  20594. </p>
  20595. </dd>
  20596. <dt><samp class="option">mpegts_original_network_id <var class="var">integer</var></samp></dt>
  20597. <dd><p>Set the &lsquo;<samp class="samp">original_network_id</samp>&rsquo;. This is unique identifier of a
  20598. network in DVB. Its main use is in the unique identification of a service
  20599. through the path &lsquo;<samp class="samp">Original_Network_ID, Transport_Stream_ID</samp>&rsquo;. Default
  20600. is <code class="code">0x0001</code>.
  20601. </p>
  20602. </dd>
  20603. <dt><samp class="option">mpegts_service_id <var class="var">integer</var></samp></dt>
  20604. <dd><p>Set the &lsquo;<samp class="samp">service_id</samp>&rsquo;, also known as program in DVB. Default is
  20605. <code class="code">0x0001</code>.
  20606. </p>
  20607. </dd>
  20608. <dt><samp class="option">mpegts_service_type <var class="var">integer</var></samp></dt>
  20609. <dd><p>Set the program &lsquo;<samp class="samp">service_type</samp>&rsquo;. Default is <code class="code">digital_tv</code>.
  20610. Accepts the following options:
  20611. </p><dl class="table">
  20612. <dt>&lsquo;<samp class="samp">hex_value</samp>&rsquo;</dt>
  20613. <dd><p>Any hexadecimal value between <code class="code">0x01</code> and <code class="code">0xff</code> as defined in
  20614. ETSI 300 468.
  20615. </p></dd>
  20616. <dt>&lsquo;<samp class="samp">digital_tv</samp>&rsquo;</dt>
  20617. <dd><p>Digital TV service.
  20618. </p></dd>
  20619. <dt>&lsquo;<samp class="samp">digital_radio</samp>&rsquo;</dt>
  20620. <dd><p>Digital Radio service.
  20621. </p></dd>
  20622. <dt>&lsquo;<samp class="samp">teletext</samp>&rsquo;</dt>
  20623. <dd><p>Teletext service.
  20624. </p></dd>
  20625. <dt>&lsquo;<samp class="samp">advanced_codec_digital_radio</samp>&rsquo;</dt>
  20626. <dd><p>Advanced Codec Digital Radio service.
  20627. </p></dd>
  20628. <dt>&lsquo;<samp class="samp">mpeg2_digital_hdtv</samp>&rsquo;</dt>
  20629. <dd><p>MPEG2 Digital HDTV service.
  20630. </p></dd>
  20631. <dt>&lsquo;<samp class="samp">advanced_codec_digital_sdtv</samp>&rsquo;</dt>
  20632. <dd><p>Advanced Codec Digital SDTV service.
  20633. </p></dd>
  20634. <dt>&lsquo;<samp class="samp">advanced_codec_digital_hdtv</samp>&rsquo;</dt>
  20635. <dd><p>Advanced Codec Digital HDTV service.
  20636. </p></dd>
  20637. </dl>
  20638. </dd>
  20639. <dt><samp class="option">mpegts_pmt_start_pid <var class="var">integer</var></samp></dt>
  20640. <dd><p>Set the first PID for PMTs. Default is <code class="code">0x1000</code>, minimum is <code class="code">0x0020</code>,
  20641. maximum is <code class="code">0x1ffa</code>. This option has no effect in m2ts mode where the PMT
  20642. PID is fixed <code class="code">0x0100</code>.
  20643. </p>
  20644. </dd>
  20645. <dt><samp class="option">mpegts_start_pid <var class="var">integer</var></samp></dt>
  20646. <dd><p>Set the first PID for elementary streams. Default is <code class="code">0x0100</code>, minimum is
  20647. <code class="code">0x0020</code>, maximum is <code class="code">0x1ffa</code>. This option has no effect in m2ts mode
  20648. where the elementary stream PIDs are fixed.
  20649. </p>
  20650. </dd>
  20651. <dt><samp class="option">mpegts_m2ts_mode <var class="var">boolean</var></samp></dt>
  20652. <dd><p>Enable m2ts mode if set to <code class="code">1</code>. Default value is <code class="code">-1</code> which
  20653. disables m2ts mode.
  20654. </p>
  20655. </dd>
  20656. <dt><samp class="option">muxrate <var class="var">integer</var></samp></dt>
  20657. <dd><p>Set a constant muxrate. Default is VBR.
  20658. </p>
  20659. </dd>
  20660. <dt><samp class="option">pes_payload_size <var class="var">integer</var></samp></dt>
  20661. <dd><p>Set minimum PES packet payload in bytes. Default is <code class="code">2930</code>.
  20662. </p>
  20663. </dd>
  20664. <dt><samp class="option">mpegts_flags <var class="var">flags</var></samp></dt>
  20665. <dd><p>Set mpegts flags. Accepts the following options:
  20666. </p><dl class="table">
  20667. <dt>&lsquo;<samp class="samp">resend_headers</samp>&rsquo;</dt>
  20668. <dd><p>Reemit PAT/PMT before writing the next packet.
  20669. </p></dd>
  20670. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  20671. <dd><p>Use LATM packetization for AAC.
  20672. </p></dd>
  20673. <dt>&lsquo;<samp class="samp">pat_pmt_at_frames</samp>&rsquo;</dt>
  20674. <dd><p>Reemit PAT and PMT at each video frame.
  20675. </p></dd>
  20676. <dt>&lsquo;<samp class="samp">system_b</samp>&rsquo;</dt>
  20677. <dd><p>Conform to System B (DVB) instead of System A (ATSC).
  20678. </p></dd>
  20679. <dt>&lsquo;<samp class="samp">initial_discontinuity</samp>&rsquo;</dt>
  20680. <dd><p>Mark the initial packet of each stream as discontinuity.
  20681. </p></dd>
  20682. <dt>&lsquo;<samp class="samp">nit</samp>&rsquo;</dt>
  20683. <dd><p>Emit NIT table.
  20684. </p></dd>
  20685. <dt>&lsquo;<samp class="samp">omit_rai</samp>&rsquo;</dt>
  20686. <dd><p>Disable writing of random access indicator.
  20687. </p></dd>
  20688. </dl>
  20689. </dd>
  20690. <dt><samp class="option">mpegts_copyts <var class="var">boolean</var></samp></dt>
  20691. <dd><p>Preserve original timestamps, if value is set to <code class="code">1</code>. Default value
  20692. is <code class="code">-1</code>, which results in shifting timestamps so that they start from 0.
  20693. </p>
  20694. </dd>
  20695. <dt><samp class="option">omit_video_pes_length <var class="var">boolean</var></samp></dt>
  20696. <dd><p>Omit the PES packet length for video packets. Default is <code class="code">1</code> (true).
  20697. </p>
  20698. </dd>
  20699. <dt><samp class="option">pcr_period <var class="var">integer</var></samp></dt>
  20700. <dd><p>Override the default PCR retransmission time in milliseconds. Default is
  20701. <code class="code">-1</code> which means that the PCR interval will be determined automatically:
  20702. 20 ms is used for CBR streams, the highest multiple of the frame duration which
  20703. is less than 100 ms is used for VBR streams.
  20704. </p>
  20705. </dd>
  20706. <dt><samp class="option">pat_period <var class="var">duration</var></samp></dt>
  20707. <dd><p>Maximum time in seconds between PAT/PMT tables. Default is <code class="code">0.1</code>.
  20708. </p>
  20709. </dd>
  20710. <dt><samp class="option">sdt_period <var class="var">duration</var></samp></dt>
  20711. <dd><p>Maximum time in seconds between SDT tables. Default is <code class="code">0.5</code>.
  20712. </p>
  20713. </dd>
  20714. <dt><samp class="option">nit_period <var class="var">duration</var></samp></dt>
  20715. <dd><p>Maximum time in seconds between NIT tables. Default is <code class="code">0.5</code>.
  20716. </p>
  20717. </dd>
  20718. <dt><samp class="option">tables_version <var class="var">integer</var></samp></dt>
  20719. <dd><p>Set PAT, PMT, SDT and NIT version (default <code class="code">0</code>, valid values are from 0 to 31, inclusively).
  20720. This option allows updating stream structure so that standard consumer may
  20721. detect the change. To do so, reopen output <code class="code">AVFormatContext</code> (in case of API
  20722. usage) or restart <code class="command">ffmpeg</code> instance, cyclically changing
  20723. <samp class="option">tables_version</samp> value:
  20724. </p>
  20725. <div class="example">
  20726. <pre class="example-preformatted">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  20727. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  20728. ...
  20729. ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  20730. ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  20731. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  20732. ...
  20733. </pre></div>
  20734. </dd>
  20735. </dl>
  20736. </div>
  20737. <div class="subsection-level-extent" id="Example-8">
  20738. <h4 class="subsection"><span>21.52.2 Example<a class="copiable-link" href="#Example-8"> &para;</a></span></h4>
  20739. <div class="example">
  20740. <pre class="example-preformatted">ffmpeg -i file.mpg -c copy \
  20741. -mpegts_original_network_id 0x1122 \
  20742. -mpegts_transport_stream_id 0x3344 \
  20743. -mpegts_service_id 0x5566 \
  20744. -mpegts_pmt_start_pid 0x1500 \
  20745. -mpegts_start_pid 0x150 \
  20746. -metadata service_provider=&quot;Some provider&quot; \
  20747. -metadata service_name=&quot;Some Channel&quot; \
  20748. out.ts
  20749. </pre></div>
  20750. </div>
  20751. </div>
  20752. <div class="section-level-extent" id="mxf_002c-mxf_005fd10_002c-mxf_005fopatom">
  20753. <h3 class="section"><span>21.53 mxf, mxf_d10, mxf_opatom<a class="copiable-link" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom"> &para;</a></span></h3>
  20754. <p>MXF muxer.
  20755. </p>
  20756. <ul class="mini-toc">
  20757. <li><a href="#Options-77" accesskey="1">Options</a></li>
  20758. </ul>
  20759. <div class="subsection-level-extent" id="Options-77">
  20760. <h4 class="subsection"><span>21.53.1 Options<a class="copiable-link" href="#Options-77"> &para;</a></span></h4>
  20761. <p>The muxer options are:
  20762. </p>
  20763. <dl class="table">
  20764. <dt><samp class="option">store_user_comments <var class="var">bool</var></samp></dt>
  20765. <dd><p>Set if user comments should be stored if available or never.
  20766. IRT D-10 does not allow user comments. The default is thus to write them for
  20767. mxf and mxf_opatom but not for mxf_d10
  20768. </p></dd>
  20769. </dl>
  20770. </div>
  20771. </div>
  20772. <div class="section-level-extent" id="null-1">
  20773. <h3 class="section"><span>21.54 null<a class="copiable-link" href="#null-1"> &para;</a></span></h3>
  20774. <p>Null muxer.
  20775. </p>
  20776. <p>This muxer does not generate any output file, it is mainly useful for
  20777. testing or benchmarking purposes.
  20778. </p>
  20779. <p>For example to benchmark decoding with <code class="command">ffmpeg</code> you can use the
  20780. command:
  20781. </p><div class="example">
  20782. <pre class="example-preformatted">ffmpeg -benchmark -i INPUT -f null out.null
  20783. </pre></div>
  20784. <p>Note that the above command does not read or write the <samp class="file">out.null</samp>
  20785. file, but specifying the output file is required by the <code class="command">ffmpeg</code>
  20786. syntax.
  20787. </p>
  20788. <p>Alternatively you can write the command as:
  20789. </p><div class="example">
  20790. <pre class="example-preformatted">ffmpeg -benchmark -i INPUT -f null -
  20791. </pre></div>
  20792. </div>
  20793. <div class="section-level-extent" id="nut">
  20794. <h3 class="section"><span>21.55 nut<a class="copiable-link" href="#nut"> &para;</a></span></h3>
  20795. <dl class="table">
  20796. <dt><samp class="option">-syncpoints <var class="var">flags</var></samp></dt>
  20797. <dd><p>Change the syncpoint usage in nut:
  20798. </p><dl class="table">
  20799. <dt><samp class="option"><var class="var">default</var> use the normal low-overhead seeking aids.</samp></dt>
  20800. <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>
  20801. <dd><p>Use of this option is not recommended, as the resulting files are very damage
  20802. sensitive and seeking is not possible. Also in general the overhead from
  20803. syncpoints is negligible. Note, -<code class="code">write_index</code> 0 can be used to disable
  20804. all growing data tables, allowing to mux endless streams with limited memory
  20805. and without these disadvantages.
  20806. </p></dd>
  20807. <dt><samp class="option"><var class="var">timestamped</var> extend the syncpoint with a wallclock field.</samp></dt>
  20808. </dl>
  20809. <p>The <var class="var">none</var> and <var class="var">timestamped</var> flags are experimental.
  20810. </p></dd>
  20811. <dt><samp class="option">-write_index <var class="var">bool</var></samp></dt>
  20812. <dd><p>Write index at the end, the default is to write an index.
  20813. </p></dd>
  20814. </dl>
  20815. <div class="example">
  20816. <pre class="example-preformatted">ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  20817. </pre></div>
  20818. </div>
  20819. <div class="section-level-extent" id="ogg">
  20820. <h3 class="section"><span>21.56 ogg<a class="copiable-link" href="#ogg"> &para;</a></span></h3>
  20821. <p>Ogg container muxer.
  20822. </p>
  20823. <dl class="table">
  20824. <dt><samp class="option">-page_duration <var class="var">duration</var></samp></dt>
  20825. <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
  20826. pages that are approximately <var class="var">duration</var> microseconds long. This allows the
  20827. user to compromise between seek granularity and container overhead. The default
  20828. is 1 second. A value of 0 will fill all segments, making pages as large as
  20829. possible. A value of 1 will effectively use 1 packet-per-page in most
  20830. situations, giving a small seek granularity at the cost of additional container
  20831. overhead.
  20832. </p></dd>
  20833. <dt><samp class="option">-serial_offset <var class="var">value</var></samp></dt>
  20834. <dd><p>Serial value from which to set the streams serial number.
  20835. Setting it to different and sufficiently large values ensures that the produced
  20836. ogg files can be safely chained.
  20837. </p>
  20838. </dd>
  20839. </dl>
  20840. <a class="anchor" id="rcwt"></a></div>
  20841. <div class="section-level-extent" id="rcwt-1">
  20842. <h3 class="section"><span>21.57 rcwt<a class="copiable-link" href="#rcwt-1"> &para;</a></span></h3>
  20843. <p>Raw Captions With Time (RCWT) is a format native to ccextractor, a commonly
  20844. used open source tool for processing 608/708 closed caption (CC) sources.
  20845. It can be used to archive the original, raw CC bitstream and to produce
  20846. a source file for later CC processing or conversion. As a result,
  20847. it also allows for interopability with ccextractor for processing CC data
  20848. extracted via ffmpeg. The format is simple to parse and can be used
  20849. to retain all lines and variants of CC.
  20850. </p>
  20851. <p>This muxer implements the specification as of 2024-01-05, which has
  20852. been stable and unchanged for 10 years as of this writing.
  20853. </p>
  20854. <p>This muxer will have some nuances from the way that ccextractor muxes RCWT.
  20855. No compatibility issues when processing the output with ccextractor
  20856. have been observed as a result of this so far, but mileage may vary
  20857. and outputs will not be a bit-exact match.
  20858. </p>
  20859. <p>A free specification of RCWT can be found here:
  20860. <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>
  20861. </p>
  20862. <a class="anchor" id="segment"></a></div>
  20863. <div class="section-level-extent" id="segment_002c-stream_005fsegment_002c-ssegment">
  20864. <h3 class="section"><span>21.58 segment, stream_segment, ssegment<a class="copiable-link" href="#segment_002c-stream_005fsegment_002c-ssegment"> &para;</a></span></h3>
  20865. <p>Basic stream segmenter.
  20866. </p>
  20867. <p>This muxer outputs streams to a number of separate files of nearly
  20868. fixed duration. Output filename pattern can be set in a fashion
  20869. similar to <a class="ref" href="#image2">image2</a>, or by using a <code class="code">strftime</code> template if
  20870. the <samp class="option">strftime</samp> option is enabled.
  20871. </p>
  20872. <p><code class="code">stream_segment</code> is a variant of the muxer used to write to
  20873. streaming output formats, i.e. which do not require global headers,
  20874. and is recommended for outputting e.g. to MPEG transport stream segments.
  20875. <code class="code">ssegment</code> is a shorter alias for <code class="code">stream_segment</code>.
  20876. </p>
  20877. <p>Every segment starts with a keyframe of the selected reference stream,
  20878. which is set through the <samp class="option">reference_stream</samp> option.
  20879. </p>
  20880. <p>Note that if you want accurate splitting for a video file, you need to
  20881. make the input key frames correspond to the exact splitting times
  20882. expected by the segmenter, or the segment muxer will start the new
  20883. segment with the key frame found next after the specified start
  20884. time.
  20885. </p>
  20886. <p>The segment muxer works best with a single constant frame rate video.
  20887. </p>
  20888. <p>Optionally it can generate a list of the created segments, by setting
  20889. the option <var class="var">segment_list</var>. The list type is specified by the
  20890. <var class="var">segment_list_type</var> option. The entry filenames in the segment
  20891. list are set by default to the basename of the corresponding segment
  20892. files.
  20893. </p>
  20894. <p>See also the <a class="ref" href="#hls">hls</a> muxer, which provides a more specific
  20895. implementation for HLS segmentation.
  20896. </p>
  20897. <ul class="mini-toc">
  20898. <li><a href="#Options-78" accesskey="1">Options</a></li>
  20899. <li><a href="#Examples-20" accesskey="2">Examples</a></li>
  20900. </ul>
  20901. <div class="subsection-level-extent" id="Options-78">
  20902. <h4 class="subsection"><span>21.58.1 Options<a class="copiable-link" href="#Options-78"> &para;</a></span></h4>
  20903. <p>The segment muxer supports the following options:
  20904. </p>
  20905. <dl class="table">
  20906. <dt><samp class="option">increment_tc <var class="var">1|0</var></samp></dt>
  20907. <dd><p>if set to <code class="code">1</code>, increment timecode between each segment
  20908. If this is selected, the input need to have
  20909. a timecode in the first video stream. Default value is
  20910. <code class="code">0</code>.
  20911. </p>
  20912. </dd>
  20913. <dt><samp class="option">reference_stream <var class="var">specifier</var></samp></dt>
  20914. <dd><p>Set the reference stream, as specified by the string <var class="var">specifier</var>.
  20915. If <var class="var">specifier</var> is set to <code class="code">auto</code>, the reference is chosen
  20916. automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
  20917. specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
  20918. reference stream. The default value is <code class="code">auto</code>.
  20919. </p>
  20920. </dd>
  20921. <dt><samp class="option">segment_format <var class="var">format</var></samp></dt>
  20922. <dd><p>Override the inner container format, by default it is guessed by the filename
  20923. extension.
  20924. </p>
  20925. </dd>
  20926. <dt><samp class="option">segment_format_options <var class="var">options_list</var></samp></dt>
  20927. <dd><p>Set output format options using a :-separated list of key=value
  20928. parameters. Values containing the <code class="code">:</code> special character must be
  20929. escaped.
  20930. </p>
  20931. </dd>
  20932. <dt><samp class="option">segment_list <var class="var">name</var></samp></dt>
  20933. <dd><p>Generate also a listfile named <var class="var">name</var>. If not specified no
  20934. listfile is generated.
  20935. </p>
  20936. </dd>
  20937. <dt><samp class="option">segment_list_flags <var class="var">flags</var></samp></dt>
  20938. <dd><p>Set flags affecting the segment list generation.
  20939. </p>
  20940. <p>It currently supports the following flags:
  20941. </p><dl class="table">
  20942. <dt>&lsquo;<samp class="samp">cache</samp>&rsquo;</dt>
  20943. <dd><p>Allow caching (only affects M3U8 list files).
  20944. </p>
  20945. </dd>
  20946. <dt>&lsquo;<samp class="samp">live</samp>&rsquo;</dt>
  20947. <dd><p>Allow live-friendly file generation.
  20948. </p></dd>
  20949. </dl>
  20950. </dd>
  20951. <dt><samp class="option">segment_list_size <var class="var">size</var></samp></dt>
  20952. <dd><p>Update the list file so that it contains at most <var class="var">size</var>
  20953. segments. If 0 the list file will contain all the segments. Default
  20954. value is 0.
  20955. </p>
  20956. </dd>
  20957. <dt><samp class="option">segment_list_entry_prefix <var class="var">prefix</var></samp></dt>
  20958. <dd><p>Prepend <var class="var">prefix</var> to each entry. Useful to generate absolute paths.
  20959. By default no prefix is applied.
  20960. </p>
  20961. </dd>
  20962. <dt><samp class="option">segment_list_type <var class="var">type</var></samp></dt>
  20963. <dd><p>Select the listing format.
  20964. </p>
  20965. <p>The following values are recognized:
  20966. </p><dl class="table">
  20967. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  20968. <dd><p>Generate a flat list for the created segments, one segment per line.
  20969. </p>
  20970. </dd>
  20971. <dt>&lsquo;<samp class="samp">csv, ext</samp>&rsquo;</dt>
  20972. <dd><p>Generate a list for the created segments, one segment per line,
  20973. each line matching the format (comma-separated values):
  20974. </p><div class="example">
  20975. <pre class="example-preformatted"><var class="var">segment_filename</var>,<var class="var">segment_start_time</var>,<var class="var">segment_end_time</var>
  20976. </pre></div>
  20977. <p><var class="var">segment_filename</var> is the name of the output file generated by the
  20978. muxer according to the provided pattern. CSV escaping (according to
  20979. RFC4180) is applied if required.
  20980. </p>
  20981. <p><var class="var">segment_start_time</var> and <var class="var">segment_end_time</var> specify
  20982. the segment start and end time expressed in seconds.
  20983. </p>
  20984. <p>A list file with the suffix <code class="code">&quot;.csv&quot;</code> or <code class="code">&quot;.ext&quot;</code> will
  20985. auto-select this format.
  20986. </p>
  20987. <p>&lsquo;<samp class="samp">ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp class="samp">csv</samp>&rsquo;.
  20988. </p>
  20989. </dd>
  20990. <dt>&lsquo;<samp class="samp">ffconcat</samp>&rsquo;</dt>
  20991. <dd><p>Generate an ffconcat file for the created segments. The resulting file
  20992. can be read using the FFmpeg <a class="ref" href="#concat">concat</a> demuxer.
  20993. </p>
  20994. <p>A list file with the suffix <code class="code">&quot;.ffcat&quot;</code> or <code class="code">&quot;.ffconcat&quot;</code> will
  20995. auto-select this format.
  20996. </p>
  20997. </dd>
  20998. <dt>&lsquo;<samp class="samp">m3u8</samp>&rsquo;</dt>
  20999. <dd><p>Generate an extended M3U8 file, version 3, compliant with
  21000. <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>.
  21001. </p>
  21002. <p>A list file with the suffix <code class="code">&quot;.m3u8&quot;</code> will auto-select this format.
  21003. </p></dd>
  21004. </dl>
  21005. <p>If not specified the type is guessed from the list file name suffix.
  21006. </p>
  21007. </dd>
  21008. <dt><samp class="option">segment_time <var class="var">time</var></samp></dt>
  21009. <dd><p>Set segment duration to <var class="var">time</var>, the value must be a duration
  21010. specification. Default value is &quot;2&quot;. See also the
  21011. <samp class="option">segment_times</samp> option.
  21012. </p>
  21013. <p>Note that splitting may not be accurate, unless you force the
  21014. reference stream key-frames at the given time. See the introductory
  21015. notice and the examples below.
  21016. </p>
  21017. </dd>
  21018. <dt><samp class="option">min_seg_duration <var class="var">time</var></samp></dt>
  21019. <dd><p>Set minimum segment duration to <var class="var">time</var>, the value must be a duration
  21020. specification. This prevents the muxer ending segments at a duration below
  21021. this value. Only effective with <code class="code">segment_time</code>. Default value is &quot;0&quot;.
  21022. </p>
  21023. </dd>
  21024. <dt><samp class="option">segment_atclocktime <var class="var">1|0</var></samp></dt>
  21025. <dd><p>If set to &quot;1&quot; split at regular clock time intervals starting from 00:00
  21026. o&rsquo;clock. The <var class="var">time</var> value specified in <samp class="option">segment_time</samp> is
  21027. used for setting the length of the splitting interval.
  21028. </p>
  21029. <p>For example with <samp class="option">segment_time</samp> set to &quot;900&quot; this makes it possible
  21030. to create files at 12:00 o&rsquo;clock, 12:15, 12:30, etc.
  21031. </p>
  21032. <p>Default value is &quot;0&quot;.
  21033. </p>
  21034. </dd>
  21035. <dt><samp class="option">segment_clocktime_offset <var class="var">duration</var></samp></dt>
  21036. <dd><p>Delay the segment splitting times with the specified duration when using
  21037. <samp class="option">segment_atclocktime</samp>.
  21038. </p>
  21039. <p>For example with <samp class="option">segment_time</samp> set to &quot;900&quot; and
  21040. <samp class="option">segment_clocktime_offset</samp> set to &quot;300&quot; this makes it possible to
  21041. create files at 12:05, 12:20, 12:35, etc.
  21042. </p>
  21043. <p>Default value is &quot;0&quot;.
  21044. </p>
  21045. </dd>
  21046. <dt><samp class="option">segment_clocktime_wrap_duration <var class="var">duration</var></samp></dt>
  21047. <dd><p>Force the segmenter to only start a new segment if a packet reaches the muxer
  21048. within the specified duration after the segmenting clock time. This way you
  21049. can make the segmenter more resilient to backward local time jumps, such as
  21050. leap seconds or transition to standard time from daylight savings time.
  21051. </p>
  21052. <p>Default is the maximum possible duration which means starting a new segment
  21053. regardless of the elapsed time since the last clock time.
  21054. </p>
  21055. </dd>
  21056. <dt><samp class="option">segment_time_delta <var class="var">delta</var></samp></dt>
  21057. <dd><p>Specify the accuracy time when selecting the start time for a
  21058. segment, expressed as a duration specification. Default value is &quot;0&quot;.
  21059. </p>
  21060. <p>When delta is specified a key-frame will start a new segment if its
  21061. PTS satisfies the relation:
  21062. </p><div class="example">
  21063. <pre class="example-preformatted">PTS &gt;= start_time - time_delta
  21064. </pre></div>
  21065. <p>This option is useful when splitting video content, which is always
  21066. split at GOP boundaries, in case a key frame is found just before the
  21067. specified split time.
  21068. </p>
  21069. <p>In particular may be used in combination with the <samp class="file">ffmpeg</samp> option
  21070. <var class="var">force_key_frames</var>. The key frame times specified by
  21071. <var class="var">force_key_frames</var> may not be set accurately because of rounding
  21072. issues, with the consequence that a key frame time may result set just
  21073. before the specified time. For constant frame rate videos a value of
  21074. 1/(2*<var class="var">frame_rate</var>) should address the worst case mismatch between
  21075. the specified time and the time set by <var class="var">force_key_frames</var>.
  21076. </p>
  21077. </dd>
  21078. <dt><samp class="option">segment_times <var class="var">times</var></samp></dt>
  21079. <dd><p>Specify a list of split points. <var class="var">times</var> contains a list of comma
  21080. separated duration specifications, in increasing order. See also
  21081. the <samp class="option">segment_time</samp> option.
  21082. </p>
  21083. </dd>
  21084. <dt><samp class="option">segment_frames <var class="var">frames</var></samp></dt>
  21085. <dd><p>Specify a list of split video frame numbers. <var class="var">frames</var> contains a
  21086. list of comma separated integer numbers, in increasing order.
  21087. </p>
  21088. <p>This option specifies to start a new segment whenever a reference
  21089. stream key frame is found and the sequential number (starting from 0)
  21090. of the frame is greater or equal to the next value in the list.
  21091. </p>
  21092. </dd>
  21093. <dt><samp class="option">segment_wrap <var class="var">limit</var></samp></dt>
  21094. <dd><p>Wrap around segment index once it reaches <var class="var">limit</var>.
  21095. </p>
  21096. </dd>
  21097. <dt><samp class="option">segment_start_number <var class="var">number</var></samp></dt>
  21098. <dd><p>Set the sequence number of the first segment. Defaults to <code class="code">0</code>.
  21099. </p>
  21100. </dd>
  21101. <dt><samp class="option">strftime <var class="var">1|0</var></samp></dt>
  21102. <dd><p>Use the <code class="code">strftime</code> function to define the name of the new
  21103. segments to write. If this is selected, the output segment name must
  21104. contain a <code class="code">strftime</code> function template. Default value is
  21105. <code class="code">0</code>.
  21106. </p>
  21107. </dd>
  21108. <dt><samp class="option">break_non_keyframes <var class="var">1|0</var></samp></dt>
  21109. <dd><p>If enabled, allow segments to start on frames other than keyframes. This
  21110. improves behavior on some players when the time between keyframes is
  21111. inconsistent, but may make things worse on others, and can cause some oddities
  21112. during seeking. Defaults to <code class="code">0</code>.
  21113. </p>
  21114. </dd>
  21115. <dt><samp class="option">reset_timestamps <var class="var">1|0</var></samp></dt>
  21116. <dd><p>Reset timestamps at the beginning of each segment, so that each segment
  21117. will start with near-zero timestamps. It is meant to ease the playback
  21118. of the generated segments. May not work with some combinations of
  21119. muxers/codecs. It is set to <code class="code">0</code> by default.
  21120. </p>
  21121. </dd>
  21122. <dt><samp class="option">initial_offset <var class="var">offset</var></samp></dt>
  21123. <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
  21124. argument must be a time duration specification, and defaults to 0.
  21125. </p>
  21126. </dd>
  21127. <dt><samp class="option">write_empty_segments <var class="var">1|0</var></samp></dt>
  21128. <dd><p>If enabled, write an empty segment if there are no packets during the period a
  21129. segment would usually span. Otherwise, the segment will be filled with the next
  21130. packet written. Defaults to <code class="code">0</code>.
  21131. </p></dd>
  21132. </dl>
  21133. <p>Make sure to require a closed GOP when encoding and to set the GOP
  21134. size to fit your segment time constraint.
  21135. </p>
  21136. </div>
  21137. <div class="subsection-level-extent" id="Examples-20">
  21138. <h4 class="subsection"><span>21.58.2 Examples<a class="copiable-link" href="#Examples-20"> &para;</a></span></h4>
  21139. <ul class="itemize mark-bullet">
  21140. <li>Remux the content of file <samp class="file">in.mkv</samp> to a list of segments
  21141. <samp class="file">out-000.nut</samp>, <samp class="file">out-001.nut</samp>, etc., and write the list of
  21142. generated segments to <samp class="file">out.list</samp>:
  21143. <div class="example">
  21144. <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
  21145. </pre></div>
  21146. </li><li>Segment input and set output format options for the output segments:
  21147. <div class="example">
  21148. <pre class="example-preformatted">ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  21149. </pre></div>
  21150. </li><li>Segment the input file according to the split points specified by the
  21151. <var class="var">segment_times</var> option:
  21152. <div class="example">
  21153. <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
  21154. </pre></div>
  21155. </li><li>Use the <code class="command">ffmpeg</code> <samp class="option">force_key_frames</samp>
  21156. option to force key frames in the input at the specified location, together
  21157. with the segment option <samp class="option">segment_time_delta</samp> to account for
  21158. possible roundings operated when setting key frame times.
  21159. <div class="example">
  21160. <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 \
  21161. -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  21162. </pre></div>
  21163. <p>In order to force key frames on the input file, transcoding is
  21164. required.
  21165. </p>
  21166. </li><li>Segment the input file by splitting the input file according to the
  21167. frame numbers sequence specified with the <samp class="option">segment_frames</samp> option:
  21168. <div class="example">
  21169. <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
  21170. </pre></div>
  21171. </li><li>Convert the <samp class="file">in.mkv</samp> to TS segments using the <code class="code">libx264</code>
  21172. and <code class="code">aac</code> encoders:
  21173. <div class="example">
  21174. <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
  21175. </pre></div>
  21176. </li><li>Segment the input file, and create an M3U8 live playlist (can be used
  21177. as live HLS source):
  21178. <div class="example">
  21179. <pre class="example-preformatted">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  21180. -segment_list_flags +live -segment_time 10 out%03d.mkv
  21181. </pre></div>
  21182. </li></ul>
  21183. </div>
  21184. </div>
  21185. <div class="section-level-extent" id="smoothstreaming">
  21186. <h3 class="section"><span>21.59 smoothstreaming<a class="copiable-link" href="#smoothstreaming"> &para;</a></span></h3>
  21187. <p>Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  21188. </p>
  21189. <dl class="table">
  21190. <dt><samp class="option">window_size</samp></dt>
  21191. <dd><p>Specify the number of fragments kept in the manifest. Default 0 (keep all).
  21192. </p>
  21193. </dd>
  21194. <dt><samp class="option">extra_window_size</samp></dt>
  21195. <dd><p>Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  21196. </p>
  21197. </dd>
  21198. <dt><samp class="option">lookahead_count</samp></dt>
  21199. <dd><p>Specify the number of lookahead fragments. Default 2.
  21200. </p>
  21201. </dd>
  21202. <dt><samp class="option">min_frag_duration</samp></dt>
  21203. <dd><p>Specify the minimum fragment duration (in microseconds). Default 5000000.
  21204. </p>
  21205. </dd>
  21206. <dt><samp class="option">remove_at_exit</samp></dt>
  21207. <dd><p>Specify whether to remove all fragments when finished. Default 0 (do not remove).
  21208. </p>
  21209. </dd>
  21210. </dl>
  21211. <a class="anchor" id="streamhash"></a></div>
  21212. <div class="section-level-extent" id="streamhash-1">
  21213. <h3 class="section"><span>21.60 streamhash<a class="copiable-link" href="#streamhash-1"> &para;</a></span></h3>
  21214. <p>Per stream hash testing format.
  21215. </p>
  21216. <p>This muxer computes and prints a cryptographic hash of all the input frames,
  21217. on a per-stream basis. This can be used for equality checks without having
  21218. to do a complete binary comparison.
  21219. </p>
  21220. <p>By default audio frames are converted to signed 16-bit raw audio and
  21221. video frames to raw video before computing the hash, but the output
  21222. of explicit conversions to other codecs can also be used. Timestamps
  21223. are ignored. It uses the SHA-256 cryptographic hash function by default,
  21224. but supports several other algorithms.
  21225. </p>
  21226. <p>The output of the muxer consists of one line per stream of the form:
  21227. <var class="var">streamindex</var>,<var class="var">streamtype</var>,<var class="var">algo</var>=<var class="var">hash</var>, where
  21228. <var class="var">streamindex</var> is the index of the mapped stream, <var class="var">streamtype</var> is a
  21229. single character indicating the type of stream, <var class="var">algo</var> is a short string
  21230. representing the hash function used, and <var class="var">hash</var> is a hexadecimal number
  21231. representing the computed hash.
  21232. </p>
  21233. <dl class="table">
  21234. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  21235. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  21236. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  21237. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  21238. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  21239. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  21240. </p>
  21241. </dd>
  21242. </dl>
  21243. <ul class="mini-toc">
  21244. <li><a href="#Examples-21" accesskey="1">Examples</a></li>
  21245. </ul>
  21246. <div class="subsection-level-extent" id="Examples-21">
  21247. <h4 class="subsection"><span>21.60.1 Examples<a class="copiable-link" href="#Examples-21"> &para;</a></span></h4>
  21248. <p>To compute the SHA-256 hash of the input converted to raw audio and
  21249. video, and store it in the file <samp class="file">out.sha256</samp>:
  21250. </p><div class="example">
  21251. <pre class="example-preformatted">ffmpeg -i INPUT -f streamhash out.sha256
  21252. </pre></div>
  21253. <p>To print an MD5 hash to stdout use the command:
  21254. </p><div class="example">
  21255. <pre class="example-preformatted">ffmpeg -i INPUT -f streamhash -hash md5 -
  21256. </pre></div>
  21257. <p>See also the <a class="ref" href="#hash">hash</a> and <a class="ref" href="#framehash">framehash</a> muxers.
  21258. </p>
  21259. <a class="anchor" id="tee"></a></div>
  21260. </div>
  21261. <div class="section-level-extent" id="tee-1">
  21262. <h3 class="section"><span>21.61 tee<a class="copiable-link" href="#tee-1"> &para;</a></span></h3>
  21263. <p>The tee muxer can be used to write the same data to several outputs, such as files or streams.
  21264. It can be used, for example, to stream a video over a network and save it to disk at the same time.
  21265. </p>
  21266. <p>It is different from specifying several outputs to the <code class="command">ffmpeg</code>
  21267. command-line tool. With the tee muxer, the audio and video data will be encoded only once.
  21268. With conventional multiple outputs, multiple encoding operations in parallel are initiated,
  21269. which can be a very expensive process. The tee muxer is not useful when using the libavformat API
  21270. directly because it is then possible to feed the same packets to several muxers directly.
  21271. </p>
  21272. <p>Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select
  21273. output streams. So all streams intended for output must be specified using <code class="code">-map</code>. See
  21274. the examples below.
  21275. </p>
  21276. <p>Some encoders may need different options depending on the output format;
  21277. the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified.
  21278. The main example is the <samp class="option">global_header</samp> flag.
  21279. </p>
  21280. <p>The slave outputs are specified in the file name given to the muxer,
  21281. separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
  21282. leading or trailing spaces or any special character, those must be
  21283. escaped (see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  21284. section in the ffmpeg-utils(1) manual</a>).
  21285. </p>
  21286. <ul class="mini-toc">
  21287. <li><a href="#Options-79" accesskey="1">Options</a></li>
  21288. <li><a href="#Examples-22" accesskey="2">Examples</a></li>
  21289. </ul>
  21290. <div class="subsection-level-extent" id="Options-79">
  21291. <h4 class="subsection"><span>21.61.1 Options<a class="copiable-link" href="#Options-79"> &para;</a></span></h4>
  21292. <dl class="table">
  21293. <dt><samp class="option">use_fifo <var class="var">bool</var></samp></dt>
  21294. <dd><p>If set to 1, slave outputs will be processed in separate threads using the <a class="ref" href="#fifo">fifo</a>
  21295. muxer. This allows to compensate for different speed/latency/reliability of
  21296. outputs and setup transparent recovery. By default this feature is turned off.
  21297. </p>
  21298. </dd>
  21299. <dt><samp class="option">fifo_options</samp></dt>
  21300. <dd><p>Options to pass to fifo pseudo-muxer instances. See <a class="ref" href="#fifo">fifo</a>.
  21301. </p>
  21302. </dd>
  21303. </dl>
  21304. <p>Muxer options can be specified for each slave by prepending them as a list of
  21305. <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
  21306. the options values contain a special character or the &rsquo;:&rsquo; separator, they
  21307. must be escaped; note that this is a second level escaping.
  21308. </p>
  21309. <p>The following special options are also recognized:
  21310. </p><dl class="table">
  21311. <dt><samp class="option">f</samp></dt>
  21312. <dd><p>Specify the format name. Required if it cannot be guessed from the
  21313. output URL.
  21314. </p>
  21315. </dd>
  21316. <dt><samp class="option">bsfs[/<var class="var">spec</var>]</samp></dt>
  21317. <dd><p>Specify a list of bitstream filters to apply to the specified
  21318. output.
  21319. </p>
  21320. <p>It is possible to specify to which streams a given bitstream filter
  21321. applies, by appending a stream specifier to the option separated by
  21322. <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>).
  21323. </p>
  21324. <p>If the stream specifier is not specified, the bitstream filters will be
  21325. applied to all streams in the output. This will cause that output operation
  21326. to fail if the output contains streams to which the bitstream filter cannot
  21327. be applied e.g. <code class="code">h264_mp4toannexb</code> being applied to an output containing an audio stream.
  21328. </p>
  21329. <p>Options for a bitstream filter must be specified in the form of <code class="code">opt=value</code>.
  21330. </p>
  21331. <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
  21332. </p>
  21333. </dd>
  21334. <dt><samp class="option">use_fifo <var class="var">bool</var></samp></dt>
  21335. <dd><p>This allows to override tee muxer use_fifo option for individual slave muxer.
  21336. </p>
  21337. </dd>
  21338. <dt><samp class="option">fifo_options</samp></dt>
  21339. <dd><p>This allows to override tee muxer fifo_options for individual slave muxer.
  21340. See <a class="ref" href="#fifo">fifo</a>.
  21341. </p>
  21342. </dd>
  21343. <dt><samp class="option">select</samp></dt>
  21344. <dd><p>Select the streams that should be mapped to the slave output,
  21345. specified by a stream specifier. If not specified, this defaults to
  21346. all the mapped streams. This will cause that output operation to fail
  21347. if the output format does not accept all mapped streams.
  21348. </p>
  21349. <p>You may use multiple stream specifiers separated by commas (<code class="code">,</code>) e.g.: <code class="code">a:0,v</code>
  21350. </p>
  21351. </dd>
  21352. <dt><samp class="option">onfail</samp></dt>
  21353. <dd><p>Specify behaviour on output failure. This can be set to either <code class="code">abort</code> (which is
  21354. default) or <code class="code">ignore</code>. <code class="code">abort</code> will cause whole process to fail in case of failure
  21355. on this slave output. <code class="code">ignore</code> will ignore failure on this output, so other outputs
  21356. will continue without being affected.
  21357. </p></dd>
  21358. </dl>
  21359. </div>
  21360. <div class="subsection-level-extent" id="Examples-22">
  21361. <h4 class="subsection"><span>21.61.2 Examples<a class="copiable-link" href="#Examples-22"> &para;</a></span></h4>
  21362. <ul class="itemize mark-bullet">
  21363. <li>Encode something and both archive it in a WebM file and stream it
  21364. as MPEG-TS over UDP:
  21365. <div class="example">
  21366. <pre class="example-preformatted">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  21367. &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  21368. </pre></div>
  21369. </li><li>As above, but continue streaming even if output to local file fails
  21370. (for example local drive fills up):
  21371. <div class="example">
  21372. <pre class="example-preformatted">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  21373. &quot;[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  21374. </pre></div>
  21375. </li><li>Use <code class="command">ffmpeg</code> to encode the input, and send the output
  21376. to three different destinations. The <code class="code">dump_extra</code> bitstream
  21377. filter is used to add extradata information to all the output video
  21378. keyframes packets, as requested by the MPEG-TS format. The select
  21379. option is applied to <samp class="file">out.aac</samp> in order to make it contain only
  21380. audio packets.
  21381. <div class="example">
  21382. <pre class="example-preformatted">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  21383. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
  21384. </pre></div>
  21385. </li><li>As above, but select only stream <code class="code">a:1</code> for the audio output. Note
  21386. that a second level escaping must be performed, as &quot;:&quot; is a special
  21387. character used to separate options.
  21388. <div class="example">
  21389. <pre class="example-preformatted">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  21390. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac&quot;
  21391. </pre></div>
  21392. </li></ul>
  21393. </div>
  21394. </div>
  21395. <div class="section-level-extent" id="webm_005fchunk">
  21396. <h3 class="section"><span>21.62 webm_chunk<a class="copiable-link" href="#webm_005fchunk"> &para;</a></span></h3>
  21397. <p>WebM Live Chunk Muxer.
  21398. </p>
  21399. <p>This muxer writes out WebM headers and chunks as separate files which can be
  21400. consumed by clients that support WebM Live streams via DASH.
  21401. </p>
  21402. <ul class="mini-toc">
  21403. <li><a href="#Options-80" accesskey="1">Options</a></li>
  21404. <li><a href="#Example-9" accesskey="2">Example</a></li>
  21405. </ul>
  21406. <div class="subsection-level-extent" id="Options-80">
  21407. <h4 class="subsection"><span>21.62.1 Options<a class="copiable-link" href="#Options-80"> &para;</a></span></h4>
  21408. <p>This muxer supports the following options:
  21409. </p>
  21410. <dl class="table">
  21411. <dt><samp class="option">chunk_start_index</samp></dt>
  21412. <dd><p>Index of the first chunk (defaults to 0).
  21413. </p>
  21414. </dd>
  21415. <dt><samp class="option">header</samp></dt>
  21416. <dd><p>Filename of the header where the initialization data will be written.
  21417. </p>
  21418. </dd>
  21419. <dt><samp class="option">audio_chunk_duration</samp></dt>
  21420. <dd><p>Duration of each audio chunk in milliseconds (defaults to 5000).
  21421. </p></dd>
  21422. </dl>
  21423. </div>
  21424. <div class="subsection-level-extent" id="Example-9">
  21425. <h4 class="subsection"><span>21.62.2 Example<a class="copiable-link" href="#Example-9"> &para;</a></span></h4>
  21426. <div class="example">
  21427. <pre class="example-preformatted">ffmpeg -f v4l2 -i /dev/video0 \
  21428. -f alsa -i hw:0 \
  21429. -map 0:0 \
  21430. -c:v libvpx-vp9 \
  21431. -s 640x360 -keyint_min 30 -g 30 \
  21432. -f webm_chunk \
  21433. -header webm_live_video_360.hdr \
  21434. -chunk_start_index 1 \
  21435. webm_live_video_360_%d.chk \
  21436. -map 1:0 \
  21437. -c:a libvorbis \
  21438. -b:a 128k \
  21439. -f webm_chunk \
  21440. -header webm_live_audio_128.hdr \
  21441. -chunk_start_index 1 \
  21442. -audio_chunk_duration 1000 \
  21443. webm_live_audio_128_%d.chk
  21444. </pre></div>
  21445. </div>
  21446. </div>
  21447. <div class="section-level-extent" id="webm_005fdash_005fmanifest">
  21448. <h3 class="section"><span>21.63 webm_dash_manifest<a class="copiable-link" href="#webm_005fdash_005fmanifest"> &para;</a></span></h3>
  21449. <p>WebM DASH Manifest muxer.
  21450. </p>
  21451. <p>This muxer implements the WebM DASH Manifest specification to generate the DASH
  21452. manifest XML. It also supports manifest generation for DASH live streams.
  21453. </p>
  21454. <p>For more information see:
  21455. </p>
  21456. <ul class="itemize mark-bullet">
  21457. <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>
  21458. </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>
  21459. </li></ul>
  21460. <ul class="mini-toc">
  21461. <li><a href="#Options-81" accesskey="1">Options</a></li>
  21462. <li><a href="#Example-10" accesskey="2">Example</a></li>
  21463. </ul>
  21464. <div class="subsection-level-extent" id="Options-81">
  21465. <h4 class="subsection"><span>21.63.1 Options<a class="copiable-link" href="#Options-81"> &para;</a></span></h4>
  21466. <p>This muxer supports the following options:
  21467. </p>
  21468. <dl class="table">
  21469. <dt><samp class="option">adaptation_sets</samp></dt>
  21470. <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
  21471. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  21472. audio and video streams. Any number of adaptation sets can be added using this option.
  21473. </p>
  21474. </dd>
  21475. <dt><samp class="option">live</samp></dt>
  21476. <dd><p>Set this to 1 to create a live stream DASH Manifest. Default: 0.
  21477. </p>
  21478. </dd>
  21479. <dt><samp class="option">chunk_start_index</samp></dt>
  21480. <dd><p>Start index of the first chunk. This will go in the &lsquo;<samp class="samp">startNumber</samp>&rsquo; attribute
  21481. of the &lsquo;<samp class="samp">SegmentTemplate</samp>&rsquo; element in the manifest. Default: 0.
  21482. </p>
  21483. </dd>
  21484. <dt><samp class="option">chunk_duration_ms</samp></dt>
  21485. <dd><p>Duration of each chunk in milliseconds. This will go in the &lsquo;<samp class="samp">duration</samp>&rsquo;
  21486. attribute of the &lsquo;<samp class="samp">SegmentTemplate</samp>&rsquo; element in the manifest. Default: 1000.
  21487. </p>
  21488. </dd>
  21489. <dt><samp class="option">utc_timing_url</samp></dt>
  21490. <dd><p>URL of the page that will return the UTC timestamp in ISO format. This will go
  21491. in the &lsquo;<samp class="samp">value</samp>&rsquo; attribute of the &lsquo;<samp class="samp">UTCTiming</samp>&rsquo; element in the manifest.
  21492. Default: None.
  21493. </p>
  21494. </dd>
  21495. <dt><samp class="option">time_shift_buffer_depth</samp></dt>
  21496. <dd><p>Smallest time (in seconds) shifting buffer for which any Representation is
  21497. guaranteed to be available. This will go in the &lsquo;<samp class="samp">timeShiftBufferDepth</samp>&rsquo;
  21498. attribute of the &lsquo;<samp class="samp">MPD</samp>&rsquo; element. Default: 60.
  21499. </p>
  21500. </dd>
  21501. <dt><samp class="option">minimum_update_period</samp></dt>
  21502. <dd><p>Minimum update period (in seconds) of the manifest. This will go in the
  21503. &lsquo;<samp class="samp">minimumUpdatePeriod</samp>&rsquo; attribute of the &lsquo;<samp class="samp">MPD</samp>&rsquo; element. Default: 0.
  21504. </p>
  21505. </dd>
  21506. </dl>
  21507. </div>
  21508. <div class="subsection-level-extent" id="Example-10">
  21509. <h4 class="subsection"><span>21.63.2 Example<a class="copiable-link" href="#Example-10"> &para;</a></span></h4>
  21510. <div class="example">
  21511. <pre class="example-preformatted">ffmpeg -f webm_dash_manifest -i video1.webm \
  21512. -f webm_dash_manifest -i video2.webm \
  21513. -f webm_dash_manifest -i audio1.webm \
  21514. -f webm_dash_manifest -i audio2.webm \
  21515. -map 0 -map 1 -map 2 -map 3 \
  21516. -c copy \
  21517. -f webm_dash_manifest \
  21518. -adaptation_sets &quot;id=0,streams=0,1 id=1,streams=2,3&quot; \
  21519. manifest.xml
  21520. </pre></div>
  21521. <a class="anchor" id="metadata"></a></div>
  21522. </div>
  21523. </div>
  21524. <div class="chapter-level-extent" id="Metadata-1">
  21525. <h2 class="chapter"><span>22 Metadata<a class="copiable-link" href="#Metadata-1"> &para;</a></span></h2>
  21526. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  21527. INI-like text file and then load it back using the metadata muxer/demuxer.
  21528. </p>
  21529. <p>The file format is as follows:
  21530. </p><ol class="enumerate">
  21531. <li> A file consists of a header and a number of metadata tags divided into sections,
  21532. each on its own line.
  21533. </li><li> The header is a &lsquo;<samp class="samp">;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  21534. </li><li> Metadata tags are of the form &lsquo;<samp class="samp">key=value</samp>&rsquo;
  21535. </li><li> Immediately after header follows global metadata
  21536. </li><li> After global metadata there may be sections with per-stream/per-chapter
  21537. metadata.
  21538. </li><li> A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  21539. brackets (&lsquo;<samp class="samp">[</samp>&rsquo;, &lsquo;<samp class="samp">]</samp>&rsquo;) and ends with next section or end of file.
  21540. </li><li> At the beginning of a chapter section there may be an optional timebase to be
  21541. used for start/end values. It must be in form
  21542. &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
  21543. integers. If the timebase is missing then start/end times are assumed to
  21544. be in nanoseconds.
  21545. <p>Next a chapter section must contain chapter start and end times in form
  21546. &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
  21547. integer.
  21548. </p>
  21549. </li><li> Empty lines and lines starting with &lsquo;<samp class="samp">;</samp>&rsquo; or &lsquo;<samp class="samp">#</samp>&rsquo; are ignored.
  21550. </li><li> Metadata keys or values containing special characters (&lsquo;<samp class="samp">=</samp>&rsquo;, &lsquo;<samp class="samp">;</samp>&rsquo;,
  21551. &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;.
  21552. </li><li> Note that whitespace in metadata (e.g. &lsquo;<samp class="samp">foo = bar</samp>&rsquo;) is considered to be
  21553. a part of the tag (in the example above key is &lsquo;<samp class="samp">foo </samp>&rsquo;, value is
  21554. &lsquo;<samp class="samp"> bar</samp>&rsquo;).
  21555. </li></ol>
  21556. <p>A ffmetadata file might look like this:
  21557. </p><div class="example">
  21558. <pre class="example-preformatted">;FFMETADATA1
  21559. title=bike\\shed
  21560. ;this is a comment
  21561. artist=FFmpeg troll team
  21562. [CHAPTER]
  21563. TIMEBASE=1/1000
  21564. START=0
  21565. #chapter ends at 0:01:00
  21566. END=60000
  21567. title=chapter \#1
  21568. [STREAM]
  21569. title=multi\
  21570. line
  21571. </pre></div>
  21572. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  21573. metadata from an input file to an ffmetadata file, and then transcode
  21574. the file into an output file with the edited ffmetadata file.
  21575. </p>
  21576. <p>Extracting an ffmetadata file with <samp class="file">ffmpeg</samp> goes as follows:
  21577. </p><div class="example">
  21578. <pre class="example-preformatted">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  21579. </pre></div>
  21580. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  21581. be done as:
  21582. </p><div class="example">
  21583. <pre class="example-preformatted">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  21584. </pre></div>
  21585. </div>
  21586. <div class="chapter-level-extent" id="Protocol-Options">
  21587. <h2 class="chapter"><span>23 Protocol Options<a class="copiable-link" href="#Protocol-Options"> &para;</a></span></h2>
  21588. <p>The libavformat library provides some generic global options, which
  21589. can be set on all the protocols. In addition each protocol may support
  21590. so-called private options, which are specific for that component.
  21591. </p>
  21592. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  21593. FFmpeg tools, or by setting the value explicitly in the
  21594. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  21595. for programmatic use.
  21596. </p>
  21597. <p>The list of supported options follows:
  21598. </p>
  21599. <dl class="table">
  21600. <dt><samp class="option">protocol_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  21601. <dd><p>Set a &quot;,&quot;-separated list of allowed protocols. &quot;ALL&quot; matches all protocols. Protocols
  21602. prefixed by &quot;-&quot; are disabled.
  21603. All protocols are allowed by default but protocols used by an another
  21604. protocol (nested protocols) are restricted to a per protocol subset.
  21605. </p></dd>
  21606. </dl>
  21607. </div>
  21608. <div class="chapter-level-extent" id="Protocols">
  21609. <h2 class="chapter"><span>24 Protocols<a class="copiable-link" href="#Protocols"> &para;</a></span></h2>
  21610. <p>Protocols are configured elements in FFmpeg that enable access to
  21611. resources that require specific protocols.
  21612. </p>
  21613. <p>When you configure your FFmpeg build, all the supported protocols are
  21614. enabled by default. You can list all available ones using the
  21615. configure option &quot;&ndash;list-protocols&quot;.
  21616. </p>
  21617. <p>You can disable all the protocols using the configure option
  21618. &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
  21619. option &quot;&ndash;enable-protocol=<var class="var">PROTOCOL</var>&quot;, or you can disable a
  21620. particular protocol using the option
  21621. &quot;&ndash;disable-protocol=<var class="var">PROTOCOL</var>&quot;.
  21622. </p>
  21623. <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
  21624. supported protocols.
  21625. </p>
  21626. <p>All protocols accept the following options:
  21627. </p>
  21628. <dl class="table">
  21629. <dt><samp class="option">rw_timeout</samp></dt>
  21630. <dd><p>Maximum time to wait for (network) read/write operations to complete,
  21631. in microseconds.
  21632. </p></dd>
  21633. </dl>
  21634. <p>A description of the currently available protocols follows.
  21635. </p>
  21636. <ul class="mini-toc">
  21637. <li><a href="#amqp" accesskey="1">amqp</a></li>
  21638. <li><a href="#async" accesskey="2">async</a></li>
  21639. <li><a href="#bluray" accesskey="3">bluray</a></li>
  21640. <li><a href="#cache" accesskey="4">cache</a></li>
  21641. <li><a href="#concat-2" accesskey="5">concat</a></li>
  21642. <li><a href="#concatf" accesskey="6">concatf</a></li>
  21643. <li><a href="#crypto" accesskey="7">crypto</a></li>
  21644. <li><a href="#data" accesskey="8">data</a></li>
  21645. <li><a href="#fd" accesskey="9">fd</a></li>
  21646. <li><a href="#file">file</a></li>
  21647. <li><a href="#ftp">ftp</a></li>
  21648. <li><a href="#gopher">gopher</a></li>
  21649. <li><a href="#gophers">gophers</a></li>
  21650. <li><a href="#hls-3">hls</a></li>
  21651. <li><a href="#http">http</a></li>
  21652. <li><a href="#Icecast">Icecast</a></li>
  21653. <li><a href="#ipfs">ipfs</a></li>
  21654. <li><a href="#mmst">mmst</a></li>
  21655. <li><a href="#mmsh">mmsh</a></li>
  21656. <li><a href="#md5-2">md5</a></li>
  21657. <li><a href="#pipe">pipe</a></li>
  21658. <li><a href="#prompeg">prompeg</a></li>
  21659. <li><a href="#rist">rist</a></li>
  21660. <li><a href="#rtmp">rtmp</a></li>
  21661. <li><a href="#rtmpe">rtmpe</a></li>
  21662. <li><a href="#rtmps">rtmps</a></li>
  21663. <li><a href="#rtmpt">rtmpt</a></li>
  21664. <li><a href="#rtmpte">rtmpte</a></li>
  21665. <li><a href="#rtmpts">rtmpts</a></li>
  21666. <li><a href="#libsmbclient">libsmbclient</a></li>
  21667. <li><a href="#libssh">libssh</a></li>
  21668. <li><a href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  21669. <li><a href="#rtp">rtp</a></li>
  21670. <li><a href="#rtsp">rtsp</a></li>
  21671. <li><a href="#sap">sap</a></li>
  21672. <li><a href="#sctp">sctp</a></li>
  21673. <li><a href="#srt">srt</a></li>
  21674. <li><a href="#srtp">srtp</a></li>
  21675. <li><a href="#subfile">subfile</a></li>
  21676. <li><a href="#tee-2">tee</a></li>
  21677. <li><a href="#tcp">tcp</a></li>
  21678. <li><a href="#tls">tls</a></li>
  21679. <li><a href="#udp">udp</a></li>
  21680. <li><a href="#unix">unix</a></li>
  21681. <li><a href="#zmq">zmq</a></li>
  21682. </ul>
  21683. <div class="section-level-extent" id="amqp">
  21684. <h3 class="section"><span>24.1 amqp<a class="copiable-link" href="#amqp"> &para;</a></span></h3>
  21685. <p>Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based
  21686. publish-subscribe communication protocol.
  21687. </p>
  21688. <p>FFmpeg must be compiled with &ndash;enable-librabbitmq to support AMQP. A separate
  21689. AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ.
  21690. </p>
  21691. <p>After starting the broker, an FFmpeg client may stream data to the broker using
  21692. the command:
  21693. </p>
  21694. <div class="example">
  21695. <pre class="example-preformatted">ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
  21696. </pre></div>
  21697. <p>Where hostname and port (default is 5672) is the address of the broker. The
  21698. client may also set a user/password for authentication. The default for both
  21699. fields is &quot;guest&quot;. Name of virtual host on broker can be set with vhost. The
  21700. default value is &quot;/&quot;.
  21701. </p>
  21702. <p>Muliple subscribers may stream from the broker using the command:
  21703. </p><div class="example">
  21704. <pre class="example-preformatted">ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
  21705. </pre></div>
  21706. <p>In RabbitMQ all data published to the broker flows through a specific exchange,
  21707. and each subscribing client has an assigned queue/buffer. When a packet arrives
  21708. at an exchange, it may be copied to a client&rsquo;s queue depending on the exchange
  21709. and routing_key fields.
  21710. </p>
  21711. <p>The following options are supported:
  21712. </p>
  21713. <dl class="table">
  21714. <dt><samp class="option">exchange</samp></dt>
  21715. <dd><p>Sets the exchange to use on the broker. RabbitMQ has several predefined
  21716. exchanges: &quot;amq.direct&quot; is the default exchange, where the publisher and
  21717. subscriber must have a matching routing_key; &quot;amq.fanout&quot; is the same as a
  21718. broadcast operation (i.e. the data is forwarded to all queues on the fanout
  21719. exchange independent of the routing_key); and &quot;amq.topic&quot; is similar to
  21720. &quot;amq.direct&quot;, but allows for more complex pattern matching (refer to the RabbitMQ
  21721. documentation).
  21722. </p>
  21723. </dd>
  21724. <dt><samp class="option">routing_key</samp></dt>
  21725. <dd><p>Sets the routing key. The default value is &quot;amqp&quot;. The routing key is used on
  21726. the &quot;amq.direct&quot; and &quot;amq.topic&quot; exchanges to decide whether packets are written
  21727. to the queue of a subscriber.
  21728. </p>
  21729. </dd>
  21730. <dt><samp class="option">pkt_size</samp></dt>
  21731. <dd><p>Maximum size of each packet sent/received to the broker. Default is 131072.
  21732. Minimum is 4096 and max is any large value (representable by an int). When
  21733. receiving packets, this sets an internal buffer size in FFmpeg. It should be
  21734. equal to or greater than the size of the published packets to the broker. Otherwise
  21735. the received message may be truncated causing decoding errors.
  21736. </p>
  21737. </dd>
  21738. <dt><samp class="option">connection_timeout</samp></dt>
  21739. <dd><p>The timeout in seconds during the initial connection to the broker. The
  21740. default value is rw_timeout, or 5 seconds if rw_timeout is not set.
  21741. </p>
  21742. </dd>
  21743. <dt><samp class="option">delivery_mode <var class="var">mode</var></samp></dt>
  21744. <dd><p>Sets the delivery mode of each message sent to broker.
  21745. The following values are accepted:
  21746. </p><dl class="table">
  21747. <dt>&lsquo;<samp class="samp">persistent</samp>&rsquo;</dt>
  21748. <dd><p>Delivery mode set to &quot;persistent&quot; (2). This is the default value.
  21749. Messages may be written to the broker&rsquo;s disk depending on its setup.
  21750. </p>
  21751. </dd>
  21752. <dt>&lsquo;<samp class="samp">non-persistent</samp>&rsquo;</dt>
  21753. <dd><p>Delivery mode set to &quot;non-persistent&quot; (1).
  21754. Messages will stay in broker&rsquo;s memory unless the broker is under memory
  21755. pressure.
  21756. </p>
  21757. </dd>
  21758. </dl>
  21759. </dd>
  21760. </dl>
  21761. </div>
  21762. <div class="section-level-extent" id="async">
  21763. <h3 class="section"><span>24.2 async<a class="copiable-link" href="#async"> &para;</a></span></h3>
  21764. <p>Asynchronous data filling wrapper for input stream.
  21765. </p>
  21766. <p>Fill data in a background thread, to decouple I/O operation from demux thread.
  21767. </p>
  21768. <div class="example">
  21769. <pre class="example-preformatted">async:<var class="var">URL</var>
  21770. async:http://host/resource
  21771. async:cache:http://host/resource
  21772. </pre></div>
  21773. </div>
  21774. <div class="section-level-extent" id="bluray">
  21775. <h3 class="section"><span>24.3 bluray<a class="copiable-link" href="#bluray"> &para;</a></span></h3>
  21776. <p>Read BluRay playlist.
  21777. </p>
  21778. <p>The accepted options are:
  21779. </p><dl class="table">
  21780. <dt><samp class="option">angle</samp></dt>
  21781. <dd><p>BluRay angle
  21782. </p>
  21783. </dd>
  21784. <dt><samp class="option">chapter</samp></dt>
  21785. <dd><p>Start chapter (1...N)
  21786. </p>
  21787. </dd>
  21788. <dt><samp class="option">playlist</samp></dt>
  21789. <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
  21790. </p>
  21791. </dd>
  21792. </dl>
  21793. <p>Examples:
  21794. </p>
  21795. <p>Read longest playlist from BluRay mounted to /mnt/bluray:
  21796. </p><div class="example">
  21797. <pre class="example-preformatted">bluray:/mnt/bluray
  21798. </pre></div>
  21799. <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  21800. </p><div class="example">
  21801. <pre class="example-preformatted">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  21802. </pre></div>
  21803. </div>
  21804. <div class="section-level-extent" id="cache">
  21805. <h3 class="section"><span>24.4 cache<a class="copiable-link" href="#cache"> &para;</a></span></h3>
  21806. <p>Caching wrapper for input stream.
  21807. </p>
  21808. <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
  21809. </p>
  21810. <p>The accepted options are:
  21811. </p><dl class="table">
  21812. <dt><samp class="option">read_ahead_limit</samp></dt>
  21813. <dd><p>Amount in bytes that may be read ahead when seeking isn&rsquo;t supported. Range is -1 to INT_MAX.
  21814. -1 for unlimited. Default is 65536.
  21815. </p>
  21816. </dd>
  21817. </dl>
  21818. <p>URL Syntax is
  21819. </p><div class="example">
  21820. <pre class="example-preformatted">cache:<var class="var">URL</var>
  21821. </pre></div>
  21822. </div>
  21823. <div class="section-level-extent" id="concat-2">
  21824. <h3 class="section"><span>24.5 concat<a class="copiable-link" href="#concat-2"> &para;</a></span></h3>
  21825. <p>Physical concatenation protocol.
  21826. </p>
  21827. <p>Read and seek from many resources in sequence as if they were
  21828. a unique resource.
  21829. </p>
  21830. <p>A URL accepted by this protocol has the syntax:
  21831. </p><div class="example">
  21832. <pre class="example-preformatted">concat:<var class="var">URL1</var>|<var class="var">URL2</var>|...|<var class="var">URLN</var>
  21833. </pre></div>
  21834. <p>where <var class="var">URL1</var>, <var class="var">URL2</var>, ..., <var class="var">URLN</var> are the urls of the
  21835. resource to be concatenated, each one possibly specifying a distinct
  21836. protocol.
  21837. </p>
  21838. <p>For example to read a sequence of files <samp class="file">split1.mpeg</samp>,
  21839. <samp class="file">split2.mpeg</samp>, <samp class="file">split3.mpeg</samp> with <code class="command">ffplay</code> use the
  21840. command:
  21841. </p><div class="example">
  21842. <pre class="example-preformatted">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  21843. </pre></div>
  21844. <p>Note that you may need to escape the character &quot;|&quot; which is special for
  21845. many shells.
  21846. </p>
  21847. </div>
  21848. <div class="section-level-extent" id="concatf">
  21849. <h3 class="section"><span>24.6 concatf<a class="copiable-link" href="#concatf"> &para;</a></span></h3>
  21850. <p>Physical concatenation protocol using a line break delimited list of
  21851. resources.
  21852. </p>
  21853. <p>Read and seek from many resources in sequence as if they were
  21854. a unique resource.
  21855. </p>
  21856. <p>A URL accepted by this protocol has the syntax:
  21857. </p><div class="example">
  21858. <pre class="example-preformatted">concatf:<var class="var">URL</var>
  21859. </pre></div>
  21860. <p>where <var class="var">URL</var> is the url containing a line break delimited list of
  21861. resources to be concatenated, each one possibly specifying a distinct
  21862. protocol. Special characters must be escaped with backslash or single
  21863. quotes. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  21864. section in the ffmpeg-utils(1) manual</a>.
  21865. </p>
  21866. <p>For example to read a sequence of files <samp class="file">split1.mpeg</samp>,
  21867. <samp class="file">split2.mpeg</samp>, <samp class="file">split3.mpeg</samp> listed in separate lines within
  21868. a file <samp class="file">split.txt</samp> with <code class="command">ffplay</code> use the command:
  21869. </p><div class="example">
  21870. <pre class="example-preformatted">ffplay concatf:split.txt
  21871. </pre></div>
  21872. <p>Where <samp class="file">split.txt</samp> contains the lines:
  21873. </p><div class="example">
  21874. <pre class="example-preformatted">split1.mpeg
  21875. split2.mpeg
  21876. split3.mpeg
  21877. </pre></div>
  21878. </div>
  21879. <div class="section-level-extent" id="crypto">
  21880. <h3 class="section"><span>24.7 crypto<a class="copiable-link" href="#crypto"> &para;</a></span></h3>
  21881. <p>AES-encrypted stream reading protocol.
  21882. </p>
  21883. <p>The accepted options are:
  21884. </p><dl class="table">
  21885. <dt><samp class="option">key</samp></dt>
  21886. <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
  21887. </p>
  21888. </dd>
  21889. <dt><samp class="option">iv</samp></dt>
  21890. <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
  21891. </p></dd>
  21892. </dl>
  21893. <p>Accepted URL formats:
  21894. </p><div class="example">
  21895. <pre class="example-preformatted">crypto:<var class="var">URL</var>
  21896. crypto+<var class="var">URL</var>
  21897. </pre></div>
  21898. </div>
  21899. <div class="section-level-extent" id="data">
  21900. <h3 class="section"><span>24.8 data<a class="copiable-link" href="#data"> &para;</a></span></h3>
  21901. <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>.
  21902. </p>
  21903. <p>For example, to convert a GIF file given inline with <code class="command">ffmpeg</code>:
  21904. </p><div class="example">
  21905. <pre class="example-preformatted">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
  21906. </pre></div>
  21907. </div>
  21908. <div class="section-level-extent" id="fd">
  21909. <h3 class="section"><span>24.9 fd<a class="copiable-link" href="#fd"> &para;</a></span></h3>
  21910. <p>File descriptor access protocol.
  21911. </p>
  21912. <p>The accepted syntax is:
  21913. </p><div class="example">
  21914. <pre class="example-preformatted">fd: -fd <var class="var">file_descriptor</var>
  21915. </pre></div>
  21916. <p>If <samp class="option">fd</samp> is not specified, by default the stdout file descriptor will be
  21917. used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has
  21918. seek support if it corresponding to a regular file. fd protocol doesn&rsquo;t support
  21919. pass file descriptor via URL for security.
  21920. </p>
  21921. <p>This protocol accepts the following options:
  21922. </p>
  21923. <dl class="table">
  21924. <dt><samp class="option">blocksize</samp></dt>
  21925. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  21926. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  21927. Setting this value reasonably low improves user termination request reaction
  21928. time, which is valuable if data transmission is slow.
  21929. </p>
  21930. </dd>
  21931. <dt><samp class="option">fd</samp></dt>
  21932. <dd><p>Set file descriptor.
  21933. </p></dd>
  21934. </dl>
  21935. </div>
  21936. <div class="section-level-extent" id="file">
  21937. <h3 class="section"><span>24.10 file<a class="copiable-link" href="#file"> &para;</a></span></h3>
  21938. <p>File access protocol.
  21939. </p>
  21940. <p>Read from or write to a file.
  21941. </p>
  21942. <p>A file URL can have the form:
  21943. </p><div class="example">
  21944. <pre class="example-preformatted">file:<var class="var">filename</var>
  21945. </pre></div>
  21946. <p>where <var class="var">filename</var> is the path of the file to read.
  21947. </p>
  21948. <p>An URL that does not have a protocol prefix will be assumed to be a
  21949. file URL. Depending on the build, an URL that looks like a Windows
  21950. path with the drive letter at the beginning will also be assumed to be
  21951. a file URL (usually not the case in builds for unix-like systems).
  21952. </p>
  21953. <p>For example to read from a file <samp class="file">input.mpeg</samp> with <code class="command">ffmpeg</code>
  21954. use the command:
  21955. </p><div class="example">
  21956. <pre class="example-preformatted">ffmpeg -i file:input.mpeg output.mpeg
  21957. </pre></div>
  21958. <p>This protocol accepts the following options:
  21959. </p>
  21960. <dl class="table">
  21961. <dt><samp class="option">truncate</samp></dt>
  21962. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  21963. truncating. Default value is 1.
  21964. </p>
  21965. </dd>
  21966. <dt><samp class="option">blocksize</samp></dt>
  21967. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  21968. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  21969. Setting this value reasonably low improves user termination request reaction
  21970. time, which is valuable for files on slow medium.
  21971. </p>
  21972. </dd>
  21973. <dt><samp class="option">follow</samp></dt>
  21974. <dd><p>If set to 1, the protocol will retry reading at the end of the file, allowing
  21975. reading files that still are being written. In order for this to terminate,
  21976. you either need to use the rw_timeout option, or use the interrupt callback
  21977. (for API users).
  21978. </p>
  21979. </dd>
  21980. <dt><samp class="option">seekable</samp></dt>
  21981. <dd><p>Controls if seekability is advertised on the file. 0 means non-seekable, -1
  21982. means auto (seekable for normal files, non-seekable for named pipes).
  21983. </p>
  21984. <p>Many demuxers handle seekable and non-seekable resources differently,
  21985. overriding this might speed up opening certain files at the cost of losing some
  21986. features (e.g. accurate seeking).
  21987. </p></dd>
  21988. </dl>
  21989. </div>
  21990. <div class="section-level-extent" id="ftp">
  21991. <h3 class="section"><span>24.11 ftp<a class="copiable-link" href="#ftp"> &para;</a></span></h3>
  21992. <p>FTP (File Transfer Protocol).
  21993. </p>
  21994. <p>Read from or write to remote resources using FTP protocol.
  21995. </p>
  21996. <p>Following syntax is required.
  21997. </p><div class="example">
  21998. <pre class="example-preformatted">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  21999. </pre></div>
  22000. <p>This protocol accepts the following options.
  22001. </p>
  22002. <dl class="table">
  22003. <dt><samp class="option">timeout</samp></dt>
  22004. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  22005. operation. By default it is set to -1, which means that the timeout is
  22006. not specified.
  22007. </p>
  22008. </dd>
  22009. <dt><samp class="option">ftp-user</samp></dt>
  22010. <dd><p>Set a user to be used for authenticating to the FTP server. This is overridden by the
  22011. user in the FTP URL.
  22012. </p>
  22013. </dd>
  22014. <dt><samp class="option">ftp-password</samp></dt>
  22015. <dd><p>Set a password to be used for authenticating to the FTP server. This is overridden by
  22016. the password in the FTP URL, or by <samp class="option">ftp-anonymous-password</samp> if no user is set.
  22017. </p>
  22018. </dd>
  22019. <dt><samp class="option">ftp-anonymous-password</samp></dt>
  22020. <dd><p>Password used when login as anonymous user. Typically an e-mail address
  22021. should be used.
  22022. </p>
  22023. </dd>
  22024. <dt><samp class="option">ftp-write-seekable</samp></dt>
  22025. <dd><p>Control seekability of connection during encoding. If set to 1 the
  22026. resource is supposed to be seekable, if set to 0 it is assumed not
  22027. to be seekable. Default value is 0.
  22028. </p></dd>
  22029. </dl>
  22030. <p>NOTE: Protocol can be used as output, but it is recommended to not do
  22031. it, unless special care is taken (tests, customized server configuration
  22032. etc.). Different FTP servers behave in different way during seek
  22033. operation. ff* tools may produce incomplete content due to server limitations.
  22034. </p>
  22035. </div>
  22036. <div class="section-level-extent" id="gopher">
  22037. <h3 class="section"><span>24.12 gopher<a class="copiable-link" href="#gopher"> &para;</a></span></h3>
  22038. <p>Gopher protocol.
  22039. </p>
  22040. </div>
  22041. <div class="section-level-extent" id="gophers">
  22042. <h3 class="section"><span>24.13 gophers<a class="copiable-link" href="#gophers"> &para;</a></span></h3>
  22043. <p>Gophers protocol.
  22044. </p>
  22045. <p>The Gopher protocol with TLS encapsulation.
  22046. </p>
  22047. </div>
  22048. <div class="section-level-extent" id="hls-3">
  22049. <h3 class="section"><span>24.14 hls<a class="copiable-link" href="#hls-3"> &para;</a></span></h3>
  22050. <p>Read Apple HTTP Live Streaming compliant segmented stream as
  22051. a uniform one. The M3U8 playlists describing the segments can be
  22052. remote HTTP resources or local files, accessed using the standard
  22053. file protocol.
  22054. The nested protocol is declared by specifying
  22055. &quot;+<var class="var">proto</var>&quot; after the hls URI scheme name, where <var class="var">proto</var>
  22056. is either &quot;file&quot; or &quot;http&quot;.
  22057. </p>
  22058. <div class="example">
  22059. <pre class="example-preformatted">hls+http://host/path/to/remote/resource.m3u8
  22060. hls+file://path/to/local/resource.m3u8
  22061. </pre></div>
  22062. <p>Using this protocol is discouraged - the hls demuxer should work
  22063. just as well (if not, please report the issues) and is more complete.
  22064. To use the hls demuxer instead, simply use the direct URLs to the
  22065. m3u8 files.
  22066. </p>
  22067. </div>
  22068. <div class="section-level-extent" id="http">
  22069. <h3 class="section"><span>24.15 http<a class="copiable-link" href="#http"> &para;</a></span></h3>
  22070. <p>HTTP (Hyper Text Transfer Protocol).
  22071. </p>
  22072. <p>This protocol accepts the following options:
  22073. </p>
  22074. <dl class="table">
  22075. <dt><samp class="option">seekable</samp></dt>
  22076. <dd><p>Control seekability of connection. If set to 1 the resource is
  22077. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  22078. if set to -1 it will try to autodetect if it is seekable. Default
  22079. value is -1.
  22080. </p>
  22081. </dd>
  22082. <dt><samp class="option">chunked_post</samp></dt>
  22083. <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  22084. </p>
  22085. </dd>
  22086. <dt><samp class="option">content_type</samp></dt>
  22087. <dd><p>Set a specific content type for the POST messages or for listen mode.
  22088. </p>
  22089. </dd>
  22090. <dt><samp class="option">http_proxy</samp></dt>
  22091. <dd><p>set HTTP proxy to tunnel through e.g. http://example.com:1234
  22092. </p>
  22093. </dd>
  22094. <dt><samp class="option">headers</samp></dt>
  22095. <dd><p>Set custom HTTP headers, can override built in default headers. The
  22096. value must be a string encoding the headers.
  22097. </p>
  22098. </dd>
  22099. <dt><samp class="option">multiple_requests</samp></dt>
  22100. <dd><p>Use persistent connections if set to 1, default is 0.
  22101. </p>
  22102. </dd>
  22103. <dt><samp class="option">post_data</samp></dt>
  22104. <dd><p>Set custom HTTP post data.
  22105. </p>
  22106. </dd>
  22107. <dt><samp class="option">referer</samp></dt>
  22108. <dd><p>Set the Referer header. Include &rsquo;Referer: URL&rsquo; header in HTTP request.
  22109. </p>
  22110. </dd>
  22111. <dt><samp class="option">user_agent</samp></dt>
  22112. <dd><p>Override the User-Agent header. If not specified the protocol will use a
  22113. string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
  22114. </p>
  22115. </dd>
  22116. <dt><samp class="option">reconnect_at_eof</samp></dt>
  22117. <dd><p>If set then eof is treated like an error and causes reconnection, this is useful
  22118. for live / endless streams.
  22119. </p>
  22120. </dd>
  22121. <dt><samp class="option">reconnect_streamed</samp></dt>
  22122. <dd><p>If set then even streamed/non seekable streams will be reconnected on errors.
  22123. </p>
  22124. </dd>
  22125. <dt><samp class="option">reconnect_on_network_error</samp></dt>
  22126. <dd><p>Reconnect automatically in case of TCP/TLS errors during connect.
  22127. </p>
  22128. </dd>
  22129. <dt><samp class="option">reconnect_on_http_error</samp></dt>
  22130. <dd><p>A comma separated list of HTTP status codes to reconnect on. The list can
  22131. include specific status codes (e.g. &rsquo;503&rsquo;) or the strings &rsquo;4xx&rsquo; / &rsquo;5xx&rsquo;.
  22132. </p>
  22133. </dd>
  22134. <dt><samp class="option">reconnect_delay_max</samp></dt>
  22135. <dd><p>Sets the maximum delay in seconds after which to give up reconnecting
  22136. </p>
  22137. </dd>
  22138. <dt><samp class="option">mime_type</samp></dt>
  22139. <dd><p>Export the MIME type.
  22140. </p>
  22141. </dd>
  22142. <dt><samp class="option">http_version</samp></dt>
  22143. <dd><p>Exports the HTTP response version number. Usually &quot;1.0&quot; or &quot;1.1&quot;.
  22144. </p>
  22145. </dd>
  22146. <dt><samp class="option">icy</samp></dt>
  22147. <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  22148. supports this, the metadata has to be retrieved by the application by reading
  22149. the <samp class="option">icy_metadata_headers</samp> and <samp class="option">icy_metadata_packet</samp> options.
  22150. The default is 1.
  22151. </p>
  22152. </dd>
  22153. <dt><samp class="option">icy_metadata_headers</samp></dt>
  22154. <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  22155. headers, separated by newline characters.
  22156. </p>
  22157. </dd>
  22158. <dt><samp class="option">icy_metadata_packet</samp></dt>
  22159. <dd><p>If the server supports ICY metadata, and <samp class="option">icy</samp> was set to 1, this
  22160. contains the last non-empty metadata packet sent by the server. It should be
  22161. polled in regular intervals by applications interested in mid-stream metadata
  22162. updates.
  22163. </p>
  22164. </dd>
  22165. <dt><samp class="option">cookies</samp></dt>
  22166. <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
  22167. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  22168. delimited by a newline character.
  22169. </p>
  22170. </dd>
  22171. <dt><samp class="option">offset</samp></dt>
  22172. <dd><p>Set initial byte offset.
  22173. </p>
  22174. </dd>
  22175. <dt><samp class="option">end_offset</samp></dt>
  22176. <dd><p>Try to limit the request to bytes preceding this offset.
  22177. </p>
  22178. </dd>
  22179. <dt><samp class="option">method</samp></dt>
  22180. <dd><p>When used as a client option it sets the HTTP method for the request.
  22181. </p>
  22182. <p>When used as a server option it sets the HTTP method that is going to be
  22183. expected from the client(s).
  22184. If the expected and the received HTTP method do not match the client will
  22185. be given a Bad Request response.
  22186. When unset the HTTP method is not checked for now. This will be replaced by
  22187. autodetection in the future.
  22188. </p>
  22189. </dd>
  22190. <dt><samp class="option">listen</samp></dt>
  22191. <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
  22192. used as an output option, or read data from a client with HTTP POST when used as
  22193. an input option.
  22194. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented
  22195. in ffmpeg.c and thus must not be used as a command line option.
  22196. </p><div class="example">
  22197. <pre class="example-preformatted"># Server side (sending):
  22198. ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var class="var">server</var>:<var class="var">port</var>
  22199. # Client side (receiving):
  22200. ffmpeg -i http://<var class="var">server</var>:<var class="var">port</var> -c copy somefile.ogg
  22201. # Client can also be done with wget:
  22202. wget http://<var class="var">server</var>:<var class="var">port</var> -O somefile.ogg
  22203. # Server side (receiving):
  22204. ffmpeg -listen 1 -i http://<var class="var">server</var>:<var class="var">port</var> -c copy somefile.ogg
  22205. # Client side (sending):
  22206. ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var class="var">server</var>:<var class="var">port</var>
  22207. # Client can also be done with wget:
  22208. wget --post-file=somefile.ogg http://<var class="var">server</var>:<var class="var">port</var>
  22209. </pre></div>
  22210. </dd>
  22211. <dt><samp class="option">send_expect_100</samp></dt>
  22212. <dd><p>Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
  22213. to 0 it won&rsquo;t, if set to -1 it will try to send if it is applicable. Default
  22214. value is -1.
  22215. </p>
  22216. </dd>
  22217. <dt><samp class="option">auth_type</samp></dt>
  22218. <dd>
  22219. <p>Set HTTP authentication type. No option for Digest, since this method requires
  22220. getting nonce parameters from the server first and can&rsquo;t be used straight away like
  22221. Basic.
  22222. </p>
  22223. <dl class="table">
  22224. <dt><samp class="option">none</samp></dt>
  22225. <dd><p>Choose the HTTP authentication type automatically. This is the default.
  22226. </p></dd>
  22227. <dt><samp class="option">basic</samp></dt>
  22228. <dd>
  22229. <p>Choose the HTTP basic authentication.
  22230. </p>
  22231. <p>Basic authentication sends a Base64-encoded string that contains a user name and password
  22232. for the client. Base64 is not a form of encryption and should be considered the same as
  22233. sending the user name and password in clear text (Base64 is a reversible encoding).
  22234. If a resource needs to be protected, strongly consider using an authentication scheme
  22235. other than basic authentication. HTTPS/TLS should be used with basic authentication.
  22236. Without these additional security enhancements, basic authentication should not be used
  22237. to protect sensitive or valuable information.
  22238. </p></dd>
  22239. </dl>
  22240. </dd>
  22241. </dl>
  22242. <ul class="mini-toc">
  22243. <li><a href="#HTTP-Cookies" accesskey="1">HTTP Cookies</a></li>
  22244. </ul>
  22245. <div class="subsection-level-extent" id="HTTP-Cookies">
  22246. <h4 class="subsection"><span>24.15.1 HTTP Cookies<a class="copiable-link" href="#HTTP-Cookies"> &para;</a></span></h4>
  22247. <p>Some HTTP requests will be denied unless cookie values are passed in with the
  22248. request. The <samp class="option">cookies</samp> option allows these cookies to be specified. At
  22249. the very least, each cookie must specify a value along with a path and domain.
  22250. HTTP requests that match both the domain and path will automatically include the
  22251. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  22252. by a newline.
  22253. </p>
  22254. <p>The required syntax to play a stream specifying a cookie is:
  22255. </p><div class="example">
  22256. <pre class="example-preformatted">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
  22257. </pre></div>
  22258. </div>
  22259. </div>
  22260. <div class="section-level-extent" id="Icecast">
  22261. <h3 class="section"><span>24.16 Icecast<a class="copiable-link" href="#Icecast"> &para;</a></span></h3>
  22262. <p>Icecast protocol (stream to Icecast servers)
  22263. </p>
  22264. <p>This protocol accepts the following options:
  22265. </p>
  22266. <dl class="table">
  22267. <dt><samp class="option">ice_genre</samp></dt>
  22268. <dd><p>Set the stream genre.
  22269. </p>
  22270. </dd>
  22271. <dt><samp class="option">ice_name</samp></dt>
  22272. <dd><p>Set the stream name.
  22273. </p>
  22274. </dd>
  22275. <dt><samp class="option">ice_description</samp></dt>
  22276. <dd><p>Set the stream description.
  22277. </p>
  22278. </dd>
  22279. <dt><samp class="option">ice_url</samp></dt>
  22280. <dd><p>Set the stream website URL.
  22281. </p>
  22282. </dd>
  22283. <dt><samp class="option">ice_public</samp></dt>
  22284. <dd><p>Set if the stream should be public.
  22285. The default is 0 (not public).
  22286. </p>
  22287. </dd>
  22288. <dt><samp class="option">user_agent</samp></dt>
  22289. <dd><p>Override the User-Agent header. If not specified a string of the form
  22290. &quot;Lavf/&lt;version&gt;&quot; will be used.
  22291. </p>
  22292. </dd>
  22293. <dt><samp class="option">password</samp></dt>
  22294. <dd><p>Set the Icecast mountpoint password.
  22295. </p>
  22296. </dd>
  22297. <dt><samp class="option">content_type</samp></dt>
  22298. <dd><p>Set the stream content type. This must be set if it is different from
  22299. audio/mpeg.
  22300. </p>
  22301. </dd>
  22302. <dt><samp class="option">legacy_icecast</samp></dt>
  22303. <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
  22304. HTTP PUT method but the SOURCE method.
  22305. </p>
  22306. </dd>
  22307. <dt><samp class="option">tls</samp></dt>
  22308. <dd><p>Establish a TLS (HTTPS) connection to Icecast.
  22309. </p>
  22310. </dd>
  22311. </dl>
  22312. <div class="example">
  22313. <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>
  22314. </pre></div>
  22315. </div>
  22316. <div class="section-level-extent" id="ipfs">
  22317. <h3 class="section"><span>24.17 ipfs<a class="copiable-link" href="#ipfs"> &para;</a></span></h3>
  22318. <p>InterPlanetary File System (IPFS) protocol support. One can access files stored
  22319. on the IPFS network through so-called gateways. These are http(s) endpoints.
  22320. This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent
  22321. to such a gateway. Users can (and should) host their own node which means this
  22322. protocol will use one&rsquo;s local gateway to access files on the IPFS network.
  22323. </p>
  22324. <p>This protocol accepts the following options:
  22325. </p>
  22326. <dl class="table">
  22327. <dt><samp class="option">gateway</samp></dt>
  22328. <dd><p>Defines the gateway to use. When not set, the protocol will first try
  22329. locating the local gateway by looking at <code class="code">$IPFS_GATEWAY</code>, <code class="code">$IPFS_PATH</code>
  22330. and <code class="code">$HOME/.ipfs/</code>, in that order.
  22331. </p>
  22332. </dd>
  22333. </dl>
  22334. <p>One can use this protocol in 2 ways. Using IPFS:
  22335. </p><div class="example">
  22336. <pre class="example-preformatted">ffplay ipfs://&lt;hash&gt;
  22337. </pre></div>
  22338. <p>Or the IPNS protocol (IPNS is mutable IPFS):
  22339. </p><div class="example">
  22340. <pre class="example-preformatted">ffplay ipns://&lt;hash&gt;
  22341. </pre></div>
  22342. </div>
  22343. <div class="section-level-extent" id="mmst">
  22344. <h3 class="section"><span>24.18 mmst<a class="copiable-link" href="#mmst"> &para;</a></span></h3>
  22345. <p>MMS (Microsoft Media Server) protocol over TCP.
  22346. </p>
  22347. </div>
  22348. <div class="section-level-extent" id="mmsh">
  22349. <h3 class="section"><span>24.19 mmsh<a class="copiable-link" href="#mmsh"> &para;</a></span></h3>
  22350. <p>MMS (Microsoft Media Server) protocol over HTTP.
  22351. </p>
  22352. <p>The required syntax is:
  22353. </p><div class="example">
  22354. <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>]
  22355. </pre></div>
  22356. </div>
  22357. <div class="section-level-extent" id="md5-2">
  22358. <h3 class="section"><span>24.20 md5<a class="copiable-link" href="#md5-2"> &para;</a></span></h3>
  22359. <p>MD5 output protocol.
  22360. </p>
  22361. <p>Computes the MD5 hash of the data to be written, and on close writes
  22362. this to the designated output or stdout if none is specified. It can
  22363. be used to test muxers without writing an actual file.
  22364. </p>
  22365. <p>Some examples follow.
  22366. </p><div class="example">
  22367. <pre class="example-preformatted"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  22368. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  22369. # Write the MD5 hash of the encoded AVI file to stdout.
  22370. ffmpeg -i input.flv -f avi -y md5:
  22371. </pre></div>
  22372. <p>Note that some formats (typically MOV) require the output protocol to
  22373. be seekable, so they will fail with the MD5 output protocol.
  22374. </p>
  22375. </div>
  22376. <div class="section-level-extent" id="pipe">
  22377. <h3 class="section"><span>24.21 pipe<a class="copiable-link" href="#pipe"> &para;</a></span></h3>
  22378. <p>UNIX pipe access protocol.
  22379. </p>
  22380. <p>Read and write from UNIX pipes.
  22381. </p>
  22382. <p>The accepted syntax is:
  22383. </p><div class="example">
  22384. <pre class="example-preformatted">pipe:[<var class="var">number</var>]
  22385. </pre></div>
  22386. <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
  22387. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var class="var">number</var>
  22388. is not specified, by default the stdout file descriptor will be used
  22389. for writing, stdin for reading.
  22390. </p>
  22391. <p>For example to read from stdin with <code class="command">ffmpeg</code>:
  22392. </p><div class="example">
  22393. <pre class="example-preformatted">cat test.wav | ffmpeg -i pipe:0
  22394. # ...this is the same as...
  22395. cat test.wav | ffmpeg -i pipe:
  22396. </pre></div>
  22397. <p>For writing to stdout with <code class="command">ffmpeg</code>:
  22398. </p><div class="example">
  22399. <pre class="example-preformatted">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
  22400. # ...this is the same as...
  22401. ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
  22402. </pre></div>
  22403. <p>This protocol accepts the following options:
  22404. </p>
  22405. <dl class="table">
  22406. <dt><samp class="option">blocksize</samp></dt>
  22407. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  22408. <code class="code">INT_MAX</code>, which results in not limiting the requested block size.
  22409. Setting this value reasonably low improves user termination request reaction
  22410. time, which is valuable if data transmission is slow.
  22411. </p></dd>
  22412. <dt><samp class="option">fd</samp></dt>
  22413. <dd><p>Set file descriptor.
  22414. </p></dd>
  22415. </dl>
  22416. <p>Note that some formats (typically MOV), require the output protocol to
  22417. be seekable, so they will fail with the pipe output protocol.
  22418. </p>
  22419. </div>
  22420. <div class="section-level-extent" id="prompeg">
  22421. <h3 class="section"><span>24.22 prompeg<a class="copiable-link" href="#prompeg"> &para;</a></span></h3>
  22422. <p>Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
  22423. </p>
  22424. <p>The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
  22425. for MPEG-2 Transport Streams sent over RTP.
  22426. </p>
  22427. <p>This protocol must be used in conjunction with the <code class="code">rtp_mpegts</code> muxer and
  22428. the <code class="code">rtp</code> protocol.
  22429. </p>
  22430. <p>The required syntax is:
  22431. </p><div class="example">
  22432. <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>
  22433. </pre></div>
  22434. <p>The destination UDP ports are <code class="code">port + 2</code> for the column FEC stream
  22435. and <code class="code">port + 4</code> for the row FEC stream.
  22436. </p>
  22437. <p>This protocol accepts the following options:
  22438. </p><dl class="table">
  22439. <dt><samp class="option">l=<var class="var">n</var></samp></dt>
  22440. <dd><p>The number of columns (4-20, LxD &lt;= 100)
  22441. </p>
  22442. </dd>
  22443. <dt><samp class="option">d=<var class="var">n</var></samp></dt>
  22444. <dd><p>The number of rows (4-20, LxD &lt;= 100)
  22445. </p>
  22446. </dd>
  22447. </dl>
  22448. <p>Example usage:
  22449. </p>
  22450. <div class="example">
  22451. <pre class="example-preformatted">-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<var class="var">hostname</var>:<var class="var">port</var>
  22452. </pre></div>
  22453. </div>
  22454. <div class="section-level-extent" id="rist">
  22455. <h3 class="section"><span>24.23 rist<a class="copiable-link" href="#rist"> &para;</a></span></h3>
  22456. <p>Reliable Internet Streaming Transport protocol
  22457. </p>
  22458. <p>The accepted options are:
  22459. </p><dl class="table">
  22460. <dt><samp class="option">rist_profile</samp></dt>
  22461. <dd><p>Supported values:
  22462. </p><dl class="table">
  22463. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  22464. <dt>&lsquo;<samp class="samp">main</samp>&rsquo;</dt>
  22465. <dd><p>This one is default.
  22466. </p></dd>
  22467. <dt>&lsquo;<samp class="samp">advanced</samp>&rsquo;</dt>
  22468. </dl>
  22469. </dd>
  22470. <dt><samp class="option">buffer_size</samp></dt>
  22471. <dd><p>Set internal RIST buffer size in milliseconds for retransmission of data.
  22472. Default value is 0 which means the librist default (1 sec). Maximum value is 30
  22473. seconds.
  22474. </p>
  22475. </dd>
  22476. <dt><samp class="option">fifo_size</samp></dt>
  22477. <dd><p>Size of the librist receiver output fifo in number of packets. This must be a
  22478. power of 2.
  22479. Defaults to 8192 (vs the librist default of 1024).
  22480. </p>
  22481. </dd>
  22482. <dt><samp class="option">overrun_nonfatal=<var class="var">1|0</var></samp></dt>
  22483. <dd><p>Survive in case of librist fifo buffer overrun. Default value is 0.
  22484. </p>
  22485. </dd>
  22486. <dt><samp class="option">pkt_size</samp></dt>
  22487. <dd><p>Set maximum packet size for sending data. 1316 by default.
  22488. </p>
  22489. </dd>
  22490. <dt><samp class="option">log_level</samp></dt>
  22491. <dd><p>Set loglevel for RIST logging messages. You only need to set this if you
  22492. explicitly want to enable debug level messages or packet loss simulation,
  22493. otherwise the regular loglevel is respected.
  22494. </p>
  22495. </dd>
  22496. <dt><samp class="option">secret</samp></dt>
  22497. <dd><p>Set override of encryption secret, by default is unset.
  22498. </p>
  22499. </dd>
  22500. <dt><samp class="option">encryption</samp></dt>
  22501. <dd><p>Set encryption type, by default is disabled.
  22502. Acceptable values are 128 and 256.
  22503. </p></dd>
  22504. </dl>
  22505. </div>
  22506. <div class="section-level-extent" id="rtmp">
  22507. <h3 class="section"><span>24.24 rtmp<a class="copiable-link" href="#rtmp"> &para;</a></span></h3>
  22508. <p>Real-Time Messaging Protocol.
  22509. </p>
  22510. <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  22511. content across a TCP/IP network.
  22512. </p>
  22513. <p>The required syntax is:
  22514. </p><div class="example">
  22515. <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>]
  22516. </pre></div>
  22517. <p>The accepted parameters are:
  22518. </p><dl class="table">
  22519. <dt><samp class="option">username</samp></dt>
  22520. <dd><p>An optional username (mostly for publishing).
  22521. </p>
  22522. </dd>
  22523. <dt><samp class="option">password</samp></dt>
  22524. <dd><p>An optional password (mostly for publishing).
  22525. </p>
  22526. </dd>
  22527. <dt><samp class="option">server</samp></dt>
  22528. <dd><p>The address of the RTMP server.
  22529. </p>
  22530. </dd>
  22531. <dt><samp class="option">port</samp></dt>
  22532. <dd><p>The number of the TCP port to use (by default is 1935).
  22533. </p>
  22534. </dd>
  22535. <dt><samp class="option">app</samp></dt>
  22536. <dd><p>It is the name of the application to access. It usually corresponds to
  22537. the path where the application is installed on the RTMP server
  22538. (e.g. <samp class="file">/ondemand/</samp>, <samp class="file">/flash/live/</samp>, etc.). You can override
  22539. the value parsed from the URI through the <code class="code">rtmp_app</code> option, too.
  22540. </p>
  22541. </dd>
  22542. <dt><samp class="option">playpath</samp></dt>
  22543. <dd><p>It is the path or name of the resource to play with reference to the
  22544. application specified in <var class="var">app</var>, may be prefixed by &quot;mp4:&quot;. You
  22545. can override the value parsed from the URI through the <code class="code">rtmp_playpath</code>
  22546. option, too.
  22547. </p>
  22548. </dd>
  22549. <dt><samp class="option">listen</samp></dt>
  22550. <dd><p>Act as a server, listening for an incoming connection.
  22551. </p>
  22552. </dd>
  22553. <dt><samp class="option">timeout</samp></dt>
  22554. <dd><p>Maximum time to wait for the incoming connection. Implies listen.
  22555. </p></dd>
  22556. </dl>
  22557. <p>Additionally, the following parameters can be set via command line options
  22558. (or in code via <code class="code">AVOption</code>s):
  22559. </p><dl class="table">
  22560. <dt><samp class="option">rtmp_app</samp></dt>
  22561. <dd><p>Name of application to connect on the RTMP server. This option
  22562. overrides the parameter specified in the URI.
  22563. </p>
  22564. </dd>
  22565. <dt><samp class="option">rtmp_buffer</samp></dt>
  22566. <dd><p>Set the client buffer time in milliseconds. The default is 3000.
  22567. </p>
  22568. </dd>
  22569. <dt><samp class="option">rtmp_conn</samp></dt>
  22570. <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
  22571. e.g. like <code class="code">B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
  22572. Each value is prefixed by a single character denoting the type,
  22573. B for Boolean, N for number, S for string, O for object, or Z for null,
  22574. followed by a colon. For Booleans the data must be either 0 or 1 for
  22575. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  22576. 1 to end or begin an object, respectively. Data items in subobjects may
  22577. be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
  22578. the value (i.e. <code class="code">NB:myFlag:1</code>). This option may be used multiple
  22579. times to construct arbitrary AMF sequences.
  22580. </p>
  22581. </dd>
  22582. <dt><samp class="option">rtmp_enhanced_codecs</samp></dt>
  22583. <dd><p>Specify the list of codecs the client advertises to support in an
  22584. enhanced RTMP stream. This option should be set to a comma separated
  22585. list of fourcc values, like <code class="code">hvc1,av01,vp09</code> for multiple codecs
  22586. or <code class="code">hvc1</code> for only one codec. The specified list will be presented
  22587. in the &quot;fourCcLive&quot; property of the Connect Command Message.
  22588. </p>
  22589. </dd>
  22590. <dt><samp class="option">rtmp_flashver</samp></dt>
  22591. <dd><p>Version of the Flash plugin used to run the SWF player. The default
  22592. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  22593. &lt;libavformat version&gt;).)
  22594. </p>
  22595. </dd>
  22596. <dt><samp class="option">rtmp_flush_interval</samp></dt>
  22597. <dd><p>Number of packets flushed in the same request (RTMPT only). The default
  22598. is 10.
  22599. </p>
  22600. </dd>
  22601. <dt><samp class="option">rtmp_live</samp></dt>
  22602. <dd><p>Specify that the media is a live stream. No resuming or seeking in
  22603. live streams is possible. The default value is <code class="code">any</code>, which means the
  22604. subscriber first tries to play the live stream specified in the
  22605. playpath. If a live stream of that name is not found, it plays the
  22606. recorded stream. The other possible values are <code class="code">live</code> and
  22607. <code class="code">recorded</code>.
  22608. </p>
  22609. </dd>
  22610. <dt><samp class="option">rtmp_pageurl</samp></dt>
  22611. <dd><p>URL of the web page in which the media was embedded. By default no
  22612. value will be sent.
  22613. </p>
  22614. </dd>
  22615. <dt><samp class="option">rtmp_playpath</samp></dt>
  22616. <dd><p>Stream identifier to play or to publish. This option overrides the
  22617. parameter specified in the URI.
  22618. </p>
  22619. </dd>
  22620. <dt><samp class="option">rtmp_subscribe</samp></dt>
  22621. <dd><p>Name of live stream to subscribe to. By default no value will be sent.
  22622. It is only sent if the option is specified or if rtmp_live
  22623. is set to live.
  22624. </p>
  22625. </dd>
  22626. <dt><samp class="option">rtmp_swfhash</samp></dt>
  22627. <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
  22628. </p>
  22629. </dd>
  22630. <dt><samp class="option">rtmp_swfsize</samp></dt>
  22631. <dd><p>Size of the decompressed SWF file, required for SWFVerification.
  22632. </p>
  22633. </dd>
  22634. <dt><samp class="option">rtmp_swfurl</samp></dt>
  22635. <dd><p>URL of the SWF player for the media. By default no value will be sent.
  22636. </p>
  22637. </dd>
  22638. <dt><samp class="option">rtmp_swfverify</samp></dt>
  22639. <dd><p>URL to player swf file, compute hash/size automatically.
  22640. </p>
  22641. </dd>
  22642. <dt><samp class="option">rtmp_tcurl</samp></dt>
  22643. <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
  22644. </p>
  22645. </dd>
  22646. <dt><samp class="option">tcp_nodelay=<var class="var">1|0</var></samp></dt>
  22647. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  22648. </p>
  22649. <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>
  22650. </p>
  22651. </dd>
  22652. </dl>
  22653. <p>For example to read with <code class="command">ffplay</code> a multimedia resource named
  22654. &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
  22655. </p><div class="example">
  22656. <pre class="example-preformatted">ffplay rtmp://myserver/vod/sample
  22657. </pre></div>
  22658. <p>To publish to a password protected server, passing the playpath and
  22659. app names separately:
  22660. </p><div class="example">
  22661. <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/
  22662. </pre></div>
  22663. </div>
  22664. <div class="section-level-extent" id="rtmpe">
  22665. <h3 class="section"><span>24.25 rtmpe<a class="copiable-link" href="#rtmpe"> &para;</a></span></h3>
  22666. <p>Encrypted Real-Time Messaging Protocol.
  22667. </p>
  22668. <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  22669. streaming multimedia content within standard cryptographic primitives,
  22670. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  22671. a pair of RC4 keys.
  22672. </p>
  22673. </div>
  22674. <div class="section-level-extent" id="rtmps">
  22675. <h3 class="section"><span>24.26 rtmps<a class="copiable-link" href="#rtmps"> &para;</a></span></h3>
  22676. <p>Real-Time Messaging Protocol over a secure SSL connection.
  22677. </p>
  22678. <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
  22679. multimedia content across an encrypted connection.
  22680. </p>
  22681. </div>
  22682. <div class="section-level-extent" id="rtmpt">
  22683. <h3 class="section"><span>24.27 rtmpt<a class="copiable-link" href="#rtmpt"> &para;</a></span></h3>
  22684. <p>Real-Time Messaging Protocol tunneled through HTTP.
  22685. </p>
  22686. <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  22687. for streaming multimedia content within HTTP requests to traverse
  22688. firewalls.
  22689. </p>
  22690. </div>
  22691. <div class="section-level-extent" id="rtmpte">
  22692. <h3 class="section"><span>24.28 rtmpte<a class="copiable-link" href="#rtmpte"> &para;</a></span></h3>
  22693. <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  22694. </p>
  22695. <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  22696. is used for streaming multimedia content within HTTP requests to traverse
  22697. firewalls.
  22698. </p>
  22699. </div>
  22700. <div class="section-level-extent" id="rtmpts">
  22701. <h3 class="section"><span>24.29 rtmpts<a class="copiable-link" href="#rtmpts"> &para;</a></span></h3>
  22702. <p>Real-Time Messaging Protocol tunneled through HTTPS.
  22703. </p>
  22704. <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  22705. for streaming multimedia content within HTTPS requests to traverse
  22706. firewalls.
  22707. </p>
  22708. </div>
  22709. <div class="section-level-extent" id="libsmbclient">
  22710. <h3 class="section"><span>24.30 libsmbclient<a class="copiable-link" href="#libsmbclient"> &para;</a></span></h3>
  22711. <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
  22712. </p>
  22713. <p>Following syntax is required.
  22714. </p>
  22715. <div class="example">
  22716. <pre class="example-preformatted">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  22717. </pre></div>
  22718. <p>This protocol accepts the following options.
  22719. </p>
  22720. <dl class="table">
  22721. <dt><samp class="option">timeout</samp></dt>
  22722. <dd><p>Set timeout in milliseconds of socket I/O operations used by the underlying
  22723. low level operation. By default it is set to -1, which means that the timeout
  22724. is not specified.
  22725. </p>
  22726. </dd>
  22727. <dt><samp class="option">truncate</samp></dt>
  22728. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  22729. truncating. Default value is 1.
  22730. </p>
  22731. </dd>
  22732. <dt><samp class="option">workgroup</samp></dt>
  22733. <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
  22734. </p>
  22735. </dd>
  22736. </dl>
  22737. <p>For more information see: <a class="url" href="http://www.samba.org/">http://www.samba.org/</a>.
  22738. </p>
  22739. </div>
  22740. <div class="section-level-extent" id="libssh">
  22741. <h3 class="section"><span>24.31 libssh<a class="copiable-link" href="#libssh"> &para;</a></span></h3>
  22742. <p>Secure File Transfer Protocol via libssh
  22743. </p>
  22744. <p>Read from or write to remote resources using SFTP protocol.
  22745. </p>
  22746. <p>Following syntax is required.
  22747. </p>
  22748. <div class="example">
  22749. <pre class="example-preformatted">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  22750. </pre></div>
  22751. <p>This protocol accepts the following options.
  22752. </p>
  22753. <dl class="table">
  22754. <dt><samp class="option">timeout</samp></dt>
  22755. <dd><p>Set timeout of socket I/O operations used by the underlying low level
  22756. operation. By default it is set to -1, which means that the timeout
  22757. is not specified.
  22758. </p>
  22759. </dd>
  22760. <dt><samp class="option">truncate</samp></dt>
  22761. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  22762. truncating. Default value is 1.
  22763. </p>
  22764. </dd>
  22765. <dt><samp class="option">private_key</samp></dt>
  22766. <dd><p>Specify the path of the file containing private key to use during authorization.
  22767. By default libssh searches for keys in the <samp class="file">~/.ssh/</samp> directory.
  22768. </p>
  22769. </dd>
  22770. </dl>
  22771. <p>Example: Play a file stored on remote server.
  22772. </p>
  22773. <div class="example">
  22774. <pre class="example-preformatted">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  22775. </pre></div>
  22776. </div>
  22777. <div class="section-level-extent" id="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">
  22778. <h3 class="section"><span>24.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte<a class="copiable-link" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"> &para;</a></span></h3>
  22779. <p>Real-Time Messaging Protocol and its variants supported through
  22780. librtmp.
  22781. </p>
  22782. <p>Requires the presence of the librtmp headers and library during
  22783. configuration. You need to explicitly configure the build with
  22784. &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
  22785. protocol.
  22786. </p>
  22787. <p>This protocol provides most client functions and a few server
  22788. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  22789. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  22790. variants of these encrypted types (RTMPTE, RTMPTS).
  22791. </p>
  22792. <p>The required syntax is:
  22793. </p><div class="example">
  22794. <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>
  22795. </pre></div>
  22796. <p>where <var class="var">rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
  22797. &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
  22798. <var class="var">server</var>, <var class="var">port</var>, <var class="var">app</var> and <var class="var">playpath</var> have the same
  22799. meaning as specified for the RTMP native protocol.
  22800. <var class="var">options</var> contains a list of space-separated options of the form
  22801. <var class="var">key</var>=<var class="var">val</var>.
  22802. </p>
  22803. <p>See the librtmp manual page (man 3 librtmp) for more information.
  22804. </p>
  22805. <p>For example, to stream a file in real-time to an RTMP server using
  22806. <code class="command">ffmpeg</code>:
  22807. </p><div class="example">
  22808. <pre class="example-preformatted">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  22809. </pre></div>
  22810. <p>To play the same stream using <code class="command">ffplay</code>:
  22811. </p><div class="example">
  22812. <pre class="example-preformatted">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
  22813. </pre></div>
  22814. </div>
  22815. <div class="section-level-extent" id="rtp">
  22816. <h3 class="section"><span>24.33 rtp<a class="copiable-link" href="#rtp"> &para;</a></span></h3>
  22817. <p>Real-time Transport Protocol.
  22818. </p>
  22819. <p>The required syntax for an RTP URL is:
  22820. rtp://<var class="var">hostname</var>[:<var class="var">port</var>][?<var class="var">option</var>=<var class="var">val</var>...]
  22821. </p>
  22822. <p><var class="var">port</var> specifies the RTP port to use.
  22823. </p>
  22824. <p>The following URL options are supported:
  22825. </p>
  22826. <dl class="table">
  22827. <dt><samp class="option">ttl=<var class="var">n</var></samp></dt>
  22828. <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
  22829. </p>
  22830. </dd>
  22831. <dt><samp class="option">rtcpport=<var class="var">n</var></samp></dt>
  22832. <dd><p>Set the remote RTCP port to <var class="var">n</var>.
  22833. </p>
  22834. </dd>
  22835. <dt><samp class="option">localrtpport=<var class="var">n</var></samp></dt>
  22836. <dd><p>Set the local RTP port to <var class="var">n</var>.
  22837. </p>
  22838. </dd>
  22839. <dt><samp class="option">localrtcpport=<var class="var">n</var>'</samp></dt>
  22840. <dd><p>Set the local RTCP port to <var class="var">n</var>.
  22841. </p>
  22842. </dd>
  22843. <dt><samp class="option">pkt_size=<var class="var">n</var></samp></dt>
  22844. <dd><p>Set max packet size (in bytes) to <var class="var">n</var>.
  22845. </p>
  22846. </dd>
  22847. <dt><samp class="option">buffer_size=<var class="var">size</var></samp></dt>
  22848. <dd><p>Set the maximum UDP socket buffer size in bytes.
  22849. </p>
  22850. </dd>
  22851. <dt><samp class="option">connect=0|1</samp></dt>
  22852. <dd><p>Do a <code class="code">connect()</code> on the UDP socket (if set to 1) or not (if set
  22853. to 0).
  22854. </p>
  22855. </dd>
  22856. <dt><samp class="option">sources=<var class="var">ip</var>[,<var class="var">ip</var>]</samp></dt>
  22857. <dd><p>List allowed source IP addresses.
  22858. </p>
  22859. </dd>
  22860. <dt><samp class="option">block=<var class="var">ip</var>[,<var class="var">ip</var>]</samp></dt>
  22861. <dd><p>List disallowed (blocked) source IP addresses.
  22862. </p>
  22863. </dd>
  22864. <dt><samp class="option">write_to_source=0|1</samp></dt>
  22865. <dd><p>Send packets to the source address of the latest received packet (if
  22866. set to 1) or to a default remote address (if set to 0).
  22867. </p>
  22868. </dd>
  22869. <dt><samp class="option">localport=<var class="var">n</var></samp></dt>
  22870. <dd><p>Set the local RTP port to <var class="var">n</var>.
  22871. </p>
  22872. </dd>
  22873. <dt><samp class="option">localaddr=<var class="var">addr</var></samp></dt>
  22874. <dd><p>Local IP address of a network interface used for sending packets or joining
  22875. multicast groups.
  22876. </p>
  22877. </dd>
  22878. <dt><samp class="option">timeout=<var class="var">n</var></samp></dt>
  22879. <dd><p>Set timeout (in microseconds) of socket I/O operations to <var class="var">n</var>.
  22880. </p>
  22881. <p>This is a deprecated option. Instead, <samp class="option">localrtpport</samp> should be
  22882. used.
  22883. </p>
  22884. </dd>
  22885. </dl>
  22886. <p>Important notes:
  22887. </p>
  22888. <ol class="enumerate">
  22889. <li> If <samp class="option">rtcpport</samp> is not set the RTCP port will be set to the RTP
  22890. port value plus 1.
  22891. </li><li> If <samp class="option">localrtpport</samp> (the local RTP port) is not set any available
  22892. port will be used for the local RTP and RTCP ports.
  22893. </li><li> If <samp class="option">localrtcpport</samp> (the local RTCP port) is not set it will be
  22894. set to the local RTP port value plus 1.
  22895. </li></ol>
  22896. </div>
  22897. <div class="section-level-extent" id="rtsp">
  22898. <h3 class="section"><span>24.34 rtsp<a class="copiable-link" href="#rtsp"> &para;</a></span></h3>
  22899. <p>Real-Time Streaming Protocol.
  22900. </p>
  22901. <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
  22902. and muxer. The demuxer supports both normal RTSP (with data transferred
  22903. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  22904. data transferred over RDT).
  22905. </p>
  22906. <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  22907. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
  22908. <a class="uref" href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
  22909. </p>
  22910. <p>The required syntax for a RTSP url is:
  22911. </p><div class="example">
  22912. <pre class="example-preformatted">rtsp://<var class="var">hostname</var>[:<var class="var">port</var>]/<var class="var">path</var>
  22913. </pre></div>
  22914. <p>Options can be set on the <code class="command">ffmpeg</code>/<code class="command">ffplay</code> command
  22915. line, or set in code via <code class="code">AVOption</code>s or in
  22916. <code class="code">avformat_open_input</code>.
  22917. </p>
  22918. <ul class="mini-toc">
  22919. <li><a href="#Muxer" accesskey="1">Muxer</a></li>
  22920. <li><a href="#Demuxer" accesskey="2">Demuxer</a></li>
  22921. <li><a href="#Examples-23" accesskey="3">Examples</a></li>
  22922. </ul>
  22923. <div class="subsection-level-extent" id="Muxer">
  22924. <h4 class="subsection"><span>24.34.1 Muxer<a class="copiable-link" href="#Muxer"> &para;</a></span></h4>
  22925. <p>The following options are supported.
  22926. </p>
  22927. <dl class="table">
  22928. <dt><samp class="option">rtsp_transport</samp></dt>
  22929. <dd><p>Set RTSP transport protocols.
  22930. </p>
  22931. <p>It accepts the following values:
  22932. </p><dl class="table">
  22933. <dt>&lsquo;<samp class="samp">udp</samp>&rsquo;</dt>
  22934. <dd><p>Use UDP as lower transport protocol.
  22935. </p>
  22936. </dd>
  22937. <dt>&lsquo;<samp class="samp">tcp</samp>&rsquo;</dt>
  22938. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  22939. transport protocol.
  22940. </p></dd>
  22941. </dl>
  22942. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  22943. </p>
  22944. </dd>
  22945. <dt><samp class="option">rtsp_flags</samp></dt>
  22946. <dd><p>Set RTSP flags.
  22947. </p>
  22948. <p>The following values are accepted:
  22949. </p><dl class="table">
  22950. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  22951. <dd><p>Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC.
  22952. </p></dd>
  22953. <dt>&lsquo;<samp class="samp">rfc2190</samp>&rsquo;</dt>
  22954. <dd><p>Use RFC 2190 packetization instead of RFC 4629 for H.263.
  22955. </p></dd>
  22956. <dt>&lsquo;<samp class="samp">skip_rtcp</samp>&rsquo;</dt>
  22957. <dd><p>Don&rsquo;t send RTCP sender reports.
  22958. </p></dd>
  22959. <dt>&lsquo;<samp class="samp">h264_mode0</samp>&rsquo;</dt>
  22960. <dd><p>Use mode 0 for H.264 in RTP.
  22961. </p></dd>
  22962. <dt>&lsquo;<samp class="samp">send_bye</samp>&rsquo;</dt>
  22963. <dd><p>Send RTCP BYE packets when finishing.
  22964. </p></dd>
  22965. </dl>
  22966. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  22967. </p>
  22968. </dd>
  22969. <dt><samp class="option">min_port</samp></dt>
  22970. <dd><p>Set minimum local UDP port. Default value is 5000.
  22971. </p>
  22972. </dd>
  22973. <dt><samp class="option">max_port</samp></dt>
  22974. <dd><p>Set maximum local UDP port. Default value is 65000.
  22975. </p>
  22976. </dd>
  22977. <dt><samp class="option">buffer_size</samp></dt>
  22978. <dd><p>Set the maximum socket buffer size in bytes.
  22979. </p>
  22980. </dd>
  22981. <dt><samp class="option">pkt_size</samp></dt>
  22982. <dd><p>Set max send packet size (in bytes). Default value is 1472.
  22983. </p></dd>
  22984. </dl>
  22985. </div>
  22986. <div class="subsection-level-extent" id="Demuxer">
  22987. <h4 class="subsection"><span>24.34.2 Demuxer<a class="copiable-link" href="#Demuxer"> &para;</a></span></h4>
  22988. <p>The following options are supported.
  22989. </p>
  22990. <dl class="table">
  22991. <dt><samp class="option">initial_pause</samp></dt>
  22992. <dd><p>Do not start playing the stream immediately if set to 1. Default value
  22993. is 0.
  22994. </p>
  22995. </dd>
  22996. <dt><samp class="option">rtsp_transport</samp></dt>
  22997. <dd><p>Set RTSP transport protocols.
  22998. </p>
  22999. <p>It accepts the following values:
  23000. </p><dl class="table">
  23001. <dt>&lsquo;<samp class="samp">udp</samp>&rsquo;</dt>
  23002. <dd><p>Use UDP as lower transport protocol.
  23003. </p>
  23004. </dd>
  23005. <dt>&lsquo;<samp class="samp">tcp</samp>&rsquo;</dt>
  23006. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  23007. transport protocol.
  23008. </p>
  23009. </dd>
  23010. <dt>&lsquo;<samp class="samp">udp_multicast</samp>&rsquo;</dt>
  23011. <dd><p>Use UDP multicast as lower transport protocol.
  23012. </p>
  23013. </dd>
  23014. <dt>&lsquo;<samp class="samp">http</samp>&rsquo;</dt>
  23015. <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
  23016. passing proxies.
  23017. </p>
  23018. </dd>
  23019. <dt>&lsquo;<samp class="samp">https</samp>&rsquo;</dt>
  23020. <dd><p>Use HTTPs tunneling as lower transport protocol, which is useful for
  23021. passing proxies and widely used for security consideration.
  23022. </p></dd>
  23023. </dl>
  23024. <p>Multiple lower transport protocols may be specified, in that case they are
  23025. tried one at a time (if the setup of one fails, the next one is tried).
  23026. For the muxer, only the &lsquo;<samp class="samp">tcp</samp>&rsquo; and &lsquo;<samp class="samp">udp</samp>&rsquo; options are supported.
  23027. </p>
  23028. </dd>
  23029. <dt><samp class="option">rtsp_flags</samp></dt>
  23030. <dd><p>Set RTSP flags.
  23031. </p>
  23032. <p>The following values are accepted:
  23033. </p><dl class="table">
  23034. <dt>&lsquo;<samp class="samp">filter_src</samp>&rsquo;</dt>
  23035. <dd><p>Accept packets only from negotiated peer address and port.
  23036. </p></dd>
  23037. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  23038. <dd><p>Act as a server, listening for an incoming connection.
  23039. </p></dd>
  23040. <dt>&lsquo;<samp class="samp">prefer_tcp</samp>&rsquo;</dt>
  23041. <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  23042. </p></dd>
  23043. <dt>&lsquo;<samp class="samp">satip_raw</samp>&rsquo;</dt>
  23044. <dd><p>Export raw MPEG-TS stream instead of demuxing. The flag will simply write out
  23045. the raw stream, with the original PAT/PMT/PIDs intact.
  23046. </p></dd>
  23047. </dl>
  23048. <p>Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  23049. </p>
  23050. </dd>
  23051. <dt><samp class="option">allowed_media_types</samp></dt>
  23052. <dd><p>Set media types to accept from the server.
  23053. </p>
  23054. <p>The following flags are accepted:
  23055. </p><dl class="table">
  23056. <dt>&lsquo;<samp class="samp">video</samp>&rsquo;</dt>
  23057. <dt>&lsquo;<samp class="samp">audio</samp>&rsquo;</dt>
  23058. <dt>&lsquo;<samp class="samp">data</samp>&rsquo;</dt>
  23059. <dt>&lsquo;<samp class="samp">subtitle</samp>&rsquo;</dt>
  23060. </dl>
  23061. <p>By default it accepts all media types.
  23062. </p>
  23063. </dd>
  23064. <dt><samp class="option">min_port</samp></dt>
  23065. <dd><p>Set minimum local UDP port. Default value is 5000.
  23066. </p>
  23067. </dd>
  23068. <dt><samp class="option">max_port</samp></dt>
  23069. <dd><p>Set maximum local UDP port. Default value is 65000.
  23070. </p>
  23071. </dd>
  23072. <dt><samp class="option">listen_timeout</samp></dt>
  23073. <dd><p>Set maximum timeout (in seconds) to establish an initial connection. Setting
  23074. <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
  23075. which means an infinite timeout when &lsquo;<samp class="samp">listen</samp>&rsquo; mode is set.
  23076. </p>
  23077. </dd>
  23078. <dt><samp class="option">reorder_queue_size</samp></dt>
  23079. <dd><p>Set number of packets to buffer for handling of reordered packets.
  23080. </p>
  23081. </dd>
  23082. <dt><samp class="option">timeout</samp></dt>
  23083. <dd><p>Set socket TCP I/O timeout in microseconds.
  23084. </p>
  23085. </dd>
  23086. <dt><samp class="option">user_agent</samp></dt>
  23087. <dd><p>Override User-Agent header. If not specified, it defaults to the
  23088. libavformat identifier string.
  23089. </p>
  23090. </dd>
  23091. <dt><samp class="option">buffer_size</samp></dt>
  23092. <dd><p>Set the maximum socket buffer size in bytes.
  23093. </p></dd>
  23094. </dl>
  23095. <p>When receiving data over UDP, the demuxer tries to reorder received packets
  23096. (since they may arrive out of order, or packets may get lost totally). This
  23097. can be disabled by setting the maximum demuxing delay to zero (via
  23098. the <code class="code">max_delay</code> field of AVFormatContext).
  23099. </p>
  23100. <p>When watching multi-bitrate Real-RTSP streams with <code class="command">ffplay</code>, the
  23101. streams to display can be chosen with <code class="code">-vst</code> <var class="var">n</var> and
  23102. <code class="code">-ast</code> <var class="var">n</var> for video and audio respectively, and can be switched
  23103. on the fly by pressing <code class="code">v</code> and <code class="code">a</code>.
  23104. </p>
  23105. </div>
  23106. <div class="subsection-level-extent" id="Examples-23">
  23107. <h4 class="subsection"><span>24.34.3 Examples<a class="copiable-link" href="#Examples-23"> &para;</a></span></h4>
  23108. <p>The following examples all make use of the <code class="command">ffplay</code> and
  23109. <code class="command">ffmpeg</code> tools.
  23110. </p>
  23111. <ul class="itemize mark-bullet">
  23112. <li>Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  23113. <div class="example">
  23114. <pre class="example-preformatted">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  23115. </pre></div>
  23116. </li><li>Watch a stream tunneled over HTTP:
  23117. <div class="example">
  23118. <pre class="example-preformatted">ffplay -rtsp_transport http rtsp://server/video.mp4
  23119. </pre></div>
  23120. </li><li>Send a stream in realtime to a RTSP server, for others to watch:
  23121. <div class="example">
  23122. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  23123. </pre></div>
  23124. </li><li>Receive a stream in realtime:
  23125. <div class="example">
  23126. <pre class="example-preformatted">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var class="var">output</var>
  23127. </pre></div>
  23128. </li></ul>
  23129. </div>
  23130. </div>
  23131. <div class="section-level-extent" id="sap">
  23132. <h3 class="section"><span>24.35 sap<a class="copiable-link" href="#sap"> &para;</a></span></h3>
  23133. <p>Session Announcement Protocol (RFC 2974). This is not technically a
  23134. protocol handler in libavformat, it is a muxer and demuxer.
  23135. It is used for signalling of RTP streams, by announcing the SDP for the
  23136. streams regularly on a separate port.
  23137. </p>
  23138. <ul class="mini-toc">
  23139. <li><a href="#Muxer-1" accesskey="1">Muxer</a></li>
  23140. <li><a href="#Demuxer-1" accesskey="2">Demuxer</a></li>
  23141. </ul>
  23142. <div class="subsection-level-extent" id="Muxer-1">
  23143. <h4 class="subsection"><span>24.35.1 Muxer<a class="copiable-link" href="#Muxer-1"> &para;</a></span></h4>
  23144. <p>The syntax for a SAP url given to the muxer is:
  23145. </p><div class="example">
  23146. <pre class="example-preformatted">sap://<var class="var">destination</var>[:<var class="var">port</var>][?<var class="var">options</var>]
  23147. </pre></div>
  23148. <p>The RTP packets are sent to <var class="var">destination</var> on port <var class="var">port</var>,
  23149. or to port 5004 if no port is specified.
  23150. <var class="var">options</var> is a <code class="code">&amp;</code>-separated list. The following options
  23151. are supported:
  23152. </p>
  23153. <dl class="table">
  23154. <dt><samp class="option">announce_addr=<var class="var">address</var></samp></dt>
  23155. <dd><p>Specify the destination IP address for sending the announcements to.
  23156. If omitted, the announcements are sent to the commonly used SAP
  23157. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  23158. ff0e::2:7ffe if <var class="var">destination</var> is an IPv6 address.
  23159. </p>
  23160. </dd>
  23161. <dt><samp class="option">announce_port=<var class="var">port</var></samp></dt>
  23162. <dd><p>Specify the port to send the announcements on, defaults to
  23163. 9875 if not specified.
  23164. </p>
  23165. </dd>
  23166. <dt><samp class="option">ttl=<var class="var">ttl</var></samp></dt>
  23167. <dd><p>Specify the time to live value for the announcements and RTP packets,
  23168. defaults to 255.
  23169. </p>
  23170. </dd>
  23171. <dt><samp class="option">same_port=<var class="var">0|1</var></samp></dt>
  23172. <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
  23173. default), all streams are sent on unique ports, with each stream on a
  23174. port 2 numbers higher than the previous.
  23175. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  23176. The RTP stack in libavformat for receiving requires all streams to be sent
  23177. on unique ports.
  23178. </p></dd>
  23179. </dl>
  23180. <p>Example command lines follow.
  23181. </p>
  23182. <p>To broadcast a stream on the local subnet, for watching in VLC:
  23183. </p>
  23184. <div class="example">
  23185. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://224.0.0.255?same_port=1
  23186. </pre></div>
  23187. <p>Similarly, for watching in <code class="command">ffplay</code>:
  23188. </p>
  23189. <div class="example">
  23190. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://224.0.0.255
  23191. </pre></div>
  23192. <p>And for watching in <code class="command">ffplay</code>, over IPv6:
  23193. </p>
  23194. <div class="example">
  23195. <pre class="example-preformatted">ffmpeg -re -i <var class="var">input</var> -f sap sap://[ff0e::1:2:3:4]
  23196. </pre></div>
  23197. </div>
  23198. <div class="subsection-level-extent" id="Demuxer-1">
  23199. <h4 class="subsection"><span>24.35.2 Demuxer<a class="copiable-link" href="#Demuxer-1"> &para;</a></span></h4>
  23200. <p>The syntax for a SAP url given to the demuxer is:
  23201. </p><div class="example">
  23202. <pre class="example-preformatted">sap://[<var class="var">address</var>][:<var class="var">port</var>]
  23203. </pre></div>
  23204. <p><var class="var">address</var> is the multicast address to listen for announcements on,
  23205. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var class="var">port</var>
  23206. is the port that is listened on, 9875 if omitted.
  23207. </p>
  23208. <p>The demuxers listens for announcements on the given address and port.
  23209. Once an announcement is received, it tries to receive that particular stream.
  23210. </p>
  23211. <p>Example command lines follow.
  23212. </p>
  23213. <p>To play back the first stream announced on the normal SAP multicast address:
  23214. </p>
  23215. <div class="example">
  23216. <pre class="example-preformatted">ffplay sap://
  23217. </pre></div>
  23218. <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
  23219. </p>
  23220. <div class="example">
  23221. <pre class="example-preformatted">ffplay sap://[ff0e::2:7ffe]
  23222. </pre></div>
  23223. </div>
  23224. </div>
  23225. <div class="section-level-extent" id="sctp">
  23226. <h3 class="section"><span>24.36 sctp<a class="copiable-link" href="#sctp"> &para;</a></span></h3>
  23227. <p>Stream Control Transmission Protocol.
  23228. </p>
  23229. <p>The accepted URL syntax is:
  23230. </p><div class="example">
  23231. <pre class="example-preformatted">sctp://<var class="var">host</var>:<var class="var">port</var>[?<var class="var">options</var>]
  23232. </pre></div>
  23233. <p>The protocol accepts the following options:
  23234. </p><dl class="table">
  23235. <dt><samp class="option">listen</samp></dt>
  23236. <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  23237. </p>
  23238. </dd>
  23239. <dt><samp class="option">max_streams</samp></dt>
  23240. <dd><p>Set the maximum number of streams. By default no limit is set.
  23241. </p></dd>
  23242. </dl>
  23243. </div>
  23244. <div class="section-level-extent" id="srt">
  23245. <h3 class="section"><span>24.37 srt<a class="copiable-link" href="#srt"> &para;</a></span></h3>
  23246. <p>Haivision Secure Reliable Transport Protocol via libsrt.
  23247. </p>
  23248. <p>The supported syntax for a SRT URL is:
  23249. </p><div class="example">
  23250. <pre class="example-preformatted">srt://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  23251. </pre></div>
  23252. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  23253. <var class="var">key</var>=<var class="var">val</var>.
  23254. </p>
  23255. <p>or
  23256. </p>
  23257. <div class="example">
  23258. <pre class="example-preformatted"><var class="var">options</var> srt://<var class="var">hostname</var>:<var class="var">port</var>
  23259. </pre></div>
  23260. <p><var class="var">options</var> contains a list of &rsquo;-<var class="var">key</var> <var class="var">val</var>&rsquo;
  23261. options.
  23262. </p>
  23263. <p>This protocol accepts the following options.
  23264. </p>
  23265. <dl class="table">
  23266. <dt><samp class="option">connect_timeout=<var class="var">milliseconds</var></samp></dt>
  23267. <dd><p>Connection timeout; SRT cannot connect for RTT &gt; 1500 msec
  23268. (2 handshake exchanges) with the default connect timeout of
  23269. 3 seconds. This option applies to the caller and rendezvous
  23270. connection modes. The connect timeout is 10 times the value
  23271. set for the rendezvous mode (which can be used as a
  23272. workaround for this connection problem with earlier versions).
  23273. </p>
  23274. </dd>
  23275. <dt><samp class="option">ffs=<var class="var">bytes</var></samp></dt>
  23276. <dd><p>Flight Flag Size (Window Size), in bytes. FFS is actually an
  23277. internal parameter and you should set it to not less than
  23278. <samp class="option">recv_buffer_size</samp> and <samp class="option">mss</samp>. The default value
  23279. is relatively large, therefore unless you set a very large receiver buffer,
  23280. you do not need to change this option. Default value is 25600.
  23281. </p>
  23282. </dd>
  23283. <dt><samp class="option">inputbw=<var class="var">bytes/seconds</var></samp></dt>
  23284. <dd><p>Sender nominal input rate, in bytes per seconds. Used along with
  23285. <samp class="option">oheadbw</samp>, when <samp class="option">maxbw</samp> is set to relative (0), to
  23286. calculate maximum sending rate when recovery packets are sent
  23287. along with the main media stream:
  23288. <samp class="option">inputbw</samp> * (100 + <samp class="option">oheadbw</samp>) / 100
  23289. if <samp class="option">inputbw</samp> is not set while <samp class="option">maxbw</samp> is set to
  23290. relative (0), the actual input rate is evaluated inside
  23291. the library. Default value is 0.
  23292. </p>
  23293. </dd>
  23294. <dt><samp class="option">iptos=<var class="var">tos</var></samp></dt>
  23295. <dd><p>IP Type of Service. Applies to sender only. Default value is 0xB8.
  23296. </p>
  23297. </dd>
  23298. <dt><samp class="option">ipttl=<var class="var">ttl</var></samp></dt>
  23299. <dd><p>IP Time To Live. Applies to sender only. Default value is 64.
  23300. </p>
  23301. </dd>
  23302. <dt><samp class="option">latency=<var class="var">microseconds</var></samp></dt>
  23303. <dd><p>Timestamp-based Packet Delivery Delay.
  23304. Used to absorb bursts of missed packet retransmissions.
  23305. This flag sets both <samp class="option">rcvlatency</samp> and <samp class="option">peerlatency</samp>
  23306. to the same value. Note that prior to version 1.3.0
  23307. this is the only flag to set the latency, however
  23308. this is effectively equivalent to setting <samp class="option">peerlatency</samp>,
  23309. when side is sender and <samp class="option">rcvlatency</samp>
  23310. when side is receiver, and the bidirectional stream
  23311. sending is not supported.
  23312. </p>
  23313. </dd>
  23314. <dt><samp class="option">listen_timeout=<var class="var">microseconds</var></samp></dt>
  23315. <dd><p>Set socket listen timeout.
  23316. </p>
  23317. </dd>
  23318. <dt><samp class="option">maxbw=<var class="var">bytes/seconds</var></samp></dt>
  23319. <dd><p>Maximum sending bandwidth, in bytes per seconds.
  23320. -1 infinite (CSRTCC limit is 30mbps)
  23321. 0 relative to input rate (see <samp class="option">inputbw</samp>)
  23322. &gt;0 absolute limit value
  23323. Default value is 0 (relative)
  23324. </p>
  23325. </dd>
  23326. <dt><samp class="option">mode=<var class="var">caller|listener|rendezvous</var></samp></dt>
  23327. <dd><p>Connection mode.
  23328. <samp class="option">caller</samp> opens client connection.
  23329. <samp class="option">listener</samp> starts server to listen for incoming connections.
  23330. <samp class="option">rendezvous</samp> use Rendez-Vous connection mode.
  23331. Default value is caller.
  23332. </p>
  23333. </dd>
  23334. <dt><samp class="option">mss=<var class="var">bytes</var></samp></dt>
  23335. <dd><p>Maximum Segment Size, in bytes. Used for buffer allocation
  23336. and rate calculation using a packet counter assuming fully
  23337. filled packets. The smallest MSS between the peers is
  23338. used. This is 1500 by default in the overall internet.
  23339. This is the maximum size of the UDP packet and can be
  23340. only decreased, unless you have some unusual dedicated
  23341. network settings. Default value is 1500.
  23342. </p>
  23343. </dd>
  23344. <dt><samp class="option">nakreport=<var class="var">1|0</var></samp></dt>
  23345. <dd><p>If set to 1, Receiver will send &lsquo;UMSG_LOSSREPORT&lsquo; messages
  23346. periodically until a lost packet is retransmitted or
  23347. intentionally dropped. Default value is 1.
  23348. </p>
  23349. </dd>
  23350. <dt><samp class="option">oheadbw=<var class="var">percents</var></samp></dt>
  23351. <dd><p>Recovery bandwidth overhead above input rate, in percents.
  23352. See <samp class="option">inputbw</samp>. Default value is 25%.
  23353. </p>
  23354. </dd>
  23355. <dt><samp class="option">passphrase=<var class="var">string</var></samp></dt>
  23356. <dd><p>HaiCrypt Encryption/Decryption Passphrase string, length
  23357. from 10 to 79 characters. The passphrase is the shared
  23358. secret between the sender and the receiver. It is used
  23359. to generate the Key Encrypting Key using PBKDF2
  23360. (Password-Based Key Derivation Function). It is used
  23361. only if <samp class="option">pbkeylen</samp> is non-zero. It is used on
  23362. the receiver only if the received data is encrypted.
  23363. The configured passphrase cannot be recovered (write-only).
  23364. </p>
  23365. </dd>
  23366. <dt><samp class="option">enforced_encryption=<var class="var">1|0</var></samp></dt>
  23367. <dd><p>If true, both connection parties must have the same password
  23368. set (including empty, that is, with no encryption). If the
  23369. password doesn&rsquo;t match or only one side is unencrypted,
  23370. the connection is rejected. Default is true.
  23371. </p>
  23372. </dd>
  23373. <dt><samp class="option">kmrefreshrate=<var class="var">packets</var></samp></dt>
  23374. <dd><p>The number of packets to be transmitted after which the
  23375. encryption key is switched to a new key. Default is -1.
  23376. -1 means auto (0x1000000 in srt library). The range for
  23377. this option is integers in the 0 - <code class="code">INT_MAX</code>.
  23378. </p>
  23379. </dd>
  23380. <dt><samp class="option">kmpreannounce=<var class="var">packets</var></samp></dt>
  23381. <dd><p>The interval between when a new encryption key is sent and
  23382. when switchover occurs. This value also applies to the
  23383. subsequent interval between when switchover occurs and
  23384. when the old encryption key is decommissioned. Default is -1.
  23385. -1 means auto (0x1000 in srt library). The range for
  23386. this option is integers in the 0 - <code class="code">INT_MAX</code>.
  23387. </p>
  23388. </dd>
  23389. <dt><samp class="option">snddropdelay=<var class="var">microseconds</var></samp></dt>
  23390. <dd><p>The sender&rsquo;s extra delay before dropping packets. This delay is
  23391. added to the default drop delay time interval value.
  23392. </p>
  23393. <p>Special value -1: Do not drop packets on the sender at all.
  23394. </p>
  23395. </dd>
  23396. <dt><samp class="option">payload_size=<var class="var">bytes</var></samp></dt>
  23397. <dd><p>Sets the maximum declared size of a packet transferred
  23398. during the single call to the sending function in Live
  23399. mode. Use 0 if this value isn&rsquo;t used (which is default in
  23400. file mode).
  23401. Default is -1 (automatic), which typically means MPEG-TS;
  23402. if you are going to use SRT
  23403. to send any different kind of payload, such as, for example,
  23404. wrapping a live stream in very small frames, then you can
  23405. use a bigger maximum frame size, though not greater than
  23406. 1456 bytes.
  23407. </p>
  23408. </dd>
  23409. <dt><samp class="option">pkt_size=<var class="var">bytes</var></samp></dt>
  23410. <dd><p>Alias for &lsquo;<samp class="samp">payload_size</samp>&rsquo;.
  23411. </p>
  23412. </dd>
  23413. <dt><samp class="option">peerlatency=<var class="var">microseconds</var></samp></dt>
  23414. <dd><p>The latency value (as described in <samp class="option">rcvlatency</samp>) that is
  23415. set by the sender side as a minimum value for the receiver.
  23416. </p>
  23417. </dd>
  23418. <dt><samp class="option">pbkeylen=<var class="var">bytes</var></samp></dt>
  23419. <dd><p>Sender encryption key length, in bytes.
  23420. Only can be set to 0, 16, 24 and 32.
  23421. Enable sender encryption if not 0.
  23422. Not required on receiver (set to 0),
  23423. key size obtained from sender in HaiCrypt handshake.
  23424. Default value is 0.
  23425. </p>
  23426. </dd>
  23427. <dt><samp class="option">rcvlatency=<var class="var">microseconds</var></samp></dt>
  23428. <dd><p>The time that should elapse since the moment when the
  23429. packet was sent and the moment when it&rsquo;s delivered to
  23430. the receiver application in the receiving function.
  23431. This time should be a buffer time large enough to cover
  23432. the time spent for sending, unexpectedly extended RTT
  23433. time, and the time needed to retransmit the lost UDP
  23434. packet. The effective latency value will be the maximum
  23435. of this options&rsquo; value and the value of <samp class="option">peerlatency</samp>
  23436. set by the peer side. Before version 1.3.0 this option
  23437. is only available as <samp class="option">latency</samp>.
  23438. </p>
  23439. </dd>
  23440. <dt><samp class="option">recv_buffer_size=<var class="var">bytes</var></samp></dt>
  23441. <dd><p>Set UDP receive buffer size, expressed in bytes.
  23442. </p>
  23443. </dd>
  23444. <dt><samp class="option">send_buffer_size=<var class="var">bytes</var></samp></dt>
  23445. <dd><p>Set UDP send buffer size, expressed in bytes.
  23446. </p>
  23447. </dd>
  23448. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  23449. <dd><p>Set raise error timeouts for read, write and connect operations. Note that the
  23450. SRT library has internal timeouts which can be controlled separately, the
  23451. value set here is only a cap on those.
  23452. </p>
  23453. </dd>
  23454. <dt><samp class="option">tlpktdrop=<var class="var">1|0</var></samp></dt>
  23455. <dd><p>Too-late Packet Drop. When enabled on receiver, it skips
  23456. missing packets that have not been delivered in time and
  23457. delivers the following packets to the application when
  23458. their time-to-play has come. It also sends a fake ACK to
  23459. the sender. When enabled on sender and enabled on the
  23460. receiving peer, the sender drops the older packets that
  23461. have no chance of being delivered in time. It was
  23462. automatically enabled in the sender if the receiver
  23463. supports it.
  23464. </p>
  23465. </dd>
  23466. <dt><samp class="option">sndbuf=<var class="var">bytes</var></samp></dt>
  23467. <dd><p>Set send buffer size, expressed in bytes.
  23468. </p>
  23469. </dd>
  23470. <dt><samp class="option">rcvbuf=<var class="var">bytes</var></samp></dt>
  23471. <dd><p>Set receive buffer size, expressed in bytes.
  23472. </p>
  23473. <p>Receive buffer must not be greater than <samp class="option">ffs</samp>.
  23474. </p>
  23475. </dd>
  23476. <dt><samp class="option">lossmaxttl=<var class="var">packets</var></samp></dt>
  23477. <dd><p>The value up to which the Reorder Tolerance may grow. When
  23478. Reorder Tolerance is &gt; 0, then packet loss report is delayed
  23479. until that number of packets come in. Reorder Tolerance
  23480. increases every time a &quot;belated&quot; packet has come, but it
  23481. wasn&rsquo;t due to retransmission (that is, when UDP packets tend
  23482. to come out of order), with the difference between the latest
  23483. sequence and this packet&rsquo;s sequence, and not more than the
  23484. value of this option. By default it&rsquo;s 0, which means that this
  23485. mechanism is turned off, and the loss report is always sent
  23486. immediately upon experiencing a &quot;gap&quot; in sequences.
  23487. </p>
  23488. </dd>
  23489. <dt><samp class="option">minversion</samp></dt>
  23490. <dd><p>The minimum SRT version that is required from the peer. A connection
  23491. to a peer that does not satisfy the minimum version requirement
  23492. will be rejected.
  23493. </p>
  23494. <p>The version format in hex is 0xXXYYZZ for x.y.z in human readable
  23495. form.
  23496. </p>
  23497. </dd>
  23498. <dt><samp class="option">streamid=<var class="var">string</var></samp></dt>
  23499. <dd><p>A string limited to 512 characters that can be set on the socket prior
  23500. to connecting. This stream ID will be able to be retrieved by the
  23501. listener side from the socket that is returned from srt_accept and
  23502. was connected by a socket with that set stream ID. SRT does not enforce
  23503. any special interpretation of the contents of this string.
  23504. This option doesn’t make sense in Rendezvous connection; the result
  23505. might be that simply one side will override the value from the other
  23506. side and it’s the matter of luck which one would win
  23507. </p>
  23508. </dd>
  23509. <dt><samp class="option">srt_streamid=<var class="var">string</var></samp></dt>
  23510. <dd><p>Alias for &lsquo;<samp class="samp">streamid</samp>&rsquo; to avoid conflict with ffmpeg command line option.
  23511. </p>
  23512. </dd>
  23513. <dt><samp class="option">smoother=<var class="var">live|file</var></samp></dt>
  23514. <dd><p>The type of Smoother used for the transmission for that socket, which
  23515. is responsible for the transmission and congestion control. The Smoother
  23516. type must be exactly the same on both connecting parties, otherwise
  23517. the connection is rejected.
  23518. </p>
  23519. </dd>
  23520. <dt><samp class="option">messageapi=<var class="var">1|0</var></samp></dt>
  23521. <dd><p>When set, this socket uses the Message API, otherwise it uses Buffer
  23522. API. Note that in live mode (see <samp class="option">transtype</samp>) there’s only
  23523. message API available. In File mode you can chose to use one of two modes:
  23524. </p>
  23525. <p>Stream API (default, when this option is false). In this mode you may
  23526. send as many data as you wish with one sending instruction, or even use
  23527. dedicated functions that read directly from a file. The internal facility
  23528. will take care of any speed and congestion control. When receiving, you
  23529. can also receive as many data as desired, the data not extracted will be
  23530. waiting for the next call. There is no boundary between data portions in
  23531. the Stream mode.
  23532. </p>
  23533. <p>Message API. In this mode your single sending instruction passes exactly
  23534. one piece of data that has boundaries (a message). Contrary to Live mode,
  23535. this message may span across multiple UDP packets and the only size
  23536. limitation is that it shall fit as a whole in the sending buffer. The
  23537. receiver shall use as large buffer as necessary to receive the message,
  23538. otherwise the message will not be given up. When the message is not
  23539. complete (not all packets received or there was a packet loss) it will
  23540. not be given up.
  23541. </p>
  23542. </dd>
  23543. <dt><samp class="option">transtype=<var class="var">live|file</var></samp></dt>
  23544. <dd><p>Sets the transmission type for the socket, in particular, setting this
  23545. option sets multiple other parameters to their default values as required
  23546. for a particular transmission type.
  23547. </p>
  23548. <p>live: Set options as for live transmission. In this mode, you should
  23549. send by one sending instruction only so many data that fit in one UDP packet,
  23550. and limited to the value defined first in <samp class="option">payload_size</samp> (1316 is
  23551. default in this mode). There is no speed control in this mode, only the
  23552. bandwidth control, if configured, in order to not exceed the bandwidth with
  23553. the overhead transmission (retransmitted and control packets).
  23554. </p>
  23555. <p>file: Set options as for non-live transmission. See <samp class="option">messageapi</samp>
  23556. for further explanations
  23557. </p>
  23558. </dd>
  23559. <dt><samp class="option">linger=<var class="var">seconds</var></samp></dt>
  23560. <dd><p>The number of seconds that the socket waits for unsent data when closing.
  23561. Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
  23562. seconds in file mode). The range for this option is integers in the
  23563. 0 - <code class="code">INT_MAX</code>.
  23564. </p>
  23565. </dd>
  23566. <dt><samp class="option">tsbpd=<var class="var">1|0</var></samp></dt>
  23567. <dd><p>When true, use Timestamp-based Packet Delivery mode. The default behavior
  23568. depends on the transmission type: enabled in live mode, disabled in file
  23569. mode.
  23570. </p>
  23571. </dd>
  23572. </dl>
  23573. <p>For more information see: <a class="url" href="https://github.com/Haivision/srt">https://github.com/Haivision/srt</a>.
  23574. </p>
  23575. </div>
  23576. <div class="section-level-extent" id="srtp">
  23577. <h3 class="section"><span>24.38 srtp<a class="copiable-link" href="#srtp"> &para;</a></span></h3>
  23578. <p>Secure Real-time Transport Protocol.
  23579. </p>
  23580. <p>The accepted options are:
  23581. </p><dl class="table">
  23582. <dt><samp class="option">srtp_in_suite</samp></dt>
  23583. <dt><samp class="option">srtp_out_suite</samp></dt>
  23584. <dd><p>Select input and output encoding suites.
  23585. </p>
  23586. <p>Supported values:
  23587. </p><dl class="table">
  23588. <dt>&lsquo;<samp class="samp">AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
  23589. <dt>&lsquo;<samp class="samp">SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
  23590. <dt>&lsquo;<samp class="samp">AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
  23591. <dt>&lsquo;<samp class="samp">SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
  23592. </dl>
  23593. </dd>
  23594. <dt><samp class="option">srtp_in_params</samp></dt>
  23595. <dt><samp class="option">srtp_out_params</samp></dt>
  23596. <dd><p>Set input and output encoding parameters, which are expressed by a
  23597. base64-encoded representation of a binary block. The first 16 bytes of
  23598. this binary block are used as master key, the following 14 bytes are
  23599. used as master salt.
  23600. </p></dd>
  23601. </dl>
  23602. </div>
  23603. <div class="section-level-extent" id="subfile">
  23604. <h3 class="section"><span>24.39 subfile<a class="copiable-link" href="#subfile"> &para;</a></span></h3>
  23605. <p>Virtually extract a segment of a file or another stream.
  23606. The underlying stream must be seekable.
  23607. </p>
  23608. <p>Accepted options:
  23609. </p><dl class="table">
  23610. <dt><samp class="option">start</samp></dt>
  23611. <dd><p>Start offset of the extracted segment, in bytes.
  23612. </p></dd>
  23613. <dt><samp class="option">end</samp></dt>
  23614. <dd><p>End offset of the extracted segment, in bytes.
  23615. If set to 0, extract till end of file.
  23616. </p></dd>
  23617. </dl>
  23618. <p>Examples:
  23619. </p>
  23620. <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
  23621. externally and multiplied by 2048):
  23622. </p><div class="example">
  23623. <pre class="example-preformatted">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  23624. </pre></div>
  23625. <p>Play an AVI file directly from a TAR archive:
  23626. </p><div class="example">
  23627. <pre class="example-preformatted">subfile,,start,183241728,end,366490624,,:archive.tar
  23628. </pre></div>
  23629. <p>Play a MPEG-TS file from start offset till end:
  23630. </p><div class="example">
  23631. <pre class="example-preformatted">subfile,,start,32815239,end,0,,:video.ts
  23632. </pre></div>
  23633. </div>
  23634. <div class="section-level-extent" id="tee-2">
  23635. <h3 class="section"><span>24.40 tee<a class="copiable-link" href="#tee-2"> &para;</a></span></h3>
  23636. <p>Writes the output to multiple protocols. The individual outputs are separated
  23637. by |
  23638. </p>
  23639. <div class="example">
  23640. <pre class="example-preformatted">tee:file://path/to/local/this.avi|file://path/to/local/that.avi
  23641. </pre></div>
  23642. </div>
  23643. <div class="section-level-extent" id="tcp">
  23644. <h3 class="section"><span>24.41 tcp<a class="copiable-link" href="#tcp"> &para;</a></span></h3>
  23645. <p>Transmission Control Protocol.
  23646. </p>
  23647. <p>The required syntax for a TCP url is:
  23648. </p><div class="example">
  23649. <pre class="example-preformatted">tcp://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  23650. </pre></div>
  23651. <p><var class="var">options</var> contains a list of &amp;-separated options of the form
  23652. <var class="var">key</var>=<var class="var">val</var>.
  23653. </p>
  23654. <p>The list of supported options follows.
  23655. </p>
  23656. <dl class="table">
  23657. <dt><samp class="option">listen=<var class="var">2|1|0</var></samp></dt>
  23658. <dd><p>Listen for an incoming connection. 0 disables listen, 1 enables listen in
  23659. single client mode, 2 enables listen in multi-client mode. Default value is 0.
  23660. </p>
  23661. </dd>
  23662. <dt><samp class="option">local_addr=<var class="var">addr</var></samp></dt>
  23663. <dd><p>Local IP address of a network interface used for tcp socket connect.
  23664. </p>
  23665. </dd>
  23666. <dt><samp class="option">local_port=<var class="var">port</var></samp></dt>
  23667. <dd><p>Local port used for tcp socket connect.
  23668. </p>
  23669. </dd>
  23670. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  23671. <dd><p>Set raise error timeout, expressed in microseconds.
  23672. </p>
  23673. <p>This option is only relevant in read mode: if no data arrived in more
  23674. than this time interval, raise error.
  23675. </p>
  23676. </dd>
  23677. <dt><samp class="option">listen_timeout=<var class="var">milliseconds</var></samp></dt>
  23678. <dd><p>Set listen timeout, expressed in milliseconds.
  23679. </p>
  23680. </dd>
  23681. <dt><samp class="option">recv_buffer_size=<var class="var">bytes</var></samp></dt>
  23682. <dd><p>Set receive buffer size, expressed bytes.
  23683. </p>
  23684. </dd>
  23685. <dt><samp class="option">send_buffer_size=<var class="var">bytes</var></samp></dt>
  23686. <dd><p>Set send buffer size, expressed bytes.
  23687. </p>
  23688. </dd>
  23689. <dt><samp class="option">tcp_nodelay=<var class="var">1|0</var></samp></dt>
  23690. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  23691. </p>
  23692. <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>
  23693. </p>
  23694. </dd>
  23695. <dt><samp class="option">tcp_mss=<var class="var">bytes</var></samp></dt>
  23696. <dd><p>Set maximum segment size for outgoing TCP packets, expressed in bytes.
  23697. </p></dd>
  23698. </dl>
  23699. <p>The following example shows how to setup a listening TCP connection
  23700. with <code class="command">ffmpeg</code>, which is then accessed with <code class="command">ffplay</code>:
  23701. </p><div class="example">
  23702. <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
  23703. ffplay tcp://<var class="var">hostname</var>:<var class="var">port</var>
  23704. </pre></div>
  23705. </div>
  23706. <div class="section-level-extent" id="tls">
  23707. <h3 class="section"><span>24.42 tls<a class="copiable-link" href="#tls"> &para;</a></span></h3>
  23708. <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  23709. </p>
  23710. <p>The required syntax for a TLS/SSL url is:
  23711. </p><div class="example">
  23712. <pre class="example-preformatted">tls://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  23713. </pre></div>
  23714. <p>The following parameters can be set via command line options
  23715. (or in code via <code class="code">AVOption</code>s):
  23716. </p>
  23717. <dl class="table">
  23718. <dt><samp class="option">ca_file, cafile=<var class="var">filename</var></samp></dt>
  23719. <dd><p>A file containing certificate authority (CA) root certificates to treat
  23720. as trusted. If the linked TLS library contains a default this might not
  23721. need to be specified for verification to work, but not all libraries and
  23722. setups have defaults built in.
  23723. The file must be in OpenSSL PEM format.
  23724. </p>
  23725. </dd>
  23726. <dt><samp class="option">tls_verify=<var class="var">1|0</var></samp></dt>
  23727. <dd><p>If enabled, try to verify the peer that we are communicating with.
  23728. Note, if using OpenSSL, this currently only makes sure that the
  23729. peer certificate is signed by one of the root certificates in the CA
  23730. database, but it does not validate that the certificate actually
  23731. matches the host name we are trying to connect to. (With other backends,
  23732. the host name is validated as well.)
  23733. </p>
  23734. <p>This is disabled by default since it requires a CA database to be
  23735. provided by the caller in many cases.
  23736. </p>
  23737. </dd>
  23738. <dt><samp class="option">cert_file, cert=<var class="var">filename</var></samp></dt>
  23739. <dd><p>A file containing a certificate to use in the handshake with the peer.
  23740. (When operating as server, in listen mode, this is more often required
  23741. by the peer, while client certificates only are mandated in certain
  23742. setups.)
  23743. </p>
  23744. </dd>
  23745. <dt><samp class="option">key_file, key=<var class="var">filename</var></samp></dt>
  23746. <dd><p>A file containing the private key for the certificate.
  23747. </p>
  23748. </dd>
  23749. <dt><samp class="option">listen=<var class="var">1|0</var></samp></dt>
  23750. <dd><p>If enabled, listen for connections on the provided port, and assume
  23751. the server role in the handshake instead of the client role.
  23752. </p>
  23753. </dd>
  23754. <dt><samp class="option">http_proxy</samp></dt>
  23755. <dd><p>The HTTP proxy to tunnel through, e.g. <code class="code">http://example.com:1234</code>.
  23756. The proxy must support the CONNECT method.
  23757. </p>
  23758. </dd>
  23759. </dl>
  23760. <p>Example command lines:
  23761. </p>
  23762. <p>To create a TLS/SSL server that serves an input stream.
  23763. </p>
  23764. <div class="example">
  23765. <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>
  23766. </pre></div>
  23767. <p>To play back a stream from the TLS/SSL server using <code class="command">ffplay</code>:
  23768. </p>
  23769. <div class="example">
  23770. <pre class="example-preformatted">ffplay tls://<var class="var">hostname</var>:<var class="var">port</var>
  23771. </pre></div>
  23772. </div>
  23773. <div class="section-level-extent" id="udp">
  23774. <h3 class="section"><span>24.43 udp<a class="copiable-link" href="#udp"> &para;</a></span></h3>
  23775. <p>User Datagram Protocol.
  23776. </p>
  23777. <p>The required syntax for an UDP URL is:
  23778. </p><div class="example">
  23779. <pre class="example-preformatted">udp://<var class="var">hostname</var>:<var class="var">port</var>[?<var class="var">options</var>]
  23780. </pre></div>
  23781. <p><var class="var">options</var> contains a list of &amp;-separated options of the form <var class="var">key</var>=<var class="var">val</var>.
  23782. </p>
  23783. <p>In case threading is enabled on the system, a circular buffer is used
  23784. to store the incoming data, which allows one to reduce loss of data due to
  23785. UDP socket buffer overruns. The <var class="var">fifo_size</var> and
  23786. <var class="var">overrun_nonfatal</var> options are related to this buffer.
  23787. </p>
  23788. <p>The list of supported options follows.
  23789. </p>
  23790. <dl class="table">
  23791. <dt><samp class="option">buffer_size=<var class="var">size</var></samp></dt>
  23792. <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
  23793. the receive or send buffer size, depending on what the socket is used for.
  23794. Default is 32 KB for output, 384 KB for input. See also <var class="var">fifo_size</var>.
  23795. </p>
  23796. </dd>
  23797. <dt><samp class="option">bitrate=<var class="var">bitrate</var></samp></dt>
  23798. <dd><p>If set to nonzero, the output will have the specified constant bitrate if the
  23799. input has enough packets to sustain it.
  23800. </p>
  23801. </dd>
  23802. <dt><samp class="option">burst_bits=<var class="var">bits</var></samp></dt>
  23803. <dd><p>When using <var class="var">bitrate</var> this specifies the maximum number of bits in
  23804. packet bursts.
  23805. </p>
  23806. </dd>
  23807. <dt><samp class="option">localport=<var class="var">port</var></samp></dt>
  23808. <dd><p>Override the local UDP port to bind with.
  23809. </p>
  23810. </dd>
  23811. <dt><samp class="option">localaddr=<var class="var">addr</var></samp></dt>
  23812. <dd><p>Local IP address of a network interface used for sending packets or joining
  23813. multicast groups.
  23814. </p>
  23815. </dd>
  23816. <dt><samp class="option">pkt_size=<var class="var">size</var></samp></dt>
  23817. <dd><p>Set the size in bytes of UDP packets.
  23818. </p>
  23819. </dd>
  23820. <dt><samp class="option">reuse=<var class="var">1|0</var></samp></dt>
  23821. <dd><p>Explicitly allow or disallow reusing UDP sockets.
  23822. </p>
  23823. </dd>
  23824. <dt><samp class="option">ttl=<var class="var">ttl</var></samp></dt>
  23825. <dd><p>Set the time to live value (for multicast only).
  23826. </p>
  23827. </dd>
  23828. <dt><samp class="option">connect=<var class="var">1|0</var></samp></dt>
  23829. <dd><p>Initialize the UDP socket with <code class="code">connect()</code>. In this case, the
  23830. destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
  23831. If the destination address isn&rsquo;t known at the start, this option can
  23832. be specified in ff_udp_set_remote_url, too.
  23833. This allows finding out the source address for the packets with getsockname,
  23834. and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
  23835. unreachable&quot; is received.
  23836. For receiving, this gives the benefit of only receiving packets from
  23837. the specified peer address/port.
  23838. </p>
  23839. </dd>
  23840. <dt><samp class="option">sources=<var class="var">address</var>[,<var class="var">address</var>]</samp></dt>
  23841. <dd><p>Only receive packets sent from the specified addresses. In case of multicast,
  23842. also subscribe to multicast traffic coming from these addresses only.
  23843. </p>
  23844. </dd>
  23845. <dt><samp class="option">block=<var class="var">address</var>[,<var class="var">address</var>]</samp></dt>
  23846. <dd><p>Ignore packets sent from the specified addresses. In case of multicast, also
  23847. exclude the source addresses in the multicast subscription.
  23848. </p>
  23849. </dd>
  23850. <dt><samp class="option">fifo_size=<var class="var">units</var></samp></dt>
  23851. <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
  23852. packets with size of 188 bytes. If not specified defaults to 7*4096.
  23853. </p>
  23854. </dd>
  23855. <dt><samp class="option">overrun_nonfatal=<var class="var">1|0</var></samp></dt>
  23856. <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
  23857. value is 0.
  23858. </p>
  23859. </dd>
  23860. <dt><samp class="option">timeout=<var class="var">microseconds</var></samp></dt>
  23861. <dd><p>Set raise error timeout, expressed in microseconds.
  23862. </p>
  23863. <p>This option is only relevant in read mode: if no data arrived in more
  23864. than this time interval, raise error.
  23865. </p>
  23866. </dd>
  23867. <dt><samp class="option">broadcast=<var class="var">1|0</var></samp></dt>
  23868. <dd><p>Explicitly allow or disallow UDP broadcasting.
  23869. </p>
  23870. <p>Note that broadcasting may not work properly on networks having
  23871. a broadcast storm protection.
  23872. </p></dd>
  23873. </dl>
  23874. <ul class="mini-toc">
  23875. <li><a href="#Examples-24" accesskey="1">Examples</a></li>
  23876. </ul>
  23877. <div class="subsection-level-extent" id="Examples-24">
  23878. <h4 class="subsection"><span>24.43.1 Examples<a class="copiable-link" href="#Examples-24"> &para;</a></span></h4>
  23879. <ul class="itemize mark-bullet">
  23880. <li>Use <code class="command">ffmpeg</code> to stream over UDP to a remote endpoint:
  23881. <div class="example">
  23882. <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>
  23883. </pre></div>
  23884. </li><li>Use <code class="command">ffmpeg</code> to stream in mpegts format over UDP using 188
  23885. sized UDP packets, using a large input buffer:
  23886. <div class="example">
  23887. <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
  23888. </pre></div>
  23889. </li><li>Use <code class="command">ffmpeg</code> to receive over UDP from a remote endpoint:
  23890. <div class="example">
  23891. <pre class="example-preformatted">ffmpeg -i udp://[<var class="var">multicast-address</var>]:<var class="var">port</var> ...
  23892. </pre></div>
  23893. </li></ul>
  23894. </div>
  23895. </div>
  23896. <div class="section-level-extent" id="unix">
  23897. <h3 class="section"><span>24.44 unix<a class="copiable-link" href="#unix"> &para;</a></span></h3>
  23898. <p>Unix local socket
  23899. </p>
  23900. <p>The required syntax for a Unix socket URL is:
  23901. </p>
  23902. <div class="example">
  23903. <pre class="example-preformatted">unix://<var class="var">filepath</var>
  23904. </pre></div>
  23905. <p>The following parameters can be set via command line options
  23906. (or in code via <code class="code">AVOption</code>s):
  23907. </p>
  23908. <dl class="table">
  23909. <dt><samp class="option">timeout</samp></dt>
  23910. <dd><p>Timeout in ms.
  23911. </p></dd>
  23912. <dt><samp class="option">listen</samp></dt>
  23913. <dd><p>Create the Unix socket in listening mode.
  23914. </p></dd>
  23915. </dl>
  23916. </div>
  23917. <div class="section-level-extent" id="zmq">
  23918. <h3 class="section"><span>24.45 zmq<a class="copiable-link" href="#zmq"> &para;</a></span></h3>
  23919. <p>ZeroMQ asynchronous messaging using the libzmq library.
  23920. </p>
  23921. <p>This library supports unicast streaming to multiple clients without relying on
  23922. an external server.
  23923. </p>
  23924. <p>The required syntax for streaming or connecting to a stream is:
  23925. </p><div class="example">
  23926. <pre class="example-preformatted">zmq:tcp://ip-address:port
  23927. </pre></div>
  23928. <p>Example:
  23929. Create a localhost stream on port 5555:
  23930. </p><div class="example">
  23931. <pre class="example-preformatted">ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
  23932. </pre></div>
  23933. <p>Multiple clients may connect to the stream using:
  23934. </p><div class="example">
  23935. <pre class="example-preformatted">ffplay zmq:tcp://127.0.0.1:5555
  23936. </pre></div>
  23937. <p>Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
  23938. The server side binds to a port and publishes data. Clients connect to the
  23939. server (via IP address/port) and subscribe to the stream. The order in which
  23940. the server and client start generally does not matter.
  23941. </p>
  23942. <p>ffmpeg must be compiled with the &ndash;enable-libzmq option to support
  23943. this protocol.
  23944. </p>
  23945. <p>Options can be set on the <code class="command">ffmpeg</code>/<code class="command">ffplay</code> command
  23946. line. The following options are supported:
  23947. </p>
  23948. <dl class="table">
  23949. <dt><samp class="option">pkt_size</samp></dt>
  23950. <dd><p>Forces the maximum packet size for sending/receiving data. The default value is
  23951. 131,072 bytes. On the server side, this sets the maximum size of sent packets
  23952. via ZeroMQ. On the clients, it sets an internal buffer size for receiving
  23953. packets. Note that pkt_size on the clients should be equal to or greater than
  23954. pkt_size on the server. Otherwise the received message may be truncated causing
  23955. decoding errors.
  23956. </p>
  23957. </dd>
  23958. </dl>
  23959. </div>
  23960. </div>
  23961. <div class="chapter-level-extent" id="Device-Options">
  23962. <h2 class="chapter"><span>25 Device Options<a class="copiable-link" href="#Device-Options"> &para;</a></span></h2>
  23963. <p>The libavdevice library provides the same interface as
  23964. libavformat. Namely, an input device is considered like a demuxer, and
  23965. an output device like a muxer, and the interface and generic device
  23966. options are the same provided by libavformat (see the ffmpeg-formats
  23967. manual).
  23968. </p>
  23969. <p>In addition each input or output device may support so-called private
  23970. options, which are specific for that component.
  23971. </p>
  23972. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  23973. FFmpeg tools, or by setting the value explicitly in the device
  23974. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  23975. for programmatic use.
  23976. </p>
  23977. </div>
  23978. <div class="chapter-level-extent" id="Input-Devices">
  23979. <h2 class="chapter"><span>26 Input Devices<a class="copiable-link" href="#Input-Devices"> &para;</a></span></h2>
  23980. <p>Input devices are configured elements in FFmpeg which enable accessing
  23981. the data coming from a multimedia device attached to your system.
  23982. </p>
  23983. <p>When you configure your FFmpeg build, all the supported input devices
  23984. are enabled by default. You can list all available ones using the
  23985. configure option &quot;&ndash;list-indevs&quot;.
  23986. </p>
  23987. <p>You can disable all the input devices using the configure option
  23988. &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
  23989. option &quot;&ndash;enable-indev=<var class="var">INDEV</var>&quot;, or you can disable a particular
  23990. input device using the option &quot;&ndash;disable-indev=<var class="var">INDEV</var>&quot;.
  23991. </p>
  23992. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  23993. supported input devices.
  23994. </p>
  23995. <p>A description of the currently available input devices follows.
  23996. </p>
  23997. <ul class="mini-toc">
  23998. <li><a href="#alsa" accesskey="1">alsa</a></li>
  23999. <li><a href="#android_005fcamera" accesskey="2">android_camera</a></li>
  24000. <li><a href="#avfoundation" accesskey="3">avfoundation</a></li>
  24001. <li><a href="#bktr" accesskey="4">bktr</a></li>
  24002. <li><a href="#decklink" accesskey="5">decklink</a></li>
  24003. <li><a href="#dshow" accesskey="6">dshow</a></li>
  24004. <li><a href="#fbdev" accesskey="7">fbdev</a></li>
  24005. <li><a href="#gdigrab" accesskey="8">gdigrab</a></li>
  24006. <li><a href="#iec61883" accesskey="9">iec61883</a></li>
  24007. <li><a href="#jack">jack</a></li>
  24008. <li><a href="#kmsgrab">kmsgrab</a></li>
  24009. <li><a href="#lavfi">lavfi</a></li>
  24010. <li><a href="#libcdio">libcdio</a></li>
  24011. <li><a href="#libdc1394">libdc1394</a></li>
  24012. <li><a href="#openal">openal</a></li>
  24013. <li><a href="#oss">oss</a></li>
  24014. <li><a href="#pulse">pulse</a></li>
  24015. <li><a href="#sndio">sndio</a></li>
  24016. <li><a href="#video4linux2_002c-v4l2">video4linux2, v4l2</a></li>
  24017. <li><a href="#vfwcap">vfwcap</a></li>
  24018. <li><a href="#x11grab">x11grab</a></li>
  24019. </ul>
  24020. <div class="section-level-extent" id="alsa">
  24021. <h3 class="section"><span>26.1 alsa<a class="copiable-link" href="#alsa"> &para;</a></span></h3>
  24022. <p>ALSA (Advanced Linux Sound Architecture) input device.
  24023. </p>
  24024. <p>To enable this input device during configuration you need libasound
  24025. installed on your system.
  24026. </p>
  24027. <p>This device allows capturing from an ALSA device. The name of the
  24028. device to capture has to be an ALSA card identifier.
  24029. </p>
  24030. <p>An ALSA identifier has the syntax:
  24031. </p><div class="example">
  24032. <pre class="example-preformatted">hw:<var class="var">CARD</var>[,<var class="var">DEV</var>[,<var class="var">SUBDEV</var>]]
  24033. </pre></div>
  24034. <p>where the <var class="var">DEV</var> and <var class="var">SUBDEV</var> components are optional.
  24035. </p>
  24036. <p>The three arguments (in order: <var class="var">CARD</var>,<var class="var">DEV</var>,<var class="var">SUBDEV</var>)
  24037. specify card number or identifier, device number and subdevice number
  24038. (-1 means any).
  24039. </p>
  24040. <p>To see the list of cards currently recognized by your system check the
  24041. files <samp class="file">/proc/asound/cards</samp> and <samp class="file">/proc/asound/devices</samp>.
  24042. </p>
  24043. <p>For example to capture with <code class="command">ffmpeg</code> from an ALSA device with
  24044. card id 0, you may run the command:
  24045. </p><div class="example">
  24046. <pre class="example-preformatted">ffmpeg -f alsa -i hw:0 alsaout.wav
  24047. </pre></div>
  24048. <p>For more information see:
  24049. <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>
  24050. </p>
  24051. <ul class="mini-toc">
  24052. <li><a href="#Options-82" accesskey="1">Options</a></li>
  24053. </ul>
  24054. <div class="subsection-level-extent" id="Options-82">
  24055. <h4 class="subsection"><span>26.1.1 Options<a class="copiable-link" href="#Options-82"> &para;</a></span></h4>
  24056. <dl class="table">
  24057. <dt><samp class="option">sample_rate</samp></dt>
  24058. <dd><p>Set the sample rate in Hz. Default is 48000.
  24059. </p>
  24060. </dd>
  24061. <dt><samp class="option">channels</samp></dt>
  24062. <dd><p>Set the number of channels. Default is 2.
  24063. </p>
  24064. </dd>
  24065. </dl>
  24066. </div>
  24067. </div>
  24068. <div class="section-level-extent" id="android_005fcamera">
  24069. <h3 class="section"><span>26.2 android_camera<a class="copiable-link" href="#android_005fcamera"> &para;</a></span></h3>
  24070. <p>Android camera input device.
  24071. </p>
  24072. <p>This input devices uses the Android Camera2 NDK API which is
  24073. available on devices with API level 24+. The availability of
  24074. android_camera is autodetected during configuration.
  24075. </p>
  24076. <p>This device allows capturing from all cameras on an Android device,
  24077. which are integrated into the Camera2 NDK API.
  24078. </p>
  24079. <p>The available cameras are enumerated internally and can be selected
  24080. with the <var class="var">camera_index</var> parameter. The input file string is
  24081. discarded.
  24082. </p>
  24083. <p>Generally the back facing camera has index 0 while the front facing
  24084. camera has index 1.
  24085. </p>
  24086. <ul class="mini-toc">
  24087. <li><a href="#Options-83" accesskey="1">Options</a></li>
  24088. </ul>
  24089. <div class="subsection-level-extent" id="Options-83">
  24090. <h4 class="subsection"><span>26.2.1 Options<a class="copiable-link" href="#Options-83"> &para;</a></span></h4>
  24091. <dl class="table">
  24092. <dt><samp class="option">video_size</samp></dt>
  24093. <dd><p>Set the video size given as a string such as 640x480 or hd720.
  24094. Falls back to the first available configuration reported by
  24095. Android if requested video size is not available or by default.
  24096. </p>
  24097. </dd>
  24098. <dt><samp class="option">framerate</samp></dt>
  24099. <dd><p>Set the video framerate.
  24100. Falls back to the first available configuration reported by
  24101. Android if requested framerate is not available or by default (-1).
  24102. </p>
  24103. </dd>
  24104. <dt><samp class="option">camera_index</samp></dt>
  24105. <dd><p>Set the index of the camera to use. Default is 0.
  24106. </p>
  24107. </dd>
  24108. <dt><samp class="option">input_queue_size</samp></dt>
  24109. <dd><p>Set the maximum number of frames to buffer. Default is 5.
  24110. </p>
  24111. </dd>
  24112. </dl>
  24113. </div>
  24114. </div>
  24115. <div class="section-level-extent" id="avfoundation">
  24116. <h3 class="section"><span>26.3 avfoundation<a class="copiable-link" href="#avfoundation"> &para;</a></span></h3>
  24117. <p>AVFoundation input device.
  24118. </p>
  24119. <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
  24120. </p>
  24121. <p>The input filename has to be given in the following syntax:
  24122. </p><div class="example">
  24123. <pre class="example-preformatted">-i &quot;[[VIDEO]:[AUDIO]]&quot;
  24124. </pre></div>
  24125. <p>The first entry selects the video input while the latter selects the audio input.
  24126. The stream has to be specified by the device name or the device index as shown by the device list.
  24127. Alternatively, the video and/or audio input device can be chosen by index using the
  24128. <samp class="option">
  24129. -video_device_index &lt;INDEX&gt;
  24130. </samp>
  24131. and/or
  24132. <samp class="option">
  24133. -audio_device_index &lt;INDEX&gt;
  24134. </samp>
  24135. , overriding any
  24136. device name or index given in the input filename.
  24137. </p>
  24138. <p>All available devices can be enumerated by using <samp class="option">-list_devices true</samp>, listing
  24139. all device names and corresponding indices.
  24140. </p>
  24141. <p>There are two device name aliases:
  24142. </p><dl class="table">
  24143. <dt><code class="code">default</code></dt>
  24144. <dd><p>Select the AVFoundation default device of the corresponding type.
  24145. </p>
  24146. </dd>
  24147. <dt><code class="code">none</code></dt>
  24148. <dd><p>Do not record the corresponding media type.
  24149. This is equivalent to specifying an empty device name or index.
  24150. </p>
  24151. </dd>
  24152. </dl>
  24153. <ul class="mini-toc">
  24154. <li><a href="#Options-84" accesskey="1">Options</a></li>
  24155. <li><a href="#Examples-25" accesskey="2">Examples</a></li>
  24156. </ul>
  24157. <div class="subsection-level-extent" id="Options-84">
  24158. <h4 class="subsection"><span>26.3.1 Options<a class="copiable-link" href="#Options-84"> &para;</a></span></h4>
  24159. <p>AVFoundation supports the following options:
  24160. </p>
  24161. <dl class="table">
  24162. <dt><samp class="option">-list_devices &lt;TRUE|FALSE&gt;</samp></dt>
  24163. <dd><p>If set to true, a list of all available input devices is given showing all
  24164. device names and indices.
  24165. </p>
  24166. </dd>
  24167. <dt><samp class="option">-video_device_index &lt;INDEX&gt;</samp></dt>
  24168. <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
  24169. </p>
  24170. </dd>
  24171. <dt><samp class="option">-audio_device_index &lt;INDEX&gt;</samp></dt>
  24172. <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
  24173. </p>
  24174. </dd>
  24175. <dt><samp class="option">-pixel_format &lt;FORMAT&gt;</samp></dt>
  24176. <dd><p>Request the video device to use a specific pixel format.
  24177. If the specified format is not supported, a list of available formats is given
  24178. and the first one in this list is used instead. Available pixel formats are:
  24179. <code class="code">monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
  24180. bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
  24181. yuv420p, nv12, yuyv422, gray</code>
  24182. </p>
  24183. </dd>
  24184. <dt><samp class="option">-framerate</samp></dt>
  24185. <dd><p>Set the grabbing frame rate. Default is <code class="code">ntsc</code>, corresponding to a
  24186. frame rate of <code class="code">30000/1001</code>.
  24187. </p>
  24188. </dd>
  24189. <dt><samp class="option">-video_size</samp></dt>
  24190. <dd><p>Set the video frame size.
  24191. </p>
  24192. </dd>
  24193. <dt><samp class="option">-capture_cursor</samp></dt>
  24194. <dd><p>Capture the mouse pointer. Default is 0.
  24195. </p>
  24196. </dd>
  24197. <dt><samp class="option">-capture_mouse_clicks</samp></dt>
  24198. <dd><p>Capture the screen mouse clicks. Default is 0.
  24199. </p>
  24200. </dd>
  24201. <dt><samp class="option">-capture_raw_data</samp></dt>
  24202. <dd><p>Capture the raw device data. Default is 0.
  24203. 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.
  24204. </p></dd>
  24205. </dl>
  24206. </div>
  24207. <div class="subsection-level-extent" id="Examples-25">
  24208. <h4 class="subsection"><span>26.3.2 Examples<a class="copiable-link" href="#Examples-25"> &para;</a></span></h4>
  24209. <ul class="itemize mark-bullet">
  24210. <li>Print the list of AVFoundation supported devices and exit:
  24211. <div class="example">
  24212. <pre class="example-preformatted">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
  24213. </pre></div>
  24214. </li><li>Record video from video device 0 and audio from audio device 0 into out.avi:
  24215. <div class="example">
  24216. <pre class="example-preformatted">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
  24217. </pre></div>
  24218. </li><li>Record video from video device 2 and audio from audio device 1 into out.avi:
  24219. <div class="example">
  24220. <pre class="example-preformatted">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
  24221. </pre></div>
  24222. </li><li>Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
  24223. <div class="example">
  24224. <pre class="example-preformatted">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
  24225. </pre></div>
  24226. </li><li>Record raw DV data from a suitable input device and write the output into out.dv:
  24227. <div class="example">
  24228. <pre class="example-preformatted">$ ffmpeg -f avfoundation -capture_raw_data true -i &quot;zr100:none&quot; out.dv
  24229. </pre></div>
  24230. </li></ul>
  24231. </div>
  24232. </div>
  24233. <div class="section-level-extent" id="bktr">
  24234. <h3 class="section"><span>26.4 bktr<a class="copiable-link" href="#bktr"> &para;</a></span></h3>
  24235. <p>BSD video input device. Deprecated and will be removed - please contact
  24236. the developers if you are interested in maintaining it.
  24237. </p>
  24238. <ul class="mini-toc">
  24239. <li><a href="#Options-85" accesskey="1">Options</a></li>
  24240. </ul>
  24241. <div class="subsection-level-extent" id="Options-85">
  24242. <h4 class="subsection"><span>26.4.1 Options<a class="copiable-link" href="#Options-85"> &para;</a></span></h4>
  24243. <dl class="table">
  24244. <dt><samp class="option">framerate</samp></dt>
  24245. <dd><p>Set the frame rate.
  24246. </p>
  24247. </dd>
  24248. <dt><samp class="option">video_size</samp></dt>
  24249. <dd><p>Set the video frame size. Default is <code class="code">vga</code>.
  24250. </p>
  24251. </dd>
  24252. <dt><samp class="option">standard</samp></dt>
  24253. <dd>
  24254. <p>Available values are:
  24255. </p><dl class="table">
  24256. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  24257. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  24258. <dt>&lsquo;<samp class="samp">secam</samp>&rsquo;</dt>
  24259. <dt>&lsquo;<samp class="samp">paln</samp>&rsquo;</dt>
  24260. <dt>&lsquo;<samp class="samp">palm</samp>&rsquo;</dt>
  24261. <dt>&lsquo;<samp class="samp">ntscj</samp>&rsquo;</dt>
  24262. </dl>
  24263. </dd>
  24264. </dl>
  24265. </div>
  24266. </div>
  24267. <div class="section-level-extent" id="decklink">
  24268. <h3 class="section"><span>26.5 decklink<a class="copiable-link" href="#decklink"> &para;</a></span></h3>
  24269. <p>The decklink input device provides capture capabilities for Blackmagic
  24270. DeckLink devices.
  24271. </p>
  24272. <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
  24273. need to configure with the appropriate <code class="code">--extra-cflags</code>
  24274. and <code class="code">--extra-ldflags</code>.
  24275. On Windows, you need to run the IDL files through <code class="command">widl</code>.
  24276. </p>
  24277. <p>DeckLink is very picky about the formats it supports. Pixel format of the
  24278. input can be set with <samp class="option">raw_format</samp>.
  24279. Framerate and video size must be determined for your device with
  24280. <code class="command">-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
  24281. of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
  24282. audio track.
  24283. </p>
  24284. <ul class="mini-toc">
  24285. <li><a href="#Options-86" accesskey="1">Options</a></li>
  24286. <li><a href="#Examples-26" accesskey="2">Examples</a></li>
  24287. </ul>
  24288. <div class="subsection-level-extent" id="Options-86">
  24289. <h4 class="subsection"><span>26.5.1 Options<a class="copiable-link" href="#Options-86"> &para;</a></span></h4>
  24290. <dl class="table">
  24291. <dt><samp class="option">list_devices</samp></dt>
  24292. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  24293. Defaults to <samp class="option">false</samp>. This option is deprecated, please use the
  24294. <code class="code">-sources</code> option of ffmpeg to list the available input devices.
  24295. </p>
  24296. </dd>
  24297. <dt><samp class="option">list_formats</samp></dt>
  24298. <dd><p>If set to <samp class="option">true</samp>, print a list of supported formats and exit.
  24299. Defaults to <samp class="option">false</samp>.
  24300. </p>
  24301. </dd>
  24302. <dt><samp class="option">format_code &lt;FourCC&gt;</samp></dt>
  24303. <dd><p>This sets the input video format to the format given by the FourCC. To see
  24304. the supported values of your device(s) use <samp class="option">list_formats</samp>.
  24305. Note that there is a FourCC <samp class="option">'pal '</samp> that can also be used
  24306. as <samp class="option">pal</samp> (3 letters).
  24307. Default behavior is autodetection of the input video format, if the hardware
  24308. supports it.
  24309. </p>
  24310. </dd>
  24311. <dt><samp class="option">raw_format</samp></dt>
  24312. <dd><p>Set the pixel format of the captured video.
  24313. Available values are:
  24314. </p><dl class="table">
  24315. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24316. <dd>
  24317. <p>This is the default which means 8-bit YUV 422 or 8-bit ARGB if format
  24318. autodetection is used, 8-bit YUV 422 otherwise.
  24319. </p>
  24320. </dd>
  24321. <dt>&lsquo;<samp class="samp">uyvy422</samp>&rsquo;</dt>
  24322. <dd>
  24323. <p>8-bit YUV 422.
  24324. </p>
  24325. </dd>
  24326. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  24327. <dd>
  24328. <p>10-bit YUV 422.
  24329. </p>
  24330. </dd>
  24331. <dt>&lsquo;<samp class="samp">argb</samp>&rsquo;</dt>
  24332. <dd>
  24333. <p>8-bit RGB.
  24334. </p>
  24335. </dd>
  24336. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  24337. <dd>
  24338. <p>8-bit RGB.
  24339. </p>
  24340. </dd>
  24341. <dt>&lsquo;<samp class="samp">rgb10</samp>&rsquo;</dt>
  24342. <dd>
  24343. <p>10-bit RGB.
  24344. </p>
  24345. </dd>
  24346. </dl>
  24347. </dd>
  24348. <dt><samp class="option">teletext_lines</samp></dt>
  24349. <dd><p>If set to nonzero, an additional teletext stream will be captured from the
  24350. vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p)
  24351. sources are supported. In case of HD sources, OP47 packets are decoded.
  24352. </p>
  24353. <p>This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6
  24354. to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines
  24355. which do not contain teletext information will be ignored. You can use the
  24356. special <samp class="option">all</samp> constant to select all possible lines, or
  24357. <samp class="option">standard</samp> to skip lines 6, 318 and 319, which are not compatible with
  24358. all receivers.
  24359. </p>
  24360. <p>For SD sources, ffmpeg needs to be compiled with <code class="code">--enable-libzvbi</code>. For
  24361. HD sources, on older (pre-4K) DeckLink card models you have to capture in 10
  24362. bit mode.
  24363. </p>
  24364. </dd>
  24365. <dt><samp class="option">channels</samp></dt>
  24366. <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;.
  24367. Defaults to &lsquo;<samp class="samp">2</samp>&rsquo;.
  24368. </p>
  24369. </dd>
  24370. <dt><samp class="option">duplex_mode</samp></dt>
  24371. <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;,
  24372. &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;,
  24373. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  24374. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  24375. </p>
  24376. <p>Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
  24377. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
  24378. sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
  24379. is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
  24380. </p>
  24381. <p>Valid profile modes for DeckLink 8K Pro(with DeckLink SDK &gt;= 11.0):
  24382. &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;,
  24383. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  24384. </p>
  24385. <p>Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
  24386. &lsquo;<samp class="samp">half</samp>&rsquo;, &lsquo;<samp class="samp">full</samp>&rsquo;
  24387. </p>
  24388. </dd>
  24389. <dt><samp class="option">timecode_format</samp></dt>
  24390. <dd><p>Timecode type to include in the frame and video stream metadata. Must be
  24391. &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;,
  24392. &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;.
  24393. Defaults to &lsquo;<samp class="samp">none</samp>&rsquo; (not included).
  24394. </p>
  24395. <p>In order to properly support 50/60 fps timecodes, the ordering of the queried
  24396. timecode types for &lsquo;<samp class="samp">rp188any</samp>&rsquo; is HFR, VITC1, VITC2 and LTC for &gt;30 fps
  24397. content. Note that this is slightly different to the ordering used by the
  24398. DeckLink API, which is HFR, VITC1, LTC, VITC2.
  24399. </p>
  24400. </dd>
  24401. <dt><samp class="option">video_input</samp></dt>
  24402. <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;,
  24403. &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;.
  24404. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  24405. </p>
  24406. </dd>
  24407. <dt><samp class="option">audio_input</samp></dt>
  24408. <dd><p>Sets the audio input source. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">embedded</samp>&rsquo;,
  24409. &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
  24410. &lsquo;<samp class="samp">microphone</samp>&rsquo;. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  24411. </p>
  24412. </dd>
  24413. <dt><samp class="option">video_pts</samp></dt>
  24414. <dd><p>Sets the video packet timestamp source. Must be &lsquo;<samp class="samp">video</samp>&rsquo;, &lsquo;<samp class="samp">audio</samp>&rsquo;,
  24415. &lsquo;<samp class="samp">reference</samp>&rsquo;, &lsquo;<samp class="samp">wallclock</samp>&rsquo; or &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  24416. Defaults to &lsquo;<samp class="samp">video</samp>&rsquo;.
  24417. </p>
  24418. </dd>
  24419. <dt><samp class="option">audio_pts</samp></dt>
  24420. <dd><p>Sets the audio packet timestamp source. Must be &lsquo;<samp class="samp">video</samp>&rsquo;, &lsquo;<samp class="samp">audio</samp>&rsquo;,
  24421. &lsquo;<samp class="samp">reference</samp>&rsquo;, &lsquo;<samp class="samp">wallclock</samp>&rsquo; or &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  24422. Defaults to &lsquo;<samp class="samp">audio</samp>&rsquo;.
  24423. </p>
  24424. </dd>
  24425. <dt><samp class="option">draw_bars</samp></dt>
  24426. <dd><p>If set to &lsquo;<samp class="samp">true</samp>&rsquo;, color bars are drawn in the event of a signal loss.
  24427. Defaults to &lsquo;<samp class="samp">true</samp>&rsquo;.
  24428. </p>
  24429. </dd>
  24430. <dt><samp class="option">queue_size</samp></dt>
  24431. <dd><p>Sets maximum input buffer size in bytes. If the buffering reaches this value,
  24432. incoming frames will be dropped.
  24433. Defaults to &lsquo;<samp class="samp">1073741824</samp>&rsquo;.
  24434. </p>
  24435. </dd>
  24436. <dt><samp class="option">audio_depth</samp></dt>
  24437. <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;.
  24438. Defaults to &lsquo;<samp class="samp">16</samp>&rsquo;.
  24439. </p>
  24440. </dd>
  24441. <dt><samp class="option">decklink_copyts</samp></dt>
  24442. <dd><p>If set to <samp class="option">true</samp>, timestamps are forwarded as they are without removing
  24443. the initial offset.
  24444. Defaults to <samp class="option">false</samp>.
  24445. </p>
  24446. </dd>
  24447. <dt><samp class="option">timestamp_align</samp></dt>
  24448. <dd><p>Capture start time alignment in seconds. If set to nonzero, input frames are
  24449. dropped till the system timestamp aligns with configured value.
  24450. Alignment difference of up to one frame duration is tolerated.
  24451. This is useful for maintaining input synchronization across N different
  24452. hardware devices deployed for &rsquo;N-way&rsquo; redundancy. The system time of different
  24453. hardware devices should be synchronized with protocols such as NTP or PTP,
  24454. before using this option.
  24455. Note that this method is not foolproof. In some border cases input
  24456. synchronization may not happen due to thread scheduling jitters in the OS.
  24457. Either sync could go wrong by 1 frame or in a rarer case
  24458. <samp class="option">timestamp_align</samp> seconds.
  24459. Defaults to &lsquo;<samp class="samp">0</samp>&rsquo;.
  24460. </p>
  24461. </dd>
  24462. <dt><samp class="option">wait_for_tc (<em class="emph">bool</em>)</samp></dt>
  24463. <dd><p>Drop frames till a frame with timecode is received. Sometimes serial timecode
  24464. isn&rsquo;t received with the first input frame. If that happens, the stored stream
  24465. timecode will be inaccurate. If this option is set to <samp class="option">true</samp>, input frames
  24466. are dropped till a frame with timecode is received.
  24467. Option <var class="var">timecode_format</var> must be specified.
  24468. Defaults to <samp class="option">false</samp>.
  24469. </p>
  24470. </dd>
  24471. <dt><samp class="option">enable_klv(<em class="emph">bool</em>)</samp></dt>
  24472. <dd><p>If set to <samp class="option">true</samp>, extracts KLV data from VANC and outputs KLV packets.
  24473. KLV VANC packets are joined based on MID and PSC fields and aggregated into
  24474. one KLV packet.
  24475. Defaults to <samp class="option">false</samp>.
  24476. </p>
  24477. </dd>
  24478. </dl>
  24479. </div>
  24480. <div class="subsection-level-extent" id="Examples-26">
  24481. <h4 class="subsection"><span>26.5.2 Examples<a class="copiable-link" href="#Examples-26"> &para;</a></span></h4>
  24482. <ul class="itemize mark-bullet">
  24483. <li>List input devices:
  24484. <div class="example">
  24485. <pre class="example-preformatted">ffmpeg -sources decklink
  24486. </pre></div>
  24487. </li><li>List supported formats:
  24488. <div class="example">
  24489. <pre class="example-preformatted">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
  24490. </pre></div>
  24491. </li><li>Capture video clip at 1080i50:
  24492. <div class="example">
  24493. <pre class="example-preformatted">ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
  24494. </pre></div>
  24495. </li><li>Capture video clip at 1080i50 10 bit:
  24496. <div class="example">
  24497. <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
  24498. </pre></div>
  24499. </li><li>Capture video clip at 1080i50 with 16 audio channels:
  24500. <div class="example">
  24501. <pre class="example-preformatted">ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  24502. </pre></div>
  24503. </li></ul>
  24504. </div>
  24505. </div>
  24506. <div class="section-level-extent" id="dshow">
  24507. <h3 class="section"><span>26.6 dshow<a class="copiable-link" href="#dshow"> &para;</a></span></h3>
  24508. <p>Windows DirectShow input device.
  24509. </p>
  24510. <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  24511. Currently only audio and video devices are supported.
  24512. </p>
  24513. <p>Multiple devices may be opened as separate inputs, but they may also be
  24514. opened on the same input, which should improve synchronism between them.
  24515. </p>
  24516. <p>The input name should be in the format:
  24517. </p>
  24518. <div class="example">
  24519. <pre class="example-preformatted"><var class="var">TYPE</var>=<var class="var">NAME</var>[:<var class="var">TYPE</var>=<var class="var">NAME</var>]
  24520. </pre></div>
  24521. <p>where <var class="var">TYPE</var> can be either <var class="var">audio</var> or <var class="var">video</var>,
  24522. and <var class="var">NAME</var> is the device&rsquo;s name or alternative name..
  24523. </p>
  24524. <ul class="mini-toc">
  24525. <li><a href="#Options-87" accesskey="1">Options</a></li>
  24526. <li><a href="#Examples-27" accesskey="2">Examples</a></li>
  24527. </ul>
  24528. <div class="subsection-level-extent" id="Options-87">
  24529. <h4 class="subsection"><span>26.6.1 Options<a class="copiable-link" href="#Options-87"> &para;</a></span></h4>
  24530. <p>If no options are specified, the device&rsquo;s defaults are used.
  24531. If the device does not support the requested options, it will
  24532. fail to open.
  24533. </p>
  24534. <dl class="table">
  24535. <dt><samp class="option">video_size</samp></dt>
  24536. <dd><p>Set the video size in the captured video.
  24537. </p>
  24538. </dd>
  24539. <dt><samp class="option">framerate</samp></dt>
  24540. <dd><p>Set the frame rate in the captured video.
  24541. </p>
  24542. </dd>
  24543. <dt><samp class="option">sample_rate</samp></dt>
  24544. <dd><p>Set the sample rate (in Hz) of the captured audio.
  24545. </p>
  24546. </dd>
  24547. <dt><samp class="option">sample_size</samp></dt>
  24548. <dd><p>Set the sample size (in bits) of the captured audio.
  24549. </p>
  24550. </dd>
  24551. <dt><samp class="option">channels</samp></dt>
  24552. <dd><p>Set the number of channels in the captured audio.
  24553. </p>
  24554. </dd>
  24555. <dt><samp class="option">list_devices</samp></dt>
  24556. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  24557. </p>
  24558. </dd>
  24559. <dt><samp class="option">list_options</samp></dt>
  24560. <dd><p>If set to <samp class="option">true</samp>, print a list of selected device&rsquo;s options
  24561. and exit.
  24562. </p>
  24563. </dd>
  24564. <dt><samp class="option">video_device_number</samp></dt>
  24565. <dd><p>Set video device number for devices with the same name (starts at 0,
  24566. defaults to 0).
  24567. </p>
  24568. </dd>
  24569. <dt><samp class="option">audio_device_number</samp></dt>
  24570. <dd><p>Set audio device number for devices with the same name (starts at 0,
  24571. defaults to 0).
  24572. </p>
  24573. </dd>
  24574. <dt><samp class="option">pixel_format</samp></dt>
  24575. <dd><p>Select pixel format to be used by DirectShow. This may only be set when
  24576. the video codec is not set or set to rawvideo.
  24577. </p>
  24578. </dd>
  24579. <dt><samp class="option">audio_buffer_size</samp></dt>
  24580. <dd><p>Set audio device buffer size in milliseconds (which can directly
  24581. impact latency, depending on the device).
  24582. Defaults to using the audio device&rsquo;s
  24583. default buffer size (typically some multiple of 500ms).
  24584. Setting this value too low can degrade performance.
  24585. See also
  24586. <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>
  24587. </p>
  24588. </dd>
  24589. <dt><samp class="option">video_pin_name</samp></dt>
  24590. <dd><p>Select video capture pin to use by name or alternative name.
  24591. </p>
  24592. </dd>
  24593. <dt><samp class="option">audio_pin_name</samp></dt>
  24594. <dd><p>Select audio capture pin to use by name or alternative name.
  24595. </p>
  24596. </dd>
  24597. <dt><samp class="option">crossbar_video_input_pin_number</samp></dt>
  24598. <dd><p>Select video input pin number for crossbar device. This will be
  24599. routed to the crossbar device&rsquo;s Video Decoder output pin.
  24600. Note that changing this value can affect future invocations
  24601. (sets a new default) until system reboot occurs.
  24602. </p>
  24603. </dd>
  24604. <dt><samp class="option">crossbar_audio_input_pin_number</samp></dt>
  24605. <dd><p>Select audio input pin number for crossbar device. This will be
  24606. routed to the crossbar device&rsquo;s Audio Decoder output pin.
  24607. Note that changing this value can affect future invocations
  24608. (sets a new default) until system reboot occurs.
  24609. </p>
  24610. </dd>
  24611. <dt><samp class="option">show_video_device_dialog</samp></dt>
  24612. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display dialog
  24613. to the end user, allowing them to change video filter properties
  24614. and configurations manually.
  24615. Note that for crossbar devices, adjusting values in this dialog
  24616. may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
  24617. input frame rates, sizes, interlacing, etc. Changing these values can
  24618. enable different scan rates/frame rates and avoiding green bars at
  24619. the bottom, flickering scan lines, etc.
  24620. Note that with some devices, changing these properties can also affect future
  24621. invocations (sets new defaults) until system reboot occurs.
  24622. </p>
  24623. </dd>
  24624. <dt><samp class="option">show_audio_device_dialog</samp></dt>
  24625. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display dialog
  24626. to the end user, allowing them to change audio filter properties
  24627. and configurations manually.
  24628. </p>
  24629. </dd>
  24630. <dt><samp class="option">show_video_crossbar_connection_dialog</samp></dt>
  24631. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  24632. dialog to the end user, allowing them to manually
  24633. modify crossbar pin routings, when it opens a video device.
  24634. </p>
  24635. </dd>
  24636. <dt><samp class="option">show_audio_crossbar_connection_dialog</samp></dt>
  24637. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  24638. dialog to the end user, allowing them to manually
  24639. modify crossbar pin routings, when it opens an audio device.
  24640. </p>
  24641. </dd>
  24642. <dt><samp class="option">show_analog_tv_tuner_dialog</samp></dt>
  24643. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  24644. dialog to the end user, allowing them to manually
  24645. modify TV channels and frequencies.
  24646. </p>
  24647. </dd>
  24648. <dt><samp class="option">show_analog_tv_tuner_audio_dialog</samp></dt>
  24649. <dd><p>If set to <samp class="option">true</samp>, before capture starts, popup a display
  24650. dialog to the end user, allowing them to manually
  24651. modify TV audio (like mono vs. stereo, Language A,B or C).
  24652. </p>
  24653. </dd>
  24654. <dt><samp class="option">audio_device_load</samp></dt>
  24655. <dd><p>Load an audio capture filter device from file instead of searching
  24656. it by name. It may load additional parameters too, if the filter
  24657. supports the serialization of its properties to.
  24658. To use this an audio capture source has to be specified, but it can
  24659. be anything even fake one.
  24660. </p>
  24661. </dd>
  24662. <dt><samp class="option">audio_device_save</samp></dt>
  24663. <dd><p>Save the currently used audio capture filter device and its
  24664. parameters (if the filter supports it) to a file.
  24665. If a file with the same name exists it will be overwritten.
  24666. </p>
  24667. </dd>
  24668. <dt><samp class="option">video_device_load</samp></dt>
  24669. <dd><p>Load a video capture filter device from file instead of searching
  24670. it by name. It may load additional parameters too, if the filter
  24671. supports the serialization of its properties to.
  24672. To use this a video capture source has to be specified, but it can
  24673. be anything even fake one.
  24674. </p>
  24675. </dd>
  24676. <dt><samp class="option">video_device_save</samp></dt>
  24677. <dd><p>Save the currently used video capture filter device and its
  24678. parameters (if the filter supports it) to a file.
  24679. If a file with the same name exists it will be overwritten.
  24680. </p>
  24681. </dd>
  24682. <dt><samp class="option">use_video_device_timestamps</samp></dt>
  24683. <dd><p>If set to <samp class="option">false</samp>, the timestamp for video frames will be
  24684. derived from the wallclock instead of the timestamp provided by
  24685. the capture device. This allows working around devices that
  24686. provide unreliable timestamps.
  24687. </p>
  24688. </dd>
  24689. </dl>
  24690. </div>
  24691. <div class="subsection-level-extent" id="Examples-27">
  24692. <h4 class="subsection"><span>26.6.2 Examples<a class="copiable-link" href="#Examples-27"> &para;</a></span></h4>
  24693. <ul class="itemize mark-bullet">
  24694. <li>Print the list of DirectShow supported devices and exit:
  24695. <div class="example">
  24696. <pre class="example-preformatted">$ ffmpeg -list_devices true -f dshow -i dummy
  24697. </pre></div>
  24698. </li><li>Open video device <var class="var">Camera</var>:
  24699. <div class="example">
  24700. <pre class="example-preformatted">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
  24701. </pre></div>
  24702. </li><li>Open second video device with name <var class="var">Camera</var>:
  24703. <div class="example">
  24704. <pre class="example-preformatted">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
  24705. </pre></div>
  24706. </li><li>Open video device <var class="var">Camera</var> and audio device <var class="var">Microphone</var>:
  24707. <div class="example">
  24708. <pre class="example-preformatted">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
  24709. </pre></div>
  24710. </li><li>Print the list of supported options in selected device and exit:
  24711. <div class="example">
  24712. <pre class="example-preformatted">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
  24713. </pre></div>
  24714. </li><li>Specify pin names to capture by name or alternative name, specify alternative device name:
  24715. <div class="example">
  24716. <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;
  24717. </pre></div>
  24718. </li><li>Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
  24719. <div class="example">
  24720. <pre class="example-preformatted">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
  24721. -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
  24722. </pre></div>
  24723. </li></ul>
  24724. </div>
  24725. </div>
  24726. <div class="section-level-extent" id="fbdev">
  24727. <h3 class="section"><span>26.7 fbdev<a class="copiable-link" href="#fbdev"> &para;</a></span></h3>
  24728. <p>Linux framebuffer input device.
  24729. </p>
  24730. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  24731. layer to show graphics on a computer monitor, typically on the
  24732. console. It is accessed through a file device node, usually
  24733. <samp class="file">/dev/fb0</samp>.
  24734. </p>
  24735. <p>For more detailed information read the file
  24736. Documentation/fb/framebuffer.txt included in the Linux source tree.
  24737. </p>
  24738. <p>See also <a class="url" href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  24739. </p>
  24740. <p>To record from the framebuffer device <samp class="file">/dev/fb0</samp> with
  24741. <code class="command">ffmpeg</code>:
  24742. </p><div class="example">
  24743. <pre class="example-preformatted">ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
  24744. </pre></div>
  24745. <p>You can take a single screenshot image with the command:
  24746. </p><div class="example">
  24747. <pre class="example-preformatted">ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
  24748. </pre></div>
  24749. <ul class="mini-toc">
  24750. <li><a href="#Options-88" accesskey="1">Options</a></li>
  24751. </ul>
  24752. <div class="subsection-level-extent" id="Options-88">
  24753. <h4 class="subsection"><span>26.7.1 Options<a class="copiable-link" href="#Options-88"> &para;</a></span></h4>
  24754. <dl class="table">
  24755. <dt><samp class="option">framerate</samp></dt>
  24756. <dd><p>Set the frame rate. Default is 25.
  24757. </p>
  24758. </dd>
  24759. </dl>
  24760. </div>
  24761. </div>
  24762. <div class="section-level-extent" id="gdigrab">
  24763. <h3 class="section"><span>26.8 gdigrab<a class="copiable-link" href="#gdigrab"> &para;</a></span></h3>
  24764. <p>Win32 GDI-based screen capture device.
  24765. </p>
  24766. <p>This device allows you to capture a region of the display on Windows.
  24767. </p>
  24768. <p>Amongst options for the imput filenames are such elements as:
  24769. </p><div class="example">
  24770. <pre class="example-preformatted">desktop
  24771. </pre></div>
  24772. <p>or
  24773. </p><div class="example">
  24774. <pre class="example-preformatted">title=<var class="var">window_title</var>
  24775. </pre></div>
  24776. <p>or
  24777. </p><div class="example">
  24778. <pre class="example-preformatted">hwnd=<var class="var">window_hwnd</var>
  24779. </pre></div>
  24780. <p>The first option will capture the entire desktop, or a fixed region of the
  24781. desktop. The second and third options will instead capture the contents of a single
  24782. window, regardless of its position on the screen.
  24783. </p>
  24784. <p>For example, to grab the entire desktop using <code class="command">ffmpeg</code>:
  24785. </p><div class="example">
  24786. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
  24787. </pre></div>
  24788. <p>Grab a 640x480 region at position <code class="code">10,20</code>:
  24789. </p><div class="example">
  24790. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
  24791. </pre></div>
  24792. <p>Grab the contents of the window named &quot;Calculator&quot;
  24793. </p><div class="example">
  24794. <pre class="example-preformatted">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
  24795. </pre></div>
  24796. <ul class="mini-toc">
  24797. <li><a href="#Options-89" accesskey="1">Options</a></li>
  24798. </ul>
  24799. <div class="subsection-level-extent" id="Options-89">
  24800. <h4 class="subsection"><span>26.8.1 Options<a class="copiable-link" href="#Options-89"> &para;</a></span></h4>
  24801. <dl class="table">
  24802. <dt><samp class="option">draw_mouse</samp></dt>
  24803. <dd><p>Specify whether to draw the mouse pointer. Use the value <code class="code">0</code> to
  24804. not draw the pointer. Default value is <code class="code">1</code>.
  24805. </p>
  24806. </dd>
  24807. <dt><samp class="option">framerate</samp></dt>
  24808. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  24809. corresponding to a frame rate of <code class="code">30000/1001</code>.
  24810. </p>
  24811. </dd>
  24812. <dt><samp class="option">show_region</samp></dt>
  24813. <dd><p>Show grabbed region on screen.
  24814. </p>
  24815. <p>If <var class="var">show_region</var> is specified with <code class="code">1</code>, then the grabbing
  24816. region will be indicated on screen. With this option, it is easy to
  24817. know what is being grabbed if only a portion of the screen is grabbed.
  24818. </p>
  24819. <p>Note that <var class="var">show_region</var> is incompatible with grabbing the contents
  24820. of a single window.
  24821. </p>
  24822. <p>For example:
  24823. </p><div class="example">
  24824. <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
  24825. </pre></div>
  24826. </dd>
  24827. <dt><samp class="option">video_size</samp></dt>
  24828. <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.
  24829. </p>
  24830. </dd>
  24831. <dt><samp class="option">offset_x</samp></dt>
  24832. <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.
  24833. </p>
  24834. <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.
  24835. </p>
  24836. </dd>
  24837. <dt><samp class="option">offset_y</samp></dt>
  24838. <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.
  24839. </p>
  24840. <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.
  24841. </p>
  24842. </dd>
  24843. </dl>
  24844. </div>
  24845. </div>
  24846. <div class="section-level-extent" id="iec61883">
  24847. <h3 class="section"><span>26.9 iec61883<a class="copiable-link" href="#iec61883"> &para;</a></span></h3>
  24848. <p>FireWire DV/HDV input device using libiec61883.
  24849. </p>
  24850. <p>To enable this input device, you need libiec61883, libraw1394 and
  24851. libavc1394 installed on your system. Use the configure option
  24852. <code class="code">--enable-libiec61883</code> to compile with the device enabled.
  24853. </p>
  24854. <p>The iec61883 capture device supports capturing from a video device
  24855. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  24856. FireWire stack (juju). This is the default DV/HDV input method in Linux
  24857. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  24858. </p>
  24859. <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
  24860. to choose the first port connected.
  24861. </p>
  24862. <ul class="mini-toc">
  24863. <li><a href="#Options-90" accesskey="1">Options</a></li>
  24864. <li><a href="#Examples-28" accesskey="2">Examples</a></li>
  24865. </ul>
  24866. <div class="subsection-level-extent" id="Options-90">
  24867. <h4 class="subsection"><span>26.9.1 Options<a class="copiable-link" href="#Options-90"> &para;</a></span></h4>
  24868. <dl class="table">
  24869. <dt><samp class="option">dvtype</samp></dt>
  24870. <dd><p>Override autodetection of DV/HDV. This should only be used if auto
  24871. detection does not work, or if usage of a different device type
  24872. should be prohibited. Treating a DV device as HDV (or vice versa) will
  24873. not work and result in undefined behavior.
  24874. The values <samp class="option">auto</samp>, <samp class="option">dv</samp> and <samp class="option">hdv</samp> are supported.
  24875. </p>
  24876. </dd>
  24877. <dt><samp class="option">dvbuffer</samp></dt>
  24878. <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
  24879. is an exact value. For HDV, it is not frame exact, since HDV does
  24880. not have a fixed frame size.
  24881. </p>
  24882. </dd>
  24883. <dt><samp class="option">dvguid</samp></dt>
  24884. <dd><p>Select the capture device by specifying its GUID. Capturing will only
  24885. be performed from the specified device and fails if no device with the
  24886. given GUID is found. This is useful to select the input if multiple
  24887. devices are connected at the same time.
  24888. Look at /sys/bus/firewire/devices to find out the GUIDs.
  24889. </p>
  24890. </dd>
  24891. </dl>
  24892. </div>
  24893. <div class="subsection-level-extent" id="Examples-28">
  24894. <h4 class="subsection"><span>26.9.2 Examples<a class="copiable-link" href="#Examples-28"> &para;</a></span></h4>
  24895. <ul class="itemize mark-bullet">
  24896. <li>Grab and show the input of a FireWire DV/HDV device.
  24897. <div class="example">
  24898. <pre class="example-preformatted">ffplay -f iec61883 -i auto
  24899. </pre></div>
  24900. </li><li>Grab and record the input of a FireWire DV/HDV device,
  24901. using a packet buffer of 100000 packets if the source is HDV.
  24902. <div class="example">
  24903. <pre class="example-preformatted">ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
  24904. </pre></div>
  24905. </li></ul>
  24906. </div>
  24907. </div>
  24908. <div class="section-level-extent" id="jack">
  24909. <h3 class="section"><span>26.10 jack<a class="copiable-link" href="#jack"> &para;</a></span></h3>
  24910. <p>JACK input device.
  24911. </p>
  24912. <p>To enable this input device during configuration you need libjack
  24913. installed on your system.
  24914. </p>
  24915. <p>A JACK input device creates one or more JACK writable clients, one for
  24916. each audio channel, with name <var class="var">client_name</var>:input_<var class="var">N</var>, where
  24917. <var class="var">client_name</var> is the name provided by the application, and <var class="var">N</var>
  24918. is a number which identifies the channel.
  24919. Each writable client will send the acquired data to the FFmpeg input
  24920. device.
  24921. </p>
  24922. <p>Once you have created one or more JACK readable clients, you need to
  24923. connect them to one or more JACK writable clients.
  24924. </p>
  24925. <p>To connect or disconnect JACK clients you can use the <code class="command">jack_connect</code>
  24926. and <code class="command">jack_disconnect</code> programs, or do it through a graphical interface,
  24927. for example with <code class="command">qjackctl</code>.
  24928. </p>
  24929. <p>To list the JACK clients and their properties you can invoke the command
  24930. <code class="command">jack_lsp</code>.
  24931. </p>
  24932. <p>Follows an example which shows how to capture a JACK readable client
  24933. with <code class="command">ffmpeg</code>.
  24934. </p><div class="example">
  24935. <pre class="example-preformatted"># Create a JACK writable client with name &quot;ffmpeg&quot;.
  24936. $ ffmpeg -f jack -i ffmpeg -y out.wav
  24937. # Start the sample jack_metro readable client.
  24938. $ jack_metro -b 120 -d 0.2 -f 4000
  24939. # List the current JACK clients.
  24940. $ jack_lsp -c
  24941. system:capture_1
  24942. system:capture_2
  24943. system:playback_1
  24944. system:playback_2
  24945. ffmpeg:input_1
  24946. metro:120_bpm
  24947. # Connect metro to the ffmpeg writable client.
  24948. $ jack_connect metro:120_bpm ffmpeg:input_1
  24949. </pre></div>
  24950. <p>For more information read:
  24951. <a class="url" href="http://jackaudio.org/">http://jackaudio.org/</a>
  24952. </p>
  24953. <ul class="mini-toc">
  24954. <li><a href="#Options-91" accesskey="1">Options</a></li>
  24955. </ul>
  24956. <div class="subsection-level-extent" id="Options-91">
  24957. <h4 class="subsection"><span>26.10.1 Options<a class="copiable-link" href="#Options-91"> &para;</a></span></h4>
  24958. <dl class="table">
  24959. <dt><samp class="option">channels</samp></dt>
  24960. <dd><p>Set the number of channels. Default is 2.
  24961. </p>
  24962. </dd>
  24963. </dl>
  24964. </div>
  24965. </div>
  24966. <div class="section-level-extent" id="kmsgrab">
  24967. <h3 class="section"><span>26.11 kmsgrab<a class="copiable-link" href="#kmsgrab"> &para;</a></span></h3>
  24968. <p>KMS video input device.
  24969. </p>
  24970. <p>Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a
  24971. DRM object that can be passed to other hardware functions.
  24972. </p>
  24973. <p>Requires either DRM master or CAP_SYS_ADMIN to run.
  24974. </p>
  24975. <p>If you don&rsquo;t understand what all of that means, you probably don&rsquo;t want this. Look at
  24976. <samp class="option">x11grab</samp> instead.
  24977. </p>
  24978. <ul class="mini-toc">
  24979. <li><a href="#Options-92" accesskey="1">Options</a></li>
  24980. <li><a href="#Examples-29" accesskey="2">Examples</a></li>
  24981. </ul>
  24982. <div class="subsection-level-extent" id="Options-92">
  24983. <h4 class="subsection"><span>26.11.1 Options<a class="copiable-link" href="#Options-92"> &para;</a></span></h4>
  24984. <dl class="table">
  24985. <dt><samp class="option">device</samp></dt>
  24986. <dd><p>DRM device to capture on. Defaults to <samp class="option">/dev/dri/card0</samp>.
  24987. </p>
  24988. </dd>
  24989. <dt><samp class="option">format</samp></dt>
  24990. <dd><p>Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7
  24991. or later, but needs to be provided for earlier versions. Defaults to <samp class="option">bgr0</samp>,
  24992. which is the most common format used by the Linux console and Xorg X server.
  24993. </p>
  24994. </dd>
  24995. <dt><samp class="option">format_modifier</samp></dt>
  24996. <dd><p>Format modifier to signal on output frames. This is necessary to import correctly into
  24997. some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need
  24998. to be provided explicitly when needed in earlier versions. See the libdrm documentation
  24999. for possible values.
  25000. </p>
  25001. </dd>
  25002. <dt><samp class="option">crtc_id</samp></dt>
  25003. <dd><p>KMS CRTC ID to define the capture source. The first active plane on the given CRTC
  25004. will be used.
  25005. </p>
  25006. </dd>
  25007. <dt><samp class="option">plane_id</samp></dt>
  25008. <dd><p>KMS plane ID to define the capture source. Defaults to the first active plane found if
  25009. neither <samp class="option">crtc_id</samp> nor <samp class="option">plane_id</samp> are specified.
  25010. </p>
  25011. </dd>
  25012. <dt><samp class="option">framerate</samp></dt>
  25013. <dd><p>Framerate to capture at. This is not synchronised to any page flipping or framebuffer
  25014. changes - it just defines the interval at which the framebuffer is sampled. Sampling
  25015. faster than the framebuffer update rate will generate independent frames with the same
  25016. content. Defaults to <code class="code">30</code>.
  25017. </p>
  25018. </dd>
  25019. </dl>
  25020. </div>
  25021. <div class="subsection-level-extent" id="Examples-29">
  25022. <h4 class="subsection"><span>26.11.2 Examples<a class="copiable-link" href="#Examples-29"> &para;</a></span></h4>
  25023. <ul class="itemize mark-bullet">
  25024. <li>Capture from the first active plane, download the result to normal frames and encode.
  25025. This will only work if the framebuffer is both linear and mappable - if not, the result
  25026. may be scrambled or fail to download.
  25027. <div class="example">
  25028. <pre class="example-preformatted">ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
  25029. </pre></div>
  25030. </li><li>Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264.
  25031. <div class="example">
  25032. <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
  25033. </pre></div>
  25034. </li><li>To capture only part of a plane the output can be cropped - this can be used to capture
  25035. a single window, as long as it has a known absolute position and size. For example, to
  25036. capture and encode the middle quarter of a 1920x1080 plane:
  25037. <div class="example">
  25038. <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
  25039. </pre></div>
  25040. </li></ul>
  25041. </div>
  25042. </div>
  25043. <div class="section-level-extent" id="lavfi">
  25044. <h3 class="section"><span>26.12 lavfi<a class="copiable-link" href="#lavfi"> &para;</a></span></h3>
  25045. <p>Libavfilter input virtual device.
  25046. </p>
  25047. <p>This input device reads data from the open output pads of a libavfilter
  25048. filtergraph.
  25049. </p>
  25050. <p>For each filtergraph open output, the input device will create a
  25051. corresponding stream which is mapped to the generated output.
  25052. The filtergraph is specified through the option <samp class="option">graph</samp>.
  25053. </p>
  25054. <ul class="mini-toc">
  25055. <li><a href="#Options-93" accesskey="1">Options</a></li>
  25056. <li><a href="#Examples-30" accesskey="2">Examples</a></li>
  25057. </ul>
  25058. <div class="subsection-level-extent" id="Options-93">
  25059. <h4 class="subsection"><span>26.12.1 Options<a class="copiable-link" href="#Options-93"> &para;</a></span></h4>
  25060. <dl class="table">
  25061. <dt><samp class="option">graph</samp></dt>
  25062. <dd><p>Specify the filtergraph to use as input. Each video open output must be
  25063. labelled by a unique string of the form &quot;out<var class="var">N</var>&quot;, where <var class="var">N</var> is a
  25064. number starting from 0 corresponding to the mapped input stream
  25065. generated by the device.
  25066. The first unlabelled output is automatically assigned to the &quot;out0&quot;
  25067. label, but all the others need to be specified explicitly.
  25068. </p>
  25069. <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
  25070. stream with the closed captions packets attached to that output
  25071. (experimental; only for EIA-608 / CEA-708 for now).
  25072. The subcc streams are created after all the normal streams, in the order of
  25073. the corresponding stream.
  25074. For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
  25075. stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
  25076. </p>
  25077. <p>If not specified defaults to the filename specified for the input
  25078. device.
  25079. </p>
  25080. </dd>
  25081. <dt><samp class="option">graph_file</samp></dt>
  25082. <dd><p>Set the filename of the filtergraph to be read and sent to the other
  25083. filters. Syntax of the filtergraph is the same as the one specified by
  25084. the option <var class="var">graph</var>.
  25085. </p>
  25086. </dd>
  25087. <dt><samp class="option">dumpgraph</samp></dt>
  25088. <dd><p>Dump graph to stderr.
  25089. </p>
  25090. </dd>
  25091. </dl>
  25092. </div>
  25093. <div class="subsection-level-extent" id="Examples-30">
  25094. <h4 class="subsection"><span>26.12.2 Examples<a class="copiable-link" href="#Examples-30"> &para;</a></span></h4>
  25095. <ul class="itemize mark-bullet">
  25096. <li>Create a color video stream and play it back with <code class="command">ffplay</code>:
  25097. <div class="example">
  25098. <pre class="example-preformatted">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
  25099. </pre></div>
  25100. </li><li>As the previous example, but use filename for specifying the graph
  25101. description, and omit the &quot;out0&quot; label:
  25102. <div class="example">
  25103. <pre class="example-preformatted">ffplay -f lavfi color=c=pink
  25104. </pre></div>
  25105. </li><li>Create three different video test filtered sources and play them:
  25106. <div class="example">
  25107. <pre class="example-preformatted">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
  25108. </pre></div>
  25109. </li><li>Read an audio stream from a file using the amovie source and play it
  25110. back with <code class="command">ffplay</code>:
  25111. <div class="example">
  25112. <pre class="example-preformatted">ffplay -f lavfi &quot;amovie=test.wav&quot;
  25113. </pre></div>
  25114. </li><li>Read an audio stream and a video stream and play it back with
  25115. <code class="command">ffplay</code>:
  25116. <div class="example">
  25117. <pre class="example-preformatted">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
  25118. </pre></div>
  25119. </li><li>Dump decoded frames to images and closed captions to a file (experimental):
  25120. <div class="example">
  25121. <pre class="example-preformatted">ffmpeg -f lavfi -i &quot;movie=test.ts[out0+subcc]&quot; -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
  25122. </pre></div>
  25123. </li></ul>
  25124. </div>
  25125. </div>
  25126. <div class="section-level-extent" id="libcdio">
  25127. <h3 class="section"><span>26.13 libcdio<a class="copiable-link" href="#libcdio"> &para;</a></span></h3>
  25128. <p>Audio-CD input device based on libcdio.
  25129. </p>
  25130. <p>To enable this input device during configuration you need libcdio
  25131. installed on your system. It requires the configure option
  25132. <code class="code">--enable-libcdio</code>.
  25133. </p>
  25134. <p>This device allows playing and grabbing from an Audio-CD.
  25135. </p>
  25136. <p>For example to copy with <code class="command">ffmpeg</code> the entire Audio-CD in <samp class="file">/dev/sr0</samp>,
  25137. you may run the command:
  25138. </p><div class="example">
  25139. <pre class="example-preformatted">ffmpeg -f libcdio -i /dev/sr0 cd.wav
  25140. </pre></div>
  25141. <ul class="mini-toc">
  25142. <li><a href="#Options-94" accesskey="1">Options</a></li>
  25143. </ul>
  25144. <div class="subsection-level-extent" id="Options-94">
  25145. <h4 class="subsection"><span>26.13.1 Options<a class="copiable-link" href="#Options-94"> &para;</a></span></h4>
  25146. <dl class="table">
  25147. <dt><samp class="option">speed</samp></dt>
  25148. <dd><p>Set drive reading speed. Default value is 0.
  25149. </p>
  25150. <p>The speed is specified CD-ROM speed units. The speed is set through
  25151. the libcdio <code class="code">cdio_cddap_speed_set</code> function. On many CD-ROM
  25152. drives, specifying a value too large will result in using the fastest
  25153. speed.
  25154. </p>
  25155. </dd>
  25156. <dt><samp class="option">paranoia_mode</samp></dt>
  25157. <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
  25158. </p>
  25159. <dl class="table">
  25160. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  25161. <dt>&lsquo;<samp class="samp">verify</samp>&rsquo;</dt>
  25162. <dt>&lsquo;<samp class="samp">overlap</samp>&rsquo;</dt>
  25163. <dt>&lsquo;<samp class="samp">neverskip</samp>&rsquo;</dt>
  25164. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  25165. </dl>
  25166. <p>Default value is &lsquo;<samp class="samp">disable</samp>&rsquo;.
  25167. </p>
  25168. <p>For more information about the available recovery modes, consult the
  25169. paranoia project documentation.
  25170. </p></dd>
  25171. </dl>
  25172. </div>
  25173. </div>
  25174. <div class="section-level-extent" id="libdc1394">
  25175. <h3 class="section"><span>26.14 libdc1394<a class="copiable-link" href="#libdc1394"> &para;</a></span></h3>
  25176. <p>IIDC1394 input device, based on libdc1394 and libraw1394.
  25177. </p>
  25178. <p>Requires the configure option <code class="code">--enable-libdc1394</code>.
  25179. </p>
  25180. <ul class="mini-toc">
  25181. <li><a href="#Options-95" accesskey="1">Options</a></li>
  25182. </ul>
  25183. <div class="subsection-level-extent" id="Options-95">
  25184. <h4 class="subsection"><span>26.14.1 Options<a class="copiable-link" href="#Options-95"> &para;</a></span></h4>
  25185. <dl class="table">
  25186. <dt><samp class="option">framerate</samp></dt>
  25187. <dd><p>Set the frame rate. Default is <code class="code">ntsc</code>, corresponding to a frame
  25188. rate of <code class="code">30000/1001</code>.
  25189. </p>
  25190. </dd>
  25191. <dt><samp class="option">pixel_format</samp></dt>
  25192. <dd><p>Select the pixel format. Default is <code class="code">uyvy422</code>.
  25193. </p>
  25194. </dd>
  25195. <dt><samp class="option">video_size</samp></dt>
  25196. <dd><p>Set the video size given as a string such as <code class="code">640x480</code> or <code class="code">hd720</code>.
  25197. Default is <code class="code">qvga</code>.
  25198. </p></dd>
  25199. </dl>
  25200. </div>
  25201. </div>
  25202. <div class="section-level-extent" id="openal">
  25203. <h3 class="section"><span>26.15 openal<a class="copiable-link" href="#openal"> &para;</a></span></h3>
  25204. <p>The OpenAL input device provides audio capture on all systems with a
  25205. working OpenAL 1.1 implementation.
  25206. </p>
  25207. <p>To enable this input device during configuration, you need OpenAL
  25208. headers and libraries installed on your system, and need to configure
  25209. FFmpeg with <code class="code">--enable-openal</code>.
  25210. </p>
  25211. <p>OpenAL headers and libraries should be provided as part of your OpenAL
  25212. implementation, or as an additional download (an SDK). Depending on your
  25213. installation you may need to specify additional flags via the
  25214. <code class="code">--extra-cflags</code> and <code class="code">--extra-ldflags</code> for allowing the build
  25215. system to locate the OpenAL headers and libraries.
  25216. </p>
  25217. <p>An incomplete list of OpenAL implementations follows:
  25218. </p>
  25219. <dl class="table">
  25220. <dt><strong class="strong">Creative</strong></dt>
  25221. <dd><p>The official Windows implementation, providing hardware acceleration
  25222. with supported devices and software fallback.
  25223. See <a class="url" href="http://openal.org/">http://openal.org/</a>.
  25224. </p></dd>
  25225. <dt><strong class="strong">OpenAL Soft</strong></dt>
  25226. <dd><p>Portable, open source (LGPL) software implementation. Includes
  25227. backends for the most common sound APIs on the Windows, Linux,
  25228. Solaris, and BSD operating systems.
  25229. See <a class="url" href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
  25230. </p></dd>
  25231. <dt><strong class="strong">Apple</strong></dt>
  25232. <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  25233. 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>
  25234. </p></dd>
  25235. </dl>
  25236. <p>This device allows one to capture from an audio input device handled
  25237. through OpenAL.
  25238. </p>
  25239. <p>You need to specify the name of the device to capture in the provided
  25240. filename. If the empty string is provided, the device will
  25241. automatically select the default device. You can get the list of the
  25242. supported devices by using the option <var class="var">list_devices</var>.
  25243. </p>
  25244. <ul class="mini-toc">
  25245. <li><a href="#Options-96" accesskey="1">Options</a></li>
  25246. <li><a href="#Examples-31" accesskey="2">Examples</a></li>
  25247. </ul>
  25248. <div class="subsection-level-extent" id="Options-96">
  25249. <h4 class="subsection"><span>26.15.1 Options<a class="copiable-link" href="#Options-96"> &para;</a></span></h4>
  25250. <dl class="table">
  25251. <dt><samp class="option">channels</samp></dt>
  25252. <dd><p>Set the number of channels in the captured audio. Only the values
  25253. <samp class="option">1</samp> (monaural) and <samp class="option">2</samp> (stereo) are currently supported.
  25254. Defaults to <samp class="option">2</samp>.
  25255. </p>
  25256. </dd>
  25257. <dt><samp class="option">sample_size</samp></dt>
  25258. <dd><p>Set the sample size (in bits) of the captured audio. Only the values
  25259. <samp class="option">8</samp> and <samp class="option">16</samp> are currently supported. Defaults to
  25260. <samp class="option">16</samp>.
  25261. </p>
  25262. </dd>
  25263. <dt><samp class="option">sample_rate</samp></dt>
  25264. <dd><p>Set the sample rate (in Hz) of the captured audio.
  25265. Defaults to <samp class="option">44.1k</samp>.
  25266. </p>
  25267. </dd>
  25268. <dt><samp class="option">list_devices</samp></dt>
  25269. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  25270. Defaults to <samp class="option">false</samp>.
  25271. </p>
  25272. </dd>
  25273. </dl>
  25274. </div>
  25275. <div class="subsection-level-extent" id="Examples-31">
  25276. <h4 class="subsection"><span>26.15.2 Examples<a class="copiable-link" href="#Examples-31"> &para;</a></span></h4>
  25277. <p>Print the list of OpenAL supported devices and exit:
  25278. </p><div class="example">
  25279. <pre class="example-preformatted">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
  25280. </pre></div>
  25281. <p>Capture from the OpenAL device <samp class="file">DR-BT101 via PulseAudio</samp>:
  25282. </p><div class="example">
  25283. <pre class="example-preformatted">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  25284. </pre></div>
  25285. <p>Capture from the default device (note the empty string &rdquo; as filename):
  25286. </p><div class="example">
  25287. <pre class="example-preformatted">$ ffmpeg -f openal -i '' out.ogg
  25288. </pre></div>
  25289. <p>Capture from two devices simultaneously, writing to two different files,
  25290. within the same <code class="command">ffmpeg</code> command:
  25291. </p><div class="example">
  25292. <pre class="example-preformatted">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  25293. </pre></div>
  25294. <p>Note: not all OpenAL implementations support multiple simultaneous capture -
  25295. try the latest OpenAL Soft if the above does not work.
  25296. </p>
  25297. </div>
  25298. </div>
  25299. <div class="section-level-extent" id="oss">
  25300. <h3 class="section"><span>26.16 oss<a class="copiable-link" href="#oss"> &para;</a></span></h3>
  25301. <p>Open Sound System input device.
  25302. </p>
  25303. <p>The filename to provide to the input device is the device node
  25304. representing the OSS input device, and is usually set to
  25305. <samp class="file">/dev/dsp</samp>.
  25306. </p>
  25307. <p>For example to grab from <samp class="file">/dev/dsp</samp> using <code class="command">ffmpeg</code> use the
  25308. command:
  25309. </p><div class="example">
  25310. <pre class="example-preformatted">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  25311. </pre></div>
  25312. <p>For more information about OSS see:
  25313. <a class="url" href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
  25314. </p>
  25315. <ul class="mini-toc">
  25316. <li><a href="#Options-97" accesskey="1">Options</a></li>
  25317. </ul>
  25318. <div class="subsection-level-extent" id="Options-97">
  25319. <h4 class="subsection"><span>26.16.1 Options<a class="copiable-link" href="#Options-97"> &para;</a></span></h4>
  25320. <dl class="table">
  25321. <dt><samp class="option">sample_rate</samp></dt>
  25322. <dd><p>Set the sample rate in Hz. Default is 48000.
  25323. </p>
  25324. </dd>
  25325. <dt><samp class="option">channels</samp></dt>
  25326. <dd><p>Set the number of channels. Default is 2.
  25327. </p>
  25328. </dd>
  25329. </dl>
  25330. </div>
  25331. </div>
  25332. <div class="section-level-extent" id="pulse">
  25333. <h3 class="section"><span>26.17 pulse<a class="copiable-link" href="#pulse"> &para;</a></span></h3>
  25334. <p>PulseAudio input device.
  25335. </p>
  25336. <p>To enable this output device you need to configure FFmpeg with <code class="code">--enable-libpulse</code>.
  25337. </p>
  25338. <p>The filename to provide to the input device is a source device or the
  25339. string &quot;default&quot;
  25340. </p>
  25341. <p>To list the PulseAudio source devices and their properties you can invoke
  25342. the command <code class="command">pactl list sources</code>.
  25343. </p>
  25344. <p>More information about PulseAudio can be found on <a class="url" href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
  25345. </p>
  25346. <ul class="mini-toc">
  25347. <li><a href="#Options-98" accesskey="1">Options</a></li>
  25348. <li><a href="#Examples-32" accesskey="2">Examples</a></li>
  25349. </ul>
  25350. <div class="subsection-level-extent" id="Options-98">
  25351. <h4 class="subsection"><span>26.17.1 Options<a class="copiable-link" href="#Options-98"> &para;</a></span></h4>
  25352. <dl class="table">
  25353. <dt><samp class="option">server</samp></dt>
  25354. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  25355. Default server is used when not provided.
  25356. </p>
  25357. </dd>
  25358. <dt><samp class="option">name</samp></dt>
  25359. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  25360. by default it is the <code class="code">LIBAVFORMAT_IDENT</code> string.
  25361. </p>
  25362. </dd>
  25363. <dt><samp class="option">stream_name</samp></dt>
  25364. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  25365. by default it is &quot;record&quot;.
  25366. </p>
  25367. </dd>
  25368. <dt><samp class="option">sample_rate</samp></dt>
  25369. <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
  25370. </p>
  25371. </dd>
  25372. <dt><samp class="option">channels</samp></dt>
  25373. <dd><p>Specify the channels in use, by default 2 (stereo) is set.
  25374. </p>
  25375. </dd>
  25376. <dt><samp class="option">frame_size</samp></dt>
  25377. <dd><p>This option does nothing and is deprecated.
  25378. </p>
  25379. </dd>
  25380. <dt><samp class="option">fragment_size</samp></dt>
  25381. <dd><p>Specify the size in bytes of the minimal buffering fragment in PulseAudio, it
  25382. will affect the audio latency. By default it is set to 50 ms amount of data.
  25383. </p>
  25384. </dd>
  25385. <dt><samp class="option">wallclock</samp></dt>
  25386. <dd><p>Set the initial PTS using the current time. Default is 1.
  25387. </p>
  25388. </dd>
  25389. </dl>
  25390. </div>
  25391. <div class="subsection-level-extent" id="Examples-32">
  25392. <h4 class="subsection"><span>26.17.2 Examples<a class="copiable-link" href="#Examples-32"> &para;</a></span></h4>
  25393. <p>Record a stream from default device:
  25394. </p><div class="example">
  25395. <pre class="example-preformatted">ffmpeg -f pulse -i default /tmp/pulse.wav
  25396. </pre></div>
  25397. </div>
  25398. </div>
  25399. <div class="section-level-extent" id="sndio">
  25400. <h3 class="section"><span>26.18 sndio<a class="copiable-link" href="#sndio"> &para;</a></span></h3>
  25401. <p>sndio input device.
  25402. </p>
  25403. <p>To enable this input device during configuration you need libsndio
  25404. installed on your system.
  25405. </p>
  25406. <p>The filename to provide to the input device is the device node
  25407. representing the sndio input device, and is usually set to
  25408. <samp class="file">/dev/audio0</samp>.
  25409. </p>
  25410. <p>For example to grab from <samp class="file">/dev/audio0</samp> using <code class="command">ffmpeg</code> use the
  25411. command:
  25412. </p><div class="example">
  25413. <pre class="example-preformatted">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  25414. </pre></div>
  25415. <ul class="mini-toc">
  25416. <li><a href="#Options-99" accesskey="1">Options</a></li>
  25417. </ul>
  25418. <div class="subsection-level-extent" id="Options-99">
  25419. <h4 class="subsection"><span>26.18.1 Options<a class="copiable-link" href="#Options-99"> &para;</a></span></h4>
  25420. <dl class="table">
  25421. <dt><samp class="option">sample_rate</samp></dt>
  25422. <dd><p>Set the sample rate in Hz. Default is 48000.
  25423. </p>
  25424. </dd>
  25425. <dt><samp class="option">channels</samp></dt>
  25426. <dd><p>Set the number of channels. Default is 2.
  25427. </p>
  25428. </dd>
  25429. </dl>
  25430. </div>
  25431. </div>
  25432. <div class="section-level-extent" id="video4linux2_002c-v4l2">
  25433. <h3 class="section"><span>26.19 video4linux2, v4l2<a class="copiable-link" href="#video4linux2_002c-v4l2"> &para;</a></span></h3>
  25434. <p>Video4Linux2 input video device.
  25435. </p>
  25436. <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
  25437. </p>
  25438. <p>If FFmpeg is built with v4l-utils support (by using the
  25439. <code class="code">--enable-libv4l2</code> configure option), it is possible to use it with the
  25440. <code class="code">-use_libv4l2</code> input device option.
  25441. </p>
  25442. <p>The name of the device to grab is a file device node, usually Linux
  25443. systems tend to automatically create such nodes when the device
  25444. (e.g. an USB webcam) is plugged into the system, and has a name of the
  25445. kind <samp class="file">/dev/video<var class="var">N</var></samp>, where <var class="var">N</var> is a number associated to
  25446. the device.
  25447. </p>
  25448. <p>Video4Linux2 devices usually support a limited set of
  25449. <var class="var">width</var>x<var class="var">height</var> sizes and frame rates. You can check which are
  25450. supported using <code class="command">-list_formats all</code> for Video4Linux2 devices.
  25451. Some devices, like TV cards, support one or more standards. It is possible
  25452. to list all the supported standards using <code class="command">-list_standards all</code>.
  25453. </p>
  25454. <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
  25455. version and configuration, the timestamps may be derived from the real time
  25456. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  25457. boot time, unaffected by NTP or manual changes to the clock). The
  25458. <samp class="option">-timestamps abs</samp> or <samp class="option">-ts abs</samp> option can be used to force
  25459. conversion into the real time clock.
  25460. </p>
  25461. <p>Some usage examples of the video4linux2 device with <code class="command">ffmpeg</code>
  25462. and <code class="command">ffplay</code>:
  25463. </p><ul class="itemize mark-bullet">
  25464. <li>List supported formats for a video4linux2 device:
  25465. <div class="example">
  25466. <pre class="example-preformatted">ffplay -f video4linux2 -list_formats all /dev/video0
  25467. </pre></div>
  25468. </li><li>Grab and show the input of a video4linux2 device:
  25469. <div class="example">
  25470. <pre class="example-preformatted">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  25471. </pre></div>
  25472. </li><li>Grab and record the input of a video4linux2 device, leave the
  25473. frame rate and size as previously set:
  25474. <div class="example">
  25475. <pre class="example-preformatted">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  25476. </pre></div>
  25477. </li></ul>
  25478. <p>For more information about Video4Linux, check <a class="url" href="http://linuxtv.org/">http://linuxtv.org/</a>.
  25479. </p>
  25480. <ul class="mini-toc">
  25481. <li><a href="#Options-100" accesskey="1">Options</a></li>
  25482. </ul>
  25483. <div class="subsection-level-extent" id="Options-100">
  25484. <h4 class="subsection"><span>26.19.1 Options<a class="copiable-link" href="#Options-100"> &para;</a></span></h4>
  25485. <dl class="table">
  25486. <dt><samp class="option">standard</samp></dt>
  25487. <dd><p>Set the standard. Must be the name of a supported standard. To get a
  25488. list of the supported standards, use the <samp class="option">list_standards</samp>
  25489. option.
  25490. </p>
  25491. </dd>
  25492. <dt><samp class="option">channel</samp></dt>
  25493. <dd><p>Set the input channel number. Default to -1, which means using the
  25494. previously selected channel.
  25495. </p>
  25496. </dd>
  25497. <dt><samp class="option">video_size</samp></dt>
  25498. <dd><p>Set the video frame size. The argument must be a string in the form
  25499. <var class="var">WIDTH</var>x<var class="var">HEIGHT</var> or a valid size abbreviation.
  25500. </p>
  25501. </dd>
  25502. <dt><samp class="option">pixel_format</samp></dt>
  25503. <dd><p>Select the pixel format (only valid for raw video input).
  25504. </p>
  25505. </dd>
  25506. <dt><samp class="option">input_format</samp></dt>
  25507. <dd><p>Set the preferred pixel format (for raw video) or a codec name.
  25508. This option allows one to select the input format, when several are
  25509. available.
  25510. </p>
  25511. </dd>
  25512. <dt><samp class="option">framerate</samp></dt>
  25513. <dd><p>Set the preferred video frame rate.
  25514. </p>
  25515. </dd>
  25516. <dt><samp class="option">list_formats</samp></dt>
  25517. <dd><p>List available formats (supported pixel formats, codecs, and frame
  25518. sizes) and exit.
  25519. </p>
  25520. <p>Available values are:
  25521. </p><dl class="table">
  25522. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  25523. <dd><p>Show all available (compressed and non-compressed) formats.
  25524. </p>
  25525. </dd>
  25526. <dt>&lsquo;<samp class="samp">raw</samp>&rsquo;</dt>
  25527. <dd><p>Show only raw video (non-compressed) formats.
  25528. </p>
  25529. </dd>
  25530. <dt>&lsquo;<samp class="samp">compressed</samp>&rsquo;</dt>
  25531. <dd><p>Show only compressed formats.
  25532. </p></dd>
  25533. </dl>
  25534. </dd>
  25535. <dt><samp class="option">list_standards</samp></dt>
  25536. <dd><p>List supported standards and exit.
  25537. </p>
  25538. <p>Available values are:
  25539. </p><dl class="table">
  25540. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  25541. <dd><p>Show all supported standards.
  25542. </p></dd>
  25543. </dl>
  25544. </dd>
  25545. <dt><samp class="option">timestamps, ts</samp></dt>
  25546. <dd><p>Set type of timestamps for grabbed frames.
  25547. </p>
  25548. <p>Available values are:
  25549. </p><dl class="table">
  25550. <dt>&lsquo;<samp class="samp">default</samp>&rsquo;</dt>
  25551. <dd><p>Use timestamps from the kernel.
  25552. </p>
  25553. </dd>
  25554. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  25555. <dd><p>Use absolute timestamps (wall clock).
  25556. </p>
  25557. </dd>
  25558. <dt>&lsquo;<samp class="samp">mono2abs</samp>&rsquo;</dt>
  25559. <dd><p>Force conversion from monotonic to absolute timestamps.
  25560. </p></dd>
  25561. </dl>
  25562. <p>Default value is <code class="code">default</code>.
  25563. </p>
  25564. </dd>
  25565. <dt><samp class="option">use_libv4l2</samp></dt>
  25566. <dd><p>Use libv4l2 (v4l-utils) conversion functions. Default is 0.
  25567. </p>
  25568. </dd>
  25569. </dl>
  25570. </div>
  25571. </div>
  25572. <div class="section-level-extent" id="vfwcap">
  25573. <h3 class="section"><span>26.20 vfwcap<a class="copiable-link" href="#vfwcap"> &para;</a></span></h3>
  25574. <p>VfW (Video for Windows) capture input device.
  25575. </p>
  25576. <p>The filename passed as input is the capture driver number, ranging from
  25577. 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
  25578. other filename will be interpreted as device number 0.
  25579. </p>
  25580. <ul class="mini-toc">
  25581. <li><a href="#Options-101" accesskey="1">Options</a></li>
  25582. </ul>
  25583. <div class="subsection-level-extent" id="Options-101">
  25584. <h4 class="subsection"><span>26.20.1 Options<a class="copiable-link" href="#Options-101"> &para;</a></span></h4>
  25585. <dl class="table">
  25586. <dt><samp class="option">video_size</samp></dt>
  25587. <dd><p>Set the video frame size.
  25588. </p>
  25589. </dd>
  25590. <dt><samp class="option">framerate</samp></dt>
  25591. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  25592. corresponding to a frame rate of <code class="code">30000/1001</code>.
  25593. </p>
  25594. </dd>
  25595. </dl>
  25596. </div>
  25597. </div>
  25598. <div class="section-level-extent" id="x11grab">
  25599. <h3 class="section"><span>26.21 x11grab<a class="copiable-link" href="#x11grab"> &para;</a></span></h3>
  25600. <p>X11 video input device.
  25601. </p>
  25602. <p>To enable this input device during configuration you need libxcb
  25603. installed on your system. It will be automatically detected during
  25604. configuration.
  25605. </p>
  25606. <p>This device allows one to capture a region of an X11 display.
  25607. </p>
  25608. <p>The filename passed as input has the syntax:
  25609. </p><div class="example">
  25610. <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>]
  25611. </pre></div>
  25612. <p><var class="var">hostname</var>:<var class="var">display_number</var>.<var class="var">screen_number</var> specifies the
  25613. X11 display name of the screen to grab from. <var class="var">hostname</var> can be
  25614. omitted, and defaults to &quot;localhost&quot;. The environment variable
  25615. <code class="env">DISPLAY</code> contains the default display name.
  25616. </p>
  25617. <p><var class="var">x_offset</var> and <var class="var">y_offset</var> specify the offsets of the grabbed
  25618. area with respect to the top-left border of the X11 screen. They
  25619. default to 0.
  25620. </p>
  25621. <p>Check the X11 documentation (e.g. <code class="command">man X</code>) for more detailed
  25622. information.
  25623. </p>
  25624. <p>Use the <code class="command">xdpyinfo</code> program for getting basic information about
  25625. the properties of your X11 display (e.g. grep for &quot;name&quot; or
  25626. &quot;dimensions&quot;).
  25627. </p>
  25628. <p>For example to grab from <samp class="file">:0.0</samp> using <code class="command">ffmpeg</code>:
  25629. </p><div class="example">
  25630. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  25631. </pre></div>
  25632. <p>Grab at position <code class="code">10,20</code>:
  25633. </p><div class="example">
  25634. <pre class="example-preformatted">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  25635. </pre></div>
  25636. <ul class="mini-toc">
  25637. <li><a href="#Options-102" accesskey="1">Options</a></li>
  25638. </ul>
  25639. <div class="subsection-level-extent" id="Options-102">
  25640. <h4 class="subsection"><span>26.21.1 Options<a class="copiable-link" href="#Options-102"> &para;</a></span></h4>
  25641. <dl class="table">
  25642. <dt><samp class="option">select_region</samp></dt>
  25643. <dd><p>Specify whether to select the grabbing area graphically using the pointer.
  25644. A value of <code class="code">1</code> prompts the user to select the grabbing area graphically
  25645. by clicking and dragging. A single click with no dragging will select the
  25646. whole screen. A region with zero width or height will also select the whole
  25647. screen. This option overwrites the <var class="var">video_size</var>, <var class="var">grab_x</var>, and
  25648. <var class="var">grab_y</var> options. Default value is <code class="code">0</code>.
  25649. </p>
  25650. </dd>
  25651. <dt><samp class="option">draw_mouse</samp></dt>
  25652. <dd><p>Specify whether to draw the mouse pointer. A value of <code class="code">0</code> specifies
  25653. not to draw the pointer. Default value is <code class="code">1</code>.
  25654. </p>
  25655. </dd>
  25656. <dt><samp class="option">follow_mouse</samp></dt>
  25657. <dd><p>Make the grabbed area follow the mouse. The argument can be
  25658. <code class="code">centered</code> or a number of pixels <var class="var">PIXELS</var>.
  25659. </p>
  25660. <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
  25661. pointer and keeps the pointer at the center of region; otherwise, the region
  25662. follows only when the mouse pointer reaches within <var class="var">PIXELS</var> (greater than
  25663. zero) to the edge of region.
  25664. </p>
  25665. <p>For example:
  25666. </p><div class="example">
  25667. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  25668. </pre></div>
  25669. <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
  25670. </p><div class="example">
  25671. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  25672. </pre></div>
  25673. </dd>
  25674. <dt><samp class="option">framerate</samp></dt>
  25675. <dd><p>Set the grabbing frame rate. Default value is <code class="code">ntsc</code>,
  25676. corresponding to a frame rate of <code class="code">30000/1001</code>.
  25677. </p>
  25678. </dd>
  25679. <dt><samp class="option">show_region</samp></dt>
  25680. <dd><p>Show grabbed region on screen.
  25681. </p>
  25682. <p>If <var class="var">show_region</var> is specified with <code class="code">1</code>, then the grabbing
  25683. region will be indicated on screen. With this option, it is easy to
  25684. know what is being grabbed if only a portion of the screen is grabbed.
  25685. </p>
  25686. </dd>
  25687. <dt><samp class="option">region_border</samp></dt>
  25688. <dd><p>Set the region border thickness if <samp class="option">-show_region 1</samp> is used.
  25689. Range is 1 to 128 and default is 3 (XCB-based x11grab only).
  25690. </p>
  25691. <p>For example:
  25692. </p><div class="example">
  25693. <pre class="example-preformatted">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  25694. </pre></div>
  25695. <p>With <var class="var">follow_mouse</var>:
  25696. </p><div class="example">
  25697. <pre class="example-preformatted">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  25698. </pre></div>
  25699. </dd>
  25700. <dt><samp class="option">window_id</samp></dt>
  25701. <dd><p>Grab this window, instead of the whole screen. Default value is 0, which maps to
  25702. the whole screen (root window).
  25703. </p>
  25704. <p>The id of a window can be found using the <code class="command">xwininfo</code> program, possibly with options -tree and
  25705. -root.
  25706. </p>
  25707. <p>If the window is later enlarged, the new area is not recorded. Video ends when
  25708. the window is closed, unmapped (i.e., iconified) or shrunk beyond the video
  25709. size (which defaults to the initial window size).
  25710. </p>
  25711. <p>This option disables options <samp class="option">follow_mouse</samp> and <samp class="option">select_region</samp>.
  25712. </p>
  25713. </dd>
  25714. <dt><samp class="option">video_size</samp></dt>
  25715. <dd><p>Set the video frame size. Default is the full desktop or window.
  25716. </p>
  25717. </dd>
  25718. <dt><samp class="option">grab_x</samp></dt>
  25719. <dt><samp class="option">grab_y</samp></dt>
  25720. <dd><p>Set the grabbing region coordinates. They are expressed as offset from
  25721. the top left corner of the X11 window and correspond to the
  25722. <var class="var">x_offset</var> and <var class="var">y_offset</var> parameters in the device name. The
  25723. default value for both options is 0.
  25724. </p></dd>
  25725. </dl>
  25726. </div>
  25727. </div>
  25728. </div>
  25729. <div class="chapter-level-extent" id="Output-Devices">
  25730. <h2 class="chapter"><span>27 Output Devices<a class="copiable-link" href="#Output-Devices"> &para;</a></span></h2>
  25731. <p>Output devices are configured elements in FFmpeg that can write
  25732. multimedia data to an output device attached to your system.
  25733. </p>
  25734. <p>When you configure your FFmpeg build, all the supported output devices
  25735. are enabled by default. You can list all available ones using the
  25736. configure option &quot;&ndash;list-outdevs&quot;.
  25737. </p>
  25738. <p>You can disable all the output devices using the configure option
  25739. &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
  25740. option &quot;&ndash;enable-outdev=<var class="var">OUTDEV</var>&quot;, or you can disable a particular
  25741. input device using the option &quot;&ndash;disable-outdev=<var class="var">OUTDEV</var>&quot;.
  25742. </p>
  25743. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  25744. enabled output devices.
  25745. </p>
  25746. <p>A description of the currently available output devices follows.
  25747. </p>
  25748. <ul class="mini-toc">
  25749. <li><a href="#alsa-1" accesskey="1">alsa</a></li>
  25750. <li><a href="#AudioToolbox" accesskey="2">AudioToolbox</a></li>
  25751. <li><a href="#caca" accesskey="3">caca</a></li>
  25752. <li><a href="#decklink-1" accesskey="4">decklink</a></li>
  25753. <li><a href="#fbdev-1" accesskey="5">fbdev</a></li>
  25754. <li><a href="#opengl" accesskey="6">opengl</a></li>
  25755. <li><a href="#oss-1" accesskey="7">oss</a></li>
  25756. <li><a href="#pulse-1" accesskey="8">pulse</a></li>
  25757. <li><a href="#sdl" accesskey="9">sdl</a></li>
  25758. <li><a href="#sndio-1">sndio</a></li>
  25759. <li><a href="#v4l2">v4l2</a></li>
  25760. <li><a href="#xv">xv</a></li>
  25761. </ul>
  25762. <div class="section-level-extent" id="alsa-1">
  25763. <h3 class="section"><span>27.1 alsa<a class="copiable-link" href="#alsa-1"> &para;</a></span></h3>
  25764. <p>ALSA (Advanced Linux Sound Architecture) output device.
  25765. </p>
  25766. <ul class="mini-toc">
  25767. <li><a href="#Examples-33" accesskey="1">Examples</a></li>
  25768. </ul>
  25769. <div class="subsection-level-extent" id="Examples-33">
  25770. <h4 class="subsection"><span>27.1.1 Examples<a class="copiable-link" href="#Examples-33"> &para;</a></span></h4>
  25771. <ul class="itemize mark-bullet">
  25772. <li>Play a file on default ALSA device:
  25773. <div class="example">
  25774. <pre class="example-preformatted">ffmpeg -i INPUT -f alsa default
  25775. </pre></div>
  25776. </li><li>Play a file on soundcard 1, audio device 7:
  25777. <div class="example">
  25778. <pre class="example-preformatted">ffmpeg -i INPUT -f alsa hw:1,7
  25779. </pre></div>
  25780. </li></ul>
  25781. </div>
  25782. </div>
  25783. <div class="section-level-extent" id="AudioToolbox">
  25784. <h3 class="section"><span>27.2 AudioToolbox<a class="copiable-link" href="#AudioToolbox"> &para;</a></span></h3>
  25785. <p>AudioToolbox output device.
  25786. </p>
  25787. <p>Allows native output to CoreAudio devices on OSX.
  25788. </p>
  25789. <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>.
  25790. </p>
  25791. <p>Alternatively, the audio input device can be chosen by index using the
  25792. <samp class="option">
  25793. -audio_device_index &lt;INDEX&gt;
  25794. </samp>
  25795. , overriding any device name or index given in the input filename.
  25796. </p>
  25797. <p>All available devices can be enumerated by using <samp class="option">-list_devices true</samp>, listing
  25798. all device names, UIDs and corresponding indices.
  25799. </p>
  25800. <ul class="mini-toc">
  25801. <li><a href="#Options-103" accesskey="1">Options</a></li>
  25802. <li><a href="#Examples-34" accesskey="2">Examples</a></li>
  25803. </ul>
  25804. <div class="subsection-level-extent" id="Options-103">
  25805. <h4 class="subsection"><span>27.2.1 Options<a class="copiable-link" href="#Options-103"> &para;</a></span></h4>
  25806. <p>AudioToolbox supports the following options:
  25807. </p>
  25808. <dl class="table">
  25809. <dt><samp class="option">-audio_device_index &lt;INDEX&gt;</samp></dt>
  25810. <dd><p>Specify the audio device by its index. Overrides anything given in the output filename.
  25811. </p>
  25812. </dd>
  25813. </dl>
  25814. </div>
  25815. <div class="subsection-level-extent" id="Examples-34">
  25816. <h4 class="subsection"><span>27.2.2 Examples<a class="copiable-link" href="#Examples-34"> &para;</a></span></h4>
  25817. <ul class="itemize mark-bullet">
  25818. <li>Print the list of supported devices and output a sine wave to the default device:
  25819. <div class="example">
  25820. <pre class="example-preformatted">$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
  25821. </pre></div>
  25822. </li><li>Output a sine wave to the device with the index 2, overriding any output filename:
  25823. <div class="example">
  25824. <pre class="example-preformatted">$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
  25825. </pre></div>
  25826. </li></ul>
  25827. </div>
  25828. </div>
  25829. <div class="section-level-extent" id="caca">
  25830. <h3 class="section"><span>27.3 caca<a class="copiable-link" href="#caca"> &para;</a></span></h3>
  25831. <p>CACA output device.
  25832. </p>
  25833. <p>This output device allows one to show a video stream in CACA window.
  25834. Only one CACA window is allowed per application, so you can
  25835. have only one instance of this output device in an application.
  25836. </p>
  25837. <p>To enable this output device you need to configure FFmpeg with
  25838. <code class="code">--enable-libcaca</code>.
  25839. libcaca is a graphics library that outputs text instead of pixels.
  25840. </p>
  25841. <p>For more information about libcaca, check:
  25842. <a class="url" href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
  25843. </p>
  25844. <ul class="mini-toc">
  25845. <li><a href="#Options-104" accesskey="1">Options</a></li>
  25846. <li><a href="#Examples-35" accesskey="2">Examples</a></li>
  25847. </ul>
  25848. <div class="subsection-level-extent" id="Options-104">
  25849. <h4 class="subsection"><span>27.3.1 Options<a class="copiable-link" href="#Options-104"> &para;</a></span></h4>
  25850. <dl class="table">
  25851. <dt><samp class="option">window_title</samp></dt>
  25852. <dd><p>Set the CACA window title, if not specified default to the filename
  25853. specified for the output device.
  25854. </p>
  25855. </dd>
  25856. <dt><samp class="option">window_size</samp></dt>
  25857. <dd><p>Set the CACA window size, can be a string of the form
  25858. <var class="var">width</var>x<var class="var">height</var> or a video size abbreviation.
  25859. If not specified it defaults to the size of the input video.
  25860. </p>
  25861. </dd>
  25862. <dt><samp class="option">driver</samp></dt>
  25863. <dd><p>Set display driver.
  25864. </p>
  25865. </dd>
  25866. <dt><samp class="option">algorithm</samp></dt>
  25867. <dd><p>Set dithering algorithm. Dithering is necessary
  25868. because the picture being rendered has usually far more colours than
  25869. the available palette.
  25870. The accepted values are listed with <code class="code">-list_dither algorithms</code>.
  25871. </p>
  25872. </dd>
  25873. <dt><samp class="option">antialias</samp></dt>
  25874. <dd><p>Set antialias method. Antialiasing smoothens the rendered
  25875. image and avoids the commonly seen staircase effect.
  25876. The accepted values are listed with <code class="code">-list_dither antialiases</code>.
  25877. </p>
  25878. </dd>
  25879. <dt><samp class="option">charset</samp></dt>
  25880. <dd><p>Set which characters are going to be used when rendering text.
  25881. The accepted values are listed with <code class="code">-list_dither charsets</code>.
  25882. </p>
  25883. </dd>
  25884. <dt><samp class="option">color</samp></dt>
  25885. <dd><p>Set color to be used when rendering text.
  25886. The accepted values are listed with <code class="code">-list_dither colors</code>.
  25887. </p>
  25888. </dd>
  25889. <dt><samp class="option">list_drivers</samp></dt>
  25890. <dd><p>If set to <samp class="option">true</samp>, print a list of available drivers and exit.
  25891. </p>
  25892. </dd>
  25893. <dt><samp class="option">list_dither</samp></dt>
  25894. <dd><p>List available dither options related to the argument.
  25895. The argument must be one of <code class="code">algorithms</code>, <code class="code">antialiases</code>,
  25896. <code class="code">charsets</code>, <code class="code">colors</code>.
  25897. </p></dd>
  25898. </dl>
  25899. </div>
  25900. <div class="subsection-level-extent" id="Examples-35">
  25901. <h4 class="subsection"><span>27.3.2 Examples<a class="copiable-link" href="#Examples-35"> &para;</a></span></h4>
  25902. <ul class="itemize mark-bullet">
  25903. <li>The following command shows the <code class="command">ffmpeg</code> output is an
  25904. CACA window, forcing its size to 80x25:
  25905. <div class="example">
  25906. <pre class="example-preformatted">ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
  25907. </pre></div>
  25908. </li><li>Show the list of available drivers and exit:
  25909. <div class="example">
  25910. <pre class="example-preformatted">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
  25911. </pre></div>
  25912. </li><li>Show the list of available dither colors and exit:
  25913. <div class="example">
  25914. <pre class="example-preformatted">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
  25915. </pre></div>
  25916. </li></ul>
  25917. </div>
  25918. </div>
  25919. <div class="section-level-extent" id="decklink-1">
  25920. <h3 class="section"><span>27.4 decklink<a class="copiable-link" href="#decklink-1"> &para;</a></span></h3>
  25921. <p>The decklink output device provides playback capabilities for Blackmagic
  25922. DeckLink devices.
  25923. </p>
  25924. <p>To enable this output device, you need the Blackmagic DeckLink SDK and you
  25925. need to configure with the appropriate <code class="code">--extra-cflags</code>
  25926. and <code class="code">--extra-ldflags</code>.
  25927. On Windows, you need to run the IDL files through <code class="command">widl</code>.
  25928. </p>
  25929. <p>DeckLink is very picky about the formats it supports. Pixel format is always
  25930. uyvy422, framerate, field order and video size must be determined for your
  25931. device with <code class="command">-list_formats 1</code>. Audio sample rate is always 48 kHz.
  25932. </p>
  25933. <ul class="mini-toc">
  25934. <li><a href="#Options-105" accesskey="1">Options</a></li>
  25935. <li><a href="#Examples-36" accesskey="2">Examples</a></li>
  25936. </ul>
  25937. <div class="subsection-level-extent" id="Options-105">
  25938. <h4 class="subsection"><span>27.4.1 Options<a class="copiable-link" href="#Options-105"> &para;</a></span></h4>
  25939. <dl class="table">
  25940. <dt><samp class="option">list_devices</samp></dt>
  25941. <dd><p>If set to <samp class="option">true</samp>, print a list of devices and exit.
  25942. Defaults to <samp class="option">false</samp>. This option is deprecated, please use the
  25943. <code class="code">-sinks</code> option of ffmpeg to list the available output devices.
  25944. </p>
  25945. </dd>
  25946. <dt><samp class="option">list_formats</samp></dt>
  25947. <dd><p>If set to <samp class="option">true</samp>, print a list of supported formats and exit.
  25948. Defaults to <samp class="option">false</samp>.
  25949. </p>
  25950. </dd>
  25951. <dt><samp class="option">preroll</samp></dt>
  25952. <dd><p>Amount of time to preroll video in seconds.
  25953. Defaults to <samp class="option">0.5</samp>.
  25954. </p>
  25955. </dd>
  25956. <dt><samp class="option">duplex_mode</samp></dt>
  25957. <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;,
  25958. &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;,
  25959. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  25960. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  25961. </p>
  25962. <p>Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
  25963. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
  25964. sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
  25965. is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
  25966. </p>
  25967. <p>Valid profile modes for DeckLink 8K Pro(with DeckLink SDK &gt;= 11.0):
  25968. &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;,
  25969. &lsquo;<samp class="samp">four_sub_device_half</samp>&rsquo;
  25970. </p>
  25971. <p>Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
  25972. &lsquo;<samp class="samp">half</samp>&rsquo;, &lsquo;<samp class="samp">full</samp>&rsquo;
  25973. </p>
  25974. </dd>
  25975. <dt><samp class="option">timing_offset</samp></dt>
  25976. <dd><p>Sets the genlock timing pixel offset on the used output.
  25977. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  25978. </p>
  25979. </dd>
  25980. <dt><samp class="option">link</samp></dt>
  25981. <dd><p>Sets the SDI video link configuration on the used output. Must be
  25982. &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
  25983. SDI.
  25984. Defaults to &lsquo;<samp class="samp">unset</samp>&rsquo;.
  25985. </p>
  25986. </dd>
  25987. <dt><samp class="option">sqd</samp></dt>
  25988. <dd><p>Enable Square Division Quad Split mode for Quad-link SDI output.
  25989. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">true</samp>&rsquo; or &lsquo;<samp class="samp">false</samp>&rsquo;.
  25990. Defaults to <samp class="option">unset</samp>.
  25991. </p>
  25992. </dd>
  25993. <dt><samp class="option">level_a</samp></dt>
  25994. <dd><p>Enable SMPTE Level A mode on the used output.
  25995. Must be &lsquo;<samp class="samp">unset</samp>&rsquo;, &lsquo;<samp class="samp">true</samp>&rsquo; or &lsquo;<samp class="samp">false</samp>&rsquo;.
  25996. Defaults to <samp class="option">unset</samp>.
  25997. </p>
  25998. </dd>
  25999. <dt><samp class="option">vanc_queue_size</samp></dt>
  26000. <dd><p>Sets maximum output buffer size in bytes for VANC data. If the buffering reaches this value,
  26001. outgoing VANC data will be dropped.
  26002. Defaults to &lsquo;<samp class="samp">1048576</samp>&rsquo;.
  26003. </p>
  26004. </dd>
  26005. </dl>
  26006. </div>
  26007. <div class="subsection-level-extent" id="Examples-36">
  26008. <h4 class="subsection"><span>27.4.2 Examples<a class="copiable-link" href="#Examples-36"> &para;</a></span></h4>
  26009. <ul class="itemize mark-bullet">
  26010. <li>List output devices:
  26011. <div class="example">
  26012. <pre class="example-preformatted">ffmpeg -sinks decklink
  26013. </pre></div>
  26014. </li><li>List supported formats:
  26015. <div class="example">
  26016. <pre class="example-preformatted">ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
  26017. </pre></div>
  26018. </li><li>Play video clip:
  26019. <div class="example">
  26020. <pre class="example-preformatted">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
  26021. </pre></div>
  26022. </li><li>Play video clip with non-standard framerate or video size:
  26023. <div class="example">
  26024. <pre class="example-preformatted">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
  26025. </pre></div>
  26026. </li></ul>
  26027. </div>
  26028. </div>
  26029. <div class="section-level-extent" id="fbdev-1">
  26030. <h3 class="section"><span>27.5 fbdev<a class="copiable-link" href="#fbdev-1"> &para;</a></span></h3>
  26031. <p>Linux framebuffer output device.
  26032. </p>
  26033. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  26034. layer to show graphics on a computer monitor, typically on the
  26035. console. It is accessed through a file device node, usually
  26036. <samp class="file">/dev/fb0</samp>.
  26037. </p>
  26038. <p>For more detailed information read the file
  26039. <samp class="file">Documentation/fb/framebuffer.txt</samp> included in the Linux source tree.
  26040. </p>
  26041. <ul class="mini-toc">
  26042. <li><a href="#Options-106" accesskey="1">Options</a></li>
  26043. <li><a href="#Examples-37" accesskey="2">Examples</a></li>
  26044. </ul>
  26045. <div class="subsection-level-extent" id="Options-106">
  26046. <h4 class="subsection"><span>27.5.1 Options<a class="copiable-link" href="#Options-106"> &para;</a></span></h4>
  26047. <dl class="table">
  26048. <dt><samp class="option">xoffset</samp></dt>
  26049. <dt><samp class="option">yoffset</samp></dt>
  26050. <dd><p>Set x/y coordinate of top left corner. Default is 0.
  26051. </p></dd>
  26052. </dl>
  26053. </div>
  26054. <div class="subsection-level-extent" id="Examples-37">
  26055. <h4 class="subsection"><span>27.5.2 Examples<a class="copiable-link" href="#Examples-37"> &para;</a></span></h4>
  26056. <p>Play a file on framebuffer device <samp class="file">/dev/fb0</samp>.
  26057. Required pixel format depends on current framebuffer settings.
  26058. </p><div class="example">
  26059. <pre class="example-preformatted">ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  26060. </pre></div>
  26061. <p>See also <a class="url" href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  26062. </p>
  26063. </div>
  26064. </div>
  26065. <div class="section-level-extent" id="opengl">
  26066. <h3 class="section"><span>27.6 opengl<a class="copiable-link" href="#opengl"> &para;</a></span></h3>
  26067. <p>OpenGL output device. Deprecated and will be removed.
  26068. </p>
  26069. <p>To enable this output device you need to configure FFmpeg with <code class="code">--enable-opengl</code>.
  26070. </p>
  26071. <p>This output device allows one to render to OpenGL context.
  26072. Context may be provided by application or default SDL window is created.
  26073. </p>
  26074. <p>When device renders to external context, application must implement handlers for following messages:
  26075. <code class="code">AV_DEV_TO_APP_CREATE_WINDOW_BUFFER</code> - create OpenGL context on current thread.
  26076. <code class="code">AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER</code> - make OpenGL context current.
  26077. <code class="code">AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER</code> - swap buffers.
  26078. <code class="code">AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER</code> - destroy OpenGL context.
  26079. Application is also required to inform a device about current resolution by sending <code class="code">AV_APP_TO_DEV_WINDOW_SIZE</code> message.
  26080. </p>
  26081. <ul class="mini-toc">
  26082. <li><a href="#Options-107" accesskey="1">Options</a></li>
  26083. <li><a href="#Examples-38" accesskey="2">Examples</a></li>
  26084. </ul>
  26085. <div class="subsection-level-extent" id="Options-107">
  26086. <h4 class="subsection"><span>27.6.1 Options<a class="copiable-link" href="#Options-107"> &para;</a></span></h4>
  26087. <dl class="table">
  26088. <dt><samp class="option">background</samp></dt>
  26089. <dd><p>Set background color. Black is a default.
  26090. </p></dd>
  26091. <dt><samp class="option">no_window</samp></dt>
  26092. <dd><p>Disables default SDL window when set to non-zero value.
  26093. Application must provide OpenGL context and both <code class="code">window_size_cb</code> and <code class="code">window_swap_buffers_cb</code> callbacks when set.
  26094. </p></dd>
  26095. <dt><samp class="option">window_title</samp></dt>
  26096. <dd><p>Set the SDL window title, if not specified default to the filename specified for the output device.
  26097. Ignored when <samp class="option">no_window</samp> is set.
  26098. </p></dd>
  26099. <dt><samp class="option">window_size</samp></dt>
  26100. <dd><p>Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
  26101. If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
  26102. Mostly usable when <samp class="option">no_window</samp> is not set.
  26103. </p>
  26104. </dd>
  26105. </dl>
  26106. </div>
  26107. <div class="subsection-level-extent" id="Examples-38">
  26108. <h4 class="subsection"><span>27.6.2 Examples<a class="copiable-link" href="#Examples-38"> &para;</a></span></h4>
  26109. <p>Play a file on SDL window using OpenGL rendering:
  26110. </p><div class="example">
  26111. <pre class="example-preformatted">ffmpeg -i INPUT -f opengl &quot;window title&quot;
  26112. </pre></div>
  26113. </div>
  26114. </div>
  26115. <div class="section-level-extent" id="oss-1">
  26116. <h3 class="section"><span>27.7 oss<a class="copiable-link" href="#oss-1"> &para;</a></span></h3>
  26117. <p>OSS (Open Sound System) output device.
  26118. </p>
  26119. </div>
  26120. <div class="section-level-extent" id="pulse-1">
  26121. <h3 class="section"><span>27.8 pulse<a class="copiable-link" href="#pulse-1"> &para;</a></span></h3>
  26122. <p>PulseAudio output device.
  26123. </p>
  26124. <p>To enable this output device you need to configure FFmpeg with <code class="code">--enable-libpulse</code>.
  26125. </p>
  26126. <p>More information about PulseAudio can be found on <a class="url" href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
  26127. </p>
  26128. <ul class="mini-toc">
  26129. <li><a href="#Options-108" accesskey="1">Options</a></li>
  26130. <li><a href="#Examples-39" accesskey="2">Examples</a></li>
  26131. </ul>
  26132. <div class="subsection-level-extent" id="Options-108">
  26133. <h4 class="subsection"><span>27.8.1 Options<a class="copiable-link" href="#Options-108"> &para;</a></span></h4>
  26134. <dl class="table">
  26135. <dt><samp class="option">server</samp></dt>
  26136. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  26137. Default server is used when not provided.
  26138. </p>
  26139. </dd>
  26140. <dt><samp class="option">name</samp></dt>
  26141. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  26142. by default it is the <code class="code">LIBAVFORMAT_IDENT</code> string.
  26143. </p>
  26144. </dd>
  26145. <dt><samp class="option">stream_name</samp></dt>
  26146. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  26147. by default it is set to the specified output name.
  26148. </p>
  26149. </dd>
  26150. <dt><samp class="option">device</samp></dt>
  26151. <dd><p>Specify the device to use. Default device is used when not provided.
  26152. List of output devices can be obtained with command <code class="command">pactl list sinks</code>.
  26153. </p>
  26154. </dd>
  26155. <dt><samp class="option">buffer_size</samp></dt>
  26156. <dt><samp class="option">buffer_duration</samp></dt>
  26157. <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
  26158. gives more control, but requires more frequent updates.
  26159. </p>
  26160. <p><samp class="option">buffer_size</samp> specifies size in bytes while
  26161. <samp class="option">buffer_duration</samp> specifies duration in milliseconds.
  26162. </p>
  26163. <p>When both options are provided then the highest value is used
  26164. (duration is recalculated to bytes using stream parameters). If they
  26165. are set to 0 (which is default), the device will use the default
  26166. PulseAudio duration value. By default PulseAudio set buffer duration
  26167. to around 2 seconds.
  26168. </p>
  26169. </dd>
  26170. <dt><samp class="option">prebuf</samp></dt>
  26171. <dd><p>Specify pre-buffering size in bytes. The server does not start with
  26172. playback before at least <samp class="option">prebuf</samp> bytes are available in the
  26173. buffer. By default this option is initialized to the same value as
  26174. <samp class="option">buffer_size</samp> or <samp class="option">buffer_duration</samp> (whichever is bigger).
  26175. </p>
  26176. </dd>
  26177. <dt><samp class="option">minreq</samp></dt>
  26178. <dd><p>Specify minimum request size in bytes. The server does not request less
  26179. than <samp class="option">minreq</samp> bytes from the client, instead waits until the buffer
  26180. is free enough to request more bytes at once. It is recommended to not set
  26181. this option, which will initialize this to a value that is deemed sensible
  26182. by the server.
  26183. </p>
  26184. </dd>
  26185. </dl>
  26186. </div>
  26187. <div class="subsection-level-extent" id="Examples-39">
  26188. <h4 class="subsection"><span>27.8.2 Examples<a class="copiable-link" href="#Examples-39"> &para;</a></span></h4>
  26189. <p>Play a file on default device on default server:
  26190. </p><div class="example">
  26191. <pre class="example-preformatted">ffmpeg -i INPUT -f pulse &quot;stream name&quot;
  26192. </pre></div>
  26193. </div>
  26194. </div>
  26195. <div class="section-level-extent" id="sdl">
  26196. <h3 class="section"><span>27.9 sdl<a class="copiable-link" href="#sdl"> &para;</a></span></h3>
  26197. <p>SDL (Simple DirectMedia Layer) output device. Deprecated and will be removed.
  26198. </p>
  26199. <p>For monitoring purposes in FFmpeg, pipes and a video player such as ffplay can be used:
  26200. </p>
  26201. <div class="example">
  26202. <pre class="example-preformatted">ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay -
  26203. </pre></div>
  26204. <p>&quot;sdl2&quot; can be used as alias for &quot;sdl&quot;.
  26205. </p>
  26206. <p>This output device allows one to show a video stream in an SDL
  26207. window. Only one SDL window is allowed per application, so you can
  26208. have only one instance of this output device in an application.
  26209. </p>
  26210. <p>To enable this output device you need libsdl installed on your system
  26211. when configuring your build.
  26212. </p>
  26213. <p>For more information about SDL, check:
  26214. <a class="url" href="http://www.libsdl.org/">http://www.libsdl.org/</a>
  26215. </p>
  26216. <ul class="mini-toc">
  26217. <li><a href="#Options-109" accesskey="1">Options</a></li>
  26218. <li><a href="#Interactive-commands" accesskey="2">Interactive commands</a></li>
  26219. <li><a href="#Examples-40" accesskey="3">Examples</a></li>
  26220. </ul>
  26221. <div class="subsection-level-extent" id="Options-109">
  26222. <h4 class="subsection"><span>27.9.1 Options<a class="copiable-link" href="#Options-109"> &para;</a></span></h4>
  26223. <dl class="table">
  26224. <dt><samp class="option">window_borderless</samp></dt>
  26225. <dd><p>Set SDL window border off.
  26226. Default value is 0 (enable window border).
  26227. </p>
  26228. </dd>
  26229. <dt><samp class="option">window_enable_quit</samp></dt>
  26230. <dd><p>Enable quit action (using window button or keyboard key)
  26231. when non-zero value is provided.
  26232. Default value is 1 (enable quit action).
  26233. </p>
  26234. </dd>
  26235. <dt><samp class="option">window_fullscreen</samp></dt>
  26236. <dd><p>Set fullscreen mode when non-zero value is provided.
  26237. Default value is zero.
  26238. </p>
  26239. </dd>
  26240. <dt><samp class="option">window_size</samp></dt>
  26241. <dd><p>Set the SDL window size, can be a string of the form
  26242. <var class="var">width</var>x<var class="var">height</var> or a video size abbreviation.
  26243. If not specified it defaults to the size of the input video,
  26244. downscaled according to the aspect ratio.
  26245. </p>
  26246. </dd>
  26247. <dt><samp class="option">window_title</samp></dt>
  26248. <dd><p>Set the SDL window title, if not specified default to the filename
  26249. specified for the output device.
  26250. </p>
  26251. </dd>
  26252. <dt><samp class="option">window_x</samp></dt>
  26253. <dt><samp class="option">window_y</samp></dt>
  26254. <dd><p>Set the position of the window on the screen.
  26255. </p></dd>
  26256. </dl>
  26257. </div>
  26258. <div class="subsection-level-extent" id="Interactive-commands">
  26259. <h4 class="subsection"><span>27.9.2 Interactive commands<a class="copiable-link" href="#Interactive-commands"> &para;</a></span></h4>
  26260. <p>The window created by the device can be controlled through the
  26261. following interactive commands.
  26262. </p>
  26263. <dl class="table">
  26264. <dt><kbd class="key">q, ESC</kbd></dt>
  26265. <dd><p>Quit the device immediately.
  26266. </p></dd>
  26267. </dl>
  26268. </div>
  26269. <div class="subsection-level-extent" id="Examples-40">
  26270. <h4 class="subsection"><span>27.9.3 Examples<a class="copiable-link" href="#Examples-40"> &para;</a></span></h4>
  26271. <p>The following command shows the <code class="command">ffmpeg</code> output is an
  26272. SDL window, forcing its size to the qcif format:
  26273. </p><div class="example">
  26274. <pre class="example-preformatted">ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
  26275. </pre></div>
  26276. </div>
  26277. </div>
  26278. <div class="section-level-extent" id="sndio-1">
  26279. <h3 class="section"><span>27.10 sndio<a class="copiable-link" href="#sndio-1"> &para;</a></span></h3>
  26280. <p>sndio audio output device.
  26281. </p>
  26282. </div>
  26283. <div class="section-level-extent" id="v4l2">
  26284. <h3 class="section"><span>27.11 v4l2<a class="copiable-link" href="#v4l2"> &para;</a></span></h3>
  26285. <p>Video4Linux2 output device.
  26286. </p>
  26287. </div>
  26288. <div class="section-level-extent" id="xv">
  26289. <h3 class="section"><span>27.12 xv<a class="copiable-link" href="#xv"> &para;</a></span></h3>
  26290. <p>XV (XVideo) output device.
  26291. </p>
  26292. <p>This output device allows one to show a video stream in a X Window System
  26293. window.
  26294. </p>
  26295. <ul class="mini-toc">
  26296. <li><a href="#Options-110" accesskey="1">Options</a></li>
  26297. <li><a href="#Examples-41" accesskey="2">Examples</a></li>
  26298. </ul>
  26299. <div class="subsection-level-extent" id="Options-110">
  26300. <h4 class="subsection"><span>27.12.1 Options<a class="copiable-link" href="#Options-110"> &para;</a></span></h4>
  26301. <dl class="table">
  26302. <dt><samp class="option">display_name</samp></dt>
  26303. <dd><p>Specify the hardware display name, which determines the display and
  26304. communications domain to be used.
  26305. </p>
  26306. <p>The display name or DISPLAY environment variable can be a string in
  26307. the format <var class="var">hostname</var>[:<var class="var">number</var>[.<var class="var">screen_number</var>]].
  26308. </p>
  26309. <p><var class="var">hostname</var> specifies the name of the host machine on which the
  26310. display is physically attached. <var class="var">number</var> specifies the number of
  26311. the display server on that host machine. <var class="var">screen_number</var> specifies
  26312. the screen to be used on that server.
  26313. </p>
  26314. <p>If unspecified, it defaults to the value of the DISPLAY environment
  26315. variable.
  26316. </p>
  26317. <p>For example, <code class="code">dual-headed:0.1</code> would specify screen 1 of display
  26318. 0 on the machine named &ldquo;dual-headed&rdquo;.
  26319. </p>
  26320. <p>Check the X11 specification for more detailed information about the
  26321. display name format.
  26322. </p>
  26323. </dd>
  26324. <dt><samp class="option">window_id</samp></dt>
  26325. <dd><p>When set to non-zero value then device doesn&rsquo;t create new window,
  26326. but uses existing one with provided <var class="var">window_id</var>. By default
  26327. this options is set to zero and device creates its own window.
  26328. </p>
  26329. </dd>
  26330. <dt><samp class="option">window_size</samp></dt>
  26331. <dd><p>Set the created window size, can be a string of the form
  26332. <var class="var">width</var>x<var class="var">height</var> or a video size abbreviation. If not
  26333. specified it defaults to the size of the input video.
  26334. Ignored when <var class="var">window_id</var> is set.
  26335. </p>
  26336. </dd>
  26337. <dt><samp class="option">window_x</samp></dt>
  26338. <dt><samp class="option">window_y</samp></dt>
  26339. <dd><p>Set the X and Y window offsets for the created window. They are both
  26340. set to 0 by default. The values may be ignored by the window manager.
  26341. Ignored when <var class="var">window_id</var> is set.
  26342. </p>
  26343. </dd>
  26344. <dt><samp class="option">window_title</samp></dt>
  26345. <dd><p>Set the window title, if not specified default to the filename
  26346. specified for the output device. Ignored when <var class="var">window_id</var> is set.
  26347. </p></dd>
  26348. </dl>
  26349. <p>For more information about XVideo see <a class="url" href="http://www.x.org/">http://www.x.org/</a>.
  26350. </p>
  26351. </div>
  26352. <div class="subsection-level-extent" id="Examples-41">
  26353. <h4 class="subsection"><span>27.12.2 Examples<a class="copiable-link" href="#Examples-41"> &para;</a></span></h4>
  26354. <ul class="itemize mark-bullet">
  26355. <li>Decode, display and encode video input with <code class="command">ffmpeg</code> at the
  26356. same time:
  26357. <div class="example">
  26358. <pre class="example-preformatted">ffmpeg -i INPUT OUTPUT -f xv display
  26359. </pre></div>
  26360. </li><li>Decode and display the input video to multiple X11 windows:
  26361. <div class="example">
  26362. <pre class="example-preformatted">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  26363. </pre></div>
  26364. </li></ul>
  26365. </div>
  26366. </div>
  26367. </div>
  26368. <div class="chapter-level-extent" id="Resampler-Options">
  26369. <h2 class="chapter"><span>28 Resampler Options<a class="copiable-link" href="#Resampler-Options"> &para;</a></span></h2>
  26370. <p>The audio resampler supports the following named options.
  26371. </p>
  26372. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  26373. FFmpeg tools, <var class="var">option</var>=<var class="var">value</var> for the aresample filter,
  26374. by setting the value explicitly in the
  26375. <code class="code">SwrContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API for
  26376. programmatic use.
  26377. </p>
  26378. <dl class="table">
  26379. <dt><samp class="option">uchl, used_chlayout</samp></dt>
  26380. <dd><p>Set used input channel layout. Default is unset. This option is
  26381. only used for special remapping.
  26382. </p>
  26383. </dd>
  26384. <dt><samp class="option">isr, in_sample_rate</samp></dt>
  26385. <dd><p>Set the input sample rate. Default value is 0.
  26386. </p>
  26387. </dd>
  26388. <dt><samp class="option">osr, out_sample_rate</samp></dt>
  26389. <dd><p>Set the output sample rate. Default value is 0.
  26390. </p>
  26391. </dd>
  26392. <dt><samp class="option">isf, in_sample_fmt</samp></dt>
  26393. <dd><p>Specify the input sample format. It is set by default to <code class="code">none</code>.
  26394. </p>
  26395. </dd>
  26396. <dt><samp class="option">osf, out_sample_fmt</samp></dt>
  26397. <dd><p>Specify the output sample format. It is set by default to <code class="code">none</code>.
  26398. </p>
  26399. </dd>
  26400. <dt><samp class="option">tsf, internal_sample_fmt</samp></dt>
  26401. <dd><p>Set the internal sample format. Default value is <code class="code">none</code>.
  26402. This will automatically be chosen when it is not explicitly set.
  26403. </p>
  26404. </dd>
  26405. <dt><samp class="option">ichl, in_chlayout</samp></dt>
  26406. <dt><samp class="option">ochl, out_chlayout</samp></dt>
  26407. <dd><p>Set the input/output channel layout.
  26408. </p>
  26409. <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>
  26410. for the required syntax.
  26411. </p>
  26412. </dd>
  26413. <dt><samp class="option">clev, center_mix_level</samp></dt>
  26414. <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
  26415. in the interval [-32,32].
  26416. </p>
  26417. </dd>
  26418. <dt><samp class="option">slev, surround_mix_level</samp></dt>
  26419. <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
  26420. be in the interval [-32,32].
  26421. </p>
  26422. </dd>
  26423. <dt><samp class="option">lfe_mix_level</samp></dt>
  26424. <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
  26425. LFE output. It is a value expressed in deciBel, and must
  26426. be in the interval [-32,32].
  26427. </p>
  26428. </dd>
  26429. <dt><samp class="option">rmvol, rematrix_volume</samp></dt>
  26430. <dd><p>Set rematrix volume. Default value is 1.0.
  26431. </p>
  26432. </dd>
  26433. <dt><samp class="option">rematrix_maxval</samp></dt>
  26434. <dd><p>Set maximum output value for rematrixing.
  26435. This can be used to prevent clipping vs. preventing volume reduction.
  26436. A value of 1.0 prevents clipping.
  26437. </p>
  26438. </dd>
  26439. <dt><samp class="option">flags, swr_flags</samp></dt>
  26440. <dd><p>Set flags used by the converter. Default value is 0.
  26441. </p>
  26442. <p>It supports the following individual flags:
  26443. </p><dl class="table">
  26444. <dt><samp class="option">res</samp></dt>
  26445. <dd><p>force resampling, this flag forces resampling to be used even when the
  26446. input and output sample rates match.
  26447. </p></dd>
  26448. </dl>
  26449. </dd>
  26450. <dt><samp class="option">dither_scale</samp></dt>
  26451. <dd><p>Set the dither scale. Default value is 1.
  26452. </p>
  26453. </dd>
  26454. <dt><samp class="option">dither_method</samp></dt>
  26455. <dd><p>Set dither method. Default value is 0.
  26456. </p>
  26457. <p>Supported values:
  26458. </p><dl class="table">
  26459. <dt>&lsquo;<samp class="samp">rectangular</samp>&rsquo;</dt>
  26460. <dd><p>select rectangular dither
  26461. </p></dd>
  26462. <dt>&lsquo;<samp class="samp">triangular</samp>&rsquo;</dt>
  26463. <dd><p>select triangular dither
  26464. </p></dd>
  26465. <dt>&lsquo;<samp class="samp">triangular_hp</samp>&rsquo;</dt>
  26466. <dd><p>select triangular dither with high pass
  26467. </p></dd>
  26468. <dt>&lsquo;<samp class="samp">lipshitz</samp>&rsquo;</dt>
  26469. <dd><p>select Lipshitz noise shaping dither.
  26470. </p></dd>
  26471. <dt>&lsquo;<samp class="samp">shibata</samp>&rsquo;</dt>
  26472. <dd><p>select Shibata noise shaping dither.
  26473. </p></dd>
  26474. <dt>&lsquo;<samp class="samp">low_shibata</samp>&rsquo;</dt>
  26475. <dd><p>select low Shibata noise shaping dither.
  26476. </p></dd>
  26477. <dt>&lsquo;<samp class="samp">high_shibata</samp>&rsquo;</dt>
  26478. <dd><p>select high Shibata noise shaping dither.
  26479. </p></dd>
  26480. <dt>&lsquo;<samp class="samp">f_weighted</samp>&rsquo;</dt>
  26481. <dd><p>select f-weighted noise shaping dither
  26482. </p></dd>
  26483. <dt>&lsquo;<samp class="samp">modified_e_weighted</samp>&rsquo;</dt>
  26484. <dd><p>select modified-e-weighted noise shaping dither
  26485. </p></dd>
  26486. <dt>&lsquo;<samp class="samp">improved_e_weighted</samp>&rsquo;</dt>
  26487. <dd><p>select improved-e-weighted noise shaping dither
  26488. </p>
  26489. </dd>
  26490. </dl>
  26491. </dd>
  26492. <dt><samp class="option">resampler</samp></dt>
  26493. <dd><p>Set resampling engine. Default value is swr.
  26494. </p>
  26495. <p>Supported values:
  26496. </p><dl class="table">
  26497. <dt>&lsquo;<samp class="samp">swr</samp>&rsquo;</dt>
  26498. <dd><p>select the native SW Resampler; filter options precision and cheby are not
  26499. applicable in this case.
  26500. </p></dd>
  26501. <dt>&lsquo;<samp class="samp">soxr</samp>&rsquo;</dt>
  26502. <dd><p>select the SoX Resampler (where available); compensation, and filter options
  26503. filter_size, phase_shift, exact_rational, filter_type &amp; kaiser_beta, are not
  26504. applicable in this case.
  26505. </p></dd>
  26506. </dl>
  26507. </dd>
  26508. <dt><samp class="option">filter_size</samp></dt>
  26509. <dd><p>For swr only, set resampling filter size, default value is 32.
  26510. </p>
  26511. </dd>
  26512. <dt><samp class="option">phase_shift</samp></dt>
  26513. <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
  26514. the interval [0,30].
  26515. </p>
  26516. </dd>
  26517. <dt><samp class="option">linear_interp</samp></dt>
  26518. <dd><p>Use linear interpolation when enabled (the default). Disable it if you want
  26519. to preserve speed instead of quality when exact_rational fails.
  26520. </p>
  26521. </dd>
  26522. <dt><samp class="option">exact_rational</samp></dt>
  26523. <dd><p>For swr only, when enabled, try to use exact phase_count based on input and
  26524. output sample rate. However, if it is larger than <code class="code">1 &lt;&lt; phase_shift</code>,
  26525. the phase_count will be <code class="code">1 &lt;&lt; phase_shift</code> as fallback. Default is enabled.
  26526. </p>
  26527. </dd>
  26528. <dt><samp class="option">cutoff</samp></dt>
  26529. <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  26530. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  26531. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  26532. </p>
  26533. </dd>
  26534. <dt><samp class="option">precision</samp></dt>
  26535. <dd><p>For soxr only, the precision in bits to which the resampled signal will be
  26536. calculated. The default value of 20 (which, with suitable dithering, is
  26537. appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
  26538. value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
  26539. </p>
  26540. </dd>
  26541. <dt><samp class="option">cheby</samp></dt>
  26542. <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
  26543. approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
  26544. </p>
  26545. </dd>
  26546. <dt><samp class="option">async</samp></dt>
  26547. <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
  26548. squeezing, filling and trimming. Setting this to 1 will enable filling and
  26549. trimming, larger values represent the maximum amount in samples that the data
  26550. may be stretched or squeezed for each second.
  26551. Default value is 0, thus no compensation is applied to make the samples match
  26552. the audio timestamps.
  26553. </p>
  26554. </dd>
  26555. <dt><samp class="option">first_pts</samp></dt>
  26556. <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  26557. This allows for padding/trimming at the start of stream. By default, no
  26558. assumption is made about the first frame&rsquo;s expected pts, so no padding or
  26559. trimming is done. For example, this could be set to 0 to pad the beginning with
  26560. silence if an audio stream starts after the video stream or to trim any samples
  26561. with a negative pts due to encoder delay.
  26562. </p>
  26563. </dd>
  26564. <dt><samp class="option">min_comp</samp></dt>
  26565. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  26566. seconds) to trigger stretching/squeezing/filling or trimming of the
  26567. data to make it match the timestamps. The default is that
  26568. stretching/squeezing/filling and trimming is disabled
  26569. (<samp class="option">min_comp</samp> = <code class="code">FLT_MAX</code>).
  26570. </p>
  26571. </dd>
  26572. <dt><samp class="option">min_hard_comp</samp></dt>
  26573. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  26574. seconds) to trigger adding/dropping samples to make it match the
  26575. timestamps. This option effectively is a threshold to select between
  26576. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  26577. all compensation is by default disabled through <samp class="option">min_comp</samp>.
  26578. The default is 0.1.
  26579. </p>
  26580. </dd>
  26581. <dt><samp class="option">comp_duration</samp></dt>
  26582. <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
  26583. to make it match the timestamps. Must be a non-negative double float value,
  26584. default value is 1.0.
  26585. </p>
  26586. </dd>
  26587. <dt><samp class="option">max_soft_comp</samp></dt>
  26588. <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
  26589. match the timestamps. Must be a non-negative double float value, default value
  26590. is 0.
  26591. </p>
  26592. </dd>
  26593. <dt><samp class="option">matrix_encoding</samp></dt>
  26594. <dd><p>Select matrixed stereo encoding.
  26595. </p>
  26596. <p>It accepts the following values:
  26597. </p><dl class="table">
  26598. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  26599. <dd><p>select none
  26600. </p></dd>
  26601. <dt>&lsquo;<samp class="samp">dolby</samp>&rsquo;</dt>
  26602. <dd><p>select Dolby
  26603. </p></dd>
  26604. <dt>&lsquo;<samp class="samp">dplii</samp>&rsquo;</dt>
  26605. <dd><p>select Dolby Pro Logic II
  26606. </p></dd>
  26607. </dl>
  26608. <p>Default value is <code class="code">none</code>.
  26609. </p>
  26610. </dd>
  26611. <dt><samp class="option">filter_type</samp></dt>
  26612. <dd><p>For swr only, select resampling filter type. This only affects resampling
  26613. operations.
  26614. </p>
  26615. <p>It accepts the following values:
  26616. </p><dl class="table">
  26617. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  26618. <dd><p>select cubic
  26619. </p></dd>
  26620. <dt>&lsquo;<samp class="samp">blackman_nuttall</samp>&rsquo;</dt>
  26621. <dd><p>select Blackman Nuttall windowed sinc
  26622. </p></dd>
  26623. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  26624. <dd><p>select Kaiser windowed sinc
  26625. </p></dd>
  26626. </dl>
  26627. </dd>
  26628. <dt><samp class="option">kaiser_beta</samp></dt>
  26629. <dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
  26630. interval [2,16], default value is 9.
  26631. </p>
  26632. </dd>
  26633. <dt><samp class="option">output_sample_bits</samp></dt>
  26634. <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
  26635. interval [0,64], default value is 0, which means it&rsquo;s not used.
  26636. </p>
  26637. </dd>
  26638. </dl>
  26639. <a class="anchor" id="scaler_005foptions"></a></div>
  26640. <div class="chapter-level-extent" id="Scaler-Options">
  26641. <h2 class="chapter"><span>29 Scaler Options<a class="copiable-link" href="#Scaler-Options"> &para;</a></span></h2>
  26642. <p>The video scaler supports the following named options.
  26643. </p>
  26644. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  26645. FFmpeg tools, with a few API-only exceptions noted below.
  26646. For programmatic use, they can be set explicitly in the
  26647. <code class="code">SwsContext</code> options or through the <samp class="file">libavutil/opt.h</samp> API.
  26648. </p>
  26649. <dl class="table">
  26650. <dd>
  26651. <a class="anchor" id="sws_005fflags"></a></dd>
  26652. <dt><samp class="option">sws_flags</samp></dt>
  26653. <dd><p>Set the scaler flags. This is also used to set the scaling
  26654. algorithm. Only a single algorithm should be selected. Default
  26655. value is &lsquo;<samp class="samp">bicubic</samp>&rsquo;.
  26656. </p>
  26657. <p>It accepts the following values:
  26658. </p><dl class="table">
  26659. <dt>&lsquo;<samp class="samp">fast_bilinear</samp>&rsquo;</dt>
  26660. <dd><p>Select fast bilinear scaling algorithm.
  26661. </p>
  26662. </dd>
  26663. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  26664. <dd><p>Select bilinear scaling algorithm.
  26665. </p>
  26666. </dd>
  26667. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  26668. <dd><p>Select bicubic scaling algorithm.
  26669. </p>
  26670. </dd>
  26671. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  26672. <dd><p>Select experimental scaling algorithm.
  26673. </p>
  26674. </dd>
  26675. <dt>&lsquo;<samp class="samp">neighbor</samp>&rsquo;</dt>
  26676. <dd><p>Select nearest neighbor rescaling algorithm.
  26677. </p>
  26678. </dd>
  26679. <dt>&lsquo;<samp class="samp">area</samp>&rsquo;</dt>
  26680. <dd><p>Select averaging area rescaling algorithm.
  26681. </p>
  26682. </dd>
  26683. <dt>&lsquo;<samp class="samp">bicublin</samp>&rsquo;</dt>
  26684. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  26685. chroma components.
  26686. </p>
  26687. </dd>
  26688. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  26689. <dd><p>Select Gaussian rescaling algorithm.
  26690. </p>
  26691. </dd>
  26692. <dt>&lsquo;<samp class="samp">sinc</samp>&rsquo;</dt>
  26693. <dd><p>Select sinc rescaling algorithm.
  26694. </p>
  26695. </dd>
  26696. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  26697. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  26698. changed by setting <code class="code">param0</code>.
  26699. </p>
  26700. </dd>
  26701. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  26702. <dd><p>Select natural bicubic spline rescaling algorithm.
  26703. </p>
  26704. </dd>
  26705. <dt>&lsquo;<samp class="samp">print_info</samp>&rsquo;</dt>
  26706. <dd><p>Enable printing/debug logging.
  26707. </p>
  26708. </dd>
  26709. <dt>&lsquo;<samp class="samp">accurate_rnd</samp>&rsquo;</dt>
  26710. <dd><p>Enable accurate rounding.
  26711. </p>
  26712. </dd>
  26713. <dt>&lsquo;<samp class="samp">full_chroma_int</samp>&rsquo;</dt>
  26714. <dd><p>Enable full chroma interpolation.
  26715. </p>
  26716. </dd>
  26717. <dt>&lsquo;<samp class="samp">full_chroma_inp</samp>&rsquo;</dt>
  26718. <dd><p>Select full chroma input.
  26719. </p>
  26720. </dd>
  26721. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  26722. <dd><p>Enable bitexact output.
  26723. </p></dd>
  26724. </dl>
  26725. </dd>
  26726. <dt><samp class="option">srcw <var class="var">(API only)</var></samp></dt>
  26727. <dd><p>Set source width.
  26728. </p>
  26729. </dd>
  26730. <dt><samp class="option">srch <var class="var">(API only)</var></samp></dt>
  26731. <dd><p>Set source height.
  26732. </p>
  26733. </dd>
  26734. <dt><samp class="option">dstw <var class="var">(API only)</var></samp></dt>
  26735. <dd><p>Set destination width.
  26736. </p>
  26737. </dd>
  26738. <dt><samp class="option">dsth <var class="var">(API only)</var></samp></dt>
  26739. <dd><p>Set destination height.
  26740. </p>
  26741. </dd>
  26742. <dt><samp class="option">src_format <var class="var">(API only)</var></samp></dt>
  26743. <dd><p>Set source pixel format (must be expressed as an integer).
  26744. </p>
  26745. </dd>
  26746. <dt><samp class="option">dst_format <var class="var">(API only)</var></samp></dt>
  26747. <dd><p>Set destination pixel format (must be expressed as an integer).
  26748. </p>
  26749. </dd>
  26750. <dt><samp class="option">src_range <var class="var">(boolean)</var></samp></dt>
  26751. <dd><p>If value is set to <code class="code">1</code>, indicates source is full range. Default value is
  26752. <code class="code">0</code>, which indicates source is limited range.
  26753. </p>
  26754. </dd>
  26755. <dt><samp class="option">dst_range <var class="var">(boolean)</var></samp></dt>
  26756. <dd><p>If value is set to <code class="code">1</code>, enable full range for destination. Default value
  26757. is <code class="code">0</code>, which enables limited range.
  26758. </p>
  26759. <a class="anchor" id="sws_005fparams"></a></dd>
  26760. <dt><samp class="option">param0, param1</samp></dt>
  26761. <dd><p>Set scaling algorithm parameters. The specified values are specific of
  26762. some scaling algorithms and ignored by others. The specified values
  26763. are floating point number values.
  26764. </p>
  26765. </dd>
  26766. <dt><samp class="option">sws_dither</samp></dt>
  26767. <dd><p>Set the dithering algorithm. Accepts one of the following
  26768. values. Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  26769. </p>
  26770. <dl class="table">
  26771. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  26772. <dd><p>automatic choice
  26773. </p>
  26774. </dd>
  26775. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  26776. <dd><p>no dithering
  26777. </p>
  26778. </dd>
  26779. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  26780. <dd><p>bayer dither
  26781. </p>
  26782. </dd>
  26783. <dt>&lsquo;<samp class="samp">ed</samp>&rsquo;</dt>
  26784. <dd><p>error diffusion dither
  26785. </p>
  26786. </dd>
  26787. <dt>&lsquo;<samp class="samp">a_dither</samp>&rsquo;</dt>
  26788. <dd><p>arithmetic dither, based using addition
  26789. </p>
  26790. </dd>
  26791. <dt>&lsquo;<samp class="samp">x_dither</samp>&rsquo;</dt>
  26792. <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
  26793. a_dither).
  26794. </p>
  26795. </dd>
  26796. </dl>
  26797. </dd>
  26798. <dt><samp class="option">alphablend</samp></dt>
  26799. <dd><p>Set the alpha blending to use when the input has alpha but the output does not.
  26800. Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  26801. </p>
  26802. <dl class="table">
  26803. <dt>&lsquo;<samp class="samp">uniform_color</samp>&rsquo;</dt>
  26804. <dd><p>Blend onto a uniform background color
  26805. </p>
  26806. </dd>
  26807. <dt>&lsquo;<samp class="samp">checkerboard</samp>&rsquo;</dt>
  26808. <dd><p>Blend onto a checkerboard
  26809. </p>
  26810. </dd>
  26811. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  26812. <dd><p>No blending
  26813. </p>
  26814. </dd>
  26815. </dl>
  26816. </dd>
  26817. </dl>
  26818. </div>
  26819. <div class="chapter-level-extent" id="Filtering-Introduction">
  26820. <h2 class="chapter"><span>30 Filtering Introduction<a class="copiable-link" href="#Filtering-Introduction"> &para;</a></span></h2>
  26821. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  26822. </p>
  26823. <p>In libavfilter, a filter can have multiple inputs and multiple
  26824. outputs.
  26825. To illustrate the sorts of things that are possible, we consider the
  26826. following filtergraph.
  26827. </p>
  26828. <pre class="verbatim"> [main]
  26829. input --&gt; split ---------------------&gt; overlay --&gt; output
  26830. | ^
  26831. |[tmp] [flip]|
  26832. +-----&gt; crop --&gt; vflip -------+
  26833. </pre>
  26834. <p>This filtergraph splits the input stream in two streams, then sends one
  26835. stream through the crop filter and the vflip filter, before merging it
  26836. back with the other stream by overlaying it on top. You can use the
  26837. following command to achieve this:
  26838. </p>
  26839. <div class="example">
  26840. <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
  26841. </pre></div>
  26842. <p>The result will be that the top half of the video is mirrored
  26843. onto the bottom half of the output video.
  26844. </p>
  26845. <p>Filters in the same linear chain are separated by commas, and distinct
  26846. linear chains of filters are separated by semicolons. In our example,
  26847. <var class="var">crop,vflip</var> are in one linear chain, <var class="var">split</var> and
  26848. <var class="var">overlay</var> are separately in another. The points where the linear
  26849. chains join are labelled by names enclosed in square brackets. In the
  26850. example, the split filter generates two outputs that are associated to
  26851. the labels <var class="var">[main]</var> and <var class="var">[tmp]</var>.
  26852. </p>
  26853. <p>The stream sent to the second output of <var class="var">split</var>, labelled as
  26854. <var class="var">[tmp]</var>, is processed through the <var class="var">crop</var> filter, which crops
  26855. away the lower half part of the video, and then vertically flipped. The
  26856. <var class="var">overlay</var> filter takes in input the first unchanged output of the
  26857. split filter (which was labelled as <var class="var">[main]</var>), and overlay on its
  26858. lower half the output generated by the <var class="var">crop,vflip</var> filterchain.
  26859. </p>
  26860. <p>Some filters take in input a list of parameters: they are specified
  26861. after the filter name and an equal sign, and are separated from each other
  26862. by a colon.
  26863. </p>
  26864. <p>There exist so-called <var class="var">source filters</var> that do not have an
  26865. audio/video input, and <var class="var">sink filters</var> that will not have audio/video
  26866. output.
  26867. </p>
  26868. </div>
  26869. <div class="chapter-level-extent" id="graph2dot">
  26870. <h2 class="chapter"><span>31 graph2dot<a class="copiable-link" href="#graph2dot"> &para;</a></span></h2>
  26871. <p>The <samp class="file">graph2dot</samp> program included in the FFmpeg <samp class="file">tools</samp>
  26872. directory can be used to parse a filtergraph description and issue a
  26873. corresponding textual representation in the dot language.
  26874. </p>
  26875. <p>Invoke the command:
  26876. </p><div class="example">
  26877. <pre class="example-preformatted">graph2dot -h
  26878. </pre></div>
  26879. <p>to see how to use <samp class="file">graph2dot</samp>.
  26880. </p>
  26881. <p>You can then pass the dot description to the <samp class="file">dot</samp> program (from
  26882. the graphviz suite of programs) and obtain a graphical representation
  26883. of the filtergraph.
  26884. </p>
  26885. <p>For example the sequence of commands:
  26886. </p><div class="example">
  26887. <pre class="example-preformatted">echo <var class="var">GRAPH_DESCRIPTION</var> | \
  26888. tools/graph2dot -o graph.tmp &amp;&amp; \
  26889. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  26890. display graph.png
  26891. </pre></div>
  26892. <p>can be used to create and display an image representing the graph
  26893. described by the <var class="var">GRAPH_DESCRIPTION</var> string. Note that this string must be
  26894. a complete self-contained graph, with its inputs and outputs explicitly defined.
  26895. For example if your command line is of the form:
  26896. </p><div class="example">
  26897. <pre class="example-preformatted">ffmpeg -i infile -vf scale=640:360 outfile
  26898. </pre></div>
  26899. <p>your <var class="var">GRAPH_DESCRIPTION</var> string will need to be of the form:
  26900. </p><div class="example">
  26901. <pre class="example-preformatted">nullsrc,scale=640:360,nullsink
  26902. </pre></div>
  26903. <p>you may also need to set the <var class="var">nullsrc</var> parameters and add a <var class="var">format</var>
  26904. filter in order to simulate a specific input file.
  26905. </p>
  26906. </div>
  26907. <div class="chapter-level-extent" id="Filtergraph-description">
  26908. <h2 class="chapter"><span>32 Filtergraph description<a class="copiable-link" href="#Filtergraph-description"> &para;</a></span></h2>
  26909. <p>A filtergraph is a directed graph of connected filters. It can contain
  26910. cycles, and there can be multiple links between a pair of
  26911. filters. Each link has one input pad on one side connecting it to one
  26912. filter from which it takes its input, and one output pad on the other
  26913. side connecting it to one filter accepting its output.
  26914. </p>
  26915. <p>Each filter in a filtergraph is an instance of a filter class
  26916. registered in the application, which defines the features and the
  26917. number of input and output pads of the filter.
  26918. </p>
  26919. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  26920. output pads is called a &quot;sink&quot;.
  26921. </p>
  26922. <a class="anchor" id="Filtergraph-syntax"></a><ul class="mini-toc">
  26923. <li><a href="#Filtergraph-syntax-1" accesskey="1">Filtergraph syntax</a></li>
  26924. <li><a href="#Notes-on-filtergraph-escaping" accesskey="2">Notes on filtergraph escaping</a></li>
  26925. </ul>
  26926. <div class="section-level-extent" id="Filtergraph-syntax-1">
  26927. <h3 class="section"><span>32.1 Filtergraph syntax<a class="copiable-link" href="#Filtergraph-syntax-1"> &para;</a></span></h3>
  26928. <p>A filtergraph has a textual representation, which is recognized by the
  26929. <samp class="option">-filter</samp>/<samp class="option">-vf</samp>/<samp class="option">-af</samp> and
  26930. <samp class="option">-filter_complex</samp> options in <code class="command">ffmpeg</code> and
  26931. <samp class="option">-vf</samp>/<samp class="option">-af</samp> in <code class="command">ffplay</code>, and by the
  26932. <code class="code">avfilter_graph_parse_ptr()</code> function defined in
  26933. <samp class="file">libavfilter/avfilter.h</samp>.
  26934. </p>
  26935. <p>A filterchain consists of a sequence of connected filters, each one
  26936. connected to the previous one in the sequence. A filterchain is
  26937. represented by a list of &quot;,&quot;-separated filter descriptions.
  26938. </p>
  26939. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  26940. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  26941. descriptions.
  26942. </p>
  26943. <p>A filter is represented by a string of the form:
  26944. [<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>]
  26945. </p>
  26946. <p><var class="var">filter_name</var> is the name of the filter class of which the
  26947. described filter is an instance of, and has to be the name of one of
  26948. the filter classes registered in the program optionally followed by &quot;@<var class="var">id</var>&quot;.
  26949. The name of the filter class is optionally followed by a string
  26950. &quot;=<var class="var">arguments</var>&quot;.
  26951. </p>
  26952. <p><var class="var">arguments</var> is a string which contains the parameters used to
  26953. initialize the filter instance. It may have one of two forms:
  26954. </p><ul class="itemize mark-bullet">
  26955. <li>A &rsquo;:&rsquo;-separated list of <var class="var">key=value</var> pairs.
  26956. </li><li>A &rsquo;:&rsquo;-separated list of <var class="var">value</var>. In this case, the keys are assumed to be
  26957. the option names in the order they are declared. E.g. the <code class="code">fade</code> filter
  26958. declares three options in this order &ndash; <samp class="option">type</samp>, <samp class="option">start_frame</samp> and
  26959. <samp class="option">nb_frames</samp>. Then the parameter list <var class="var">in:0:30</var> means that the value
  26960. <var class="var">in</var> is assigned to the option <samp class="option">type</samp>, <var class="var">0</var> to
  26961. <samp class="option">start_frame</samp> and <var class="var">30</var> to <samp class="option">nb_frames</samp>.
  26962. </li><li>A &rsquo;:&rsquo;-separated list of mixed direct <var class="var">value</var> and long <var class="var">key=value</var>
  26963. pairs. The direct <var class="var">value</var> must precede the <var class="var">key=value</var> pairs, and
  26964. follow the same constraints order of the previous point. The following
  26965. <var class="var">key=value</var> pairs can be set in any preferred order.
  26966. </li></ul>
  26967. <p>If the option value itself is a list of items (e.g. the <code class="code">format</code> filter
  26968. takes a list of pixel formats), the items in the list are usually separated by
  26969. &lsquo;<samp class="samp">|</samp>&rsquo;.
  26970. </p>
  26971. <p>The list of arguments can be quoted using the character &lsquo;<samp class="samp">'</samp>&rsquo; as initial
  26972. and ending mark, and the character &lsquo;<samp class="samp">\</samp>&rsquo; for escaping the characters
  26973. within the quoted text; otherwise the argument string is considered
  26974. terminated when the next special character (belonging to the set
  26975. &lsquo;<samp class="samp">[]=;,</samp>&rsquo;) is encountered.
  26976. </p>
  26977. <p>A special syntax implemented in the <code class="command">ffmpeg</code> CLI tool allows loading
  26978. option values from files. This is done be prepending a slash &rsquo;/&rsquo; to the option
  26979. name, then the supplied value is interpreted as a path from which the actual
  26980. value is loaded. E.g.
  26981. </p><div class="example">
  26982. <pre class="example-preformatted">ffmpeg -i &lt;INPUT&gt; -vf drawtext=/text=/tmp/some_text &lt;OUTPUT&gt;
  26983. </pre></div>
  26984. <p>will load the text to be drawn from <samp class="file">/tmp/some_text</samp>. API users wishing to
  26985. implement a similar feature should use the <code class="code">avfilter_graph_segment_*()</code>
  26986. functions together with custom IO code.
  26987. </p>
  26988. <p>The name and arguments of the filter are optionally preceded and
  26989. followed by a list of link labels.
  26990. A link label allows one to name a link and associate it to a filter output
  26991. or input pad. The preceding labels <var class="var">in_link_1</var>
  26992. ... <var class="var">in_link_N</var>, are associated to the filter input pads,
  26993. the following labels <var class="var">out_link_1</var> ... <var class="var">out_link_M</var>, are
  26994. associated to the output pads.
  26995. </p>
  26996. <p>When two link labels with the same name are found in the
  26997. filtergraph, a link between the corresponding input and output pad is
  26998. created.
  26999. </p>
  27000. <p>If an output pad is not labelled, it is linked by default to the first
  27001. unlabelled input pad of the next filter in the filterchain.
  27002. For example in the filterchain
  27003. </p><div class="example">
  27004. <pre class="example-preformatted">nullsrc, split[L1], [L2]overlay, nullsink
  27005. </pre></div>
  27006. <p>the split filter instance has two output pads, and the overlay filter
  27007. instance two input pads. The first output pad of split is labelled
  27008. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  27009. output pad of split is linked to the second input pad of overlay,
  27010. which are both unlabelled.
  27011. </p>
  27012. <p>In a filter description, if the input label of the first filter is not
  27013. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  27014. specified, &quot;out&quot; is assumed.
  27015. </p>
  27016. <p>In a complete filterchain all the unlabelled filter input and output
  27017. pads must be connected. A filtergraph is considered valid if all the
  27018. filter input and output pads of all the filterchains are connected.
  27019. </p>
  27020. <p>Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens
  27021. in the filtergraph specification are ignored. This means that the filtergraph
  27022. can be expressed using empty lines and spaces to improve redability.
  27023. </p>
  27024. <p>For example, the filtergraph:
  27025. </p><div class="example">
  27026. <pre class="example-preformatted">testsrc,split[L1],hflip[L2];[L1][L2] hstack
  27027. </pre></div>
  27028. <p>can be represented as:
  27029. </p><div class="example">
  27030. <pre class="example-preformatted">testsrc,
  27031. split [L1], hflip [L2];
  27032. [L1][L2] hstack
  27033. </pre></div>
  27034. <p>Libavfilter will automatically insert <a class="ref" href="#scale">scale</a> filters where format
  27035. conversion is required. It is possible to specify swscale flags
  27036. for those automatically inserted scalers by prepending
  27037. <code class="code">sws_flags=<var class="var">flags</var>;</code>
  27038. to the filtergraph description.
  27039. </p>
  27040. <p>Here is a BNF description of the filtergraph syntax:
  27041. </p><div class="example">
  27042. <pre class="example-preformatted"><var class="var">NAME</var> ::= sequence of alphanumeric characters and '_'
  27043. <var class="var">FILTER_NAME</var> ::= <var class="var">NAME</var>[&quot;@&quot;<var class="var">NAME</var>]
  27044. <var class="var">LINKLABEL</var> ::= &quot;[&quot; <var class="var">NAME</var> &quot;]&quot;
  27045. <var class="var">LINKLABELS</var> ::= <var class="var">LINKLABEL</var> [<var class="var">LINKLABELS</var>]
  27046. <var class="var">FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  27047. <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>]
  27048. <var class="var">FILTERCHAIN</var> ::= <var class="var">FILTER</var> [,<var class="var">FILTERCHAIN</var>]
  27049. <var class="var">FILTERGRAPH</var> ::= [sws_flags=<var class="var">flags</var>;] <var class="var">FILTERCHAIN</var> [;<var class="var">FILTERGRAPH</var>]
  27050. </pre></div>
  27051. <a class="anchor" id="filtergraph-escaping"></a></div>
  27052. <div class="section-level-extent" id="Notes-on-filtergraph-escaping">
  27053. <h3 class="section"><span>32.2 Notes on filtergraph escaping<a class="copiable-link" href="#Notes-on-filtergraph-escaping"> &para;</a></span></h3>
  27054. <p>Filtergraph description composition entails several levels of
  27055. escaping. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  27056. section in the ffmpeg-utils(1) manual</a> for more
  27057. information about the employed escaping procedure.
  27058. </p>
  27059. <p>A first level escaping affects the content of each filter option
  27060. value, which may contain the special character <code class="code">:</code> used to
  27061. separate values, or one of the escaping characters <code class="code">\'</code>.
  27062. </p>
  27063. <p>A second level escaping affects the whole filter description, which
  27064. may contain the escaping characters <code class="code">\'</code> or the special
  27065. characters <code class="code">[],;</code> used by the filtergraph description.
  27066. </p>
  27067. <p>Finally, when you specify a filtergraph on a shell commandline, you
  27068. need to perform a third level escaping for the shell special
  27069. characters contained within it.
  27070. </p>
  27071. <p>For example, consider the following string to be embedded in
  27072. the <a class="ref" href="#drawtext">drawtext</a> filter description <samp class="option">text</samp> value:
  27073. </p><div class="example">
  27074. <pre class="example-preformatted">this is a 'string': may contain one, or more, special characters
  27075. </pre></div>
  27076. <p>This string contains the <code class="code">'</code> special escaping character, and the
  27077. <code class="code">:</code> special character, so it needs to be escaped in this way:
  27078. </p><div class="example">
  27079. <pre class="example-preformatted">text=this is a \'string\'\: may contain one, or more, special characters
  27080. </pre></div>
  27081. <p>A second level of escaping is required when embedding the filter
  27082. description in a filtergraph description, in order to escape all the
  27083. filtergraph special characters. Thus the example above becomes:
  27084. </p><div class="example">
  27085. <pre class="example-preformatted">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  27086. </pre></div>
  27087. <p>(note that in addition to the <code class="code">\'</code> escaping special characters,
  27088. also <code class="code">,</code> needs to be escaped).
  27089. </p>
  27090. <p>Finally an additional level of escaping is needed when writing the
  27091. filtergraph description in a shell command, which depends on the
  27092. escaping rules of the adopted shell. For example, assuming that
  27093. <code class="code">\</code> is special and needs to be escaped with another <code class="code">\</code>, the
  27094. previous string will finally result in:
  27095. </p><div class="example">
  27096. <pre class="example-preformatted">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  27097. </pre></div>
  27098. <p>In order to avoid cumbersome escaping when using a commandline tool accepting a
  27099. filter specification as input, it is advisable to avoid direct inclusion of the
  27100. filter or options specification in the shell.
  27101. </p>
  27102. <p>For example, in case of the <a class="ref" href="#drawtext">drawtext filter</a>, you might prefer to
  27103. use the <samp class="option">textfile</samp> option in place of <samp class="option">text</samp> to specify the text
  27104. to render.
  27105. </p>
  27106. </div>
  27107. </div>
  27108. <div class="chapter-level-extent" id="Timeline-editing">
  27109. <h2 class="chapter"><span>33 Timeline editing<a class="copiable-link" href="#Timeline-editing"> &para;</a></span></h2>
  27110. <p>Some filters support a generic <samp class="option">enable</samp> option. For the filters
  27111. supporting timeline editing, this option can be set to an expression which is
  27112. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  27113. the filter will be enabled, otherwise the frame will be sent unchanged to the
  27114. next filter in the filtergraph.
  27115. </p>
  27116. <p>The expression accepts the following values:
  27117. </p><dl class="table">
  27118. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  27119. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  27120. </p>
  27121. </dd>
  27122. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  27123. <dd><p>sequential number of the input frame, starting from 0
  27124. </p>
  27125. </dd>
  27126. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  27127. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated, do
  27128. not use
  27129. </p>
  27130. </dd>
  27131. <dt>&lsquo;<samp class="samp">w</samp>&rsquo;</dt>
  27132. <dt>&lsquo;<samp class="samp">h</samp>&rsquo;</dt>
  27133. <dd><p>width and height of the input frame if video
  27134. </p></dd>
  27135. </dl>
  27136. <p>Additionally, these filters support an <samp class="option">enable</samp> command that can be used
  27137. to re-define the expression.
  27138. </p>
  27139. <p>Like any other filtering option, the <samp class="option">enable</samp> option follows the same
  27140. rules.
  27141. </p>
  27142. <p>For example, to enable a blur filter (<a class="ref" href="#smartblur">smartblur</a>) from 10 seconds to 3
  27143. minutes, and a <a class="ref" href="#curves">curves</a> filter starting at 3 seconds:
  27144. </p><div class="example">
  27145. <pre class="example-preformatted">smartblur = enable='between(t,10,3*60)',
  27146. curves = enable='gte(t,3)' : preset=cross_process
  27147. </pre></div>
  27148. <p>See <code class="code">ffmpeg -filters</code> to view which filters have timeline support.
  27149. </p>
  27150. <a class="anchor" id="commands"></a></div>
  27151. <div class="chapter-level-extent" id="Changing-options-at-runtime-with-a-command">
  27152. <h2 class="chapter"><span>34 Changing options at runtime with a command<a class="copiable-link" href="#Changing-options-at-runtime-with-a-command"> &para;</a></span></h2>
  27153. <p>Some options can be changed during the operation of the filter using
  27154. a command. These options are marked &rsquo;T&rsquo; on the output of
  27155. <code class="command">ffmpeg</code> <samp class="option">-h filter=&lt;name of filter&gt;</samp>.
  27156. The name of the command is the name of the option and the argument is
  27157. the new value.
  27158. </p>
  27159. <a class="anchor" id="framesync"></a></div>
  27160. <div class="chapter-level-extent" id="Options-for-filters-with-several-inputs-_0028framesync_0029">
  27161. <h2 class="chapter"><span>35 Options for filters with several inputs (framesync)<a class="copiable-link" href="#Options-for-filters-with-several-inputs-_0028framesync_0029"> &para;</a></span></h2>
  27162. <p>Some filters with several inputs support a common set of options.
  27163. These options can only be set by name, not with the short notation.
  27164. </p>
  27165. <dl class="table">
  27166. <dt><samp class="option">eof_action</samp></dt>
  27167. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  27168. one of the following values:
  27169. </p>
  27170. <dl class="table">
  27171. <dt><samp class="option">repeat</samp></dt>
  27172. <dd><p>Repeat the last frame (the default).
  27173. </p></dd>
  27174. <dt><samp class="option">endall</samp></dt>
  27175. <dd><p>End both streams.
  27176. </p></dd>
  27177. <dt><samp class="option">pass</samp></dt>
  27178. <dd><p>Pass the main input through.
  27179. </p></dd>
  27180. </dl>
  27181. </dd>
  27182. <dt><samp class="option">shortest</samp></dt>
  27183. <dd><p>If set to 1, force the output to terminate when the shortest input
  27184. terminates. Default value is 0.
  27185. </p>
  27186. </dd>
  27187. <dt><samp class="option">repeatlast</samp></dt>
  27188. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  27189. until the end of the primary stream. A value of 0 disables this behavior.
  27190. Default value is 1.
  27191. </p>
  27192. </dd>
  27193. <dt><samp class="option">ts_sync_mode</samp></dt>
  27194. <dd><p>How strictly to sync streams based on secondary input timestamps; it accepts
  27195. one of the following values:
  27196. </p>
  27197. <dl class="table">
  27198. <dt><samp class="option">default</samp></dt>
  27199. <dd><p>Frame from secondary input with the nearest lower or equal timestamp to the
  27200. primary input frame.
  27201. </p></dd>
  27202. <dt><samp class="option">nearest</samp></dt>
  27203. <dd><p>Frame from secondary input with the absolute nearest timestamp to the primary
  27204. input frame.
  27205. </p></dd>
  27206. </dl>
  27207. </dd>
  27208. </dl>
  27209. </div>
  27210. <div class="chapter-level-extent" id="Audio-Filters">
  27211. <h2 class="chapter"><span>36 Audio Filters<a class="copiable-link" href="#Audio-Filters"> &para;</a></span></h2>
  27212. <p>When you configure your FFmpeg build, you can disable any of the
  27213. existing filters using <code class="code">--disable-filters</code>.
  27214. The configure output will show the audio filters included in your
  27215. build.
  27216. </p>
  27217. <p>Below is a description of the currently available audio filters.
  27218. </p>
  27219. <ul class="mini-toc">
  27220. <li><a href="#aap" accesskey="1">aap</a></li>
  27221. <li><a href="#acompressor" accesskey="2">acompressor</a></li>
  27222. <li><a href="#acontrast" accesskey="3">acontrast</a></li>
  27223. <li><a href="#acopy" accesskey="4">acopy</a></li>
  27224. <li><a href="#acrossfade" accesskey="5">acrossfade</a></li>
  27225. <li><a href="#acrossover" accesskey="6">acrossover</a></li>
  27226. <li><a href="#acrusher" accesskey="7">acrusher</a></li>
  27227. <li><a href="#acue" accesskey="8">acue</a></li>
  27228. <li><a href="#adeclick" accesskey="9">adeclick</a></li>
  27229. <li><a href="#adeclip">adeclip</a></li>
  27230. <li><a href="#adecorrelate">adecorrelate</a></li>
  27231. <li><a href="#adelay">adelay</a></li>
  27232. <li><a href="#adenorm">adenorm</a></li>
  27233. <li><a href="#aderivative_002c-aintegral">aderivative, aintegral</a></li>
  27234. <li><a href="#adrc">adrc</a></li>
  27235. <li><a href="#adynamicequalizer">adynamicequalizer</a></li>
  27236. <li><a href="#adynamicsmooth">adynamicsmooth</a></li>
  27237. <li><a href="#aecho">aecho</a></li>
  27238. <li><a href="#aemphasis">aemphasis</a></li>
  27239. <li><a href="#aeval">aeval</a></li>
  27240. <li><a href="#aexciter">aexciter</a></li>
  27241. <li><a href="#afade-1">afade</a></li>
  27242. <li><a href="#afftdn">afftdn</a></li>
  27243. <li><a href="#afftfilt">afftfilt</a></li>
  27244. <li><a href="#afir-1">afir</a></li>
  27245. <li><a href="#aformat-1">aformat</a></li>
  27246. <li><a href="#afreqshift">afreqshift</a></li>
  27247. <li><a href="#afwtdn">afwtdn</a></li>
  27248. <li><a href="#agate">agate</a></li>
  27249. <li><a href="#aiir">aiir</a></li>
  27250. <li><a href="#alimiter">alimiter</a></li>
  27251. <li><a href="#allpass">allpass</a></li>
  27252. <li><a href="#aloop">aloop</a></li>
  27253. <li><a href="#amerge-1">amerge</a></li>
  27254. <li><a href="#amix">amix</a></li>
  27255. <li><a href="#amultiply">amultiply</a></li>
  27256. <li><a href="#anequalizer">anequalizer</a></li>
  27257. <li><a href="#anlmdn">anlmdn</a></li>
  27258. <li><a href="#anlmf_002c-anlms">anlmf, anlms</a></li>
  27259. <li><a href="#anull">anull</a></li>
  27260. <li><a href="#apad">apad</a></li>
  27261. <li><a href="#aphaser">aphaser</a></li>
  27262. <li><a href="#aphaseshift">aphaseshift</a></li>
  27263. <li><a href="#apsnr">apsnr</a></li>
  27264. <li><a href="#apsyclip">apsyclip</a></li>
  27265. <li><a href="#apulsator">apulsator</a></li>
  27266. <li><a href="#aresample-1">aresample</a></li>
  27267. <li><a href="#areverse">areverse</a></li>
  27268. <li><a href="#arls">arls</a></li>
  27269. <li><a href="#arnndn">arnndn</a></li>
  27270. <li><a href="#asdr">asdr</a></li>
  27271. <li><a href="#asetnsamples">asetnsamples</a></li>
  27272. <li><a href="#asetrate">asetrate</a></li>
  27273. <li><a href="#ashowinfo">ashowinfo</a></li>
  27274. <li><a href="#asisdr">asisdr</a></li>
  27275. <li><a href="#asoftclip">asoftclip</a></li>
  27276. <li><a href="#aspectralstats">aspectralstats</a></li>
  27277. <li><a href="#asr">asr</a></li>
  27278. <li><a href="#astats-1">astats</a></li>
  27279. <li><a href="#asubboost">asubboost</a></li>
  27280. <li><a href="#asubcut">asubcut</a></li>
  27281. <li><a href="#asupercut">asupercut</a></li>
  27282. <li><a href="#asuperpass">asuperpass</a></li>
  27283. <li><a href="#asuperstop">asuperstop</a></li>
  27284. <li><a href="#atempo">atempo</a></li>
  27285. <li><a href="#atilt">atilt</a></li>
  27286. <li><a href="#atrim">atrim</a></li>
  27287. <li><a href="#axcorrelate">axcorrelate</a></li>
  27288. <li><a href="#bandpass">bandpass</a></li>
  27289. <li><a href="#bandreject">bandreject</a></li>
  27290. <li><a href="#bass_002c-lowshelf">bass, lowshelf</a></li>
  27291. <li><a href="#biquad">biquad</a></li>
  27292. <li><a href="#bs2b">bs2b</a></li>
  27293. <li><a href="#channelmap">channelmap</a></li>
  27294. <li><a href="#channelsplit">channelsplit</a></li>
  27295. <li><a href="#chorus">chorus</a></li>
  27296. <li><a href="#compand">compand</a></li>
  27297. <li><a href="#compensationdelay">compensationdelay</a></li>
  27298. <li><a href="#crossfeed">crossfeed</a></li>
  27299. <li><a href="#crystalizer">crystalizer</a></li>
  27300. <li><a href="#dcshift">dcshift</a></li>
  27301. <li><a href="#deesser">deesser</a></li>
  27302. <li><a href="#dialoguenhance">dialoguenhance</a></li>
  27303. <li><a href="#drmeter">drmeter</a></li>
  27304. <li><a href="#dynaudnorm">dynaudnorm</a></li>
  27305. <li><a href="#earwax">earwax</a></li>
  27306. <li><a href="#equalizer">equalizer</a></li>
  27307. <li><a href="#extrastereo">extrastereo</a></li>
  27308. <li><a href="#firequalizer">firequalizer</a></li>
  27309. <li><a href="#flanger">flanger</a></li>
  27310. <li><a href="#haas">haas</a></li>
  27311. <li><a href="#hdcd">hdcd</a></li>
  27312. <li><a href="#headphone">headphone</a></li>
  27313. <li><a href="#highpass">highpass</a></li>
  27314. <li><a href="#join">join</a></li>
  27315. <li><a href="#ladspa">ladspa</a></li>
  27316. <li><a href="#loudnorm">loudnorm</a></li>
  27317. <li><a href="#lowpass">lowpass</a></li>
  27318. <li><a href="#lv2">lv2</a></li>
  27319. <li><a href="#mcompand">mcompand</a></li>
  27320. <li><a href="#pan-1">pan</a></li>
  27321. <li><a href="#replaygain">replaygain</a></li>
  27322. <li><a href="#resample">resample</a></li>
  27323. <li><a href="#rubberband">rubberband</a></li>
  27324. <li><a href="#sidechaincompress">sidechaincompress</a></li>
  27325. <li><a href="#sidechaingate">sidechaingate</a></li>
  27326. <li><a href="#silencedetect">silencedetect</a></li>
  27327. <li><a href="#silenceremove">silenceremove</a></li>
  27328. <li><a href="#sofalizer">sofalizer</a></li>
  27329. <li><a href="#speechnorm">speechnorm</a></li>
  27330. <li><a href="#stereotools">stereotools</a></li>
  27331. <li><a href="#stereowiden">stereowiden</a></li>
  27332. <li><a href="#superequalizer">superequalizer</a></li>
  27333. <li><a href="#surround">surround</a></li>
  27334. <li><a href="#tiltshelf">tiltshelf</a></li>
  27335. <li><a href="#treble_002c-highshelf">treble, highshelf</a></li>
  27336. <li><a href="#tremolo">tremolo</a></li>
  27337. <li><a href="#vibrato">vibrato</a></li>
  27338. <li><a href="#virtualbass">virtualbass</a></li>
  27339. <li><a href="#volume">volume</a></li>
  27340. <li><a href="#volumedetect">volumedetect</a></li>
  27341. </ul>
  27342. <div class="section-level-extent" id="aap">
  27343. <h3 class="section"><span>36.1 aap<a class="copiable-link" href="#aap"> &para;</a></span></h3>
  27344. <p>Apply Affine Projection algorithm to the first audio stream using the second audio stream.
  27345. </p>
  27346. <p>This adaptive filter is used to estimate unknown audio based on multiple input audio samples.
  27347. Affine projection algorithm can make trade-offs between computation complexity with convergence speed.
  27348. </p>
  27349. <p>A description of the accepted options follows.
  27350. </p>
  27351. <dl class="table">
  27352. <dt><samp class="option">order</samp></dt>
  27353. <dd><p>Set the filter order.
  27354. </p>
  27355. </dd>
  27356. <dt><samp class="option">projection</samp></dt>
  27357. <dd><p>Set the projection order.
  27358. </p>
  27359. </dd>
  27360. <dt><samp class="option">mu</samp></dt>
  27361. <dd><p>Set the filter mu.
  27362. </p>
  27363. </dd>
  27364. <dt><samp class="option">delta</samp></dt>
  27365. <dd><p>Set the coefficient to initialize internal covariance matrix.
  27366. </p>
  27367. </dd>
  27368. <dt><samp class="option">out_mode</samp></dt>
  27369. <dd><p>Set the filter output samples. It accepts the following values:
  27370. </p><dl class="table">
  27371. <dt><samp class="option">i</samp></dt>
  27372. <dd><p>Pass the 1st input.
  27373. </p>
  27374. </dd>
  27375. <dt><samp class="option">d</samp></dt>
  27376. <dd><p>Pass the 2nd input.
  27377. </p>
  27378. </dd>
  27379. <dt><samp class="option">o</samp></dt>
  27380. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  27381. </p>
  27382. </dd>
  27383. <dt><samp class="option">n</samp></dt>
  27384. <dd><p>Pass difference between input, 1st input and error signal estimate.
  27385. </p>
  27386. </dd>
  27387. <dt><samp class="option">e</samp></dt>
  27388. <dd><p>Pass error signal estimated samples.
  27389. </p>
  27390. <p>Default value is <var class="var">o</var>.
  27391. </p></dd>
  27392. </dl>
  27393. </dd>
  27394. <dt><samp class="option">precision</samp></dt>
  27395. <dd><p>Set which precision to use when processing samples.
  27396. </p>
  27397. <dl class="table">
  27398. <dt><samp class="option">auto</samp></dt>
  27399. <dd><p>Auto pick internal sample format depending on other filters.
  27400. </p>
  27401. </dd>
  27402. <dt><samp class="option">float</samp></dt>
  27403. <dd><p>Always use single-floating point precision sample format.
  27404. </p>
  27405. </dd>
  27406. <dt><samp class="option">double</samp></dt>
  27407. <dd><p>Always use double-floating point precision sample format.
  27408. </p></dd>
  27409. </dl>
  27410. </dd>
  27411. </dl>
  27412. </div>
  27413. <div class="section-level-extent" id="acompressor">
  27414. <h3 class="section"><span>36.2 acompressor<a class="copiable-link" href="#acompressor"> &para;</a></span></h3>
  27415. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  27416. Especially modern music is mostly compressed at a high ratio to
  27417. improve the overall loudness. It&rsquo;s done to get the highest attention
  27418. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  27419. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  27420. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  27421. but can also destroy a track completely).
  27422. The right compression is the key to reach a professional sound and is
  27423. the high art of mixing and mastering. Because of its complex settings
  27424. it may take a long time to get the right feeling for this kind of effect.
  27425. </p>
  27426. <p>Compression is done by detecting the volume above a chosen level
  27427. <code class="code">threshold</code> and dividing it by the factor set with <code class="code">ratio</code>.
  27428. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  27429. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  27430. the signal would cause distortion of the waveform the reduction can be
  27431. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  27432. <code class="code">attack</code> determines how long the signal has to rise above the threshold
  27433. before any reduction will occur and <code class="code">release</code> sets the time the signal
  27434. has to fall below the threshold to reduce the reduction again. Shorter signals
  27435. than the chosen attack time will be left untouched.
  27436. The overall reduction of the signal can be made up afterwards with the
  27437. <code class="code">makeup</code> setting. So compressing the peaks of a signal about 6dB and
  27438. raising the makeup to this level results in a signal twice as loud than the
  27439. source. To gain a softer entry in the compression the <code class="code">knee</code> flattens the
  27440. hard edge at the threshold in the range of the chosen decibels.
  27441. </p>
  27442. <p>The filter accepts the following options:
  27443. </p>
  27444. <dl class="table">
  27445. <dt><samp class="option">level_in</samp></dt>
  27446. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  27447. </p>
  27448. </dd>
  27449. <dt><samp class="option">mode</samp></dt>
  27450. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  27451. Default is <code class="code">downward</code>.
  27452. </p>
  27453. </dd>
  27454. <dt><samp class="option">threshold</samp></dt>
  27455. <dd><p>If a signal of stream rises above this level it will affect the gain
  27456. reduction.
  27457. By default it is 0.125. Range is between 0.00097563 and 1.
  27458. </p>
  27459. </dd>
  27460. <dt><samp class="option">ratio</samp></dt>
  27461. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  27462. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  27463. Default is 2. Range is between 1 and 20.
  27464. </p>
  27465. </dd>
  27466. <dt><samp class="option">attack</samp></dt>
  27467. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  27468. reduction starts. Default is 20. Range is between 0.01 and 2000.
  27469. </p>
  27470. </dd>
  27471. <dt><samp class="option">release</samp></dt>
  27472. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  27473. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  27474. </p>
  27475. </dd>
  27476. <dt><samp class="option">makeup</samp></dt>
  27477. <dd><p>Set the amount by how much signal will be amplified after processing.
  27478. Default is 1. Range is from 1 to 64.
  27479. </p>
  27480. </dd>
  27481. <dt><samp class="option">knee</samp></dt>
  27482. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  27483. Default is 2.82843. Range is between 1 and 8.
  27484. </p>
  27485. </dd>
  27486. <dt><samp class="option">link</samp></dt>
  27487. <dd><p>Choose if the <code class="code">average</code> level between all channels of input stream
  27488. or the louder(<code class="code">maximum</code>) channel of input stream affects the
  27489. reduction. Default is <code class="code">average</code>.
  27490. </p>
  27491. </dd>
  27492. <dt><samp class="option">detection</samp></dt>
  27493. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  27494. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mostly smoother.
  27495. </p>
  27496. </dd>
  27497. <dt><samp class="option">mix</samp></dt>
  27498. <dd><p>How much to use compressed signal in output. Default is 1.
  27499. Range is between 0 and 1.
  27500. </p></dd>
  27501. </dl>
  27502. <ul class="mini-toc">
  27503. <li><a href="#Commands" accesskey="1">Commands</a></li>
  27504. </ul>
  27505. <div class="subsection-level-extent" id="Commands">
  27506. <h4 class="subsection"><span>36.2.1 Commands<a class="copiable-link" href="#Commands"> &para;</a></span></h4>
  27507. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27508. </p>
  27509. </div>
  27510. </div>
  27511. <div class="section-level-extent" id="acontrast">
  27512. <h3 class="section"><span>36.3 acontrast<a class="copiable-link" href="#acontrast"> &para;</a></span></h3>
  27513. <p>Simple audio dynamic range compression/expansion filter.
  27514. </p>
  27515. <p>The filter accepts the following options:
  27516. </p>
  27517. <dl class="table">
  27518. <dt><samp class="option">contrast</samp></dt>
  27519. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  27520. </p></dd>
  27521. </dl>
  27522. </div>
  27523. <div class="section-level-extent" id="acopy">
  27524. <h3 class="section"><span>36.4 acopy<a class="copiable-link" href="#acopy"> &para;</a></span></h3>
  27525. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  27526. testing purposes.
  27527. </p>
  27528. </div>
  27529. <div class="section-level-extent" id="acrossfade">
  27530. <h3 class="section"><span>36.5 acrossfade<a class="copiable-link" href="#acrossfade"> &para;</a></span></h3>
  27531. <p>Apply cross fade from one input audio stream to another input audio stream.
  27532. The cross fade is applied for specified duration near the end of first stream.
  27533. </p>
  27534. <p>The filter accepts the following options:
  27535. </p>
  27536. <dl class="table">
  27537. <dt><samp class="option">nb_samples, ns</samp></dt>
  27538. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  27539. At the end of the cross fade effect the first input audio will be completely
  27540. silent. Default is 44100.
  27541. </p>
  27542. </dd>
  27543. <dt><samp class="option">duration, d</samp></dt>
  27544. <dd><p>Specify the duration of the cross fade effect. See
  27545. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  27546. for the accepted syntax.
  27547. By default the duration is determined by <var class="var">nb_samples</var>.
  27548. If set this option is used instead of <var class="var">nb_samples</var>.
  27549. </p>
  27550. </dd>
  27551. <dt><samp class="option">overlap, o</samp></dt>
  27552. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  27553. </p>
  27554. </dd>
  27555. <dt><samp class="option">curve1</samp></dt>
  27556. <dd><p>Set curve for cross fade transition for first stream.
  27557. </p>
  27558. </dd>
  27559. <dt><samp class="option">curve2</samp></dt>
  27560. <dd><p>Set curve for cross fade transition for second stream.
  27561. </p>
  27562. <p>For description of available curve types see <a class="ref" href="#afade">afade</a> filter description.
  27563. </p></dd>
  27564. </dl>
  27565. <ul class="mini-toc">
  27566. <li><a href="#Examples-42" accesskey="1">Examples</a></li>
  27567. </ul>
  27568. <div class="subsection-level-extent" id="Examples-42">
  27569. <h4 class="subsection"><span>36.5.1 Examples<a class="copiable-link" href="#Examples-42"> &para;</a></span></h4>
  27570. <ul class="itemize mark-bullet">
  27571. <li>Cross fade from one input to another:
  27572. <div class="example">
  27573. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  27574. </pre></div>
  27575. </li><li>Cross fade from one input to another but without overlapping:
  27576. <div class="example">
  27577. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  27578. </pre></div>
  27579. </li></ul>
  27580. </div>
  27581. </div>
  27582. <div class="section-level-extent" id="acrossover">
  27583. <h3 class="section"><span>36.6 acrossover<a class="copiable-link" href="#acrossover"> &para;</a></span></h3>
  27584. <p>Split audio stream into several bands.
  27585. </p>
  27586. <p>This filter splits audio stream into two or more frequency ranges.
  27587. Summing all streams back will give flat output.
  27588. </p>
  27589. <p>The filter accepts the following options:
  27590. </p>
  27591. <dl class="table">
  27592. <dt><samp class="option">split</samp></dt>
  27593. <dd><p>Set split frequencies. Those must be positive and increasing.
  27594. </p>
  27595. </dd>
  27596. <dt><samp class="option">order</samp></dt>
  27597. <dd><p>Set filter order for each band split. This controls filter roll-off or steepness
  27598. of filter transfer function.
  27599. Available values are:
  27600. </p>
  27601. <dl class="table">
  27602. <dt>&lsquo;<samp class="samp">2nd</samp>&rsquo;</dt>
  27603. <dd><p>12 dB per octave.
  27604. </p></dd>
  27605. <dt>&lsquo;<samp class="samp">4th</samp>&rsquo;</dt>
  27606. <dd><p>24 dB per octave.
  27607. </p></dd>
  27608. <dt>&lsquo;<samp class="samp">6th</samp>&rsquo;</dt>
  27609. <dd><p>36 dB per octave.
  27610. </p></dd>
  27611. <dt>&lsquo;<samp class="samp">8th</samp>&rsquo;</dt>
  27612. <dd><p>48 dB per octave.
  27613. </p></dd>
  27614. <dt>&lsquo;<samp class="samp">10th</samp>&rsquo;</dt>
  27615. <dd><p>60 dB per octave.
  27616. </p></dd>
  27617. <dt>&lsquo;<samp class="samp">12th</samp>&rsquo;</dt>
  27618. <dd><p>72 dB per octave.
  27619. </p></dd>
  27620. <dt>&lsquo;<samp class="samp">14th</samp>&rsquo;</dt>
  27621. <dd><p>84 dB per octave.
  27622. </p></dd>
  27623. <dt>&lsquo;<samp class="samp">16th</samp>&rsquo;</dt>
  27624. <dd><p>96 dB per octave.
  27625. </p></dd>
  27626. <dt>&lsquo;<samp class="samp">18th</samp>&rsquo;</dt>
  27627. <dd><p>108 dB per octave.
  27628. </p></dd>
  27629. <dt>&lsquo;<samp class="samp">20th</samp>&rsquo;</dt>
  27630. <dd><p>120 dB per octave.
  27631. </p></dd>
  27632. </dl>
  27633. <p>Default is <var class="var">4th</var>.
  27634. </p>
  27635. </dd>
  27636. <dt><samp class="option">level</samp></dt>
  27637. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  27638. </p>
  27639. </dd>
  27640. <dt><samp class="option">gains</samp></dt>
  27641. <dd><p>Set output gain for each band. Default value is 1 for all bands.
  27642. </p>
  27643. </dd>
  27644. <dt><samp class="option">precision</samp></dt>
  27645. <dd><p>Set which precision to use when processing samples.
  27646. </p>
  27647. <dl class="table">
  27648. <dt><samp class="option">auto</samp></dt>
  27649. <dd><p>Auto pick internal sample format depending on other filters.
  27650. </p>
  27651. </dd>
  27652. <dt><samp class="option">float</samp></dt>
  27653. <dd><p>Always use single-floating point precision sample format.
  27654. </p>
  27655. </dd>
  27656. <dt><samp class="option">double</samp></dt>
  27657. <dd><p>Always use double-floating point precision sample format.
  27658. </p></dd>
  27659. </dl>
  27660. <p>Default value is <code class="code">auto</code>.
  27661. </p></dd>
  27662. </dl>
  27663. <ul class="mini-toc">
  27664. <li><a href="#Examples-43" accesskey="1">Examples</a></li>
  27665. </ul>
  27666. <div class="subsection-level-extent" id="Examples-43">
  27667. <h4 class="subsection"><span>36.6.1 Examples<a class="copiable-link" href="#Examples-43"> &para;</a></span></h4>
  27668. <ul class="itemize mark-bullet">
  27669. <li>Split input audio stream into two bands (low and high) with split frequency of 1500 Hz,
  27670. each band will be in separate stream:
  27671. <div class="example">
  27672. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  27673. </pre></div>
  27674. </li><li>Same as above, but with higher filter order:
  27675. <div class="example">
  27676. <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
  27677. </pre></div>
  27678. </li><li>Same as above, but also with additional middle band (frequencies between 1500 and 8000):
  27679. <div class="example">
  27680. <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
  27681. </pre></div>
  27682. </li></ul>
  27683. </div>
  27684. </div>
  27685. <div class="section-level-extent" id="acrusher">
  27686. <h3 class="section"><span>36.7 acrusher<a class="copiable-link" href="#acrusher"> &para;</a></span></h3>
  27687. <p>Reduce audio bit resolution.
  27688. </p>
  27689. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  27690. is used to audibly reduce number of bits an audio signal is sampled
  27691. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  27692. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  27693. This filter is able to even round to continuous values instead of discrete
  27694. bit depths.
  27695. Additionally it has a D/C offset which results in different crushing of
  27696. the lower and the upper half of the signal.
  27697. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  27698. </p>
  27699. <p>Another feature of this filter is the logarithmic mode.
  27700. This setting switches from linear distances between bits to logarithmic ones.
  27701. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  27702. signals for example. The human ear has a logarithmic perception,
  27703. so this kind of crushing is much more pleasant.
  27704. Logarithmic crushing is also able to get anti-aliased.
  27705. </p>
  27706. <p>The filter accepts the following options:
  27707. </p>
  27708. <dl class="table">
  27709. <dt><samp class="option">level_in</samp></dt>
  27710. <dd><p>Set level in.
  27711. </p>
  27712. </dd>
  27713. <dt><samp class="option">level_out</samp></dt>
  27714. <dd><p>Set level out.
  27715. </p>
  27716. </dd>
  27717. <dt><samp class="option">bits</samp></dt>
  27718. <dd><p>Set bit reduction.
  27719. </p>
  27720. </dd>
  27721. <dt><samp class="option">mix</samp></dt>
  27722. <dd><p>Set mixing amount.
  27723. </p>
  27724. </dd>
  27725. <dt><samp class="option">mode</samp></dt>
  27726. <dd><p>Can be linear: <code class="code">lin</code> or logarithmic: <code class="code">log</code>.
  27727. </p>
  27728. </dd>
  27729. <dt><samp class="option">dc</samp></dt>
  27730. <dd><p>Set DC.
  27731. </p>
  27732. </dd>
  27733. <dt><samp class="option">aa</samp></dt>
  27734. <dd><p>Set anti-aliasing.
  27735. </p>
  27736. </dd>
  27737. <dt><samp class="option">samples</samp></dt>
  27738. <dd><p>Set sample reduction.
  27739. </p>
  27740. </dd>
  27741. <dt><samp class="option">lfo</samp></dt>
  27742. <dd><p>Enable LFO. By default disabled.
  27743. </p>
  27744. </dd>
  27745. <dt><samp class="option">lforange</samp></dt>
  27746. <dd><p>Set LFO range.
  27747. </p>
  27748. </dd>
  27749. <dt><samp class="option">lforate</samp></dt>
  27750. <dd><p>Set LFO rate.
  27751. </p></dd>
  27752. </dl>
  27753. <ul class="mini-toc">
  27754. <li><a href="#Commands-1" accesskey="1">Commands</a></li>
  27755. </ul>
  27756. <div class="subsection-level-extent" id="Commands-1">
  27757. <h4 class="subsection"><span>36.7.1 Commands<a class="copiable-link" href="#Commands-1"> &para;</a></span></h4>
  27758. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27759. </p>
  27760. </div>
  27761. </div>
  27762. <div class="section-level-extent" id="acue">
  27763. <h3 class="section"><span>36.8 acue<a class="copiable-link" href="#acue"> &para;</a></span></h3>
  27764. <p>Delay audio filtering until a given wallclock timestamp. See the <a class="ref" href="#cue">cue</a>
  27765. filter.
  27766. </p>
  27767. </div>
  27768. <div class="section-level-extent" id="adeclick">
  27769. <h3 class="section"><span>36.9 adeclick<a class="copiable-link" href="#adeclick"> &para;</a></span></h3>
  27770. <p>Remove impulsive noise from input audio.
  27771. </p>
  27772. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  27773. autoregressive modelling.
  27774. </p>
  27775. <dl class="table">
  27776. <dt><samp class="option">window, w</samp></dt>
  27777. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to
  27778. <code class="code">100</code>. Default value is <code class="code">55</code> milliseconds.
  27779. This sets size of window which will be processed at once.
  27780. </p>
  27781. </dd>
  27782. <dt><samp class="option">overlap, o</samp></dt>
  27783. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  27784. <code class="code">50</code> to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  27785. Setting this to a very high value increases impulsive noise removal but makes
  27786. whole process much slower.
  27787. </p>
  27788. </dd>
  27789. <dt><samp class="option">arorder, a</samp></dt>
  27790. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  27791. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">2</code> percent. This option also
  27792. controls quality of interpolated samples using neighbour good samples.
  27793. </p>
  27794. </dd>
  27795. <dt><samp class="option">threshold, t</samp></dt>
  27796. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  27797. Default value is <code class="code">2</code>.
  27798. This controls the strength of impulsive noise which is going to be removed.
  27799. The lower value, the more samples will be detected as impulsive noise.
  27800. </p>
  27801. </dd>
  27802. <dt><samp class="option">burst, b</samp></dt>
  27803. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code class="code">0</code> to
  27804. <code class="code">10</code>. Default value is <code class="code">2</code>.
  27805. If any two samples detected as noise are spaced less than this value then any
  27806. sample between those two samples will be also detected as noise.
  27807. </p>
  27808. </dd>
  27809. <dt><samp class="option">method, m</samp></dt>
  27810. <dd><p>Set overlap method.
  27811. </p>
  27812. <p>It accepts the following values:
  27813. </p><dl class="table">
  27814. <dt><samp class="option">add, a</samp></dt>
  27815. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  27816. changed with this method.
  27817. </p>
  27818. </dd>
  27819. <dt><samp class="option">save, s</samp></dt>
  27820. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  27821. </p></dd>
  27822. </dl>
  27823. <p>Default value is <code class="code">a</code>.
  27824. </p></dd>
  27825. </dl>
  27826. </div>
  27827. <div class="section-level-extent" id="adeclip">
  27828. <h3 class="section"><span>36.10 adeclip<a class="copiable-link" href="#adeclip"> &para;</a></span></h3>
  27829. <p>Remove clipped samples from input audio.
  27830. </p>
  27831. <p>Samples detected as clipped are replaced by interpolated samples using
  27832. autoregressive modelling.
  27833. </p>
  27834. <dl class="table">
  27835. <dt><samp class="option">window, w</samp></dt>
  27836. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to <code class="code">100</code>.
  27837. Default value is <code class="code">55</code> milliseconds.
  27838. This sets size of window which will be processed at once.
  27839. </p>
  27840. </dd>
  27841. <dt><samp class="option">overlap, o</samp></dt>
  27842. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code class="code">50</code>
  27843. to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  27844. </p>
  27845. </dd>
  27846. <dt><samp class="option">arorder, a</samp></dt>
  27847. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  27848. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">8</code> percent. This option also controls
  27849. quality of interpolated samples using neighbour good samples.
  27850. </p>
  27851. </dd>
  27852. <dt><samp class="option">threshold, t</samp></dt>
  27853. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  27854. Default value is <code class="code">10</code>. Higher values make clip detection less aggressive.
  27855. </p>
  27856. </dd>
  27857. <dt><samp class="option">hsize, n</samp></dt>
  27858. <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>.
  27859. Default value is <code class="code">1000</code>. Higher values make clip detection less aggressive.
  27860. </p>
  27861. </dd>
  27862. <dt><samp class="option">method, m</samp></dt>
  27863. <dd><p>Set overlap method.
  27864. </p>
  27865. <p>It accepts the following values:
  27866. </p><dl class="table">
  27867. <dt><samp class="option">add, a</samp></dt>
  27868. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  27869. with this method.
  27870. </p>
  27871. </dd>
  27872. <dt><samp class="option">save, s</samp></dt>
  27873. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  27874. </p></dd>
  27875. </dl>
  27876. <p>Default value is <code class="code">a</code>.
  27877. </p></dd>
  27878. </dl>
  27879. </div>
  27880. <div class="section-level-extent" id="adecorrelate">
  27881. <h3 class="section"><span>36.11 adecorrelate<a class="copiable-link" href="#adecorrelate"> &para;</a></span></h3>
  27882. <p>Apply decorrelation to input audio stream.
  27883. </p>
  27884. <p>The filter accepts the following options:
  27885. </p>
  27886. <dl class="table">
  27887. <dt><samp class="option">stages</samp></dt>
  27888. <dd><p>Set decorrelation stages of filtering. Allowed
  27889. range is from 1 to 16. Default value is 6.
  27890. </p>
  27891. </dd>
  27892. <dt><samp class="option">seed</samp></dt>
  27893. <dd><p>Set random seed used for setting delay in samples across channels.
  27894. </p></dd>
  27895. </dl>
  27896. </div>
  27897. <div class="section-level-extent" id="adelay">
  27898. <h3 class="section"><span>36.12 adelay<a class="copiable-link" href="#adelay"> &para;</a></span></h3>
  27899. <p>Delay one or more audio channels.
  27900. </p>
  27901. <p>Samples in delayed channel are filled with silence.
  27902. </p>
  27903. <p>The filter accepts the following option:
  27904. </p>
  27905. <dl class="table">
  27906. <dt><samp class="option">delays</samp></dt>
  27907. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  27908. Unused delays will be silently ignored. If number of given delays is
  27909. smaller than number of channels all remaining channels will not be delayed.
  27910. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  27911. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  27912. </p>
  27913. </dd>
  27914. <dt><samp class="option">all</samp></dt>
  27915. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  27916. This option if enabled changes how option <code class="code">delays</code> is interpreted.
  27917. </p></dd>
  27918. </dl>
  27919. <ul class="mini-toc">
  27920. <li><a href="#Examples-44" accesskey="1">Examples</a></li>
  27921. </ul>
  27922. <div class="subsection-level-extent" id="Examples-44">
  27923. <h4 class="subsection"><span>36.12.1 Examples<a class="copiable-link" href="#Examples-44"> &para;</a></span></h4>
  27924. <ul class="itemize mark-bullet">
  27925. <li>Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  27926. the second channel (and any other channels that may be present) unchanged.
  27927. <div class="example">
  27928. <pre class="example-preformatted">adelay=1500|0|500
  27929. </pre></div>
  27930. </li><li>Delay second channel by 500 samples, the third channel by 700 samples and leave
  27931. the first channel (and any other channels that may be present) unchanged.
  27932. <div class="example">
  27933. <pre class="example-preformatted">adelay=0|500S|700S
  27934. </pre></div>
  27935. </li><li>Delay all channels by same number of samples:
  27936. <div class="example">
  27937. <pre class="example-preformatted">adelay=delays=64S:all=1
  27938. </pre></div>
  27939. </li></ul>
  27940. </div>
  27941. </div>
  27942. <div class="section-level-extent" id="adenorm">
  27943. <h3 class="section"><span>36.13 adenorm<a class="copiable-link" href="#adenorm"> &para;</a></span></h3>
  27944. <p>Remedy denormals in audio by adding extremely low-level noise.
  27945. </p>
  27946. <p>This filter shall be placed before any filter that can produce denormals.
  27947. </p>
  27948. <p>A description of the accepted parameters follows.
  27949. </p>
  27950. <dl class="table">
  27951. <dt><samp class="option">level</samp></dt>
  27952. <dd><p>Set level of added noise in dB. Default is <code class="code">-351</code>.
  27953. Allowed range is from -451 to -90.
  27954. </p>
  27955. </dd>
  27956. <dt><samp class="option">type</samp></dt>
  27957. <dd><p>Set type of added noise.
  27958. </p>
  27959. <dl class="table">
  27960. <dt><samp class="option">dc</samp></dt>
  27961. <dd><p>Add DC signal.
  27962. </p></dd>
  27963. <dt><samp class="option">ac</samp></dt>
  27964. <dd><p>Add AC signal.
  27965. </p></dd>
  27966. <dt><samp class="option">square</samp></dt>
  27967. <dd><p>Add square signal.
  27968. </p></dd>
  27969. <dt><samp class="option">pulse</samp></dt>
  27970. <dd><p>Add pulse signal.
  27971. </p></dd>
  27972. </dl>
  27973. <p>Default is <code class="code">dc</code>.
  27974. </p></dd>
  27975. </dl>
  27976. <ul class="mini-toc">
  27977. <li><a href="#Commands-2" accesskey="1">Commands</a></li>
  27978. </ul>
  27979. <div class="subsection-level-extent" id="Commands-2">
  27980. <h4 class="subsection"><span>36.13.1 Commands<a class="copiable-link" href="#Commands-2"> &para;</a></span></h4>
  27981. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  27982. </p>
  27983. </div>
  27984. </div>
  27985. <div class="section-level-extent" id="aderivative_002c-aintegral">
  27986. <h3 class="section"><span>36.14 aderivative, aintegral<a class="copiable-link" href="#aderivative_002c-aintegral"> &para;</a></span></h3>
  27987. <p>Compute derivative/integral of audio stream.
  27988. </p>
  27989. <p>Applying both filters one after another produces original audio.
  27990. </p>
  27991. </div>
  27992. <div class="section-level-extent" id="adrc">
  27993. <h3 class="section"><span>36.15 adrc<a class="copiable-link" href="#adrc"> &para;</a></span></h3>
  27994. <p>Apply spectral dynamic range controller filter to input audio stream.
  27995. </p>
  27996. <p>A description of the accepted options follows.
  27997. </p>
  27998. <dl class="table">
  27999. <dt><samp class="option">transfer</samp></dt>
  28000. <dd><p>Set the transfer expression.
  28001. </p>
  28002. <p>The expression can contain the following constants:
  28003. </p>
  28004. <dl class="table">
  28005. <dt><samp class="option">ch</samp></dt>
  28006. <dd><p>current channel number
  28007. </p>
  28008. </dd>
  28009. <dt><samp class="option">sn</samp></dt>
  28010. <dd><p>current sample number
  28011. </p>
  28012. </dd>
  28013. <dt><samp class="option">nb_channels</samp></dt>
  28014. <dd><p>number of channels
  28015. </p>
  28016. </dd>
  28017. <dt><samp class="option">t</samp></dt>
  28018. <dd><p>timestamp expressed in seconds
  28019. </p>
  28020. </dd>
  28021. <dt><samp class="option">sr</samp></dt>
  28022. <dd><p>sample rate
  28023. </p>
  28024. </dd>
  28025. <dt><samp class="option">p</samp></dt>
  28026. <dd><p>current frequency power value, in dB
  28027. </p>
  28028. </dd>
  28029. <dt><samp class="option">f</samp></dt>
  28030. <dd><p>current frequency in Hz
  28031. </p></dd>
  28032. </dl>
  28033. <p>Default value is <code class="code">p</code>.
  28034. </p>
  28035. </dd>
  28036. <dt><samp class="option">attack</samp></dt>
  28037. <dd><p>Set the attack in milliseconds. Default is <code class="code">50</code> milliseconds.
  28038. Allowed range is from 1 to 1000 milliseconds.
  28039. </p></dd>
  28040. <dt><samp class="option">release</samp></dt>
  28041. <dd><p>Set the release in milliseconds. Default is <code class="code">100</code> milliseconds.
  28042. Allowed range is from 5 to 2000 milliseconds.
  28043. </p></dd>
  28044. <dt><samp class="option">channels</samp></dt>
  28045. <dd><p>Set which channels to filter, by default <code class="code">all</code> channels in audio stream are filtered.
  28046. </p></dd>
  28047. </dl>
  28048. <ul class="mini-toc">
  28049. <li><a href="#Commands-3" accesskey="1">Commands</a></li>
  28050. <li><a href="#Examples-45" accesskey="2">Examples</a></li>
  28051. </ul>
  28052. <div class="subsection-level-extent" id="Commands-3">
  28053. <h4 class="subsection"><span>36.15.1 Commands<a class="copiable-link" href="#Commands-3"> &para;</a></span></h4>
  28054. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28055. </p>
  28056. </div>
  28057. <div class="subsection-level-extent" id="Examples-45">
  28058. <h4 class="subsection"><span>36.15.2 Examples<a class="copiable-link" href="#Examples-45"> &para;</a></span></h4>
  28059. <ul class="itemize mark-bullet">
  28060. <li>Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio:
  28061. <div class="example">
  28062. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
  28063. </pre></div>
  28064. </li><li>Similar to above but with 1:2 ratio and filtering only front center channel:
  28065. <div class="example">
  28066. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
  28067. </pre></div>
  28068. </li><li>Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time:
  28069. <div class="example">
  28070. <pre class="example-preformatted">adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
  28071. </pre></div>
  28072. </li><li>Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio:
  28073. <div class="example">
  28074. <pre class="example-preformatted">adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
  28075. </pre></div>
  28076. </li><li>Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms:
  28077. <div class="example">
  28078. <pre class="example-preformatted">adrc=transfer='min(p,-60)':attack=2:release=10
  28079. </pre></div>
  28080. </li></ul>
  28081. </div>
  28082. </div>
  28083. <div class="section-level-extent" id="adynamicequalizer">
  28084. <h3 class="section"><span>36.16 adynamicequalizer<a class="copiable-link" href="#adynamicequalizer"> &para;</a></span></h3>
  28085. <p>Apply dynamic equalization to input audio stream.
  28086. </p>
  28087. <p>A description of the accepted options follows.
  28088. </p>
  28089. <dl class="table">
  28090. <dt><samp class="option">threshold</samp></dt>
  28091. <dd><p>Set the detection threshold used to trigger equalization.
  28092. Threshold detection is using detection filter.
  28093. Default value is 0. Allowed range is from 0 to 100.
  28094. </p>
  28095. </dd>
  28096. <dt><samp class="option">dfrequency</samp></dt>
  28097. <dd><p>Set the detection frequency in Hz used for detection filter used to trigger equalization.
  28098. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  28099. </p>
  28100. </dd>
  28101. <dt><samp class="option">dqfactor</samp></dt>
  28102. <dd><p>Set the detection resonance factor for detection filter used to trigger equalization.
  28103. Default value is 1. Allowed range is from 0.001 to 1000.
  28104. </p>
  28105. </dd>
  28106. <dt><samp class="option">tfrequency</samp></dt>
  28107. <dd><p>Set the target frequency of equalization filter.
  28108. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  28109. </p>
  28110. </dd>
  28111. <dt><samp class="option">tqfactor</samp></dt>
  28112. <dd><p>Set the target resonance factor for target equalization filter.
  28113. Default value is 1. Allowed range is from 0.001 to 1000.
  28114. </p>
  28115. </dd>
  28116. <dt><samp class="option">attack</samp></dt>
  28117. <dd><p>Set the amount of milliseconds the signal from detection has to rise above
  28118. the detection threshold before equalization starts.
  28119. Default is 20. Allowed range is between 1 and 2000.
  28120. </p>
  28121. </dd>
  28122. <dt><samp class="option">release</samp></dt>
  28123. <dd><p>Set the amount of milliseconds the signal from detection has to fall below the
  28124. detection threshold before equalization ends.
  28125. Default is 200. Allowed range is between 1 and 2000.
  28126. </p>
  28127. </dd>
  28128. <dt><samp class="option">ratio</samp></dt>
  28129. <dd><p>Set the ratio by which the equalization gain is raised.
  28130. Default is 1. Allowed range is between 0 and 30.
  28131. </p>
  28132. </dd>
  28133. <dt><samp class="option">makeup</samp></dt>
  28134. <dd><p>Set the makeup offset by which the equalization gain is raised.
  28135. Default is 0. Allowed range is between 0 and 100.
  28136. </p>
  28137. </dd>
  28138. <dt><samp class="option">range</samp></dt>
  28139. <dd><p>Set the max allowed cut/boost amount. Default is 50.
  28140. Allowed range is from 1 to 200.
  28141. </p>
  28142. </dd>
  28143. <dt><samp class="option">mode</samp></dt>
  28144. <dd><p>Set the mode of filter operation, can be one of the following:
  28145. </p>
  28146. <dl class="table">
  28147. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  28148. <dd><p>Output only isolated detection signal.
  28149. </p></dd>
  28150. <dt>&lsquo;<samp class="samp">cutbelow</samp>&rsquo;</dt>
  28151. <dd><p>Cut frequencies below detection threshold.
  28152. </p></dd>
  28153. <dt>&lsquo;<samp class="samp">cutabove</samp>&rsquo;</dt>
  28154. <dd><p>Cut frequencies above detection threshold.
  28155. </p></dd>
  28156. <dt>&lsquo;<samp class="samp">boostbelow</samp>&rsquo;</dt>
  28157. <dd><p>Boost frequencies below detection threshold.
  28158. </p></dd>
  28159. <dt>&lsquo;<samp class="samp">boostabove</samp>&rsquo;</dt>
  28160. <dd><p>Boost frequencies above detection threshold.
  28161. </p></dd>
  28162. </dl>
  28163. <p>Default mode is &lsquo;<samp class="samp">cutbelow</samp>&rsquo;.
  28164. </p>
  28165. </dd>
  28166. <dt><samp class="option">dftype</samp></dt>
  28167. <dd><p>Set the type of detection filter, can be one of the following:
  28168. </p>
  28169. <dl class="table">
  28170. <dt>&lsquo;<samp class="samp">bandpass</samp>&rsquo;</dt>
  28171. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  28172. <dt>&lsquo;<samp class="samp">highpass</samp>&rsquo;</dt>
  28173. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  28174. </dl>
  28175. <p>Default type is &lsquo;<samp class="samp">bandpass</samp>&rsquo;.
  28176. </p>
  28177. </dd>
  28178. <dt><samp class="option">tftype</samp></dt>
  28179. <dd><p>Set the type of target filter, can be one of the following:
  28180. </p>
  28181. <dl class="table">
  28182. <dt>&lsquo;<samp class="samp">bell</samp>&rsquo;</dt>
  28183. <dt>&lsquo;<samp class="samp">lowshelf</samp>&rsquo;</dt>
  28184. <dt>&lsquo;<samp class="samp">highshelf</samp>&rsquo;</dt>
  28185. </dl>
  28186. <p>Default type is &lsquo;<samp class="samp">bell</samp>&rsquo;.
  28187. </p>
  28188. </dd>
  28189. <dt><samp class="option">auto</samp></dt>
  28190. <dd><p>Automatically gather threshold from detection filter. By default
  28191. is &lsquo;<samp class="samp">disabled</samp>&rsquo;.
  28192. This option is useful to detect threshold in certain time frame of
  28193. input audio stream, in such case option value is changed at runtime.
  28194. </p>
  28195. <p>Available values are:
  28196. </p><dl class="table">
  28197. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  28198. <dd><p>Disable using automatically gathered threshold value.
  28199. </p></dd>
  28200. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  28201. <dd><p>Stop picking threshold value.
  28202. </p></dd>
  28203. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  28204. <dd><p>Start picking threshold value.
  28205. </p></dd>
  28206. <dt>&lsquo;<samp class="samp">adaptive</samp>&rsquo;</dt>
  28207. <dd><p>Adaptively pick threshold value, by calculating sliding window entropy.
  28208. </p></dd>
  28209. </dl>
  28210. </dd>
  28211. <dt><samp class="option">precision</samp></dt>
  28212. <dd><p>Set which precision to use when processing samples.
  28213. </p>
  28214. <dl class="table">
  28215. <dt><samp class="option">auto</samp></dt>
  28216. <dd><p>Auto pick internal sample format depending on other filters.
  28217. </p>
  28218. </dd>
  28219. <dt><samp class="option">float</samp></dt>
  28220. <dd><p>Always use single-floating point precision sample format.
  28221. </p>
  28222. </dd>
  28223. <dt><samp class="option">double</samp></dt>
  28224. <dd><p>Always use double-floating point precision sample format.
  28225. </p></dd>
  28226. </dl>
  28227. </dd>
  28228. </dl>
  28229. <ul class="mini-toc">
  28230. <li><a href="#Commands-4" accesskey="1">Commands</a></li>
  28231. </ul>
  28232. <div class="subsection-level-extent" id="Commands-4">
  28233. <h4 class="subsection"><span>36.16.1 Commands<a class="copiable-link" href="#Commands-4"> &para;</a></span></h4>
  28234. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28235. </p>
  28236. </div>
  28237. </div>
  28238. <div class="section-level-extent" id="adynamicsmooth">
  28239. <h3 class="section"><span>36.17 adynamicsmooth<a class="copiable-link" href="#adynamicsmooth"> &para;</a></span></h3>
  28240. <p>Apply dynamic smoothing to input audio stream.
  28241. </p>
  28242. <p>A description of the accepted options follows.
  28243. </p>
  28244. <dl class="table">
  28245. <dt><samp class="option">sensitivity</samp></dt>
  28246. <dd><p>Set an amount of sensitivity to frequency fluctations. Default is 2.
  28247. Allowed range is from 0 to 1e+06.
  28248. </p>
  28249. </dd>
  28250. <dt><samp class="option">basefreq</samp></dt>
  28251. <dd><p>Set a base frequency for smoothing. Default value is 22050.
  28252. Allowed range is from 2 to 1e+06.
  28253. </p></dd>
  28254. </dl>
  28255. <ul class="mini-toc">
  28256. <li><a href="#Commands-5" accesskey="1">Commands</a></li>
  28257. </ul>
  28258. <div class="subsection-level-extent" id="Commands-5">
  28259. <h4 class="subsection"><span>36.17.1 Commands<a class="copiable-link" href="#Commands-5"> &para;</a></span></h4>
  28260. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28261. </p>
  28262. </div>
  28263. </div>
  28264. <div class="section-level-extent" id="aecho">
  28265. <h3 class="section"><span>36.18 aecho<a class="copiable-link" href="#aecho"> &para;</a></span></h3>
  28266. <p>Apply echoing to the input audio.
  28267. </p>
  28268. <p>Echoes are reflected sound and can occur naturally amongst mountains
  28269. (and sometimes large buildings) when talking or shouting; digital echo
  28270. effects emulate this behaviour and are often used to help fill out the
  28271. sound of a single instrument or vocal. The time difference between the
  28272. original signal and the reflection is the <code class="code">delay</code>, and the
  28273. loudness of the reflected signal is the <code class="code">decay</code>.
  28274. Multiple echoes can have different delays and decays.
  28275. </p>
  28276. <p>A description of the accepted parameters follows.
  28277. </p>
  28278. <dl class="table">
  28279. <dt><samp class="option">in_gain</samp></dt>
  28280. <dd><p>Set input gain of reflected signal. Default is <code class="code">0.6</code>.
  28281. </p>
  28282. </dd>
  28283. <dt><samp class="option">out_gain</samp></dt>
  28284. <dd><p>Set output gain of reflected signal. Default is <code class="code">0.3</code>.
  28285. </p>
  28286. </dd>
  28287. <dt><samp class="option">delays</samp></dt>
  28288. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  28289. separated by &rsquo;|&rsquo;. Allowed range for each <code class="code">delay</code> is <code class="code">(0 - 90000.0]</code>.
  28290. Default is <code class="code">1000</code>.
  28291. </p>
  28292. </dd>
  28293. <dt><samp class="option">decays</samp></dt>
  28294. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  28295. Allowed range for each <code class="code">decay</code> is <code class="code">(0 - 1.0]</code>.
  28296. Default is <code class="code">0.5</code>.
  28297. </p></dd>
  28298. </dl>
  28299. <ul class="mini-toc">
  28300. <li><a href="#Examples-46" accesskey="1">Examples</a></li>
  28301. </ul>
  28302. <div class="subsection-level-extent" id="Examples-46">
  28303. <h4 class="subsection"><span>36.18.1 Examples<a class="copiable-link" href="#Examples-46"> &para;</a></span></h4>
  28304. <ul class="itemize mark-bullet">
  28305. <li>Make it sound as if there are twice as many instruments as are actually playing:
  28306. <div class="example">
  28307. <pre class="example-preformatted">aecho=0.8:0.88:60:0.4
  28308. </pre></div>
  28309. </li><li>If delay is very short, then it sounds like a (metallic) robot playing music:
  28310. <div class="example">
  28311. <pre class="example-preformatted">aecho=0.8:0.88:6:0.4
  28312. </pre></div>
  28313. </li><li>A longer delay will sound like an open air concert in the mountains:
  28314. <div class="example">
  28315. <pre class="example-preformatted">aecho=0.8:0.9:1000:0.3
  28316. </pre></div>
  28317. </li><li>Same as above but with one more mountain:
  28318. <div class="example">
  28319. <pre class="example-preformatted">aecho=0.8:0.9:1000|1800:0.3|0.25
  28320. </pre></div>
  28321. </li></ul>
  28322. </div>
  28323. </div>
  28324. <div class="section-level-extent" id="aemphasis">
  28325. <h3 class="section"><span>36.19 aemphasis<a class="copiable-link" href="#aemphasis"> &para;</a></span></h3>
  28326. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  28327. emphased CDs with different filter curves. E.g. to store music on vinyl the
  28328. signal has to be altered by a filter first to even out the disadvantages of
  28329. this recording medium.
  28330. Once the material is played back the inverse filter has to be applied to
  28331. restore the distortion of the frequency response.
  28332. </p>
  28333. <p>The filter accepts the following options:
  28334. </p>
  28335. <dl class="table">
  28336. <dt><samp class="option">level_in</samp></dt>
  28337. <dd><p>Set input gain.
  28338. </p>
  28339. </dd>
  28340. <dt><samp class="option">level_out</samp></dt>
  28341. <dd><p>Set output gain.
  28342. </p>
  28343. </dd>
  28344. <dt><samp class="option">mode</samp></dt>
  28345. <dd><p>Set filter mode. For restoring material use <code class="code">reproduction</code> mode, otherwise
  28346. use <code class="code">production</code> mode. Default is <code class="code">reproduction</code> mode.
  28347. </p>
  28348. </dd>
  28349. <dt><samp class="option">type</samp></dt>
  28350. <dd><p>Set filter type. Selects medium. Can be one of the following:
  28351. </p>
  28352. <dl class="table">
  28353. <dt><samp class="option">col</samp></dt>
  28354. <dd><p>select Columbia.
  28355. </p></dd>
  28356. <dt><samp class="option">emi</samp></dt>
  28357. <dd><p>select EMI.
  28358. </p></dd>
  28359. <dt><samp class="option">bsi</samp></dt>
  28360. <dd><p>select BSI (78RPM).
  28361. </p></dd>
  28362. <dt><samp class="option">riaa</samp></dt>
  28363. <dd><p>select RIAA.
  28364. </p></dd>
  28365. <dt><samp class="option">cd</samp></dt>
  28366. <dd><p>select Compact Disc (CD).
  28367. </p></dd>
  28368. <dt><samp class="option">50fm</samp></dt>
  28369. <dd><p>select 50µs (FM).
  28370. </p></dd>
  28371. <dt><samp class="option">75fm</samp></dt>
  28372. <dd><p>select 75µs (FM).
  28373. </p></dd>
  28374. <dt><samp class="option">50kf</samp></dt>
  28375. <dd><p>select 50µs (FM-KF).
  28376. </p></dd>
  28377. <dt><samp class="option">75kf</samp></dt>
  28378. <dd><p>select 75µs (FM-KF).
  28379. </p></dd>
  28380. </dl>
  28381. </dd>
  28382. </dl>
  28383. <ul class="mini-toc">
  28384. <li><a href="#Commands-6" accesskey="1">Commands</a></li>
  28385. </ul>
  28386. <div class="subsection-level-extent" id="Commands-6">
  28387. <h4 class="subsection"><span>36.19.1 Commands<a class="copiable-link" href="#Commands-6"> &para;</a></span></h4>
  28388. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28389. </p>
  28390. </div>
  28391. </div>
  28392. <div class="section-level-extent" id="aeval">
  28393. <h3 class="section"><span>36.20 aeval<a class="copiable-link" href="#aeval"> &para;</a></span></h3>
  28394. <p>Modify an audio signal according to the specified expressions.
  28395. </p>
  28396. <p>This filter accepts one or more expressions (one for each channel),
  28397. which are evaluated and used to modify a corresponding audio signal.
  28398. </p>
  28399. <p>It accepts the following parameters:
  28400. </p>
  28401. <dl class="table">
  28402. <dt><samp class="option">exprs</samp></dt>
  28403. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  28404. the number of input channels is greater than the number of
  28405. expressions, the last specified expression is used for the remaining
  28406. output channels.
  28407. </p>
  28408. </dd>
  28409. <dt><samp class="option">channel_layout, c</samp></dt>
  28410. <dd><p>Set output channel layout. If not specified, the channel layout is
  28411. specified by the number of expressions. If set to &lsquo;<samp class="samp">same</samp>&rsquo;, it will
  28412. use by default the same input channel layout.
  28413. </p></dd>
  28414. </dl>
  28415. <p>Each expression in <var class="var">exprs</var> can contain the following constants and functions:
  28416. </p>
  28417. <dl class="table">
  28418. <dt><samp class="option">ch</samp></dt>
  28419. <dd><p>channel number of the current expression
  28420. </p>
  28421. </dd>
  28422. <dt><samp class="option">n</samp></dt>
  28423. <dd><p>number of the evaluated sample, starting from 0
  28424. </p>
  28425. </dd>
  28426. <dt><samp class="option">s</samp></dt>
  28427. <dd><p>sample rate
  28428. </p>
  28429. </dd>
  28430. <dt><samp class="option">t</samp></dt>
  28431. <dd><p>time of the evaluated sample expressed in seconds
  28432. </p>
  28433. </dd>
  28434. <dt><samp class="option">nb_in_channels</samp></dt>
  28435. <dt><samp class="option">nb_out_channels</samp></dt>
  28436. <dd><p>input and output number of channels
  28437. </p>
  28438. </dd>
  28439. <dt><samp class="option">val(CH)</samp></dt>
  28440. <dd><p>the value of input channel with number <var class="var">CH</var>
  28441. </p></dd>
  28442. </dl>
  28443. <p>Note: this filter is slow. For faster processing you should use a
  28444. dedicated filter.
  28445. </p>
  28446. <ul class="mini-toc">
  28447. <li><a href="#Examples-47" accesskey="1">Examples</a></li>
  28448. </ul>
  28449. <div class="subsection-level-extent" id="Examples-47">
  28450. <h4 class="subsection"><span>36.20.1 Examples<a class="copiable-link" href="#Examples-47"> &para;</a></span></h4>
  28451. <ul class="itemize mark-bullet">
  28452. <li>Half volume:
  28453. <div class="example">
  28454. <pre class="example-preformatted">aeval=val(ch)/2:c=same
  28455. </pre></div>
  28456. </li><li>Invert phase of the second channel:
  28457. <div class="example">
  28458. <pre class="example-preformatted">aeval=val(0)|-val(1)
  28459. </pre></div>
  28460. </li></ul>
  28461. </div>
  28462. </div>
  28463. <div class="section-level-extent" id="aexciter">
  28464. <h3 class="section"><span>36.21 aexciter<a class="copiable-link" href="#aexciter"> &para;</a></span></h3>
  28465. <p>An exciter is used to produce high sound that is not present in the
  28466. original signal. This is done by creating harmonic distortions of the
  28467. signal which are restricted in range and added to the original signal.
  28468. An Exciter raises the upper end of an audio signal without simply raising
  28469. the higher frequencies like an equalizer would do to create a more
  28470. &quot;crisp&quot; or &quot;brilliant&quot; sound.
  28471. </p>
  28472. <p>The filter accepts the following options:
  28473. </p>
  28474. <dl class="table">
  28475. <dt><samp class="option">level_in</samp></dt>
  28476. <dd><p>Set input level prior processing of signal.
  28477. Allowed range is from 0 to 64.
  28478. Default value is 1.
  28479. </p>
  28480. </dd>
  28481. <dt><samp class="option">level_out</samp></dt>
  28482. <dd><p>Set output level after processing of signal.
  28483. Allowed range is from 0 to 64.
  28484. Default value is 1.
  28485. </p>
  28486. </dd>
  28487. <dt><samp class="option">amount</samp></dt>
  28488. <dd><p>Set the amount of harmonics added to original signal.
  28489. Allowed range is from 0 to 64.
  28490. Default value is 1.
  28491. </p>
  28492. </dd>
  28493. <dt><samp class="option">drive</samp></dt>
  28494. <dd><p>Set the amount of newly created harmonics.
  28495. Allowed range is from 0.1 to 10.
  28496. Default value is 8.5.
  28497. </p>
  28498. </dd>
  28499. <dt><samp class="option">blend</samp></dt>
  28500. <dd><p>Set the octave of newly created harmonics.
  28501. Allowed range is from -10 to 10.
  28502. Default value is 0.
  28503. </p>
  28504. </dd>
  28505. <dt><samp class="option">freq</samp></dt>
  28506. <dd><p>Set the lower frequency limit of producing harmonics in Hz.
  28507. Allowed range is from 2000 to 12000 Hz.
  28508. Default is 7500 Hz.
  28509. </p>
  28510. </dd>
  28511. <dt><samp class="option">ceil</samp></dt>
  28512. <dd><p>Set the upper frequency limit of producing harmonics.
  28513. Allowed range is from 9999 to 20000 Hz.
  28514. If value is lower than 10000 Hz no limit is applied.
  28515. </p>
  28516. </dd>
  28517. <dt><samp class="option">listen</samp></dt>
  28518. <dd><p>Mute the original signal and output only added harmonics.
  28519. By default is disabled.
  28520. </p></dd>
  28521. </dl>
  28522. <ul class="mini-toc">
  28523. <li><a href="#Commands-7" accesskey="1">Commands</a></li>
  28524. </ul>
  28525. <div class="subsection-level-extent" id="Commands-7">
  28526. <h4 class="subsection"><span>36.21.1 Commands<a class="copiable-link" href="#Commands-7"> &para;</a></span></h4>
  28527. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28528. </p>
  28529. <a class="anchor" id="afade"></a></div>
  28530. </div>
  28531. <div class="section-level-extent" id="afade-1">
  28532. <h3 class="section"><span>36.22 afade<a class="copiable-link" href="#afade-1"> &para;</a></span></h3>
  28533. <p>Apply fade-in/out effect to input audio.
  28534. </p>
  28535. <p>A description of the accepted parameters follows.
  28536. </p>
  28537. <dl class="table">
  28538. <dt><samp class="option">type, t</samp></dt>
  28539. <dd><p>Specify the effect type, can be either <code class="code">in</code> for fade-in, or
  28540. <code class="code">out</code> for a fade-out effect. Default is <code class="code">in</code>.
  28541. </p>
  28542. </dd>
  28543. <dt><samp class="option">start_sample, ss</samp></dt>
  28544. <dd><p>Specify the number of the start sample for starting to apply the fade
  28545. effect. Default is 0.
  28546. </p>
  28547. </dd>
  28548. <dt><samp class="option">nb_samples, ns</samp></dt>
  28549. <dd><p>Specify the number of samples for which the fade effect has to last. At
  28550. the end of the fade-in effect the output audio will have the same
  28551. volume as the input audio, at the end of the fade-out transition
  28552. the output audio will be silence. Default is 44100.
  28553. </p>
  28554. </dd>
  28555. <dt><samp class="option">start_time, st</samp></dt>
  28556. <dd><p>Specify the start time of the fade effect. Default is 0.
  28557. The value must be specified as a time duration; see
  28558. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  28559. for the accepted syntax.
  28560. If set this option is used instead of <var class="var">start_sample</var>.
  28561. </p>
  28562. </dd>
  28563. <dt><samp class="option">duration, d</samp></dt>
  28564. <dd><p>Specify the duration of the fade effect. See
  28565. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  28566. for the accepted syntax.
  28567. At the end of the fade-in effect the output audio will have the same
  28568. volume as the input audio, at the end of the fade-out transition
  28569. the output audio will be silence.
  28570. By default the duration is determined by <var class="var">nb_samples</var>.
  28571. If set this option is used instead of <var class="var">nb_samples</var>.
  28572. </p>
  28573. </dd>
  28574. <dt><samp class="option">curve</samp></dt>
  28575. <dd><p>Set curve for fade transition.
  28576. </p>
  28577. <p>It accepts the following values:
  28578. </p><dl class="table">
  28579. <dt><samp class="option">tri</samp></dt>
  28580. <dd><p>select triangular, linear slope (default)
  28581. </p></dd>
  28582. <dt><samp class="option">qsin</samp></dt>
  28583. <dd><p>select quarter of sine wave
  28584. </p></dd>
  28585. <dt><samp class="option">hsin</samp></dt>
  28586. <dd><p>select half of sine wave
  28587. </p></dd>
  28588. <dt><samp class="option">esin</samp></dt>
  28589. <dd><p>select exponential sine wave
  28590. </p></dd>
  28591. <dt><samp class="option">log</samp></dt>
  28592. <dd><p>select logarithmic
  28593. </p></dd>
  28594. <dt><samp class="option">ipar</samp></dt>
  28595. <dd><p>select inverted parabola
  28596. </p></dd>
  28597. <dt><samp class="option">qua</samp></dt>
  28598. <dd><p>select quadratic
  28599. </p></dd>
  28600. <dt><samp class="option">cub</samp></dt>
  28601. <dd><p>select cubic
  28602. </p></dd>
  28603. <dt><samp class="option">squ</samp></dt>
  28604. <dd><p>select square root
  28605. </p></dd>
  28606. <dt><samp class="option">cbr</samp></dt>
  28607. <dd><p>select cubic root
  28608. </p></dd>
  28609. <dt><samp class="option">par</samp></dt>
  28610. <dd><p>select parabola
  28611. </p></dd>
  28612. <dt><samp class="option">exp</samp></dt>
  28613. <dd><p>select exponential
  28614. </p></dd>
  28615. <dt><samp class="option">iqsin</samp></dt>
  28616. <dd><p>select inverted quarter of sine wave
  28617. </p></dd>
  28618. <dt><samp class="option">ihsin</samp></dt>
  28619. <dd><p>select inverted half of sine wave
  28620. </p></dd>
  28621. <dt><samp class="option">dese</samp></dt>
  28622. <dd><p>select double-exponential seat
  28623. </p></dd>
  28624. <dt><samp class="option">desi</samp></dt>
  28625. <dd><p>select double-exponential sigmoid
  28626. </p></dd>
  28627. <dt><samp class="option">losi</samp></dt>
  28628. <dd><p>select logistic sigmoid
  28629. </p></dd>
  28630. <dt><samp class="option">sinc</samp></dt>
  28631. <dd><p>select sine cardinal function
  28632. </p></dd>
  28633. <dt><samp class="option">isinc</samp></dt>
  28634. <dd><p>select inverted sine cardinal function
  28635. </p></dd>
  28636. <dt><samp class="option">quat</samp></dt>
  28637. <dd><p>select quartic
  28638. </p></dd>
  28639. <dt><samp class="option">quatr</samp></dt>
  28640. <dd><p>select quartic root
  28641. </p></dd>
  28642. <dt><samp class="option">qsin2</samp></dt>
  28643. <dd><p>select squared quarter of sine wave
  28644. </p></dd>
  28645. <dt><samp class="option">hsin2</samp></dt>
  28646. <dd><p>select squared half of sine wave
  28647. </p></dd>
  28648. <dt><samp class="option">nofade</samp></dt>
  28649. <dd><p>no fade applied
  28650. </p></dd>
  28651. </dl>
  28652. </dd>
  28653. <dt><samp class="option">silence</samp></dt>
  28654. <dd><p>Set the initial gain for fade-in or final gain for fade-out.
  28655. Default value is <code class="code">0.0</code>.
  28656. </p>
  28657. </dd>
  28658. <dt><samp class="option">unity</samp></dt>
  28659. <dd><p>Set the initial gain for fade-out or final gain for fade-in.
  28660. Default value is <code class="code">1.0</code>.
  28661. </p></dd>
  28662. </dl>
  28663. <ul class="mini-toc">
  28664. <li><a href="#Commands-8" accesskey="1">Commands</a></li>
  28665. <li><a href="#Examples-48" accesskey="2">Examples</a></li>
  28666. </ul>
  28667. <div class="subsection-level-extent" id="Commands-8">
  28668. <h4 class="subsection"><span>36.22.1 Commands<a class="copiable-link" href="#Commands-8"> &para;</a></span></h4>
  28669. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28670. </p>
  28671. </div>
  28672. <div class="subsection-level-extent" id="Examples-48">
  28673. <h4 class="subsection"><span>36.22.2 Examples<a class="copiable-link" href="#Examples-48"> &para;</a></span></h4>
  28674. <ul class="itemize mark-bullet">
  28675. <li>Fade in first 15 seconds of audio:
  28676. <div class="example">
  28677. <pre class="example-preformatted">afade=t=in:ss=0:d=15
  28678. </pre></div>
  28679. </li><li>Fade out last 25 seconds of a 900 seconds audio:
  28680. <div class="example">
  28681. <pre class="example-preformatted">afade=t=out:st=875:d=25
  28682. </pre></div>
  28683. </li></ul>
  28684. </div>
  28685. </div>
  28686. <div class="section-level-extent" id="afftdn">
  28687. <h3 class="section"><span>36.23 afftdn<a class="copiable-link" href="#afftdn"> &para;</a></span></h3>
  28688. <p>Denoise audio samples with FFT.
  28689. </p>
  28690. <p>A description of the accepted parameters follows.
  28691. </p>
  28692. <dl class="table">
  28693. <dt><samp class="option">noise_reduction, nr</samp></dt>
  28694. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  28695. Default value is 12 dB.
  28696. </p>
  28697. </dd>
  28698. <dt><samp class="option">noise_floor, nf</samp></dt>
  28699. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  28700. Default value is -50 dB.
  28701. </p>
  28702. </dd>
  28703. <dt><samp class="option">noise_type, nt</samp></dt>
  28704. <dd><p>Set the noise type.
  28705. </p>
  28706. <p>It accepts the following values:
  28707. </p><dl class="table">
  28708. <dt><samp class="option">white, w</samp></dt>
  28709. <dd><p>Select white noise.
  28710. </p>
  28711. </dd>
  28712. <dt><samp class="option">vinyl, v</samp></dt>
  28713. <dd><p>Select vinyl noise.
  28714. </p>
  28715. </dd>
  28716. <dt><samp class="option">shellac, s</samp></dt>
  28717. <dd><p>Select shellac noise.
  28718. </p>
  28719. </dd>
  28720. <dt><samp class="option">custom, c</samp></dt>
  28721. <dd><p>Select custom noise, defined in <code class="code">bn</code> option.
  28722. </p>
  28723. <p>Default value is white noise.
  28724. </p></dd>
  28725. </dl>
  28726. </dd>
  28727. <dt><samp class="option">band_noise, bn</samp></dt>
  28728. <dd><p>Set custom band noise profile for every one of 15 bands.
  28729. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  28730. </p>
  28731. </dd>
  28732. <dt><samp class="option">residual_floor, rf</samp></dt>
  28733. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  28734. Default value is -38 dB.
  28735. </p>
  28736. </dd>
  28737. <dt><samp class="option">track_noise, tn</samp></dt>
  28738. <dd><p>Enable noise floor tracking. By default is disabled.
  28739. With this enabled, noise floor is automatically adjusted.
  28740. </p>
  28741. </dd>
  28742. <dt><samp class="option">track_residual, tr</samp></dt>
  28743. <dd><p>Enable residual tracking. By default is disabled.
  28744. </p>
  28745. </dd>
  28746. <dt><samp class="option">output_mode, om</samp></dt>
  28747. <dd><p>Set the output mode.
  28748. </p>
  28749. <p>It accepts the following values:
  28750. </p><dl class="table">
  28751. <dt><samp class="option">input, i</samp></dt>
  28752. <dd><p>Pass input unchanged.
  28753. </p>
  28754. </dd>
  28755. <dt><samp class="option">output, o</samp></dt>
  28756. <dd><p>Pass noise filtered out.
  28757. </p>
  28758. </dd>
  28759. <dt><samp class="option">noise, n</samp></dt>
  28760. <dd><p>Pass only noise.
  28761. </p>
  28762. <p>Default value is <var class="var">output</var>.
  28763. </p></dd>
  28764. </dl>
  28765. </dd>
  28766. <dt><samp class="option">adaptivity, ad</samp></dt>
  28767. <dd><p>Set the adaptivity factor, used how fast to adapt gains adjustments per
  28768. each frequency bin. Value <var class="var">0</var> enables instant adaptation, while higher values
  28769. react much slower.
  28770. Allowed range is from <var class="var">0</var> to <var class="var">1</var>. Default value is <var class="var">0.5</var>.
  28771. </p>
  28772. </dd>
  28773. <dt><samp class="option">floor_offset, fo</samp></dt>
  28774. <dd><p>Set the noise floor offset factor. This option is used to adjust offset applied to measured
  28775. noise floor. It is only effective when noise floor tracking is enabled.
  28776. 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>.
  28777. </p>
  28778. </dd>
  28779. <dt><samp class="option">noise_link, nl</samp></dt>
  28780. <dd><p>Set the noise link used for multichannel audio.
  28781. </p>
  28782. <p>It accepts the following values:
  28783. </p><dl class="table">
  28784. <dt><samp class="option">none</samp></dt>
  28785. <dd><p>Use unchanged channel&rsquo;s noise floor.
  28786. </p>
  28787. </dd>
  28788. <dt><samp class="option">min</samp></dt>
  28789. <dd><p>Use measured min noise floor of all channels.
  28790. </p>
  28791. </dd>
  28792. <dt><samp class="option">max</samp></dt>
  28793. <dd><p>Use measured max noise floor of all channels.
  28794. </p>
  28795. </dd>
  28796. <dt><samp class="option">average</samp></dt>
  28797. <dd><p>Use measured average noise floor of all channels.
  28798. </p>
  28799. <p>Default value is <var class="var">min</var>.
  28800. </p></dd>
  28801. </dl>
  28802. </dd>
  28803. <dt><samp class="option">band_multiplier, bm</samp></dt>
  28804. <dd><p>Set the band multiplier factor, used how much to spread bands across frequency bins.
  28805. 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>.
  28806. </p>
  28807. </dd>
  28808. <dt><samp class="option">sample_noise, sn</samp></dt>
  28809. <dd><p>Toggle capturing and measurement of noise profile from input audio.
  28810. </p>
  28811. <p>It accepts the following values:
  28812. </p><dl class="table">
  28813. <dt><samp class="option">start, begin</samp></dt>
  28814. <dd><p>Start sample noise capture.
  28815. </p>
  28816. </dd>
  28817. <dt><samp class="option">stop, end</samp></dt>
  28818. <dd><p>Stop sample noise capture and measure new noise band profile.
  28819. </p>
  28820. <p>Default value is <code class="code">none</code>.
  28821. </p></dd>
  28822. </dl>
  28823. </dd>
  28824. <dt><samp class="option">gain_smooth, gs</samp></dt>
  28825. <dd><p>Set gain smooth spatial radius, used to smooth gains applied to each frequency bin.
  28826. Useful to reduce random music noise artefacts.
  28827. Higher values increases smoothing of gains.
  28828. Allowed range is from <code class="code">0</code> to <code class="code">50</code>.
  28829. Default value is <code class="code">0</code>.
  28830. </p></dd>
  28831. </dl>
  28832. <ul class="mini-toc">
  28833. <li><a href="#Commands-9" accesskey="1">Commands</a></li>
  28834. <li><a href="#Examples-49" accesskey="2">Examples</a></li>
  28835. </ul>
  28836. <div class="subsection-level-extent" id="Commands-9">
  28837. <h4 class="subsection"><span>36.23.1 Commands<a class="copiable-link" href="#Commands-9"> &para;</a></span></h4>
  28838. <p>This filter supports the some above mentioned options as <a class="ref" href="#commands">commands</a>.
  28839. </p>
  28840. </div>
  28841. <div class="subsection-level-extent" id="Examples-49">
  28842. <h4 class="subsection"><span>36.23.2 Examples<a class="copiable-link" href="#Examples-49"> &para;</a></span></h4>
  28843. <ul class="itemize mark-bullet">
  28844. <li>Reduce white noise by 10dB, and use previously measured noise floor of -40dB:
  28845. <div class="example">
  28846. <pre class="example-preformatted">afftdn=nr=10:nf=-40
  28847. </pre></div>
  28848. </li><li>Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic
  28849. tracking of noise floor so noise floor will gradually change during processing:
  28850. <div class="example">
  28851. <pre class="example-preformatted">afftdn=nr=10:nf=-80:tn=1
  28852. </pre></div>
  28853. </li><li>Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile
  28854. of first 0.4 seconds of input audio:
  28855. <div class="example">
  28856. <pre class="example-preformatted">asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
  28857. </pre></div>
  28858. </li></ul>
  28859. </div>
  28860. </div>
  28861. <div class="section-level-extent" id="afftfilt">
  28862. <h3 class="section"><span>36.24 afftfilt<a class="copiable-link" href="#afftfilt"> &para;</a></span></h3>
  28863. <p>Apply arbitrary expressions to samples in frequency domain.
  28864. </p>
  28865. <dl class="table">
  28866. <dt><samp class="option">real</samp></dt>
  28867. <dd><p>Set frequency domain real expression for each separate channel separated
  28868. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  28869. If the number of input channels is greater than the number of
  28870. expressions, the last specified expression is used for the remaining
  28871. output channels.
  28872. </p>
  28873. </dd>
  28874. <dt><samp class="option">imag</samp></dt>
  28875. <dd><p>Set frequency domain imaginary expression for each separate channel
  28876. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  28877. </p>
  28878. <p>Each expression in <var class="var">real</var> and <var class="var">imag</var> can contain the following
  28879. constants and functions:
  28880. </p>
  28881. <dl class="table">
  28882. <dt><samp class="option">sr</samp></dt>
  28883. <dd><p>sample rate
  28884. </p>
  28885. </dd>
  28886. <dt><samp class="option">b</samp></dt>
  28887. <dd><p>current frequency bin number
  28888. </p>
  28889. </dd>
  28890. <dt><samp class="option">nb</samp></dt>
  28891. <dd><p>number of available bins
  28892. </p>
  28893. </dd>
  28894. <dt><samp class="option">ch</samp></dt>
  28895. <dd><p>channel number of the current expression
  28896. </p>
  28897. </dd>
  28898. <dt><samp class="option">chs</samp></dt>
  28899. <dd><p>number of channels
  28900. </p>
  28901. </dd>
  28902. <dt><samp class="option">pts</samp></dt>
  28903. <dd><p>current frame pts
  28904. </p>
  28905. </dd>
  28906. <dt><samp class="option">re</samp></dt>
  28907. <dd><p>current real part of frequency bin of current channel
  28908. </p>
  28909. </dd>
  28910. <dt><samp class="option">im</samp></dt>
  28911. <dd><p>current imaginary part of frequency bin of current channel
  28912. </p>
  28913. </dd>
  28914. <dt><samp class="option">real(b, ch)</samp></dt>
  28915. <dd><p>Return the value of real part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  28916. </p>
  28917. </dd>
  28918. <dt><samp class="option">imag(b, ch)</samp></dt>
  28919. <dd><p>Return the value of imaginary part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  28920. </p></dd>
  28921. </dl>
  28922. </dd>
  28923. <dt><samp class="option">win_size</samp></dt>
  28924. <dd><p>Set window size. Allowed range is from 16 to 131072.
  28925. Default is <code class="code">4096</code>
  28926. </p>
  28927. </dd>
  28928. <dt><samp class="option">win_func</samp></dt>
  28929. <dd><p>Set window function.
  28930. </p>
  28931. <p>It accepts the following values:
  28932. </p><dl class="table">
  28933. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  28934. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  28935. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  28936. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  28937. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  28938. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  28939. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  28940. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  28941. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  28942. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  28943. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  28944. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  28945. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  28946. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  28947. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  28948. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  28949. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  28950. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  28951. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  28952. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  28953. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  28954. </dl>
  28955. <p>Default is <code class="code">hann</code>.
  28956. </p>
  28957. </dd>
  28958. <dt><samp class="option">overlap</samp></dt>
  28959. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  28960. window function will be picked. Default is <code class="code">0.75</code>.
  28961. </p></dd>
  28962. </dl>
  28963. <ul class="mini-toc">
  28964. <li><a href="#Examples-50" accesskey="1">Examples</a></li>
  28965. </ul>
  28966. <div class="subsection-level-extent" id="Examples-50">
  28967. <h4 class="subsection"><span>36.24.1 Examples<a class="copiable-link" href="#Examples-50"> &para;</a></span></h4>
  28968. <ul class="itemize mark-bullet">
  28969. <li>Leave almost only low frequencies in audio:
  28970. <div class="example">
  28971. <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;
  28972. </pre></div>
  28973. </li><li>Apply robotize effect:
  28974. <div class="example">
  28975. <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;
  28976. </pre></div>
  28977. </li><li>Apply whisper effect:
  28978. <div class="example">
  28979. <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;
  28980. </pre></div>
  28981. </li><li>Apply phase shift:
  28982. <div class="example">
  28983. <pre class="example-preformatted">afftfilt=&quot;real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)&quot;
  28984. </pre></div>
  28985. </li></ul>
  28986. <a class="anchor" id="afir"></a></div>
  28987. </div>
  28988. <div class="section-level-extent" id="afir-1">
  28989. <h3 class="section"><span>36.25 afir<a class="copiable-link" href="#afir-1"> &para;</a></span></h3>
  28990. <p>Apply an arbitrary Finite Impulse Response filter.
  28991. </p>
  28992. <p>This filter is designed for applying long FIR filters,
  28993. up to 60 seconds long.
  28994. </p>
  28995. <p>It can be used as component for digital crossover filters,
  28996. room equalization, cross talk cancellation, wavefield synthesis,
  28997. auralization, ambiophonics, ambisonics and spatialization.
  28998. </p>
  28999. <p>This filter uses the streams higher than first one as FIR coefficients.
  29000. If the non-first stream holds a single channel, it will be used
  29001. for all input channels in the first stream, otherwise
  29002. the number of channels in the non-first stream must be same as
  29003. the number of channels in the first stream.
  29004. </p>
  29005. <p>It accepts the following parameters:
  29006. </p>
  29007. <dl class="table">
  29008. <dt><samp class="option">dry</samp></dt>
  29009. <dd><p>Set dry gain. This sets input gain.
  29010. </p>
  29011. </dd>
  29012. <dt><samp class="option">wet</samp></dt>
  29013. <dd><p>Set wet gain. This sets final output gain.
  29014. </p>
  29015. </dd>
  29016. <dt><samp class="option">length</samp></dt>
  29017. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  29018. </p>
  29019. </dd>
  29020. <dt><samp class="option">gtype</samp></dt>
  29021. <dd><p>This option is deprecated, and does nothing.
  29022. </p>
  29023. </dd>
  29024. <dt><samp class="option">irnorm</samp></dt>
  29025. <dd><p>Set norm to be applied to IR coefficients before filtering.
  29026. Allowed range is from <var class="var">-1</var> to <var class="var">2</var>.
  29027. IR coefficients are normalized with calculated vector norm set by this option.
  29028. For negative values, no norm is calculated, and IR coefficients are not modified at all.
  29029. Default is <var class="var">1</var>.
  29030. </p>
  29031. </dd>
  29032. <dt><samp class="option">irlink</samp></dt>
  29033. <dd><p>For multichannel IR if this option is set to <var class="var">true</var>, all IR channels will be
  29034. normalized with maximal measured gain of all IR channels coefficients as set by <code class="code">irnorm</code> option.
  29035. When disabled, all IR coefficients in each IR channel will be normalized independently.
  29036. Default is <var class="var">true</var>.
  29037. </p>
  29038. </dd>
  29039. <dt><samp class="option">irgain</samp></dt>
  29040. <dd><p>Set gain to be applied to IR coefficients before filtering.
  29041. Allowed range is 0 to 1. This gain is applied after any gain applied with <var class="var">irnorm</var> option.
  29042. </p>
  29043. </dd>
  29044. <dt><samp class="option">irfmt</samp></dt>
  29045. <dd><p>Set format of IR stream. Can be <code class="code">mono</code> or <code class="code">input</code>.
  29046. Default is <code class="code">input</code>.
  29047. </p>
  29048. </dd>
  29049. <dt><samp class="option">maxir</samp></dt>
  29050. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  29051. Allowed range is 0.1 to 60 seconds.
  29052. </p>
  29053. </dd>
  29054. <dt><samp class="option">response</samp></dt>
  29055. <dd><p>This option is deprecated, and does nothing.
  29056. </p>
  29057. </dd>
  29058. <dt><samp class="option">channel</samp></dt>
  29059. <dd><p>This option is deprecated, and does nothing.
  29060. </p>
  29061. </dd>
  29062. <dt><samp class="option">size</samp></dt>
  29063. <dd><p>This option is deprecated, and does nothing.
  29064. </p>
  29065. </dd>
  29066. <dt><samp class="option">rate</samp></dt>
  29067. <dd><p>This option is deprecated, and does nothing.
  29068. </p>
  29069. </dd>
  29070. <dt><samp class="option">minp</samp></dt>
  29071. <dd><p>Set minimal partition size used for convolution. Default is <var class="var">8192</var>.
  29072. Allowed range is from <var class="var">1</var> to <var class="var">65536</var>.
  29073. Lower values decreases latency at cost of higher CPU usage.
  29074. </p>
  29075. </dd>
  29076. <dt><samp class="option">maxp</samp></dt>
  29077. <dd><p>Set maximal partition size used for convolution. Default is <var class="var">8192</var>.
  29078. Allowed range is from <var class="var">8</var> to <var class="var">65536</var>.
  29079. Lower values may increase CPU usage.
  29080. </p>
  29081. </dd>
  29082. <dt><samp class="option">nbirs</samp></dt>
  29083. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  29084. Allowed range is from <var class="var">1</var> to <var class="var">32</var>. Default is <var class="var">1</var>.
  29085. </p>
  29086. </dd>
  29087. <dt><samp class="option">ir</samp></dt>
  29088. <dd><p>Set IR stream which will be used for convolution, starting from <var class="var">0</var>, should always be
  29089. lower than supplied value by <code class="code">nbirs</code> option. Default is <var class="var">0</var>.
  29090. This option can be changed at runtime via <a class="ref" href="#commands">commands</a>.
  29091. </p>
  29092. </dd>
  29093. <dt><samp class="option">precision</samp></dt>
  29094. <dd><p>Set which precision to use when processing samples.
  29095. </p>
  29096. <dl class="table">
  29097. <dt><samp class="option">auto</samp></dt>
  29098. <dd><p>Auto pick internal sample format depending on other filters.
  29099. </p>
  29100. </dd>
  29101. <dt><samp class="option">float</samp></dt>
  29102. <dd><p>Always use single-floating point precision sample format.
  29103. </p>
  29104. </dd>
  29105. <dt><samp class="option">double</samp></dt>
  29106. <dd><p>Always use double-floating point precision sample format.
  29107. </p></dd>
  29108. </dl>
  29109. <p>Default value is auto.
  29110. </p>
  29111. </dd>
  29112. <dt><samp class="option">irload</samp></dt>
  29113. <dd><p>Set when to load IR stream. Can be <code class="code">init</code> or <code class="code">access</code>.
  29114. First one load and prepares all IRs on initialization, second one
  29115. once on first access of specific IR.
  29116. Default is <code class="code">init</code>.
  29117. </p></dd>
  29118. </dl>
  29119. <ul class="mini-toc">
  29120. <li><a href="#Examples-51" accesskey="1">Examples</a></li>
  29121. </ul>
  29122. <div class="subsection-level-extent" id="Examples-51">
  29123. <h4 class="subsection"><span>36.25.1 Examples<a class="copiable-link" href="#Examples-51"> &para;</a></span></h4>
  29124. <ul class="itemize mark-bullet">
  29125. <li>Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  29126. <div class="example">
  29127. <pre class="example-preformatted">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  29128. </pre></div>
  29129. </li><li>Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel,
  29130. the impulse response files are files with names l_ir.wav and r_ir.wav, and setting irnorm option value:
  29131. <div class="example">
  29132. <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;
  29133. </pre></div>
  29134. </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:
  29135. <div class="example">
  29136. <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;
  29137. </pre></div>
  29138. </li></ul>
  29139. <a class="anchor" id="aformat"></a></div>
  29140. </div>
  29141. <div class="section-level-extent" id="aformat-1">
  29142. <h3 class="section"><span>36.26 aformat<a class="copiable-link" href="#aformat-1"> &para;</a></span></h3>
  29143. <p>Set output format constraints for the input audio. The framework will
  29144. negotiate the most appropriate format to minimize conversions.
  29145. </p>
  29146. <p>It accepts the following parameters:
  29147. </p><dl class="table">
  29148. <dt><samp class="option">sample_fmts, f</samp></dt>
  29149. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  29150. </p>
  29151. </dd>
  29152. <dt><samp class="option">sample_rates, r</samp></dt>
  29153. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  29154. </p>
  29155. </dd>
  29156. <dt><samp class="option">channel_layouts, cl</samp></dt>
  29157. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  29158. </p>
  29159. <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>
  29160. for the required syntax.
  29161. </p></dd>
  29162. </dl>
  29163. <p>If a parameter is omitted, all values are allowed.
  29164. </p>
  29165. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  29166. </p><div class="example">
  29167. <pre class="example-preformatted">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  29168. </pre></div>
  29169. </div>
  29170. <div class="section-level-extent" id="afreqshift">
  29171. <h3 class="section"><span>36.27 afreqshift<a class="copiable-link" href="#afreqshift"> &para;</a></span></h3>
  29172. <p>Apply frequency shift to input audio samples.
  29173. </p>
  29174. <p>The filter accepts the following options:
  29175. </p>
  29176. <dl class="table">
  29177. <dt><samp class="option">shift</samp></dt>
  29178. <dd><p>Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
  29179. Default value is 0.0.
  29180. </p>
  29181. </dd>
  29182. <dt><samp class="option">level</samp></dt>
  29183. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  29184. Default value is 1.0.
  29185. </p>
  29186. </dd>
  29187. <dt><samp class="option">order</samp></dt>
  29188. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  29189. Default value is 8.
  29190. </p></dd>
  29191. </dl>
  29192. <ul class="mini-toc">
  29193. <li><a href="#Commands-10" accesskey="1">Commands</a></li>
  29194. </ul>
  29195. <div class="subsection-level-extent" id="Commands-10">
  29196. <h4 class="subsection"><span>36.27.1 Commands<a class="copiable-link" href="#Commands-10"> &para;</a></span></h4>
  29197. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  29198. </p>
  29199. </div>
  29200. </div>
  29201. <div class="section-level-extent" id="afwtdn">
  29202. <h3 class="section"><span>36.28 afwtdn<a class="copiable-link" href="#afwtdn"> &para;</a></span></h3>
  29203. <p>Reduce broadband noise from input samples using Wavelets.
  29204. </p>
  29205. <p>A description of the accepted options follows.
  29206. </p>
  29207. <dl class="table">
  29208. <dt><samp class="option">sigma</samp></dt>
  29209. <dd><p>Set the noise sigma, allowed range is from 0 to 1.
  29210. Default value is 0.
  29211. This option controls strength of denoising applied to input samples.
  29212. Most useful way to set this option is via decibels, eg. -45dB.
  29213. </p>
  29214. </dd>
  29215. <dt><samp class="option">levels</samp></dt>
  29216. <dd><p>Set the number of wavelet levels of decomposition.
  29217. Allowed range is from 1 to 12.
  29218. Default value is 10.
  29219. Setting this too low make denoising performance very poor.
  29220. </p>
  29221. </dd>
  29222. <dt><samp class="option">wavet</samp></dt>
  29223. <dd><p>Set wavelet type for decomposition of input frame.
  29224. They are sorted by number of coefficients, from lowest to highest.
  29225. More coefficients means worse filtering speed, but overall better quality.
  29226. Available wavelets are:
  29227. </p>
  29228. <dl class="table">
  29229. <dt>&lsquo;<samp class="samp">sym2</samp>&rsquo;</dt>
  29230. <dt>&lsquo;<samp class="samp">sym4</samp>&rsquo;</dt>
  29231. <dt>&lsquo;<samp class="samp">rbior68</samp>&rsquo;</dt>
  29232. <dt>&lsquo;<samp class="samp">deb10</samp>&rsquo;</dt>
  29233. <dt>&lsquo;<samp class="samp">sym10</samp>&rsquo;</dt>
  29234. <dt>&lsquo;<samp class="samp">coif5</samp>&rsquo;</dt>
  29235. <dt>&lsquo;<samp class="samp">bl3</samp>&rsquo;</dt>
  29236. </dl>
  29237. </dd>
  29238. <dt><samp class="option">percent</samp></dt>
  29239. <dd><p>Set percent of full denoising. Allowed range is from 0 to 100 percent.
  29240. Default value is 85 percent or partial denoising.
  29241. </p>
  29242. </dd>
  29243. <dt><samp class="option">profile</samp></dt>
  29244. <dd><p>If enabled, first input frame will be used as noise profile.
  29245. If first frame samples contain non-noise performance will be very poor.
  29246. </p>
  29247. </dd>
  29248. <dt><samp class="option">adaptive</samp></dt>
  29249. <dd><p>If enabled, input frames are analyzed for presence of noise.
  29250. If noise is detected with high possibility then input frame profile will be
  29251. used for processing following frames, until new noise frame is detected.
  29252. </p>
  29253. </dd>
  29254. <dt><samp class="option">samples</samp></dt>
  29255. <dd><p>Set size of single frame in number of samples. Allowed range is from 512 to
  29256. 65536. Default frame size is 8192 samples.
  29257. </p>
  29258. </dd>
  29259. <dt><samp class="option">softness</samp></dt>
  29260. <dd><p>Set softness applied inside thresholding function. Allowed range is from 0 to
  29261. 10. Default softness is 1.
  29262. </p></dd>
  29263. </dl>
  29264. <ul class="mini-toc">
  29265. <li><a href="#Commands-11" accesskey="1">Commands</a></li>
  29266. </ul>
  29267. <div class="subsection-level-extent" id="Commands-11">
  29268. <h4 class="subsection"><span>36.28.1 Commands<a class="copiable-link" href="#Commands-11"> &para;</a></span></h4>
  29269. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  29270. </p>
  29271. </div>
  29272. </div>
  29273. <div class="section-level-extent" id="agate">
  29274. <h3 class="section"><span>36.29 agate<a class="copiable-link" href="#agate"> &para;</a></span></h3>
  29275. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  29276. processing reduces disturbing noise between useful signals.
  29277. </p>
  29278. <p>Gating is done by detecting the volume below a chosen level <var class="var">threshold</var>
  29279. and dividing it by the factor set with <var class="var">ratio</var>. The bottom of the noise
  29280. floor is set via <var class="var">range</var>. Because an exact manipulation of the signal
  29281. would cause distortion of the waveform the reduction can be levelled over
  29282. time. This is done by setting <var class="var">attack</var> and <var class="var">release</var>.
  29283. </p>
  29284. <p><var class="var">attack</var> determines how long the signal has to fall below the threshold
  29285. before any reduction will occur and <var class="var">release</var> sets the time the signal
  29286. has to rise above the threshold to reduce the reduction again.
  29287. Shorter signals than the chosen attack time will be left untouched.
  29288. </p>
  29289. <dl class="table">
  29290. <dt><samp class="option">level_in</samp></dt>
  29291. <dd><p>Set input level before filtering.
  29292. Default is 1. Allowed range is from 0.015625 to 64.
  29293. </p>
  29294. </dd>
  29295. <dt><samp class="option">mode</samp></dt>
  29296. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  29297. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  29298. will be amplified, expanding dynamic range in upward direction.
  29299. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  29300. </p>
  29301. </dd>
  29302. <dt><samp class="option">range</samp></dt>
  29303. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  29304. Default is 0.06125. Allowed range is from 0 to 1.
  29305. Setting this to 0 disables reduction and then filter behaves like expander.
  29306. </p>
  29307. </dd>
  29308. <dt><samp class="option">threshold</samp></dt>
  29309. <dd><p>If a signal rises above this level the gain reduction is released.
  29310. Default is 0.125. Allowed range is from 0 to 1.
  29311. </p>
  29312. </dd>
  29313. <dt><samp class="option">ratio</samp></dt>
  29314. <dd><p>Set a ratio by which the signal is reduced.
  29315. Default is 2. Allowed range is from 1 to 9000.
  29316. </p>
  29317. </dd>
  29318. <dt><samp class="option">attack</samp></dt>
  29319. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  29320. reduction stops.
  29321. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  29322. </p>
  29323. </dd>
  29324. <dt><samp class="option">release</samp></dt>
  29325. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  29326. reduction is increased again. Default is 250 milliseconds.
  29327. Allowed range is from 0.01 to 9000.
  29328. </p>
  29329. </dd>
  29330. <dt><samp class="option">makeup</samp></dt>
  29331. <dd><p>Set amount of amplification of signal after processing.
  29332. Default is 1. Allowed range is from 1 to 64.
  29333. </p>
  29334. </dd>
  29335. <dt><samp class="option">knee</samp></dt>
  29336. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  29337. Default is 2.828427125. Allowed range is from 1 to 8.
  29338. </p>
  29339. </dd>
  29340. <dt><samp class="option">detection</samp></dt>
  29341. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  29342. Default is <code class="code">rms</code>. Can be <code class="code">peak</code> or <code class="code">rms</code>.
  29343. </p>
  29344. </dd>
  29345. <dt><samp class="option">link</samp></dt>
  29346. <dd><p>Choose if the average level between all channels or the louder channel affects
  29347. the reduction.
  29348. Default is <code class="code">average</code>. Can be <code class="code">average</code> or <code class="code">maximum</code>.
  29349. </p></dd>
  29350. </dl>
  29351. <ul class="mini-toc">
  29352. <li><a href="#Commands-12" accesskey="1">Commands</a></li>
  29353. </ul>
  29354. <div class="subsection-level-extent" id="Commands-12">
  29355. <h4 class="subsection"><span>36.29.1 Commands<a class="copiable-link" href="#Commands-12"> &para;</a></span></h4>
  29356. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  29357. </p>
  29358. </div>
  29359. </div>
  29360. <div class="section-level-extent" id="aiir">
  29361. <h3 class="section"><span>36.30 aiir<a class="copiable-link" href="#aiir"> &para;</a></span></h3>
  29362. <p>Apply an arbitrary Infinite Impulse Response filter.
  29363. </p>
  29364. <p>It accepts the following parameters:
  29365. </p>
  29366. <dl class="table">
  29367. <dt><samp class="option">zeros, z</samp></dt>
  29368. <dd><p>Set B/numerator/zeros/reflection coefficients.
  29369. </p>
  29370. </dd>
  29371. <dt><samp class="option">poles, p</samp></dt>
  29372. <dd><p>Set A/denominator/poles/ladder coefficients.
  29373. </p>
  29374. </dd>
  29375. <dt><samp class="option">gains, k</samp></dt>
  29376. <dd><p>Set channels gains.
  29377. </p>
  29378. </dd>
  29379. <dt><samp class="option">dry_gain</samp></dt>
  29380. <dd><p>Set input gain.
  29381. </p>
  29382. </dd>
  29383. <dt><samp class="option">wet_gain</samp></dt>
  29384. <dd><p>Set output gain.
  29385. </p>
  29386. </dd>
  29387. <dt><samp class="option">format, f</samp></dt>
  29388. <dd><p>Set coefficients format.
  29389. </p>
  29390. <dl class="table">
  29391. <dt>&lsquo;<samp class="samp">ll</samp>&rsquo;</dt>
  29392. <dd><p>lattice-ladder function
  29393. </p></dd>
  29394. <dt>&lsquo;<samp class="samp">sf</samp>&rsquo;</dt>
  29395. <dd><p>analog transfer function
  29396. </p></dd>
  29397. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  29398. <dd><p>digital transfer function
  29399. </p></dd>
  29400. <dt>&lsquo;<samp class="samp">zp</samp>&rsquo;</dt>
  29401. <dd><p>Z-plane zeros/poles, cartesian (default)
  29402. </p></dd>
  29403. <dt>&lsquo;<samp class="samp">pr</samp>&rsquo;</dt>
  29404. <dd><p>Z-plane zeros/poles, polar radians
  29405. </p></dd>
  29406. <dt>&lsquo;<samp class="samp">pd</samp>&rsquo;</dt>
  29407. <dd><p>Z-plane zeros/poles, polar degrees
  29408. </p></dd>
  29409. <dt>&lsquo;<samp class="samp">sp</samp>&rsquo;</dt>
  29410. <dd><p>S-plane zeros/poles
  29411. </p></dd>
  29412. </dl>
  29413. </dd>
  29414. <dt><samp class="option">process, r</samp></dt>
  29415. <dd><p>Set type of processing.
  29416. </p>
  29417. <dl class="table">
  29418. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  29419. <dd><p>direct processing
  29420. </p></dd>
  29421. <dt>&lsquo;<samp class="samp">s</samp>&rsquo;</dt>
  29422. <dd><p>serial processing
  29423. </p></dd>
  29424. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  29425. <dd><p>parallel processing
  29426. </p></dd>
  29427. </dl>
  29428. </dd>
  29429. <dt><samp class="option">precision, e</samp></dt>
  29430. <dd><p>Set filtering precision.
  29431. </p>
  29432. <dl class="table">
  29433. <dt>&lsquo;<samp class="samp">dbl</samp>&rsquo;</dt>
  29434. <dd><p>double-precision floating-point (default)
  29435. </p></dd>
  29436. <dt>&lsquo;<samp class="samp">flt</samp>&rsquo;</dt>
  29437. <dd><p>single-precision floating-point
  29438. </p></dd>
  29439. <dt>&lsquo;<samp class="samp">i32</samp>&rsquo;</dt>
  29440. <dd><p>32-bit integers
  29441. </p></dd>
  29442. <dt>&lsquo;<samp class="samp">i16</samp>&rsquo;</dt>
  29443. <dd><p>16-bit integers
  29444. </p></dd>
  29445. </dl>
  29446. </dd>
  29447. <dt><samp class="option">normalize, n</samp></dt>
  29448. <dd><p>Normalize filter coefficients, by default is enabled.
  29449. Enabling it will normalize magnitude response at DC to 0dB.
  29450. </p>
  29451. </dd>
  29452. <dt><samp class="option">mix</samp></dt>
  29453. <dd><p>How much to use filtered signal in output. Default is 1.
  29454. Range is between 0 and 1.
  29455. </p>
  29456. </dd>
  29457. <dt><samp class="option">response</samp></dt>
  29458. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  29459. By default it is disabled.
  29460. </p>
  29461. </dd>
  29462. <dt><samp class="option">channel</samp></dt>
  29463. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  29464. displayed. This option is used only when <var class="var">response</var> is enabled.
  29465. </p>
  29466. </dd>
  29467. <dt><samp class="option">size</samp></dt>
  29468. <dd><p>Set video stream size. This option is used only when <var class="var">response</var> is enabled.
  29469. </p></dd>
  29470. </dl>
  29471. <p>Coefficients in <code class="code">tf</code> and <code class="code">sf</code> format are separated by spaces and are in ascending
  29472. order.
  29473. </p>
  29474. <p>Coefficients in <code class="code">zp</code> format are separated by spaces and order of coefficients
  29475. doesn&rsquo;t matter. Coefficients in <code class="code">zp</code> format are complex numbers with <var class="var">i</var>
  29476. imaginary unit.
  29477. </p>
  29478. <p>Different coefficients and gains can be provided for every channel, in such case
  29479. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  29480. used for all remaining channels.
  29481. </p>
  29482. <ul class="mini-toc">
  29483. <li><a href="#Examples-52" accesskey="1">Examples</a></li>
  29484. </ul>
  29485. <div class="subsection-level-extent" id="Examples-52">
  29486. <h4 class="subsection"><span>36.30.1 Examples<a class="copiable-link" href="#Examples-52"> &para;</a></span></h4>
  29487. <ul class="itemize mark-bullet">
  29488. <li>Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  29489. <div class="example">
  29490. <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
  29491. </pre></div>
  29492. </li><li>Same as above but in <code class="code">zp</code> format:
  29493. <div class="example">
  29494. <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
  29495. </pre></div>
  29496. </li><li>Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format:
  29497. <div class="example">
  29498. <pre class="example-preformatted">aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
  29499. </pre></div>
  29500. </li></ul>
  29501. </div>
  29502. </div>
  29503. <div class="section-level-extent" id="alimiter">
  29504. <h3 class="section"><span>36.31 alimiter<a class="copiable-link" href="#alimiter"> &para;</a></span></h3>
  29505. <p>The limiter prevents an input signal from rising over a desired threshold.
  29506. This limiter uses lookahead technology to prevent your signal from distorting.
  29507. It means that there is a small delay after the signal is processed. Keep in mind
  29508. that the delay it produces is the attack time you set.
  29509. </p>
  29510. <p>The filter accepts the following options:
  29511. </p>
  29512. <dl class="table">
  29513. <dt><samp class="option">level_in</samp></dt>
  29514. <dd><p>Set input gain. Default is 1.
  29515. </p>
  29516. </dd>
  29517. <dt><samp class="option">level_out</samp></dt>
  29518. <dd><p>Set output gain. Default is 1.
  29519. </p>
  29520. </dd>
  29521. <dt><samp class="option">limit</samp></dt>
  29522. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  29523. </p>
  29524. </dd>
  29525. <dt><samp class="option">attack</samp></dt>
  29526. <dd><p>The limiter will reach its attenuation level in this amount of time in
  29527. milliseconds. Default is 5 milliseconds.
  29528. </p>
  29529. </dd>
  29530. <dt><samp class="option">release</samp></dt>
  29531. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  29532. Default is 50 milliseconds.
  29533. </p>
  29534. </dd>
  29535. <dt><samp class="option">asc</samp></dt>
  29536. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  29537. average reduction level rather than reaching a reduction of 0 in the release
  29538. time.
  29539. </p>
  29540. </dd>
  29541. <dt><samp class="option">asc_level</samp></dt>
  29542. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  29543. in release time while 1 produces higher release times.
  29544. </p>
  29545. </dd>
  29546. <dt><samp class="option">level</samp></dt>
  29547. <dd><p>Auto level output signal. Default is enabled.
  29548. This normalizes audio back to 0dB if enabled.
  29549. </p>
  29550. </dd>
  29551. <dt><samp class="option">latency</samp></dt>
  29552. <dd><p>Compensate the delay introduced by using the lookahead buffer set with attack
  29553. parameter. Also flush the valid audio data in the lookahead buffer when the
  29554. stream hits EOF.
  29555. </p></dd>
  29556. </dl>
  29557. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  29558. with <a class="ref" href="#aresample">aresample</a> before applying this filter.
  29559. </p>
  29560. </div>
  29561. <div class="section-level-extent" id="allpass">
  29562. <h3 class="section"><span>36.32 allpass<a class="copiable-link" href="#allpass"> &para;</a></span></h3>
  29563. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  29564. <var class="var">frequency</var>, and filter-width <var class="var">width</var>.
  29565. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  29566. without changing its frequency to amplitude relationship.
  29567. </p>
  29568. <p>The filter accepts the following options:
  29569. </p>
  29570. <dl class="table">
  29571. <dt><samp class="option">frequency, f</samp></dt>
  29572. <dd><p>Set frequency in Hz.
  29573. </p>
  29574. </dd>
  29575. <dt><samp class="option">width_type, t</samp></dt>
  29576. <dd><p>Set method to specify band-width of filter.
  29577. </p><dl class="table">
  29578. <dt><samp class="option">h</samp></dt>
  29579. <dd><p>Hz
  29580. </p></dd>
  29581. <dt><samp class="option">q</samp></dt>
  29582. <dd><p>Q-Factor
  29583. </p></dd>
  29584. <dt><samp class="option">o</samp></dt>
  29585. <dd><p>octave
  29586. </p></dd>
  29587. <dt><samp class="option">s</samp></dt>
  29588. <dd><p>slope
  29589. </p></dd>
  29590. <dt><samp class="option">k</samp></dt>
  29591. <dd><p>kHz
  29592. </p></dd>
  29593. </dl>
  29594. </dd>
  29595. <dt><samp class="option">width, w</samp></dt>
  29596. <dd><p>Specify the band-width of a filter in width_type units.
  29597. </p>
  29598. </dd>
  29599. <dt><samp class="option">mix, m</samp></dt>
  29600. <dd><p>How much to use filtered signal in output. Default is 1.
  29601. Range is between 0 and 1.
  29602. </p>
  29603. </dd>
  29604. <dt><samp class="option">channels, c</samp></dt>
  29605. <dd><p>Specify which channels to filter, by default all available are filtered.
  29606. </p>
  29607. </dd>
  29608. <dt><samp class="option">normalize, n</samp></dt>
  29609. <dd><p>Normalize biquad coefficients, by default is disabled.
  29610. Enabling it will normalize magnitude response at DC to 0dB.
  29611. </p>
  29612. </dd>
  29613. <dt><samp class="option">order, o</samp></dt>
  29614. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  29615. </p>
  29616. </dd>
  29617. <dt><samp class="option">transform, a</samp></dt>
  29618. <dd><p>Set transform type of IIR filter.
  29619. </p><dl class="table">
  29620. <dt><samp class="option">di</samp></dt>
  29621. <dt><samp class="option">dii</samp></dt>
  29622. <dt><samp class="option">tdi</samp></dt>
  29623. <dt><samp class="option">tdii</samp></dt>
  29624. <dt><samp class="option">latt</samp></dt>
  29625. <dt><samp class="option">svf</samp></dt>
  29626. <dt><samp class="option">zdf</samp></dt>
  29627. </dl>
  29628. </dd>
  29629. <dt><samp class="option">precision, r</samp></dt>
  29630. <dd><p>Set precision of filtering.
  29631. </p><dl class="table">
  29632. <dt><samp class="option">auto</samp></dt>
  29633. <dd><p>Pick automatic sample format depending on surround filters.
  29634. </p></dd>
  29635. <dt><samp class="option">s16</samp></dt>
  29636. <dd><p>Always use signed 16-bit.
  29637. </p></dd>
  29638. <dt><samp class="option">s32</samp></dt>
  29639. <dd><p>Always use signed 32-bit.
  29640. </p></dd>
  29641. <dt><samp class="option">f32</samp></dt>
  29642. <dd><p>Always use float 32-bit.
  29643. </p></dd>
  29644. <dt><samp class="option">f64</samp></dt>
  29645. <dd><p>Always use float 64-bit.
  29646. </p></dd>
  29647. </dl>
  29648. </dd>
  29649. </dl>
  29650. <ul class="mini-toc">
  29651. <li><a href="#Commands-13" accesskey="1">Commands</a></li>
  29652. </ul>
  29653. <div class="subsection-level-extent" id="Commands-13">
  29654. <h4 class="subsection"><span>36.32.1 Commands<a class="copiable-link" href="#Commands-13"> &para;</a></span></h4>
  29655. <p>This filter supports the following commands:
  29656. </p><dl class="table">
  29657. <dt><samp class="option">frequency, f</samp></dt>
  29658. <dd><p>Change allpass frequency.
  29659. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  29660. </p>
  29661. </dd>
  29662. <dt><samp class="option">width_type, t</samp></dt>
  29663. <dd><p>Change allpass width_type.
  29664. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  29665. </p>
  29666. </dd>
  29667. <dt><samp class="option">width, w</samp></dt>
  29668. <dd><p>Change allpass width.
  29669. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  29670. </p>
  29671. </dd>
  29672. <dt><samp class="option">mix, m</samp></dt>
  29673. <dd><p>Change allpass mix.
  29674. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  29675. </p></dd>
  29676. </dl>
  29677. </div>
  29678. </div>
  29679. <div class="section-level-extent" id="aloop">
  29680. <h3 class="section"><span>36.33 aloop<a class="copiable-link" href="#aloop"> &para;</a></span></h3>
  29681. <p>Loop audio samples.
  29682. </p>
  29683. <p>The filter accepts the following options:
  29684. </p>
  29685. <dl class="table">
  29686. <dt><samp class="option">loop</samp></dt>
  29687. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  29688. Default is 0.
  29689. </p>
  29690. </dd>
  29691. <dt><samp class="option">size</samp></dt>
  29692. <dd><p>Set maximal number of samples. Default is 0.
  29693. </p>
  29694. </dd>
  29695. <dt><samp class="option">start</samp></dt>
  29696. <dd><p>Set first sample of loop. Default is 0.
  29697. </p>
  29698. </dd>
  29699. <dt><samp class="option">time</samp></dt>
  29700. <dd><p>Set the time of loop start in seconds.
  29701. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  29702. </p></dd>
  29703. </dl>
  29704. <a class="anchor" id="amerge"></a></div>
  29705. <div class="section-level-extent" id="amerge-1">
  29706. <h3 class="section"><span>36.34 amerge<a class="copiable-link" href="#amerge-1"> &para;</a></span></h3>
  29707. <p>Merge two or more audio streams into a single multi-channel stream.
  29708. </p>
  29709. <p>The filter accepts the following options:
  29710. </p>
  29711. <dl class="table">
  29712. <dt><samp class="option">inputs</samp></dt>
  29713. <dd><p>Set the number of inputs. Default is 2.
  29714. </p>
  29715. </dd>
  29716. </dl>
  29717. <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
  29718. the channel layout of the output will be set accordingly and the channels
  29719. will be reordered as necessary. If the channel layouts of the inputs are not
  29720. disjoint, the output will have all the channels of the first input then all
  29721. the channels of the second input, in that order, and the channel layout of
  29722. the output will be the default value corresponding to the total number of
  29723. channels.
  29724. </p>
  29725. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  29726. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  29727. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  29728. first input, b1 is the first channel of the second input).
  29729. </p>
  29730. <p>On the other hand, if both input are in stereo, the output channels will be
  29731. in the default order: a1, a2, b1, b2, and the channel layout will be
  29732. arbitrarily set to 4.0, which may or may not be the expected value.
  29733. </p>
  29734. <p>All inputs must have the same sample rate, and format.
  29735. </p>
  29736. <p>If inputs do not have the same duration, the output will stop with the
  29737. shortest.
  29738. </p>
  29739. <ul class="mini-toc">
  29740. <li><a href="#Examples-53" accesskey="1">Examples</a></li>
  29741. </ul>
  29742. <div class="subsection-level-extent" id="Examples-53">
  29743. <h4 class="subsection"><span>36.34.1 Examples<a class="copiable-link" href="#Examples-53"> &para;</a></span></h4>
  29744. <ul class="itemize mark-bullet">
  29745. <li>Merge two mono files into a stereo stream:
  29746. <div class="example">
  29747. <pre class="example-preformatted">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  29748. </pre></div>
  29749. </li><li>Multiple merges assuming 1 video stream and 6 audio streams in <samp class="file">input.mkv</samp>:
  29750. <div class="example">
  29751. <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
  29752. </pre></div>
  29753. </li></ul>
  29754. </div>
  29755. </div>
  29756. <div class="section-level-extent" id="amix">
  29757. <h3 class="section"><span>36.35 amix<a class="copiable-link" href="#amix"> &para;</a></span></h3>
  29758. <p>Mixes multiple audio inputs into a single output.
  29759. </p>
  29760. <p>Note that this filter only supports float samples (the <var class="var">amerge</var>
  29761. and <var class="var">pan</var> audio filters support many formats). If the <var class="var">amix</var>
  29762. input has integer samples then <a class="ref" href="#aresample">aresample</a> will be automatically
  29763. inserted to perform the conversion to float samples.
  29764. </p>
  29765. <p>It accepts the following parameters:
  29766. </p><dl class="table">
  29767. <dt><samp class="option">inputs</samp></dt>
  29768. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  29769. </p>
  29770. </dd>
  29771. <dt><samp class="option">duration</samp></dt>
  29772. <dd><p>How to determine the end-of-stream.
  29773. </p><dl class="table">
  29774. <dt><samp class="option">longest</samp></dt>
  29775. <dd><p>The duration of the longest input. (default)
  29776. </p>
  29777. </dd>
  29778. <dt><samp class="option">shortest</samp></dt>
  29779. <dd><p>The duration of the shortest input.
  29780. </p>
  29781. </dd>
  29782. <dt><samp class="option">first</samp></dt>
  29783. <dd><p>The duration of the first input.
  29784. </p>
  29785. </dd>
  29786. </dl>
  29787. </dd>
  29788. <dt><samp class="option">dropout_transition</samp></dt>
  29789. <dd><p>The transition time, in seconds, for volume renormalization when an input
  29790. stream ends. The default value is 2 seconds.
  29791. </p>
  29792. </dd>
  29793. <dt><samp class="option">weights</samp></dt>
  29794. <dd><p>Specify weight of each input audio stream as a sequence of numbers separated
  29795. by a space. If fewer weights are specified compared to number of inputs, the
  29796. last weight is assigned to the remaining inputs.
  29797. Default weight for each input is 1.
  29798. </p>
  29799. </dd>
  29800. <dt><samp class="option">normalize</samp></dt>
  29801. <dd><p>Always scale inputs instead of only doing summation of samples.
  29802. Beware of heavy clipping if inputs are not normalized prior or after filtering
  29803. by this filter if this option is disabled. By default is enabled.
  29804. </p></dd>
  29805. </dl>
  29806. <ul class="mini-toc">
  29807. <li><a href="#Examples-54" accesskey="1">Examples</a></li>
  29808. <li><a href="#Commands-14" accesskey="2">Commands</a></li>
  29809. </ul>
  29810. <div class="subsection-level-extent" id="Examples-54">
  29811. <h4 class="subsection"><span>36.35.1 Examples<a class="copiable-link" href="#Examples-54"> &para;</a></span></h4>
  29812. <ul class="itemize mark-bullet">
  29813. <li>This will mix 3 input audio streams to a single output with the same duration as the
  29814. first input and a dropout transition time of 3 seconds:
  29815. <div class="example">
  29816. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  29817. </pre></div>
  29818. </li><li>This will mix one vocal and one music input audio stream to a single output with the same duration as the
  29819. longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized:
  29820. <div class="example">
  29821. <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
  29822. </pre></div>
  29823. </li></ul>
  29824. </div>
  29825. <div class="subsection-level-extent" id="Commands-14">
  29826. <h4 class="subsection"><span>36.35.2 Commands<a class="copiable-link" href="#Commands-14"> &para;</a></span></h4>
  29827. <p>This filter supports the following commands:
  29828. </p><dl class="table">
  29829. <dt><samp class="option">weights</samp></dt>
  29830. <dt><samp class="option">normalize</samp></dt>
  29831. <dd><p>Syntax is same as option with same name.
  29832. </p></dd>
  29833. </dl>
  29834. </div>
  29835. </div>
  29836. <div class="section-level-extent" id="amultiply">
  29837. <h3 class="section"><span>36.36 amultiply<a class="copiable-link" href="#amultiply"> &para;</a></span></h3>
  29838. <p>Multiply first audio stream with second audio stream and store result
  29839. in output audio stream. Multiplication is done by multiplying each
  29840. sample from first stream with sample at same position from second stream.
  29841. </p>
  29842. <p>With this element-wise multiplication one can create amplitude fades and
  29843. amplitude modulations.
  29844. </p>
  29845. </div>
  29846. <div class="section-level-extent" id="anequalizer">
  29847. <h3 class="section"><span>36.37 anequalizer<a class="copiable-link" href="#anequalizer"> &para;</a></span></h3>
  29848. <p>High-order parametric multiband equalizer for each channel.
  29849. </p>
  29850. <p>It accepts the following parameters:
  29851. </p><dl class="table">
  29852. <dt><samp class="option">params</samp></dt>
  29853. <dd>
  29854. <p>This option string is in format:
  29855. &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;
  29856. Each equalizer band is separated by &rsquo;|&rsquo;.
  29857. </p>
  29858. <dl class="table">
  29859. <dt><samp class="option">chn</samp></dt>
  29860. <dd><p>Set channel number to which equalization will be applied.
  29861. If input doesn&rsquo;t have that channel the entry is ignored.
  29862. </p>
  29863. </dd>
  29864. <dt><samp class="option">f</samp></dt>
  29865. <dd><p>Set central frequency for band.
  29866. If input doesn&rsquo;t have that frequency the entry is ignored.
  29867. </p>
  29868. </dd>
  29869. <dt><samp class="option">w</samp></dt>
  29870. <dd><p>Set band width in Hertz.
  29871. </p>
  29872. </dd>
  29873. <dt><samp class="option">g</samp></dt>
  29874. <dd><p>Set band gain in dB.
  29875. </p>
  29876. </dd>
  29877. <dt><samp class="option">t</samp></dt>
  29878. <dd><p>Set filter type for band, optional, can be:
  29879. </p>
  29880. <dl class="table">
  29881. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  29882. <dd><p>Butterworth, this is default.
  29883. </p>
  29884. </dd>
  29885. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  29886. <dd><p>Chebyshev type 1.
  29887. </p>
  29888. </dd>
  29889. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  29890. <dd><p>Chebyshev type 2.
  29891. </p></dd>
  29892. </dl>
  29893. </dd>
  29894. </dl>
  29895. </dd>
  29896. <dt><samp class="option">curves</samp></dt>
  29897. <dd><p>With this option activated frequency response of anequalizer is displayed
  29898. in video stream.
  29899. </p>
  29900. </dd>
  29901. <dt><samp class="option">size</samp></dt>
  29902. <dd><p>Set video stream size. Only useful if curves option is activated.
  29903. </p>
  29904. </dd>
  29905. <dt><samp class="option">mgain</samp></dt>
  29906. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  29907. Setting this to a reasonable value makes it possible to display gain which is derived from
  29908. neighbour bands which are too close to each other and thus produce higher gain
  29909. when both are activated.
  29910. </p>
  29911. </dd>
  29912. <dt><samp class="option">fscale</samp></dt>
  29913. <dd><p>Set frequency scale used to draw frequency response in video output.
  29914. Can be linear or logarithmic. Default is logarithmic.
  29915. </p>
  29916. </dd>
  29917. <dt><samp class="option">colors</samp></dt>
  29918. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  29919. This is list of color names separated by space or by &rsquo;|&rsquo;.
  29920. Unrecognised or missing colors will be replaced by white color.
  29921. </p></dd>
  29922. </dl>
  29923. <ul class="mini-toc">
  29924. <li><a href="#Examples-55" accesskey="1">Examples</a></li>
  29925. <li><a href="#Commands-15" accesskey="2">Commands</a></li>
  29926. </ul>
  29927. <div class="subsection-level-extent" id="Examples-55">
  29928. <h4 class="subsection"><span>36.37.1 Examples<a class="copiable-link" href="#Examples-55"> &para;</a></span></h4>
  29929. <ul class="itemize mark-bullet">
  29930. <li>Lower gain by 10 of central frequency 200Hz and width 100 Hz
  29931. for first 2 channels using Chebyshev type 1 filter:
  29932. <div class="example">
  29933. <pre class="example-preformatted">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  29934. </pre></div>
  29935. </li></ul>
  29936. </div>
  29937. <div class="subsection-level-extent" id="Commands-15">
  29938. <h4 class="subsection"><span>36.37.2 Commands<a class="copiable-link" href="#Commands-15"> &para;</a></span></h4>
  29939. <p>This filter supports the following commands:
  29940. </p><dl class="table">
  29941. <dt><samp class="option">change</samp></dt>
  29942. <dd><p>Alter existing filter parameters.
  29943. 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;
  29944. </p>
  29945. <p><var class="var">fN</var> is existing filter number, starting from 0, if no such filter is available
  29946. error is returned.
  29947. <var class="var">freq</var> set new frequency parameter.
  29948. <var class="var">width</var> set new width parameter in Hertz.
  29949. <var class="var">gain</var> set new gain parameter in dB.
  29950. </p>
  29951. <p>Full filter invocation with asendcmd may look like this:
  29952. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  29953. </p></dd>
  29954. </dl>
  29955. </div>
  29956. </div>
  29957. <div class="section-level-extent" id="anlmdn">
  29958. <h3 class="section"><span>36.38 anlmdn<a class="copiable-link" href="#anlmdn"> &para;</a></span></h3>
  29959. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  29960. </p>
  29961. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  29962. context similarity is defined by comparing their surrounding patches of size
  29963. <samp class="option">p</samp>. Patches are searched in an area of <samp class="option">r</samp> around the sample.
  29964. </p>
  29965. <p>The filter accepts the following options:
  29966. </p>
  29967. <dl class="table">
  29968. <dt><samp class="option">strength, s</samp></dt>
  29969. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001.
  29970. </p>
  29971. </dd>
  29972. <dt><samp class="option">patch, p</samp></dt>
  29973. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  29974. Default value is 2 milliseconds.
  29975. </p>
  29976. </dd>
  29977. <dt><samp class="option">research, r</samp></dt>
  29978. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  29979. Default value is 6 milliseconds.
  29980. </p>
  29981. </dd>
  29982. <dt><samp class="option">output, o</samp></dt>
  29983. <dd><p>Set the output mode.
  29984. </p>
  29985. <p>It accepts the following values:
  29986. </p><dl class="table">
  29987. <dt><samp class="option">i</samp></dt>
  29988. <dd><p>Pass input unchanged.
  29989. </p>
  29990. </dd>
  29991. <dt><samp class="option">o</samp></dt>
  29992. <dd><p>Pass noise filtered out.
  29993. </p>
  29994. </dd>
  29995. <dt><samp class="option">n</samp></dt>
  29996. <dd><p>Pass only noise.
  29997. </p>
  29998. <p>Default value is <var class="var">o</var>.
  29999. </p></dd>
  30000. </dl>
  30001. </dd>
  30002. <dt><samp class="option">smooth, m</samp></dt>
  30003. <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>.
  30004. </p></dd>
  30005. </dl>
  30006. <ul class="mini-toc">
  30007. <li><a href="#Commands-16" accesskey="1">Commands</a></li>
  30008. </ul>
  30009. <div class="subsection-level-extent" id="Commands-16">
  30010. <h4 class="subsection"><span>36.38.1 Commands<a class="copiable-link" href="#Commands-16"> &para;</a></span></h4>
  30011. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30012. </p>
  30013. </div>
  30014. </div>
  30015. <div class="section-level-extent" id="anlmf_002c-anlms">
  30016. <h3 class="section"><span>36.39 anlmf, anlms<a class="copiable-link" href="#anlmf_002c-anlms"> &para;</a></span></h3>
  30017. <p>Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream.
  30018. </p>
  30019. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  30020. relate to producing the least mean square of the error signal (difference between the desired,
  30021. 2nd input audio stream and the actual signal, the 1st input audio stream).
  30022. </p>
  30023. <p>A description of the accepted options follows.
  30024. </p>
  30025. <dl class="table">
  30026. <dt><samp class="option">order</samp></dt>
  30027. <dd><p>Set filter order.
  30028. </p>
  30029. </dd>
  30030. <dt><samp class="option">mu</samp></dt>
  30031. <dd><p>Set filter mu.
  30032. </p>
  30033. </dd>
  30034. <dt><samp class="option">eps</samp></dt>
  30035. <dd><p>Set the filter eps.
  30036. </p>
  30037. </dd>
  30038. <dt><samp class="option">leakage</samp></dt>
  30039. <dd><p>Set the filter leakage.
  30040. </p>
  30041. </dd>
  30042. <dt><samp class="option">out_mode</samp></dt>
  30043. <dd><p>It accepts the following values:
  30044. </p><dl class="table">
  30045. <dt><samp class="option">i</samp></dt>
  30046. <dd><p>Pass the 1st input.
  30047. </p>
  30048. </dd>
  30049. <dt><samp class="option">d</samp></dt>
  30050. <dd><p>Pass the 2nd input.
  30051. </p>
  30052. </dd>
  30053. <dt><samp class="option">o</samp></dt>
  30054. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  30055. </p>
  30056. </dd>
  30057. <dt><samp class="option">n</samp></dt>
  30058. <dd><p>Pass difference between input, 1st input and error signal estimate.
  30059. </p>
  30060. </dd>
  30061. <dt><samp class="option">e</samp></dt>
  30062. <dd><p>Pass error signal estimated samples.
  30063. </p>
  30064. <p>Default value is <var class="var">o</var>.
  30065. </p></dd>
  30066. </dl>
  30067. </dd>
  30068. <dt><samp class="option">precision</samp></dt>
  30069. <dd><p>Set which precision to use when processing samples.
  30070. </p>
  30071. <dl class="table">
  30072. <dt><samp class="option">auto</samp></dt>
  30073. <dd><p>Auto pick internal sample format depending on other filters.
  30074. </p>
  30075. </dd>
  30076. <dt><samp class="option">float</samp></dt>
  30077. <dd><p>Always use single-floating point precision sample format.
  30078. </p>
  30079. </dd>
  30080. <dt><samp class="option">double</samp></dt>
  30081. <dd><p>Always use double-floating point precision sample format.
  30082. </p></dd>
  30083. </dl>
  30084. </dd>
  30085. </dl>
  30086. <ul class="mini-toc">
  30087. <li><a href="#Examples-56" accesskey="1">Examples</a></li>
  30088. <li><a href="#Commands-17" accesskey="2">Commands</a></li>
  30089. </ul>
  30090. <div class="subsection-level-extent" id="Examples-56">
  30091. <h4 class="subsection"><span>36.39.1 Examples<a class="copiable-link" href="#Examples-56"> &para;</a></span></h4>
  30092. <ul class="itemize mark-bullet">
  30093. <li>One of many usages of this filter is noise reduction, input audio is filtered
  30094. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  30095. <div class="example">
  30096. <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
  30097. </pre></div>
  30098. </li></ul>
  30099. </div>
  30100. <div class="subsection-level-extent" id="Commands-17">
  30101. <h4 class="subsection"><span>36.39.2 Commands<a class="copiable-link" href="#Commands-17"> &para;</a></span></h4>
  30102. <p>This filter supports the same commands as options, excluding option <code class="code">order</code>.
  30103. </p>
  30104. </div>
  30105. </div>
  30106. <div class="section-level-extent" id="anull">
  30107. <h3 class="section"><span>36.40 anull<a class="copiable-link" href="#anull"> &para;</a></span></h3>
  30108. <p>Pass the audio source unchanged to the output.
  30109. </p>
  30110. </div>
  30111. <div class="section-level-extent" id="apad">
  30112. <h3 class="section"><span>36.41 apad<a class="copiable-link" href="#apad"> &para;</a></span></h3>
  30113. <p>Pad the end of an audio stream with silence.
  30114. </p>
  30115. <p>This can be used together with <code class="command">ffmpeg</code> <samp class="option">-shortest</samp> to
  30116. extend audio streams to the same length as the video stream.
  30117. </p>
  30118. <p>A description of the accepted options follows.
  30119. </p>
  30120. <dl class="table">
  30121. <dt><samp class="option">packet_size</samp></dt>
  30122. <dd><p>Set silence packet size. Default value is 4096.
  30123. </p>
  30124. </dd>
  30125. <dt><samp class="option">pad_len</samp></dt>
  30126. <dd><p>Set the number of samples of silence to add to the end. After the
  30127. value is reached, the stream is terminated. This option is mutually
  30128. exclusive with <samp class="option">whole_len</samp>.
  30129. </p>
  30130. </dd>
  30131. <dt><samp class="option">whole_len</samp></dt>
  30132. <dd><p>Set the minimum total number of samples in the output audio stream. If
  30133. the value is longer than the input audio length, silence is added to
  30134. the end, until the value is reached. This option is mutually exclusive
  30135. with <samp class="option">pad_len</samp>.
  30136. </p>
  30137. </dd>
  30138. <dt><samp class="option">pad_dur</samp></dt>
  30139. <dd><p>Specify the duration of samples of silence to add. See
  30140. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  30141. for the accepted syntax. Used only if set to non-negative value.
  30142. </p>
  30143. </dd>
  30144. <dt><samp class="option">whole_dur</samp></dt>
  30145. <dd><p>Specify the minimum total duration in the output audio stream. See
  30146. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  30147. for the accepted syntax. Used only if set to non-negative value. If the value is longer than
  30148. the input audio length, silence is added to the end, until the value is reached.
  30149. This option is mutually exclusive with <samp class="option">pad_dur</samp>
  30150. </p></dd>
  30151. </dl>
  30152. <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>
  30153. nor <samp class="option">whole_dur</samp> option is set, the filter will add silence to the end of
  30154. the input stream indefinitely.
  30155. </p>
  30156. <p>Note that for ffmpeg 4.4 and earlier a zero <samp class="option">pad_dur</samp> or
  30157. <samp class="option">whole_dur</samp> also caused the filter to add silence indefinitely.
  30158. </p>
  30159. <ul class="mini-toc">
  30160. <li><a href="#Examples-57" accesskey="1">Examples</a></li>
  30161. </ul>
  30162. <div class="subsection-level-extent" id="Examples-57">
  30163. <h4 class="subsection"><span>36.41.1 Examples<a class="copiable-link" href="#Examples-57"> &para;</a></span></h4>
  30164. <ul class="itemize mark-bullet">
  30165. <li>Add 1024 samples of silence to the end of the input:
  30166. <div class="example">
  30167. <pre class="example-preformatted">apad=pad_len=1024
  30168. </pre></div>
  30169. </li><li>Make sure the audio output will contain at least 10000 samples, pad
  30170. the input with silence if required:
  30171. <div class="example">
  30172. <pre class="example-preformatted">apad=whole_len=10000
  30173. </pre></div>
  30174. </li><li>Use <code class="command">ffmpeg</code> to pad the audio input with silence, so that the
  30175. video stream will always result the shortest and will be converted
  30176. until the end in the output file when using the <samp class="option">shortest</samp>
  30177. option:
  30178. <div class="example">
  30179. <pre class="example-preformatted">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  30180. </pre></div>
  30181. </li></ul>
  30182. </div>
  30183. </div>
  30184. <div class="section-level-extent" id="aphaser">
  30185. <h3 class="section"><span>36.42 aphaser<a class="copiable-link" href="#aphaser"> &para;</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. </div>
  30225. <div class="section-level-extent" id="aphaseshift">
  30226. <h3 class="section"><span>36.43 aphaseshift<a class="copiable-link" href="#aphaseshift"> &para;</a></span></h3>
  30227. <p>Apply phase shift to input audio samples.
  30228. </p>
  30229. <p>The filter accepts the following options:
  30230. </p>
  30231. <dl class="table">
  30232. <dt><samp class="option">shift</samp></dt>
  30233. <dd><p>Specify phase shift. Allowed range is from -1.0 to 1.0.
  30234. Default value is 0.0.
  30235. </p>
  30236. </dd>
  30237. <dt><samp class="option">level</samp></dt>
  30238. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  30239. Default value is 1.0.
  30240. </p>
  30241. </dd>
  30242. <dt><samp class="option">order</samp></dt>
  30243. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  30244. Default value is 8.
  30245. </p></dd>
  30246. </dl>
  30247. <ul class="mini-toc">
  30248. <li><a href="#Commands-18" accesskey="1">Commands</a></li>
  30249. </ul>
  30250. <div class="subsection-level-extent" id="Commands-18">
  30251. <h4 class="subsection"><span>36.43.1 Commands<a class="copiable-link" href="#Commands-18"> &para;</a></span></h4>
  30252. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30253. </p>
  30254. </div>
  30255. </div>
  30256. <div class="section-level-extent" id="apsnr">
  30257. <h3 class="section"><span>36.44 apsnr<a class="copiable-link" href="#apsnr"> &para;</a></span></h3>
  30258. <p>Measure Audio Peak Signal-to-Noise Ratio.
  30259. </p>
  30260. <p>This filter takes two audio streams for input, and outputs first
  30261. audio stream.
  30262. Results are in dB per channel at end of either input.
  30263. </p>
  30264. </div>
  30265. <div class="section-level-extent" id="apsyclip">
  30266. <h3 class="section"><span>36.45 apsyclip<a class="copiable-link" href="#apsyclip"> &para;</a></span></h3>
  30267. <p>Apply Psychoacoustic clipper to input audio stream.
  30268. </p>
  30269. <p>The filter accepts the following options:
  30270. </p>
  30271. <dl class="table">
  30272. <dt><samp class="option">level_in</samp></dt>
  30273. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  30274. </p>
  30275. </dd>
  30276. <dt><samp class="option">level_out</samp></dt>
  30277. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  30278. </p>
  30279. </dd>
  30280. <dt><samp class="option">clip</samp></dt>
  30281. <dd><p>Set the clipping start value. Default value is 0dBFS or 1.
  30282. </p>
  30283. </dd>
  30284. <dt><samp class="option">diff</samp></dt>
  30285. <dd><p>Output only difference samples, useful to hear introduced distortions.
  30286. By default is disabled.
  30287. </p>
  30288. </dd>
  30289. <dt><samp class="option">adaptive</samp></dt>
  30290. <dd><p>Set strength of adaptive distortion applied. Default value is 0.5.
  30291. Allowed range is from 0 to 1.
  30292. </p>
  30293. </dd>
  30294. <dt><samp class="option">iterations</samp></dt>
  30295. <dd><p>Set number of iterations of psychoacoustic clipper.
  30296. Allowed range is from 1 to 20. Default value is 10.
  30297. </p>
  30298. </dd>
  30299. <dt><samp class="option">level</samp></dt>
  30300. <dd><p>Auto level output signal. Default is disabled.
  30301. This normalizes audio back to 0dBFS if enabled.
  30302. </p></dd>
  30303. </dl>
  30304. <ul class="mini-toc">
  30305. <li><a href="#Commands-19" accesskey="1">Commands</a></li>
  30306. </ul>
  30307. <div class="subsection-level-extent" id="Commands-19">
  30308. <h4 class="subsection"><span>36.45.1 Commands<a class="copiable-link" href="#Commands-19"> &para;</a></span></h4>
  30309. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30310. </p>
  30311. </div>
  30312. </div>
  30313. <div class="section-level-extent" id="apulsator">
  30314. <h3 class="section"><span>36.46 apulsator<a class="copiable-link" href="#apulsator"> &para;</a></span></h3>
  30315. <p>Audio pulsator is something between an autopanner and a tremolo.
  30316. But it can produce funny stereo effects as well. Pulsator changes the volume
  30317. of the left and right channel based on a LFO (low frequency oscillator) with
  30318. different waveforms and shifted phases.
  30319. This filter have the ability to define an offset between left and right
  30320. channel. An offset of 0 means that both LFO shapes match each other.
  30321. The left and right channel are altered equally - a conventional tremolo.
  30322. An offset of 50% means that the shape of the right channel is exactly shifted
  30323. in phase (or moved backwards about half of the frequency) - pulsator acts as
  30324. an autopanner. At 1 both curves match again. Every setting in between moves the
  30325. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  30326. sine and triangle waveforms. The more you set the offset near 1 (starting from
  30327. the 0.5) the faster the signal passes from the left to the right speaker.
  30328. </p>
  30329. <p>The filter accepts the following options:
  30330. </p>
  30331. <dl class="table">
  30332. <dt><samp class="option">level_in</samp></dt>
  30333. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  30334. </p>
  30335. </dd>
  30336. <dt><samp class="option">level_out</samp></dt>
  30337. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  30338. </p>
  30339. </dd>
  30340. <dt><samp class="option">mode</samp></dt>
  30341. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  30342. sawup or sawdown. Default is sine.
  30343. </p>
  30344. </dd>
  30345. <dt><samp class="option">amount</samp></dt>
  30346. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  30347. </p>
  30348. </dd>
  30349. <dt><samp class="option">offset_l</samp></dt>
  30350. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  30351. </p>
  30352. </dd>
  30353. <dt><samp class="option">offset_r</samp></dt>
  30354. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  30355. </p>
  30356. </dd>
  30357. <dt><samp class="option">width</samp></dt>
  30358. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  30359. </p>
  30360. </dd>
  30361. <dt><samp class="option">timing</samp></dt>
  30362. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  30363. </p>
  30364. </dd>
  30365. <dt><samp class="option">bpm</samp></dt>
  30366. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  30367. is set to bpm.
  30368. </p>
  30369. </dd>
  30370. <dt><samp class="option">ms</samp></dt>
  30371. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  30372. is set to ms.
  30373. </p>
  30374. </dd>
  30375. <dt><samp class="option">hz</samp></dt>
  30376. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  30377. if timing is set to hz.
  30378. </p></dd>
  30379. </dl>
  30380. <a class="anchor" id="aresample"></a></div>
  30381. <div class="section-level-extent" id="aresample-1">
  30382. <h3 class="section"><span>36.47 aresample<a class="copiable-link" href="#aresample-1"> &para;</a></span></h3>
  30383. <p>Resample the input audio to the specified parameters, using the
  30384. libswresample library. If none are specified then the filter will
  30385. automatically convert between its input and output.
  30386. </p>
  30387. <p>This filter is also able to stretch/squeeze the audio data to make it match
  30388. the timestamps or to inject silence / cut out audio to make it match the
  30389. timestamps, do a combination of both or do neither.
  30390. </p>
  30391. <p>The filter accepts the syntax
  30392. [<var class="var">sample_rate</var>:]<var class="var">resampler_options</var>, where <var class="var">sample_rate</var>
  30393. expresses a sample rate and <var class="var">resampler_options</var> is a list of
  30394. <var class="var">key</var>=<var class="var">value</var> pairs, separated by &quot;:&quot;. See the
  30395. <a data-manual="ffmpeg-resampler" href="ffmpeg-resampler.html#Resampler-Options">&quot;Resampler Options&quot; section in the
  30396. ffmpeg-resampler(1) manual</a>
  30397. for the complete list of supported options.
  30398. </p>
  30399. <ul class="mini-toc">
  30400. <li><a href="#Examples-58" accesskey="1">Examples</a></li>
  30401. </ul>
  30402. <div class="subsection-level-extent" id="Examples-58">
  30403. <h4 class="subsection"><span>36.47.1 Examples<a class="copiable-link" href="#Examples-58"> &para;</a></span></h4>
  30404. <ul class="itemize mark-bullet">
  30405. <li>Resample the input audio to 44100Hz:
  30406. <div class="example">
  30407. <pre class="example-preformatted">aresample=44100
  30408. </pre></div>
  30409. </li><li>Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  30410. samples per second compensation:
  30411. <div class="example">
  30412. <pre class="example-preformatted">aresample=async=1000
  30413. </pre></div>
  30414. </li></ul>
  30415. </div>
  30416. </div>
  30417. <div class="section-level-extent" id="areverse">
  30418. <h3 class="section"><span>36.48 areverse<a class="copiable-link" href="#areverse"> &para;</a></span></h3>
  30419. <p>Reverse an audio clip.
  30420. </p>
  30421. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  30422. is suggested.
  30423. </p>
  30424. <ul class="mini-toc">
  30425. <li><a href="#Examples-59" accesskey="1">Examples</a></li>
  30426. </ul>
  30427. <div class="subsection-level-extent" id="Examples-59">
  30428. <h4 class="subsection"><span>36.48.1 Examples<a class="copiable-link" href="#Examples-59"> &para;</a></span></h4>
  30429. <ul class="itemize mark-bullet">
  30430. <li>Take the first 5 seconds of a clip, and reverse it.
  30431. <div class="example">
  30432. <pre class="example-preformatted">atrim=end=5,areverse
  30433. </pre></div>
  30434. </li></ul>
  30435. </div>
  30436. </div>
  30437. <div class="section-level-extent" id="arls">
  30438. <h3 class="section"><span>36.49 arls<a class="copiable-link" href="#arls"> &para;</a></span></h3>
  30439. <p>Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream.
  30440. </p>
  30441. <p>This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that
  30442. relate to producing the minimal weighted linear least squares cost function of the error signal (difference
  30443. between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream).
  30444. </p>
  30445. <p>A description of the accepted options follows.
  30446. </p>
  30447. <dl class="table">
  30448. <dt><samp class="option">order</samp></dt>
  30449. <dd><p>Set the filter order.
  30450. </p>
  30451. </dd>
  30452. <dt><samp class="option">lambda</samp></dt>
  30453. <dd><p>Set the forgetting factor.
  30454. </p>
  30455. </dd>
  30456. <dt><samp class="option">delta</samp></dt>
  30457. <dd><p>Set the coefficient to initialize internal covariance matrix.
  30458. </p>
  30459. </dd>
  30460. <dt><samp class="option">out_mode</samp></dt>
  30461. <dd><p>Set the filter output samples. It accepts the following values:
  30462. </p><dl class="table">
  30463. <dt><samp class="option">i</samp></dt>
  30464. <dd><p>Pass the 1st input.
  30465. </p>
  30466. </dd>
  30467. <dt><samp class="option">d</samp></dt>
  30468. <dd><p>Pass the 2nd input.
  30469. </p>
  30470. </dd>
  30471. <dt><samp class="option">o</samp></dt>
  30472. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  30473. </p>
  30474. </dd>
  30475. <dt><samp class="option">n</samp></dt>
  30476. <dd><p>Pass difference between input, 1st input and error signal estimate.
  30477. </p>
  30478. </dd>
  30479. <dt><samp class="option">e</samp></dt>
  30480. <dd><p>Pass error signal estimated samples.
  30481. </p>
  30482. <p>Default value is <var class="var">o</var>.
  30483. </p></dd>
  30484. </dl>
  30485. </dd>
  30486. <dt><samp class="option">precision</samp></dt>
  30487. <dd><p>Set which precision to use when processing samples.
  30488. </p>
  30489. <dl class="table">
  30490. <dt><samp class="option">auto</samp></dt>
  30491. <dd><p>Auto pick internal sample format depending on other filters.
  30492. </p>
  30493. </dd>
  30494. <dt><samp class="option">float</samp></dt>
  30495. <dd><p>Always use single-floating point precision sample format.
  30496. </p>
  30497. </dd>
  30498. <dt><samp class="option">double</samp></dt>
  30499. <dd><p>Always use double-floating point precision sample format.
  30500. </p></dd>
  30501. </dl>
  30502. </dd>
  30503. </dl>
  30504. </div>
  30505. <div class="section-level-extent" id="arnndn">
  30506. <h3 class="section"><span>36.50 arnndn<a class="copiable-link" href="#arnndn"> &para;</a></span></h3>
  30507. <p>Reduce noise from speech using Recurrent Neural Networks.
  30508. </p>
  30509. <p>This filter accepts the following options:
  30510. </p>
  30511. <dl class="table">
  30512. <dt><samp class="option">model, m</samp></dt>
  30513. <dd><p>Set train model file to load. This option is always required.
  30514. </p>
  30515. </dd>
  30516. <dt><samp class="option">mix</samp></dt>
  30517. <dd><p>Set how much to mix filtered samples into final output.
  30518. Allowed range is from -1 to 1. Default value is 1.
  30519. Negative values are special, they set how much to keep filtered noise
  30520. in the final filter output. Set this option to -1 to hear actual
  30521. noise removed from input signal.
  30522. </p></dd>
  30523. </dl>
  30524. <ul class="mini-toc">
  30525. <li><a href="#Commands-20" accesskey="1">Commands</a></li>
  30526. </ul>
  30527. <div class="subsection-level-extent" id="Commands-20">
  30528. <h4 class="subsection"><span>36.50.1 Commands<a class="copiable-link" href="#Commands-20"> &para;</a></span></h4>
  30529. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30530. </p>
  30531. </div>
  30532. </div>
  30533. <div class="section-level-extent" id="asdr">
  30534. <h3 class="section"><span>36.51 asdr<a class="copiable-link" href="#asdr"> &para;</a></span></h3>
  30535. <p>Measure Audio Signal-to-Distortion Ratio.
  30536. </p>
  30537. <p>This filter takes two audio streams for input, and outputs first
  30538. audio stream.
  30539. Results are in dB per channel at end of either input.
  30540. </p>
  30541. </div>
  30542. <div class="section-level-extent" id="asetnsamples">
  30543. <h3 class="section"><span>36.52 asetnsamples<a class="copiable-link" href="#asetnsamples"> &para;</a></span></h3>
  30544. <p>Set the number of samples per each output audio frame.
  30545. </p>
  30546. <p>The last output packet may contain a different number of samples, as
  30547. the filter will flush all the remaining samples when the input audio
  30548. signals its end.
  30549. </p>
  30550. <p>The filter accepts the following options:
  30551. </p>
  30552. <dl class="table">
  30553. <dt><samp class="option">nb_out_samples, n</samp></dt>
  30554. <dd><p>Set the number of frames per each output audio frame. The number is
  30555. intended as the number of samples <em class="emph">per each channel</em>.
  30556. Default value is 1024.
  30557. </p>
  30558. </dd>
  30559. <dt><samp class="option">pad, p</samp></dt>
  30560. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  30561. that the last frame will contain the same number of samples as the
  30562. previous ones. Default value is 1.
  30563. </p></dd>
  30564. </dl>
  30565. <p>For example, to set the number of per-frame samples to 1234 and
  30566. disable padding for the last frame, use:
  30567. </p><div class="example">
  30568. <pre class="example-preformatted">asetnsamples=n=1234:p=0
  30569. </pre></div>
  30570. </div>
  30571. <div class="section-level-extent" id="asetrate">
  30572. <h3 class="section"><span>36.53 asetrate<a class="copiable-link" href="#asetrate"> &para;</a></span></h3>
  30573. <p>Set the sample rate without altering the PCM data.
  30574. This will result in a change of speed and pitch.
  30575. </p>
  30576. <p>The filter accepts the following options:
  30577. </p>
  30578. <dl class="table">
  30579. <dt><samp class="option">sample_rate, r</samp></dt>
  30580. <dd><p>Set the output sample rate. Default is 44100 Hz.
  30581. </p></dd>
  30582. </dl>
  30583. </div>
  30584. <div class="section-level-extent" id="ashowinfo">
  30585. <h3 class="section"><span>36.54 ashowinfo<a class="copiable-link" href="#ashowinfo"> &para;</a></span></h3>
  30586. <p>Show a line containing various information for each input audio frame.
  30587. The input audio is not modified.
  30588. </p>
  30589. <p>The shown line contains a sequence of key/value pairs of the form
  30590. <var class="var">key</var>:<var class="var">value</var>.
  30591. </p>
  30592. <p>The following values are shown in the output:
  30593. </p>
  30594. <dl class="table">
  30595. <dt><samp class="option">n</samp></dt>
  30596. <dd><p>The (sequential) number of the input frame, starting from 0.
  30597. </p>
  30598. </dd>
  30599. <dt><samp class="option">pts</samp></dt>
  30600. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  30601. depends on the filter input pad, and is usually 1/<var class="var">sample_rate</var>.
  30602. </p>
  30603. </dd>
  30604. <dt><samp class="option">pts_time</samp></dt>
  30605. <dd><p>The presentation timestamp of the input frame in seconds.
  30606. </p>
  30607. </dd>
  30608. <dt><samp class="option">fmt</samp></dt>
  30609. <dd><p>The sample format.
  30610. </p>
  30611. </dd>
  30612. <dt><samp class="option">chlayout</samp></dt>
  30613. <dd><p>The channel layout.
  30614. </p>
  30615. </dd>
  30616. <dt><samp class="option">rate</samp></dt>
  30617. <dd><p>The sample rate for the audio frame.
  30618. </p>
  30619. </dd>
  30620. <dt><samp class="option">nb_samples</samp></dt>
  30621. <dd><p>The number of samples (per channel) in the frame.
  30622. </p>
  30623. </dd>
  30624. <dt><samp class="option">checksum</samp></dt>
  30625. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  30626. audio, the data is treated as if all the planes were concatenated.
  30627. </p>
  30628. </dd>
  30629. <dt><samp class="option">plane_checksums</samp></dt>
  30630. <dd><p>A list of Adler-32 checksums for each data plane.
  30631. </p></dd>
  30632. </dl>
  30633. </div>
  30634. <div class="section-level-extent" id="asisdr">
  30635. <h3 class="section"><span>36.55 asisdr<a class="copiable-link" href="#asisdr"> &para;</a></span></h3>
  30636. <p>Measure Audio Scaled-Invariant Signal-to-Distortion Ratio.
  30637. </p>
  30638. <p>This filter takes two audio streams for input, and outputs first
  30639. audio stream.
  30640. Results are in dB per channel at end of either input.
  30641. </p>
  30642. </div>
  30643. <div class="section-level-extent" id="asoftclip">
  30644. <h3 class="section"><span>36.56 asoftclip<a class="copiable-link" href="#asoftclip"> &para;</a></span></h3>
  30645. <p>Apply audio soft clipping.
  30646. </p>
  30647. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  30648. along a smooth curve, rather than the abrupt shape of hard-clipping.
  30649. </p>
  30650. <p>This filter accepts the following options:
  30651. </p>
  30652. <dl class="table">
  30653. <dt><samp class="option">type</samp></dt>
  30654. <dd><p>Set type of soft-clipping.
  30655. </p>
  30656. <p>It accepts the following values:
  30657. </p><dl class="table">
  30658. <dt><samp class="option">hard</samp></dt>
  30659. <dt><samp class="option">tanh</samp></dt>
  30660. <dt><samp class="option">atan</samp></dt>
  30661. <dt><samp class="option">cubic</samp></dt>
  30662. <dt><samp class="option">exp</samp></dt>
  30663. <dt><samp class="option">alg</samp></dt>
  30664. <dt><samp class="option">quintic</samp></dt>
  30665. <dt><samp class="option">sin</samp></dt>
  30666. <dt><samp class="option">erf</samp></dt>
  30667. </dl>
  30668. </dd>
  30669. <dt><samp class="option">threshold</samp></dt>
  30670. <dd><p>Set threshold from where to start clipping. Default value is 0dB or 1.
  30671. </p>
  30672. </dd>
  30673. <dt><samp class="option">output</samp></dt>
  30674. <dd><p>Set gain applied to output. Default value is 0dB or 1.
  30675. </p>
  30676. </dd>
  30677. <dt><samp class="option">param</samp></dt>
  30678. <dd><p>Set additional parameter which controls sigmoid function.
  30679. </p>
  30680. </dd>
  30681. <dt><samp class="option">oversample</samp></dt>
  30682. <dd><p>Set oversampling factor.
  30683. </p></dd>
  30684. </dl>
  30685. <ul class="mini-toc">
  30686. <li><a href="#Commands-21" accesskey="1">Commands</a></li>
  30687. </ul>
  30688. <div class="subsection-level-extent" id="Commands-21">
  30689. <h4 class="subsection"><span>36.56.1 Commands<a class="copiable-link" href="#Commands-21"> &para;</a></span></h4>
  30690. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  30691. </p>
  30692. </div>
  30693. </div>
  30694. <div class="section-level-extent" id="aspectralstats">
  30695. <h3 class="section"><span>36.57 aspectralstats<a class="copiable-link" href="#aspectralstats"> &para;</a></span></h3>
  30696. <p>Display frequency domain statistical information about the audio channels.
  30697. Statistics are calculated and stored as metadata for each audio channel and for each audio frame.
  30698. </p>
  30699. <p>It accepts the following option:
  30700. </p><dl class="table">
  30701. <dt><samp class="option">win_size</samp></dt>
  30702. <dd><p>Set the window length in samples. Default value is 2048.
  30703. Allowed range is from 32 to 65536.
  30704. </p>
  30705. </dd>
  30706. <dt><samp class="option">win_func</samp></dt>
  30707. <dd><p>Set window function.
  30708. </p>
  30709. <p>It accepts the following values:
  30710. </p><dl class="table">
  30711. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  30712. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  30713. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  30714. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  30715. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  30716. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  30717. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  30718. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  30719. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  30720. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  30721. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  30722. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  30723. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  30724. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  30725. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  30726. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  30727. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  30728. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  30729. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  30730. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  30731. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  30732. </dl>
  30733. <p>Default is <code class="code">hann</code>.
  30734. </p>
  30735. </dd>
  30736. <dt><samp class="option">overlap</samp></dt>
  30737. <dd><p>Set window overlap. Allowed range is from <code class="code">0</code>
  30738. to <code class="code">1</code>. Default value is <code class="code">0.5</code>.
  30739. </p>
  30740. </dd>
  30741. <dt><samp class="option">measure</samp></dt>
  30742. <dd><p>Select the parameters which are measured. The metadata keys can
  30743. be used as flags, default is <samp class="option">all</samp> which measures everything.
  30744. <samp class="option">none</samp> disables all measurement.
  30745. </p></dd>
  30746. </dl>
  30747. <p>A list of each metadata key follows:
  30748. </p>
  30749. <dl class="table">
  30750. <dt><samp class="option">mean</samp></dt>
  30751. <dt><samp class="option">variance</samp></dt>
  30752. <dt><samp class="option">centroid</samp></dt>
  30753. <dt><samp class="option">spread</samp></dt>
  30754. <dt><samp class="option">skewness</samp></dt>
  30755. <dt><samp class="option">kurtosis</samp></dt>
  30756. <dt><samp class="option">entropy</samp></dt>
  30757. <dt><samp class="option">flatness</samp></dt>
  30758. <dt><samp class="option">crest</samp></dt>
  30759. <dt><samp class="option">flux</samp></dt>
  30760. <dt><samp class="option">slope</samp></dt>
  30761. <dt><samp class="option">decrease</samp></dt>
  30762. <dt><samp class="option">rolloff</samp></dt>
  30763. </dl>
  30764. </div>
  30765. <div class="section-level-extent" id="asr">
  30766. <h3 class="section"><span>36.58 asr<a class="copiable-link" href="#asr"> &para;</a></span></h3>
  30767. <p>Automatic Speech Recognition
  30768. </p>
  30769. <p>This filter uses PocketSphinx for speech recognition. To enable
  30770. compilation of this filter, you need to configure FFmpeg with
  30771. <code class="code">--enable-pocketsphinx</code>.
  30772. </p>
  30773. <p>It accepts the following options:
  30774. </p>
  30775. <dl class="table">
  30776. <dt><samp class="option">rate</samp></dt>
  30777. <dd><p>Set sampling rate of input audio. Defaults is <code class="code">16000</code>.
  30778. This need to match speech models, otherwise one will get poor results.
  30779. </p>
  30780. </dd>
  30781. <dt><samp class="option">hmm</samp></dt>
  30782. <dd><p>Set dictionary containing acoustic model files.
  30783. </p>
  30784. </dd>
  30785. <dt><samp class="option">dict</samp></dt>
  30786. <dd><p>Set pronunciation dictionary.
  30787. </p>
  30788. </dd>
  30789. <dt><samp class="option">lm</samp></dt>
  30790. <dd><p>Set language model file.
  30791. </p>
  30792. </dd>
  30793. <dt><samp class="option">lmctl</samp></dt>
  30794. <dd><p>Set language model set.
  30795. </p>
  30796. </dd>
  30797. <dt><samp class="option">lmname</samp></dt>
  30798. <dd><p>Set which language model to use.
  30799. </p>
  30800. </dd>
  30801. <dt><samp class="option">logfn</samp></dt>
  30802. <dd><p>Set output for log messages.
  30803. </p></dd>
  30804. </dl>
  30805. <p>The filter exports recognized speech as the frame metadata <code class="code">lavfi.asr.text</code>.
  30806. </p>
  30807. <a class="anchor" id="astats"></a></div>
  30808. <div class="section-level-extent" id="astats-1">
  30809. <h3 class="section"><span>36.59 astats<a class="copiable-link" href="#astats-1"> &para;</a></span></h3>
  30810. <p>Display time domain statistical information about the audio channels.
  30811. Statistics are calculated and displayed for each audio channel and,
  30812. where applicable, an overall figure is also given.
  30813. </p>
  30814. <p>It accepts the following option:
  30815. </p><dl class="table">
  30816. <dt><samp class="option">length</samp></dt>
  30817. <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
  30818. Default is <code class="code">0.05</code> (50 milliseconds). Allowed range is <code class="code">[0 - 10]</code>.
  30819. </p>
  30820. </dd>
  30821. <dt><samp class="option">metadata</samp></dt>
  30822. <dd>
  30823. <p>Set metadata injection. All the metadata keys are prefixed with <code class="code">lavfi.astats.X</code>,
  30824. where <code class="code">X</code> is channel number starting from 1 or string <code class="code">Overall</code>. Default is
  30825. disabled.
  30826. </p>
  30827. <p>Available keys for each channel are:
  30828. <var class="var">Bit_depth</var>
  30829. <var class="var">Crest_factor</var>
  30830. <var class="var">DC_offset</var>
  30831. <var class="var">Dynamic_range</var>
  30832. <var class="var">Entropy</var>
  30833. <var class="var">Flat_factor</var>
  30834. <var class="var">Max_difference</var>
  30835. <var class="var">Max_level</var>
  30836. <var class="var">Mean_difference</var>
  30837. <var class="var">Min_difference</var>
  30838. <var class="var">Min_level</var>
  30839. <var class="var">Noise_floor</var>
  30840. <var class="var">Noise_floor_count</var>
  30841. <var class="var">Number_of_Infs</var>
  30842. <var class="var">Number_of_NaNs</var>
  30843. <var class="var">Number_of_denormals</var>
  30844. <var class="var">Peak_count</var>
  30845. <var class="var">Abs_Peak_count</var>
  30846. <var class="var">Peak_level</var>
  30847. <var class="var">RMS_difference</var>
  30848. <var class="var">RMS_peak</var>
  30849. <var class="var">RMS_trough</var>
  30850. <var class="var">Zero_crossings</var>
  30851. <var class="var">Zero_crossings_rate</var>
  30852. </p>
  30853. <p>and for <code class="code">Overall</code>:
  30854. <var class="var">Bit_depth</var>
  30855. <var class="var">DC_offset</var>
  30856. <var class="var">Entropy</var>
  30857. <var class="var">Flat_factor</var>
  30858. <var class="var">Max_difference</var>
  30859. <var class="var">Max_level</var>
  30860. <var class="var">Mean_difference</var>
  30861. <var class="var">Min_difference</var>
  30862. <var class="var">Min_level</var>
  30863. <var class="var">Noise_floor</var>
  30864. <var class="var">Noise_floor_count</var>
  30865. <var class="var">Number_of_Infs</var>
  30866. <var class="var">Number_of_NaNs</var>
  30867. <var class="var">Number_of_denormals</var>
  30868. <var class="var">Number_of_samples</var>
  30869. <var class="var">Peak_count</var>
  30870. <var class="var">Abs_Peak_count</var>
  30871. <var class="var">Peak_level</var>
  30872. <var class="var">RMS_difference</var>
  30873. <var class="var">RMS_level</var>
  30874. <var class="var">RMS_peak</var>
  30875. <var class="var">RMS_trough</var>
  30876. </p>
  30877. <p>For example, a full key looks like <code class="code">lavfi.astats.1.DC_offset</code> or
  30878. <code class="code">lavfi.astats.Overall.Peak_count</code>.
  30879. </p>
  30880. <p>Read below for the description of the keys.
  30881. </p>
  30882. </dd>
  30883. <dt><samp class="option">reset</samp></dt>
  30884. <dd><p>Set the number of frames over which cumulative stats are calculated before
  30885. being reset. Default is disabled.
  30886. </p>
  30887. </dd>
  30888. <dt><samp class="option">measure_perchannel</samp></dt>
  30889. <dd><p>Select the parameters which are measured per channel. The metadata keys can
  30890. be used as flags, default is <samp class="option">all</samp> which measures everything.
  30891. <samp class="option">none</samp> disables all per channel measurement.
  30892. </p>
  30893. </dd>
  30894. <dt><samp class="option">measure_overall</samp></dt>
  30895. <dd><p>Select the parameters which are measured overall. The metadata keys can
  30896. be used as flags, default is <samp class="option">all</samp> which measures everything.
  30897. <samp class="option">none</samp> disables all overall measurement.
  30898. </p>
  30899. </dd>
  30900. </dl>
  30901. <p>A description of the measure keys follow:
  30902. </p>
  30903. <dl class="table">
  30904. <dt><samp class="option">none</samp></dt>
  30905. <dd><p>no measures
  30906. </p>
  30907. </dd>
  30908. <dt><samp class="option">all</samp></dt>
  30909. <dd><p>all measures
  30910. </p>
  30911. </dd>
  30912. <dt><samp class="option">Bit_depth</samp></dt>
  30913. <dd><p>overall bit depth of audio, i.e. number of bits used for each sample
  30914. </p>
  30915. </dd>
  30916. <dt><samp class="option">Crest_factor</samp></dt>
  30917. <dd><p>standard ratio of peak to RMS level (note: not in dB)
  30918. </p>
  30919. </dd>
  30920. <dt><samp class="option">DC_offset</samp></dt>
  30921. <dd><p>mean amplitude displacement from zero
  30922. </p>
  30923. </dd>
  30924. <dt><samp class="option">Dynamic_range</samp></dt>
  30925. <dd><p>measured dynamic range of audio in dB
  30926. </p>
  30927. </dd>
  30928. <dt><samp class="option">Entropy</samp></dt>
  30929. <dd><p>entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise
  30930. </p>
  30931. </dd>
  30932. <dt><samp class="option">Flat_factor</samp></dt>
  30933. <dd><p>flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  30934. (i.e. either <var class="var">Min_level</var> or <var class="var">Max_level</var>)
  30935. </p>
  30936. </dd>
  30937. <dt><samp class="option">Max_difference</samp></dt>
  30938. <dd><p>maximal difference between two consecutive samples
  30939. </p>
  30940. </dd>
  30941. <dt><samp class="option">Max_level</samp></dt>
  30942. <dd><p>maximal sample level
  30943. </p>
  30944. </dd>
  30945. <dt><samp class="option">Mean_difference</samp></dt>
  30946. <dd><p>mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples
  30947. </p>
  30948. </dd>
  30949. <dt><samp class="option">Min_difference</samp></dt>
  30950. <dd><p>minimal difference between two consecutive samples
  30951. </p>
  30952. </dd>
  30953. <dt><samp class="option">Min_level</samp></dt>
  30954. <dd><p>minimal sample level
  30955. </p>
  30956. </dd>
  30957. <dt><samp class="option">Noise_floor</samp></dt>
  30958. <dd><p>minimum local peak measured in dBFS over a short window
  30959. </p>
  30960. </dd>
  30961. <dt><samp class="option">Noise_floor_count</samp></dt>
  30962. <dd><p>number of occasions (not the number of samples) that the signal attained
  30963. <var class="var">Noise floor</var>
  30964. </p>
  30965. </dd>
  30966. <dt><samp class="option">Number_of_Infs</samp></dt>
  30967. <dd><p>number of samples with an infinite value
  30968. </p>
  30969. </dd>
  30970. <dt><samp class="option">Number_of_NaNs</samp></dt>
  30971. <dd><p>number of samples with a NaN (not a number) value
  30972. </p>
  30973. </dd>
  30974. <dt><samp class="option">Number_of_denormals</samp></dt>
  30975. <dd><p>number of samples with a subnormal value
  30976. </p>
  30977. </dd>
  30978. <dt><samp class="option">Number_of_samples</samp></dt>
  30979. <dd><p>number of samples
  30980. </p>
  30981. </dd>
  30982. <dt><samp class="option">Peak_count</samp></dt>
  30983. <dd><p>number of occasions (not the number of samples) that the signal attained either
  30984. <var class="var">Min_level</var> or <var class="var">Max_level</var>
  30985. </p>
  30986. </dd>
  30987. <dt><samp class="option">Abs_Peak_count</samp></dt>
  30988. <dd><p>number of occasions that the absolute samples taken from the signal attained
  30989. max absolute value of <var class="var">Min_level</var> and <var class="var">Max_level</var>
  30990. </p>
  30991. </dd>
  30992. <dt><samp class="option">Peak_level</samp></dt>
  30993. <dd><p>standard peak level measured in dBFS
  30994. </p>
  30995. </dd>
  30996. <dt><samp class="option">RMS_difference</samp></dt>
  30997. <dd><p>Root Mean Square difference between two consecutive samples
  30998. </p>
  30999. </dd>
  31000. <dt><samp class="option">RMS_level</samp></dt>
  31001. <dd><p>standard RMS level measured in dBFS
  31002. </p>
  31003. </dd>
  31004. <dt><samp class="option">RMS_peak</samp></dt>
  31005. <dt><samp class="option">RMS_trough</samp></dt>
  31006. <dd><p>peak and trough values for RMS level measured over a short window,
  31007. measured in dBFS.
  31008. </p>
  31009. </dd>
  31010. <dt><samp class="option">Zero crossings</samp></dt>
  31011. <dd><p>number of points where the waveform crosses the zero level axis
  31012. </p>
  31013. </dd>
  31014. <dt><samp class="option">Zero crossings rate</samp></dt>
  31015. <dd><p>rate of Zero crossings and number of audio samples
  31016. </p></dd>
  31017. </dl>
  31018. </div>
  31019. <div class="section-level-extent" id="asubboost">
  31020. <h3 class="section"><span>36.60 asubboost<a class="copiable-link" href="#asubboost"> &para;</a></span></h3>
  31021. <p>Boost subwoofer frequencies.
  31022. </p>
  31023. <p>The filter accepts the following options:
  31024. </p>
  31025. <dl class="table">
  31026. <dt><samp class="option">dry</samp></dt>
  31027. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  31028. Default value is 1.0.
  31029. </p>
  31030. </dd>
  31031. <dt><samp class="option">wet</samp></dt>
  31032. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  31033. Default value is 1.0.
  31034. </p>
  31035. </dd>
  31036. <dt><samp class="option">boost</samp></dt>
  31037. <dd><p>Set max boost factor. Allowed range is from 1 to 12. Default value is 2.
  31038. </p>
  31039. </dd>
  31040. <dt><samp class="option">decay</samp></dt>
  31041. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  31042. Default value is 0.0.
  31043. </p>
  31044. </dd>
  31045. <dt><samp class="option">feedback</samp></dt>
  31046. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  31047. Default value is 0.9.
  31048. </p>
  31049. </dd>
  31050. <dt><samp class="option">cutoff</samp></dt>
  31051. <dd><p>Set cutoff frequency in Hertz. Allowed range is 50 to 900.
  31052. Default value is 100.
  31053. </p>
  31054. </dd>
  31055. <dt><samp class="option">slope</samp></dt>
  31056. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  31057. Default value is 0.5.
  31058. </p>
  31059. </dd>
  31060. <dt><samp class="option">delay</samp></dt>
  31061. <dd><p>Set delay. Allowed range is from 1 to 100.
  31062. Default value is 20.
  31063. </p>
  31064. </dd>
  31065. <dt><samp class="option">channels</samp></dt>
  31066. <dd><p>Set the channels to process. Default value is all available.
  31067. </p></dd>
  31068. </dl>
  31069. <ul class="mini-toc">
  31070. <li><a href="#Commands-22" accesskey="1">Commands</a></li>
  31071. </ul>
  31072. <div class="subsection-level-extent" id="Commands-22">
  31073. <h4 class="subsection"><span>36.60.1 Commands<a class="copiable-link" href="#Commands-22"> &para;</a></span></h4>
  31074. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31075. </p>
  31076. </div>
  31077. </div>
  31078. <div class="section-level-extent" id="asubcut">
  31079. <h3 class="section"><span>36.61 asubcut<a class="copiable-link" href="#asubcut"> &para;</a></span></h3>
  31080. <p>Cut subwoofer frequencies.
  31081. </p>
  31082. <p>This filter allows to set custom, steeper
  31083. roll off than highpass filter, and thus is able to more attenuate
  31084. frequency content in stop-band.
  31085. </p>
  31086. <p>The filter accepts the following options:
  31087. </p>
  31088. <dl class="table">
  31089. <dt><samp class="option">cutoff</samp></dt>
  31090. <dd><p>Set cutoff frequency in Hertz. Allowed range is 2 to 200.
  31091. Default value is 20.
  31092. </p>
  31093. </dd>
  31094. <dt><samp class="option">order</samp></dt>
  31095. <dd><p>Set filter order. Available values are from 3 to 20.
  31096. Default value is 10.
  31097. </p>
  31098. </dd>
  31099. <dt><samp class="option">level</samp></dt>
  31100. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  31101. </p></dd>
  31102. </dl>
  31103. <ul class="mini-toc">
  31104. <li><a href="#Commands-23" accesskey="1">Commands</a></li>
  31105. </ul>
  31106. <div class="subsection-level-extent" id="Commands-23">
  31107. <h4 class="subsection"><span>36.61.1 Commands<a class="copiable-link" href="#Commands-23"> &para;</a></span></h4>
  31108. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31109. </p>
  31110. </div>
  31111. </div>
  31112. <div class="section-level-extent" id="asupercut">
  31113. <h3 class="section"><span>36.62 asupercut<a class="copiable-link" href="#asupercut"> &para;</a></span></h3>
  31114. <p>Cut super frequencies.
  31115. </p>
  31116. <p>The filter accepts the following options:
  31117. </p>
  31118. <dl class="table">
  31119. <dt><samp class="option">cutoff</samp></dt>
  31120. <dd><p>Set cutoff frequency in Hertz. Allowed range is 20000 to 192000.
  31121. Default value is 20000.
  31122. </p>
  31123. </dd>
  31124. <dt><samp class="option">order</samp></dt>
  31125. <dd><p>Set filter order. Available values are from 3 to 20.
  31126. Default value is 10.
  31127. </p>
  31128. </dd>
  31129. <dt><samp class="option">level</samp></dt>
  31130. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  31131. </p></dd>
  31132. </dl>
  31133. <ul class="mini-toc">
  31134. <li><a href="#Commands-24" accesskey="1">Commands</a></li>
  31135. </ul>
  31136. <div class="subsection-level-extent" id="Commands-24">
  31137. <h4 class="subsection"><span>36.62.1 Commands<a class="copiable-link" href="#Commands-24"> &para;</a></span></h4>
  31138. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31139. </p>
  31140. </div>
  31141. </div>
  31142. <div class="section-level-extent" id="asuperpass">
  31143. <h3 class="section"><span>36.63 asuperpass<a class="copiable-link" href="#asuperpass"> &para;</a></span></h3>
  31144. <p>Apply high order Butterworth band-pass filter.
  31145. </p>
  31146. <p>The filter accepts the following options:
  31147. </p>
  31148. <dl class="table">
  31149. <dt><samp class="option">centerf</samp></dt>
  31150. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  31151. Default value is 1000.
  31152. </p>
  31153. </dd>
  31154. <dt><samp class="option">order</samp></dt>
  31155. <dd><p>Set filter order. Available values are from 4 to 20.
  31156. Default value is 4.
  31157. </p>
  31158. </dd>
  31159. <dt><samp class="option">qfactor</samp></dt>
  31160. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  31161. </p>
  31162. </dd>
  31163. <dt><samp class="option">level</samp></dt>
  31164. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  31165. </p></dd>
  31166. </dl>
  31167. <ul class="mini-toc">
  31168. <li><a href="#Commands-25" accesskey="1">Commands</a></li>
  31169. </ul>
  31170. <div class="subsection-level-extent" id="Commands-25">
  31171. <h4 class="subsection"><span>36.63.1 Commands<a class="copiable-link" href="#Commands-25"> &para;</a></span></h4>
  31172. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31173. </p>
  31174. </div>
  31175. </div>
  31176. <div class="section-level-extent" id="asuperstop">
  31177. <h3 class="section"><span>36.64 asuperstop<a class="copiable-link" href="#asuperstop"> &para;</a></span></h3>
  31178. <p>Apply high order Butterworth band-stop filter.
  31179. </p>
  31180. <p>The filter accepts the following options:
  31181. </p>
  31182. <dl class="table">
  31183. <dt><samp class="option">centerf</samp></dt>
  31184. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  31185. Default value is 1000.
  31186. </p>
  31187. </dd>
  31188. <dt><samp class="option">order</samp></dt>
  31189. <dd><p>Set filter order. Available values are from 4 to 20.
  31190. Default value is 4.
  31191. </p>
  31192. </dd>
  31193. <dt><samp class="option">qfactor</samp></dt>
  31194. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  31195. </p>
  31196. </dd>
  31197. <dt><samp class="option">level</samp></dt>
  31198. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  31199. </p></dd>
  31200. </dl>
  31201. <ul class="mini-toc">
  31202. <li><a href="#Commands-26" accesskey="1">Commands</a></li>
  31203. </ul>
  31204. <div class="subsection-level-extent" id="Commands-26">
  31205. <h4 class="subsection"><span>36.64.1 Commands<a class="copiable-link" href="#Commands-26"> &para;</a></span></h4>
  31206. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31207. </p>
  31208. </div>
  31209. </div>
  31210. <div class="section-level-extent" id="atempo">
  31211. <h3 class="section"><span>36.65 atempo<a class="copiable-link" href="#atempo"> &para;</a></span></h3>
  31212. <p>Adjust audio tempo.
  31213. </p>
  31214. <p>The filter accepts exactly one parameter, the audio tempo. If not
  31215. specified then the filter will assume nominal 1.0 tempo. Tempo must
  31216. be in the [0.5, 100.0] range.
  31217. </p>
  31218. <p>Note that tempo greater than 2 will skip some samples rather than
  31219. blend them in. If for any reason this is a concern it is always
  31220. possible to daisy-chain several instances of atempo to achieve the
  31221. desired product tempo.
  31222. </p>
  31223. <ul class="mini-toc">
  31224. <li><a href="#Examples-60" accesskey="1">Examples</a></li>
  31225. <li><a href="#Commands-27" accesskey="2">Commands</a></li>
  31226. </ul>
  31227. <div class="subsection-level-extent" id="Examples-60">
  31228. <h4 class="subsection"><span>36.65.1 Examples<a class="copiable-link" href="#Examples-60"> &para;</a></span></h4>
  31229. <ul class="itemize mark-bullet">
  31230. <li>Slow down audio to 80% tempo:
  31231. <div class="example">
  31232. <pre class="example-preformatted">atempo=0.8
  31233. </pre></div>
  31234. </li><li>To speed up audio to 300% tempo:
  31235. <div class="example">
  31236. <pre class="example-preformatted">atempo=3
  31237. </pre></div>
  31238. </li><li>To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  31239. <div class="example">
  31240. <pre class="example-preformatted">atempo=sqrt(3),atempo=sqrt(3)
  31241. </pre></div>
  31242. </li></ul>
  31243. </div>
  31244. <div class="subsection-level-extent" id="Commands-27">
  31245. <h4 class="subsection"><span>36.65.2 Commands<a class="copiable-link" href="#Commands-27"> &para;</a></span></h4>
  31246. <p>This filter supports the following commands:
  31247. </p><dl class="table">
  31248. <dt><samp class="option">tempo</samp></dt>
  31249. <dd><p>Change filter tempo scale factor.
  31250. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  31251. </p></dd>
  31252. </dl>
  31253. </div>
  31254. </div>
  31255. <div class="section-level-extent" id="atilt">
  31256. <h3 class="section"><span>36.66 atilt<a class="copiable-link" href="#atilt"> &para;</a></span></h3>
  31257. <p>Apply spectral tilt filter to audio stream.
  31258. </p>
  31259. <p>This filter apply any spectral roll-off slope over any specified frequency band.
  31260. </p>
  31261. <p>The filter accepts the following options:
  31262. </p>
  31263. <dl class="table">
  31264. <dt><samp class="option">freq</samp></dt>
  31265. <dd><p>Set central frequency of tilt in Hz. Default is 10000 Hz.
  31266. </p>
  31267. </dd>
  31268. <dt><samp class="option">slope</samp></dt>
  31269. <dd><p>Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1.
  31270. </p>
  31271. </dd>
  31272. <dt><samp class="option">width</samp></dt>
  31273. <dd><p>Set width of tilt. Default is 1000. Allowed range is from 100 to 10000.
  31274. </p>
  31275. </dd>
  31276. <dt><samp class="option">order</samp></dt>
  31277. <dd><p>Set order of tilt filter.
  31278. </p>
  31279. </dd>
  31280. <dt><samp class="option">level</samp></dt>
  31281. <dd><p>Set input volume level. Allowed range is from 0 to 4.
  31282. Default is 1.
  31283. </p></dd>
  31284. </dl>
  31285. <ul class="mini-toc">
  31286. <li><a href="#Commands-28" accesskey="1">Commands</a></li>
  31287. </ul>
  31288. <div class="subsection-level-extent" id="Commands-28">
  31289. <h4 class="subsection"><span>36.66.1 Commands<a class="copiable-link" href="#Commands-28"> &para;</a></span></h4>
  31290. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  31291. </p>
  31292. </div>
  31293. </div>
  31294. <div class="section-level-extent" id="atrim">
  31295. <h3 class="section"><span>36.67 atrim<a class="copiable-link" href="#atrim"> &para;</a></span></h3>
  31296. <p>Trim the input so that the output contains one continuous subpart of the input.
  31297. </p>
  31298. <p>It accepts the following parameters:
  31299. </p><dl class="table">
  31300. <dt><samp class="option">start</samp></dt>
  31301. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  31302. sample with the timestamp <var class="var">start</var> will be the first sample in the output.
  31303. </p>
  31304. </dd>
  31305. <dt><samp class="option">end</samp></dt>
  31306. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  31307. audio sample immediately preceding the one with the timestamp <var class="var">end</var> will be
  31308. the last sample in the output.
  31309. </p>
  31310. </dd>
  31311. <dt><samp class="option">start_pts</samp></dt>
  31312. <dd><p>Same as <var class="var">start</var>, except this option sets the start timestamp in samples
  31313. instead of seconds.
  31314. </p>
  31315. </dd>
  31316. <dt><samp class="option">end_pts</samp></dt>
  31317. <dd><p>Same as <var class="var">end</var>, except this option sets the end timestamp in samples instead
  31318. of seconds.
  31319. </p>
  31320. </dd>
  31321. <dt><samp class="option">duration</samp></dt>
  31322. <dd><p>The maximum duration of the output in seconds.
  31323. </p>
  31324. </dd>
  31325. <dt><samp class="option">start_sample</samp></dt>
  31326. <dd><p>The number of the first sample that should be output.
  31327. </p>
  31328. </dd>
  31329. <dt><samp class="option">end_sample</samp></dt>
  31330. <dd><p>The number of the first sample that should be dropped.
  31331. </p></dd>
  31332. </dl>
  31333. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  31334. duration specifications; see
  31335. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  31336. </p>
  31337. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  31338. option look at the frame timestamp, while the _sample options simply count the
  31339. samples that pass through the filter. So start/end_pts and start/end_sample will
  31340. give different results when the timestamps are wrong, inexact or do not start at
  31341. zero. Also note that this filter does not modify the timestamps. If you wish
  31342. to have the output timestamps start at zero, insert the asetpts filter after the
  31343. atrim filter.
  31344. </p>
  31345. <p>If multiple start or end options are set, this filter tries to be greedy and
  31346. keep all samples that match at least one of the specified constraints. To keep
  31347. only the part that matches all the constraints at once, chain multiple atrim
  31348. filters.
  31349. </p>
  31350. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  31351. just the end values to keep everything before the specified time.
  31352. </p>
  31353. <p>Examples:
  31354. </p><ul class="itemize mark-bullet">
  31355. <li>Drop everything except the second minute of input:
  31356. <div class="example">
  31357. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=60:120
  31358. </pre></div>
  31359. </li><li>Keep only the first 1000 samples:
  31360. <div class="example">
  31361. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=end_sample=1000
  31362. </pre></div>
  31363. </li></ul>
  31364. </div>
  31365. <div class="section-level-extent" id="axcorrelate">
  31366. <h3 class="section"><span>36.68 axcorrelate<a class="copiable-link" href="#axcorrelate"> &para;</a></span></h3>
  31367. <p>Calculate normalized windowed cross-correlation between two input audio streams.
  31368. </p>
  31369. <p>Resulted samples are always between -1 and 1 inclusive.
  31370. If result is 1 it means two input samples are highly correlated in that selected segment.
  31371. Result 0 means they are not correlated at all.
  31372. If result is -1 it means two input samples are out of phase, which means they cancel each
  31373. other.
  31374. </p>
  31375. <p>The filter accepts the following options:
  31376. </p>
  31377. <dl class="table">
  31378. <dt><samp class="option">size</samp></dt>
  31379. <dd><p>Set size of segment over which cross-correlation is calculated.
  31380. Default is 256. Allowed range is from 2 to 131072.
  31381. </p>
  31382. </dd>
  31383. <dt><samp class="option">algo</samp></dt>
  31384. <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>.
  31385. Default is <code class="code">best</code>. Fast algorithm assumes mean values over any given segment
  31386. are always zero and thus need much less calculations to make.
  31387. This is generally not true, but is valid for typical audio streams.
  31388. </p></dd>
  31389. </dl>
  31390. <ul class="mini-toc">
  31391. <li><a href="#Examples-61" accesskey="1">Examples</a></li>
  31392. </ul>
  31393. <div class="subsection-level-extent" id="Examples-61">
  31394. <h4 class="subsection"><span>36.68.1 Examples<a class="copiable-link" href="#Examples-61"> &para;</a></span></h4>
  31395. <ul class="itemize mark-bullet">
  31396. <li>Calculate correlation between channels in stereo audio stream:
  31397. <div class="example">
  31398. <pre class="example-preformatted">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  31399. </pre></div>
  31400. </li></ul>
  31401. </div>
  31402. </div>
  31403. <div class="section-level-extent" id="bandpass">
  31404. <h3 class="section"><span>36.69 bandpass<a class="copiable-link" href="#bandpass"> &para;</a></span></h3>
  31405. <p>Apply a two-pole Butterworth band-pass filter with central
  31406. frequency <var class="var">frequency</var>, and (3dB-point) band-width width.
  31407. The <var class="var">csg</var> option selects a constant skirt gain (peak gain = Q)
  31408. instead of the default: constant 0dB peak gain.
  31409. The filter roll off at 6dB per octave (20dB per decade).
  31410. </p>
  31411. <p>The filter accepts the following options:
  31412. </p>
  31413. <dl class="table">
  31414. <dt><samp class="option">frequency, f</samp></dt>
  31415. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  31416. </p>
  31417. </dd>
  31418. <dt><samp class="option">csg</samp></dt>
  31419. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  31420. </p>
  31421. </dd>
  31422. <dt><samp class="option">width_type, t</samp></dt>
  31423. <dd><p>Set method to specify band-width of filter.
  31424. </p><dl class="table">
  31425. <dt><samp class="option">h</samp></dt>
  31426. <dd><p>Hz
  31427. </p></dd>
  31428. <dt><samp class="option">q</samp></dt>
  31429. <dd><p>Q-Factor
  31430. </p></dd>
  31431. <dt><samp class="option">o</samp></dt>
  31432. <dd><p>octave
  31433. </p></dd>
  31434. <dt><samp class="option">s</samp></dt>
  31435. <dd><p>slope
  31436. </p></dd>
  31437. <dt><samp class="option">k</samp></dt>
  31438. <dd><p>kHz
  31439. </p></dd>
  31440. </dl>
  31441. </dd>
  31442. <dt><samp class="option">width, w</samp></dt>
  31443. <dd><p>Specify the band-width of a filter in width_type units.
  31444. </p>
  31445. </dd>
  31446. <dt><samp class="option">mix, m</samp></dt>
  31447. <dd><p>How much to use filtered signal in output. Default is 1.
  31448. Range is between 0 and 1.
  31449. </p>
  31450. </dd>
  31451. <dt><samp class="option">channels, c</samp></dt>
  31452. <dd><p>Specify which channels to filter, by default all available are filtered.
  31453. </p>
  31454. </dd>
  31455. <dt><samp class="option">normalize, n</samp></dt>
  31456. <dd><p>Normalize biquad coefficients, by default is disabled.
  31457. Enabling it will normalize magnitude response at DC to 0dB.
  31458. </p>
  31459. </dd>
  31460. <dt><samp class="option">transform, a</samp></dt>
  31461. <dd><p>Set transform type of IIR filter.
  31462. </p><dl class="table">
  31463. <dt><samp class="option">di</samp></dt>
  31464. <dt><samp class="option">dii</samp></dt>
  31465. <dt><samp class="option">tdi</samp></dt>
  31466. <dt><samp class="option">tdii</samp></dt>
  31467. <dt><samp class="option">latt</samp></dt>
  31468. <dt><samp class="option">svf</samp></dt>
  31469. <dt><samp class="option">zdf</samp></dt>
  31470. </dl>
  31471. </dd>
  31472. <dt><samp class="option">precision, r</samp></dt>
  31473. <dd><p>Set precision of filtering.
  31474. </p><dl class="table">
  31475. <dt><samp class="option">auto</samp></dt>
  31476. <dd><p>Pick automatic sample format depending on surround filters.
  31477. </p></dd>
  31478. <dt><samp class="option">s16</samp></dt>
  31479. <dd><p>Always use signed 16-bit.
  31480. </p></dd>
  31481. <dt><samp class="option">s32</samp></dt>
  31482. <dd><p>Always use signed 32-bit.
  31483. </p></dd>
  31484. <dt><samp class="option">f32</samp></dt>
  31485. <dd><p>Always use float 32-bit.
  31486. </p></dd>
  31487. <dt><samp class="option">f64</samp></dt>
  31488. <dd><p>Always use float 64-bit.
  31489. </p></dd>
  31490. </dl>
  31491. </dd>
  31492. <dt><samp class="option">block_size, b</samp></dt>
  31493. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  31494. value (higher than impulse response length truncated when reaches near zero values) filtering
  31495. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  31496. </p>
  31497. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  31498. </p></dd>
  31499. </dl>
  31500. <ul class="mini-toc">
  31501. <li><a href="#Commands-29" accesskey="1">Commands</a></li>
  31502. </ul>
  31503. <div class="subsection-level-extent" id="Commands-29">
  31504. <h4 class="subsection"><span>36.69.1 Commands<a class="copiable-link" href="#Commands-29"> &para;</a></span></h4>
  31505. <p>This filter supports the following commands:
  31506. </p><dl class="table">
  31507. <dt><samp class="option">frequency, f</samp></dt>
  31508. <dd><p>Change bandpass frequency.
  31509. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  31510. </p>
  31511. </dd>
  31512. <dt><samp class="option">width_type, t</samp></dt>
  31513. <dd><p>Change bandpass width_type.
  31514. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  31515. </p>
  31516. </dd>
  31517. <dt><samp class="option">width, w</samp></dt>
  31518. <dd><p>Change bandpass width.
  31519. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  31520. </p>
  31521. </dd>
  31522. <dt><samp class="option">mix, m</samp></dt>
  31523. <dd><p>Change bandpass mix.
  31524. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  31525. </p></dd>
  31526. </dl>
  31527. </div>
  31528. </div>
  31529. <div class="section-level-extent" id="bandreject">
  31530. <h3 class="section"><span>36.70 bandreject<a class="copiable-link" href="#bandreject"> &para;</a></span></h3>
  31531. <p>Apply a two-pole Butterworth band-reject filter with central
  31532. frequency <var class="var">frequency</var>, and (3dB-point) band-width <var class="var">width</var>.
  31533. The filter roll off at 6dB per octave (20dB per decade).
  31534. </p>
  31535. <p>The filter accepts the following options:
  31536. </p>
  31537. <dl class="table">
  31538. <dt><samp class="option">frequency, f</samp></dt>
  31539. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  31540. </p>
  31541. </dd>
  31542. <dt><samp class="option">width_type, t</samp></dt>
  31543. <dd><p>Set method to specify band-width of filter.
  31544. </p><dl class="table">
  31545. <dt><samp class="option">h</samp></dt>
  31546. <dd><p>Hz
  31547. </p></dd>
  31548. <dt><samp class="option">q</samp></dt>
  31549. <dd><p>Q-Factor
  31550. </p></dd>
  31551. <dt><samp class="option">o</samp></dt>
  31552. <dd><p>octave
  31553. </p></dd>
  31554. <dt><samp class="option">s</samp></dt>
  31555. <dd><p>slope
  31556. </p></dd>
  31557. <dt><samp class="option">k</samp></dt>
  31558. <dd><p>kHz
  31559. </p></dd>
  31560. </dl>
  31561. </dd>
  31562. <dt><samp class="option">width, w</samp></dt>
  31563. <dd><p>Specify the band-width of a filter in width_type units.
  31564. </p>
  31565. </dd>
  31566. <dt><samp class="option">mix, m</samp></dt>
  31567. <dd><p>How much to use filtered signal in output. Default is 1.
  31568. Range is between 0 and 1.
  31569. </p>
  31570. </dd>
  31571. <dt><samp class="option">channels, c</samp></dt>
  31572. <dd><p>Specify which channels to filter, by default all available are filtered.
  31573. </p>
  31574. </dd>
  31575. <dt><samp class="option">normalize, n</samp></dt>
  31576. <dd><p>Normalize biquad coefficients, by default is disabled.
  31577. Enabling it will normalize magnitude response at DC to 0dB.
  31578. </p>
  31579. </dd>
  31580. <dt><samp class="option">transform, a</samp></dt>
  31581. <dd><p>Set transform type of IIR filter.
  31582. </p><dl class="table">
  31583. <dt><samp class="option">di</samp></dt>
  31584. <dt><samp class="option">dii</samp></dt>
  31585. <dt><samp class="option">tdi</samp></dt>
  31586. <dt><samp class="option">tdii</samp></dt>
  31587. <dt><samp class="option">latt</samp></dt>
  31588. <dt><samp class="option">svf</samp></dt>
  31589. <dt><samp class="option">zdf</samp></dt>
  31590. </dl>
  31591. </dd>
  31592. <dt><samp class="option">precision, r</samp></dt>
  31593. <dd><p>Set precision of filtering.
  31594. </p><dl class="table">
  31595. <dt><samp class="option">auto</samp></dt>
  31596. <dd><p>Pick automatic sample format depending on surround filters.
  31597. </p></dd>
  31598. <dt><samp class="option">s16</samp></dt>
  31599. <dd><p>Always use signed 16-bit.
  31600. </p></dd>
  31601. <dt><samp class="option">s32</samp></dt>
  31602. <dd><p>Always use signed 32-bit.
  31603. </p></dd>
  31604. <dt><samp class="option">f32</samp></dt>
  31605. <dd><p>Always use float 32-bit.
  31606. </p></dd>
  31607. <dt><samp class="option">f64</samp></dt>
  31608. <dd><p>Always use float 64-bit.
  31609. </p></dd>
  31610. </dl>
  31611. </dd>
  31612. <dt><samp class="option">block_size, b</samp></dt>
  31613. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  31614. value (higher than impulse response length truncated when reaches near zero values) filtering
  31615. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  31616. </p>
  31617. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  31618. </p></dd>
  31619. </dl>
  31620. <ul class="mini-toc">
  31621. <li><a href="#Commands-30" accesskey="1">Commands</a></li>
  31622. </ul>
  31623. <div class="subsection-level-extent" id="Commands-30">
  31624. <h4 class="subsection"><span>36.70.1 Commands<a class="copiable-link" href="#Commands-30"> &para;</a></span></h4>
  31625. <p>This filter supports the following commands:
  31626. </p><dl class="table">
  31627. <dt><samp class="option">frequency, f</samp></dt>
  31628. <dd><p>Change bandreject frequency.
  31629. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  31630. </p>
  31631. </dd>
  31632. <dt><samp class="option">width_type, t</samp></dt>
  31633. <dd><p>Change bandreject width_type.
  31634. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  31635. </p>
  31636. </dd>
  31637. <dt><samp class="option">width, w</samp></dt>
  31638. <dd><p>Change bandreject width.
  31639. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  31640. </p>
  31641. </dd>
  31642. <dt><samp class="option">mix, m</samp></dt>
  31643. <dd><p>Change bandreject mix.
  31644. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  31645. </p></dd>
  31646. </dl>
  31647. </div>
  31648. </div>
  31649. <div class="section-level-extent" id="bass_002c-lowshelf">
  31650. <h3 class="section"><span>36.71 bass, lowshelf<a class="copiable-link" href="#bass_002c-lowshelf"> &para;</a></span></h3>
  31651. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  31652. shelving filter with a response similar to that of a standard
  31653. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  31654. </p>
  31655. <p>The filter accepts the following options:
  31656. </p>
  31657. <dl class="table">
  31658. <dt><samp class="option">gain, g</samp></dt>
  31659. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  31660. (for a large cut) to +20 (for a large boost).
  31661. Beware of clipping when using a positive gain.
  31662. </p>
  31663. </dd>
  31664. <dt><samp class="option">frequency, f</samp></dt>
  31665. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  31666. to extend or reduce the frequency range to be boosted or cut.
  31667. The default value is <code class="code">100</code> Hz.
  31668. </p>
  31669. </dd>
  31670. <dt><samp class="option">width_type, t</samp></dt>
  31671. <dd><p>Set method to specify band-width of filter.
  31672. </p><dl class="table">
  31673. <dt><samp class="option">h</samp></dt>
  31674. <dd><p>Hz
  31675. </p></dd>
  31676. <dt><samp class="option">q</samp></dt>
  31677. <dd><p>Q-Factor
  31678. </p></dd>
  31679. <dt><samp class="option">o</samp></dt>
  31680. <dd><p>octave
  31681. </p></dd>
  31682. <dt><samp class="option">s</samp></dt>
  31683. <dd><p>slope
  31684. </p></dd>
  31685. <dt><samp class="option">k</samp></dt>
  31686. <dd><p>kHz
  31687. </p></dd>
  31688. </dl>
  31689. </dd>
  31690. <dt><samp class="option">width, w</samp></dt>
  31691. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  31692. </p>
  31693. </dd>
  31694. <dt><samp class="option">poles, p</samp></dt>
  31695. <dd><p>Set number of poles. Default is 2.
  31696. </p>
  31697. </dd>
  31698. <dt><samp class="option">mix, m</samp></dt>
  31699. <dd><p>How much to use filtered signal in output. Default is 1.
  31700. Range is between 0 and 1.
  31701. </p>
  31702. </dd>
  31703. <dt><samp class="option">channels, c</samp></dt>
  31704. <dd><p>Specify which channels to filter, by default all available are filtered.
  31705. </p>
  31706. </dd>
  31707. <dt><samp class="option">normalize, n</samp></dt>
  31708. <dd><p>Normalize biquad coefficients, by default is disabled.
  31709. Enabling it will normalize magnitude response at DC to 0dB.
  31710. </p>
  31711. </dd>
  31712. <dt><samp class="option">transform, a</samp></dt>
  31713. <dd><p>Set transform type of IIR filter.
  31714. </p><dl class="table">
  31715. <dt><samp class="option">di</samp></dt>
  31716. <dt><samp class="option">dii</samp></dt>
  31717. <dt><samp class="option">tdi</samp></dt>
  31718. <dt><samp class="option">tdii</samp></dt>
  31719. <dt><samp class="option">latt</samp></dt>
  31720. <dt><samp class="option">svf</samp></dt>
  31721. <dt><samp class="option">zdf</samp></dt>
  31722. </dl>
  31723. </dd>
  31724. <dt><samp class="option">precision, r</samp></dt>
  31725. <dd><p>Set precision of filtering.
  31726. </p><dl class="table">
  31727. <dt><samp class="option">auto</samp></dt>
  31728. <dd><p>Pick automatic sample format depending on surround filters.
  31729. </p></dd>
  31730. <dt><samp class="option">s16</samp></dt>
  31731. <dd><p>Always use signed 16-bit.
  31732. </p></dd>
  31733. <dt><samp class="option">s32</samp></dt>
  31734. <dd><p>Always use signed 32-bit.
  31735. </p></dd>
  31736. <dt><samp class="option">f32</samp></dt>
  31737. <dd><p>Always use float 32-bit.
  31738. </p></dd>
  31739. <dt><samp class="option">f64</samp></dt>
  31740. <dd><p>Always use float 64-bit.
  31741. </p></dd>
  31742. </dl>
  31743. </dd>
  31744. <dt><samp class="option">block_size, b</samp></dt>
  31745. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  31746. value (higher than impulse response length truncated when reaches near zero values) filtering
  31747. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  31748. </p>
  31749. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  31750. </p></dd>
  31751. </dl>
  31752. <ul class="mini-toc">
  31753. <li><a href="#Commands-31" accesskey="1">Commands</a></li>
  31754. </ul>
  31755. <div class="subsection-level-extent" id="Commands-31">
  31756. <h4 class="subsection"><span>36.71.1 Commands<a class="copiable-link" href="#Commands-31"> &para;</a></span></h4>
  31757. <p>This filter supports the following commands:
  31758. </p><dl class="table">
  31759. <dt><samp class="option">frequency, f</samp></dt>
  31760. <dd><p>Change bass frequency.
  31761. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  31762. </p>
  31763. </dd>
  31764. <dt><samp class="option">width_type, t</samp></dt>
  31765. <dd><p>Change bass width_type.
  31766. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  31767. </p>
  31768. </dd>
  31769. <dt><samp class="option">width, w</samp></dt>
  31770. <dd><p>Change bass width.
  31771. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  31772. </p>
  31773. </dd>
  31774. <dt><samp class="option">gain, g</samp></dt>
  31775. <dd><p>Change bass gain.
  31776. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  31777. </p>
  31778. </dd>
  31779. <dt><samp class="option">mix, m</samp></dt>
  31780. <dd><p>Change bass mix.
  31781. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  31782. </p></dd>
  31783. </dl>
  31784. </div>
  31785. </div>
  31786. <div class="section-level-extent" id="biquad">
  31787. <h3 class="section"><span>36.72 biquad<a class="copiable-link" href="#biquad"> &para;</a></span></h3>
  31788. <p>Apply a biquad IIR filter with the given coefficients.
  31789. 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>
  31790. are the numerator and denominator coefficients respectively.
  31791. and <var class="var">channels</var>, <var class="var">c</var> specify which channels to filter, by default all
  31792. available are filtered.
  31793. </p>
  31794. <ul class="mini-toc">
  31795. <li><a href="#Commands-32" accesskey="1">Commands</a></li>
  31796. </ul>
  31797. <div class="subsection-level-extent" id="Commands-32">
  31798. <h4 class="subsection"><span>36.72.1 Commands<a class="copiable-link" href="#Commands-32"> &para;</a></span></h4>
  31799. <p>This filter supports the following commands:
  31800. </p><dl class="table">
  31801. <dt><samp class="option">a0</samp></dt>
  31802. <dt><samp class="option">a1</samp></dt>
  31803. <dt><samp class="option">a2</samp></dt>
  31804. <dt><samp class="option">b0</samp></dt>
  31805. <dt><samp class="option">b1</samp></dt>
  31806. <dt><samp class="option">b2</samp></dt>
  31807. <dd><p>Change biquad parameter.
  31808. Syntax for the command is : &quot;<var class="var">value</var>&quot;
  31809. </p>
  31810. </dd>
  31811. <dt><samp class="option">mix, m</samp></dt>
  31812. <dd><p>How much to use filtered signal in output. Default is 1.
  31813. Range is between 0 and 1.
  31814. </p>
  31815. </dd>
  31816. <dt><samp class="option">channels, c</samp></dt>
  31817. <dd><p>Specify which channels to filter, by default all available are filtered.
  31818. </p>
  31819. </dd>
  31820. <dt><samp class="option">normalize, n</samp></dt>
  31821. <dd><p>Normalize biquad coefficients, by default is disabled.
  31822. Enabling it will normalize magnitude response at DC to 0dB.
  31823. </p>
  31824. </dd>
  31825. <dt><samp class="option">transform, a</samp></dt>
  31826. <dd><p>Set transform type of IIR filter.
  31827. </p><dl class="table">
  31828. <dt><samp class="option">di</samp></dt>
  31829. <dt><samp class="option">dii</samp></dt>
  31830. <dt><samp class="option">tdi</samp></dt>
  31831. <dt><samp class="option">tdii</samp></dt>
  31832. <dt><samp class="option">latt</samp></dt>
  31833. <dt><samp class="option">svf</samp></dt>
  31834. <dt><samp class="option">zdf</samp></dt>
  31835. </dl>
  31836. </dd>
  31837. <dt><samp class="option">precision, r</samp></dt>
  31838. <dd><p>Set precision of filtering.
  31839. </p><dl class="table">
  31840. <dt><samp class="option">auto</samp></dt>
  31841. <dd><p>Pick automatic sample format depending on surround filters.
  31842. </p></dd>
  31843. <dt><samp class="option">s16</samp></dt>
  31844. <dd><p>Always use signed 16-bit.
  31845. </p></dd>
  31846. <dt><samp class="option">s32</samp></dt>
  31847. <dd><p>Always use signed 32-bit.
  31848. </p></dd>
  31849. <dt><samp class="option">f32</samp></dt>
  31850. <dd><p>Always use float 32-bit.
  31851. </p></dd>
  31852. <dt><samp class="option">f64</samp></dt>
  31853. <dd><p>Always use float 64-bit.
  31854. </p></dd>
  31855. </dl>
  31856. </dd>
  31857. <dt><samp class="option">block_size, b</samp></dt>
  31858. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  31859. value (higher than impulse response length truncated when reaches near zero values) filtering
  31860. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  31861. </p>
  31862. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  31863. </p></dd>
  31864. </dl>
  31865. </div>
  31866. </div>
  31867. <div class="section-level-extent" id="bs2b">
  31868. <h3 class="section"><span>36.73 bs2b<a class="copiable-link" href="#bs2b"> &para;</a></span></h3>
  31869. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  31870. stereo audio records.
  31871. </p>
  31872. <p>To enable compilation of this filter you need to configure FFmpeg with
  31873. <code class="code">--enable-libbs2b</code>.
  31874. </p>
  31875. <p>It accepts the following parameters:
  31876. </p><dl class="table">
  31877. <dt><samp class="option">profile</samp></dt>
  31878. <dd><p>Pre-defined crossfeed level.
  31879. </p><dl class="table">
  31880. <dt><samp class="option">default</samp></dt>
  31881. <dd><p>Default level (fcut=700, feed=50).
  31882. </p>
  31883. </dd>
  31884. <dt><samp class="option">cmoy</samp></dt>
  31885. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  31886. </p>
  31887. </dd>
  31888. <dt><samp class="option">jmeier</samp></dt>
  31889. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  31890. </p>
  31891. </dd>
  31892. </dl>
  31893. </dd>
  31894. <dt><samp class="option">fcut</samp></dt>
  31895. <dd><p>Cut frequency (in Hz).
  31896. </p>
  31897. </dd>
  31898. <dt><samp class="option">feed</samp></dt>
  31899. <dd><p>Feed level (in Hz).
  31900. </p>
  31901. </dd>
  31902. </dl>
  31903. </div>
  31904. <div class="section-level-extent" id="channelmap">
  31905. <h3 class="section"><span>36.74 channelmap<a class="copiable-link" href="#channelmap"> &para;</a></span></h3>
  31906. <p>Remap input channels to new locations.
  31907. </p>
  31908. <p>It accepts the following parameters:
  31909. </p><dl class="table">
  31910. <dt><samp class="option">map</samp></dt>
  31911. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  31912. mappings, each in the <code class="code"><var class="var">in_channel</var>-<var class="var">out_channel</var></code> or
  31913. <code class="code"><var class="var">in_channel</var></code> form. <var class="var">in_channel</var> can be either the name of the
  31914. input channel (e.g. FL for front left) or its index in the input channel
  31915. layout. <var class="var">out_channel</var> is the name of the output channel or its index in the
  31916. output channel layout. If <var class="var">out_channel</var> is not given then it is implicitly
  31917. an index, starting with zero and increasing by one for each mapping. Mixing
  31918. different types of mappings is not allowed and will result in a parse error.
  31919. </p>
  31920. </dd>
  31921. <dt><samp class="option">channel_layout</samp></dt>
  31922. <dd><p>The channel layout of the output stream. If not specified, then filter will
  31923. guess it based on the <var class="var">out_channel</var> names or the number of mappings.
  31924. Guessed layouts will not necessarily contain channels in the order of the
  31925. mappings.
  31926. </p></dd>
  31927. </dl>
  31928. <p>If no mapping is present, the filter will implicitly map input channels to
  31929. output channels, preserving indices.
  31930. </p>
  31931. <ul class="mini-toc">
  31932. <li><a href="#Examples-62" accesskey="1">Examples</a></li>
  31933. </ul>
  31934. <div class="subsection-level-extent" id="Examples-62">
  31935. <h4 class="subsection"><span>36.74.1 Examples<a class="copiable-link" href="#Examples-62"> &para;</a></span></h4>
  31936. <ul class="itemize mark-bullet">
  31937. <li>For example, assuming a 5.1+downmix input MOV file,
  31938. <div class="example">
  31939. <pre class="example-preformatted">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  31940. </pre></div>
  31941. <p>will create an output WAV file tagged as stereo from the downmix channels of
  31942. the input.
  31943. </p>
  31944. </li><li>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  31945. <div class="example">
  31946. <pre class="example-preformatted">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  31947. </pre></div>
  31948. </li></ul>
  31949. </div>
  31950. </div>
  31951. <div class="section-level-extent" id="channelsplit">
  31952. <h3 class="section"><span>36.75 channelsplit<a class="copiable-link" href="#channelsplit"> &para;</a></span></h3>
  31953. <p>Split each channel from an input audio stream into a separate output stream.
  31954. </p>
  31955. <p>It accepts the following parameters:
  31956. </p><dl class="table">
  31957. <dt><samp class="option">channel_layout</samp></dt>
  31958. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  31959. </p></dd>
  31960. <dt><samp class="option">channels</samp></dt>
  31961. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  31962. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  31963. </p>
  31964. <p>Choosing channels not present in channel layout in the input will result in an error.
  31965. </p></dd>
  31966. </dl>
  31967. <ul class="mini-toc">
  31968. <li><a href="#Examples-63" accesskey="1">Examples</a></li>
  31969. </ul>
  31970. <div class="subsection-level-extent" id="Examples-63">
  31971. <h4 class="subsection"><span>36.75.1 Examples<a class="copiable-link" href="#Examples-63"> &para;</a></span></h4>
  31972. <ul class="itemize mark-bullet">
  31973. <li>For example, assuming a stereo input MP3 file,
  31974. <div class="example">
  31975. <pre class="example-preformatted">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  31976. </pre></div>
  31977. <p>will create an output Matroska file with two audio streams, one containing only
  31978. the left channel and the other the right channel.
  31979. </p>
  31980. </li><li>Split a 5.1 WAV file into per-channel files:
  31981. <div class="example">
  31982. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex
  31983. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  31984. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  31985. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  31986. side_right.wav
  31987. </pre></div>
  31988. </li><li>Extract only LFE from a 5.1 WAV file:
  31989. <div class="example">
  31990. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  31991. -map '[LFE]' lfe.wav
  31992. </pre></div>
  31993. </li></ul>
  31994. </div>
  31995. </div>
  31996. <div class="section-level-extent" id="chorus">
  31997. <h3 class="section"><span>36.76 chorus<a class="copiable-link" href="#chorus"> &para;</a></span></h3>
  31998. <p>Add a chorus effect to the audio.
  31999. </p>
  32000. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  32001. </p>
  32002. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  32003. constant, with chorus, it is varied using using sinusoidal or triangular modulation.
  32004. The modulation depth defines the range the modulated delay is played before or after
  32005. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  32006. sound tuned around the original one, like in a chorus where some vocals are slightly
  32007. off key.
  32008. </p>
  32009. <p>It accepts the following parameters:
  32010. </p><dl class="table">
  32011. <dt><samp class="option">in_gain</samp></dt>
  32012. <dd><p>Set input gain. Default is 0.4.
  32013. </p>
  32014. </dd>
  32015. <dt><samp class="option">out_gain</samp></dt>
  32016. <dd><p>Set output gain. Default is 0.4.
  32017. </p>
  32018. </dd>
  32019. <dt><samp class="option">delays</samp></dt>
  32020. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  32021. </p>
  32022. </dd>
  32023. <dt><samp class="option">decays</samp></dt>
  32024. <dd><p>Set decays.
  32025. </p>
  32026. </dd>
  32027. <dt><samp class="option">speeds</samp></dt>
  32028. <dd><p>Set speeds.
  32029. </p>
  32030. </dd>
  32031. <dt><samp class="option">depths</samp></dt>
  32032. <dd><p>Set depths.
  32033. </p></dd>
  32034. </dl>
  32035. <ul class="mini-toc">
  32036. <li><a href="#Examples-64" accesskey="1">Examples</a></li>
  32037. </ul>
  32038. <div class="subsection-level-extent" id="Examples-64">
  32039. <h4 class="subsection"><span>36.76.1 Examples<a class="copiable-link" href="#Examples-64"> &para;</a></span></h4>
  32040. <ul class="itemize mark-bullet">
  32041. <li>A single delay:
  32042. <div class="example">
  32043. <pre class="example-preformatted">chorus=0.7:0.9:55:0.4:0.25:2
  32044. </pre></div>
  32045. </li><li>Two delays:
  32046. <div class="example">
  32047. <pre class="example-preformatted">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  32048. </pre></div>
  32049. </li><li>Fuller sounding chorus with three delays:
  32050. <div class="example">
  32051. <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
  32052. </pre></div>
  32053. </li></ul>
  32054. </div>
  32055. </div>
  32056. <div class="section-level-extent" id="compand">
  32057. <h3 class="section"><span>36.77 compand<a class="copiable-link" href="#compand"> &para;</a></span></h3>
  32058. <p>Compress or expand the audio&rsquo;s dynamic range.
  32059. </p>
  32060. <p>It accepts the following parameters:
  32061. </p>
  32062. <dl class="table">
  32063. <dt><samp class="option">attacks</samp></dt>
  32064. <dt><samp class="option">decays</samp></dt>
  32065. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  32066. of the input signal is averaged to determine its volume. <var class="var">attacks</var> refers to
  32067. increase of volume and <var class="var">decays</var> refers to decrease of volume. For most
  32068. situations, the attack time (response to the audio getting louder) should be
  32069. shorter than the decay time, because the human ear is more sensitive to sudden
  32070. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  32071. a typical value for decay is 0.8 seconds.
  32072. If specified number of attacks &amp; decays is lower than number of channels, the last
  32073. set attack/decay will be used for all remaining channels.
  32074. </p>
  32075. </dd>
  32076. <dt><samp class="option">points</samp></dt>
  32077. <dd><p>A list of points for the transfer function, specified in dB relative to the
  32078. maximum possible signal amplitude. Each key points list must be defined using
  32079. the following syntax: <code class="code">x0/y0|x1/y1|x2/y2|....</code> or
  32080. <code class="code">x0/y0 x1/y1 x2/y2 ....</code>
  32081. </p>
  32082. <p>The input values must be in strictly increasing order but the transfer function
  32083. does not have to be monotonically rising. The point <code class="code">0/0</code> is assumed but
  32084. may be overridden (by <code class="code">0/out-dBn</code>). Typical values for the transfer
  32085. function are <code class="code">-70/-70|-60/-20|1/0</code>.
  32086. </p>
  32087. </dd>
  32088. <dt><samp class="option">soft-knee</samp></dt>
  32089. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  32090. </p>
  32091. </dd>
  32092. <dt><samp class="option">gain</samp></dt>
  32093. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  32094. function. This allows for easy adjustment of the overall gain.
  32095. It defaults to 0.
  32096. </p>
  32097. </dd>
  32098. <dt><samp class="option">volume</samp></dt>
  32099. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  32100. starts. This permits the user to supply a nominal level initially, so that, for
  32101. example, a very large gain is not applied to initial signal levels before the
  32102. companding has begun to operate. A typical value for audio which is initially
  32103. quiet is -90 dB. It defaults to 0.
  32104. </p>
  32105. </dd>
  32106. <dt><samp class="option">delay</samp></dt>
  32107. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  32108. delayed before being fed to the volume adjuster. Specifying a delay
  32109. approximately equal to the attack/decay times allows the filter to effectively
  32110. operate in predictive rather than reactive mode. It defaults to 0.
  32111. </p>
  32112. </dd>
  32113. </dl>
  32114. <ul class="mini-toc">
  32115. <li><a href="#Examples-65" accesskey="1">Examples</a></li>
  32116. </ul>
  32117. <div class="subsection-level-extent" id="Examples-65">
  32118. <h4 class="subsection"><span>36.77.1 Examples<a class="copiable-link" href="#Examples-65"> &para;</a></span></h4>
  32119. <ul class="itemize mark-bullet">
  32120. <li>Make music with both quiet and loud passages suitable for listening to in a
  32121. noisy environment:
  32122. <div class="example">
  32123. <pre class="example-preformatted">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  32124. </pre></div>
  32125. <p>Another example for audio with whisper and explosion parts:
  32126. </p><div class="example">
  32127. <pre class="example-preformatted">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  32128. </pre></div>
  32129. </li><li>A noise gate for when the noise is at a lower level than the signal:
  32130. <div class="example">
  32131. <pre class="example-preformatted">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  32132. </pre></div>
  32133. </li><li>Here is another noise gate, this time for when the noise is at a higher level
  32134. than the signal (making it, in some ways, similar to squelch):
  32135. <div class="example">
  32136. <pre class="example-preformatted">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  32137. </pre></div>
  32138. </li><li>2:1 compression starting at -6dB:
  32139. <div class="example">
  32140. <pre class="example-preformatted">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  32141. </pre></div>
  32142. </li><li>2:1 compression starting at -9dB:
  32143. <div class="example">
  32144. <pre class="example-preformatted">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  32145. </pre></div>
  32146. </li><li>2:1 compression starting at -12dB:
  32147. <div class="example">
  32148. <pre class="example-preformatted">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  32149. </pre></div>
  32150. </li><li>2:1 compression starting at -18dB:
  32151. <div class="example">
  32152. <pre class="example-preformatted">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  32153. </pre></div>
  32154. </li><li>3:1 compression starting at -15dB:
  32155. <div class="example">
  32156. <pre class="example-preformatted">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  32157. </pre></div>
  32158. </li><li>Compressor/Gate:
  32159. <div class="example">
  32160. <pre class="example-preformatted">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  32161. </pre></div>
  32162. </li><li>Expander:
  32163. <div class="example">
  32164. <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
  32165. </pre></div>
  32166. </li><li>Hard limiter at -6dB:
  32167. <div class="example">
  32168. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  32169. </pre></div>
  32170. </li><li>Hard limiter at -12dB:
  32171. <div class="example">
  32172. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  32173. </pre></div>
  32174. </li><li>Hard noise gate at -35 dB:
  32175. <div class="example">
  32176. <pre class="example-preformatted">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  32177. </pre></div>
  32178. </li><li>Soft limiter:
  32179. <div class="example">
  32180. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  32181. </pre></div>
  32182. </li></ul>
  32183. </div>
  32184. </div>
  32185. <div class="section-level-extent" id="compensationdelay">
  32186. <h3 class="section"><span>36.78 compensationdelay<a class="copiable-link" href="#compensationdelay"> &para;</a></span></h3>
  32187. <p>Compensation Delay Line is a metric based delay to compensate differing
  32188. positions of microphones or speakers.
  32189. </p>
  32190. <p>For example, you have recorded guitar with two microphones placed in
  32191. different locations. Because the front of sound wave has fixed speed in
  32192. normal conditions, the phasing of microphones can vary and depends on
  32193. their location and interposition. The best sound mix can be achieved when
  32194. these microphones are in phase (synchronized). Note that a distance of
  32195. ~30 cm between microphones makes one microphone capture the signal in
  32196. antiphase to the other microphone. That makes the final mix sound moody.
  32197. This filter helps to solve phasing problems by adding different delays
  32198. to each microphone track and make them synchronized.
  32199. </p>
  32200. <p>The best result can be reached when you take one track as base and
  32201. synchronize other tracks one by one with it.
  32202. Remember that synchronization/delay tolerance depends on sample rate, too.
  32203. Higher sample rates will give more tolerance.
  32204. </p>
  32205. <p>The filter accepts the following parameters:
  32206. </p>
  32207. <dl class="table">
  32208. <dt><samp class="option">mm</samp></dt>
  32209. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  32210. Default is 0.
  32211. </p>
  32212. </dd>
  32213. <dt><samp class="option">cm</samp></dt>
  32214. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  32215. Default is 0.
  32216. </p>
  32217. </dd>
  32218. <dt><samp class="option">m</samp></dt>
  32219. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  32220. Default is 0.
  32221. </p>
  32222. </dd>
  32223. <dt><samp class="option">dry</samp></dt>
  32224. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  32225. Default is 0.
  32226. </p>
  32227. </dd>
  32228. <dt><samp class="option">wet</samp></dt>
  32229. <dd><p>Set wet amount. Amount of processed (wet) signal.
  32230. Default is 1.
  32231. </p>
  32232. </dd>
  32233. <dt><samp class="option">temp</samp></dt>
  32234. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  32235. Default is 20.
  32236. </p></dd>
  32237. </dl>
  32238. <ul class="mini-toc">
  32239. <li><a href="#Commands-33" accesskey="1">Commands</a></li>
  32240. </ul>
  32241. <div class="subsection-level-extent" id="Commands-33">
  32242. <h4 class="subsection"><span>36.78.1 Commands<a class="copiable-link" href="#Commands-33"> &para;</a></span></h4>
  32243. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32244. </p>
  32245. </div>
  32246. </div>
  32247. <div class="section-level-extent" id="crossfeed">
  32248. <h3 class="section"><span>36.79 crossfeed<a class="copiable-link" href="#crossfeed"> &para;</a></span></h3>
  32249. <p>Apply headphone crossfeed filter.
  32250. </p>
  32251. <p>Crossfeed is the process of blending the left and right channels of stereo
  32252. audio recording.
  32253. It is mainly used to reduce extreme stereo separation of low frequencies.
  32254. </p>
  32255. <p>The intent is to produce more speaker like sound to the listener.
  32256. </p>
  32257. <p>The filter accepts the following options:
  32258. </p>
  32259. <dl class="table">
  32260. <dt><samp class="option">strength</samp></dt>
  32261. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  32262. This sets gain of low shelf filter for side part of stereo image.
  32263. Default is -6dB. Max allowed is -30db when strength is set to 1.
  32264. </p>
  32265. </dd>
  32266. <dt><samp class="option">range</samp></dt>
  32267. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  32268. This sets cut off frequency of low shelf filter. Default is cut off near
  32269. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  32270. </p>
  32271. </dd>
  32272. <dt><samp class="option">slope</samp></dt>
  32273. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  32274. Allowed range is from 0.01 to 1.
  32275. </p>
  32276. </dd>
  32277. <dt><samp class="option">level_in</samp></dt>
  32278. <dd><p>Set input gain. Default is 0.9.
  32279. </p>
  32280. </dd>
  32281. <dt><samp class="option">level_out</samp></dt>
  32282. <dd><p>Set output gain. Default is 1.
  32283. </p>
  32284. </dd>
  32285. <dt><samp class="option">block_size</samp></dt>
  32286. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  32287. value (higher than impulse response length truncated when reaches near zero values) filtering
  32288. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  32289. </p>
  32290. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  32291. </p></dd>
  32292. </dl>
  32293. <ul class="mini-toc">
  32294. <li><a href="#Commands-34" accesskey="1">Commands</a></li>
  32295. </ul>
  32296. <div class="subsection-level-extent" id="Commands-34">
  32297. <h4 class="subsection"><span>36.79.1 Commands<a class="copiable-link" href="#Commands-34"> &para;</a></span></h4>
  32298. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32299. </p>
  32300. </div>
  32301. </div>
  32302. <div class="section-level-extent" id="crystalizer">
  32303. <h3 class="section"><span>36.80 crystalizer<a class="copiable-link" href="#crystalizer"> &para;</a></span></h3>
  32304. <p>Simple algorithm for audio noise sharpening.
  32305. </p>
  32306. <p>This filter linearly increases differences between each audio sample.
  32307. </p>
  32308. <p>The filter accepts the following options:
  32309. </p>
  32310. <dl class="table">
  32311. <dt><samp class="option">i</samp></dt>
  32312. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0
  32313. (unchanged sound) to 10.0 (maximum effect).
  32314. To inverse filtering use negative value.
  32315. </p>
  32316. </dd>
  32317. <dt><samp class="option">c</samp></dt>
  32318. <dd><p>Enable clipping. By default is enabled.
  32319. </p></dd>
  32320. </dl>
  32321. <ul class="mini-toc">
  32322. <li><a href="#Commands-35" accesskey="1">Commands</a></li>
  32323. </ul>
  32324. <div class="subsection-level-extent" id="Commands-35">
  32325. <h4 class="subsection"><span>36.80.1 Commands<a class="copiable-link" href="#Commands-35"> &para;</a></span></h4>
  32326. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32327. </p>
  32328. </div>
  32329. </div>
  32330. <div class="section-level-extent" id="dcshift">
  32331. <h3 class="section"><span>36.81 dcshift<a class="copiable-link" href="#dcshift"> &para;</a></span></h3>
  32332. <p>Apply a DC shift to the audio.
  32333. </p>
  32334. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  32335. in the recording chain) from the audio. The effect of a DC offset is reduced
  32336. headroom and hence volume. The <a class="ref" href="#astats">astats</a> filter can be used to determine if
  32337. a signal has a DC offset.
  32338. </p>
  32339. <dl class="table">
  32340. <dt><samp class="option">shift</samp></dt>
  32341. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  32342. the audio.
  32343. </p>
  32344. </dd>
  32345. <dt><samp class="option">limitergain</samp></dt>
  32346. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  32347. used to prevent clipping.
  32348. </p></dd>
  32349. </dl>
  32350. </div>
  32351. <div class="section-level-extent" id="deesser">
  32352. <h3 class="section"><span>36.82 deesser<a class="copiable-link" href="#deesser"> &para;</a></span></h3>
  32353. <p>Apply de-essing to the audio samples.
  32354. </p>
  32355. <dl class="table">
  32356. <dt><samp class="option">i</samp></dt>
  32357. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  32358. Default is 0.
  32359. </p>
  32360. </dd>
  32361. <dt><samp class="option">m</samp></dt>
  32362. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  32363. Default is 0.5.
  32364. </p>
  32365. </dd>
  32366. <dt><samp class="option">f</samp></dt>
  32367. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  32368. Default is 0.5.
  32369. </p>
  32370. </dd>
  32371. <dt><samp class="option">s</samp></dt>
  32372. <dd><p>Set the output mode.
  32373. </p>
  32374. <p>It accepts the following values:
  32375. </p><dl class="table">
  32376. <dt><samp class="option">i</samp></dt>
  32377. <dd><p>Pass input unchanged.
  32378. </p>
  32379. </dd>
  32380. <dt><samp class="option">o</samp></dt>
  32381. <dd><p>Pass ess filtered out.
  32382. </p>
  32383. </dd>
  32384. <dt><samp class="option">e</samp></dt>
  32385. <dd><p>Pass only ess.
  32386. </p>
  32387. <p>Default value is <var class="var">o</var>.
  32388. </p></dd>
  32389. </dl>
  32390. </dd>
  32391. </dl>
  32392. </div>
  32393. <div class="section-level-extent" id="dialoguenhance">
  32394. <h3 class="section"><span>36.83 dialoguenhance<a class="copiable-link" href="#dialoguenhance"> &para;</a></span></h3>
  32395. <p>Enhance dialogue in stereo audio.
  32396. </p>
  32397. <p>This filter accepts stereo input and produce surround (3.0) channels output.
  32398. The newly produced front center channel have enhanced speech dialogue originally
  32399. available in both stereo channels.
  32400. This filter outputs front left and front right channels same as available in stereo input.
  32401. </p>
  32402. <p>The filter accepts the following options:
  32403. </p>
  32404. <dl class="table">
  32405. <dt><samp class="option">original</samp></dt>
  32406. <dd><p>Set the original center factor to keep in front center channel output.
  32407. Allowed range is from 0 to 1. Default value is 1.
  32408. </p>
  32409. </dd>
  32410. <dt><samp class="option">enhance</samp></dt>
  32411. <dd><p>Set the dialogue enhance factor to put in front center channel output.
  32412. Allowed range is from 0 to 3. Default value is 1.
  32413. </p>
  32414. </dd>
  32415. <dt><samp class="option">voice</samp></dt>
  32416. <dd><p>Set the voice detection factor.
  32417. Allowed range is from 2 to 32. Default value is 2.
  32418. </p></dd>
  32419. </dl>
  32420. <ul class="mini-toc">
  32421. <li><a href="#Commands-36" accesskey="1">Commands</a></li>
  32422. </ul>
  32423. <div class="subsection-level-extent" id="Commands-36">
  32424. <h4 class="subsection"><span>36.83.1 Commands<a class="copiable-link" href="#Commands-36"> &para;</a></span></h4>
  32425. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32426. </p>
  32427. </div>
  32428. </div>
  32429. <div class="section-level-extent" id="drmeter">
  32430. <h3 class="section"><span>36.84 drmeter<a class="copiable-link" href="#drmeter"> &para;</a></span></h3>
  32431. <p>Measure audio dynamic range.
  32432. </p>
  32433. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  32434. is found in transition material. And anything less that 8 have very poor dynamics
  32435. and is very compressed.
  32436. </p>
  32437. <p>The filter accepts the following options:
  32438. </p>
  32439. <dl class="table">
  32440. <dt><samp class="option">length</samp></dt>
  32441. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  32442. Default is 3 seconds.
  32443. </p></dd>
  32444. </dl>
  32445. </div>
  32446. <div class="section-level-extent" id="dynaudnorm">
  32447. <h3 class="section"><span>36.85 dynaudnorm<a class="copiable-link" href="#dynaudnorm"> &para;</a></span></h3>
  32448. <p>Dynamic Audio Normalizer.
  32449. </p>
  32450. <p>This filter applies a certain amount of gain to the input audio in order
  32451. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  32452. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  32453. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  32454. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  32455. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  32456. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  32457. sections, in the sense that the volume of each section is brought to the
  32458. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  32459. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  32460. of the dynamic range *within* each section of the audio file.
  32461. </p>
  32462. <dl class="table">
  32463. <dt><samp class="option">framelen, f</samp></dt>
  32464. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  32465. Default is 500 milliseconds.
  32466. The Dynamic Audio Normalizer processes the input audio in small chunks,
  32467. referred to as frames. This is required, because a peak magnitude has no
  32468. meaning for just a single sample value. Instead, we need to determine the
  32469. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  32470. normalizer would simply use the peak magnitude of the complete file, the
  32471. Dynamic Audio Normalizer determines the peak magnitude individually for each
  32472. frame. The length of a frame is specified in milliseconds. By default, the
  32473. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  32474. been found to give good results with most files.
  32475. Note that the exact frame length, in number of samples, will be determined
  32476. automatically, based on the sampling rate of the individual input audio file.
  32477. </p>
  32478. </dd>
  32479. <dt><samp class="option">gausssize, g</samp></dt>
  32480. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  32481. number. Default is 31.
  32482. Probably the most important parameter of the Dynamic Audio Normalizer is the
  32483. <code class="code">window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  32484. is specified in frames, centered around the current frame. For the sake of
  32485. simplicity, this must be an odd number. Consequently, the default value of 31
  32486. takes into account the current frame, as well as the 15 preceding frames and
  32487. the 15 subsequent frames. Using a larger window results in a stronger
  32488. smoothing effect and thus in less gain variation, i.e. slower gain
  32489. adaptation. Conversely, using a smaller window results in a weaker smoothing
  32490. effect and thus in more gain variation, i.e. faster gain adaptation.
  32491. In other words, the more you increase this value, the more the Dynamic Audio
  32492. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  32493. contrary, the more you decrease this value, the more the Dynamic Audio
  32494. Normalizer will behave like a dynamic range compressor.
  32495. </p>
  32496. </dd>
  32497. <dt><samp class="option">peak, p</samp></dt>
  32498. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  32499. level for the normalized audio input. This filter will try to approach the
  32500. target peak magnitude as closely as possible, but at the same time it also
  32501. makes sure that the normalized signal will never exceed the peak magnitude.
  32502. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  32503. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  32504. It is not recommended to go above this value.
  32505. </p>
  32506. </dd>
  32507. <dt><samp class="option">maxgain, m</samp></dt>
  32508. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  32509. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  32510. factor for each input frame, i.e. the maximum gain factor that does not
  32511. result in clipping or distortion. The maximum gain factor is determined by
  32512. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  32513. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  32514. (global) maximum gain factor. This is done in order to avoid excessive gain
  32515. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  32516. factor is 10.0, For most inputs the default value should be sufficient and
  32517. it usually is not recommended to increase this value. Though, for input
  32518. with an extremely low overall volume level, it may be necessary to allow even
  32519. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  32520. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  32521. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  32522. gain factors will smoothly approach the threshold value, but never exceed that
  32523. value.
  32524. </p>
  32525. </dd>
  32526. <dt><samp class="option">targetrms, r</samp></dt>
  32527. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  32528. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  32529. This means that the maximum local gain factor for each frame is defined
  32530. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  32531. be amplified as much as possible without exceeding the maximum signal
  32532. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  32533. Normalizer can also take into account the frame&rsquo;s root mean square,
  32534. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  32535. determine the power of a time-varying signal. It is therefore considered
  32536. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  32537. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  32538. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  32539. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  32540. factor is defined as the factor that would result in exactly that RMS value.
  32541. Note, however, that the maximum local gain factor is still restricted by the
  32542. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  32543. </p>
  32544. </dd>
  32545. <dt><samp class="option">coupling, n</samp></dt>
  32546. <dd><p>Enable channels coupling. By default is enabled.
  32547. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  32548. amount. This means the same gain factor will be applied to all channels, i.e.
  32549. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  32550. However, in some recordings, it may happen that the volume of the different
  32551. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  32552. In this case, this option can be used to disable the channel coupling. This way,
  32553. the gain factor will be determined independently for each channel, depending
  32554. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  32555. harmonizing the volume of the different channels.
  32556. </p>
  32557. </dd>
  32558. <dt><samp class="option">correctdc, c</samp></dt>
  32559. <dd><p>Enable DC bias correction. By default is disabled.
  32560. An audio signal (in the time domain) is a sequence of sample values.
  32561. In the Dynamic Audio Normalizer these sample values are represented in the
  32562. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  32563. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  32564. That means if we calculate the mean value of all samples in a file, or in a
  32565. single frame, then the result should be 0.0 or at least very close to that
  32566. value. If, however, there is a significant deviation of the mean value from
  32567. 0.0, in either positive or negative direction, this is referred to as a
  32568. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  32569. Audio Normalizer provides optional DC bias correction.
  32570. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  32571. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  32572. that value from all of the frame&rsquo;s sample values which ensures those samples
  32573. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  32574. boundaries, the DC correction offset values will be interpolated smoothly
  32575. between neighbouring frames.
  32576. </p>
  32577. </dd>
  32578. <dt><samp class="option">altboundary, b</samp></dt>
  32579. <dd><p>Enable alternative boundary mode. By default is disabled.
  32580. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  32581. around each frame. This includes the preceding frames as well as the
  32582. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  32583. beginning and at the very end of the audio file, not all neighbouring
  32584. frames are available. In particular, for the first few frames in the audio
  32585. file, the preceding frames are not known. And, similarly, for the last few
  32586. frames in the audio file, the subsequent frames are not known. Thus, the
  32587. question arises which gain factors should be assumed for the missing frames
  32588. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  32589. to deal with this situation. The default boundary mode assumes a gain factor
  32590. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  32591. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  32592. </p>
  32593. </dd>
  32594. <dt><samp class="option">compress, s</samp></dt>
  32595. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  32596. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  32597. compression. This means that signal peaks will not be pruned and thus the
  32598. full dynamic range will be retained within each local neighbourhood. However,
  32599. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  32600. normalization algorithm with a more &quot;traditional&quot; compression.
  32601. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  32602. (thresholding) function. If (and only if) the compression feature is enabled,
  32603. all input frames will be processed by a soft knee thresholding function prior
  32604. to the actual normalization process. Put simply, the thresholding function is
  32605. going to prune all samples whose magnitude exceeds a certain threshold value.
  32606. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  32607. value. Instead, the threshold value will be adjusted for each individual
  32608. frame.
  32609. In general, smaller parameters result in stronger compression, and vice versa.
  32610. Values below 3.0 are not recommended, because audible distortion may appear.
  32611. </p>
  32612. </dd>
  32613. <dt><samp class="option">threshold, t</samp></dt>
  32614. <dd><p>Set the target threshold value. This specifies the lowest permissible
  32615. magnitude level for the audio input which will be normalized.
  32616. If input frame volume is above this value frame will be normalized.
  32617. Otherwise frame may not be normalized at all. The default value is set
  32618. to 0, which means all input frames will be normalized.
  32619. This option is mostly useful if digital noise is not wanted to be amplified.
  32620. </p>
  32621. </dd>
  32622. <dt><samp class="option">channels, h</samp></dt>
  32623. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  32624. </p>
  32625. </dd>
  32626. <dt><samp class="option">overlap, o</samp></dt>
  32627. <dd><p>Specify overlap for frames. If set to 0 (default) no frame overlapping is done.
  32628. Using &gt;0 and &lt;1 values will make less conservative gain adjustments, like
  32629. when framelen option is set to smaller value, if framelen option value is
  32630. compensated for non-zero overlap then gain adjustments will be smoother across time
  32631. compared to zero overlap case.
  32632. </p>
  32633. </dd>
  32634. <dt><samp class="option">curve, v</samp></dt>
  32635. <dd><p>Specify the peak mapping curve expression which is going to be used when calculating
  32636. gain applied to frames. The max output frame gain will still be limited by other
  32637. options mentioned previously for this filter.
  32638. </p>
  32639. <p>The expression can contain the following constants:
  32640. </p>
  32641. <dl class="table">
  32642. <dt><samp class="option">ch</samp></dt>
  32643. <dd><p>current channel number
  32644. </p>
  32645. </dd>
  32646. <dt><samp class="option">sn</samp></dt>
  32647. <dd><p>current sample number
  32648. </p>
  32649. </dd>
  32650. <dt><samp class="option">nb_channels</samp></dt>
  32651. <dd><p>number of channels
  32652. </p>
  32653. </dd>
  32654. <dt><samp class="option">t</samp></dt>
  32655. <dd><p>timestamp expressed in seconds
  32656. </p>
  32657. </dd>
  32658. <dt><samp class="option">sr</samp></dt>
  32659. <dd><p>sample rate
  32660. </p>
  32661. </dd>
  32662. <dt><samp class="option">p</samp></dt>
  32663. <dd><p>current frame peak value
  32664. </p></dd>
  32665. </dl>
  32666. </dd>
  32667. </dl>
  32668. <ul class="mini-toc">
  32669. <li><a href="#Commands-37" accesskey="1">Commands</a></li>
  32670. </ul>
  32671. <div class="subsection-level-extent" id="Commands-37">
  32672. <h4 class="subsection"><span>36.85.1 Commands<a class="copiable-link" href="#Commands-37"> &para;</a></span></h4>
  32673. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32674. </p>
  32675. </div>
  32676. </div>
  32677. <div class="section-level-extent" id="earwax">
  32678. <h3 class="section"><span>36.86 earwax<a class="copiable-link" href="#earwax"> &para;</a></span></h3>
  32679. <p>Make audio easier to listen to on headphones.
  32680. </p>
  32681. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  32682. so that when listened to on headphones the stereo image is moved from
  32683. inside your head (standard for headphones) to outside and in front of
  32684. the listener (standard for speakers).
  32685. </p>
  32686. <p>Ported from SoX.
  32687. </p>
  32688. </div>
  32689. <div class="section-level-extent" id="equalizer">
  32690. <h3 class="section"><span>36.87 equalizer<a class="copiable-link" href="#equalizer"> &para;</a></span></h3>
  32691. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  32692. filter, the signal-level at and around a selected frequency can
  32693. be increased or decreased, whilst (unlike bandpass and bandreject
  32694. filters) that at all other frequencies is unchanged.
  32695. </p>
  32696. <p>In order to produce complex equalisation curves, this filter can
  32697. be given several times, each with a different central frequency.
  32698. </p>
  32699. <p>The filter accepts the following options:
  32700. </p>
  32701. <dl class="table">
  32702. <dt><samp class="option">frequency, f</samp></dt>
  32703. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  32704. </p>
  32705. </dd>
  32706. <dt><samp class="option">width_type, t</samp></dt>
  32707. <dd><p>Set method to specify band-width of filter.
  32708. </p><dl class="table">
  32709. <dt><samp class="option">h</samp></dt>
  32710. <dd><p>Hz
  32711. </p></dd>
  32712. <dt><samp class="option">q</samp></dt>
  32713. <dd><p>Q-Factor
  32714. </p></dd>
  32715. <dt><samp class="option">o</samp></dt>
  32716. <dd><p>octave
  32717. </p></dd>
  32718. <dt><samp class="option">s</samp></dt>
  32719. <dd><p>slope
  32720. </p></dd>
  32721. <dt><samp class="option">k</samp></dt>
  32722. <dd><p>kHz
  32723. </p></dd>
  32724. </dl>
  32725. </dd>
  32726. <dt><samp class="option">width, w</samp></dt>
  32727. <dd><p>Specify the band-width of a filter in width_type units.
  32728. </p>
  32729. </dd>
  32730. <dt><samp class="option">gain, g</samp></dt>
  32731. <dd><p>Set the required gain or attenuation in dB.
  32732. Beware of clipping when using a positive gain.
  32733. </p>
  32734. </dd>
  32735. <dt><samp class="option">mix, m</samp></dt>
  32736. <dd><p>How much to use filtered signal in output. Default is 1.
  32737. Range is between 0 and 1.
  32738. </p>
  32739. </dd>
  32740. <dt><samp class="option">channels, c</samp></dt>
  32741. <dd><p>Specify which channels to filter, by default all available are filtered.
  32742. </p>
  32743. </dd>
  32744. <dt><samp class="option">normalize, n</samp></dt>
  32745. <dd><p>Normalize biquad coefficients, by default is disabled.
  32746. Enabling it will normalize magnitude response at DC to 0dB.
  32747. </p>
  32748. </dd>
  32749. <dt><samp class="option">transform, a</samp></dt>
  32750. <dd><p>Set transform type of IIR filter.
  32751. </p><dl class="table">
  32752. <dt><samp class="option">di</samp></dt>
  32753. <dt><samp class="option">dii</samp></dt>
  32754. <dt><samp class="option">tdi</samp></dt>
  32755. <dt><samp class="option">tdii</samp></dt>
  32756. <dt><samp class="option">latt</samp></dt>
  32757. <dt><samp class="option">svf</samp></dt>
  32758. <dt><samp class="option">zdf</samp></dt>
  32759. </dl>
  32760. </dd>
  32761. <dt><samp class="option">precision, r</samp></dt>
  32762. <dd><p>Set precision of filtering.
  32763. </p><dl class="table">
  32764. <dt><samp class="option">auto</samp></dt>
  32765. <dd><p>Pick automatic sample format depending on surround filters.
  32766. </p></dd>
  32767. <dt><samp class="option">s16</samp></dt>
  32768. <dd><p>Always use signed 16-bit.
  32769. </p></dd>
  32770. <dt><samp class="option">s32</samp></dt>
  32771. <dd><p>Always use signed 32-bit.
  32772. </p></dd>
  32773. <dt><samp class="option">f32</samp></dt>
  32774. <dd><p>Always use float 32-bit.
  32775. </p></dd>
  32776. <dt><samp class="option">f64</samp></dt>
  32777. <dd><p>Always use float 64-bit.
  32778. </p></dd>
  32779. </dl>
  32780. </dd>
  32781. <dt><samp class="option">block_size, b</samp></dt>
  32782. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  32783. value (higher than impulse response length truncated when reaches near zero values) filtering
  32784. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  32785. </p>
  32786. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  32787. </p></dd>
  32788. </dl>
  32789. <ul class="mini-toc">
  32790. <li><a href="#Examples-66" accesskey="1">Examples</a></li>
  32791. <li><a href="#Commands-38" accesskey="2">Commands</a></li>
  32792. </ul>
  32793. <div class="subsection-level-extent" id="Examples-66">
  32794. <h4 class="subsection"><span>36.87.1 Examples<a class="copiable-link" href="#Examples-66"> &para;</a></span></h4>
  32795. <ul class="itemize mark-bullet">
  32796. <li>Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  32797. <div class="example">
  32798. <pre class="example-preformatted">equalizer=f=1000:t=h:width=200:g=-10
  32799. </pre></div>
  32800. </li><li>Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  32801. <div class="example">
  32802. <pre class="example-preformatted">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  32803. </pre></div>
  32804. </li></ul>
  32805. </div>
  32806. <div class="subsection-level-extent" id="Commands-38">
  32807. <h4 class="subsection"><span>36.87.2 Commands<a class="copiable-link" href="#Commands-38"> &para;</a></span></h4>
  32808. <p>This filter supports the following commands:
  32809. </p><dl class="table">
  32810. <dt><samp class="option">frequency, f</samp></dt>
  32811. <dd><p>Change equalizer frequency.
  32812. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  32813. </p>
  32814. </dd>
  32815. <dt><samp class="option">width_type, t</samp></dt>
  32816. <dd><p>Change equalizer width_type.
  32817. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  32818. </p>
  32819. </dd>
  32820. <dt><samp class="option">width, w</samp></dt>
  32821. <dd><p>Change equalizer width.
  32822. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  32823. </p>
  32824. </dd>
  32825. <dt><samp class="option">gain, g</samp></dt>
  32826. <dd><p>Change equalizer gain.
  32827. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  32828. </p>
  32829. </dd>
  32830. <dt><samp class="option">mix, m</samp></dt>
  32831. <dd><p>Change equalizer mix.
  32832. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  32833. </p></dd>
  32834. </dl>
  32835. </div>
  32836. </div>
  32837. <div class="section-level-extent" id="extrastereo">
  32838. <h3 class="section"><span>36.88 extrastereo<a class="copiable-link" href="#extrastereo"> &para;</a></span></h3>
  32839. <p>Linearly increases the difference between left and right channels which
  32840. adds some sort of &quot;live&quot; effect to playback.
  32841. </p>
  32842. <p>The filter accepts the following options:
  32843. </p>
  32844. <dl class="table">
  32845. <dt><samp class="option">m</samp></dt>
  32846. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  32847. (average of both channels), with 1.0 sound will be unchanged, with
  32848. -1.0 left and right channels will be swapped.
  32849. </p>
  32850. </dd>
  32851. <dt><samp class="option">c</samp></dt>
  32852. <dd><p>Enable clipping. By default is enabled.
  32853. </p></dd>
  32854. </dl>
  32855. <ul class="mini-toc">
  32856. <li><a href="#Commands-39" accesskey="1">Commands</a></li>
  32857. </ul>
  32858. <div class="subsection-level-extent" id="Commands-39">
  32859. <h4 class="subsection"><span>36.88.1 Commands<a class="copiable-link" href="#Commands-39"> &para;</a></span></h4>
  32860. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  32861. </p>
  32862. </div>
  32863. </div>
  32864. <div class="section-level-extent" id="firequalizer">
  32865. <h3 class="section"><span>36.89 firequalizer<a class="copiable-link" href="#firequalizer"> &para;</a></span></h3>
  32866. <p>Apply FIR Equalization using arbitrary frequency response.
  32867. </p>
  32868. <p>The filter accepts the following option:
  32869. </p>
  32870. <dl class="table">
  32871. <dt><samp class="option">gain</samp></dt>
  32872. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  32873. </p><dl class="table">
  32874. <dt><samp class="option">f</samp></dt>
  32875. <dd><p>the evaluated frequency
  32876. </p></dd>
  32877. <dt><samp class="option">sr</samp></dt>
  32878. <dd><p>sample rate
  32879. </p></dd>
  32880. <dt><samp class="option">ch</samp></dt>
  32881. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  32882. </p></dd>
  32883. <dt><samp class="option">chid</samp></dt>
  32884. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  32885. multichannels evaluation is disabled
  32886. </p></dd>
  32887. <dt><samp class="option">chs</samp></dt>
  32888. <dd><p>number of channels
  32889. </p></dd>
  32890. <dt><samp class="option">chlayout</samp></dt>
  32891. <dd><p>channel_layout, see libavutil/channel_layout.h
  32892. </p>
  32893. </dd>
  32894. </dl>
  32895. <p>and functions:
  32896. </p><dl class="table">
  32897. <dt><samp class="option">gain_interpolate(f)</samp></dt>
  32898. <dd><p>interpolate gain on frequency f based on gain_entry
  32899. </p></dd>
  32900. <dt><samp class="option">cubic_interpolate(f)</samp></dt>
  32901. <dd><p>same as gain_interpolate, but smoother
  32902. </p></dd>
  32903. </dl>
  32904. <p>This option is also available as command. Default is <code class="code">gain_interpolate(f)</code>.
  32905. </p>
  32906. </dd>
  32907. <dt><samp class="option">gain_entry</samp></dt>
  32908. <dd><p>Set gain entry for gain_interpolate function. The expression can
  32909. contain functions:
  32910. </p><dl class="table">
  32911. <dt><samp class="option">entry(f, g)</samp></dt>
  32912. <dd><p>store gain entry at frequency f with value g
  32913. </p></dd>
  32914. </dl>
  32915. <p>This option is also available as command.
  32916. </p>
  32917. </dd>
  32918. <dt><samp class="option">delay</samp></dt>
  32919. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  32920. Default is <code class="code">0.01</code>.
  32921. </p>
  32922. </dd>
  32923. <dt><samp class="option">accuracy</samp></dt>
  32924. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  32925. Default is <code class="code">5</code>.
  32926. </p>
  32927. </dd>
  32928. <dt><samp class="option">wfunc</samp></dt>
  32929. <dd><p>Set window function. Acceptable values are:
  32930. </p><dl class="table">
  32931. <dt><samp class="option">rectangular</samp></dt>
  32932. <dd><p>rectangular window, useful when gain curve is already smooth
  32933. </p></dd>
  32934. <dt><samp class="option">hann</samp></dt>
  32935. <dd><p>hann window (default)
  32936. </p></dd>
  32937. <dt><samp class="option">hamming</samp></dt>
  32938. <dd><p>hamming window
  32939. </p></dd>
  32940. <dt><samp class="option">blackman</samp></dt>
  32941. <dd><p>blackman window
  32942. </p></dd>
  32943. <dt><samp class="option">nuttall3</samp></dt>
  32944. <dd><p>3-terms continuous 1st derivative nuttall window
  32945. </p></dd>
  32946. <dt><samp class="option">mnuttall3</samp></dt>
  32947. <dd><p>minimum 3-terms discontinuous nuttall window
  32948. </p></dd>
  32949. <dt><samp class="option">nuttall</samp></dt>
  32950. <dd><p>4-terms continuous 1st derivative nuttall window
  32951. </p></dd>
  32952. <dt><samp class="option">bnuttall</samp></dt>
  32953. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  32954. </p></dd>
  32955. <dt><samp class="option">bharris</samp></dt>
  32956. <dd><p>blackman-harris window
  32957. </p></dd>
  32958. <dt><samp class="option">tukey</samp></dt>
  32959. <dd><p>tukey window
  32960. </p></dd>
  32961. </dl>
  32962. </dd>
  32963. <dt><samp class="option">fixed</samp></dt>
  32964. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  32965. filtering with large delay. Default is disabled.
  32966. </p>
  32967. </dd>
  32968. <dt><samp class="option">multi</samp></dt>
  32969. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  32970. </p>
  32971. </dd>
  32972. <dt><samp class="option">zero_phase</samp></dt>
  32973. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  32974. Default is disabled.
  32975. </p>
  32976. </dd>
  32977. <dt><samp class="option">scale</samp></dt>
  32978. <dd><p>Set scale used by gain. Acceptable values are:
  32979. </p><dl class="table">
  32980. <dt><samp class="option">linlin</samp></dt>
  32981. <dd><p>linear frequency, linear gain
  32982. </p></dd>
  32983. <dt><samp class="option">linlog</samp></dt>
  32984. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  32985. </p></dd>
  32986. <dt><samp class="option">loglin</samp></dt>
  32987. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  32988. </p></dd>
  32989. <dt><samp class="option">loglog</samp></dt>
  32990. <dd><p>logarithmic frequency, logarithmic gain
  32991. </p></dd>
  32992. </dl>
  32993. </dd>
  32994. <dt><samp class="option">dumpfile</samp></dt>
  32995. <dd><p>Set file for dumping, suitable for gnuplot.
  32996. </p>
  32997. </dd>
  32998. <dt><samp class="option">dumpscale</samp></dt>
  32999. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  33000. Default is linlog.
  33001. </p>
  33002. </dd>
  33003. <dt><samp class="option">fft2</samp></dt>
  33004. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  33005. Default is disabled.
  33006. </p>
  33007. </dd>
  33008. <dt><samp class="option">min_phase</samp></dt>
  33009. <dd><p>Enable minimum phase impulse response. Default is disabled.
  33010. </p></dd>
  33011. </dl>
  33012. <ul class="mini-toc">
  33013. <li><a href="#Examples-67" accesskey="1">Examples</a></li>
  33014. </ul>
  33015. <div class="subsection-level-extent" id="Examples-67">
  33016. <h4 class="subsection"><span>36.89.1 Examples<a class="copiable-link" href="#Examples-67"> &para;</a></span></h4>
  33017. <ul class="itemize mark-bullet">
  33018. <li>lowpass at 1000 Hz:
  33019. <div class="example">
  33020. <pre class="example-preformatted">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  33021. </pre></div>
  33022. </li><li>lowpass at 1000 Hz with gain_entry:
  33023. <div class="example">
  33024. <pre class="example-preformatted">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  33025. </pre></div>
  33026. </li><li>custom equalization:
  33027. <div class="example">
  33028. <pre class="example-preformatted">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  33029. </pre></div>
  33030. </li><li>higher delay with zero phase to compensate delay:
  33031. <div class="example">
  33032. <pre class="example-preformatted">firequalizer=delay=0.1:fixed=on:zero_phase=on
  33033. </pre></div>
  33034. </li><li>lowpass on left channel, highpass on right channel:
  33035. <div class="example">
  33036. <pre class="example-preformatted">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  33037. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  33038. </pre></div>
  33039. </li></ul>
  33040. </div>
  33041. </div>
  33042. <div class="section-level-extent" id="flanger">
  33043. <h3 class="section"><span>36.90 flanger<a class="copiable-link" href="#flanger"> &para;</a></span></h3>
  33044. <p>Apply a flanging effect to the audio.
  33045. </p>
  33046. <p>The filter accepts the following options:
  33047. </p>
  33048. <dl class="table">
  33049. <dt><samp class="option">delay</samp></dt>
  33050. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  33051. </p>
  33052. </dd>
  33053. <dt><samp class="option">depth</samp></dt>
  33054. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  33055. </p>
  33056. </dd>
  33057. <dt><samp class="option">regen</samp></dt>
  33058. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  33059. Default value is 0.
  33060. </p>
  33061. </dd>
  33062. <dt><samp class="option">width</samp></dt>
  33063. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  33064. Default value is 71.
  33065. </p>
  33066. </dd>
  33067. <dt><samp class="option">speed</samp></dt>
  33068. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  33069. </p>
  33070. </dd>
  33071. <dt><samp class="option">shape</samp></dt>
  33072. <dd><p>Set swept wave shape, can be <var class="var">triangular</var> or <var class="var">sinusoidal</var>.
  33073. Default value is <var class="var">sinusoidal</var>.
  33074. </p>
  33075. </dd>
  33076. <dt><samp class="option">phase</samp></dt>
  33077. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  33078. Default value is 25.
  33079. </p>
  33080. </dd>
  33081. <dt><samp class="option">interp</samp></dt>
  33082. <dd><p>Set delay-line interpolation, <var class="var">linear</var> or <var class="var">quadratic</var>.
  33083. Default is <var class="var">linear</var>.
  33084. </p></dd>
  33085. </dl>
  33086. </div>
  33087. <div class="section-level-extent" id="haas">
  33088. <h3 class="section"><span>36.91 haas<a class="copiable-link" href="#haas"> &para;</a></span></h3>
  33089. <p>Apply Haas effect to audio.
  33090. </p>
  33091. <p>Note that this makes most sense to apply on mono signals.
  33092. With this filter applied to mono signals it give some directionality and
  33093. stretches its stereo image.
  33094. </p>
  33095. <p>The filter accepts the following options:
  33096. </p>
  33097. <dl class="table">
  33098. <dt><samp class="option">level_in</samp></dt>
  33099. <dd><p>Set input level. By default is <var class="var">1</var>, or 0dB
  33100. </p>
  33101. </dd>
  33102. <dt><samp class="option">level_out</samp></dt>
  33103. <dd><p>Set output level. By default is <var class="var">1</var>, or 0dB.
  33104. </p>
  33105. </dd>
  33106. <dt><samp class="option">side_gain</samp></dt>
  33107. <dd><p>Set gain applied to side part of signal. By default is <var class="var">1</var>.
  33108. </p>
  33109. </dd>
  33110. <dt><samp class="option">middle_source</samp></dt>
  33111. <dd><p>Set kind of middle source. Can be one of the following:
  33112. </p>
  33113. <dl class="table">
  33114. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  33115. <dd><p>Pick left channel.
  33116. </p>
  33117. </dd>
  33118. <dt>&lsquo;<samp class="samp">right</samp>&rsquo;</dt>
  33119. <dd><p>Pick right channel.
  33120. </p>
  33121. </dd>
  33122. <dt>&lsquo;<samp class="samp">mid</samp>&rsquo;</dt>
  33123. <dd><p>Pick middle part signal of stereo image.
  33124. </p>
  33125. </dd>
  33126. <dt>&lsquo;<samp class="samp">side</samp>&rsquo;</dt>
  33127. <dd><p>Pick side part signal of stereo image.
  33128. </p></dd>
  33129. </dl>
  33130. </dd>
  33131. <dt><samp class="option">middle_phase</samp></dt>
  33132. <dd><p>Change middle phase. By default is disabled.
  33133. </p>
  33134. </dd>
  33135. <dt><samp class="option">left_delay</samp></dt>
  33136. <dd><p>Set left channel delay. By default is <var class="var">2.05</var> milliseconds.
  33137. </p>
  33138. </dd>
  33139. <dt><samp class="option">left_balance</samp></dt>
  33140. <dd><p>Set left channel balance. By default is <var class="var">-1</var>.
  33141. </p>
  33142. </dd>
  33143. <dt><samp class="option">left_gain</samp></dt>
  33144. <dd><p>Set left channel gain. By default is <var class="var">1</var>.
  33145. </p>
  33146. </dd>
  33147. <dt><samp class="option">left_phase</samp></dt>
  33148. <dd><p>Change left phase. By default is disabled.
  33149. </p>
  33150. </dd>
  33151. <dt><samp class="option">right_delay</samp></dt>
  33152. <dd><p>Set right channel delay. By defaults is <var class="var">2.12</var> milliseconds.
  33153. </p>
  33154. </dd>
  33155. <dt><samp class="option">right_balance</samp></dt>
  33156. <dd><p>Set right channel balance. By default is <var class="var">1</var>.
  33157. </p>
  33158. </dd>
  33159. <dt><samp class="option">right_gain</samp></dt>
  33160. <dd><p>Set right channel gain. By default is <var class="var">1</var>.
  33161. </p>
  33162. </dd>
  33163. <dt><samp class="option">right_phase</samp></dt>
  33164. <dd><p>Change right phase. By default is enabled.
  33165. </p></dd>
  33166. </dl>
  33167. </div>
  33168. <div class="section-level-extent" id="hdcd">
  33169. <h3 class="section"><span>36.92 hdcd<a class="copiable-link" href="#hdcd"> &para;</a></span></h3>
  33170. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  33171. embedded HDCD codes is expanded into a 20-bit PCM stream.
  33172. </p>
  33173. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  33174. of HDCD, and detects the Transient Filter flag.
  33175. </p>
  33176. <div class="example">
  33177. <pre class="example-preformatted">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  33178. </pre></div>
  33179. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  33180. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  33181. like <code class="command">-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  33182. </p><div class="example">
  33183. <pre class="example-preformatted">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  33184. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  33185. </pre></div>
  33186. <p>The filter accepts the following options:
  33187. </p>
  33188. <dl class="table">
  33189. <dt><samp class="option">disable_autoconvert</samp></dt>
  33190. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  33191. </p>
  33192. </dd>
  33193. <dt><samp class="option">process_stereo</samp></dt>
  33194. <dd><p>Process the stereo channels together. If target_gain does not match between
  33195. channels, consider it invalid and use the last valid target_gain.
  33196. </p>
  33197. </dd>
  33198. <dt><samp class="option">cdt_ms</samp></dt>
  33199. <dd><p>Set the code detect timer period in ms.
  33200. </p>
  33201. </dd>
  33202. <dt><samp class="option">force_pe</samp></dt>
  33203. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  33204. </p>
  33205. </dd>
  33206. <dt><samp class="option">analyze_mode</samp></dt>
  33207. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  33208. specific aspect of the decoding process. The output file can be loaded in
  33209. an audio editor alongside the original to aid analysis.
  33210. </p>
  33211. <p><code class="code">analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  33212. </p>
  33213. <p>Modes are:
  33214. </p><dl class="table">
  33215. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  33216. <dd><p>Disabled
  33217. </p></dd>
  33218. <dt>&lsquo;<samp class="samp">1, lle</samp>&rsquo;</dt>
  33219. <dd><p>Gain adjustment level at each sample
  33220. </p></dd>
  33221. <dt>&lsquo;<samp class="samp">2, pe</samp>&rsquo;</dt>
  33222. <dd><p>Samples where peak extend occurs
  33223. </p></dd>
  33224. <dt>&lsquo;<samp class="samp">3, cdt</samp>&rsquo;</dt>
  33225. <dd><p>Samples where the code detect timer is active
  33226. </p></dd>
  33227. <dt>&lsquo;<samp class="samp">4, tgm</samp>&rsquo;</dt>
  33228. <dd><p>Samples where the target gain does not match between channels
  33229. </p></dd>
  33230. </dl>
  33231. </dd>
  33232. </dl>
  33233. </div>
  33234. <div class="section-level-extent" id="headphone">
  33235. <h3 class="section"><span>36.93 headphone<a class="copiable-link" href="#headphone"> &para;</a></span></h3>
  33236. <p>Apply head-related transfer functions (HRTFs) to create virtual
  33237. loudspeakers around the user for binaural listening via headphones.
  33238. The HRIRs are provided via additional streams, for each channel
  33239. one stereo input stream is needed.
  33240. </p>
  33241. <p>The filter accepts the following options:
  33242. </p>
  33243. <dl class="table">
  33244. <dt><samp class="option">map</samp></dt>
  33245. <dd><p>Set mapping of input streams for convolution.
  33246. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  33247. are given as additional stream inputs for filter.
  33248. This also specify number of input streams. Number of input streams
  33249. must be not less than number of channels in first stream plus one.
  33250. </p>
  33251. </dd>
  33252. <dt><samp class="option">gain</samp></dt>
  33253. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  33254. </p>
  33255. </dd>
  33256. <dt><samp class="option">type</samp></dt>
  33257. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  33258. processing audio in time domain which is slow.
  33259. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  33260. Default is <var class="var">freq</var>.
  33261. </p>
  33262. </dd>
  33263. <dt><samp class="option">lfe</samp></dt>
  33264. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  33265. </p>
  33266. </dd>
  33267. <dt><samp class="option">size</samp></dt>
  33268. <dd><p>Set size of frame in number of samples which will be processed at once.
  33269. Default value is <var class="var">1024</var>. Allowed range is from 1024 to 96000.
  33270. </p>
  33271. </dd>
  33272. <dt><samp class="option">hrir</samp></dt>
  33273. <dd><p>Set format of hrir stream.
  33274. Default value is <var class="var">stereo</var>. Alternative value is <var class="var">multich</var>.
  33275. If value is set to <var class="var">stereo</var>, number of additional streams should
  33276. be greater or equal to number of input channels in first input stream.
  33277. Also each additional stream should have stereo number of channels.
  33278. If value is set to <var class="var">multich</var>, number of additional streams should
  33279. be exactly one. Also number of input channels of additional stream
  33280. should be equal or greater than twice number of channels of first input
  33281. stream.
  33282. </p></dd>
  33283. </dl>
  33284. <ul class="mini-toc">
  33285. <li><a href="#Examples-68" accesskey="1">Examples</a></li>
  33286. </ul>
  33287. <div class="subsection-level-extent" id="Examples-68">
  33288. <h4 class="subsection"><span>36.93.1 Examples<a class="copiable-link" href="#Examples-68"> &para;</a></span></h4>
  33289. <ul class="itemize mark-bullet">
  33290. <li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  33291. each amovie filter use stereo file with IR coefficients as input.
  33292. The files give coefficients for each position of virtual loudspeaker:
  33293. <div class="example">
  33294. <pre class="example-preformatted">ffmpeg -i input.wav
  33295. -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;
  33296. output.wav
  33297. </pre></div>
  33298. </li><li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  33299. but now in <var class="var">multich</var> <var class="var">hrir</var> format.
  33300. <div class="example">
  33301. <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;
  33302. output.wav
  33303. </pre></div>
  33304. </li></ul>
  33305. </div>
  33306. </div>
  33307. <div class="section-level-extent" id="highpass">
  33308. <h3 class="section"><span>36.94 highpass<a class="copiable-link" href="#highpass"> &para;</a></span></h3>
  33309. <p>Apply a high-pass filter with 3dB point frequency.
  33310. The filter can be either single-pole, or double-pole (the default).
  33311. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  33312. </p>
  33313. <p>The filter accepts the following options:
  33314. </p>
  33315. <dl class="table">
  33316. <dt><samp class="option">frequency, f</samp></dt>
  33317. <dd><p>Set frequency in Hz. Default is 3000.
  33318. </p>
  33319. </dd>
  33320. <dt><samp class="option">poles, p</samp></dt>
  33321. <dd><p>Set number of poles. Default is 2.
  33322. </p>
  33323. </dd>
  33324. <dt><samp class="option">width_type, t</samp></dt>
  33325. <dd><p>Set method to specify band-width of filter.
  33326. </p><dl class="table">
  33327. <dt><samp class="option">h</samp></dt>
  33328. <dd><p>Hz
  33329. </p></dd>
  33330. <dt><samp class="option">q</samp></dt>
  33331. <dd><p>Q-Factor
  33332. </p></dd>
  33333. <dt><samp class="option">o</samp></dt>
  33334. <dd><p>octave
  33335. </p></dd>
  33336. <dt><samp class="option">s</samp></dt>
  33337. <dd><p>slope
  33338. </p></dd>
  33339. <dt><samp class="option">k</samp></dt>
  33340. <dd><p>kHz
  33341. </p></dd>
  33342. </dl>
  33343. </dd>
  33344. <dt><samp class="option">width, w</samp></dt>
  33345. <dd><p>Specify the band-width of a filter in width_type units.
  33346. Applies only to double-pole filter.
  33347. The default is 0.707q and gives a Butterworth response.
  33348. </p>
  33349. </dd>
  33350. <dt><samp class="option">mix, m</samp></dt>
  33351. <dd><p>How much to use filtered signal in output. Default is 1.
  33352. Range is between 0 and 1.
  33353. </p>
  33354. </dd>
  33355. <dt><samp class="option">channels, c</samp></dt>
  33356. <dd><p>Specify which channels to filter, by default all available are filtered.
  33357. </p>
  33358. </dd>
  33359. <dt><samp class="option">normalize, n</samp></dt>
  33360. <dd><p>Normalize biquad coefficients, by default is disabled.
  33361. Enabling it will normalize magnitude response at DC to 0dB.
  33362. </p>
  33363. </dd>
  33364. <dt><samp class="option">transform, a</samp></dt>
  33365. <dd><p>Set transform type of IIR filter.
  33366. </p><dl class="table">
  33367. <dt><samp class="option">di</samp></dt>
  33368. <dt><samp class="option">dii</samp></dt>
  33369. <dt><samp class="option">tdi</samp></dt>
  33370. <dt><samp class="option">tdii</samp></dt>
  33371. <dt><samp class="option">latt</samp></dt>
  33372. <dt><samp class="option">svf</samp></dt>
  33373. <dt><samp class="option">zdf</samp></dt>
  33374. </dl>
  33375. </dd>
  33376. <dt><samp class="option">precision, r</samp></dt>
  33377. <dd><p>Set precision of filtering.
  33378. </p><dl class="table">
  33379. <dt><samp class="option">auto</samp></dt>
  33380. <dd><p>Pick automatic sample format depending on surround filters.
  33381. </p></dd>
  33382. <dt><samp class="option">s16</samp></dt>
  33383. <dd><p>Always use signed 16-bit.
  33384. </p></dd>
  33385. <dt><samp class="option">s32</samp></dt>
  33386. <dd><p>Always use signed 32-bit.
  33387. </p></dd>
  33388. <dt><samp class="option">f32</samp></dt>
  33389. <dd><p>Always use float 32-bit.
  33390. </p></dd>
  33391. <dt><samp class="option">f64</samp></dt>
  33392. <dd><p>Always use float 64-bit.
  33393. </p></dd>
  33394. </dl>
  33395. </dd>
  33396. <dt><samp class="option">block_size, b</samp></dt>
  33397. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  33398. value (higher than impulse response length truncated when reaches near zero values) filtering
  33399. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  33400. </p>
  33401. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  33402. </p></dd>
  33403. </dl>
  33404. <ul class="mini-toc">
  33405. <li><a href="#Commands-40" accesskey="1">Commands</a></li>
  33406. </ul>
  33407. <div class="subsection-level-extent" id="Commands-40">
  33408. <h4 class="subsection"><span>36.94.1 Commands<a class="copiable-link" href="#Commands-40"> &para;</a></span></h4>
  33409. <p>This filter supports the following commands:
  33410. </p><dl class="table">
  33411. <dt><samp class="option">frequency, f</samp></dt>
  33412. <dd><p>Change highpass frequency.
  33413. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  33414. </p>
  33415. </dd>
  33416. <dt><samp class="option">width_type, t</samp></dt>
  33417. <dd><p>Change highpass width_type.
  33418. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  33419. </p>
  33420. </dd>
  33421. <dt><samp class="option">width, w</samp></dt>
  33422. <dd><p>Change highpass width.
  33423. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  33424. </p>
  33425. </dd>
  33426. <dt><samp class="option">mix, m</samp></dt>
  33427. <dd><p>Change highpass mix.
  33428. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  33429. </p></dd>
  33430. </dl>
  33431. </div>
  33432. </div>
  33433. <div class="section-level-extent" id="join">
  33434. <h3 class="section"><span>36.95 join<a class="copiable-link" href="#join"> &para;</a></span></h3>
  33435. <p>Join multiple input streams into one multi-channel stream.
  33436. </p>
  33437. <p>It accepts the following parameters:
  33438. </p><dl class="table">
  33439. <dt><samp class="option">inputs</samp></dt>
  33440. <dd><p>The number of input streams. It defaults to 2.
  33441. </p>
  33442. </dd>
  33443. <dt><samp class="option">channel_layout</samp></dt>
  33444. <dd><p>The desired output channel layout. It defaults to stereo.
  33445. </p>
  33446. </dd>
  33447. <dt><samp class="option">map</samp></dt>
  33448. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  33449. 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>
  33450. form. <var class="var">input_idx</var> is the 0-based index of the input stream. <var class="var">in_channel</var>
  33451. can be either the name of the input channel (e.g. FL for front left) or its
  33452. index in the specified input stream. <var class="var">out_channel</var> is the name of the output
  33453. channel.
  33454. </p></dd>
  33455. </dl>
  33456. <p>The filter will attempt to guess the mappings when they are not specified
  33457. explicitly. It does so by first trying to find an unused matching input channel
  33458. and if that fails it picks the first unused input channel.
  33459. </p>
  33460. <p>Join 3 inputs (with properly set channel layouts):
  33461. </p><div class="example">
  33462. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  33463. </pre></div>
  33464. <p>Build a 5.1 output from 6 single-channel streams:
  33465. </p><div class="example">
  33466. <pre class="example-preformatted">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  33467. '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'
  33468. out
  33469. </pre></div>
  33470. </div>
  33471. <div class="section-level-extent" id="ladspa">
  33472. <h3 class="section"><span>36.96 ladspa<a class="copiable-link" href="#ladspa"> &para;</a></span></h3>
  33473. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  33474. </p>
  33475. <p>To enable compilation of this filter you need to configure FFmpeg with
  33476. <code class="code">--enable-ladspa</code>.
  33477. </p>
  33478. <dl class="table">
  33479. <dt><samp class="option">file, f</samp></dt>
  33480. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  33481. variable <code class="env">LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  33482. each one of the directories specified by the colon separated list in
  33483. <code class="env">LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  33484. this order: <samp class="file">HOME/.ladspa/lib/</samp>, <samp class="file">/usr/local/lib/ladspa/</samp>,
  33485. <samp class="file">/usr/lib/ladspa/</samp>.
  33486. </p>
  33487. </dd>
  33488. <dt><samp class="option">plugin, p</samp></dt>
  33489. <dd><p>Specifies the plugin within the library. Some libraries contain only
  33490. one plugin, but others contain many of them. If this is not set filter
  33491. will list all available plugins within the specified library.
  33492. </p>
  33493. </dd>
  33494. <dt><samp class="option">controls, c</samp></dt>
  33495. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  33496. values that determine the behavior of the loaded plugin (for example delay,
  33497. threshold or gain).
  33498. Controls need to be defined using the following syntax:
  33499. c0=<var class="var">value0</var>|c1=<var class="var">value1</var>|c2=<var class="var">value2</var>|..., where
  33500. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  33501. Alternatively they can be also defined using the following syntax:
  33502. <var class="var">value0</var>|<var class="var">value1</var>|<var class="var">value2</var>|..., where
  33503. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  33504. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  33505. their valid ranges are printed.
  33506. </p>
  33507. </dd>
  33508. <dt><samp class="option">sample_rate, s</samp></dt>
  33509. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  33510. zero inputs.
  33511. </p>
  33512. </dd>
  33513. <dt><samp class="option">nb_samples, n</samp></dt>
  33514. <dd><p>Set the number of samples per channel per each output frame, default
  33515. is 1024. Only used if plugin have zero inputs.
  33516. </p>
  33517. </dd>
  33518. <dt><samp class="option">duration, d</samp></dt>
  33519. <dd><p>Set the minimum duration of the sourced audio. See
  33520. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  33521. for the accepted syntax.
  33522. Note that the resulting duration may be greater than the specified duration,
  33523. as the generated audio is always cut at the end of a complete frame.
  33524. If not specified, or the expressed duration is negative, the audio is
  33525. supposed to be generated forever.
  33526. Only used if plugin have zero inputs.
  33527. </p>
  33528. </dd>
  33529. <dt><samp class="option">latency, l</samp></dt>
  33530. <dd><p>Enable latency compensation, by default is disabled.
  33531. Only used if plugin have inputs.
  33532. </p></dd>
  33533. </dl>
  33534. <ul class="mini-toc">
  33535. <li><a href="#Examples-69" accesskey="1">Examples</a></li>
  33536. <li><a href="#Commands-41" accesskey="2">Commands</a></li>
  33537. </ul>
  33538. <div class="subsection-level-extent" id="Examples-69">
  33539. <h4 class="subsection"><span>36.96.1 Examples<a class="copiable-link" href="#Examples-69"> &para;</a></span></h4>
  33540. <ul class="itemize mark-bullet">
  33541. <li>List all available plugins within amp (LADSPA example plugin) library:
  33542. <div class="example">
  33543. <pre class="example-preformatted">ladspa=file=amp
  33544. </pre></div>
  33545. </li><li>List all available controls and their valid ranges for <code class="code">vcf_notch</code>
  33546. plugin from <code class="code">VCF</code> library:
  33547. <div class="example">
  33548. <pre class="example-preformatted">ladspa=f=vcf:p=vcf_notch:c=help
  33549. </pre></div>
  33550. </li><li>Simulate low quality audio equipment using <code class="code">Computer Music Toolkit</code> (CMT)
  33551. plugin library:
  33552. <div class="example">
  33553. <pre class="example-preformatted">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  33554. </pre></div>
  33555. </li><li>Add reverberation to the audio using TAP-plugins
  33556. (Tom&rsquo;s Audio Processing plugins):
  33557. <div class="example">
  33558. <pre class="example-preformatted">ladspa=file=tap_reverb:tap_reverb
  33559. </pre></div>
  33560. </li><li>Generate white noise, with 0.2 amplitude:
  33561. <div class="example">
  33562. <pre class="example-preformatted">ladspa=file=cmt:noise_source_white:c=c0=.2
  33563. </pre></div>
  33564. </li><li>Generate 20 bpm clicks using plugin <code class="code">C* Click - Metronome</code> from the
  33565. <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  33566. <div class="example">
  33567. <pre class="example-preformatted">ladspa=file=caps:Click:c=c1=20'
  33568. </pre></div>
  33569. </li><li>Apply <code class="code">C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  33570. <div class="example">
  33571. <pre class="example-preformatted">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  33572. </pre></div>
  33573. </li><li>Increase volume by 20dB using fast lookahead limiter from Steve Harris
  33574. <code class="code">SWH Plugins</code> collection:
  33575. <div class="example">
  33576. <pre class="example-preformatted">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  33577. </pre></div>
  33578. </li><li>Attenuate low frequencies using Multiband EQ from Steve Harris
  33579. <code class="code">SWH Plugins</code> collection:
  33580. <div class="example">
  33581. <pre class="example-preformatted">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  33582. </pre></div>
  33583. </li><li>Reduce stereo image using <code class="code">Narrower</code> from the <code class="code">C* Audio Plugin Suite</code>
  33584. (CAPS) library:
  33585. <div class="example">
  33586. <pre class="example-preformatted">ladspa=caps:Narrower
  33587. </pre></div>
  33588. </li><li>Another white noise, now using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  33589. <div class="example">
  33590. <pre class="example-preformatted">ladspa=caps:White:.2
  33591. </pre></div>
  33592. </li><li>Some fractal noise, using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  33593. <div class="example">
  33594. <pre class="example-preformatted">ladspa=caps:Fractal:c=c1=1
  33595. </pre></div>
  33596. </li><li>Dynamic volume normalization using <code class="code">VLevel</code> plugin:
  33597. <div class="example">
  33598. <pre class="example-preformatted">ladspa=vlevel-ladspa:vlevel_mono
  33599. </pre></div>
  33600. </li></ul>
  33601. </div>
  33602. <div class="subsection-level-extent" id="Commands-41">
  33603. <h4 class="subsection"><span>36.96.2 Commands<a class="copiable-link" href="#Commands-41"> &para;</a></span></h4>
  33604. <p>This filter supports the following commands:
  33605. </p><dl class="table">
  33606. <dt><samp class="option">cN</samp></dt>
  33607. <dd><p>Modify the <var class="var">N</var>-th control value.
  33608. </p>
  33609. <p>If the specified value is not valid, it is ignored and prior one is kept.
  33610. </p></dd>
  33611. </dl>
  33612. </div>
  33613. </div>
  33614. <div class="section-level-extent" id="loudnorm">
  33615. <h3 class="section"><span>36.97 loudnorm<a class="copiable-link" href="#loudnorm"> &para;</a></span></h3>
  33616. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  33617. Support for both single pass (livestreams, files) and double pass (files) modes.
  33618. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  33619. detect true peaks, the audio stream will be upsampled to 192 kHz.
  33620. Use the <code class="code">-ar</code> option or <code class="code">aresample</code> filter to explicitly set an output sample rate.
  33621. </p>
  33622. <p>The filter accepts the following options:
  33623. </p>
  33624. <dl class="table">
  33625. <dt><samp class="option">I, i</samp></dt>
  33626. <dd><p>Set integrated loudness target.
  33627. Range is -70.0 - -5.0. Default value is -24.0.
  33628. </p>
  33629. </dd>
  33630. <dt><samp class="option">LRA, lra</samp></dt>
  33631. <dd><p>Set loudness range target.
  33632. Range is 1.0 - 50.0. Default value is 7.0.
  33633. </p>
  33634. </dd>
  33635. <dt><samp class="option">TP, tp</samp></dt>
  33636. <dd><p>Set maximum true peak.
  33637. Range is -9.0 - +0.0. Default value is -2.0.
  33638. </p>
  33639. </dd>
  33640. <dt><samp class="option">measured_I, measured_i</samp></dt>
  33641. <dd><p>Measured IL of input file.
  33642. Range is -99.0 - +0.0.
  33643. </p>
  33644. </dd>
  33645. <dt><samp class="option">measured_LRA, measured_lra</samp></dt>
  33646. <dd><p>Measured LRA of input file.
  33647. Range is 0.0 - 99.0.
  33648. </p>
  33649. </dd>
  33650. <dt><samp class="option">measured_TP, measured_tp</samp></dt>
  33651. <dd><p>Measured true peak of input file.
  33652. Range is -99.0 - +99.0.
  33653. </p>
  33654. </dd>
  33655. <dt><samp class="option">measured_thresh</samp></dt>
  33656. <dd><p>Measured threshold of input file.
  33657. Range is -99.0 - +0.0.
  33658. </p>
  33659. </dd>
  33660. <dt><samp class="option">offset</samp></dt>
  33661. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  33662. Range is -99.0 - +99.0. Default is +0.0.
  33663. </p>
  33664. </dd>
  33665. <dt><samp class="option">linear</samp></dt>
  33666. <dd><p>Normalize by linearly scaling the source audio.
  33667. <code class="code">measured_I</code>, <code class="code">measured_LRA</code>, <code class="code">measured_TP</code>,
  33668. and <code class="code">measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  33669. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  33670. result in a true peak which exceeds the target TP. If any of these
  33671. conditions aren&rsquo;t met, normalization mode will revert to <var class="var">dynamic</var>.
  33672. Options are <code class="code">true</code> or <code class="code">false</code>. Default is <code class="code">true</code>.
  33673. </p>
  33674. </dd>
  33675. <dt><samp class="option">dual_mono</samp></dt>
  33676. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  33677. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  33678. If set to <code class="code">true</code>, this option will compensate for this effect.
  33679. Multi-channel input files are not affected by this option.
  33680. Options are true or false. Default is false.
  33681. </p>
  33682. </dd>
  33683. <dt><samp class="option">print_format</samp></dt>
  33684. <dd><p>Set print format for stats. Options are summary, json, or none.
  33685. Default value is none.
  33686. </p></dd>
  33687. </dl>
  33688. </div>
  33689. <div class="section-level-extent" id="lowpass">
  33690. <h3 class="section"><span>36.98 lowpass<a class="copiable-link" href="#lowpass"> &para;</a></span></h3>
  33691. <p>Apply a low-pass filter with 3dB point frequency.
  33692. The filter can be either single-pole or double-pole (the default).
  33693. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  33694. </p>
  33695. <p>The filter accepts the following options:
  33696. </p>
  33697. <dl class="table">
  33698. <dt><samp class="option">frequency, f</samp></dt>
  33699. <dd><p>Set frequency in Hz. Default is 500.
  33700. </p>
  33701. </dd>
  33702. <dt><samp class="option">poles, p</samp></dt>
  33703. <dd><p>Set number of poles. Default is 2.
  33704. </p>
  33705. </dd>
  33706. <dt><samp class="option">width_type, t</samp></dt>
  33707. <dd><p>Set method to specify band-width of filter.
  33708. </p><dl class="table">
  33709. <dt><samp class="option">h</samp></dt>
  33710. <dd><p>Hz
  33711. </p></dd>
  33712. <dt><samp class="option">q</samp></dt>
  33713. <dd><p>Q-Factor
  33714. </p></dd>
  33715. <dt><samp class="option">o</samp></dt>
  33716. <dd><p>octave
  33717. </p></dd>
  33718. <dt><samp class="option">s</samp></dt>
  33719. <dd><p>slope
  33720. </p></dd>
  33721. <dt><samp class="option">k</samp></dt>
  33722. <dd><p>kHz
  33723. </p></dd>
  33724. </dl>
  33725. </dd>
  33726. <dt><samp class="option">width, w</samp></dt>
  33727. <dd><p>Specify the band-width of a filter in width_type units.
  33728. Applies only to double-pole filter.
  33729. The default is 0.707q and gives a Butterworth response.
  33730. </p>
  33731. </dd>
  33732. <dt><samp class="option">mix, m</samp></dt>
  33733. <dd><p>How much to use filtered signal in output. Default is 1.
  33734. Range is between 0 and 1.
  33735. </p>
  33736. </dd>
  33737. <dt><samp class="option">channels, c</samp></dt>
  33738. <dd><p>Specify which channels to filter, by default all available are filtered.
  33739. </p>
  33740. </dd>
  33741. <dt><samp class="option">normalize, n</samp></dt>
  33742. <dd><p>Normalize biquad coefficients, by default is disabled.
  33743. Enabling it will normalize magnitude response at DC to 0dB.
  33744. </p>
  33745. </dd>
  33746. <dt><samp class="option">transform, a</samp></dt>
  33747. <dd><p>Set transform type of IIR filter.
  33748. </p><dl class="table">
  33749. <dt><samp class="option">di</samp></dt>
  33750. <dt><samp class="option">dii</samp></dt>
  33751. <dt><samp class="option">tdi</samp></dt>
  33752. <dt><samp class="option">tdii</samp></dt>
  33753. <dt><samp class="option">latt</samp></dt>
  33754. <dt><samp class="option">svf</samp></dt>
  33755. <dt><samp class="option">zdf</samp></dt>
  33756. </dl>
  33757. </dd>
  33758. <dt><samp class="option">precision, r</samp></dt>
  33759. <dd><p>Set precision of filtering.
  33760. </p><dl class="table">
  33761. <dt><samp class="option">auto</samp></dt>
  33762. <dd><p>Pick automatic sample format depending on surround filters.
  33763. </p></dd>
  33764. <dt><samp class="option">s16</samp></dt>
  33765. <dd><p>Always use signed 16-bit.
  33766. </p></dd>
  33767. <dt><samp class="option">s32</samp></dt>
  33768. <dd><p>Always use signed 32-bit.
  33769. </p></dd>
  33770. <dt><samp class="option">f32</samp></dt>
  33771. <dd><p>Always use float 32-bit.
  33772. </p></dd>
  33773. <dt><samp class="option">f64</samp></dt>
  33774. <dd><p>Always use float 64-bit.
  33775. </p></dd>
  33776. </dl>
  33777. </dd>
  33778. <dt><samp class="option">block_size, b</samp></dt>
  33779. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  33780. value (higher than impulse response length truncated when reaches near zero values) filtering
  33781. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  33782. </p>
  33783. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  33784. </p></dd>
  33785. </dl>
  33786. <ul class="mini-toc">
  33787. <li><a href="#Examples-70" accesskey="1">Examples</a></li>
  33788. <li><a href="#Commands-42" accesskey="2">Commands</a></li>
  33789. </ul>
  33790. <div class="subsection-level-extent" id="Examples-70">
  33791. <h4 class="subsection"><span>36.98.1 Examples<a class="copiable-link" href="#Examples-70"> &para;</a></span></h4>
  33792. <ul class="itemize mark-bullet">
  33793. <li>Lowpass only LFE channel, it LFE is not present it does nothing:
  33794. <div class="example">
  33795. <pre class="example-preformatted">lowpass=c=LFE
  33796. </pre></div>
  33797. </li></ul>
  33798. </div>
  33799. <div class="subsection-level-extent" id="Commands-42">
  33800. <h4 class="subsection"><span>36.98.2 Commands<a class="copiable-link" href="#Commands-42"> &para;</a></span></h4>
  33801. <p>This filter supports the following commands:
  33802. </p><dl class="table">
  33803. <dt><samp class="option">frequency, f</samp></dt>
  33804. <dd><p>Change lowpass frequency.
  33805. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  33806. </p>
  33807. </dd>
  33808. <dt><samp class="option">width_type, t</samp></dt>
  33809. <dd><p>Change lowpass width_type.
  33810. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  33811. </p>
  33812. </dd>
  33813. <dt><samp class="option">width, w</samp></dt>
  33814. <dd><p>Change lowpass width.
  33815. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  33816. </p>
  33817. </dd>
  33818. <dt><samp class="option">mix, m</samp></dt>
  33819. <dd><p>Change lowpass mix.
  33820. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  33821. </p></dd>
  33822. </dl>
  33823. </div>
  33824. </div>
  33825. <div class="section-level-extent" id="lv2">
  33826. <h3 class="section"><span>36.99 lv2<a class="copiable-link" href="#lv2"> &para;</a></span></h3>
  33827. <p>Load a LV2 (LADSPA Version 2) plugin.
  33828. </p>
  33829. <p>To enable compilation of this filter you need to configure FFmpeg with
  33830. <code class="code">--enable-lv2</code>.
  33831. </p>
  33832. <dl class="table">
  33833. <dt><samp class="option">plugin, p</samp></dt>
  33834. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  33835. </p>
  33836. </dd>
  33837. <dt><samp class="option">controls, c</samp></dt>
  33838. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  33839. values that determine the behavior of the loaded plugin (for example delay,
  33840. threshold or gain).
  33841. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  33842. their valid ranges are printed.
  33843. </p>
  33844. </dd>
  33845. <dt><samp class="option">sample_rate, s</samp></dt>
  33846. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  33847. zero inputs.
  33848. </p>
  33849. </dd>
  33850. <dt><samp class="option">nb_samples, n</samp></dt>
  33851. <dd><p>Set the number of samples per channel per each output frame, default
  33852. is 1024. Only used if plugin have zero inputs.
  33853. </p>
  33854. </dd>
  33855. <dt><samp class="option">duration, d</samp></dt>
  33856. <dd><p>Set the minimum duration of the sourced audio. See
  33857. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  33858. for the accepted syntax.
  33859. Note that the resulting duration may be greater than the specified duration,
  33860. as the generated audio is always cut at the end of a complete frame.
  33861. If not specified, or the expressed duration is negative, the audio is
  33862. supposed to be generated forever.
  33863. Only used if plugin have zero inputs.
  33864. </p></dd>
  33865. </dl>
  33866. <ul class="mini-toc">
  33867. <li><a href="#Examples-71" accesskey="1">Examples</a></li>
  33868. <li><a href="#Commands-43" accesskey="2">Commands</a></li>
  33869. </ul>
  33870. <div class="subsection-level-extent" id="Examples-71">
  33871. <h4 class="subsection"><span>36.99.1 Examples<a class="copiable-link" href="#Examples-71"> &para;</a></span></h4>
  33872. <ul class="itemize mark-bullet">
  33873. <li>Apply bass enhancer plugin from Calf:
  33874. <div class="example">
  33875. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  33876. </pre></div>
  33877. </li><li>Apply vinyl plugin from Calf:
  33878. <div class="example">
  33879. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  33880. </pre></div>
  33881. </li><li>Apply bit crusher plugin from ArtyFX:
  33882. <div class="example">
  33883. <pre class="example-preformatted">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  33884. </pre></div>
  33885. </li></ul>
  33886. </div>
  33887. <div class="subsection-level-extent" id="Commands-43">
  33888. <h4 class="subsection"><span>36.99.2 Commands<a class="copiable-link" href="#Commands-43"> &para;</a></span></h4>
  33889. <p>This filter supports all options that are exported by plugin as commands.
  33890. </p>
  33891. </div>
  33892. </div>
  33893. <div class="section-level-extent" id="mcompand">
  33894. <h3 class="section"><span>36.100 mcompand<a class="copiable-link" href="#mcompand"> &para;</a></span></h3>
  33895. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  33896. </p>
  33897. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  33898. This is akin to the crossover of a loudspeaker, and results in flat frequency
  33899. response when absent compander action.
  33900. </p>
  33901. <p>It accepts the following parameters:
  33902. </p>
  33903. <dl class="table">
  33904. <dt><samp class="option">args</samp></dt>
  33905. <dd><p>This option syntax is:
  33906. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  33907. For explanation of each item refer to compand filter documentation.
  33908. </p></dd>
  33909. </dl>
  33910. <a class="anchor" id="pan"></a></div>
  33911. <div class="section-level-extent" id="pan-1">
  33912. <h3 class="section"><span>36.101 pan<a class="copiable-link" href="#pan-1"> &para;</a></span></h3>
  33913. <p>Mix channels with specific gain levels. The filter accepts the output
  33914. channel layout followed by a set of channels definitions.
  33915. </p>
  33916. <p>This filter is also designed to efficiently remap the channels of an audio
  33917. stream.
  33918. </p>
  33919. <p>The filter accepts parameters of the form:
  33920. &quot;<var class="var">l</var>|<var class="var">outdef</var>|<var class="var">outdef</var>|...&quot;
  33921. </p>
  33922. <dl class="table">
  33923. <dt><samp class="option">l</samp></dt>
  33924. <dd><p>output channel layout or number of channels
  33925. </p>
  33926. </dd>
  33927. <dt><samp class="option">outdef</samp></dt>
  33928. <dd><p>output channel specification, of the form:
  33929. &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;
  33930. </p>
  33931. </dd>
  33932. <dt><samp class="option">out_name</samp></dt>
  33933. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  33934. number (c0, c1, etc.)
  33935. </p>
  33936. </dd>
  33937. <dt><samp class="option">gain</samp></dt>
  33938. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  33939. </p>
  33940. </dd>
  33941. <dt><samp class="option">in_name</samp></dt>
  33942. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  33943. named and numbered input channels
  33944. </p></dd>
  33945. </dl>
  33946. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  33947. that specification will be renormalized so that the total is 1, thus
  33948. avoiding clipping noise.
  33949. </p>
  33950. <ul class="mini-toc">
  33951. <li><a href="#Mixing-examples" accesskey="1">Mixing examples</a></li>
  33952. <li><a href="#Remapping-examples" accesskey="2">Remapping examples</a></li>
  33953. </ul>
  33954. <div class="subsection-level-extent" id="Mixing-examples">
  33955. <h4 class="subsection"><span>36.101.1 Mixing examples<a class="copiable-link" href="#Mixing-examples"> &para;</a></span></h4>
  33956. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  33957. factor for the left channel:
  33958. </p><div class="example">
  33959. <pre class="example-preformatted">pan=1c|c0=0.9*c0+0.1*c1
  33960. </pre></div>
  33961. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  33962. 7-channels surround:
  33963. </p><div class="example">
  33964. <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
  33965. </pre></div>
  33966. <p>Note that <code class="command">ffmpeg</code> integrates a default down-mix (and up-mix) system
  33967. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  33968. needs.
  33969. </p>
  33970. </div>
  33971. <div class="subsection-level-extent" id="Remapping-examples">
  33972. <h4 class="subsection"><span>36.101.2 Remapping examples<a class="copiable-link" href="#Remapping-examples"> &para;</a></span></h4>
  33973. <p>The channel remapping will be effective if, and only if:
  33974. </p>
  33975. <ul class="itemize mark-bullet">
  33976. <li>gain coefficients are zeroes or ones,
  33977. </li><li>only one input per channel output,
  33978. </li></ul>
  33979. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  33980. channel mapping detected&quot;), and use an optimized and lossless method to do the
  33981. remapping.
  33982. </p>
  33983. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  33984. dropping the extra channels:
  33985. </p><div class="example">
  33986. <pre class="example-preformatted">pan=&quot;stereo| c0=FL | c1=FR&quot;
  33987. </pre></div>
  33988. <p>Given the same source, you can also switch front left and front right channels
  33989. and keep the input channel layout:
  33990. </p><div class="example">
  33991. <pre class="example-preformatted">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  33992. </pre></div>
  33993. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  33994. still keep the stereo channel layout) with:
  33995. </p><div class="example">
  33996. <pre class="example-preformatted">pan=&quot;stereo|c1=c1&quot;
  33997. </pre></div>
  33998. <p>Still with a stereo audio stream input, you can copy the right channel in both
  33999. front left and right:
  34000. </p><div class="example">
  34001. <pre class="example-preformatted">pan=&quot;stereo| c0=FR | c1=FR&quot;
  34002. </pre></div>
  34003. </div>
  34004. </div>
  34005. <div class="section-level-extent" id="replaygain">
  34006. <h3 class="section"><span>36.102 replaygain<a class="copiable-link" href="#replaygain"> &para;</a></span></h3>
  34007. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  34008. outputs it unchanged.
  34009. At end of filtering it displays <code class="code">track_gain</code> and <code class="code">track_peak</code>.
  34010. </p>
  34011. <p>The filter accepts the following exported read-only options:
  34012. </p>
  34013. <dl class="table">
  34014. <dt><samp class="option">track_gain</samp></dt>
  34015. <dd><p>Exported track gain in dB at end of stream.
  34016. </p>
  34017. </dd>
  34018. <dt><samp class="option">track_peak</samp></dt>
  34019. <dd><p>Exported track peak at end of stream.
  34020. </p></dd>
  34021. </dl>
  34022. </div>
  34023. <div class="section-level-extent" id="resample">
  34024. <h3 class="section"><span>36.103 resample<a class="copiable-link" href="#resample"> &para;</a></span></h3>
  34025. <p>Convert the audio sample format, sample rate and channel layout. It is
  34026. not meant to be used directly.
  34027. </p>
  34028. </div>
  34029. <div class="section-level-extent" id="rubberband">
  34030. <h3 class="section"><span>36.104 rubberband<a class="copiable-link" href="#rubberband"> &para;</a></span></h3>
  34031. <p>Apply time-stretching and pitch-shifting with librubberband.
  34032. </p>
  34033. <p>To enable compilation of this filter, you need to configure FFmpeg with
  34034. <code class="code">--enable-librubberband</code>.
  34035. </p>
  34036. <p>The filter accepts the following options:
  34037. </p>
  34038. <dl class="table">
  34039. <dt><samp class="option">tempo</samp></dt>
  34040. <dd><p>Set tempo scale factor.
  34041. </p>
  34042. </dd>
  34043. <dt><samp class="option">pitch</samp></dt>
  34044. <dd><p>Set pitch scale factor.
  34045. </p>
  34046. </dd>
  34047. <dt><samp class="option">transients</samp></dt>
  34048. <dd><p>Set transients detector.
  34049. Possible values are:
  34050. </p><dl class="table">
  34051. <dt><var class="var">crisp</var></dt>
  34052. <dt><var class="var">mixed</var></dt>
  34053. <dt><var class="var">smooth</var></dt>
  34054. </dl>
  34055. </dd>
  34056. <dt><samp class="option">detector</samp></dt>
  34057. <dd><p>Set detector.
  34058. Possible values are:
  34059. </p><dl class="table">
  34060. <dt><var class="var">compound</var></dt>
  34061. <dt><var class="var">percussive</var></dt>
  34062. <dt><var class="var">soft</var></dt>
  34063. </dl>
  34064. </dd>
  34065. <dt><samp class="option">phase</samp></dt>
  34066. <dd><p>Set phase.
  34067. Possible values are:
  34068. </p><dl class="table">
  34069. <dt><var class="var">laminar</var></dt>
  34070. <dt><var class="var">independent</var></dt>
  34071. </dl>
  34072. </dd>
  34073. <dt><samp class="option">window</samp></dt>
  34074. <dd><p>Set processing window size.
  34075. Possible values are:
  34076. </p><dl class="table">
  34077. <dt><var class="var">standard</var></dt>
  34078. <dt><var class="var">short</var></dt>
  34079. <dt><var class="var">long</var></dt>
  34080. </dl>
  34081. </dd>
  34082. <dt><samp class="option">smoothing</samp></dt>
  34083. <dd><p>Set smoothing.
  34084. Possible values are:
  34085. </p><dl class="table">
  34086. <dt><var class="var">off</var></dt>
  34087. <dt><var class="var">on</var></dt>
  34088. </dl>
  34089. </dd>
  34090. <dt><samp class="option">formant</samp></dt>
  34091. <dd><p>Enable formant preservation when shift pitching.
  34092. Possible values are:
  34093. </p><dl class="table">
  34094. <dt><var class="var">shifted</var></dt>
  34095. <dt><var class="var">preserved</var></dt>
  34096. </dl>
  34097. </dd>
  34098. <dt><samp class="option">pitchq</samp></dt>
  34099. <dd><p>Set pitch quality.
  34100. Possible values are:
  34101. </p><dl class="table">
  34102. <dt><var class="var">quality</var></dt>
  34103. <dt><var class="var">speed</var></dt>
  34104. <dt><var class="var">consistency</var></dt>
  34105. </dl>
  34106. </dd>
  34107. <dt><samp class="option">channels</samp></dt>
  34108. <dd><p>Set channels.
  34109. Possible values are:
  34110. </p><dl class="table">
  34111. <dt><var class="var">apart</var></dt>
  34112. <dt><var class="var">together</var></dt>
  34113. </dl>
  34114. </dd>
  34115. </dl>
  34116. <ul class="mini-toc">
  34117. <li><a href="#Commands-44" accesskey="1">Commands</a></li>
  34118. </ul>
  34119. <div class="subsection-level-extent" id="Commands-44">
  34120. <h4 class="subsection"><span>36.104.1 Commands<a class="copiable-link" href="#Commands-44"> &para;</a></span></h4>
  34121. <p>This filter supports the following commands:
  34122. </p><dl class="table">
  34123. <dt><samp class="option">tempo</samp></dt>
  34124. <dd><p>Change filter tempo scale factor.
  34125. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  34126. </p>
  34127. </dd>
  34128. <dt><samp class="option">pitch</samp></dt>
  34129. <dd><p>Change filter pitch scale factor.
  34130. Syntax for the command is : &quot;<var class="var">pitch</var>&quot;
  34131. </p></dd>
  34132. </dl>
  34133. </div>
  34134. </div>
  34135. <div class="section-level-extent" id="sidechaincompress">
  34136. <h3 class="section"><span>36.105 sidechaincompress<a class="copiable-link" href="#sidechaincompress"> &para;</a></span></h3>
  34137. <p>This filter acts like normal compressor but has the ability to compress
  34138. detected signal using second input signal.
  34139. It needs two input streams and returns one output stream.
  34140. First input stream will be processed depending on second stream signal.
  34141. The filtered signal then can be filtered with other filters in later stages of
  34142. processing. See <a class="ref" href="#pan">pan</a> and <a class="ref" href="#amerge">amerge</a> filter.
  34143. </p>
  34144. <p>The filter accepts the following options:
  34145. </p>
  34146. <dl class="table">
  34147. <dt><samp class="option">level_in</samp></dt>
  34148. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  34149. </p>
  34150. </dd>
  34151. <dt><samp class="option">mode</samp></dt>
  34152. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  34153. Default is <code class="code">downward</code>.
  34154. </p>
  34155. </dd>
  34156. <dt><samp class="option">threshold</samp></dt>
  34157. <dd><p>If a signal of second stream raises above this level it will affect the gain
  34158. reduction of first stream.
  34159. By default is 0.125. Range is between 0.00097563 and 1.
  34160. </p>
  34161. </dd>
  34162. <dt><samp class="option">ratio</samp></dt>
  34163. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  34164. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  34165. Default is 2. Range is between 1 and 20.
  34166. </p>
  34167. </dd>
  34168. <dt><samp class="option">attack</samp></dt>
  34169. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  34170. reduction starts. Default is 20. Range is between 0.01 and 2000.
  34171. </p>
  34172. </dd>
  34173. <dt><samp class="option">release</samp></dt>
  34174. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  34175. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  34176. </p>
  34177. </dd>
  34178. <dt><samp class="option">makeup</samp></dt>
  34179. <dd><p>Set the amount by how much signal will be amplified after processing.
  34180. Default is 1. Range is from 1 to 64.
  34181. </p>
  34182. </dd>
  34183. <dt><samp class="option">knee</samp></dt>
  34184. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  34185. Default is 2.82843. Range is between 1 and 8.
  34186. </p>
  34187. </dd>
  34188. <dt><samp class="option">link</samp></dt>
  34189. <dd><p>Choose if the <code class="code">average</code> level between all channels of side-chain stream
  34190. or the louder(<code class="code">maximum</code>) channel of side-chain stream affects the
  34191. reduction. Default is <code class="code">average</code>.
  34192. </p>
  34193. </dd>
  34194. <dt><samp class="option">detection</samp></dt>
  34195. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  34196. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mainly smoother.
  34197. </p>
  34198. </dd>
  34199. <dt><samp class="option">level_sc</samp></dt>
  34200. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  34201. </p>
  34202. </dd>
  34203. <dt><samp class="option">mix</samp></dt>
  34204. <dd><p>How much to use compressed signal in output. Default is 1.
  34205. Range is between 0 and 1.
  34206. </p></dd>
  34207. </dl>
  34208. <ul class="mini-toc">
  34209. <li><a href="#Commands-45" accesskey="1">Commands</a></li>
  34210. <li><a href="#Examples-72" accesskey="2">Examples</a></li>
  34211. </ul>
  34212. <div class="subsection-level-extent" id="Commands-45">
  34213. <h4 class="subsection"><span>36.105.1 Commands<a class="copiable-link" href="#Commands-45"> &para;</a></span></h4>
  34214. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34215. </p>
  34216. </div>
  34217. <div class="subsection-level-extent" id="Examples-72">
  34218. <h4 class="subsection"><span>36.105.2 Examples<a class="copiable-link" href="#Examples-72"> &para;</a></span></h4>
  34219. <ul class="itemize mark-bullet">
  34220. <li>Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  34221. depending on the signal of 2nd input and later compressed signal to be
  34222. merged with 2nd input:
  34223. <div class="example">
  34224. <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;
  34225. </pre></div>
  34226. </li></ul>
  34227. </div>
  34228. </div>
  34229. <div class="section-level-extent" id="sidechaingate">
  34230. <h3 class="section"><span>36.106 sidechaingate<a class="copiable-link" href="#sidechaingate"> &para;</a></span></h3>
  34231. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  34232. filter the detected signal before sending it to the gain reduction stage.
  34233. Normally a gate uses the full range signal to detect a level above the
  34234. threshold.
  34235. For example: If you cut all lower frequencies from your sidechain signal
  34236. the gate will decrease the volume of your track only if not enough highs
  34237. appear. With this technique you are able to reduce the resonation of a
  34238. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  34239. guitar.
  34240. It needs two input streams and returns one output stream.
  34241. First input stream will be processed depending on second stream signal.
  34242. </p>
  34243. <p>The filter accepts the following options:
  34244. </p>
  34245. <dl class="table">
  34246. <dt><samp class="option">level_in</samp></dt>
  34247. <dd><p>Set input level before filtering.
  34248. Default is 1. Allowed range is from 0.015625 to 64.
  34249. </p>
  34250. </dd>
  34251. <dt><samp class="option">mode</samp></dt>
  34252. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  34253. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  34254. will be amplified, expanding dynamic range in upward direction.
  34255. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  34256. </p>
  34257. </dd>
  34258. <dt><samp class="option">range</samp></dt>
  34259. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  34260. Default is 0.06125. Allowed range is from 0 to 1.
  34261. Setting this to 0 disables reduction and then filter behaves like expander.
  34262. </p>
  34263. </dd>
  34264. <dt><samp class="option">threshold</samp></dt>
  34265. <dd><p>If a signal rises above this level the gain reduction is released.
  34266. Default is 0.125. Allowed range is from 0 to 1.
  34267. </p>
  34268. </dd>
  34269. <dt><samp class="option">ratio</samp></dt>
  34270. <dd><p>Set a ratio about which the signal is reduced.
  34271. Default is 2. Allowed range is from 1 to 9000.
  34272. </p>
  34273. </dd>
  34274. <dt><samp class="option">attack</samp></dt>
  34275. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  34276. reduction stops.
  34277. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  34278. </p>
  34279. </dd>
  34280. <dt><samp class="option">release</samp></dt>
  34281. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  34282. reduction is increased again. Default is 250 milliseconds.
  34283. Allowed range is from 0.01 to 9000.
  34284. </p>
  34285. </dd>
  34286. <dt><samp class="option">makeup</samp></dt>
  34287. <dd><p>Set amount of amplification of signal after processing.
  34288. Default is 1. Allowed range is from 1 to 64.
  34289. </p>
  34290. </dd>
  34291. <dt><samp class="option">knee</samp></dt>
  34292. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  34293. Default is 2.828427125. Allowed range is from 1 to 8.
  34294. </p>
  34295. </dd>
  34296. <dt><samp class="option">detection</samp></dt>
  34297. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  34298. Default is rms. Can be peak or rms.
  34299. </p>
  34300. </dd>
  34301. <dt><samp class="option">link</samp></dt>
  34302. <dd><p>Choose if the average level between all channels or the louder channel affects
  34303. the reduction.
  34304. Default is average. Can be average or maximum.
  34305. </p>
  34306. </dd>
  34307. <dt><samp class="option">level_sc</samp></dt>
  34308. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  34309. </p></dd>
  34310. </dl>
  34311. <ul class="mini-toc">
  34312. <li><a href="#Commands-46" accesskey="1">Commands</a></li>
  34313. </ul>
  34314. <div class="subsection-level-extent" id="Commands-46">
  34315. <h4 class="subsection"><span>36.106.1 Commands<a class="copiable-link" href="#Commands-46"> &para;</a></span></h4>
  34316. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34317. </p>
  34318. </div>
  34319. </div>
  34320. <div class="section-level-extent" id="silencedetect">
  34321. <h3 class="section"><span>36.107 silencedetect<a class="copiable-link" href="#silencedetect"> &para;</a></span></h3>
  34322. <p>Detect silence in an audio stream.
  34323. </p>
  34324. <p>This filter logs a message when it detects that the input audio volume is less
  34325. or equal to a noise tolerance value for a duration greater or equal to the
  34326. minimum detected noise duration.
  34327. </p>
  34328. <p>The printed times and duration are expressed in seconds. The
  34329. <code class="code">lavfi.silence_start</code> or <code class="code">lavfi.silence_start.X</code> metadata key
  34330. is set on the first frame whose timestamp equals or exceeds the detection
  34331. duration and it contains the timestamp of the first frame of the silence.
  34332. </p>
  34333. <p>The <code class="code">lavfi.silence_duration</code> or <code class="code">lavfi.silence_duration.X</code>
  34334. and <code class="code">lavfi.silence_end</code> or <code class="code">lavfi.silence_end.X</code> metadata
  34335. keys are set on the first frame after the silence. If <samp class="option">mono</samp> is
  34336. enabled, and each channel is evaluated separately, the <code class="code">.X</code>
  34337. suffixed keys are used, and <code class="code">X</code> corresponds to the channel number.
  34338. </p>
  34339. <p>The filter accepts the following options:
  34340. </p>
  34341. <dl class="table">
  34342. <dt><samp class="option">noise, n</samp></dt>
  34343. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  34344. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  34345. </p>
  34346. </dd>
  34347. <dt><samp class="option">duration, d</samp></dt>
  34348. <dd><p>Set silence duration until notification (default is 2 seconds). See
  34349. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  34350. for the accepted syntax.
  34351. </p>
  34352. </dd>
  34353. <dt><samp class="option">mono, m</samp></dt>
  34354. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  34355. </p></dd>
  34356. </dl>
  34357. <ul class="mini-toc">
  34358. <li><a href="#Examples-73" accesskey="1">Examples</a></li>
  34359. </ul>
  34360. <div class="subsection-level-extent" id="Examples-73">
  34361. <h4 class="subsection"><span>36.107.1 Examples<a class="copiable-link" href="#Examples-73"> &para;</a></span></h4>
  34362. <ul class="itemize mark-bullet">
  34363. <li>Detect 5 seconds of silence with -50dB noise tolerance:
  34364. <div class="example">
  34365. <pre class="example-preformatted">silencedetect=n=-50dB:d=5
  34366. </pre></div>
  34367. </li><li>Complete example with <code class="command">ffmpeg</code> to detect silence with 0.0001 noise
  34368. tolerance in <samp class="file">silence.mp3</samp>:
  34369. <div class="example">
  34370. <pre class="example-preformatted">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  34371. </pre></div>
  34372. </li></ul>
  34373. </div>
  34374. </div>
  34375. <div class="section-level-extent" id="silenceremove">
  34376. <h3 class="section"><span>36.108 silenceremove<a class="copiable-link" href="#silenceremove"> &para;</a></span></h3>
  34377. <p>Remove silence from the beginning, middle or end of the audio.
  34378. </p>
  34379. <p>The filter accepts the following options:
  34380. </p>
  34381. <dl class="table">
  34382. <dt><samp class="option">start_periods</samp></dt>
  34383. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  34384. the audio. A value of zero indicates no silence should be trimmed from the
  34385. beginning. When specifying a non-zero value, it trims audio up until it
  34386. finds non-silence. Normally, when trimming silence from beginning of audio
  34387. the <var class="var">start_periods</var> will be <code class="code">1</code> but it can be increased to higher
  34388. values to trim all audio up to specific count of non-silence periods.
  34389. Default value is <code class="code">0</code>.
  34390. </p>
  34391. </dd>
  34392. <dt><samp class="option">start_duration</samp></dt>
  34393. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  34394. trimming audio. By increasing the duration, bursts of noises can be treated
  34395. as silence and trimmed off. Default value is <code class="code">0</code>.
  34396. </p>
  34397. </dd>
  34398. <dt><samp class="option">start_threshold</samp></dt>
  34399. <dd><p>This indicates what sample value should be treated as silence. For digital
  34400. audio, a value of <code class="code">0</code> may be fine but for audio recorded from analog,
  34401. you may wish to increase the value to account for background noise.
  34402. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  34403. or amplitude ratio. Default value is <code class="code">0</code>.
  34404. </p>
  34405. </dd>
  34406. <dt><samp class="option">start_silence</samp></dt>
  34407. <dd><p>Specify max duration of silence at beginning that will be kept after
  34408. trimming. Default is 0, which is equal to trimming all samples detected
  34409. as silence.
  34410. </p>
  34411. </dd>
  34412. <dt><samp class="option">start_mode</samp></dt>
  34413. <dd><p>Specify mode of detection of silence end at start of multi-channel audio.
  34414. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">any</var>.
  34415. With <var class="var">any</var>, any sample from any channel that is detected as non-silence
  34416. will trigger end of silence trimming at start of audio stream.
  34417. With <var class="var">all</var>, only if every sample from every channel is detected as non-silence
  34418. will trigger end of silence trimming at start of audio stream, limited usage.
  34419. </p>
  34420. </dd>
  34421. <dt><samp class="option">stop_periods</samp></dt>
  34422. <dd><p>Set the count for trimming silence from the end of audio. When specifying a
  34423. positive value, it trims audio after it finds specified silence period.
  34424. To remove silence from the middle of a file, specify a <var class="var">stop_periods</var>
  34425. that is negative. This value is then treated as a positive value and is
  34426. used to indicate the effect should restart processing as specified by
  34427. <var class="var">stop_periods</var>, making it suitable for removing periods of silence
  34428. in the middle of the audio.
  34429. Default value is <code class="code">0</code>.
  34430. </p>
  34431. </dd>
  34432. <dt><samp class="option">stop_duration</samp></dt>
  34433. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  34434. more. By specifying a higher duration, silence that is wanted can be left in
  34435. the audio.
  34436. Default value is <code class="code">0</code>.
  34437. </p>
  34438. </dd>
  34439. <dt><samp class="option">stop_threshold</samp></dt>
  34440. <dd><p>This is the same as <samp class="option">start_threshold</samp> but for trimming silence from
  34441. the end of audio.
  34442. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  34443. or amplitude ratio. Default value is <code class="code">0</code>.
  34444. </p>
  34445. </dd>
  34446. <dt><samp class="option">stop_silence</samp></dt>
  34447. <dd><p>Specify max duration of silence at end that will be kept after
  34448. trimming. Default is 0, which is equal to trimming all samples detected
  34449. as silence.
  34450. </p>
  34451. </dd>
  34452. <dt><samp class="option">stop_mode</samp></dt>
  34453. <dd><p>Specify mode of detection of silence start after start of multi-channel audio.
  34454. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  34455. With <var class="var">any</var>, any sample from any channel that is detected as silence
  34456. will trigger start of silence trimming after start of audio stream, limited usage.
  34457. With <var class="var">all</var>, only if every sample from every channel is detected as silence
  34458. will trigger start of silence trimming after start of audio stream.
  34459. </p>
  34460. </dd>
  34461. <dt><samp class="option">detection</samp></dt>
  34462. <dd><p>Set how is silence detected.
  34463. </p><dl class="table">
  34464. <dt><samp class="option">avg</samp></dt>
  34465. <dd><p>Mean of absolute values of samples in moving window.
  34466. </p></dd>
  34467. <dt><samp class="option">rms</samp></dt>
  34468. <dd><p>Root squared mean of absolute values of samples in moving window.
  34469. </p></dd>
  34470. <dt><samp class="option">peak</samp></dt>
  34471. <dd><p>Maximum of absolute values of samples in moving window.
  34472. </p></dd>
  34473. <dt><samp class="option">median</samp></dt>
  34474. <dd><p>Median of absolute values of samples in moving window.
  34475. </p></dd>
  34476. <dt><samp class="option">ptp</samp></dt>
  34477. <dd><p>Absolute of max peak to min peak difference of samples in moving window.
  34478. </p></dd>
  34479. <dt><samp class="option">dev</samp></dt>
  34480. <dd><p>Standard deviation of values of samples in moving window.
  34481. </p></dd>
  34482. </dl>
  34483. <p>Default value is <code class="code">rms</code>.
  34484. </p>
  34485. </dd>
  34486. <dt><samp class="option">window</samp></dt>
  34487. <dd><p>Set duration in number of seconds used to calculate size of window in number
  34488. of samples for detecting silence. Using <code class="code">0</code> will effectively disable
  34489. any windowing and use only single sample per channel for silence detection.
  34490. In that case it may be needed to also set <samp class="option">start_silence</samp> and/or
  34491. <samp class="option">stop_silence</samp> to nonzero values with also <samp class="option">start_duration</samp> and/or
  34492. <samp class="option">stop_duration</samp> to nonzero values.
  34493. Default value is <code class="code">0.02</code>. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  34494. </p>
  34495. </dd>
  34496. <dt><samp class="option">timestamp</samp></dt>
  34497. <dd><p>Set processing mode of every audio frame output timestamp.
  34498. </p><dl class="table">
  34499. <dt><samp class="option">write</samp></dt>
  34500. <dd><p>Full timestamps rewrite, keep only the start time for the first output frame.
  34501. </p></dd>
  34502. <dt><samp class="option">copy</samp></dt>
  34503. <dd><p>Non-dropped frames are left with same timestamp as input audio frame.
  34504. </p></dd>
  34505. </dl>
  34506. <p>Defaults value is <code class="code">write</code>.
  34507. </p></dd>
  34508. </dl>
  34509. <ul class="mini-toc">
  34510. <li><a href="#Examples-74" accesskey="1">Examples</a></li>
  34511. <li><a href="#Commands-47" accesskey="2">Commands</a></li>
  34512. </ul>
  34513. <div class="subsection-level-extent" id="Examples-74">
  34514. <h4 class="subsection"><span>36.108.1 Examples<a class="copiable-link" href="#Examples-74"> &para;</a></span></h4>
  34515. <ul class="itemize mark-bullet">
  34516. <li>The following example shows how this filter can be used to start a recording
  34517. that does not contain the delay at the start which usually occurs between
  34518. pressing the record button and the start of the performance:
  34519. <div class="example">
  34520. <pre class="example-preformatted">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  34521. </pre></div>
  34522. </li><li>Trim all silence encountered from beginning to end where there is more than 1
  34523. second of silence in audio:
  34524. <div class="example">
  34525. <pre class="example-preformatted">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  34526. </pre></div>
  34527. </li><li>Trim all digital silence samples, using peak detection, from beginning to end
  34528. where there is more than 0 samples of digital silence in audio and digital
  34529. silence is detected in all channels at same positions in stream:
  34530. <div class="example">
  34531. <pre class="example-preformatted">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  34532. </pre></div>
  34533. </li><li>Trim every 2nd encountered silence period from beginning to end where there is
  34534. more than 1 second of silence per silence period in audio:
  34535. <div class="example">
  34536. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB
  34537. </pre></div>
  34538. </li><li>Similar as above, but keep maximum of 0.5 seconds of silence from each trimmed period:
  34539. <div class="example">
  34540. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5
  34541. </pre></div>
  34542. </li><li>Similar as above, but keep maximum of 1.5 seconds of silence from start of audio:
  34543. <div class="example">
  34544. <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
  34545. </pre></div>
  34546. </li></ul>
  34547. </div>
  34548. <div class="subsection-level-extent" id="Commands-47">
  34549. <h4 class="subsection"><span>36.108.2 Commands<a class="copiable-link" href="#Commands-47"> &para;</a></span></h4>
  34550. <p>This filter supports some above options as <a class="ref" href="#commands">commands</a>.
  34551. </p>
  34552. </div>
  34553. </div>
  34554. <div class="section-level-extent" id="sofalizer">
  34555. <h3 class="section"><span>36.109 sofalizer<a class="copiable-link" href="#sofalizer"> &para;</a></span></h3>
  34556. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  34557. loudspeakers around the user for binaural listening via headphones (audio
  34558. formats up to 9 channels supported).
  34559. The HRTFs are stored in SOFA files (see <a class="url" href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  34560. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  34561. Austrian Academy of Sciences.
  34562. </p>
  34563. <p>To enable compilation of this filter you need to configure FFmpeg with
  34564. <code class="code">--enable-libmysofa</code>.
  34565. </p>
  34566. <p>The filter accepts the following options:
  34567. </p>
  34568. <dl class="table">
  34569. <dt><samp class="option">sofa</samp></dt>
  34570. <dd><p>Set the SOFA file used for rendering.
  34571. </p>
  34572. </dd>
  34573. <dt><samp class="option">gain</samp></dt>
  34574. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  34575. </p>
  34576. </dd>
  34577. <dt><samp class="option">rotation</samp></dt>
  34578. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  34579. </p>
  34580. </dd>
  34581. <dt><samp class="option">elevation</samp></dt>
  34582. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  34583. </p>
  34584. </dd>
  34585. <dt><samp class="option">radius</samp></dt>
  34586. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  34587. HRTFs. Default is 1.
  34588. </p>
  34589. </dd>
  34590. <dt><samp class="option">type</samp></dt>
  34591. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  34592. processing audio in time domain which is slow.
  34593. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  34594. Default is <var class="var">freq</var>.
  34595. </p>
  34596. </dd>
  34597. <dt><samp class="option">speakers</samp></dt>
  34598. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  34599. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  34600. Each virtual loudspeaker is described with short channel name following with
  34601. azimuth and elevation in degrees.
  34602. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  34603. For example to override front left and front right channel positions use:
  34604. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  34605. Descriptions with unrecognised channel names are ignored.
  34606. </p>
  34607. </dd>
  34608. <dt><samp class="option">lfegain</samp></dt>
  34609. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  34610. </p>
  34611. </dd>
  34612. <dt><samp class="option">framesize</samp></dt>
  34613. <dd><p>Set custom frame size in number of samples. Default is 1024.
  34614. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp class="samp">type</samp>&rsquo;
  34615. is set to <var class="var">freq</var>.
  34616. </p>
  34617. </dd>
  34618. <dt><samp class="option">normalize</samp></dt>
  34619. <dd><p>Should all IRs be normalized upon importing SOFA file.
  34620. By default is enabled.
  34621. </p>
  34622. </dd>
  34623. <dt><samp class="option">interpolate</samp></dt>
  34624. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  34625. does not match. By default is disabled.
  34626. </p>
  34627. </dd>
  34628. <dt><samp class="option">minphase</samp></dt>
  34629. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  34630. </p>
  34631. </dd>
  34632. <dt><samp class="option">anglestep</samp></dt>
  34633. <dd><p>Set neighbor search angle step. Only used if option <var class="var">interpolate</var> is enabled.
  34634. </p>
  34635. </dd>
  34636. <dt><samp class="option">radstep</samp></dt>
  34637. <dd><p>Set neighbor search radius step. Only used if option <var class="var">interpolate</var> is enabled.
  34638. </p></dd>
  34639. </dl>
  34640. <ul class="mini-toc">
  34641. <li><a href="#Examples-75" accesskey="1">Examples</a></li>
  34642. </ul>
  34643. <div class="subsection-level-extent" id="Examples-75">
  34644. <h4 class="subsection"><span>36.109.1 Examples<a class="copiable-link" href="#Examples-75"> &para;</a></span></h4>
  34645. <ul class="itemize mark-bullet">
  34646. <li>Using ClubFritz6 sofa file:
  34647. <div class="example">
  34648. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  34649. </pre></div>
  34650. </li><li>Using ClubFritz12 sofa file and bigger radius with small rotation:
  34651. <div class="example">
  34652. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  34653. </pre></div>
  34654. </li><li>Similar as above but with custom speaker positions for front left, front right, back left and back right
  34655. and also with custom gain:
  34656. <div class="example">
  34657. <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;
  34658. </pre></div>
  34659. </li></ul>
  34660. </div>
  34661. </div>
  34662. <div class="section-level-extent" id="speechnorm">
  34663. <h3 class="section"><span>36.110 speechnorm<a class="copiable-link" href="#speechnorm"> &para;</a></span></h3>
  34664. <p>Speech Normalizer.
  34665. </p>
  34666. <p>This filter expands or compresses each half-cycle of audio samples
  34667. (local set of samples all above or all below zero and between two nearest zero crossings) depending
  34668. on threshold value, so audio reaches target peak value under conditions controlled by below options.
  34669. </p>
  34670. <p>The filter accepts the following options:
  34671. </p>
  34672. <dl class="table">
  34673. <dt><samp class="option">peak, p</samp></dt>
  34674. <dd><p>Set the expansion target peak value. This specifies the highest allowed absolute amplitude
  34675. level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0.
  34676. </p>
  34677. </dd>
  34678. <dt><samp class="option">expansion, e</samp></dt>
  34679. <dd><p>Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  34680. This option controls maximum local half-cycle of samples expansion. The maximum expansion
  34681. would be such that local peak value reaches target peak value but never to surpass it and that
  34682. ratio between new and previous peak value does not surpass this option value.
  34683. </p>
  34684. </dd>
  34685. <dt><samp class="option">compression, c</samp></dt>
  34686. <dd><p>Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  34687. This option controls maximum local half-cycle of samples compression. This option is used
  34688. only if <samp class="option">threshold</samp> option is set to value greater than 0.0, then in such cases
  34689. when local peak is lower or same as value set by <samp class="option">threshold</samp> all samples belonging to
  34690. that peak&rsquo;s half-cycle will be compressed by current compression factor.
  34691. </p>
  34692. </dd>
  34693. <dt><samp class="option">threshold, t</samp></dt>
  34694. <dd><p>Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  34695. This option specifies which half-cycles of samples will be compressed and which will be expanded.
  34696. Any half-cycle samples with their local peak value below or same as this option value will be
  34697. compressed by current compression factor, otherwise, if greater than threshold value they will be
  34698. expanded with expansion factor so that it could reach peak target value but never surpass it.
  34699. </p>
  34700. </dd>
  34701. <dt><samp class="option">raise, r</samp></dt>
  34702. <dd><p>Set the expansion raising amount per each half-cycle of samples. Default value is 0.001.
  34703. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per
  34704. each new half-cycle until it reaches <samp class="option">expansion</samp> value.
  34705. Setting this options too high may lead to distortions.
  34706. </p>
  34707. </dd>
  34708. <dt><samp class="option">fall, f</samp></dt>
  34709. <dd><p>Set the compression raising amount per each half-cycle of samples. Default value is 0.001.
  34710. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per
  34711. each new half-cycle until it reaches <samp class="option">compression</samp> value.
  34712. </p>
  34713. </dd>
  34714. <dt><samp class="option">channels, h</samp></dt>
  34715. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  34716. </p>
  34717. </dd>
  34718. <dt><samp class="option">invert, i</samp></dt>
  34719. <dd><p>Enable inverted filtering, by default is disabled. This inverts interpretation of <samp class="option">threshold</samp>
  34720. option. When enabled any half-cycle of samples with their local peak value below or same as
  34721. <samp class="option">threshold</samp> option will be expanded otherwise it will be compressed.
  34722. </p>
  34723. </dd>
  34724. <dt><samp class="option">link, l</samp></dt>
  34725. <dd><p>Link channels when calculating gain applied to each filtered channel sample, by default is disabled.
  34726. When disabled each filtered channel gain calculation is independent, otherwise when this option
  34727. is enabled the minimum of all possible gains for each filtered channel is used.
  34728. </p>
  34729. </dd>
  34730. <dt><samp class="option">rms, m</samp></dt>
  34731. <dd><p>Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized
  34732. audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0.
  34733. </p></dd>
  34734. </dl>
  34735. <ul class="mini-toc">
  34736. <li><a href="#Commands-48" accesskey="1">Commands</a></li>
  34737. <li><a href="#Examples-76" accesskey="2">Examples</a></li>
  34738. </ul>
  34739. <div class="subsection-level-extent" id="Commands-48">
  34740. <h4 class="subsection"><span>36.110.1 Commands<a class="copiable-link" href="#Commands-48"> &para;</a></span></h4>
  34741. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34742. </p>
  34743. </div>
  34744. <div class="subsection-level-extent" id="Examples-76">
  34745. <h4 class="subsection"><span>36.110.2 Examples<a class="copiable-link" href="#Examples-76"> &para;</a></span></h4>
  34746. <ul class="itemize mark-bullet">
  34747. <li>Weak and slow amplification:
  34748. <div class="example">
  34749. <pre class="example-preformatted">speechnorm=e=3:r=0.00001:l=1
  34750. </pre></div>
  34751. </li><li>Moderate and slow amplification:
  34752. <div class="example">
  34753. <pre class="example-preformatted">speechnorm=e=6.25:r=0.00001:l=1
  34754. </pre></div>
  34755. </li><li>Strong and fast amplification:
  34756. <div class="example">
  34757. <pre class="example-preformatted">speechnorm=e=12.5:r=0.0001:l=1
  34758. </pre></div>
  34759. </li><li>Very strong and fast amplification:
  34760. <div class="example">
  34761. <pre class="example-preformatted">speechnorm=e=25:r=0.0001:l=1
  34762. </pre></div>
  34763. </li><li>Extreme and fast amplification:
  34764. <div class="example">
  34765. <pre class="example-preformatted">speechnorm=e=50:r=0.0001:l=1
  34766. </pre></div>
  34767. </li></ul>
  34768. </div>
  34769. </div>
  34770. <div class="section-level-extent" id="stereotools">
  34771. <h3 class="section"><span>36.111 stereotools<a class="copiable-link" href="#stereotools"> &para;</a></span></h3>
  34772. <p>This filter has some handy utilities to manage stereo signals, for converting
  34773. M/S stereo recordings to L/R signal while having control over the parameters
  34774. or spreading the stereo image of master track.
  34775. </p>
  34776. <p>The filter accepts the following options:
  34777. </p>
  34778. <dl class="table">
  34779. <dt><samp class="option">level_in</samp></dt>
  34780. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  34781. Allowed range is from 0.015625 to 64.
  34782. </p>
  34783. </dd>
  34784. <dt><samp class="option">level_out</samp></dt>
  34785. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  34786. Allowed range is from 0.015625 to 64.
  34787. </p>
  34788. </dd>
  34789. <dt><samp class="option">balance_in</samp></dt>
  34790. <dd><p>Set input balance between both channels. Default is 0.
  34791. Allowed range is from -1 to 1.
  34792. </p>
  34793. </dd>
  34794. <dt><samp class="option">balance_out</samp></dt>
  34795. <dd><p>Set output balance between both channels. Default is 0.
  34796. Allowed range is from -1 to 1.
  34797. </p>
  34798. </dd>
  34799. <dt><samp class="option">softclip</samp></dt>
  34800. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  34801. clipping. Disabled by default.
  34802. </p>
  34803. </dd>
  34804. <dt><samp class="option">mutel</samp></dt>
  34805. <dd><p>Mute the left channel. Disabled by default.
  34806. </p>
  34807. </dd>
  34808. <dt><samp class="option">muter</samp></dt>
  34809. <dd><p>Mute the right channel. Disabled by default.
  34810. </p>
  34811. </dd>
  34812. <dt><samp class="option">phasel</samp></dt>
  34813. <dd><p>Change the phase of the left channel. Disabled by default.
  34814. </p>
  34815. </dd>
  34816. <dt><samp class="option">phaser</samp></dt>
  34817. <dd><p>Change the phase of the right channel. Disabled by default.
  34818. </p>
  34819. </dd>
  34820. <dt><samp class="option">mode</samp></dt>
  34821. <dd><p>Set stereo mode. Available values are:
  34822. </p>
  34823. <dl class="table">
  34824. <dt>&lsquo;<samp class="samp">lr&gt;lr</samp>&rsquo;</dt>
  34825. <dd><p>Left/Right to Left/Right, this is default.
  34826. </p>
  34827. </dd>
  34828. <dt>&lsquo;<samp class="samp">lr&gt;ms</samp>&rsquo;</dt>
  34829. <dd><p>Left/Right to Mid/Side.
  34830. </p>
  34831. </dd>
  34832. <dt>&lsquo;<samp class="samp">ms&gt;lr</samp>&rsquo;</dt>
  34833. <dd><p>Mid/Side to Left/Right.
  34834. </p>
  34835. </dd>
  34836. <dt>&lsquo;<samp class="samp">lr&gt;ll</samp>&rsquo;</dt>
  34837. <dd><p>Left/Right to Left/Left.
  34838. </p>
  34839. </dd>
  34840. <dt>&lsquo;<samp class="samp">lr&gt;rr</samp>&rsquo;</dt>
  34841. <dd><p>Left/Right to Right/Right.
  34842. </p>
  34843. </dd>
  34844. <dt>&lsquo;<samp class="samp">lr&gt;l+r</samp>&rsquo;</dt>
  34845. <dd><p>Left/Right to Left + Right.
  34846. </p>
  34847. </dd>
  34848. <dt>&lsquo;<samp class="samp">lr&gt;rl</samp>&rsquo;</dt>
  34849. <dd><p>Left/Right to Right/Left.
  34850. </p>
  34851. </dd>
  34852. <dt>&lsquo;<samp class="samp">ms&gt;ll</samp>&rsquo;</dt>
  34853. <dd><p>Mid/Side to Left/Left.
  34854. </p>
  34855. </dd>
  34856. <dt>&lsquo;<samp class="samp">ms&gt;rr</samp>&rsquo;</dt>
  34857. <dd><p>Mid/Side to Right/Right.
  34858. </p>
  34859. </dd>
  34860. <dt>&lsquo;<samp class="samp">ms&gt;rl</samp>&rsquo;</dt>
  34861. <dd><p>Mid/Side to Right/Left.
  34862. </p>
  34863. </dd>
  34864. <dt>&lsquo;<samp class="samp">lr&gt;l-r</samp>&rsquo;</dt>
  34865. <dd><p>Left/Right to Left - Right.
  34866. </p></dd>
  34867. </dl>
  34868. </dd>
  34869. <dt><samp class="option">slev</samp></dt>
  34870. <dd><p>Set level of side signal. Default is 1.
  34871. Allowed range is from 0.015625 to 64.
  34872. </p>
  34873. </dd>
  34874. <dt><samp class="option">sbal</samp></dt>
  34875. <dd><p>Set balance of side signal. Default is 0.
  34876. Allowed range is from -1 to 1.
  34877. </p>
  34878. </dd>
  34879. <dt><samp class="option">mlev</samp></dt>
  34880. <dd><p>Set level of the middle signal. Default is 1.
  34881. Allowed range is from 0.015625 to 64.
  34882. </p>
  34883. </dd>
  34884. <dt><samp class="option">mpan</samp></dt>
  34885. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  34886. </p>
  34887. </dd>
  34888. <dt><samp class="option">base</samp></dt>
  34889. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  34890. Allowed range is from -1 to 1.
  34891. </p>
  34892. </dd>
  34893. <dt><samp class="option">delay</samp></dt>
  34894. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  34895. vice versa. Default is 0. Allowed range is from -20 to 20.
  34896. </p>
  34897. </dd>
  34898. <dt><samp class="option">sclevel</samp></dt>
  34899. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  34900. </p>
  34901. </dd>
  34902. <dt><samp class="option">phase</samp></dt>
  34903. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  34904. </p>
  34905. </dd>
  34906. <dt><samp class="option">bmode_in, bmode_out</samp></dt>
  34907. <dd><p>Set balance mode for balance_in/balance_out option.
  34908. </p>
  34909. <p>Can be one of the following:
  34910. </p>
  34911. <dl class="table">
  34912. <dt>&lsquo;<samp class="samp">balance</samp>&rsquo;</dt>
  34913. <dd><p>Classic balance mode. Attenuate one channel at time.
  34914. Gain is raised up to 1.
  34915. </p>
  34916. </dd>
  34917. <dt>&lsquo;<samp class="samp">amplitude</samp>&rsquo;</dt>
  34918. <dd><p>Similar as classic mode above but gain is raised up to 2.
  34919. </p>
  34920. </dd>
  34921. <dt>&lsquo;<samp class="samp">power</samp>&rsquo;</dt>
  34922. <dd><p>Equal power distribution, from -6dB to +6dB range.
  34923. </p></dd>
  34924. </dl>
  34925. </dd>
  34926. </dl>
  34927. <ul class="mini-toc">
  34928. <li><a href="#Commands-49" accesskey="1">Commands</a></li>
  34929. <li><a href="#Examples-77" accesskey="2">Examples</a></li>
  34930. </ul>
  34931. <div class="subsection-level-extent" id="Commands-49">
  34932. <h4 class="subsection"><span>36.111.1 Commands<a class="copiable-link" href="#Commands-49"> &para;</a></span></h4>
  34933. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  34934. </p>
  34935. </div>
  34936. <div class="subsection-level-extent" id="Examples-77">
  34937. <h4 class="subsection"><span>36.111.2 Examples<a class="copiable-link" href="#Examples-77"> &para;</a></span></h4>
  34938. <ul class="itemize mark-bullet">
  34939. <li>Apply karaoke like effect:
  34940. <div class="example">
  34941. <pre class="example-preformatted">stereotools=mlev=0.015625
  34942. </pre></div>
  34943. </li><li>Convert M/S signal to L/R:
  34944. <div class="example">
  34945. <pre class="example-preformatted">&quot;stereotools=mode=ms&gt;lr&quot;
  34946. </pre></div>
  34947. </li></ul>
  34948. </div>
  34949. </div>
  34950. <div class="section-level-extent" id="stereowiden">
  34951. <h3 class="section"><span>36.112 stereowiden<a class="copiable-link" href="#stereowiden"> &para;</a></span></h3>
  34952. <p>This filter enhance the stereo effect by suppressing signal common to both
  34953. channels and by delaying the signal of left into right and vice versa,
  34954. thereby widening the stereo effect.
  34955. </p>
  34956. <p>The filter accepts the following options:
  34957. </p>
  34958. <dl class="table">
  34959. <dt><samp class="option">delay</samp></dt>
  34960. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  34961. Default is 20 milliseconds.
  34962. </p>
  34963. </dd>
  34964. <dt><samp class="option">feedback</samp></dt>
  34965. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  34966. effect of left signal in right output and vice versa which gives widening
  34967. effect. Default is 0.3.
  34968. </p>
  34969. </dd>
  34970. <dt><samp class="option">crossfeed</samp></dt>
  34971. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  34972. the mono. If the value is 1 it will cancel all the signal common to both
  34973. channels. Default is 0.3.
  34974. </p>
  34975. </dd>
  34976. <dt><samp class="option">drymix</samp></dt>
  34977. <dd><p>Set level of input signal of original channel. Default is 0.8.
  34978. </p></dd>
  34979. </dl>
  34980. <ul class="mini-toc">
  34981. <li><a href="#Commands-50" accesskey="1">Commands</a></li>
  34982. </ul>
  34983. <div class="subsection-level-extent" id="Commands-50">
  34984. <h4 class="subsection"><span>36.112.1 Commands<a class="copiable-link" href="#Commands-50"> &para;</a></span></h4>
  34985. <p>This filter supports the all above options except <code class="code">delay</code> as <a class="ref" href="#commands">commands</a>.
  34986. </p>
  34987. </div>
  34988. </div>
  34989. <div class="section-level-extent" id="superequalizer">
  34990. <h3 class="section"><span>36.113 superequalizer<a class="copiable-link" href="#superequalizer"> &para;</a></span></h3>
  34991. <p>Apply 18 band equalizer.
  34992. </p>
  34993. <p>The filter accepts the following options:
  34994. </p><dl class="table">
  34995. <dt><samp class="option">1b</samp></dt>
  34996. <dd><p>Set 65Hz band gain.
  34997. </p></dd>
  34998. <dt><samp class="option">2b</samp></dt>
  34999. <dd><p>Set 92Hz band gain.
  35000. </p></dd>
  35001. <dt><samp class="option">3b</samp></dt>
  35002. <dd><p>Set 131Hz band gain.
  35003. </p></dd>
  35004. <dt><samp class="option">4b</samp></dt>
  35005. <dd><p>Set 185Hz band gain.
  35006. </p></dd>
  35007. <dt><samp class="option">5b</samp></dt>
  35008. <dd><p>Set 262Hz band gain.
  35009. </p></dd>
  35010. <dt><samp class="option">6b</samp></dt>
  35011. <dd><p>Set 370Hz band gain.
  35012. </p></dd>
  35013. <dt><samp class="option">7b</samp></dt>
  35014. <dd><p>Set 523Hz band gain.
  35015. </p></dd>
  35016. <dt><samp class="option">8b</samp></dt>
  35017. <dd><p>Set 740Hz band gain.
  35018. </p></dd>
  35019. <dt><samp class="option">9b</samp></dt>
  35020. <dd><p>Set 1047Hz band gain.
  35021. </p></dd>
  35022. <dt><samp class="option">10b</samp></dt>
  35023. <dd><p>Set 1480Hz band gain.
  35024. </p></dd>
  35025. <dt><samp class="option">11b</samp></dt>
  35026. <dd><p>Set 2093Hz band gain.
  35027. </p></dd>
  35028. <dt><samp class="option">12b</samp></dt>
  35029. <dd><p>Set 2960Hz band gain.
  35030. </p></dd>
  35031. <dt><samp class="option">13b</samp></dt>
  35032. <dd><p>Set 4186Hz band gain.
  35033. </p></dd>
  35034. <dt><samp class="option">14b</samp></dt>
  35035. <dd><p>Set 5920Hz band gain.
  35036. </p></dd>
  35037. <dt><samp class="option">15b</samp></dt>
  35038. <dd><p>Set 8372Hz band gain.
  35039. </p></dd>
  35040. <dt><samp class="option">16b</samp></dt>
  35041. <dd><p>Set 11840Hz band gain.
  35042. </p></dd>
  35043. <dt><samp class="option">17b</samp></dt>
  35044. <dd><p>Set 16744Hz band gain.
  35045. </p></dd>
  35046. <dt><samp class="option">18b</samp></dt>
  35047. <dd><p>Set 20000Hz band gain.
  35048. </p></dd>
  35049. </dl>
  35050. </div>
  35051. <div class="section-level-extent" id="surround">
  35052. <h3 class="section"><span>36.114 surround<a class="copiable-link" href="#surround"> &para;</a></span></h3>
  35053. <p>Apply audio surround upmix filter.
  35054. </p>
  35055. <p>This filter allows to produce multichannel output from audio stream.
  35056. </p>
  35057. <p>The filter accepts the following options:
  35058. </p>
  35059. <dl class="table">
  35060. <dt><samp class="option">chl_out</samp></dt>
  35061. <dd><p>Set output channel layout. By default, this is <var class="var">5.1</var>.
  35062. </p>
  35063. <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>
  35064. for the required syntax.
  35065. </p>
  35066. </dd>
  35067. <dt><samp class="option">chl_in</samp></dt>
  35068. <dd><p>Set input channel layout. By default, this is <var class="var">stereo</var>.
  35069. </p>
  35070. <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>
  35071. for the required syntax.
  35072. </p>
  35073. </dd>
  35074. <dt><samp class="option">level_in</samp></dt>
  35075. <dd><p>Set input volume level. By default, this is <var class="var">1</var>.
  35076. </p>
  35077. </dd>
  35078. <dt><samp class="option">level_out</samp></dt>
  35079. <dd><p>Set output volume level. By default, this is <var class="var">1</var>.
  35080. </p>
  35081. </dd>
  35082. <dt><samp class="option">lfe</samp></dt>
  35083. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  35084. </p>
  35085. </dd>
  35086. <dt><samp class="option">lfe_low</samp></dt>
  35087. <dd><p>Set LFE low cut off frequency. By default, this is <var class="var">128</var> Hz.
  35088. </p>
  35089. </dd>
  35090. <dt><samp class="option">lfe_high</samp></dt>
  35091. <dd><p>Set LFE high cut off frequency. By default, this is <var class="var">256</var> Hz.
  35092. </p>
  35093. </dd>
  35094. <dt><samp class="option">lfe_mode</samp></dt>
  35095. <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>.
  35096. In <var class="var">add</var> mode, LFE channel is created from input audio and added to output.
  35097. In <var class="var">sub</var> mode, LFE channel is created from input audio and added to output but
  35098. also all non-LFE output channels are subtracted with output LFE channel.
  35099. </p>
  35100. </dd>
  35101. <dt><samp class="option">smooth</samp></dt>
  35102. <dd><p>Set temporal smoothness strength, used to gradually change factors when transforming
  35103. stereo sound in time. Allowed range is from <var class="var">0.0</var> to <var class="var">1.0</var>.
  35104. Useful to improve output quality with <var class="var">focus</var> option values greater than <var class="var">0.0</var>.
  35105. Default is <var class="var">0.0</var>. Only values inside this range and without edges are effective.
  35106. </p>
  35107. </dd>
  35108. <dt><samp class="option">angle</samp></dt>
  35109. <dd><p>Set angle of stereo surround transform, Allowed range is from <var class="var">0</var> to <var class="var">360</var>.
  35110. Default is <var class="var">90</var>.
  35111. </p>
  35112. </dd>
  35113. <dt><samp class="option">focus</samp></dt>
  35114. <dd><p>Set focus of stereo surround transform, Allowed range is from <var class="var">-1</var> to <var class="var">1</var>.
  35115. Default is <var class="var">0</var>.
  35116. </p>
  35117. </dd>
  35118. <dt><samp class="option">fc_in</samp></dt>
  35119. <dd><p>Set front center input volume. By default, this is <var class="var">1</var>.
  35120. </p>
  35121. </dd>
  35122. <dt><samp class="option">fc_out</samp></dt>
  35123. <dd><p>Set front center output volume. By default, this is <var class="var">1</var>.
  35124. </p>
  35125. </dd>
  35126. <dt><samp class="option">fl_in</samp></dt>
  35127. <dd><p>Set front left input volume. By default, this is <var class="var">1</var>.
  35128. </p>
  35129. </dd>
  35130. <dt><samp class="option">fl_out</samp></dt>
  35131. <dd><p>Set front left output volume. By default, this is <var class="var">1</var>.
  35132. </p>
  35133. </dd>
  35134. <dt><samp class="option">fr_in</samp></dt>
  35135. <dd><p>Set front right input volume. By default, this is <var class="var">1</var>.
  35136. </p>
  35137. </dd>
  35138. <dt><samp class="option">fr_out</samp></dt>
  35139. <dd><p>Set front right output volume. By default, this is <var class="var">1</var>.
  35140. </p>
  35141. </dd>
  35142. <dt><samp class="option">sl_in</samp></dt>
  35143. <dd><p>Set side left input volume. By default, this is <var class="var">1</var>.
  35144. </p>
  35145. </dd>
  35146. <dt><samp class="option">sl_out</samp></dt>
  35147. <dd><p>Set side left output volume. By default, this is <var class="var">1</var>.
  35148. </p>
  35149. </dd>
  35150. <dt><samp class="option">sr_in</samp></dt>
  35151. <dd><p>Set side right input volume. By default, this is <var class="var">1</var>.
  35152. </p>
  35153. </dd>
  35154. <dt><samp class="option">sr_out</samp></dt>
  35155. <dd><p>Set side right output volume. By default, this is <var class="var">1</var>.
  35156. </p>
  35157. </dd>
  35158. <dt><samp class="option">bl_in</samp></dt>
  35159. <dd><p>Set back left input volume. By default, this is <var class="var">1</var>.
  35160. </p>
  35161. </dd>
  35162. <dt><samp class="option">bl_out</samp></dt>
  35163. <dd><p>Set back left output volume. By default, this is <var class="var">1</var>.
  35164. </p>
  35165. </dd>
  35166. <dt><samp class="option">br_in</samp></dt>
  35167. <dd><p>Set back right input volume. By default, this is <var class="var">1</var>.
  35168. </p>
  35169. </dd>
  35170. <dt><samp class="option">br_out</samp></dt>
  35171. <dd><p>Set back right output volume. By default, this is <var class="var">1</var>.
  35172. </p>
  35173. </dd>
  35174. <dt><samp class="option">bc_in</samp></dt>
  35175. <dd><p>Set back center input volume. By default, this is <var class="var">1</var>.
  35176. </p>
  35177. </dd>
  35178. <dt><samp class="option">bc_out</samp></dt>
  35179. <dd><p>Set back center output volume. By default, this is <var class="var">1</var>.
  35180. </p>
  35181. </dd>
  35182. <dt><samp class="option">lfe_in</samp></dt>
  35183. <dd><p>Set LFE input volume. By default, this is <var class="var">1</var>.
  35184. </p>
  35185. </dd>
  35186. <dt><samp class="option">lfe_out</samp></dt>
  35187. <dd><p>Set LFE output volume. By default, this is <var class="var">1</var>.
  35188. </p>
  35189. </dd>
  35190. <dt><samp class="option">allx</samp></dt>
  35191. <dd><p>Set spread usage of stereo image across X axis for all channels.
  35192. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  35193. By default this value is negative <var class="var">-1</var>, and thus unused.
  35194. </p>
  35195. </dd>
  35196. <dt><samp class="option">ally</samp></dt>
  35197. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  35198. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  35199. By default this value is negative <var class="var">-1</var>, and thus unused.
  35200. </p>
  35201. </dd>
  35202. <dt><samp class="option">fcx, flx, frx, blx, brx, slx, srx, bcx</samp></dt>
  35203. <dd><p>Set spread usage of stereo image across X axis for each channel.
  35204. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  35205. By default this value is <var class="var">0.5</var>.
  35206. </p>
  35207. </dd>
  35208. <dt><samp class="option">fcy, fly, fry, bly, bry, sly, sry, bcy</samp></dt>
  35209. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  35210. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  35211. By default this value is <var class="var">0.5</var>.
  35212. </p>
  35213. </dd>
  35214. <dt><samp class="option">win_size</samp></dt>
  35215. <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>.
  35216. </p>
  35217. </dd>
  35218. <dt><samp class="option">win_func</samp></dt>
  35219. <dd><p>Set window function.
  35220. </p>
  35221. <p>It accepts the following values:
  35222. </p><dl class="table">
  35223. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  35224. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  35225. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  35226. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  35227. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  35228. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  35229. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  35230. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  35231. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  35232. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  35233. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  35234. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  35235. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  35236. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  35237. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  35238. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  35239. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  35240. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  35241. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  35242. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  35243. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  35244. </dl>
  35245. <p>Default is <code class="code">hann</code>.
  35246. </p>
  35247. </dd>
  35248. <dt><samp class="option">overlap</samp></dt>
  35249. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  35250. window function will be picked. Default is <code class="code">0.5</code>.
  35251. </p></dd>
  35252. </dl>
  35253. </div>
  35254. <div class="section-level-extent" id="tiltshelf">
  35255. <h3 class="section"><span>36.115 tiltshelf<a class="copiable-link" href="#tiltshelf"> &para;</a></span></h3>
  35256. <p>Boost or cut the lower frequencies and cut or boost higher frequencies
  35257. of the audio using a two-pole shelving filter with a response similar to
  35258. that of a standard hi-fi&rsquo;s tone-controls.
  35259. This is also known as shelving equalisation (EQ).
  35260. </p>
  35261. <p>The filter accepts the following options:
  35262. </p>
  35263. <dl class="table">
  35264. <dt><samp class="option">gain, g</samp></dt>
  35265. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  35266. (for a large cut) to +20 (for a large boost).
  35267. Beware of clipping when using a positive gain.
  35268. </p>
  35269. </dd>
  35270. <dt><samp class="option">frequency, f</samp></dt>
  35271. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  35272. to extend or reduce the frequency range to be boosted or cut.
  35273. The default value is <code class="code">3000</code> Hz.
  35274. </p>
  35275. </dd>
  35276. <dt><samp class="option">width_type, t</samp></dt>
  35277. <dd><p>Set method to specify band-width of filter.
  35278. </p><dl class="table">
  35279. <dt><samp class="option">h</samp></dt>
  35280. <dd><p>Hz
  35281. </p></dd>
  35282. <dt><samp class="option">q</samp></dt>
  35283. <dd><p>Q-Factor
  35284. </p></dd>
  35285. <dt><samp class="option">o</samp></dt>
  35286. <dd><p>octave
  35287. </p></dd>
  35288. <dt><samp class="option">s</samp></dt>
  35289. <dd><p>slope
  35290. </p></dd>
  35291. <dt><samp class="option">k</samp></dt>
  35292. <dd><p>kHz
  35293. </p></dd>
  35294. </dl>
  35295. </dd>
  35296. <dt><samp class="option">width, w</samp></dt>
  35297. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  35298. </p>
  35299. </dd>
  35300. <dt><samp class="option">poles, p</samp></dt>
  35301. <dd><p>Set number of poles. Default is 2.
  35302. </p>
  35303. </dd>
  35304. <dt><samp class="option">mix, m</samp></dt>
  35305. <dd><p>How much to use filtered signal in output. Default is 1.
  35306. Range is between 0 and 1.
  35307. </p>
  35308. </dd>
  35309. <dt><samp class="option">channels, c</samp></dt>
  35310. <dd><p>Specify which channels to filter, by default all available are filtered.
  35311. </p>
  35312. </dd>
  35313. <dt><samp class="option">normalize, n</samp></dt>
  35314. <dd><p>Normalize biquad coefficients, by default is disabled.
  35315. Enabling it will normalize magnitude response at DC to 0dB.
  35316. </p>
  35317. </dd>
  35318. <dt><samp class="option">transform, a</samp></dt>
  35319. <dd><p>Set transform type of IIR filter.
  35320. </p><dl class="table">
  35321. <dt><samp class="option">di</samp></dt>
  35322. <dt><samp class="option">dii</samp></dt>
  35323. <dt><samp class="option">tdi</samp></dt>
  35324. <dt><samp class="option">tdii</samp></dt>
  35325. <dt><samp class="option">latt</samp></dt>
  35326. <dt><samp class="option">svf</samp></dt>
  35327. <dt><samp class="option">zdf</samp></dt>
  35328. </dl>
  35329. </dd>
  35330. <dt><samp class="option">precision, r</samp></dt>
  35331. <dd><p>Set precision of filtering.
  35332. </p><dl class="table">
  35333. <dt><samp class="option">auto</samp></dt>
  35334. <dd><p>Pick automatic sample format depending on surround filters.
  35335. </p></dd>
  35336. <dt><samp class="option">s16</samp></dt>
  35337. <dd><p>Always use signed 16-bit.
  35338. </p></dd>
  35339. <dt><samp class="option">s32</samp></dt>
  35340. <dd><p>Always use signed 32-bit.
  35341. </p></dd>
  35342. <dt><samp class="option">f32</samp></dt>
  35343. <dd><p>Always use float 32-bit.
  35344. </p></dd>
  35345. <dt><samp class="option">f64</samp></dt>
  35346. <dd><p>Always use float 64-bit.
  35347. </p></dd>
  35348. </dl>
  35349. </dd>
  35350. <dt><samp class="option">block_size, b</samp></dt>
  35351. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  35352. value (higher than impulse response length truncated when reaches near zero values) filtering
  35353. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  35354. </p>
  35355. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  35356. </p></dd>
  35357. </dl>
  35358. <ul class="mini-toc">
  35359. <li><a href="#Commands-51" accesskey="1">Commands</a></li>
  35360. </ul>
  35361. <div class="subsection-level-extent" id="Commands-51">
  35362. <h4 class="subsection"><span>36.115.1 Commands<a class="copiable-link" href="#Commands-51"> &para;</a></span></h4>
  35363. <p>This filter supports some options as <a class="ref" href="#commands">commands</a>.
  35364. </p>
  35365. </div>
  35366. </div>
  35367. <div class="section-level-extent" id="treble_002c-highshelf">
  35368. <h3 class="section"><span>36.116 treble, highshelf<a class="copiable-link" href="#treble_002c-highshelf"> &para;</a></span></h3>
  35369. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  35370. shelving filter with a response similar to that of a standard
  35371. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  35372. </p>
  35373. <p>The filter accepts the following options:
  35374. </p>
  35375. <dl class="table">
  35376. <dt><samp class="option">gain, g</samp></dt>
  35377. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  35378. Nyquist frequency. Its useful range is about -20 (for a large cut)
  35379. to +20 (for a large boost). Beware of clipping when using a positive gain.
  35380. </p>
  35381. </dd>
  35382. <dt><samp class="option">frequency, f</samp></dt>
  35383. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  35384. to extend or reduce the frequency range to be boosted or cut.
  35385. The default value is <code class="code">3000</code> Hz.
  35386. </p>
  35387. </dd>
  35388. <dt><samp class="option">width_type, t</samp></dt>
  35389. <dd><p>Set method to specify band-width of filter.
  35390. </p><dl class="table">
  35391. <dt><samp class="option">h</samp></dt>
  35392. <dd><p>Hz
  35393. </p></dd>
  35394. <dt><samp class="option">q</samp></dt>
  35395. <dd><p>Q-Factor
  35396. </p></dd>
  35397. <dt><samp class="option">o</samp></dt>
  35398. <dd><p>octave
  35399. </p></dd>
  35400. <dt><samp class="option">s</samp></dt>
  35401. <dd><p>slope
  35402. </p></dd>
  35403. <dt><samp class="option">k</samp></dt>
  35404. <dd><p>kHz
  35405. </p></dd>
  35406. </dl>
  35407. </dd>
  35408. <dt><samp class="option">width, w</samp></dt>
  35409. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  35410. </p>
  35411. </dd>
  35412. <dt><samp class="option">poles, p</samp></dt>
  35413. <dd><p>Set number of poles. Default is 2.
  35414. </p>
  35415. </dd>
  35416. <dt><samp class="option">mix, m</samp></dt>
  35417. <dd><p>How much to use filtered signal in output. Default is 1.
  35418. Range is between 0 and 1.
  35419. </p>
  35420. </dd>
  35421. <dt><samp class="option">channels, c</samp></dt>
  35422. <dd><p>Specify which channels to filter, by default all available are filtered.
  35423. </p>
  35424. </dd>
  35425. <dt><samp class="option">normalize, n</samp></dt>
  35426. <dd><p>Normalize biquad coefficients, by default is disabled.
  35427. Enabling it will normalize magnitude response at DC to 0dB.
  35428. </p>
  35429. </dd>
  35430. <dt><samp class="option">transform, a</samp></dt>
  35431. <dd><p>Set transform type of IIR filter.
  35432. </p><dl class="table">
  35433. <dt><samp class="option">di</samp></dt>
  35434. <dt><samp class="option">dii</samp></dt>
  35435. <dt><samp class="option">tdi</samp></dt>
  35436. <dt><samp class="option">tdii</samp></dt>
  35437. <dt><samp class="option">latt</samp></dt>
  35438. <dt><samp class="option">svf</samp></dt>
  35439. <dt><samp class="option">zdf</samp></dt>
  35440. </dl>
  35441. </dd>
  35442. <dt><samp class="option">precision, r</samp></dt>
  35443. <dd><p>Set precision of filtering.
  35444. </p><dl class="table">
  35445. <dt><samp class="option">auto</samp></dt>
  35446. <dd><p>Pick automatic sample format depending on surround filters.
  35447. </p></dd>
  35448. <dt><samp class="option">s16</samp></dt>
  35449. <dd><p>Always use signed 16-bit.
  35450. </p></dd>
  35451. <dt><samp class="option">s32</samp></dt>
  35452. <dd><p>Always use signed 32-bit.
  35453. </p></dd>
  35454. <dt><samp class="option">f32</samp></dt>
  35455. <dd><p>Always use float 32-bit.
  35456. </p></dd>
  35457. <dt><samp class="option">f64</samp></dt>
  35458. <dd><p>Always use float 64-bit.
  35459. </p></dd>
  35460. </dl>
  35461. </dd>
  35462. <dt><samp class="option">block_size, b</samp></dt>
  35463. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  35464. value (higher than impulse response length truncated when reaches near zero values) filtering
  35465. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  35466. </p>
  35467. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  35468. </p></dd>
  35469. </dl>
  35470. <ul class="mini-toc">
  35471. <li><a href="#Commands-52" accesskey="1">Commands</a></li>
  35472. </ul>
  35473. <div class="subsection-level-extent" id="Commands-52">
  35474. <h4 class="subsection"><span>36.116.1 Commands<a class="copiable-link" href="#Commands-52"> &para;</a></span></h4>
  35475. <p>This filter supports the following commands:
  35476. </p><dl class="table">
  35477. <dt><samp class="option">frequency, f</samp></dt>
  35478. <dd><p>Change treble frequency.
  35479. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  35480. </p>
  35481. </dd>
  35482. <dt><samp class="option">width_type, t</samp></dt>
  35483. <dd><p>Change treble width_type.
  35484. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  35485. </p>
  35486. </dd>
  35487. <dt><samp class="option">width, w</samp></dt>
  35488. <dd><p>Change treble width.
  35489. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  35490. </p>
  35491. </dd>
  35492. <dt><samp class="option">gain, g</samp></dt>
  35493. <dd><p>Change treble gain.
  35494. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  35495. </p>
  35496. </dd>
  35497. <dt><samp class="option">mix, m</samp></dt>
  35498. <dd><p>Change treble mix.
  35499. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  35500. </p></dd>
  35501. </dl>
  35502. </div>
  35503. </div>
  35504. <div class="section-level-extent" id="tremolo">
  35505. <h3 class="section"><span>36.117 tremolo<a class="copiable-link" href="#tremolo"> &para;</a></span></h3>
  35506. <p>Sinusoidal amplitude modulation.
  35507. </p>
  35508. <p>The filter accepts the following options:
  35509. </p>
  35510. <dl class="table">
  35511. <dt><samp class="option">f</samp></dt>
  35512. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  35513. (20 Hz or lower) will result in a tremolo effect.
  35514. This filter may also be used as a ring modulator by specifying
  35515. a modulation frequency higher than 20 Hz.
  35516. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  35517. </p>
  35518. </dd>
  35519. <dt><samp class="option">d</samp></dt>
  35520. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  35521. Default value is 0.5.
  35522. </p></dd>
  35523. </dl>
  35524. </div>
  35525. <div class="section-level-extent" id="vibrato">
  35526. <h3 class="section"><span>36.118 vibrato<a class="copiable-link" href="#vibrato"> &para;</a></span></h3>
  35527. <p>Sinusoidal phase modulation.
  35528. </p>
  35529. <p>The filter accepts the following options:
  35530. </p>
  35531. <dl class="table">
  35532. <dt><samp class="option">f</samp></dt>
  35533. <dd><p>Modulation frequency in Hertz.
  35534. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  35535. </p>
  35536. </dd>
  35537. <dt><samp class="option">d</samp></dt>
  35538. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  35539. Default value is 0.5.
  35540. </p></dd>
  35541. </dl>
  35542. </div>
  35543. <div class="section-level-extent" id="virtualbass">
  35544. <h3 class="section"><span>36.119 virtualbass<a class="copiable-link" href="#virtualbass"> &para;</a></span></h3>
  35545. <p>Apply audio Virtual Bass filter.
  35546. </p>
  35547. <p>This filter accepts stereo input and produce stereo with LFE (2.1) channels output.
  35548. The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels.
  35549. This filter outputs front left and front right channels unchanged as available in stereo input.
  35550. </p>
  35551. <p>The filter accepts the following options:
  35552. </p>
  35553. <dl class="table">
  35554. <dt><samp class="option">cutoff</samp></dt>
  35555. <dd><p>Set the virtual bass cutoff frequency. Default value is 250 Hz.
  35556. Allowed range is from 100 to 500 Hz.
  35557. </p>
  35558. </dd>
  35559. <dt><samp class="option">strength</samp></dt>
  35560. <dd><p>Set the virtual bass strength. Allowed range is from 0.5 to 3.
  35561. Default value is 3.
  35562. </p></dd>
  35563. </dl>
  35564. </div>
  35565. <div class="section-level-extent" id="volume">
  35566. <h3 class="section"><span>36.120 volume<a class="copiable-link" href="#volume"> &para;</a></span></h3>
  35567. <p>Adjust the input audio volume.
  35568. </p>
  35569. <p>It accepts the following parameters:
  35570. </p><dl class="table">
  35571. <dt><samp class="option">volume</samp></dt>
  35572. <dd><p>Set audio volume expression.
  35573. </p>
  35574. <p>Output values are clipped to the maximum value.
  35575. </p>
  35576. <p>The output audio volume is given by the relation:
  35577. </p><div class="example">
  35578. <pre class="example-preformatted"><var class="var">output_volume</var> = <var class="var">volume</var> * <var class="var">input_volume</var>
  35579. </pre></div>
  35580. <p>The default value for <var class="var">volume</var> is &quot;1.0&quot;.
  35581. </p>
  35582. </dd>
  35583. <dt><samp class="option">precision</samp></dt>
  35584. <dd><p>This parameter represents the mathematical precision.
  35585. </p>
  35586. <p>It determines which input sample formats will be allowed, which affects the
  35587. precision of the volume scaling.
  35588. </p>
  35589. <dl class="table">
  35590. <dt><samp class="option">fixed</samp></dt>
  35591. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  35592. </p></dd>
  35593. <dt><samp class="option">float</samp></dt>
  35594. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  35595. </p></dd>
  35596. <dt><samp class="option">double</samp></dt>
  35597. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  35598. </p></dd>
  35599. </dl>
  35600. </dd>
  35601. <dt><samp class="option">replaygain</samp></dt>
  35602. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  35603. </p>
  35604. <dl class="table">
  35605. <dt><samp class="option">drop</samp></dt>
  35606. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  35607. </p>
  35608. </dd>
  35609. <dt><samp class="option">ignore</samp></dt>
  35610. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  35611. </p>
  35612. </dd>
  35613. <dt><samp class="option">track</samp></dt>
  35614. <dd><p>Prefer the track gain, if present.
  35615. </p>
  35616. </dd>
  35617. <dt><samp class="option">album</samp></dt>
  35618. <dd><p>Prefer the album gain, if present.
  35619. </p></dd>
  35620. </dl>
  35621. </dd>
  35622. <dt><samp class="option">replaygain_preamp</samp></dt>
  35623. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  35624. </p>
  35625. <p>Default value for <var class="var">replaygain_preamp</var> is 0.0.
  35626. </p>
  35627. </dd>
  35628. <dt><samp class="option">replaygain_noclip</samp></dt>
  35629. <dd><p>Prevent clipping by limiting the gain applied.
  35630. </p>
  35631. <p>Default value for <var class="var">replaygain_noclip</var> is 1.
  35632. </p>
  35633. </dd>
  35634. <dt><samp class="option">eval</samp></dt>
  35635. <dd><p>Set when the volume expression is evaluated.
  35636. </p>
  35637. <p>It accepts the following values:
  35638. </p><dl class="table">
  35639. <dt>&lsquo;<samp class="samp">once</samp>&rsquo;</dt>
  35640. <dd><p>only evaluate expression once during the filter initialization, or
  35641. when the &lsquo;<samp class="samp">volume</samp>&rsquo; command is sent
  35642. </p>
  35643. </dd>
  35644. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  35645. <dd><p>evaluate expression for each incoming frame
  35646. </p></dd>
  35647. </dl>
  35648. <p>Default value is &lsquo;<samp class="samp">once</samp>&rsquo;.
  35649. </p></dd>
  35650. </dl>
  35651. <p>The volume expression can contain the following parameters.
  35652. </p>
  35653. <dl class="table">
  35654. <dt><samp class="option">n</samp></dt>
  35655. <dd><p>frame number (starting at zero)
  35656. </p></dd>
  35657. <dt><samp class="option">nb_channels</samp></dt>
  35658. <dd><p>number of channels
  35659. </p></dd>
  35660. <dt><samp class="option">nb_consumed_samples</samp></dt>
  35661. <dd><p>number of samples consumed by the filter
  35662. </p></dd>
  35663. <dt><samp class="option">nb_samples</samp></dt>
  35664. <dd><p>number of samples in the current frame
  35665. </p></dd>
  35666. <dt><samp class="option">pos</samp></dt>
  35667. <dd><p>original frame position in the file; deprecated, do not use
  35668. </p></dd>
  35669. <dt><samp class="option">pts</samp></dt>
  35670. <dd><p>frame PTS
  35671. </p></dd>
  35672. <dt><samp class="option">sample_rate</samp></dt>
  35673. <dd><p>sample rate
  35674. </p></dd>
  35675. <dt><samp class="option">startpts</samp></dt>
  35676. <dd><p>PTS at start of stream
  35677. </p></dd>
  35678. <dt><samp class="option">startt</samp></dt>
  35679. <dd><p>time at start of stream
  35680. </p></dd>
  35681. <dt><samp class="option">t</samp></dt>
  35682. <dd><p>frame time
  35683. </p></dd>
  35684. <dt><samp class="option">tb</samp></dt>
  35685. <dd><p>timestamp timebase
  35686. </p></dd>
  35687. <dt><samp class="option">volume</samp></dt>
  35688. <dd><p>last set volume value
  35689. </p></dd>
  35690. </dl>
  35691. <p>Note that when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">once</samp>&rsquo; only the
  35692. <var class="var">sample_rate</var> and <var class="var">tb</var> variables are available, all other
  35693. variables will evaluate to NAN.
  35694. </p>
  35695. <ul class="mini-toc">
  35696. <li><a href="#Commands-53" accesskey="1">Commands</a></li>
  35697. <li><a href="#Examples-78" accesskey="2">Examples</a></li>
  35698. </ul>
  35699. <div class="subsection-level-extent" id="Commands-53">
  35700. <h4 class="subsection"><span>36.120.1 Commands<a class="copiable-link" href="#Commands-53"> &para;</a></span></h4>
  35701. <p>This filter supports the following commands:
  35702. </p><dl class="table">
  35703. <dt><samp class="option">volume</samp></dt>
  35704. <dd><p>Modify the volume expression.
  35705. The command accepts the same syntax of the corresponding option.
  35706. </p>
  35707. <p>If the specified expression is not valid, it is kept at its current
  35708. value.
  35709. </p></dd>
  35710. </dl>
  35711. </div>
  35712. <div class="subsection-level-extent" id="Examples-78">
  35713. <h4 class="subsection"><span>36.120.2 Examples<a class="copiable-link" href="#Examples-78"> &para;</a></span></h4>
  35714. <ul class="itemize mark-bullet">
  35715. <li>Halve the input audio volume:
  35716. <div class="example">
  35717. <pre class="example-preformatted">volume=volume=0.5
  35718. volume=volume=1/2
  35719. volume=volume=-6.0206dB
  35720. </pre></div>
  35721. <p>In all the above example the named key for <samp class="option">volume</samp> can be
  35722. omitted, for example like in:
  35723. </p><div class="example">
  35724. <pre class="example-preformatted">volume=0.5
  35725. </pre></div>
  35726. </li><li>Increase input audio power by 6 decibels using fixed-point precision:
  35727. <div class="example">
  35728. <pre class="example-preformatted">volume=volume=6dB:precision=fixed
  35729. </pre></div>
  35730. </li><li>Fade volume after time 10 with an annihilation period of 5 seconds:
  35731. <div class="example">
  35732. <pre class="example-preformatted">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  35733. </pre></div>
  35734. </li></ul>
  35735. </div>
  35736. </div>
  35737. <div class="section-level-extent" id="volumedetect">
  35738. <h3 class="section"><span>36.121 volumedetect<a class="copiable-link" href="#volumedetect"> &para;</a></span></h3>
  35739. <p>Detect the volume of the input video.
  35740. </p>
  35741. <p>The filter has no parameters. It supports only 16-bit signed integer samples,
  35742. so the input will be converted when needed. Statistics about the volume will
  35743. be printed in the log when the input stream end is reached.
  35744. </p>
  35745. <p>In particular it will show the mean volume (root mean square), maximum
  35746. volume (on a per-sample basis), and the beginning of a histogram of the
  35747. registered volume values (from the maximum value to a cumulated 1/1000 of
  35748. the samples).
  35749. </p>
  35750. <p>All volumes are in decibels relative to the maximum PCM value.
  35751. </p>
  35752. <ul class="mini-toc">
  35753. <li><a href="#Examples-79" accesskey="1">Examples</a></li>
  35754. </ul>
  35755. <div class="subsection-level-extent" id="Examples-79">
  35756. <h4 class="subsection"><span>36.121.1 Examples<a class="copiable-link" href="#Examples-79"> &para;</a></span></h4>
  35757. <p>Here is an excerpt of the output:
  35758. </p><div class="example">
  35759. <pre class="example-preformatted">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  35760. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  35761. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  35762. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  35763. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  35764. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  35765. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  35766. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  35767. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  35768. </pre></div>
  35769. <p>It means that:
  35770. </p><ul class="itemize mark-bullet">
  35771. <li>The mean square energy is approximately -27 dB, or 10^-2.7.
  35772. </li><li>The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  35773. </li><li>There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  35774. </li></ul>
  35775. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  35776. raising it by +5 dB causes clipping for 6 samples, etc.
  35777. </p>
  35778. </div>
  35779. </div>
  35780. </div>
  35781. <div class="chapter-level-extent" id="Audio-Sources">
  35782. <h2 class="chapter"><span>37 Audio Sources<a class="copiable-link" href="#Audio-Sources"> &para;</a></span></h2>
  35783. <p>Below is a description of the currently available audio sources.
  35784. </p>
  35785. <ul class="mini-toc">
  35786. <li><a href="#abuffer" accesskey="1">abuffer</a></li>
  35787. <li><a href="#aevalsrc" accesskey="2">aevalsrc</a></li>
  35788. <li><a href="#afdelaysrc" accesskey="3">afdelaysrc</a></li>
  35789. <li><a href="#afireqsrc" accesskey="4">afireqsrc</a></li>
  35790. <li><a href="#afirsrc" accesskey="5">afirsrc</a></li>
  35791. <li><a href="#anullsrc" accesskey="6">anullsrc</a></li>
  35792. <li><a href="#flite" accesskey="7">flite</a></li>
  35793. <li><a href="#anoisesrc" accesskey="8">anoisesrc</a></li>
  35794. <li><a href="#hilbert" accesskey="9">hilbert</a></li>
  35795. <li><a href="#sinc">sinc</a></li>
  35796. <li><a href="#sine">sine</a></li>
  35797. </ul>
  35798. <div class="section-level-extent" id="abuffer">
  35799. <h3 class="section"><span>37.1 abuffer<a class="copiable-link" href="#abuffer"> &para;</a></span></h3>
  35800. <p>Buffer audio frames, and make them available to the filter chain.
  35801. </p>
  35802. <p>This source is mainly intended for a programmatic use, in particular
  35803. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  35804. </p>
  35805. <p>It accepts the following parameters:
  35806. </p><dl class="table">
  35807. <dt><samp class="option">time_base</samp></dt>
  35808. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  35809. either a floating-point number or in <var class="var">numerator</var>/<var class="var">denominator</var> form.
  35810. </p>
  35811. </dd>
  35812. <dt><samp class="option">sample_rate</samp></dt>
  35813. <dd><p>The sample rate of the incoming audio buffers.
  35814. </p>
  35815. </dd>
  35816. <dt><samp class="option">sample_fmt</samp></dt>
  35817. <dd><p>The sample format of the incoming audio buffers.
  35818. Either a sample format name or its corresponding integer representation from
  35819. the enum AVSampleFormat in <samp class="file">libavutil/samplefmt.h</samp>
  35820. </p>
  35821. </dd>
  35822. <dt><samp class="option">channel_layout</samp></dt>
  35823. <dd><p>The channel layout of the incoming audio buffers.
  35824. Either a channel layout name from channel_layout_map in
  35825. <samp class="file">libavutil/channel_layout.c</samp> or its corresponding integer representation
  35826. from the AV_CH_LAYOUT_* macros in <samp class="file">libavutil/channel_layout.h</samp>
  35827. </p>
  35828. </dd>
  35829. <dt><samp class="option">channels</samp></dt>
  35830. <dd><p>The number of channels of the incoming audio buffers.
  35831. If both <var class="var">channels</var> and <var class="var">channel_layout</var> are specified, then they
  35832. must be consistent.
  35833. </p>
  35834. </dd>
  35835. </dl>
  35836. <ul class="mini-toc">
  35837. <li><a href="#Examples-80" accesskey="1">Examples</a></li>
  35838. </ul>
  35839. <div class="subsection-level-extent" id="Examples-80">
  35840. <h4 class="subsection"><span>37.1.1 Examples<a class="copiable-link" href="#Examples-80"> &para;</a></span></h4>
  35841. <div class="example">
  35842. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  35843. </pre></div>
  35844. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  35845. Since the sample format with name &quot;s16p&quot; corresponds to the number
  35846. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  35847. equivalent to:
  35848. </p><div class="example">
  35849. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  35850. </pre></div>
  35851. </div>
  35852. </div>
  35853. <div class="section-level-extent" id="aevalsrc">
  35854. <h3 class="section"><span>37.2 aevalsrc<a class="copiable-link" href="#aevalsrc"> &para;</a></span></h3>
  35855. <p>Generate an audio signal specified by an expression.
  35856. </p>
  35857. <p>This source accepts in input one or more expressions (one for each
  35858. channel), which are evaluated and used to generate a corresponding
  35859. audio signal.
  35860. </p>
  35861. <p>This source accepts the following options:
  35862. </p>
  35863. <dl class="table">
  35864. <dt><samp class="option">exprs</samp></dt>
  35865. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  35866. <samp class="option">channel_layout</samp> option is not specified, the selected channel layout
  35867. depends on the number of provided expressions. Otherwise the last
  35868. specified expression is applied to the remaining output channels.
  35869. </p>
  35870. </dd>
  35871. <dt><samp class="option">channel_layout, c</samp></dt>
  35872. <dd><p>Set the channel layout. The number of channels in the specified layout
  35873. must be equal to the number of specified expressions.
  35874. </p>
  35875. </dd>
  35876. <dt><samp class="option">duration, d</samp></dt>
  35877. <dd><p>Set the minimum duration of the sourced audio. See
  35878. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  35879. for the accepted syntax.
  35880. Note that the resulting duration may be greater than the specified
  35881. duration, as the generated audio is always cut at the end of a
  35882. complete frame.
  35883. </p>
  35884. <p>If not specified, or the expressed duration is negative, the audio is
  35885. supposed to be generated forever.
  35886. </p>
  35887. </dd>
  35888. <dt><samp class="option">nb_samples, n</samp></dt>
  35889. <dd><p>Set the number of samples per channel per each output frame,
  35890. default to 1024.
  35891. </p>
  35892. </dd>
  35893. <dt><samp class="option">sample_rate, s</samp></dt>
  35894. <dd><p>Specify the sample rate, default to 44100.
  35895. </p></dd>
  35896. </dl>
  35897. <p>Each expression in <var class="var">exprs</var> can contain the following constants:
  35898. </p>
  35899. <dl class="table">
  35900. <dt><samp class="option">n</samp></dt>
  35901. <dd><p>number of the evaluated sample, starting from 0
  35902. </p>
  35903. </dd>
  35904. <dt><samp class="option">t</samp></dt>
  35905. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  35906. </p>
  35907. </dd>
  35908. <dt><samp class="option">s</samp></dt>
  35909. <dd><p>sample rate
  35910. </p>
  35911. </dd>
  35912. </dl>
  35913. <ul class="mini-toc">
  35914. <li><a href="#Examples-81" accesskey="1">Examples</a></li>
  35915. </ul>
  35916. <div class="subsection-level-extent" id="Examples-81">
  35917. <h4 class="subsection"><span>37.2.1 Examples<a class="copiable-link" href="#Examples-81"> &para;</a></span></h4>
  35918. <ul class="itemize mark-bullet">
  35919. <li>Generate silence:
  35920. <div class="example">
  35921. <pre class="example-preformatted">aevalsrc=0
  35922. </pre></div>
  35923. </li><li>Generate a sin signal with frequency of 440 Hz, set sample rate to
  35924. 8000 Hz:
  35925. <div class="example">
  35926. <pre class="example-preformatted">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  35927. </pre></div>
  35928. </li><li>Generate a two channels signal, specify the channel layout (Front
  35929. Center + Back Center) explicitly:
  35930. <div class="example">
  35931. <pre class="example-preformatted">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  35932. </pre></div>
  35933. </li><li>Generate white noise:
  35934. <div class="example">
  35935. <pre class="example-preformatted">aevalsrc=&quot;-2+random(0)&quot;
  35936. </pre></div>
  35937. </li><li>Generate an amplitude modulated signal:
  35938. <div class="example">
  35939. <pre class="example-preformatted">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  35940. </pre></div>
  35941. </li><li>Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  35942. <div class="example">
  35943. <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;
  35944. </pre></div>
  35945. </li></ul>
  35946. </div>
  35947. </div>
  35948. <div class="section-level-extent" id="afdelaysrc">
  35949. <h3 class="section"><span>37.3 afdelaysrc<a class="copiable-link" href="#afdelaysrc"> &para;</a></span></h3>
  35950. <p>Generate a fractional delay FIR coefficients.
  35951. </p>
  35952. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  35953. </p>
  35954. <p>The filter accepts the following options:
  35955. </p>
  35956. <dl class="table">
  35957. <dt><samp class="option">delay, d</samp></dt>
  35958. <dd><p>Set the fractional delay. Default is 0.
  35959. </p>
  35960. </dd>
  35961. <dt><samp class="option">sample_rate, r</samp></dt>
  35962. <dd><p>Set the sample rate, default is 44100.
  35963. </p>
  35964. </dd>
  35965. <dt><samp class="option">nb_samples, n</samp></dt>
  35966. <dd><p>Set the number of samples per each frame. Default is 1024.
  35967. </p>
  35968. </dd>
  35969. <dt><samp class="option">taps, t</samp></dt>
  35970. <dd><p>Set the number of filter coefficients in output audio stream.
  35971. Default value is 0.
  35972. </p>
  35973. </dd>
  35974. <dt><samp class="option">channel_layout, c</samp></dt>
  35975. <dd><p>Specifies the channel layout, and can be a string representing a channel layout.
  35976. The default value of <var class="var">channel_layout</var> is &quot;stereo&quot;.
  35977. </p></dd>
  35978. </dl>
  35979. </div>
  35980. <div class="section-level-extent" id="afireqsrc">
  35981. <h3 class="section"><span>37.4 afireqsrc<a class="copiable-link" href="#afireqsrc"> &para;</a></span></h3>
  35982. <p>Generate a FIR equalizer coefficients.
  35983. </p>
  35984. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  35985. </p>
  35986. <p>The filter accepts the following options:
  35987. </p>
  35988. <dl class="table">
  35989. <dt><samp class="option">preset, p</samp></dt>
  35990. <dd><p>Set equalizer preset.
  35991. Default preset is <code class="code">flat</code>.
  35992. </p>
  35993. <p>Available presets are:
  35994. </p><dl class="table">
  35995. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  35996. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  35997. <dt>&lsquo;<samp class="samp">acoustic</samp>&rsquo;</dt>
  35998. <dt>&lsquo;<samp class="samp">bass</samp>&rsquo;</dt>
  35999. <dt>&lsquo;<samp class="samp">beats</samp>&rsquo;</dt>
  36000. <dt>&lsquo;<samp class="samp">classic</samp>&rsquo;</dt>
  36001. <dt>&lsquo;<samp class="samp">clear</samp>&rsquo;</dt>
  36002. <dt>&lsquo;<samp class="samp">deep bass</samp>&rsquo;</dt>
  36003. <dt>&lsquo;<samp class="samp">dubstep</samp>&rsquo;</dt>
  36004. <dt>&lsquo;<samp class="samp">electronic</samp>&rsquo;</dt>
  36005. <dt>&lsquo;<samp class="samp">hard-style</samp>&rsquo;</dt>
  36006. <dt>&lsquo;<samp class="samp">hip-hop</samp>&rsquo;</dt>
  36007. <dt>&lsquo;<samp class="samp">jazz</samp>&rsquo;</dt>
  36008. <dt>&lsquo;<samp class="samp">metal</samp>&rsquo;</dt>
  36009. <dt>&lsquo;<samp class="samp">movie</samp>&rsquo;</dt>
  36010. <dt>&lsquo;<samp class="samp">pop</samp>&rsquo;</dt>
  36011. <dt>&lsquo;<samp class="samp">r&amp;b</samp>&rsquo;</dt>
  36012. <dt>&lsquo;<samp class="samp">rock</samp>&rsquo;</dt>
  36013. <dt>&lsquo;<samp class="samp">vocal booster</samp>&rsquo;</dt>
  36014. </dl>
  36015. </dd>
  36016. <dt><samp class="option">gains, g</samp></dt>
  36017. <dd><p>Set custom gains for each band. Only used if the preset option is set to <code class="code">custom</code>.
  36018. Gains are separated by white spaces and each gain is set in dBFS.
  36019. Default is <code class="code">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</code>.
  36020. </p>
  36021. </dd>
  36022. <dt><samp class="option">bands, b</samp></dt>
  36023. <dd><p>Set the custom bands from where custon equalizer gains are set.
  36024. This must be in strictly increasing order. Only used if the preset option is set to <code class="code">custom</code>.
  36025. Bands are separated by white spaces and each band represent frequency in Hz.
  36026. Default is <code class="code">25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000</code>.
  36027. </p>
  36028. </dd>
  36029. <dt><samp class="option">taps, t</samp></dt>
  36030. <dd><p>Set number of filter coefficients in output audio stream.
  36031. Default value is <code class="code">4096</code>.
  36032. </p>
  36033. </dd>
  36034. <dt><samp class="option">sample_rate, r</samp></dt>
  36035. <dd><p>Set sample rate of output audio stream, default is <code class="code">44100</code>.
  36036. </p>
  36037. </dd>
  36038. <dt><samp class="option">nb_samples, n</samp></dt>
  36039. <dd><p>Set number of samples per each frame in output audio stream. Default is <code class="code">1024</code>.
  36040. </p>
  36041. </dd>
  36042. <dt><samp class="option">interp, i</samp></dt>
  36043. <dd><p>Set interpolation method for FIR equalizer coefficients. Can be <code class="code">linear</code> or <code class="code">cubic</code>.
  36044. </p>
  36045. </dd>
  36046. <dt><samp class="option">phase, h</samp></dt>
  36047. <dd><p>Set phase type of FIR filter. Can be <code class="code">linear</code> or <code class="code">min</code>: minimum-phase.
  36048. Default is minimum-phase filter.
  36049. </p></dd>
  36050. </dl>
  36051. </div>
  36052. <div class="section-level-extent" id="afirsrc">
  36053. <h3 class="section"><span>37.5 afirsrc<a class="copiable-link" href="#afirsrc"> &para;</a></span></h3>
  36054. <p>Generate a FIR coefficients using frequency sampling method.
  36055. </p>
  36056. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  36057. </p>
  36058. <p>The filter accepts the following options:
  36059. </p>
  36060. <dl class="table">
  36061. <dt><samp class="option">taps, t</samp></dt>
  36062. <dd><p>Set number of filter coefficients in output audio stream.
  36063. Default value is 1025.
  36064. </p>
  36065. </dd>
  36066. <dt><samp class="option">frequency, f</samp></dt>
  36067. <dd><p>Set frequency points from where magnitude and phase are set.
  36068. This must be in non decreasing order, and first element must be 0, while last element
  36069. must be 1. Elements are separated by white spaces.
  36070. </p>
  36071. </dd>
  36072. <dt><samp class="option">magnitude, m</samp></dt>
  36073. <dd><p>Set magnitude value for every frequency point set by <samp class="option">frequency</samp>.
  36074. Number of values must be same as number of frequency points.
  36075. Values are separated by white spaces.
  36076. </p>
  36077. </dd>
  36078. <dt><samp class="option">phase, p</samp></dt>
  36079. <dd><p>Set phase value for every frequency point set by <samp class="option">frequency</samp>.
  36080. Number of values must be same as number of frequency points.
  36081. Values are separated by white spaces.
  36082. </p>
  36083. </dd>
  36084. <dt><samp class="option">sample_rate, r</samp></dt>
  36085. <dd><p>Set sample rate, default is 44100.
  36086. </p>
  36087. </dd>
  36088. <dt><samp class="option">nb_samples, n</samp></dt>
  36089. <dd><p>Set number of samples per each frame. Default is 1024.
  36090. </p>
  36091. </dd>
  36092. <dt><samp class="option">win_func, w</samp></dt>
  36093. <dd><p>Set window function. Default is blackman.
  36094. </p></dd>
  36095. </dl>
  36096. </div>
  36097. <div class="section-level-extent" id="anullsrc">
  36098. <h3 class="section"><span>37.6 anullsrc<a class="copiable-link" href="#anullsrc"> &para;</a></span></h3>
  36099. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  36100. as a template and to be employed in analysis / debugging tools, or as
  36101. the source for filters which ignore the input data (for example the sox
  36102. synth filter).
  36103. </p>
  36104. <p>This source accepts the following options:
  36105. </p>
  36106. <dl class="table">
  36107. <dt><samp class="option">channel_layout, cl</samp></dt>
  36108. <dd>
  36109. <p>Specifies the channel layout, and can be either an integer or a string
  36110. representing a channel layout. The default value of <var class="var">channel_layout</var>
  36111. is &quot;stereo&quot;.
  36112. </p>
  36113. <p>Check the channel_layout_map definition in
  36114. <samp class="file">libavutil/channel_layout.c</samp> for the mapping between strings and
  36115. channel layout values.
  36116. </p>
  36117. </dd>
  36118. <dt><samp class="option">sample_rate, r</samp></dt>
  36119. <dd><p>Specifies the sample rate, and defaults to 44100.
  36120. </p>
  36121. </dd>
  36122. <dt><samp class="option">nb_samples, n</samp></dt>
  36123. <dd><p>Set the number of samples per requested frames.
  36124. </p>
  36125. </dd>
  36126. <dt><samp class="option">duration, d</samp></dt>
  36127. <dd><p>Set the duration of the sourced audio. See
  36128. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  36129. for the accepted syntax.
  36130. </p>
  36131. <p>If not specified, or the expressed duration is negative, the audio is
  36132. supposed to be generated forever.
  36133. </p></dd>
  36134. </dl>
  36135. <ul class="mini-toc">
  36136. <li><a href="#Examples-82" accesskey="1">Examples</a></li>
  36137. </ul>
  36138. <div class="subsection-level-extent" id="Examples-82">
  36139. <h4 class="subsection"><span>37.6.1 Examples<a class="copiable-link" href="#Examples-82"> &para;</a></span></h4>
  36140. <ul class="itemize mark-bullet">
  36141. <li>Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  36142. <div class="example">
  36143. <pre class="example-preformatted">anullsrc=r=48000:cl=4
  36144. </pre></div>
  36145. </li><li>Do the same operation with a more obvious syntax:
  36146. <div class="example">
  36147. <pre class="example-preformatted">anullsrc=r=48000:cl=mono
  36148. </pre></div>
  36149. </li></ul>
  36150. <p>All the parameters need to be explicitly defined.
  36151. </p>
  36152. </div>
  36153. </div>
  36154. <div class="section-level-extent" id="flite">
  36155. <h3 class="section"><span>37.7 flite<a class="copiable-link" href="#flite"> &para;</a></span></h3>
  36156. <p>Synthesize a voice utterance using the libflite library.
  36157. </p>
  36158. <p>To enable compilation of this filter you need to configure FFmpeg with
  36159. <code class="code">--enable-libflite</code>.
  36160. </p>
  36161. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  36162. </p>
  36163. <p>The filter accepts the following options:
  36164. </p>
  36165. <dl class="table">
  36166. <dt><samp class="option">list_voices</samp></dt>
  36167. <dd><p>If set to 1, list the names of the available voices and exit
  36168. immediately. Default value is 0.
  36169. </p>
  36170. </dd>
  36171. <dt><samp class="option">nb_samples, n</samp></dt>
  36172. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  36173. </p>
  36174. </dd>
  36175. <dt><samp class="option">textfile</samp></dt>
  36176. <dd><p>Set the filename containing the text to speak.
  36177. </p>
  36178. </dd>
  36179. <dt><samp class="option">text</samp></dt>
  36180. <dd><p>Set the text to speak.
  36181. </p>
  36182. </dd>
  36183. <dt><samp class="option">voice, v</samp></dt>
  36184. <dd><p>Set the voice to use for the speech synthesis. Default value is
  36185. <code class="code">kal</code>. See also the <var class="var">list_voices</var> option.
  36186. </p></dd>
  36187. </dl>
  36188. <ul class="mini-toc">
  36189. <li><a href="#Examples-83" accesskey="1">Examples</a></li>
  36190. </ul>
  36191. <div class="subsection-level-extent" id="Examples-83">
  36192. <h4 class="subsection"><span>37.7.1 Examples<a class="copiable-link" href="#Examples-83"> &para;</a></span></h4>
  36193. <ul class="itemize mark-bullet">
  36194. <li>Read from file <samp class="file">speech.txt</samp>, and synthesize the text using the
  36195. standard flite voice:
  36196. <div class="example">
  36197. <pre class="example-preformatted">flite=textfile=speech.txt
  36198. </pre></div>
  36199. </li><li>Read the specified text selecting the <code class="code">slt</code> voice:
  36200. <div class="example">
  36201. <pre class="example-preformatted">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  36202. </pre></div>
  36203. </li><li>Input text to ffmpeg:
  36204. <div class="example">
  36205. <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
  36206. </pre></div>
  36207. </li><li>Make <samp class="file">ffplay</samp> speak the specified text, using <code class="code">flite</code> and
  36208. the <code class="code">lavfi</code> device:
  36209. <div class="example">
  36210. <pre class="example-preformatted">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  36211. </pre></div>
  36212. </li></ul>
  36213. <p>For more information about libflite, check:
  36214. <a class="url" href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  36215. </p>
  36216. </div>
  36217. </div>
  36218. <div class="section-level-extent" id="anoisesrc">
  36219. <h3 class="section"><span>37.8 anoisesrc<a class="copiable-link" href="#anoisesrc"> &para;</a></span></h3>
  36220. <p>Generate a noise audio signal.
  36221. </p>
  36222. <p>The filter accepts the following options:
  36223. </p>
  36224. <dl class="table">
  36225. <dt><samp class="option">sample_rate, r</samp></dt>
  36226. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  36227. </p>
  36228. </dd>
  36229. <dt><samp class="option">amplitude, a</samp></dt>
  36230. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  36231. is 1.0.
  36232. </p>
  36233. </dd>
  36234. <dt><samp class="option">duration, d</samp></dt>
  36235. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  36236. results in noise with an infinite length.
  36237. </p>
  36238. </dd>
  36239. <dt><samp class="option">color, colour, c</samp></dt>
  36240. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  36241. blue, violet and velvet. Default color is white.
  36242. </p>
  36243. </dd>
  36244. <dt><samp class="option">seed, s</samp></dt>
  36245. <dd><p>Specify a value used to seed the PRNG.
  36246. </p>
  36247. </dd>
  36248. <dt><samp class="option">nb_samples, n</samp></dt>
  36249. <dd><p>Set the number of samples per each output frame, default is 1024.
  36250. </p>
  36251. </dd>
  36252. <dt><samp class="option">density</samp></dt>
  36253. <dd><p>Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05.
  36254. </p></dd>
  36255. </dl>
  36256. <ul class="mini-toc">
  36257. <li><a href="#Examples-84" accesskey="1">Examples</a></li>
  36258. </ul>
  36259. <div class="subsection-level-extent" id="Examples-84">
  36260. <h4 class="subsection"><span>37.8.1 Examples<a class="copiable-link" href="#Examples-84"> &para;</a></span></h4>
  36261. <ul class="itemize mark-bullet">
  36262. <li>Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  36263. <div class="example">
  36264. <pre class="example-preformatted">anoisesrc=d=60:c=pink:r=44100:a=0.5
  36265. </pre></div>
  36266. </li></ul>
  36267. </div>
  36268. </div>
  36269. <div class="section-level-extent" id="hilbert">
  36270. <h3 class="section"><span>37.9 hilbert<a class="copiable-link" href="#hilbert"> &para;</a></span></h3>
  36271. <p>Generate odd-tap Hilbert transform FIR coefficients.
  36272. </p>
  36273. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for phase-shifting
  36274. the signal by 90 degrees.
  36275. </p>
  36276. <p>This is used in many matrix coding schemes and for analytic signal generation.
  36277. The process is often written as a multiplication by i (or j), the imaginary unit.
  36278. </p>
  36279. <p>The filter accepts the following options:
  36280. </p>
  36281. <dl class="table">
  36282. <dt><samp class="option">sample_rate, s</samp></dt>
  36283. <dd><p>Set sample rate, default is 44100.
  36284. </p>
  36285. </dd>
  36286. <dt><samp class="option">taps, t</samp></dt>
  36287. <dd><p>Set length of FIR filter, default is 22051.
  36288. </p>
  36289. </dd>
  36290. <dt><samp class="option">nb_samples, n</samp></dt>
  36291. <dd><p>Set number of samples per each frame.
  36292. </p>
  36293. </dd>
  36294. <dt><samp class="option">win_func, w</samp></dt>
  36295. <dd><p>Set window function to be used when generating FIR coefficients.
  36296. </p></dd>
  36297. </dl>
  36298. </div>
  36299. <div class="section-level-extent" id="sinc">
  36300. <h3 class="section"><span>37.10 sinc<a class="copiable-link" href="#sinc"> &para;</a></span></h3>
  36301. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  36302. </p>
  36303. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  36304. </p>
  36305. <p>The filter accepts the following options:
  36306. </p>
  36307. <dl class="table">
  36308. <dt><samp class="option">sample_rate, r</samp></dt>
  36309. <dd><p>Set sample rate, default is 44100.
  36310. </p>
  36311. </dd>
  36312. <dt><samp class="option">nb_samples, n</samp></dt>
  36313. <dd><p>Set number of samples per each frame. Default is 1024.
  36314. </p>
  36315. </dd>
  36316. <dt><samp class="option">hp</samp></dt>
  36317. <dd><p>Set high-pass frequency. Default is 0.
  36318. </p>
  36319. </dd>
  36320. <dt><samp class="option">lp</samp></dt>
  36321. <dd><p>Set low-pass frequency. Default is 0.
  36322. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  36323. is higher than 0 then filter will create band-pass filter coefficients,
  36324. otherwise band-reject filter coefficients.
  36325. </p>
  36326. </dd>
  36327. <dt><samp class="option">phase</samp></dt>
  36328. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  36329. </p>
  36330. </dd>
  36331. <dt><samp class="option">beta</samp></dt>
  36332. <dd><p>Set Kaiser window beta.
  36333. </p>
  36334. </dd>
  36335. <dt><samp class="option">att</samp></dt>
  36336. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  36337. </p>
  36338. </dd>
  36339. <dt><samp class="option">round</samp></dt>
  36340. <dd><p>Enable rounding, by default is disabled.
  36341. </p>
  36342. </dd>
  36343. <dt><samp class="option">hptaps</samp></dt>
  36344. <dd><p>Set number of taps for high-pass filter.
  36345. </p>
  36346. </dd>
  36347. <dt><samp class="option">lptaps</samp></dt>
  36348. <dd><p>Set number of taps for low-pass filter.
  36349. </p></dd>
  36350. </dl>
  36351. </div>
  36352. <div class="section-level-extent" id="sine">
  36353. <h3 class="section"><span>37.11 sine<a class="copiable-link" href="#sine"> &para;</a></span></h3>
  36354. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  36355. </p>
  36356. <p>The audio signal is bit-exact.
  36357. </p>
  36358. <p>The filter accepts the following options:
  36359. </p>
  36360. <dl class="table">
  36361. <dt><samp class="option">frequency, f</samp></dt>
  36362. <dd><p>Set the carrier frequency. Default is 440 Hz.
  36363. </p>
  36364. </dd>
  36365. <dt><samp class="option">beep_factor, b</samp></dt>
  36366. <dd><p>Enable a periodic beep every second with frequency <var class="var">beep_factor</var> times
  36367. the carrier frequency. Default is 0, meaning the beep is disabled.
  36368. </p>
  36369. </dd>
  36370. <dt><samp class="option">sample_rate, r</samp></dt>
  36371. <dd><p>Specify the sample rate, default is 44100.
  36372. </p>
  36373. </dd>
  36374. <dt><samp class="option">duration, d</samp></dt>
  36375. <dd><p>Specify the duration of the generated audio stream.
  36376. </p>
  36377. </dd>
  36378. <dt><samp class="option">samples_per_frame</samp></dt>
  36379. <dd><p>Set the number of samples per output frame.
  36380. </p>
  36381. <p>The expression can contain the following constants:
  36382. </p>
  36383. <dl class="table">
  36384. <dt><samp class="option">n</samp></dt>
  36385. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  36386. </p>
  36387. </dd>
  36388. <dt><samp class="option">pts</samp></dt>
  36389. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  36390. expressed in <var class="var">TB</var> units.
  36391. </p>
  36392. </dd>
  36393. <dt><samp class="option">t</samp></dt>
  36394. <dd><p>The PTS of the output audio frame, expressed in seconds.
  36395. </p>
  36396. </dd>
  36397. <dt><samp class="option">TB</samp></dt>
  36398. <dd><p>The timebase of the output audio frames.
  36399. </p></dd>
  36400. </dl>
  36401. <p>Default is <code class="code">1024</code>.
  36402. </p></dd>
  36403. </dl>
  36404. <ul class="mini-toc">
  36405. <li><a href="#Examples-85" accesskey="1">Examples</a></li>
  36406. </ul>
  36407. <div class="subsection-level-extent" id="Examples-85">
  36408. <h4 class="subsection"><span>37.11.1 Examples<a class="copiable-link" href="#Examples-85"> &para;</a></span></h4>
  36409. <ul class="itemize mark-bullet">
  36410. <li>Generate a simple 440 Hz sine wave:
  36411. <div class="example">
  36412. <pre class="example-preformatted">sine
  36413. </pre></div>
  36414. </li><li>Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  36415. <div class="example">
  36416. <pre class="example-preformatted">sine=220:4:d=5
  36417. sine=f=220:b=4:d=5
  36418. sine=frequency=220:beep_factor=4:duration=5
  36419. </pre></div>
  36420. </li><li>Generate a 1 kHz sine wave following <code class="code">1602,1601,1602,1601,1602</code> NTSC
  36421. pattern:
  36422. <div class="example">
  36423. <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)))'
  36424. </pre></div>
  36425. </li></ul>
  36426. </div>
  36427. </div>
  36428. </div>
  36429. <div class="chapter-level-extent" id="Audio-Sinks">
  36430. <h2 class="chapter"><span>38 Audio Sinks<a class="copiable-link" href="#Audio-Sinks"> &para;</a></span></h2>
  36431. <p>Below is a description of the currently available audio sinks.
  36432. </p>
  36433. <ul class="mini-toc">
  36434. <li><a href="#abuffersink" accesskey="1">abuffersink</a></li>
  36435. <li><a href="#anullsink" accesskey="2">anullsink</a></li>
  36436. </ul>
  36437. <div class="section-level-extent" id="abuffersink">
  36438. <h3 class="section"><span>38.1 abuffersink<a class="copiable-link" href="#abuffersink"> &para;</a></span></h3>
  36439. <p>Buffer audio frames, and make them available to the end of filter chain.
  36440. </p>
  36441. <p>This sink is mainly intended for programmatic use, in particular
  36442. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  36443. or the options system.
  36444. </p>
  36445. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  36446. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  36447. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  36448. </p></div>
  36449. <div class="section-level-extent" id="anullsink">
  36450. <h3 class="section"><span>38.2 anullsink<a class="copiable-link" href="#anullsink"> &para;</a></span></h3>
  36451. <p>Null audio sink; do absolutely nothing with the input audio. It is
  36452. mainly useful as a template and for use in analysis / debugging
  36453. tools.
  36454. </p>
  36455. </div>
  36456. </div>
  36457. <div class="chapter-level-extent" id="Video-Filters">
  36458. <h2 class="chapter"><span>39 Video Filters<a class="copiable-link" href="#Video-Filters"> &para;</a></span></h2>
  36459. <p>When you configure your FFmpeg build, you can disable any of the
  36460. existing filters using <code class="code">--disable-filters</code>.
  36461. The configure output will show the video filters included in your
  36462. build.
  36463. </p>
  36464. <p>Below is a description of the currently available video filters.
  36465. </p>
  36466. <ul class="mini-toc">
  36467. <li><a href="#addroi" accesskey="1">addroi</a></li>
  36468. <li><a href="#alphaextract" accesskey="2">alphaextract</a></li>
  36469. <li><a href="#alphamerge" accesskey="3">alphamerge</a></li>
  36470. <li><a href="#amplify" accesskey="4">amplify</a></li>
  36471. <li><a href="#ass-1" accesskey="5">ass</a></li>
  36472. <li><a href="#atadenoise" accesskey="6">atadenoise</a></li>
  36473. <li><a href="#avgblur" accesskey="7">avgblur</a></li>
  36474. <li><a href="#backgroundkey" accesskey="8">backgroundkey</a></li>
  36475. <li><a href="#bbox" accesskey="9">bbox</a></li>
  36476. <li><a href="#bilateral">bilateral</a></li>
  36477. <li><a href="#bilateral_005fcuda">bilateral_cuda</a></li>
  36478. <li><a href="#bitplanenoise">bitplanenoise</a></li>
  36479. <li><a href="#blackdetect">blackdetect</a></li>
  36480. <li><a href="#blackframe">blackframe</a></li>
  36481. <li><a href="#blend-1">blend</a></li>
  36482. <li><a href="#blockdetect-1">blockdetect</a></li>
  36483. <li><a href="#blurdetect-1">blurdetect</a></li>
  36484. <li><a href="#bm3d">bm3d</a></li>
  36485. <li><a href="#boxblur">boxblur</a></li>
  36486. <li><a href="#bwdif-1">bwdif</a></li>
  36487. <li><a href="#bwdif_005fcuda">bwdif_cuda</a></li>
  36488. <li><a href="#ccrepack">ccrepack</a></li>
  36489. <li><a href="#cas">cas</a></li>
  36490. <li><a href="#chromahold">chromahold</a></li>
  36491. <li><a href="#chromakey-1">chromakey</a></li>
  36492. <li><a href="#chromakey_005fcuda">chromakey_cuda</a></li>
  36493. <li><a href="#chromanr">chromanr</a></li>
  36494. <li><a href="#chromashift">chromashift</a></li>
  36495. <li><a href="#ciescope">ciescope</a></li>
  36496. <li><a href="#codecview">codecview</a></li>
  36497. <li><a href="#colorbalance">colorbalance</a></li>
  36498. <li><a href="#colorcontrast">colorcontrast</a></li>
  36499. <li><a href="#colorcorrect">colorcorrect</a></li>
  36500. <li><a href="#colorchannelmixer">colorchannelmixer</a></li>
  36501. <li><a href="#colorize">colorize</a></li>
  36502. <li><a href="#colorkey">colorkey</a></li>
  36503. <li><a href="#colorhold">colorhold</a></li>
  36504. <li><a href="#colorlevels">colorlevels</a></li>
  36505. <li><a href="#colormap">colormap</a></li>
  36506. <li><a href="#colormatrix">colormatrix</a></li>
  36507. <li><a href="#colorspace">colorspace</a></li>
  36508. <li><a href="#colorspace_005fcuda">colorspace_cuda</a></li>
  36509. <li><a href="#colortemperature">colortemperature</a></li>
  36510. <li><a href="#convolution">convolution</a></li>
  36511. <li><a href="#convolve">convolve</a></li>
  36512. <li><a href="#copy">copy</a></li>
  36513. <li><a href="#coreimage-1">coreimage</a></li>
  36514. <li><a href="#corr">corr</a></li>
  36515. <li><a href="#cover_005frect">cover_rect</a></li>
  36516. <li><a href="#crop">crop</a></li>
  36517. <li><a href="#cropdetect">cropdetect</a></li>
  36518. <li><a href="#cue-1">cue</a></li>
  36519. <li><a href="#curves-1">curves</a></li>
  36520. <li><a href="#datascope">datascope</a></li>
  36521. <li><a href="#dblur">dblur</a></li>
  36522. <li><a href="#dctdnoiz">dctdnoiz</a></li>
  36523. <li><a href="#deband">deband</a></li>
  36524. <li><a href="#deblock">deblock</a></li>
  36525. <li><a href="#decimate-1">decimate</a></li>
  36526. <li><a href="#deconvolve">deconvolve</a></li>
  36527. <li><a href="#dedot">dedot</a></li>
  36528. <li><a href="#deflate">deflate</a></li>
  36529. <li><a href="#deflicker">deflicker</a></li>
  36530. <li><a href="#dejudder">dejudder</a></li>
  36531. <li><a href="#delogo">delogo</a></li>
  36532. <li><a href="#derain-1">derain</a></li>
  36533. <li><a href="#deshake">deshake</a></li>
  36534. <li><a href="#despill">despill</a></li>
  36535. <li><a href="#detelecine">detelecine</a></li>
  36536. <li><a href="#dilation-1">dilation</a></li>
  36537. <li><a href="#displace">displace</a></li>
  36538. <li><a href="#dnn_005fclassify">dnn_classify</a></li>
  36539. <li><a href="#dnn_005fdetect">dnn_detect</a></li>
  36540. <li><a href="#dnn_005fprocessing-1">dnn_processing</a></li>
  36541. <li><a href="#drawbox">drawbox</a></li>
  36542. <li><a href="#drawgraph-1">drawgraph</a></li>
  36543. <li><a href="#drawgrid">drawgrid</a></li>
  36544. <li><a href="#drawtext-1">drawtext</a></li>
  36545. <li><a href="#edgedetect">edgedetect</a></li>
  36546. <li><a href="#elbg">elbg</a></li>
  36547. <li><a href="#entropy">entropy</a></li>
  36548. <li><a href="#epx">epx</a></li>
  36549. <li><a href="#eq">eq</a></li>
  36550. <li><a href="#erosion-1">erosion</a></li>
  36551. <li><a href="#estdif">estdif</a></li>
  36552. <li><a href="#exposure">exposure</a></li>
  36553. <li><a href="#extractplanes">extractplanes</a></li>
  36554. <li><a href="#fade">fade</a></li>
  36555. <li><a href="#feedback">feedback</a></li>
  36556. <li><a href="#fftdnoiz">fftdnoiz</a></li>
  36557. <li><a href="#fftfilt">fftfilt</a></li>
  36558. <li><a href="#field">field</a></li>
  36559. <li><a href="#fieldhint">fieldhint</a></li>
  36560. <li><a href="#fieldmatch">fieldmatch</a></li>
  36561. <li><a href="#fieldorder">fieldorder</a></li>
  36562. <li><a href="#fillborders">fillborders</a></li>
  36563. <li><a href="#find_005frect">find_rect</a></li>
  36564. <li><a href="#floodfill">floodfill</a></li>
  36565. <li><a href="#format-1">format</a></li>
  36566. <li><a href="#fps-1">fps</a></li>
  36567. <li><a href="#framepack">framepack</a></li>
  36568. <li><a href="#framerate">framerate</a></li>
  36569. <li><a href="#framestep">framestep</a></li>
  36570. <li><a href="#freezedetect">freezedetect</a></li>
  36571. <li><a href="#freezeframes">freezeframes</a></li>
  36572. <li><a href="#frei0r-1">frei0r</a></li>
  36573. <li><a href="#fspp">fspp</a></li>
  36574. <li><a href="#fsync-1">fsync</a></li>
  36575. <li><a href="#gblur">gblur</a></li>
  36576. <li><a href="#geq">geq</a></li>
  36577. <li><a href="#gradfun">gradfun</a></li>
  36578. <li><a href="#graphmonitor-1">graphmonitor</a></li>
  36579. <li><a href="#grayworld">grayworld</a></li>
  36580. <li><a href="#greyedge">greyedge</a></li>
  36581. <li><a href="#guided">guided</a></li>
  36582. <li><a href="#haldclut-1">haldclut</a></li>
  36583. <li><a href="#hflip">hflip</a></li>
  36584. <li><a href="#histeq">histeq</a></li>
  36585. <li><a href="#histogram-1">histogram</a></li>
  36586. <li><a href="#hqdn3d-1">hqdn3d</a></li>
  36587. <li><a href="#hwdownload-1">hwdownload</a></li>
  36588. <li><a href="#hwmap">hwmap</a></li>
  36589. <li><a href="#hwupload-1">hwupload</a></li>
  36590. <li><a href="#hwupload_005fcuda-1">hwupload_cuda</a></li>
  36591. <li><a href="#hqx">hqx</a></li>
  36592. <li><a href="#hstack-1">hstack</a></li>
  36593. <li><a href="#hsvhold">hsvhold</a></li>
  36594. <li><a href="#hsvkey">hsvkey</a></li>
  36595. <li><a href="#hue">hue</a></li>
  36596. <li><a href="#huesaturation">huesaturation</a></li>
  36597. <li><a href="#hysteresis">hysteresis</a></li>
  36598. <li><a href="#iccdetect">iccdetect</a></li>
  36599. <li><a href="#iccgen">iccgen</a></li>
  36600. <li><a href="#identity">identity</a></li>
  36601. <li><a href="#idet">idet</a></li>
  36602. <li><a href="#il">il</a></li>
  36603. <li><a href="#inflate">inflate</a></li>
  36604. <li><a href="#interlace">interlace</a></li>
  36605. <li><a href="#kerndeint">kerndeint</a></li>
  36606. <li><a href="#kirsch">kirsch</a></li>
  36607. <li><a href="#lagfun">lagfun</a></li>
  36608. <li><a href="#lenscorrection">lenscorrection</a></li>
  36609. <li><a href="#lensfun">lensfun</a></li>
  36610. <li><a href="#libplacebo">libplacebo</a></li>
  36611. <li><a href="#libvmaf-1">libvmaf</a></li>
  36612. <li><a href="#libvmaf_005fcuda">libvmaf_cuda</a></li>
  36613. <li><a href="#limitdiff">limitdiff</a></li>
  36614. <li><a href="#limiter">limiter</a></li>
  36615. <li><a href="#loop">loop</a></li>
  36616. <li><a href="#lut1d">lut1d</a></li>
  36617. <li><a href="#lut3d-1">lut3d</a></li>
  36618. <li><a href="#lumakey">lumakey</a></li>
  36619. <li><a href="#lut_002c-lutrgb_002c-lutyuv">lut, lutrgb, lutyuv</a></li>
  36620. <li><a href="#lut2_002c-tlut2">lut2, tlut2</a></li>
  36621. <li><a href="#maskedclamp">maskedclamp</a></li>
  36622. <li><a href="#maskedmax">maskedmax</a></li>
  36623. <li><a href="#maskedmerge">maskedmerge</a></li>
  36624. <li><a href="#maskedmin">maskedmin</a></li>
  36625. <li><a href="#maskedthreshold">maskedthreshold</a></li>
  36626. <li><a href="#maskfun">maskfun</a></li>
  36627. <li><a href="#mcdeint">mcdeint</a></li>
  36628. <li><a href="#median">median</a></li>
  36629. <li><a href="#mergeplanes">mergeplanes</a></li>
  36630. <li><a href="#mestimate">mestimate</a></li>
  36631. <li><a href="#midequalizer">midequalizer</a></li>
  36632. <li><a href="#minterpolate">minterpolate</a></li>
  36633. <li><a href="#mix">mix</a></li>
  36634. <li><a href="#monochrome">monochrome</a></li>
  36635. <li><a href="#morpho">morpho</a></li>
  36636. <li><a href="#mpdecimate">mpdecimate</a></li>
  36637. <li><a href="#msad">msad</a></li>
  36638. <li><a href="#multiply">multiply</a></li>
  36639. <li><a href="#negate">negate</a></li>
  36640. <li><a href="#nlmeans-1">nlmeans</a></li>
  36641. <li><a href="#nnedi">nnedi</a></li>
  36642. <li><a href="#noformat">noformat</a></li>
  36643. <li><a href="#noise-1">noise</a></li>
  36644. <li><a href="#normalize">normalize</a></li>
  36645. <li><a href="#null-2">null</a></li>
  36646. <li><a href="#ocr">ocr</a></li>
  36647. <li><a href="#ocv">ocv</a></li>
  36648. <li><a href="#oscilloscope">oscilloscope</a></li>
  36649. <li><a href="#overlay-1">overlay</a></li>
  36650. <li><a href="#overlay_005fcuda-1">overlay_cuda</a></li>
  36651. <li><a href="#owdenoise">owdenoise</a></li>
  36652. <li><a href="#pad-1">pad</a></li>
  36653. <li><a href="#palettegen-1">palettegen</a></li>
  36654. <li><a href="#paletteuse">paletteuse</a></li>
  36655. <li><a href="#perspective">perspective</a></li>
  36656. <li><a href="#phase">phase</a></li>
  36657. <li><a href="#photosensitivity">photosensitivity</a></li>
  36658. <li><a href="#pixdesctest">pixdesctest</a></li>
  36659. <li><a href="#pixelize">pixelize</a></li>
  36660. <li><a href="#pixscope">pixscope</a></li>
  36661. <li><a href="#pp">pp</a></li>
  36662. <li><a href="#pp7">pp7</a></li>
  36663. <li><a href="#premultiply">premultiply</a></li>
  36664. <li><a href="#prewitt">prewitt</a></li>
  36665. <li><a href="#pseudocolor">pseudocolor</a></li>
  36666. <li><a href="#psnr">psnr</a></li>
  36667. <li><a href="#pullup-1">pullup</a></li>
  36668. <li><a href="#qp">qp</a></li>
  36669. <li><a href="#qrencode">qrencode</a></li>
  36670. <li><a href="#quirc">quirc</a></li>
  36671. <li><a href="#random">random</a></li>
  36672. <li><a href="#readeia608">readeia608</a></li>
  36673. <li><a href="#readvitc">readvitc</a></li>
  36674. <li><a href="#remap">remap</a></li>
  36675. <li><a href="#removegrain">removegrain</a></li>
  36676. <li><a href="#removelogo">removelogo</a></li>
  36677. <li><a href="#repeatfields">repeatfields</a></li>
  36678. <li><a href="#reverse">reverse</a></li>
  36679. <li><a href="#rgbashift">rgbashift</a></li>
  36680. <li><a href="#roberts">roberts</a></li>
  36681. <li><a href="#rotate">rotate</a></li>
  36682. <li><a href="#sab">sab</a></li>
  36683. <li><a href="#scale-1">scale</a></li>
  36684. <li><a href="#scale_005fcuda-1">scale_cuda</a></li>
  36685. <li><a href="#scale_005fnpp-1">scale_npp</a></li>
  36686. <li><a href="#scale2ref">scale2ref</a></li>
  36687. <li><a href="#scale2ref_005fnpp">scale2ref_npp</a></li>
  36688. <li><a href="#scale_005fvt">scale_vt</a></li>
  36689. <li><a href="#scharr">scharr</a></li>
  36690. <li><a href="#scroll">scroll</a></li>
  36691. <li><a href="#scdet-1">scdet</a></li>
  36692. <li><a href="#selectivecolor-1">selectivecolor</a></li>
  36693. <li><a href="#separatefields-1">separatefields</a></li>
  36694. <li><a href="#setdar_002c-setsar">setdar, setsar</a></li>
  36695. <li><a href="#setfield-1">setfield</a></li>
  36696. <li><a href="#setparams-1">setparams</a></li>
  36697. <li><a href="#sharpen_005fnpp">sharpen_npp</a></li>
  36698. <li><a href="#shear">shear</a></li>
  36699. <li><a href="#showinfo-1">showinfo</a></li>
  36700. <li><a href="#showpalette">showpalette</a></li>
  36701. <li><a href="#shuffleframes">shuffleframes</a></li>
  36702. <li><a href="#shufflepixels">shufflepixels</a></li>
  36703. <li><a href="#shuffleplanes">shuffleplanes</a></li>
  36704. <li><a href="#signalstats-1">signalstats</a></li>
  36705. <li><a href="#signature-1">signature</a></li>
  36706. <li><a href="#siti-1">siti</a></li>
  36707. <li><a href="#smartblur-1">smartblur</a></li>
  36708. <li><a href="#sobel">sobel</a></li>
  36709. <li><a href="#spp-1">spp</a></li>
  36710. <li><a href="#sr-1">sr</a></li>
  36711. <li><a href="#ssim">ssim</a></li>
  36712. <li><a href="#stereo3d">stereo3d</a></li>
  36713. <li><a href="#streamselect_002c-astreamselect">streamselect, astreamselect</a></li>
  36714. <li><a href="#subtitles-1">subtitles</a></li>
  36715. <li><a href="#super2xsai">super2xsai</a></li>
  36716. <li><a href="#swaprect">swaprect</a></li>
  36717. <li><a href="#swapuv">swapuv</a></li>
  36718. <li><a href="#tblend">tblend</a></li>
  36719. <li><a href="#telecine">telecine</a></li>
  36720. <li><a href="#thistogram">thistogram</a></li>
  36721. <li><a href="#threshold">threshold</a></li>
  36722. <li><a href="#thumbnail">thumbnail</a></li>
  36723. <li><a href="#tile-1">tile</a></li>
  36724. <li><a href="#tiltandshift">tiltandshift</a></li>
  36725. <li><a href="#tinterlace">tinterlace</a></li>
  36726. <li><a href="#tmedian">tmedian</a></li>
  36727. <li><a href="#tmidequalizer">tmidequalizer</a></li>
  36728. <li><a href="#tmix">tmix</a></li>
  36729. <li><a href="#tonemap-1">tonemap</a></li>
  36730. <li><a href="#tpad">tpad</a></li>
  36731. <li><a href="#transpose-1">transpose</a></li>
  36732. <li><a href="#transpose_005fnpp">transpose_npp</a></li>
  36733. <li><a href="#trim">trim</a></li>
  36734. <li><a href="#unpremultiply">unpremultiply</a></li>
  36735. <li><a href="#unsharp-1">unsharp</a></li>
  36736. <li><a href="#untile-1">untile</a></li>
  36737. <li><a href="#uspp">uspp</a></li>
  36738. <li><a href="#v360">v360</a></li>
  36739. <li><a href="#vaguedenoiser">vaguedenoiser</a></li>
  36740. <li><a href="#varblur">varblur</a></li>
  36741. <li><a href="#vectorscope">vectorscope</a></li>
  36742. <li><a href="#vidstabdetect-1">vidstabdetect</a></li>
  36743. <li><a href="#vidstabtransform-1">vidstabtransform</a></li>
  36744. <li><a href="#vflip">vflip</a></li>
  36745. <li><a href="#vfrdet">vfrdet</a></li>
  36746. <li><a href="#vibrance">vibrance</a></li>
  36747. <li><a href="#vif">vif</a></li>
  36748. <li><a href="#vignette-1">vignette</a></li>
  36749. <li><a href="#vmafmotion">vmafmotion</a></li>
  36750. <li><a href="#vstack-1">vstack</a></li>
  36751. <li><a href="#w3fdif">w3fdif</a></li>
  36752. <li><a href="#waveform">waveform</a></li>
  36753. <li><a href="#weave_002c-doubleweave">weave, doubleweave</a></li>
  36754. <li><a href="#xbr">xbr</a></li>
  36755. <li><a href="#xcorrelate">xcorrelate</a></li>
  36756. <li><a href="#xfade">xfade</a></li>
  36757. <li><a href="#xmedian">xmedian</a></li>
  36758. <li><a href="#xstack-1">xstack</a></li>
  36759. <li><a href="#yadif-1">yadif</a></li>
  36760. <li><a href="#yadif_005fcuda">yadif_cuda</a></li>
  36761. <li><a href="#yaepblur">yaepblur</a></li>
  36762. <li><a href="#zoompan">zoompan</a></li>
  36763. <li><a href="#zscale-1">zscale</a></li>
  36764. </ul>
  36765. <div class="section-level-extent" id="addroi">
  36766. <h3 class="section"><span>39.1 addroi<a class="copiable-link" href="#addroi"> &para;</a></span></h3>
  36767. <p>Mark a region of interest in a video frame.
  36768. </p>
  36769. <p>The frame data is passed through unchanged, but metadata is attached
  36770. to the frame indicating regions of interest which can affect the
  36771. behaviour of later encoding. Multiple regions can be marked by
  36772. applying the filter multiple times.
  36773. </p>
  36774. <dl class="table">
  36775. <dt><samp class="option">x</samp></dt>
  36776. <dd><p>Region distance in pixels from the left edge of the frame.
  36777. </p></dd>
  36778. <dt><samp class="option">y</samp></dt>
  36779. <dd><p>Region distance in pixels from the top edge of the frame.
  36780. </p></dd>
  36781. <dt><samp class="option">w</samp></dt>
  36782. <dd><p>Region width in pixels.
  36783. </p></dd>
  36784. <dt><samp class="option">h</samp></dt>
  36785. <dd><p>Region height in pixels.
  36786. </p>
  36787. <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,
  36788. and may contain the following variables:
  36789. </p><dl class="table">
  36790. <dt><samp class="option">iw</samp></dt>
  36791. <dd><p>Width of the input frame.
  36792. </p></dd>
  36793. <dt><samp class="option">ih</samp></dt>
  36794. <dd><p>Height of the input frame.
  36795. </p></dd>
  36796. </dl>
  36797. </dd>
  36798. <dt><samp class="option">qoffset</samp></dt>
  36799. <dd><p>Quantisation offset to apply within the region.
  36800. </p>
  36801. <p>This must be a real value in the range -1 to +1. A value of zero
  36802. indicates no quality change. A negative value asks for better quality
  36803. (less quantisation), while a positive value asks for worse quality
  36804. (greater quantisation).
  36805. </p>
  36806. <p>The range is calibrated so that the extreme values indicate the
  36807. largest possible offset - if the rest of the frame is encoded with the
  36808. worst possible quality, an offset of -1 indicates that this region
  36809. should be encoded with the best possible quality anyway. Intermediate
  36810. values are then interpolated in some codec-dependent way.
  36811. </p>
  36812. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  36813. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  36814. this region should be encoded with a QP around one-tenth of the full
  36815. range better than the rest of the frame. So, if most of the frame
  36816. were to be encoded with a QP of around 30, this region would get a QP
  36817. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  36818. An extreme value of -1 would indicate that this region should be
  36819. encoded with the best possible quality regardless of the treatment of
  36820. the rest of the frame - that is, should be encoded at a QP of -12.
  36821. </p></dd>
  36822. <dt><samp class="option">clear</samp></dt>
  36823. <dd><p>If set to true, remove any existing regions of interest marked on the
  36824. frame before adding the new one.
  36825. </p></dd>
  36826. </dl>
  36827. <ul class="mini-toc">
  36828. <li><a href="#Examples-86" accesskey="1">Examples</a></li>
  36829. </ul>
  36830. <div class="subsection-level-extent" id="Examples-86">
  36831. <h4 class="subsection"><span>39.1.1 Examples<a class="copiable-link" href="#Examples-86"> &para;</a></span></h4>
  36832. <ul class="itemize mark-bullet">
  36833. <li>Mark the centre quarter of the frame as interesting.
  36834. <div class="example">
  36835. <pre class="example-preformatted">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  36836. </pre></div>
  36837. </li><li>Mark the 100-pixel-wide region on the left edge of the frame as very
  36838. uninteresting (to be encoded at much lower quality than the rest of
  36839. the frame).
  36840. <div class="example">
  36841. <pre class="example-preformatted">addroi=0:0:100:ih:+1/5
  36842. </pre></div>
  36843. </li></ul>
  36844. </div>
  36845. </div>
  36846. <div class="section-level-extent" id="alphaextract">
  36847. <h3 class="section"><span>39.2 alphaextract<a class="copiable-link" href="#alphaextract"> &para;</a></span></h3>
  36848. <p>Extract the alpha component from the input as a grayscale video. This
  36849. is especially useful with the <var class="var">alphamerge</var> filter.
  36850. </p>
  36851. </div>
  36852. <div class="section-level-extent" id="alphamerge">
  36853. <h3 class="section"><span>39.3 alphamerge<a class="copiable-link" href="#alphamerge"> &para;</a></span></h3>
  36854. <p>Add or replace the alpha component of the primary input with the
  36855. grayscale value of a second input. This is intended for use with
  36856. <var class="var">alphaextract</var> to allow the transmission or storage of frame
  36857. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  36858. channel.
  36859. </p>
  36860. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  36861. and a separate video created with <var class="var">alphaextract</var>, you might use:
  36862. </p><div class="example">
  36863. <pre class="example-preformatted">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  36864. </pre></div>
  36865. </div>
  36866. <div class="section-level-extent" id="amplify">
  36867. <h3 class="section"><span>39.4 amplify<a class="copiable-link" href="#amplify"> &para;</a></span></h3>
  36868. <p>Amplify differences between current pixel and pixels of adjacent frames in
  36869. same pixel location.
  36870. </p>
  36871. <p>This filter accepts the following options:
  36872. </p>
  36873. <dl class="table">
  36874. <dt><samp class="option">radius</samp></dt>
  36875. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  36876. For example radius of 3 will instruct filter to calculate average of 7 frames.
  36877. </p>
  36878. </dd>
  36879. <dt><samp class="option">factor</samp></dt>
  36880. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  36881. </p>
  36882. </dd>
  36883. <dt><samp class="option">threshold</samp></dt>
  36884. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  36885. this value will not alter source pixel. Default is 10.
  36886. Allowed range is from 0 to 65535.
  36887. </p>
  36888. </dd>
  36889. <dt><samp class="option">tolerance</samp></dt>
  36890. <dd><p>Set tolerance for difference amplification. Any difference lower to
  36891. this value will not alter source pixel. Default is 0.
  36892. Allowed range is from 0 to 65535.
  36893. </p>
  36894. </dd>
  36895. <dt><samp class="option">low</samp></dt>
  36896. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  36897. This option controls maximum possible value that will decrease source pixel value.
  36898. </p>
  36899. </dd>
  36900. <dt><samp class="option">high</samp></dt>
  36901. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  36902. This option controls maximum possible value that will increase source pixel value.
  36903. </p>
  36904. </dd>
  36905. <dt><samp class="option">planes</samp></dt>
  36906. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  36907. </p></dd>
  36908. </dl>
  36909. <ul class="mini-toc">
  36910. <li><a href="#Commands-54" accesskey="1">Commands</a></li>
  36911. </ul>
  36912. <div class="subsection-level-extent" id="Commands-54">
  36913. <h4 class="subsection"><span>39.4.1 Commands<a class="copiable-link" href="#Commands-54"> &para;</a></span></h4>
  36914. <p>This filter supports the following <a class="ref" href="#commands">commands</a> that corresponds to option of same name:
  36915. </p><dl class="table">
  36916. <dt><samp class="option">factor</samp></dt>
  36917. <dt><samp class="option">threshold</samp></dt>
  36918. <dt><samp class="option">tolerance</samp></dt>
  36919. <dt><samp class="option">low</samp></dt>
  36920. <dt><samp class="option">high</samp></dt>
  36921. <dt><samp class="option">planes</samp></dt>
  36922. </dl>
  36923. </div>
  36924. </div>
  36925. <div class="section-level-extent" id="ass-1">
  36926. <h3 class="section"><span>39.5 ass<a class="copiable-link" href="#ass-1"> &para;</a></span></h3>
  36927. <p>Same as the <a class="ref" href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  36928. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  36929. Substation Alpha) subtitles files.
  36930. </p>
  36931. <p>This filter accepts the following option in addition to the common options from
  36932. the <a class="ref" href="#subtitles">subtitles</a> filter:
  36933. </p>
  36934. <dl class="table">
  36935. <dt><samp class="option">shaping</samp></dt>
  36936. <dd><p>Set the shaping engine
  36937. </p>
  36938. <p>Available values are:
  36939. </p><dl class="table">
  36940. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  36941. <dd><p>The default libass shaping engine, which is the best available.
  36942. </p></dd>
  36943. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  36944. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  36945. </p></dd>
  36946. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  36947. <dd><p>Slower shaper using OpenType for substitutions and positioning
  36948. </p></dd>
  36949. </dl>
  36950. <p>The default is <code class="code">auto</code>.
  36951. </p></dd>
  36952. </dl>
  36953. </div>
  36954. <div class="section-level-extent" id="atadenoise">
  36955. <h3 class="section"><span>39.6 atadenoise<a class="copiable-link" href="#atadenoise"> &para;</a></span></h3>
  36956. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  36957. </p>
  36958. <p>The filter accepts the following options:
  36959. </p>
  36960. <dl class="table">
  36961. <dt><samp class="option">0a</samp></dt>
  36962. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  36963. Valid range is 0 to 0.3.
  36964. </p>
  36965. </dd>
  36966. <dt><samp class="option">0b</samp></dt>
  36967. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  36968. Valid range is 0 to 5.
  36969. </p>
  36970. </dd>
  36971. <dt><samp class="option">1a</samp></dt>
  36972. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  36973. Valid range is 0 to 0.3.
  36974. </p>
  36975. </dd>
  36976. <dt><samp class="option">1b</samp></dt>
  36977. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  36978. Valid range is 0 to 5.
  36979. </p>
  36980. </dd>
  36981. <dt><samp class="option">2a</samp></dt>
  36982. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  36983. Valid range is 0 to 0.3.
  36984. </p>
  36985. </dd>
  36986. <dt><samp class="option">2b</samp></dt>
  36987. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  36988. Valid range is 0 to 5.
  36989. </p>
  36990. <p>Threshold A is designed to react on abrupt changes in the input signal and
  36991. threshold B is designed to react on continuous changes in the input signal.
  36992. </p>
  36993. </dd>
  36994. <dt><samp class="option">s</samp></dt>
  36995. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  36996. number in range [5, 129].
  36997. </p>
  36998. </dd>
  36999. <dt><samp class="option">p</samp></dt>
  37000. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  37001. </p>
  37002. </dd>
  37003. <dt><samp class="option">a</samp></dt>
  37004. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code class="code">p</code> parallel.
  37005. Alternatively can be set to <code class="code">s</code> serial.
  37006. </p>
  37007. <p>Parallel can be faster then serial, while other way around is never true.
  37008. Parallel will abort early on first change being greater then thresholds, while serial
  37009. will continue processing other side of frames if they are equal or below thresholds.
  37010. </p>
  37011. </dd>
  37012. <dt><samp class="option">0s</samp></dt>
  37013. <dt><samp class="option">1s</samp></dt>
  37014. <dt><samp class="option">2s</samp></dt>
  37015. <dd><p>Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
  37016. Valid range is from 0 to 32767.
  37017. This options controls weight for each pixel in radius defined by size.
  37018. Default value means every pixel have same weight.
  37019. Setting this option to 0 effectively disables filtering.
  37020. </p></dd>
  37021. </dl>
  37022. <ul class="mini-toc">
  37023. <li><a href="#Commands-55" accesskey="1">Commands</a></li>
  37024. </ul>
  37025. <div class="subsection-level-extent" id="Commands-55">
  37026. <h4 class="subsection"><span>39.6.1 Commands<a class="copiable-link" href="#Commands-55"> &para;</a></span></h4>
  37027. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options except option <code class="code">s</code>.
  37028. The command accepts the same syntax of the corresponding option.
  37029. </p>
  37030. </div>
  37031. </div>
  37032. <div class="section-level-extent" id="avgblur">
  37033. <h3 class="section"><span>39.7 avgblur<a class="copiable-link" href="#avgblur"> &para;</a></span></h3>
  37034. <p>Apply average blur filter.
  37035. </p>
  37036. <p>The filter accepts the following options:
  37037. </p>
  37038. <dl class="table">
  37039. <dt><samp class="option">sizeX</samp></dt>
  37040. <dd><p>Set horizontal radius size.
  37041. </p>
  37042. </dd>
  37043. <dt><samp class="option">planes</samp></dt>
  37044. <dd><p>Set which planes to filter. By default all planes are filtered.
  37045. </p>
  37046. </dd>
  37047. <dt><samp class="option">sizeY</samp></dt>
  37048. <dd><p>Set vertical radius size, if zero it will be same as <code class="code">sizeX</code>.
  37049. Default is <code class="code">0</code>.
  37050. </p></dd>
  37051. </dl>
  37052. <ul class="mini-toc">
  37053. <li><a href="#Commands-56" accesskey="1">Commands</a></li>
  37054. </ul>
  37055. <div class="subsection-level-extent" id="Commands-56">
  37056. <h4 class="subsection"><span>39.7.1 Commands<a class="copiable-link" href="#Commands-56"> &para;</a></span></h4>
  37057. <p>This filter supports same commands as options.
  37058. The command accepts the same syntax of the corresponding option.
  37059. </p>
  37060. <p>If the specified expression is not valid, it is kept at its current
  37061. value.
  37062. </p>
  37063. </div>
  37064. </div>
  37065. <div class="section-level-extent" id="backgroundkey">
  37066. <h3 class="section"><span>39.8 backgroundkey<a class="copiable-link" href="#backgroundkey"> &para;</a></span></h3>
  37067. <p>Turns a static background into transparency.
  37068. </p>
  37069. <p>The filter accepts the following option:
  37070. </p>
  37071. <dl class="table">
  37072. <dt><samp class="option">threshold</samp></dt>
  37073. <dd><p>Threshold for scene change detection.
  37074. </p></dd>
  37075. <dt><samp class="option">similarity</samp></dt>
  37076. <dd><p>Similarity percentage with the background.
  37077. </p></dd>
  37078. <dt><samp class="option">blend</samp></dt>
  37079. <dd><p>Set the blend amount for pixels that are not similar.
  37080. </p></dd>
  37081. </dl>
  37082. <ul class="mini-toc">
  37083. <li><a href="#Commands-57" accesskey="1">Commands</a></li>
  37084. </ul>
  37085. <div class="subsection-level-extent" id="Commands-57">
  37086. <h4 class="subsection"><span>39.8.1 Commands<a class="copiable-link" href="#Commands-57"> &para;</a></span></h4>
  37087. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37088. </p>
  37089. </div>
  37090. </div>
  37091. <div class="section-level-extent" id="bbox">
  37092. <h3 class="section"><span>39.9 bbox<a class="copiable-link" href="#bbox"> &para;</a></span></h3>
  37093. <p>Compute the bounding box for the non-black pixels in the input frame
  37094. luma plane.
  37095. </p>
  37096. <p>This filter computes the bounding box containing all the pixels with a
  37097. luma value greater than the minimum allowed value.
  37098. The parameters describing the bounding box are printed on the filter
  37099. log.
  37100. </p>
  37101. <p>The filter accepts the following option:
  37102. </p>
  37103. <dl class="table">
  37104. <dt><samp class="option">min_val</samp></dt>
  37105. <dd><p>Set the minimal luma value. Default is <code class="code">16</code>.
  37106. </p></dd>
  37107. </dl>
  37108. <ul class="mini-toc">
  37109. <li><a href="#Commands-58" accesskey="1">Commands</a></li>
  37110. </ul>
  37111. <div class="subsection-level-extent" id="Commands-58">
  37112. <h4 class="subsection"><span>39.9.1 Commands<a class="copiable-link" href="#Commands-58"> &para;</a></span></h4>
  37113. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37114. </p>
  37115. </div>
  37116. </div>
  37117. <div class="section-level-extent" id="bilateral">
  37118. <h3 class="section"><span>39.10 bilateral<a class="copiable-link" href="#bilateral"> &para;</a></span></h3>
  37119. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  37120. </p>
  37121. <p>The filter accepts the following options:
  37122. </p><dl class="table">
  37123. <dt><samp class="option">sigmaS</samp></dt>
  37124. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  37125. Allowed range is 0 to 512. Default is 0.1.
  37126. </p>
  37127. </dd>
  37128. <dt><samp class="option">sigmaR</samp></dt>
  37129. <dd><p>Set sigma of gaussian function to calculate range weight.
  37130. Allowed range is 0 to 1. Default is 0.1.
  37131. </p>
  37132. </dd>
  37133. <dt><samp class="option">planes</samp></dt>
  37134. <dd><p>Set planes to filter. Default is first only.
  37135. </p></dd>
  37136. </dl>
  37137. <ul class="mini-toc">
  37138. <li><a href="#Commands-59" accesskey="1">Commands</a></li>
  37139. </ul>
  37140. <div class="subsection-level-extent" id="Commands-59">
  37141. <h4 class="subsection"><span>39.10.1 Commands<a class="copiable-link" href="#Commands-59"> &para;</a></span></h4>
  37142. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  37143. </p>
  37144. </div>
  37145. </div>
  37146. <div class="section-level-extent" id="bilateral_005fcuda">
  37147. <h3 class="section"><span>39.11 bilateral_cuda<a class="copiable-link" href="#bilateral_005fcuda"> &para;</a></span></h3>
  37148. <p>CUDA accelerated bilateral filter, an edge preserving filter.
  37149. This filter is mathematically accurate thanks to the use of GPU acceleration.
  37150. For best output quality, use one to one chroma subsampling, i.e. yuv444p format.
  37151. </p>
  37152. <p>The filter accepts the following options:
  37153. </p><dl class="table">
  37154. <dt><samp class="option">sigmaS</samp></dt>
  37155. <dd><p>Set sigma of gaussian function to calculate spatial weight, also called sigma space.
  37156. Allowed range is 0.1 to 512. Default is 0.1.
  37157. </p>
  37158. </dd>
  37159. <dt><samp class="option">sigmaR</samp></dt>
  37160. <dd><p>Set sigma of gaussian function to calculate color range weight, also called sigma color.
  37161. Allowed range is 0.1 to 512. Default is 0.1.
  37162. </p>
  37163. </dd>
  37164. <dt><samp class="option">window_size</samp></dt>
  37165. <dd><p>Set window size of the bilateral function to determine the number of neighbours to loop on.
  37166. If the number entered is even, one will be added automatically.
  37167. Allowed range is 1 to 255. Default is 1.
  37168. </p></dd>
  37169. </dl>
  37170. <ul class="mini-toc">
  37171. <li><a href="#Examples-87" accesskey="1">Examples</a></li>
  37172. </ul>
  37173. <div class="subsection-level-extent" id="Examples-87">
  37174. <h4 class="subsection"><span>39.11.1 Examples<a class="copiable-link" href="#Examples-87"> &para;</a></span></h4>
  37175. <ul class="itemize mark-bullet">
  37176. <li>Apply the bilateral filter on a video.
  37177. <div class="example">
  37178. <pre class="example-preformatted">./ffmpeg -v verbose \
  37179. -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 \
  37180. -init_hw_device cuda \
  37181. -filter_complex \
  37182. &quot; \
  37183. [0:v]scale_cuda=format=yuv444p[scaled_video];
  37184. [scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0&quot; \
  37185. -an -sn -c:v h264_nvenc -cq 20 out.mp4
  37186. </pre></div>
  37187. </li></ul>
  37188. </div>
  37189. </div>
  37190. <div class="section-level-extent" id="bitplanenoise">
  37191. <h3 class="section"><span>39.12 bitplanenoise<a class="copiable-link" href="#bitplanenoise"> &para;</a></span></h3>
  37192. <p>Show and measure bit plane noise.
  37193. </p>
  37194. <p>The filter accepts the following options:
  37195. </p>
  37196. <dl class="table">
  37197. <dt><samp class="option">bitplane</samp></dt>
  37198. <dd><p>Set which plane to analyze. Default is <code class="code">1</code>.
  37199. </p>
  37200. </dd>
  37201. <dt><samp class="option">filter</samp></dt>
  37202. <dd><p>Filter out noisy pixels from <code class="code">bitplane</code> set above.
  37203. Default is disabled.
  37204. </p></dd>
  37205. </dl>
  37206. </div>
  37207. <div class="section-level-extent" id="blackdetect">
  37208. <h3 class="section"><span>39.13 blackdetect<a class="copiable-link" href="#blackdetect"> &para;</a></span></h3>
  37209. <p>Detect video intervals that are (almost) completely black. Can be
  37210. useful to detect chapter transitions, commercials, or invalid
  37211. recordings.
  37212. </p>
  37213. <p>The filter outputs its detection analysis to both the log as well as
  37214. frame metadata. If a black segment of at least the specified minimum
  37215. duration is found, a line with the start and end timestamps as well
  37216. as duration is printed to the log with level <code class="code">info</code>. In addition,
  37217. a log line with level <code class="code">debug</code> is printed per frame showing the
  37218. black amount detected for that frame.
  37219. </p>
  37220. <p>The filter also attaches metadata to the first frame of a black
  37221. segment with key <code class="code">lavfi.black_start</code> and to the first frame
  37222. after the black segment ends with key <code class="code">lavfi.black_end</code>. The
  37223. value is the frame&rsquo;s timestamp. This metadata is added regardless
  37224. of the minimum duration specified.
  37225. </p>
  37226. <p>The filter accepts the following options:
  37227. </p>
  37228. <dl class="table">
  37229. <dt><samp class="option">black_min_duration, d</samp></dt>
  37230. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  37231. be a non-negative floating point number.
  37232. </p>
  37233. <p>Default value is 2.0.
  37234. </p>
  37235. </dd>
  37236. <dt><samp class="option">picture_black_ratio_th, pic_th</samp></dt>
  37237. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  37238. Express the minimum value for the ratio:
  37239. </p><div class="example">
  37240. <pre class="example-preformatted"><var class="var">nb_black_pixels</var> / <var class="var">nb_pixels</var>
  37241. </pre></div>
  37242. <p>for which a picture is considered black.
  37243. Default value is 0.98.
  37244. </p>
  37245. </dd>
  37246. <dt><samp class="option">pixel_black_th, pix_th</samp></dt>
  37247. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  37248. </p>
  37249. <p>The threshold expresses the maximum pixel luma value for which a
  37250. pixel is considered &quot;black&quot;. The provided value is scaled according to
  37251. the following equation:
  37252. </p><div class="example">
  37253. <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>
  37254. </pre></div>
  37255. <p><var class="var">luma_range_size</var> and <var class="var">luma_minimum_value</var> depend on
  37256. the input video format, the range is [0-255] for YUV full-range
  37257. formats and [16-235] for YUV non full-range formats.
  37258. </p>
  37259. <p>Default value is 0.10.
  37260. </p></dd>
  37261. </dl>
  37262. <p>The following example sets the maximum pixel threshold to the minimum
  37263. value, and detects only black intervals of 2 or more seconds:
  37264. </p><div class="example">
  37265. <pre class="example-preformatted">blackdetect=d=2:pix_th=0.00
  37266. </pre></div>
  37267. </div>
  37268. <div class="section-level-extent" id="blackframe">
  37269. <h3 class="section"><span>39.14 blackframe<a class="copiable-link" href="#blackframe"> &para;</a></span></h3>
  37270. <p>Detect frames that are (almost) completely black. Can be useful to
  37271. detect chapter transitions or commercials. Output lines consist of
  37272. the frame number of the detected frame, the percentage of blackness,
  37273. the position in the file if known or -1 and the timestamp in seconds.
  37274. </p>
  37275. <p>In order to display the output lines, you need to set the loglevel at
  37276. least to the AV_LOG_INFO value.
  37277. </p>
  37278. <p>This filter exports frame metadata <code class="code">lavfi.blackframe.pblack</code>.
  37279. The value represents the percentage of pixels in the picture that
  37280. are below the threshold value.
  37281. </p>
  37282. <p>It accepts the following parameters:
  37283. </p>
  37284. <dl class="table">
  37285. <dt><samp class="option">amount</samp></dt>
  37286. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  37287. <code class="code">98</code>.
  37288. </p>
  37289. </dd>
  37290. <dt><samp class="option">threshold, thresh</samp></dt>
  37291. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  37292. <code class="code">32</code>.
  37293. </p>
  37294. </dd>
  37295. </dl>
  37296. <a class="anchor" id="blend"></a></div>
  37297. <div class="section-level-extent" id="blend-1">
  37298. <h3 class="section"><span>39.15 blend<a class="copiable-link" href="#blend-1"> &para;</a></span></h3>
  37299. <p>Blend two video frames into each other.
  37300. </p>
  37301. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  37302. stream, the first input is the &quot;top&quot; layer and second input is
  37303. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  37304. </p>
  37305. <p>The <code class="code">tblend</code> (time blend) filter takes two consecutive frames
  37306. from one single stream, and outputs the result obtained by blending
  37307. the new frame on top of the old frame.
  37308. </p>
  37309. <p>A description of the accepted options follows.
  37310. </p>
  37311. <dl class="table">
  37312. <dt><samp class="option">c0_mode</samp></dt>
  37313. <dt><samp class="option">c1_mode</samp></dt>
  37314. <dt><samp class="option">c2_mode</samp></dt>
  37315. <dt><samp class="option">c3_mode</samp></dt>
  37316. <dt><samp class="option">all_mode</samp></dt>
  37317. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  37318. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  37319. </p>
  37320. <p>Available values for component modes are:
  37321. </p><dl class="table">
  37322. <dt>&lsquo;<samp class="samp">addition</samp>&rsquo;</dt>
  37323. <dt>&lsquo;<samp class="samp">and</samp>&rsquo;</dt>
  37324. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  37325. <dt>&lsquo;<samp class="samp">bleach</samp>&rsquo;</dt>
  37326. <dt>&lsquo;<samp class="samp">burn</samp>&rsquo;</dt>
  37327. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  37328. <dt>&lsquo;<samp class="samp">difference</samp>&rsquo;</dt>
  37329. <dt>&lsquo;<samp class="samp">divide</samp>&rsquo;</dt>
  37330. <dt>&lsquo;<samp class="samp">dodge</samp>&rsquo;</dt>
  37331. <dt>&lsquo;<samp class="samp">exclusion</samp>&rsquo;</dt>
  37332. <dt>&lsquo;<samp class="samp">extremity</samp>&rsquo;</dt>
  37333. <dt>&lsquo;<samp class="samp">freeze</samp>&rsquo;</dt>
  37334. <dt>&lsquo;<samp class="samp">geometric</samp>&rsquo;</dt>
  37335. <dt>&lsquo;<samp class="samp">glow</samp>&rsquo;</dt>
  37336. <dt>&lsquo;<samp class="samp">grainextract</samp>&rsquo;</dt>
  37337. <dt>&lsquo;<samp class="samp">grainmerge</samp>&rsquo;</dt>
  37338. <dt>&lsquo;<samp class="samp">hardlight</samp>&rsquo;</dt>
  37339. <dt>&lsquo;<samp class="samp">hardmix</samp>&rsquo;</dt>
  37340. <dt>&lsquo;<samp class="samp">hardoverlay</samp>&rsquo;</dt>
  37341. <dt>&lsquo;<samp class="samp">harmonic</samp>&rsquo;</dt>
  37342. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  37343. <dt>&lsquo;<samp class="samp">interpolate</samp>&rsquo;</dt>
  37344. <dt>&lsquo;<samp class="samp">lighten</samp>&rsquo;</dt>
  37345. <dt>&lsquo;<samp class="samp">linearlight</samp>&rsquo;</dt>
  37346. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  37347. <dt>&lsquo;<samp class="samp">multiply128</samp>&rsquo;</dt>
  37348. <dt>&lsquo;<samp class="samp">negation</samp>&rsquo;</dt>
  37349. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  37350. <dt>&lsquo;<samp class="samp">or</samp>&rsquo;</dt>
  37351. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  37352. <dt>&lsquo;<samp class="samp">phoenix</samp>&rsquo;</dt>
  37353. <dt>&lsquo;<samp class="samp">pinlight</samp>&rsquo;</dt>
  37354. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  37355. <dt>&lsquo;<samp class="samp">screen</samp>&rsquo;</dt>
  37356. <dt>&lsquo;<samp class="samp">softdifference</samp>&rsquo;</dt>
  37357. <dt>&lsquo;<samp class="samp">softlight</samp>&rsquo;</dt>
  37358. <dt>&lsquo;<samp class="samp">stain</samp>&rsquo;</dt>
  37359. <dt>&lsquo;<samp class="samp">subtract</samp>&rsquo;</dt>
  37360. <dt>&lsquo;<samp class="samp">vividlight</samp>&rsquo;</dt>
  37361. <dt>&lsquo;<samp class="samp">xor</samp>&rsquo;</dt>
  37362. </dl>
  37363. </dd>
  37364. <dt><samp class="option">c0_opacity</samp></dt>
  37365. <dt><samp class="option">c1_opacity</samp></dt>
  37366. <dt><samp class="option">c2_opacity</samp></dt>
  37367. <dt><samp class="option">c3_opacity</samp></dt>
  37368. <dt><samp class="option">all_opacity</samp></dt>
  37369. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  37370. of <var class="var">all_opacity</var>. Only used in combination with pixel component blend modes.
  37371. </p>
  37372. </dd>
  37373. <dt><samp class="option">c0_expr</samp></dt>
  37374. <dt><samp class="option">c1_expr</samp></dt>
  37375. <dt><samp class="option">c2_expr</samp></dt>
  37376. <dt><samp class="option">c3_expr</samp></dt>
  37377. <dt><samp class="option">all_expr</samp></dt>
  37378. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  37379. of <var class="var">all_expr</var>. Note that related mode options will be ignored if those are set.
  37380. </p>
  37381. <p>The expressions can use the following variables:
  37382. </p>
  37383. <dl class="table">
  37384. <dt><samp class="option">N</samp></dt>
  37385. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  37386. </p>
  37387. </dd>
  37388. <dt><samp class="option">X</samp></dt>
  37389. <dt><samp class="option">Y</samp></dt>
  37390. <dd><p>the coordinates of the current sample
  37391. </p>
  37392. </dd>
  37393. <dt><samp class="option">W</samp></dt>
  37394. <dt><samp class="option">H</samp></dt>
  37395. <dd><p>the width and height of currently filtered plane
  37396. </p>
  37397. </dd>
  37398. <dt><samp class="option">SW</samp></dt>
  37399. <dt><samp class="option">SH</samp></dt>
  37400. <dd><p>Width and height scale for the plane being filtered. It is the
  37401. ratio between the dimensions of the current plane to the luma plane,
  37402. e.g. for a <code class="code">yuv420p</code> frame, the values are <code class="code">1,1</code> for
  37403. the luma plane and <code class="code">0.5,0.5</code> for the chroma planes.
  37404. </p>
  37405. </dd>
  37406. <dt><samp class="option">T</samp></dt>
  37407. <dd><p>Time of the current frame, expressed in seconds.
  37408. </p>
  37409. </dd>
  37410. <dt><samp class="option">TOP, A</samp></dt>
  37411. <dd><p>Value of pixel component at current location for first video frame (top layer).
  37412. </p>
  37413. </dd>
  37414. <dt><samp class="option">BOTTOM, B</samp></dt>
  37415. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  37416. </p></dd>
  37417. </dl>
  37418. </dd>
  37419. </dl>
  37420. <p>The <code class="code">blend</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  37421. </p>
  37422. <ul class="mini-toc">
  37423. <li><a href="#Examples-88" accesskey="1">Examples</a></li>
  37424. <li><a href="#Commands-60" accesskey="2">Commands</a></li>
  37425. </ul>
  37426. <div class="subsection-level-extent" id="Examples-88">
  37427. <h4 class="subsection"><span>39.15.1 Examples<a class="copiable-link" href="#Examples-88"> &para;</a></span></h4>
  37428. <ul class="itemize mark-bullet">
  37429. <li>Apply transition from bottom layer to top layer in first 10 seconds:
  37430. <div class="example">
  37431. <pre class="example-preformatted">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  37432. </pre></div>
  37433. </li><li>Apply linear horizontal transition from top layer to bottom layer:
  37434. <div class="example">
  37435. <pre class="example-preformatted">blend=all_expr='A*(X/W)+B*(1-X/W)'
  37436. </pre></div>
  37437. </li><li>Apply 1x1 checkerboard effect:
  37438. <div class="example">
  37439. <pre class="example-preformatted">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  37440. </pre></div>
  37441. </li><li>Apply uncover left effect:
  37442. <div class="example">
  37443. <pre class="example-preformatted">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  37444. </pre></div>
  37445. </li><li>Apply uncover down effect:
  37446. <div class="example">
  37447. <pre class="example-preformatted">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  37448. </pre></div>
  37449. </li><li>Apply uncover up-left effect:
  37450. <div class="example">
  37451. <pre class="example-preformatted">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  37452. </pre></div>
  37453. </li><li>Split diagonally video and shows top and bottom layer on each side:
  37454. <div class="example">
  37455. <pre class="example-preformatted">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  37456. </pre></div>
  37457. </li><li>Display differences between the current and the previous frame:
  37458. <div class="example">
  37459. <pre class="example-preformatted">tblend=all_mode=grainextract
  37460. </pre></div>
  37461. </li></ul>
  37462. </div>
  37463. <div class="subsection-level-extent" id="Commands-60">
  37464. <h4 class="subsection"><span>39.15.2 Commands<a class="copiable-link" href="#Commands-60"> &para;</a></span></h4>
  37465. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37466. </p>
  37467. <a class="anchor" id="blockdetect"></a></div>
  37468. </div>
  37469. <div class="section-level-extent" id="blockdetect-1">
  37470. <h3 class="section"><span>39.16 blockdetect<a class="copiable-link" href="#blockdetect-1"> &para;</a></span></h3>
  37471. <p>Determines blockiness of frames without altering the input frames.
  37472. </p>
  37473. <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.
  37474. </p>
  37475. <p>The filter accepts the following options:
  37476. </p>
  37477. <dl class="table">
  37478. <dt><samp class="option">period_min</samp></dt>
  37479. <dt><samp class="option">period_max</samp></dt>
  37480. <dd><p>Set minimum and maximum values for determining pixel grids (periods).
  37481. Default values are [3,24].
  37482. </p>
  37483. </dd>
  37484. <dt><samp class="option">planes</samp></dt>
  37485. <dd><p>Set planes to filter. Default is first only.
  37486. </p></dd>
  37487. </dl>
  37488. <ul class="mini-toc">
  37489. <li><a href="#Examples-89" accesskey="1">Examples</a></li>
  37490. </ul>
  37491. <div class="subsection-level-extent" id="Examples-89">
  37492. <h4 class="subsection"><span>39.16.1 Examples<a class="copiable-link" href="#Examples-89"> &para;</a></span></h4>
  37493. <ul class="itemize mark-bullet">
  37494. <li>Determine blockiness for the first plane and search for periods within [8,32]:
  37495. <div class="example">
  37496. <pre class="example-preformatted">blockdetect=period_min=8:period_max=32:planes=1
  37497. </pre></div>
  37498. </li></ul>
  37499. <a class="anchor" id="blurdetect"></a></div>
  37500. </div>
  37501. <div class="section-level-extent" id="blurdetect-1">
  37502. <h3 class="section"><span>39.17 blurdetect<a class="copiable-link" href="#blurdetect-1"> &para;</a></span></h3>
  37503. <p>Determines blurriness of frames without altering the input frames.
  37504. </p>
  37505. <p>Based on Marziliano, Pina, et al. &quot;A no-reference perceptual blur metric.&quot;
  37506. Allows for a block-based abbreviation.
  37507. </p>
  37508. <p>The filter accepts the following options:
  37509. </p>
  37510. <dl class="table">
  37511. <dt><samp class="option">low</samp></dt>
  37512. <dt><samp class="option">high</samp></dt>
  37513. <dd><p>Set low and high threshold values used by the Canny thresholding
  37514. algorithm.
  37515. </p>
  37516. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  37517. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  37518. by the low threshold.
  37519. </p>
  37520. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  37521. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  37522. </p>
  37523. <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>
  37524. is <code class="code">50/255</code>.
  37525. </p>
  37526. </dd>
  37527. <dt><samp class="option">radius</samp></dt>
  37528. <dd><p>Define the radius to search around an edge pixel for local maxima.
  37529. </p>
  37530. </dd>
  37531. <dt><samp class="option">block_pct</samp></dt>
  37532. <dd><p>Determine blurriness only for the most significant blocks, given in percentage.
  37533. </p>
  37534. </dd>
  37535. <dt><samp class="option">block_width</samp></dt>
  37536. <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>.
  37537. </p>
  37538. </dd>
  37539. <dt><samp class="option">block_height</samp></dt>
  37540. <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>.
  37541. </p>
  37542. </dd>
  37543. <dt><samp class="option">planes</samp></dt>
  37544. <dd><p>Set planes to filter. Default is first only.
  37545. </p></dd>
  37546. </dl>
  37547. <ul class="mini-toc">
  37548. <li><a href="#Examples-90" accesskey="1">Examples</a></li>
  37549. </ul>
  37550. <div class="subsection-level-extent" id="Examples-90">
  37551. <h4 class="subsection"><span>39.17.1 Examples<a class="copiable-link" href="#Examples-90"> &para;</a></span></h4>
  37552. <ul class="itemize mark-bullet">
  37553. <li>Determine blur for 80% of most significant 32x32 blocks:
  37554. <div class="example">
  37555. <pre class="example-preformatted">blurdetect=block_width=32:block_height=32:block_pct=80
  37556. </pre></div>
  37557. </li></ul>
  37558. </div>
  37559. </div>
  37560. <div class="section-level-extent" id="bm3d">
  37561. <h3 class="section"><span>39.18 bm3d<a class="copiable-link" href="#bm3d"> &para;</a></span></h3>
  37562. <p>Denoise frames using Block-Matching 3D algorithm.
  37563. </p>
  37564. <p>The filter accepts the following options.
  37565. </p>
  37566. <dl class="table">
  37567. <dt><samp class="option">sigma</samp></dt>
  37568. <dd><p>Set denoising strength. Default value is 1.
  37569. Allowed range is from 0 to 999.9.
  37570. The denoising algorithm is very sensitive to sigma, so adjust it
  37571. according to the source.
  37572. </p>
  37573. </dd>
  37574. <dt><samp class="option">block</samp></dt>
  37575. <dd><p>Set local patch size. This sets dimensions in 2D.
  37576. </p>
  37577. </dd>
  37578. <dt><samp class="option">bstep</samp></dt>
  37579. <dd><p>Set sliding step for processing blocks. Default value is 4.
  37580. Allowed range is from 1 to 64.
  37581. Smaller values allows processing more reference blocks and is slower.
  37582. </p>
  37583. </dd>
  37584. <dt><samp class="option">group</samp></dt>
  37585. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  37586. When set to 1, no block matching is done. Larger values allows more blocks
  37587. in single group.
  37588. Allowed range is from 1 to 256.
  37589. </p>
  37590. </dd>
  37591. <dt><samp class="option">range</samp></dt>
  37592. <dd><p>Set radius for search block matching. Default is 9.
  37593. Allowed range is from 1 to INT32_MAX.
  37594. </p>
  37595. </dd>
  37596. <dt><samp class="option">mstep</samp></dt>
  37597. <dd><p>Set step between two search locations for block matching. Default is 1.
  37598. Allowed range is from 1 to 64. Smaller is slower.
  37599. </p>
  37600. </dd>
  37601. <dt><samp class="option">thmse</samp></dt>
  37602. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  37603. INT32_MAX.
  37604. </p>
  37605. </dd>
  37606. <dt><samp class="option">hdthr</samp></dt>
  37607. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  37608. Larger values results in stronger hard-thresholding filtering in frequency
  37609. domain.
  37610. </p>
  37611. </dd>
  37612. <dt><samp class="option">estim</samp></dt>
  37613. <dd><p>Set filtering estimation mode. Can be <code class="code">basic</code> or <code class="code">final</code>.
  37614. Default is <code class="code">basic</code>.
  37615. </p>
  37616. </dd>
  37617. <dt><samp class="option">ref</samp></dt>
  37618. <dd><p>If enabled, filter will use 2nd stream for block matching.
  37619. Default is disabled for <code class="code">basic</code> value of <var class="var">estim</var> option,
  37620. and always enabled if value of <var class="var">estim</var> is <code class="code">final</code>.
  37621. </p>
  37622. </dd>
  37623. <dt><samp class="option">planes</samp></dt>
  37624. <dd><p>Set planes to filter. Default is all available except alpha.
  37625. </p></dd>
  37626. </dl>
  37627. <ul class="mini-toc">
  37628. <li><a href="#Examples-91" accesskey="1">Examples</a></li>
  37629. </ul>
  37630. <div class="subsection-level-extent" id="Examples-91">
  37631. <h4 class="subsection"><span>39.18.1 Examples<a class="copiable-link" href="#Examples-91"> &para;</a></span></h4>
  37632. <ul class="itemize mark-bullet">
  37633. <li>Basic filtering with bm3d:
  37634. <div class="example">
  37635. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  37636. </pre></div>
  37637. </li><li>Same as above, but filtering only luma:
  37638. <div class="example">
  37639. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  37640. </pre></div>
  37641. </li><li>Same as above, but with both estimation modes:
  37642. <div class="example">
  37643. <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
  37644. </pre></div>
  37645. </li><li>Same as above, but prefilter with <a class="ref" href="#nlmeans">nlmeans</a> filter instead:
  37646. <div class="example">
  37647. <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
  37648. </pre></div>
  37649. </li></ul>
  37650. </div>
  37651. </div>
  37652. <div class="section-level-extent" id="boxblur">
  37653. <h3 class="section"><span>39.19 boxblur<a class="copiable-link" href="#boxblur"> &para;</a></span></h3>
  37654. <p>Apply a boxblur algorithm to the input video.
  37655. </p>
  37656. <p>It accepts the following parameters:
  37657. </p>
  37658. <dl class="table">
  37659. <dt><samp class="option">luma_radius, lr</samp></dt>
  37660. <dt><samp class="option">luma_power, lp</samp></dt>
  37661. <dt><samp class="option">chroma_radius, cr</samp></dt>
  37662. <dt><samp class="option">chroma_power, cp</samp></dt>
  37663. <dt><samp class="option">alpha_radius, ar</samp></dt>
  37664. <dt><samp class="option">alpha_power, ap</samp></dt>
  37665. </dl>
  37666. <p>A description of the accepted options follows.
  37667. </p>
  37668. <dl class="table">
  37669. <dt><samp class="option">luma_radius, lr</samp></dt>
  37670. <dt><samp class="option">chroma_radius, cr</samp></dt>
  37671. <dt><samp class="option">alpha_radius, ar</samp></dt>
  37672. <dd><p>Set an expression for the box radius in pixels used for blurring the
  37673. corresponding input plane.
  37674. </p>
  37675. <p>The radius value must be a non-negative number, and must not be
  37676. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  37677. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  37678. planes.
  37679. </p>
  37680. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  37681. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  37682. corresponding value set for <samp class="option">luma_radius</samp>.
  37683. </p>
  37684. <p>The expressions can contain the following constants:
  37685. </p><dl class="table">
  37686. <dt><samp class="option">w</samp></dt>
  37687. <dt><samp class="option">h</samp></dt>
  37688. <dd><p>The input width and height in pixels.
  37689. </p>
  37690. </dd>
  37691. <dt><samp class="option">cw</samp></dt>
  37692. <dt><samp class="option">ch</samp></dt>
  37693. <dd><p>The input chroma image width and height in pixels.
  37694. </p>
  37695. </dd>
  37696. <dt><samp class="option">hsub</samp></dt>
  37697. <dt><samp class="option">vsub</samp></dt>
  37698. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  37699. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  37700. </p></dd>
  37701. </dl>
  37702. </dd>
  37703. <dt><samp class="option">luma_power, lp</samp></dt>
  37704. <dt><samp class="option">chroma_power, cp</samp></dt>
  37705. <dt><samp class="option">alpha_power, ap</samp></dt>
  37706. <dd><p>Specify how many times the boxblur filter is applied to the
  37707. corresponding plane.
  37708. </p>
  37709. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  37710. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  37711. corresponding value set for <samp class="option">luma_power</samp>.
  37712. </p>
  37713. <p>A value of 0 will disable the effect.
  37714. </p></dd>
  37715. </dl>
  37716. <ul class="mini-toc">
  37717. <li><a href="#Examples-92" accesskey="1">Examples</a></li>
  37718. </ul>
  37719. <div class="subsection-level-extent" id="Examples-92">
  37720. <h4 class="subsection"><span>39.19.1 Examples<a class="copiable-link" href="#Examples-92"> &para;</a></span></h4>
  37721. <ul class="itemize mark-bullet">
  37722. <li>Apply a boxblur filter with the luma, chroma, and alpha radii
  37723. set to 2:
  37724. <div class="example">
  37725. <pre class="example-preformatted">boxblur=luma_radius=2:luma_power=1
  37726. boxblur=2:1
  37727. </pre></div>
  37728. </li><li>Set the luma radius to 2, and alpha and chroma radius to 0:
  37729. <div class="example">
  37730. <pre class="example-preformatted">boxblur=2:1:cr=0:ar=0
  37731. </pre></div>
  37732. </li><li>Set the luma and chroma radii to a fraction of the video dimension:
  37733. <div class="example">
  37734. <pre class="example-preformatted">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  37735. </pre></div>
  37736. </li></ul>
  37737. <a class="anchor" id="bwdif"></a></div>
  37738. </div>
  37739. <div class="section-level-extent" id="bwdif-1">
  37740. <h3 class="section"><span>39.20 bwdif<a class="copiable-link" href="#bwdif-1"> &para;</a></span></h3>
  37741. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  37742. Deinterlacing Filter&quot;).
  37743. </p>
  37744. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  37745. interpolation algorithms.
  37746. It accepts the following parameters:
  37747. </p>
  37748. <dl class="table">
  37749. <dt><samp class="option">mode</samp></dt>
  37750. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  37751. </p>
  37752. <dl class="table">
  37753. <dt><samp class="option">0, send_frame</samp></dt>
  37754. <dd><p>Output one frame for each frame.
  37755. </p></dd>
  37756. <dt><samp class="option">1, send_field</samp></dt>
  37757. <dd><p>Output one frame for each field.
  37758. </p></dd>
  37759. </dl>
  37760. <p>The default value is <code class="code">send_field</code>.
  37761. </p>
  37762. </dd>
  37763. <dt><samp class="option">parity</samp></dt>
  37764. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  37765. of the following values:
  37766. </p>
  37767. <dl class="table">
  37768. <dt><samp class="option">0, tff</samp></dt>
  37769. <dd><p>Assume the top field is first.
  37770. </p></dd>
  37771. <dt><samp class="option">1, bff</samp></dt>
  37772. <dd><p>Assume the bottom field is first.
  37773. </p></dd>
  37774. <dt><samp class="option">-1, auto</samp></dt>
  37775. <dd><p>Enable automatic detection of field parity.
  37776. </p></dd>
  37777. </dl>
  37778. <p>The default value is <code class="code">auto</code>.
  37779. If the interlacing is unknown or the decoder does not export this information,
  37780. top field first will be assumed.
  37781. </p>
  37782. </dd>
  37783. <dt><samp class="option">deint</samp></dt>
  37784. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  37785. values:
  37786. </p>
  37787. <dl class="table">
  37788. <dt><samp class="option">0, all</samp></dt>
  37789. <dd><p>Deinterlace all frames.
  37790. </p></dd>
  37791. <dt><samp class="option">1, interlaced</samp></dt>
  37792. <dd><p>Only deinterlace frames marked as interlaced.
  37793. </p></dd>
  37794. </dl>
  37795. <p>The default value is <code class="code">all</code>.
  37796. </p></dd>
  37797. </dl>
  37798. </div>
  37799. <div class="section-level-extent" id="bwdif_005fcuda">
  37800. <h3 class="section"><span>39.21 bwdif_cuda<a class="copiable-link" href="#bwdif_005fcuda"> &para;</a></span></h3>
  37801. <p>Deinterlace the input video using the <a class="ref" href="#bwdif">bwdif</a> algorithm, but implemented
  37802. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  37803. and/or nvenc.
  37804. </p>
  37805. <p>It accepts the following parameters:
  37806. </p>
  37807. <dl class="table">
  37808. <dt><samp class="option">mode</samp></dt>
  37809. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  37810. </p>
  37811. <dl class="table">
  37812. <dt><samp class="option">0, send_frame</samp></dt>
  37813. <dd><p>Output one frame for each frame.
  37814. </p></dd>
  37815. <dt><samp class="option">1, send_field</samp></dt>
  37816. <dd><p>Output one frame for each field.
  37817. </p></dd>
  37818. </dl>
  37819. <p>The default value is <code class="code">send_field</code>.
  37820. </p>
  37821. </dd>
  37822. <dt><samp class="option">parity</samp></dt>
  37823. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  37824. of the following values:
  37825. </p>
  37826. <dl class="table">
  37827. <dt><samp class="option">0, tff</samp></dt>
  37828. <dd><p>Assume the top field is first.
  37829. </p></dd>
  37830. <dt><samp class="option">1, bff</samp></dt>
  37831. <dd><p>Assume the bottom field is first.
  37832. </p></dd>
  37833. <dt><samp class="option">-1, auto</samp></dt>
  37834. <dd><p>Enable automatic detection of field parity.
  37835. </p></dd>
  37836. </dl>
  37837. <p>The default value is <code class="code">auto</code>.
  37838. If the interlacing is unknown or the decoder does not export this information,
  37839. top field first will be assumed.
  37840. </p>
  37841. </dd>
  37842. <dt><samp class="option">deint</samp></dt>
  37843. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  37844. values:
  37845. </p>
  37846. <dl class="table">
  37847. <dt><samp class="option">0, all</samp></dt>
  37848. <dd><p>Deinterlace all frames.
  37849. </p></dd>
  37850. <dt><samp class="option">1, interlaced</samp></dt>
  37851. <dd><p>Only deinterlace frames marked as interlaced.
  37852. </p></dd>
  37853. </dl>
  37854. <p>The default value is <code class="code">all</code>.
  37855. </p></dd>
  37856. </dl>
  37857. </div>
  37858. <div class="section-level-extent" id="ccrepack">
  37859. <h3 class="section"><span>39.22 ccrepack<a class="copiable-link" href="#ccrepack"> &para;</a></span></h3>
  37860. <p>Repack CEA-708 closed captioning side data
  37861. </p>
  37862. <p>This filter fixes various issues seen with commerical encoders
  37863. related to upstream malformed CEA-708 payloads, specifically
  37864. incorrect number of tuples (wrong cc_count for the target FPS),
  37865. and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at
  37866. the first entries in the payload).
  37867. </p>
  37868. </div>
  37869. <div class="section-level-extent" id="cas">
  37870. <h3 class="section"><span>39.23 cas<a class="copiable-link" href="#cas"> &para;</a></span></h3>
  37871. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  37872. </p>
  37873. <p>The filter accepts the following options:
  37874. </p>
  37875. <dl class="table">
  37876. <dt><samp class="option">strength</samp></dt>
  37877. <dd><p>Set the sharpening strength. Default value is 0.
  37878. </p>
  37879. </dd>
  37880. <dt><samp class="option">planes</samp></dt>
  37881. <dd><p>Set planes to filter. Default value is to filter all
  37882. planes except alpha plane.
  37883. </p></dd>
  37884. </dl>
  37885. <ul class="mini-toc">
  37886. <li><a href="#Commands-61" accesskey="1">Commands</a></li>
  37887. </ul>
  37888. <div class="subsection-level-extent" id="Commands-61">
  37889. <h4 class="subsection"><span>39.23.1 Commands<a class="copiable-link" href="#Commands-61"> &para;</a></span></h4>
  37890. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37891. </p>
  37892. </div>
  37893. </div>
  37894. <div class="section-level-extent" id="chromahold">
  37895. <h3 class="section"><span>39.24 chromahold<a class="copiable-link" href="#chromahold"> &para;</a></span></h3>
  37896. <p>Remove all color information for all colors except for certain one.
  37897. </p>
  37898. <p>The filter accepts the following options:
  37899. </p>
  37900. <dl class="table">
  37901. <dt><samp class="option">color</samp></dt>
  37902. <dd><p>The color which will not be replaced with neutral chroma.
  37903. </p>
  37904. </dd>
  37905. <dt><samp class="option">similarity</samp></dt>
  37906. <dd><p>Similarity percentage with the above color.
  37907. 0.01 matches only the exact key color, while 1.0 matches everything.
  37908. </p>
  37909. </dd>
  37910. <dt><samp class="option">blend</samp></dt>
  37911. <dd><p>Blend percentage.
  37912. 0.0 makes pixels either fully gray, or not gray at all.
  37913. Higher values result in more preserved color.
  37914. </p>
  37915. </dd>
  37916. <dt><samp class="option">yuv</samp></dt>
  37917. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  37918. </p>
  37919. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  37920. This can be used to pass exact YUV values as hexadecimal numbers.
  37921. </p></dd>
  37922. </dl>
  37923. <ul class="mini-toc">
  37924. <li><a href="#Commands-62" accesskey="1">Commands</a></li>
  37925. </ul>
  37926. <div class="subsection-level-extent" id="Commands-62">
  37927. <h4 class="subsection"><span>39.24.1 Commands<a class="copiable-link" href="#Commands-62"> &para;</a></span></h4>
  37928. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37929. The command accepts the same syntax of the corresponding option.
  37930. </p>
  37931. <p>If the specified expression is not valid, it is kept at its current
  37932. value.
  37933. </p>
  37934. <a class="anchor" id="chromakey"></a></div>
  37935. </div>
  37936. <div class="section-level-extent" id="chromakey-1">
  37937. <h3 class="section"><span>39.25 chromakey<a class="copiable-link" href="#chromakey-1"> &para;</a></span></h3>
  37938. <p>YUV colorspace color/chroma keying.
  37939. </p>
  37940. <p>The filter accepts the following options:
  37941. </p>
  37942. <dl class="table">
  37943. <dt><samp class="option">color</samp></dt>
  37944. <dd><p>The color which will be replaced with transparency.
  37945. </p>
  37946. </dd>
  37947. <dt><samp class="option">similarity</samp></dt>
  37948. <dd><p>Similarity percentage with the key color.
  37949. </p>
  37950. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  37951. </p>
  37952. </dd>
  37953. <dt><samp class="option">blend</samp></dt>
  37954. <dd><p>Blend percentage.
  37955. </p>
  37956. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  37957. </p>
  37958. <p>Higher values result in semi-transparent pixels, with a higher transparency
  37959. the more similar the pixels color is to the key color.
  37960. </p>
  37961. </dd>
  37962. <dt><samp class="option">yuv</samp></dt>
  37963. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  37964. </p>
  37965. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  37966. This can be used to pass exact YUV values as hexadecimal numbers.
  37967. </p></dd>
  37968. </dl>
  37969. <ul class="mini-toc">
  37970. <li><a href="#Commands-63" accesskey="1">Commands</a></li>
  37971. <li><a href="#Examples-93" accesskey="2">Examples</a></li>
  37972. </ul>
  37973. <div class="subsection-level-extent" id="Commands-63">
  37974. <h4 class="subsection"><span>39.25.1 Commands<a class="copiable-link" href="#Commands-63"> &para;</a></span></h4>
  37975. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  37976. The command accepts the same syntax of the corresponding option.
  37977. </p>
  37978. <p>If the specified expression is not valid, it is kept at its current
  37979. value.
  37980. </p>
  37981. </div>
  37982. <div class="subsection-level-extent" id="Examples-93">
  37983. <h4 class="subsection"><span>39.25.2 Examples<a class="copiable-link" href="#Examples-93"> &para;</a></span></h4>
  37984. <ul class="itemize mark-bullet">
  37985. <li>Make every green pixel in the input image transparent:
  37986. <div class="example">
  37987. <pre class="example-preformatted">ffmpeg -i input.png -vf chromakey=green out.png
  37988. </pre></div>
  37989. </li><li>Overlay a greenscreen-video on top of a static black background.
  37990. <div class="example">
  37991. <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
  37992. </pre></div>
  37993. </li></ul>
  37994. </div>
  37995. </div>
  37996. <div class="section-level-extent" id="chromakey_005fcuda">
  37997. <h3 class="section"><span>39.26 chromakey_cuda<a class="copiable-link" href="#chromakey_005fcuda"> &para;</a></span></h3>
  37998. <p>CUDA accelerated YUV colorspace color/chroma keying.
  37999. </p>
  38000. <p>This filter works like normal chromakey filter but operates on CUDA frames.
  38001. for more details and parameters see <a class="ref" href="#chromakey">chromakey</a>.
  38002. </p>
  38003. <ul class="mini-toc">
  38004. <li><a href="#Examples-94" accesskey="1">Examples</a></li>
  38005. </ul>
  38006. <div class="subsection-level-extent" id="Examples-94">
  38007. <h4 class="subsection"><span>39.26.1 Examples<a class="copiable-link" href="#Examples-94"> &para;</a></span></h4>
  38008. <ul class="itemize mark-bullet">
  38009. <li>Make all the green pixels in the input video transparent and use it as an overlay for another video:
  38010. <div class="example">
  38011. <pre class="example-preformatted">./ffmpeg \
  38012. -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4 \
  38013. -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
  38014. -init_hw_device cuda \
  38015. -filter_complex \
  38016. &quot; \
  38017. [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
  38018. [1:v]scale_cuda=format=yuv420p[base]; \
  38019. [base][overlay_video]overlay_cuda&quot; \
  38020. -an -sn -c:v h264_nvenc -cq 20 output.mp4
  38021. </pre></div>
  38022. </li><li>Process two software sources, explicitly uploading the frames:
  38023. <div class="example">
  38024. <pre class="example-preformatted">./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
  38025. -f lavfi -i color=size=800x600:color=white,format=yuv420p \
  38026. -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
  38027. -filter_complex \
  38028. &quot; \
  38029. [0]hwupload[under]; \
  38030. [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
  38031. [under][over]overlay_cuda&quot; \
  38032. -c:v hevc_nvenc -cq 18 -preset slow output.mp4
  38033. </pre></div>
  38034. </li></ul>
  38035. </div>
  38036. </div>
  38037. <div class="section-level-extent" id="chromanr">
  38038. <h3 class="section"><span>39.27 chromanr<a class="copiable-link" href="#chromanr"> &para;</a></span></h3>
  38039. <p>Reduce chrominance noise.
  38040. </p>
  38041. <p>The filter accepts the following options:
  38042. </p>
  38043. <dl class="table">
  38044. <dt><samp class="option">thres</samp></dt>
  38045. <dd><p>Set threshold for averaging chrominance values.
  38046. Sum of absolute difference of Y, U and V pixel components of current
  38047. pixel and neighbour pixels lower than this threshold will be used in
  38048. averaging. Luma component is left unchanged and is copied to output.
  38049. Default value is 30. Allowed range is from 1 to 200.
  38050. </p>
  38051. </dd>
  38052. <dt><samp class="option">sizew</samp></dt>
  38053. <dd><p>Set horizontal radius of rectangle used for averaging.
  38054. Allowed range is from 1 to 100. Default value is 5.
  38055. </p>
  38056. </dd>
  38057. <dt><samp class="option">sizeh</samp></dt>
  38058. <dd><p>Set vertical radius of rectangle used for averaging.
  38059. Allowed range is from 1 to 100. Default value is 5.
  38060. </p>
  38061. </dd>
  38062. <dt><samp class="option">stepw</samp></dt>
  38063. <dd><p>Set horizontal step when averaging. Default value is 1.
  38064. Allowed range is from 1 to 50.
  38065. Mostly useful to speed-up filtering.
  38066. </p>
  38067. </dd>
  38068. <dt><samp class="option">steph</samp></dt>
  38069. <dd><p>Set vertical step when averaging. Default value is 1.
  38070. Allowed range is from 1 to 50.
  38071. Mostly useful to speed-up filtering.
  38072. </p>
  38073. </dd>
  38074. <dt><samp class="option">threy</samp></dt>
  38075. <dd><p>Set Y threshold for averaging chrominance values.
  38076. Set finer control for max allowed difference between Y components
  38077. of current pixel and neigbour pixels.
  38078. Default value is 200. Allowed range is from 1 to 200.
  38079. </p>
  38080. </dd>
  38081. <dt><samp class="option">threu</samp></dt>
  38082. <dd><p>Set U threshold for averaging chrominance values.
  38083. Set finer control for max allowed difference between U components
  38084. of current pixel and neigbour pixels.
  38085. Default value is 200. Allowed range is from 1 to 200.
  38086. </p>
  38087. </dd>
  38088. <dt><samp class="option">threv</samp></dt>
  38089. <dd><p>Set V threshold for averaging chrominance values.
  38090. Set finer control for max allowed difference between V components
  38091. of current pixel and neigbour pixels.
  38092. Default value is 200. Allowed range is from 1 to 200.
  38093. </p>
  38094. </dd>
  38095. <dt><samp class="option">distance</samp></dt>
  38096. <dd><p>Set distance type used in calculations.
  38097. </p>
  38098. <dl class="table">
  38099. <dt>&lsquo;<samp class="samp">manhattan</samp>&rsquo;</dt>
  38100. <dd><p>Absolute difference.
  38101. </p></dd>
  38102. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  38103. <dd><p>Difference squared.
  38104. </p></dd>
  38105. </dl>
  38106. <p>Default distance type is manhattan.
  38107. </p></dd>
  38108. </dl>
  38109. <ul class="mini-toc">
  38110. <li><a href="#Commands-64" accesskey="1">Commands</a></li>
  38111. </ul>
  38112. <div class="subsection-level-extent" id="Commands-64">
  38113. <h4 class="subsection"><span>39.27.1 Commands<a class="copiable-link" href="#Commands-64"> &para;</a></span></h4>
  38114. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  38115. The command accepts the same syntax of the corresponding option.
  38116. </p>
  38117. </div>
  38118. </div>
  38119. <div class="section-level-extent" id="chromashift">
  38120. <h3 class="section"><span>39.28 chromashift<a class="copiable-link" href="#chromashift"> &para;</a></span></h3>
  38121. <p>Shift chroma pixels horizontally and/or vertically.
  38122. </p>
  38123. <p>The filter accepts the following options:
  38124. </p><dl class="table">
  38125. <dt><samp class="option">cbh</samp></dt>
  38126. <dd><p>Set amount to shift chroma-blue horizontally.
  38127. </p></dd>
  38128. <dt><samp class="option">cbv</samp></dt>
  38129. <dd><p>Set amount to shift chroma-blue vertically.
  38130. </p></dd>
  38131. <dt><samp class="option">crh</samp></dt>
  38132. <dd><p>Set amount to shift chroma-red horizontally.
  38133. </p></dd>
  38134. <dt><samp class="option">crv</samp></dt>
  38135. <dd><p>Set amount to shift chroma-red vertically.
  38136. </p></dd>
  38137. <dt><samp class="option">edge</samp></dt>
  38138. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  38139. </p></dd>
  38140. </dl>
  38141. <ul class="mini-toc">
  38142. <li><a href="#Commands-65" accesskey="1">Commands</a></li>
  38143. </ul>
  38144. <div class="subsection-level-extent" id="Commands-65">
  38145. <h4 class="subsection"><span>39.28.1 Commands<a class="copiable-link" href="#Commands-65"> &para;</a></span></h4>
  38146. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38147. </p>
  38148. </div>
  38149. </div>
  38150. <div class="section-level-extent" id="ciescope">
  38151. <h3 class="section"><span>39.29 ciescope<a class="copiable-link" href="#ciescope"> &para;</a></span></h3>
  38152. <p>Display CIE color diagram with pixels overlaid onto it.
  38153. </p>
  38154. <p>The filter accepts the following options:
  38155. </p>
  38156. <dl class="table">
  38157. <dt><samp class="option">system</samp></dt>
  38158. <dd><p>Set color system.
  38159. </p>
  38160. <dl class="table">
  38161. <dt>&lsquo;<samp class="samp">ntsc, 470m</samp>&rsquo;</dt>
  38162. <dt>&lsquo;<samp class="samp">ebu, 470bg</samp>&rsquo;</dt>
  38163. <dt>&lsquo;<samp class="samp">smpte</samp>&rsquo;</dt>
  38164. <dt>&lsquo;<samp class="samp">240m</samp>&rsquo;</dt>
  38165. <dt>&lsquo;<samp class="samp">apple</samp>&rsquo;</dt>
  38166. <dt>&lsquo;<samp class="samp">widergb</samp>&rsquo;</dt>
  38167. <dt>&lsquo;<samp class="samp">cie1931</samp>&rsquo;</dt>
  38168. <dt>&lsquo;<samp class="samp">rec709, hdtv</samp>&rsquo;</dt>
  38169. <dt>&lsquo;<samp class="samp">uhdtv, rec2020</samp>&rsquo;</dt>
  38170. <dt>&lsquo;<samp class="samp">dcip3</samp>&rsquo;</dt>
  38171. </dl>
  38172. </dd>
  38173. <dt><samp class="option">cie</samp></dt>
  38174. <dd><p>Set CIE system.
  38175. </p>
  38176. <dl class="table">
  38177. <dt>&lsquo;<samp class="samp">xyy</samp>&rsquo;</dt>
  38178. <dt>&lsquo;<samp class="samp">ucs</samp>&rsquo;</dt>
  38179. <dt>&lsquo;<samp class="samp">luv</samp>&rsquo;</dt>
  38180. </dl>
  38181. </dd>
  38182. <dt><samp class="option">gamuts</samp></dt>
  38183. <dd><p>Set what gamuts to draw.
  38184. </p>
  38185. <p>See <code class="code">system</code> option for available values.
  38186. </p>
  38187. </dd>
  38188. <dt><samp class="option">size, s</samp></dt>
  38189. <dd><p>Set ciescope size, by default set to 512.
  38190. </p>
  38191. </dd>
  38192. <dt><samp class="option">intensity, i</samp></dt>
  38193. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  38194. </p>
  38195. </dd>
  38196. <dt><samp class="option">contrast</samp></dt>
  38197. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  38198. </p>
  38199. </dd>
  38200. <dt><samp class="option">corrgamma</samp></dt>
  38201. <dd><p>Correct gamma displayed on scope, by default enabled.
  38202. </p>
  38203. </dd>
  38204. <dt><samp class="option">showwhite</samp></dt>
  38205. <dd><p>Show white point on CIE diagram, by default disabled.
  38206. </p>
  38207. </dd>
  38208. <dt><samp class="option">gamma</samp></dt>
  38209. <dd><p>Set input gamma. Used only with XYZ input color space.
  38210. </p>
  38211. </dd>
  38212. <dt><samp class="option">fill</samp></dt>
  38213. <dd><p>Fill with CIE colors. By default is enabled.
  38214. </p></dd>
  38215. </dl>
  38216. </div>
  38217. <div class="section-level-extent" id="codecview">
  38218. <h3 class="section"><span>39.30 codecview<a class="copiable-link" href="#codecview"> &para;</a></span></h3>
  38219. <p>Visualize information exported by some codecs.
  38220. </p>
  38221. <p>Some codecs can export information through frames using side-data or other
  38222. means. For example, some MPEG based codecs export motion vectors through the
  38223. <var class="var">export_mvs</var> flag in the codec <samp class="option">flags2</samp> option.
  38224. </p>
  38225. <p>The filter accepts the following option:
  38226. </p>
  38227. <dl class="table">
  38228. <dt><samp class="option">block</samp></dt>
  38229. <dd><p>Display block partition structure using the luma plane.
  38230. </p>
  38231. </dd>
  38232. <dt><samp class="option">mv</samp></dt>
  38233. <dd><p>Set motion vectors to visualize.
  38234. </p>
  38235. <p>Available flags for <var class="var">mv</var> are:
  38236. </p>
  38237. <dl class="table">
  38238. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  38239. <dd><p>forward predicted MVs of P-frames
  38240. </p></dd>
  38241. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  38242. <dd><p>forward predicted MVs of B-frames
  38243. </p></dd>
  38244. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  38245. <dd><p>backward predicted MVs of B-frames
  38246. </p></dd>
  38247. </dl>
  38248. </dd>
  38249. <dt><samp class="option">qp</samp></dt>
  38250. <dd><p>Display quantization parameters using the chroma planes.
  38251. </p>
  38252. </dd>
  38253. <dt><samp class="option">mv_type, mvt</samp></dt>
  38254. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var class="var">frame_type</var> option.
  38255. </p>
  38256. <p>Available flags for <var class="var">mv_type</var> are:
  38257. </p>
  38258. <dl class="table">
  38259. <dt>&lsquo;<samp class="samp">fp</samp>&rsquo;</dt>
  38260. <dd><p>forward predicted MVs
  38261. </p></dd>
  38262. <dt>&lsquo;<samp class="samp">bp</samp>&rsquo;</dt>
  38263. <dd><p>backward predicted MVs
  38264. </p></dd>
  38265. </dl>
  38266. </dd>
  38267. <dt><samp class="option">frame_type, ft</samp></dt>
  38268. <dd><p>Set frame type to visualize motion vectors of.
  38269. </p>
  38270. <p>Available flags for <var class="var">frame_type</var> are:
  38271. </p>
  38272. <dl class="table">
  38273. <dt>&lsquo;<samp class="samp">if</samp>&rsquo;</dt>
  38274. <dd><p>intra-coded frames (I-frames)
  38275. </p></dd>
  38276. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  38277. <dd><p>predicted frames (P-frames)
  38278. </p></dd>
  38279. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  38280. <dd><p>bi-directionally predicted frames (B-frames)
  38281. </p></dd>
  38282. </dl>
  38283. </dd>
  38284. </dl>
  38285. <ul class="mini-toc">
  38286. <li><a href="#Examples-95" accesskey="1">Examples</a></li>
  38287. </ul>
  38288. <div class="subsection-level-extent" id="Examples-95">
  38289. <h4 class="subsection"><span>39.30.1 Examples<a class="copiable-link" href="#Examples-95"> &para;</a></span></h4>
  38290. <ul class="itemize mark-bullet">
  38291. <li>Visualize forward predicted MVs of all frames using <code class="command">ffplay</code>:
  38292. <div class="example">
  38293. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  38294. </pre></div>
  38295. </li><li>Visualize multi-directionals MVs of P and B-Frames using <code class="command">ffplay</code>:
  38296. <div class="example">
  38297. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  38298. </pre></div>
  38299. </li></ul>
  38300. </div>
  38301. </div>
  38302. <div class="section-level-extent" id="colorbalance">
  38303. <h3 class="section"><span>39.31 colorbalance<a class="copiable-link" href="#colorbalance"> &para;</a></span></h3>
  38304. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  38305. </p>
  38306. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  38307. regions for the red-cyan, green-magenta or blue-yellow balance.
  38308. </p>
  38309. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  38310. value towards the complementary color.
  38311. </p>
  38312. <p>The filter accepts the following options:
  38313. </p>
  38314. <dl class="table">
  38315. <dt><samp class="option">rs</samp></dt>
  38316. <dt><samp class="option">gs</samp></dt>
  38317. <dt><samp class="option">bs</samp></dt>
  38318. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  38319. </p>
  38320. </dd>
  38321. <dt><samp class="option">rm</samp></dt>
  38322. <dt><samp class="option">gm</samp></dt>
  38323. <dt><samp class="option">bm</samp></dt>
  38324. <dd><p>Adjust red, green and blue midtones (medium pixels).
  38325. </p>
  38326. </dd>
  38327. <dt><samp class="option">rh</samp></dt>
  38328. <dt><samp class="option">gh</samp></dt>
  38329. <dt><samp class="option">bh</samp></dt>
  38330. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  38331. </p>
  38332. <p>Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  38333. </p>
  38334. </dd>
  38335. <dt><samp class="option">pl</samp></dt>
  38336. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  38337. </p></dd>
  38338. </dl>
  38339. <ul class="mini-toc">
  38340. <li><a href="#Examples-96" accesskey="1">Examples</a></li>
  38341. <li><a href="#Commands-66" accesskey="2">Commands</a></li>
  38342. </ul>
  38343. <div class="subsection-level-extent" id="Examples-96">
  38344. <h4 class="subsection"><span>39.31.1 Examples<a class="copiable-link" href="#Examples-96"> &para;</a></span></h4>
  38345. <ul class="itemize mark-bullet">
  38346. <li>Add red color cast to shadows:
  38347. <div class="example">
  38348. <pre class="example-preformatted">colorbalance=rs=.3
  38349. </pre></div>
  38350. </li></ul>
  38351. </div>
  38352. <div class="subsection-level-extent" id="Commands-66">
  38353. <h4 class="subsection"><span>39.31.2 Commands<a class="copiable-link" href="#Commands-66"> &para;</a></span></h4>
  38354. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38355. </p>
  38356. </div>
  38357. </div>
  38358. <div class="section-level-extent" id="colorcontrast">
  38359. <h3 class="section"><span>39.32 colorcontrast<a class="copiable-link" href="#colorcontrast"> &para;</a></span></h3>
  38360. <p>Adjust color contrast between RGB components.
  38361. </p>
  38362. <p>The filter accepts the following options:
  38363. </p>
  38364. <dl class="table">
  38365. <dt><samp class="option">rc</samp></dt>
  38366. <dd><p>Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  38367. </p>
  38368. </dd>
  38369. <dt><samp class="option">gm</samp></dt>
  38370. <dd><p>Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  38371. </p>
  38372. </dd>
  38373. <dt><samp class="option">by</samp></dt>
  38374. <dd><p>Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  38375. </p>
  38376. </dd>
  38377. <dt><samp class="option">rcw</samp></dt>
  38378. <dt><samp class="option">gmw</samp></dt>
  38379. <dt><samp class="option">byw</samp></dt>
  38380. <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.
  38381. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled.
  38382. </p>
  38383. </dd>
  38384. <dt><samp class="option">pl</samp></dt>
  38385. <dd><p>Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  38386. </p></dd>
  38387. </dl>
  38388. <ul class="mini-toc">
  38389. <li><a href="#Commands-67" accesskey="1">Commands</a></li>
  38390. </ul>
  38391. <div class="subsection-level-extent" id="Commands-67">
  38392. <h4 class="subsection"><span>39.32.1 Commands<a class="copiable-link" href="#Commands-67"> &para;</a></span></h4>
  38393. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38394. </p>
  38395. </div>
  38396. </div>
  38397. <div class="section-level-extent" id="colorcorrect">
  38398. <h3 class="section"><span>39.33 colorcorrect<a class="copiable-link" href="#colorcorrect"> &para;</a></span></h3>
  38399. <p>Adjust color white balance selectively for blacks and whites.
  38400. This filter operates in YUV colorspace.
  38401. </p>
  38402. <p>The filter accepts the following options:
  38403. </p>
  38404. <dl class="table">
  38405. <dt><samp class="option">rl</samp></dt>
  38406. <dd><p>Set the red shadow spot. Allowed range is from -1.0 to 1.0.
  38407. Default value is 0.
  38408. </p>
  38409. </dd>
  38410. <dt><samp class="option">bl</samp></dt>
  38411. <dd><p>Set the blue shadow spot. Allowed range is from -1.0 to 1.0.
  38412. Default value is 0.
  38413. </p>
  38414. </dd>
  38415. <dt><samp class="option">rh</samp></dt>
  38416. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  38417. Default value is 0.
  38418. </p>
  38419. </dd>
  38420. <dt><samp class="option">bh</samp></dt>
  38421. <dd><p>Set the blue highlight spot. Allowed range is from -1.0 to 1.0.
  38422. Default value is 0.
  38423. </p>
  38424. </dd>
  38425. <dt><samp class="option">saturation</samp></dt>
  38426. <dd><p>Set the amount of saturation. Allowed range is from -3.0 to 3.0.
  38427. Default value is 1.
  38428. </p>
  38429. </dd>
  38430. <dt><samp class="option">analyze</samp></dt>
  38431. <dd><p>If set to anything other than <code class="code">manual</code> it will analyze every frame and use derived
  38432. parameters for filtering output frame.
  38433. </p>
  38434. <p>Possible values are:
  38435. </p><dl class="table">
  38436. <dt>&lsquo;<samp class="samp">manual</samp>&rsquo;</dt>
  38437. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  38438. <dt>&lsquo;<samp class="samp">minmax</samp>&rsquo;</dt>
  38439. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  38440. </dl>
  38441. <p>Default value is <code class="code">manual</code>.
  38442. </p></dd>
  38443. </dl>
  38444. <ul class="mini-toc">
  38445. <li><a href="#Commands-68" accesskey="1">Commands</a></li>
  38446. </ul>
  38447. <div class="subsection-level-extent" id="Commands-68">
  38448. <h4 class="subsection"><span>39.33.1 Commands<a class="copiable-link" href="#Commands-68"> &para;</a></span></h4>
  38449. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38450. </p>
  38451. </div>
  38452. </div>
  38453. <div class="section-level-extent" id="colorchannelmixer">
  38454. <h3 class="section"><span>39.34 colorchannelmixer<a class="copiable-link" href="#colorchannelmixer"> &para;</a></span></h3>
  38455. <p>Adjust video input frames by re-mixing color channels.
  38456. </p>
  38457. <p>This filter modifies a color channel by adding the values associated to
  38458. the other channels of the same pixels. For example if the value to
  38459. modify is red, the output value will be:
  38460. </p><div class="example">
  38461. <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>
  38462. </pre></div>
  38463. <p>The filter accepts the following options:
  38464. </p>
  38465. <dl class="table">
  38466. <dt><samp class="option">rr</samp></dt>
  38467. <dt><samp class="option">rg</samp></dt>
  38468. <dt><samp class="option">rb</samp></dt>
  38469. <dt><samp class="option">ra</samp></dt>
  38470. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  38471. 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>.
  38472. </p>
  38473. </dd>
  38474. <dt><samp class="option">gr</samp></dt>
  38475. <dt><samp class="option">gg</samp></dt>
  38476. <dt><samp class="option">gb</samp></dt>
  38477. <dt><samp class="option">ga</samp></dt>
  38478. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  38479. 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>.
  38480. </p>
  38481. </dd>
  38482. <dt><samp class="option">br</samp></dt>
  38483. <dt><samp class="option">bg</samp></dt>
  38484. <dt><samp class="option">bb</samp></dt>
  38485. <dt><samp class="option">ba</samp></dt>
  38486. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  38487. 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>.
  38488. </p>
  38489. </dd>
  38490. <dt><samp class="option">ar</samp></dt>
  38491. <dt><samp class="option">ag</samp></dt>
  38492. <dt><samp class="option">ab</samp></dt>
  38493. <dt><samp class="option">aa</samp></dt>
  38494. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  38495. 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>.
  38496. </p>
  38497. <p>Allowed ranges for options are <code class="code">[-2.0, 2.0]</code>.
  38498. </p>
  38499. </dd>
  38500. <dt><samp class="option">pc</samp></dt>
  38501. <dd><p>Set preserve color mode. The accepted values are:
  38502. </p><dl class="table">
  38503. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  38504. <dd><p>Disable color preserving, this is default.
  38505. </p></dd>
  38506. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  38507. <dd><p>Preserve luminance.
  38508. </p></dd>
  38509. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  38510. <dd><p>Preserve max value of RGB triplet.
  38511. </p></dd>
  38512. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  38513. <dd><p>Preserve average value of RGB triplet.
  38514. </p></dd>
  38515. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  38516. <dd><p>Preserve sum value of RGB triplet.
  38517. </p></dd>
  38518. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  38519. <dd><p>Preserve normalized value of RGB triplet.
  38520. </p></dd>
  38521. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  38522. <dd><p>Preserve power value of RGB triplet.
  38523. </p></dd>
  38524. </dl>
  38525. </dd>
  38526. <dt><samp class="option">pa</samp></dt>
  38527. <dd><p>Set the preserve color amount when changing colors. Allowed range is from <code class="code">[0.0, 1.0]</code>.
  38528. Default is <code class="code">0.0</code>, thus disabled.
  38529. </p></dd>
  38530. </dl>
  38531. <ul class="mini-toc">
  38532. <li><a href="#Examples-97" accesskey="1">Examples</a></li>
  38533. <li><a href="#Commands-69" accesskey="2">Commands</a></li>
  38534. </ul>
  38535. <div class="subsection-level-extent" id="Examples-97">
  38536. <h4 class="subsection"><span>39.34.1 Examples<a class="copiable-link" href="#Examples-97"> &para;</a></span></h4>
  38537. <ul class="itemize mark-bullet">
  38538. <li>Convert source to grayscale:
  38539. <div class="example">
  38540. <pre class="example-preformatted">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  38541. </pre></div>
  38542. </li><li>Simulate sepia tones:
  38543. <div class="example">
  38544. <pre class="example-preformatted">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  38545. </pre></div>
  38546. </li></ul>
  38547. </div>
  38548. <div class="subsection-level-extent" id="Commands-69">
  38549. <h4 class="subsection"><span>39.34.2 Commands<a class="copiable-link" href="#Commands-69"> &para;</a></span></h4>
  38550. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38551. </p>
  38552. </div>
  38553. </div>
  38554. <div class="section-level-extent" id="colorize">
  38555. <h3 class="section"><span>39.35 colorize<a class="copiable-link" href="#colorize"> &para;</a></span></h3>
  38556. <p>Overlay a solid color on the video stream.
  38557. </p>
  38558. <p>The filter accepts the following options:
  38559. </p>
  38560. <dl class="table">
  38561. <dt><samp class="option">hue</samp></dt>
  38562. <dd><p>Set the color hue. Allowed range is from 0 to 360.
  38563. Default value is 0.
  38564. </p>
  38565. </dd>
  38566. <dt><samp class="option">saturation</samp></dt>
  38567. <dd><p>Set the color saturation. Allowed range is from 0 to 1.
  38568. Default value is 0.5.
  38569. </p>
  38570. </dd>
  38571. <dt><samp class="option">lightness</samp></dt>
  38572. <dd><p>Set the color lightness. Allowed range is from 0 to 1.
  38573. Default value is 0.5.
  38574. </p>
  38575. </dd>
  38576. <dt><samp class="option">mix</samp></dt>
  38577. <dd><p>Set the mix of source lightness. By default is set to 1.0.
  38578. Allowed range is from 0.0 to 1.0.
  38579. </p></dd>
  38580. </dl>
  38581. <ul class="mini-toc">
  38582. <li><a href="#Commands-70" accesskey="1">Commands</a></li>
  38583. </ul>
  38584. <div class="subsection-level-extent" id="Commands-70">
  38585. <h4 class="subsection"><span>39.35.1 Commands<a class="copiable-link" href="#Commands-70"> &para;</a></span></h4>
  38586. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38587. </p>
  38588. </div>
  38589. </div>
  38590. <div class="section-level-extent" id="colorkey">
  38591. <h3 class="section"><span>39.36 colorkey<a class="copiable-link" href="#colorkey"> &para;</a></span></h3>
  38592. <p>RGB colorspace color keying.
  38593. This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel
  38594. which falls within the similarity radius of the key color to 0. The alpha value for pixels outside
  38595. the similarity radius depends on the value of the blend option.
  38596. </p>
  38597. <p>The filter accepts the following options:
  38598. </p>
  38599. <dl class="table">
  38600. <dt><samp class="option">color</samp></dt>
  38601. <dd><p>Set the color for which alpha will be set to 0 (full transparency).
  38602. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  38603. Default is <code class="code">black</code>.
  38604. </p>
  38605. </dd>
  38606. <dt><samp class="option">similarity</samp></dt>
  38607. <dd><p>Set the radius from the key color within which other colors also have full transparency.
  38608. The computed distance is related to the unit fractional distance in 3D space between the RGB values
  38609. 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
  38610. around the exact key color, while 1.0 matches everything.
  38611. Default is <code class="code">0.01</code>.
  38612. </p>
  38613. </dd>
  38614. <dt><samp class="option">blend</samp></dt>
  38615. <dd><p>Set how the alpha value for pixels that fall outside the similarity radius is computed.
  38616. 0.0 makes pixels either fully transparent or fully opaque.
  38617. Higher values result in semi-transparent pixels, with greater transparency
  38618. the more similar the pixel color is to the key color.
  38619. Range is 0.0 to 1.0. Default is <code class="code">0.0</code>.
  38620. </p></dd>
  38621. </dl>
  38622. <ul class="mini-toc">
  38623. <li><a href="#Examples-98" accesskey="1">Examples</a></li>
  38624. <li><a href="#Commands-71" accesskey="2">Commands</a></li>
  38625. </ul>
  38626. <div class="subsection-level-extent" id="Examples-98">
  38627. <h4 class="subsection"><span>39.36.1 Examples<a class="copiable-link" href="#Examples-98"> &para;</a></span></h4>
  38628. <ul class="itemize mark-bullet">
  38629. <li>Make every green pixel in the input image transparent:
  38630. <div class="example">
  38631. <pre class="example-preformatted">ffmpeg -i input.png -vf colorkey=green out.png
  38632. </pre></div>
  38633. </li><li>Overlay a greenscreen-video on top of a static background image.
  38634. <div class="example">
  38635. <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
  38636. </pre></div>
  38637. </li></ul>
  38638. </div>
  38639. <div class="subsection-level-extent" id="Commands-71">
  38640. <h4 class="subsection"><span>39.36.2 Commands<a class="copiable-link" href="#Commands-71"> &para;</a></span></h4>
  38641. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  38642. The command accepts the same syntax of the corresponding option.
  38643. </p>
  38644. <p>If the specified expression is not valid, it is kept at its current
  38645. value.
  38646. </p>
  38647. </div>
  38648. </div>
  38649. <div class="section-level-extent" id="colorhold">
  38650. <h3 class="section"><span>39.37 colorhold<a class="copiable-link" href="#colorhold"> &para;</a></span></h3>
  38651. <p>Remove all color information for all RGB colors except for certain one.
  38652. </p>
  38653. <p>The filter accepts the following options:
  38654. </p>
  38655. <dl class="table">
  38656. <dt><samp class="option">color</samp></dt>
  38657. <dd><p>The color which will not be replaced with neutral gray.
  38658. </p>
  38659. </dd>
  38660. <dt><samp class="option">similarity</samp></dt>
  38661. <dd><p>Similarity percentage with the above color.
  38662. 0.01 matches only the exact key color, while 1.0 matches everything.
  38663. </p>
  38664. </dd>
  38665. <dt><samp class="option">blend</samp></dt>
  38666. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  38667. Higher values result in more preserved color.
  38668. </p></dd>
  38669. </dl>
  38670. <ul class="mini-toc">
  38671. <li><a href="#Commands-72" accesskey="1">Commands</a></li>
  38672. </ul>
  38673. <div class="subsection-level-extent" id="Commands-72">
  38674. <h4 class="subsection"><span>39.37.1 Commands<a class="copiable-link" href="#Commands-72"> &para;</a></span></h4>
  38675. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  38676. The command accepts the same syntax of the corresponding option.
  38677. </p>
  38678. <p>If the specified expression is not valid, it is kept at its current
  38679. value.
  38680. </p>
  38681. </div>
  38682. </div>
  38683. <div class="section-level-extent" id="colorlevels">
  38684. <h3 class="section"><span>39.38 colorlevels<a class="copiable-link" href="#colorlevels"> &para;</a></span></h3>
  38685. <p>Adjust video input frames using levels.
  38686. </p>
  38687. <p>The filter accepts the following options:
  38688. </p>
  38689. <dl class="table">
  38690. <dt><samp class="option">rimin</samp></dt>
  38691. <dt><samp class="option">gimin</samp></dt>
  38692. <dt><samp class="option">bimin</samp></dt>
  38693. <dt><samp class="option">aimin</samp></dt>
  38694. <dd><p>Adjust red, green, blue and alpha input black point.
  38695. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  38696. </p>
  38697. </dd>
  38698. <dt><samp class="option">rimax</samp></dt>
  38699. <dt><samp class="option">gimax</samp></dt>
  38700. <dt><samp class="option">bimax</samp></dt>
  38701. <dt><samp class="option">aimax</samp></dt>
  38702. <dd><p>Adjust red, green, blue and alpha input white point.
  38703. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">1</code>.
  38704. </p>
  38705. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  38706. (dark tones), change the balance of bright and dark tones.
  38707. </p>
  38708. </dd>
  38709. <dt><samp class="option">romin</samp></dt>
  38710. <dt><samp class="option">gomin</samp></dt>
  38711. <dt><samp class="option">bomin</samp></dt>
  38712. <dt><samp class="option">aomin</samp></dt>
  38713. <dd><p>Adjust red, green, blue and alpha output black point.
  38714. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">0</code>.
  38715. </p>
  38716. </dd>
  38717. <dt><samp class="option">romax</samp></dt>
  38718. <dt><samp class="option">gomax</samp></dt>
  38719. <dt><samp class="option">bomax</samp></dt>
  38720. <dt><samp class="option">aomax</samp></dt>
  38721. <dd><p>Adjust red, green, blue and alpha output white point.
  38722. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">1</code>.
  38723. </p>
  38724. <p>Output levels allows manual selection of a constrained output level range.
  38725. </p>
  38726. </dd>
  38727. <dt><samp class="option">preserve</samp></dt>
  38728. <dd><p>Set preserve color mode. The accepted values are:
  38729. </p><dl class="table">
  38730. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  38731. <dd><p>Disable color preserving, this is default.
  38732. </p></dd>
  38733. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  38734. <dd><p>Preserve luminance.
  38735. </p></dd>
  38736. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  38737. <dd><p>Preserve max value of RGB triplet.
  38738. </p></dd>
  38739. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  38740. <dd><p>Preserve average value of RGB triplet.
  38741. </p></dd>
  38742. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  38743. <dd><p>Preserve sum value of RGB triplet.
  38744. </p></dd>
  38745. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  38746. <dd><p>Preserve normalized value of RGB triplet.
  38747. </p></dd>
  38748. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  38749. <dd><p>Preserve power value of RGB triplet.
  38750. </p></dd>
  38751. </dl>
  38752. </dd>
  38753. </dl>
  38754. <ul class="mini-toc">
  38755. <li><a href="#Examples-99" accesskey="1">Examples</a></li>
  38756. <li><a href="#Commands-73" accesskey="2">Commands</a></li>
  38757. </ul>
  38758. <div class="subsection-level-extent" id="Examples-99">
  38759. <h4 class="subsection"><span>39.38.1 Examples<a class="copiable-link" href="#Examples-99"> &para;</a></span></h4>
  38760. <ul class="itemize mark-bullet">
  38761. <li>Make video output darker:
  38762. <div class="example">
  38763. <pre class="example-preformatted">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  38764. </pre></div>
  38765. </li><li>Increase contrast:
  38766. <div class="example">
  38767. <pre class="example-preformatted">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  38768. </pre></div>
  38769. </li><li>Make video output lighter:
  38770. <div class="example">
  38771. <pre class="example-preformatted">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  38772. </pre></div>
  38773. </li><li>Increase brightness:
  38774. <div class="example">
  38775. <pre class="example-preformatted">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  38776. </pre></div>
  38777. </li></ul>
  38778. </div>
  38779. <div class="subsection-level-extent" id="Commands-73">
  38780. <h4 class="subsection"><span>39.38.2 Commands<a class="copiable-link" href="#Commands-73"> &para;</a></span></h4>
  38781. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  38782. </p>
  38783. </div>
  38784. </div>
  38785. <div class="section-level-extent" id="colormap">
  38786. <h3 class="section"><span>39.39 colormap<a class="copiable-link" href="#colormap"> &para;</a></span></h3>
  38787. <p>Apply custom color maps to video stream.
  38788. </p>
  38789. <p>This filter needs three input video streams.
  38790. First stream is video stream that is going to be filtered out.
  38791. Second and third video stream specify color patches for source
  38792. color to target color mapping.
  38793. </p>
  38794. <p>The filter accepts the following options:
  38795. </p>
  38796. <dl class="table">
  38797. <dt><samp class="option">patch_size</samp></dt>
  38798. <dd><p>Set the source and target video stream patch size in pixels.
  38799. </p>
  38800. </dd>
  38801. <dt><samp class="option">nb_patches</samp></dt>
  38802. <dd><p>Set the max number of used patches from source and target video stream.
  38803. Default value is number of patches available in additional video streams.
  38804. Max allowed number of patches is <code class="code">64</code>.
  38805. </p>
  38806. </dd>
  38807. <dt><samp class="option">type</samp></dt>
  38808. <dd><p>Set the adjustments used for target colors. Can be <code class="code">relative</code> or <code class="code">absolute</code>.
  38809. Defaults is <code class="code">absolute</code>.
  38810. </p>
  38811. </dd>
  38812. <dt><samp class="option">kernel</samp></dt>
  38813. <dd><p>Set the kernel used to measure color differences between mapped colors.
  38814. </p>
  38815. <p>The accepted values are:
  38816. </p><dl class="table">
  38817. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  38818. <dt>&lsquo;<samp class="samp">weuclidean</samp>&rsquo;</dt>
  38819. </dl>
  38820. <p>Default is <code class="code">euclidean</code>.
  38821. </p></dd>
  38822. </dl>
  38823. </div>
  38824. <div class="section-level-extent" id="colormatrix">
  38825. <h3 class="section"><span>39.40 colormatrix<a class="copiable-link" href="#colormatrix"> &para;</a></span></h3>
  38826. <p>Convert color matrix.
  38827. </p>
  38828. <p>The filter accepts the following options:
  38829. </p>
  38830. <dl class="table">
  38831. <dt><samp class="option">src</samp></dt>
  38832. <dt><samp class="option">dst</samp></dt>
  38833. <dd><p>Specify the source and destination color matrix. Both values must be
  38834. specified.
  38835. </p>
  38836. <p>The accepted values are:
  38837. </p><dl class="table">
  38838. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38839. <dd><p>BT.709
  38840. </p>
  38841. </dd>
  38842. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  38843. <dd><p>FCC
  38844. </p>
  38845. </dd>
  38846. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  38847. <dd><p>BT.601
  38848. </p>
  38849. </dd>
  38850. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  38851. <dd><p>BT.470
  38852. </p>
  38853. </dd>
  38854. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38855. <dd><p>BT.470BG
  38856. </p>
  38857. </dd>
  38858. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38859. <dd><p>SMPTE-170M
  38860. </p>
  38861. </dd>
  38862. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38863. <dd><p>SMPTE-240M
  38864. </p>
  38865. </dd>
  38866. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  38867. <dd><p>BT.2020
  38868. </p></dd>
  38869. </dl>
  38870. </dd>
  38871. </dl>
  38872. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  38873. </p><div class="example">
  38874. <pre class="example-preformatted">colormatrix=bt601:smpte240m
  38875. </pre></div>
  38876. </div>
  38877. <div class="section-level-extent" id="colorspace">
  38878. <h3 class="section"><span>39.41 colorspace<a class="copiable-link" href="#colorspace"> &para;</a></span></h3>
  38879. <p>Convert colorspace, transfer characteristics or color primaries.
  38880. Input video needs to have an even size.
  38881. </p>
  38882. <p>The filter accepts the following options:
  38883. </p>
  38884. <dl class="table">
  38885. <dd><a class="anchor" id="all"></a></dd>
  38886. <dt><samp class="option">all</samp></dt>
  38887. <dd><p>Specify all color properties at once.
  38888. </p>
  38889. <p>The accepted values are:
  38890. </p><dl class="table">
  38891. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  38892. <dd><p>BT.470M
  38893. </p>
  38894. </dd>
  38895. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38896. <dd><p>BT.470BG
  38897. </p>
  38898. </dd>
  38899. <dt>&lsquo;<samp class="samp">bt601-6-525</samp>&rsquo;</dt>
  38900. <dd><p>BT.601-6 525
  38901. </p>
  38902. </dd>
  38903. <dt>&lsquo;<samp class="samp">bt601-6-625</samp>&rsquo;</dt>
  38904. <dd><p>BT.601-6 625
  38905. </p>
  38906. </dd>
  38907. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38908. <dd><p>BT.709
  38909. </p>
  38910. </dd>
  38911. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38912. <dd><p>SMPTE-170M
  38913. </p>
  38914. </dd>
  38915. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38916. <dd><p>SMPTE-240M
  38917. </p>
  38918. </dd>
  38919. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  38920. <dd><p>BT.2020
  38921. </p>
  38922. </dd>
  38923. </dl>
  38924. <a class="anchor" id="space"></a></dd>
  38925. <dt><samp class="option">space</samp></dt>
  38926. <dd><p>Specify output colorspace.
  38927. </p>
  38928. <p>The accepted values are:
  38929. </p><dl class="table">
  38930. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38931. <dd><p>BT.709
  38932. </p>
  38933. </dd>
  38934. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  38935. <dd><p>FCC
  38936. </p>
  38937. </dd>
  38938. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38939. <dd><p>BT.470BG or BT.601-6 625
  38940. </p>
  38941. </dd>
  38942. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38943. <dd><p>SMPTE-170M or BT.601-6 525
  38944. </p>
  38945. </dd>
  38946. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38947. <dd><p>SMPTE-240M
  38948. </p>
  38949. </dd>
  38950. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  38951. <dd><p>YCgCo
  38952. </p>
  38953. </dd>
  38954. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  38955. <dd><p>BT.2020 with non-constant luminance
  38956. </p>
  38957. </dd>
  38958. </dl>
  38959. <a class="anchor" id="trc"></a></dd>
  38960. <dt><samp class="option">trc</samp></dt>
  38961. <dd><p>Specify output transfer characteristics.
  38962. </p>
  38963. <p>The accepted values are:
  38964. </p><dl class="table">
  38965. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  38966. <dd><p>BT.709
  38967. </p>
  38968. </dd>
  38969. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  38970. <dd><p>BT.470M
  38971. </p>
  38972. </dd>
  38973. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  38974. <dd><p>BT.470BG
  38975. </p>
  38976. </dd>
  38977. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  38978. <dd><p>Constant gamma of 2.2
  38979. </p>
  38980. </dd>
  38981. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  38982. <dd><p>Constant gamma of 2.8
  38983. </p>
  38984. </dd>
  38985. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  38986. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  38987. </p>
  38988. </dd>
  38989. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  38990. <dd><p>SMPTE-240M
  38991. </p>
  38992. </dd>
  38993. <dt>&lsquo;<samp class="samp">srgb</samp>&rsquo;</dt>
  38994. <dd><p>SRGB
  38995. </p>
  38996. </dd>
  38997. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  38998. <dd><p>iec61966-2-1
  38999. </p>
  39000. </dd>
  39001. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  39002. <dd><p>iec61966-2-4
  39003. </p>
  39004. </dd>
  39005. <dt>&lsquo;<samp class="samp">xvycc</samp>&rsquo;</dt>
  39006. <dd><p>xvycc
  39007. </p>
  39008. </dd>
  39009. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  39010. <dd><p>BT.2020 for 10-bits content
  39011. </p>
  39012. </dd>
  39013. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  39014. <dd><p>BT.2020 for 12-bits content
  39015. </p>
  39016. </dd>
  39017. </dl>
  39018. <a class="anchor" id="primaries"></a></dd>
  39019. <dt><samp class="option">primaries</samp></dt>
  39020. <dd><p>Specify output color primaries.
  39021. </p>
  39022. <p>The accepted values are:
  39023. </p><dl class="table">
  39024. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  39025. <dd><p>BT.709
  39026. </p>
  39027. </dd>
  39028. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  39029. <dd><p>BT.470M
  39030. </p>
  39031. </dd>
  39032. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  39033. <dd><p>BT.470BG or BT.601-6 625
  39034. </p>
  39035. </dd>
  39036. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  39037. <dd><p>SMPTE-170M or BT.601-6 525
  39038. </p>
  39039. </dd>
  39040. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  39041. <dd><p>SMPTE-240M
  39042. </p>
  39043. </dd>
  39044. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  39045. <dd><p>film
  39046. </p>
  39047. </dd>
  39048. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  39049. <dd><p>SMPTE-431
  39050. </p>
  39051. </dd>
  39052. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  39053. <dd><p>SMPTE-432
  39054. </p>
  39055. </dd>
  39056. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  39057. <dd><p>BT.2020
  39058. </p>
  39059. </dd>
  39060. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  39061. <dd><p>JEDEC P22 phosphors
  39062. </p>
  39063. </dd>
  39064. </dl>
  39065. <a class="anchor" id="range"></a></dd>
  39066. <dt><samp class="option">range</samp></dt>
  39067. <dd><p>Specify output color range.
  39068. </p>
  39069. <p>The accepted values are:
  39070. </p><dl class="table">
  39071. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  39072. <dd><p>TV (restricted) range
  39073. </p>
  39074. </dd>
  39075. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  39076. <dd><p>MPEG (restricted) range
  39077. </p>
  39078. </dd>
  39079. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  39080. <dd><p>PC (full) range
  39081. </p>
  39082. </dd>
  39083. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  39084. <dd><p>JPEG (full) range
  39085. </p>
  39086. </dd>
  39087. </dl>
  39088. </dd>
  39089. <dt><samp class="option">format</samp></dt>
  39090. <dd><p>Specify output color format.
  39091. </p>
  39092. <p>The accepted values are:
  39093. </p><dl class="table">
  39094. <dt>&lsquo;<samp class="samp">yuv420p</samp>&rsquo;</dt>
  39095. <dd><p>YUV 4:2:0 planar 8-bits
  39096. </p>
  39097. </dd>
  39098. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  39099. <dd><p>YUV 4:2:0 planar 10-bits
  39100. </p>
  39101. </dd>
  39102. <dt>&lsquo;<samp class="samp">yuv420p12</samp>&rsquo;</dt>
  39103. <dd><p>YUV 4:2:0 planar 12-bits
  39104. </p>
  39105. </dd>
  39106. <dt>&lsquo;<samp class="samp">yuv422p</samp>&rsquo;</dt>
  39107. <dd><p>YUV 4:2:2 planar 8-bits
  39108. </p>
  39109. </dd>
  39110. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  39111. <dd><p>YUV 4:2:2 planar 10-bits
  39112. </p>
  39113. </dd>
  39114. <dt>&lsquo;<samp class="samp">yuv422p12</samp>&rsquo;</dt>
  39115. <dd><p>YUV 4:2:2 planar 12-bits
  39116. </p>
  39117. </dd>
  39118. <dt>&lsquo;<samp class="samp">yuv444p</samp>&rsquo;</dt>
  39119. <dd><p>YUV 4:4:4 planar 8-bits
  39120. </p>
  39121. </dd>
  39122. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  39123. <dd><p>YUV 4:4:4 planar 10-bits
  39124. </p>
  39125. </dd>
  39126. <dt>&lsquo;<samp class="samp">yuv444p12</samp>&rsquo;</dt>
  39127. <dd><p>YUV 4:4:4 planar 12-bits
  39128. </p>
  39129. </dd>
  39130. </dl>
  39131. </dd>
  39132. <dt><samp class="option">fast</samp></dt>
  39133. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  39134. significantly less CPU, but will be mathematically incorrect. To get output
  39135. compatible with that produced by the colormatrix filter, use fast=1.
  39136. </p>
  39137. </dd>
  39138. <dt><samp class="option">dither</samp></dt>
  39139. <dd><p>Specify dithering mode.
  39140. </p>
  39141. <p>The accepted values are:
  39142. </p><dl class="table">
  39143. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  39144. <dd><p>No dithering
  39145. </p>
  39146. </dd>
  39147. <dt>&lsquo;<samp class="samp">fsb</samp>&rsquo;</dt>
  39148. <dd><p>Floyd-Steinberg dithering
  39149. </p></dd>
  39150. </dl>
  39151. </dd>
  39152. <dt><samp class="option">wpadapt</samp></dt>
  39153. <dd><p>Whitepoint adaptation mode.
  39154. </p>
  39155. <p>The accepted values are:
  39156. </p><dl class="table">
  39157. <dt>&lsquo;<samp class="samp">bradford</samp>&rsquo;</dt>
  39158. <dd><p>Bradford whitepoint adaptation
  39159. </p>
  39160. </dd>
  39161. <dt>&lsquo;<samp class="samp">vonkries</samp>&rsquo;</dt>
  39162. <dd><p>von Kries whitepoint adaptation
  39163. </p>
  39164. </dd>
  39165. <dt>&lsquo;<samp class="samp">identity</samp>&rsquo;</dt>
  39166. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  39167. </p></dd>
  39168. </dl>
  39169. </dd>
  39170. <dt><samp class="option">iall</samp></dt>
  39171. <dd><p>Override all input properties at once. Same accepted values as <a class="ref" href="#all">all</a>.
  39172. </p>
  39173. </dd>
  39174. <dt><samp class="option">ispace</samp></dt>
  39175. <dd><p>Override input colorspace. Same accepted values as <a class="ref" href="#space">space</a>.
  39176. </p>
  39177. </dd>
  39178. <dt><samp class="option">iprimaries</samp></dt>
  39179. <dd><p>Override input color primaries. Same accepted values as <a class="ref" href="#primaries">primaries</a>.
  39180. </p>
  39181. </dd>
  39182. <dt><samp class="option">itrc</samp></dt>
  39183. <dd><p>Override input transfer characteristics. Same accepted values as <a class="ref" href="#trc">trc</a>.
  39184. </p>
  39185. </dd>
  39186. <dt><samp class="option">irange</samp></dt>
  39187. <dd><p>Override input color range. Same accepted values as <a class="ref" href="#range">range</a>.
  39188. </p>
  39189. </dd>
  39190. </dl>
  39191. <p>The filter converts the transfer characteristics, color space and color
  39192. primaries to the specified user values. The output value, if not specified,
  39193. is set to a default value based on the &quot;all&quot; property. If that property is
  39194. also not specified, the filter will log an error. The output color range and
  39195. format default to the same value as the input color range and format. The
  39196. input transfer characteristics, color space, color primaries and color range
  39197. should be set on the input data. If any of these are missing, the filter will
  39198. log an error and no conversion will take place.
  39199. </p>
  39200. <p>For example to convert the input to SMPTE-240M, use the command:
  39201. </p><div class="example">
  39202. <pre class="example-preformatted">colorspace=smpte240m
  39203. </pre></div>
  39204. </div>
  39205. <div class="section-level-extent" id="colorspace_005fcuda">
  39206. <h3 class="section"><span>39.42 colorspace_cuda<a class="copiable-link" href="#colorspace_005fcuda"> &para;</a></span></h3>
  39207. <p>CUDA accelerated implementation of the colorspace filter.
  39208. </p>
  39209. <p>It is by no means feature complete compared to the software colorspace filter,
  39210. and at the current time only supports color range conversion between jpeg/full
  39211. and mpeg/limited range.
  39212. </p>
  39213. <p>The filter accepts the following options:
  39214. </p>
  39215. <dl class="table">
  39216. <dt><samp class="option">range</samp></dt>
  39217. <dd><p>Specify output color range.
  39218. </p>
  39219. <p>The accepted values are:
  39220. </p><dl class="table">
  39221. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  39222. <dd><p>TV (restricted) range
  39223. </p>
  39224. </dd>
  39225. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  39226. <dd><p>MPEG (restricted) range
  39227. </p>
  39228. </dd>
  39229. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  39230. <dd><p>PC (full) range
  39231. </p>
  39232. </dd>
  39233. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  39234. <dd><p>JPEG (full) range
  39235. </p>
  39236. </dd>
  39237. </dl>
  39238. </dd>
  39239. </dl>
  39240. </div>
  39241. <div class="section-level-extent" id="colortemperature">
  39242. <h3 class="section"><span>39.43 colortemperature<a class="copiable-link" href="#colortemperature"> &para;</a></span></h3>
  39243. <p>Adjust color temperature in video to simulate variations in ambient color temperature.
  39244. </p>
  39245. <p>The filter accepts the following options:
  39246. </p>
  39247. <dl class="table">
  39248. <dt><samp class="option">temperature</samp></dt>
  39249. <dd><p>Set the temperature in Kelvin. Allowed range is from 1000 to 40000.
  39250. Default value is 6500 K.
  39251. </p>
  39252. </dd>
  39253. <dt><samp class="option">mix</samp></dt>
  39254. <dd><p>Set mixing with filtered output. Allowed range is from 0 to 1.
  39255. Default value is 1.
  39256. </p>
  39257. </dd>
  39258. <dt><samp class="option">pl</samp></dt>
  39259. <dd><p>Set the amount of preserving lightness. Allowed range is from 0 to 1.
  39260. Default value is 0.
  39261. </p></dd>
  39262. </dl>
  39263. <ul class="mini-toc">
  39264. <li><a href="#Commands-74" accesskey="1">Commands</a></li>
  39265. </ul>
  39266. <div class="subsection-level-extent" id="Commands-74">
  39267. <h4 class="subsection"><span>39.43.1 Commands<a class="copiable-link" href="#Commands-74"> &para;</a></span></h4>
  39268. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  39269. </p>
  39270. </div>
  39271. </div>
  39272. <div class="section-level-extent" id="convolution">
  39273. <h3 class="section"><span>39.44 convolution<a class="copiable-link" href="#convolution"> &para;</a></span></h3>
  39274. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  39275. </p>
  39276. <p>The filter accepts the following options:
  39277. </p>
  39278. <dl class="table">
  39279. <dt><samp class="option">0m</samp></dt>
  39280. <dt><samp class="option">1m</samp></dt>
  39281. <dt><samp class="option">2m</samp></dt>
  39282. <dt><samp class="option">3m</samp></dt>
  39283. <dd><p>Set matrix for each plane.
  39284. Matrix is sequence of 9, 25 or 49 signed integers in <var class="var">square</var> mode,
  39285. and from 1 to 49 odd number of signed integers in <var class="var">row</var> mode.
  39286. </p>
  39287. </dd>
  39288. <dt><samp class="option">0rdiv</samp></dt>
  39289. <dt><samp class="option">1rdiv</samp></dt>
  39290. <dt><samp class="option">2rdiv</samp></dt>
  39291. <dt><samp class="option">3rdiv</samp></dt>
  39292. <dd><p>Set multiplier for calculated value for each plane.
  39293. If unset or 0, it will be 1/sum of all matrix elements.
  39294. </p>
  39295. </dd>
  39296. <dt><samp class="option">0bias</samp></dt>
  39297. <dt><samp class="option">1bias</samp></dt>
  39298. <dt><samp class="option">2bias</samp></dt>
  39299. <dt><samp class="option">3bias</samp></dt>
  39300. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  39301. Useful for making the overall image brighter or darker. Default is 0.0.
  39302. </p>
  39303. </dd>
  39304. <dt><samp class="option">0mode</samp></dt>
  39305. <dt><samp class="option">1mode</samp></dt>
  39306. <dt><samp class="option">2mode</samp></dt>
  39307. <dt><samp class="option">3mode</samp></dt>
  39308. <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>.
  39309. Default is <var class="var">square</var>.
  39310. </p></dd>
  39311. </dl>
  39312. <ul class="mini-toc">
  39313. <li><a href="#Commands-75" accesskey="1">Commands</a></li>
  39314. <li><a href="#Examples-100" accesskey="2">Examples</a></li>
  39315. </ul>
  39316. <div class="subsection-level-extent" id="Commands-75">
  39317. <h4 class="subsection"><span>39.44.1 Commands<a class="copiable-link" href="#Commands-75"> &para;</a></span></h4>
  39318. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  39319. </p>
  39320. </div>
  39321. <div class="subsection-level-extent" id="Examples-100">
  39322. <h4 class="subsection"><span>39.44.2 Examples<a class="copiable-link" href="#Examples-100"> &para;</a></span></h4>
  39323. <ul class="itemize mark-bullet">
  39324. <li>Apply sharpen:
  39325. <div class="example">
  39326. <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;
  39327. </pre></div>
  39328. </li><li>Apply blur:
  39329. <div class="example">
  39330. <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;
  39331. </pre></div>
  39332. </li><li>Apply edge enhance:
  39333. <div class="example">
  39334. <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;
  39335. </pre></div>
  39336. </li><li>Apply edge detect:
  39337. <div class="example">
  39338. <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;
  39339. </pre></div>
  39340. </li><li>Apply laplacian edge detector which includes diagonals:
  39341. <div class="example">
  39342. <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;
  39343. </pre></div>
  39344. </li><li>Apply emboss:
  39345. <div class="example">
  39346. <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;
  39347. </pre></div>
  39348. </li></ul>
  39349. </div>
  39350. </div>
  39351. <div class="section-level-extent" id="convolve">
  39352. <h3 class="section"><span>39.45 convolve<a class="copiable-link" href="#convolve"> &para;</a></span></h3>
  39353. <p>Apply 2D convolution of video stream in frequency domain using second stream
  39354. as impulse.
  39355. </p>
  39356. <p>The filter accepts the following options:
  39357. </p>
  39358. <dl class="table">
  39359. <dt><samp class="option">planes</samp></dt>
  39360. <dd><p>Set which planes to process.
  39361. </p>
  39362. </dd>
  39363. <dt><samp class="option">impulse</samp></dt>
  39364. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  39365. or <var class="var">all</var>. Default is <var class="var">all</var>.
  39366. </p></dd>
  39367. </dl>
  39368. <p>The <code class="code">convolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  39369. </p>
  39370. </div>
  39371. <div class="section-level-extent" id="copy">
  39372. <h3 class="section"><span>39.46 copy<a class="copiable-link" href="#copy"> &para;</a></span></h3>
  39373. <p>Copy the input video source unchanged to the output. This is mainly useful for
  39374. testing purposes.
  39375. </p>
  39376. <a class="anchor" id="coreimage"></a></div>
  39377. <div class="section-level-extent" id="coreimage-1">
  39378. <h3 class="section"><span>39.47 coreimage<a class="copiable-link" href="#coreimage-1"> &para;</a></span></h3>
  39379. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  39380. </p>
  39381. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  39382. processed by video hardware. However, software-based OpenGL implementations
  39383. exist which means there is no guarantee for hardware processing. It depends on
  39384. the respective OSX.
  39385. </p>
  39386. <p>There are many filters and image generators provided by Apple that come with a
  39387. large variety of options. The filter has to be referenced by its name along
  39388. with its options.
  39389. </p>
  39390. <p>The coreimage filter accepts the following options:
  39391. </p><dl class="table">
  39392. <dt><samp class="option">list_filters</samp></dt>
  39393. <dd><p>List all available filters and generators along with all their respective
  39394. options as well as possible minimum and maximum values along with the default
  39395. values.
  39396. </p><div class="example">
  39397. <pre class="example-preformatted">list_filters=true
  39398. </pre></div>
  39399. </dd>
  39400. <dt><samp class="option">filter</samp></dt>
  39401. <dd><p>Specify all filters by their respective name and options.
  39402. Use <var class="var">list_filters</var> to determine all valid filter names and options.
  39403. Numerical options are specified by a float value and are automatically clamped
  39404. to their respective value range. Vector and color options have to be specified
  39405. by a list of space separated float values. Character escaping has to be done.
  39406. A special option name <code class="code">default</code> is available to use default options for a
  39407. filter.
  39408. </p>
  39409. <p>It is required to specify either <code class="code">default</code> or at least one of the filter options.
  39410. All omitted options are used with their default values.
  39411. The syntax of the filter string is as follows:
  39412. </p><div class="example">
  39413. <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;][@...]][#...]
  39414. </pre></div>
  39415. </dd>
  39416. <dt><samp class="option">output_rect</samp></dt>
  39417. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  39418. input image. It is given by a list of space separated float values:
  39419. </p><div class="example">
  39420. <pre class="example-preformatted">output_rect=x\ y\ width\ height
  39421. </pre></div>
  39422. <p>If not given, the output rectangle equals the dimensions of the input image.
  39423. The output rectangle is automatically cropped at the borders of the input
  39424. image. Negative values are valid for each component.
  39425. </p><div class="example">
  39426. <pre class="example-preformatted">output_rect=25\ 25\ 100\ 100
  39427. </pre></div>
  39428. </dd>
  39429. </dl>
  39430. <p>Several filters can be chained for successive processing without GPU-HOST
  39431. transfers allowing for fast processing of complex filter chains.
  39432. Currently, only filters with zero (generators) or exactly one (filters) input
  39433. image and one output image are supported. Also, transition filters are not yet
  39434. usable as intended.
  39435. </p>
  39436. <p>Some filters generate output images with additional padding depending on the
  39437. respective filter kernel. The padding is automatically removed to ensure the
  39438. filter output has the same size as the input image.
  39439. </p>
  39440. <p>For image generators, the size of the output image is determined by the
  39441. previous output image of the filter chain or the input image of the whole
  39442. filterchain, respectively. The generators do not use the pixel information of
  39443. this image to generate their output. However, the generated output is
  39444. blended onto this image, resulting in partial or complete coverage of the
  39445. output image.
  39446. </p>
  39447. <p>The <a class="ref" href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  39448. which are directly fed into the filter chain. By using it, providing input
  39449. images by another video source or an input video is not required.
  39450. </p>
  39451. <ul class="mini-toc">
  39452. <li><a href="#Examples-101" accesskey="1">Examples</a></li>
  39453. </ul>
  39454. <div class="subsection-level-extent" id="Examples-101">
  39455. <h4 class="subsection"><span>39.47.1 Examples<a class="copiable-link" href="#Examples-101"> &para;</a></span></h4>
  39456. <ul class="itemize mark-bullet">
  39457. <li>List all filters available:
  39458. <div class="example">
  39459. <pre class="example-preformatted">coreimage=list_filters=true
  39460. </pre></div>
  39461. </li><li>Use the CIBoxBlur filter with default options to blur an image:
  39462. <div class="example">
  39463. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default
  39464. </pre></div>
  39465. </li><li>Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  39466. its center at 100x100 and a radius of 50 pixels:
  39467. <div class="example">
  39468. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  39469. </pre></div>
  39470. </li><li>Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  39471. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  39472. <div class="example">
  39473. <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
  39474. </pre></div>
  39475. </li></ul>
  39476. </div>
  39477. </div>
  39478. <div class="section-level-extent" id="corr">
  39479. <h3 class="section"><span>39.48 corr<a class="copiable-link" href="#corr"> &para;</a></span></h3>
  39480. <p>Obtain the correlation between two input videos.
  39481. </p>
  39482. <p>This filter takes two input videos.
  39483. </p>
  39484. <p>Both input videos must have the same resolution and pixel format for
  39485. this filter to work correctly. Also it assumes that both inputs
  39486. have the same number of frames, which are compared one by one.
  39487. </p>
  39488. <p>The obtained per component, average, min and max correlation is printed through
  39489. the logging system.
  39490. </p>
  39491. <p>The filter stores the calculated correlation of each frame in frame metadata.
  39492. </p>
  39493. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  39494. </p>
  39495. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  39496. with the reference file <samp class="file">ref.mpg</samp>.
  39497. </p>
  39498. <div class="example">
  39499. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
  39500. </pre></div>
  39501. </div>
  39502. <div class="section-level-extent" id="cover_005frect">
  39503. <h3 class="section"><span>39.49 cover_rect<a class="copiable-link" href="#cover_005frect"> &para;</a></span></h3>
  39504. <p>Cover a rectangular object
  39505. </p>
  39506. <p>It accepts the following options:
  39507. </p>
  39508. <dl class="table">
  39509. <dt><samp class="option">cover</samp></dt>
  39510. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  39511. </p>
  39512. </dd>
  39513. <dt><samp class="option">mode</samp></dt>
  39514. <dd><p>Set covering mode.
  39515. </p>
  39516. <p>It accepts the following values:
  39517. </p><dl class="table">
  39518. <dt>&lsquo;<samp class="samp">cover</samp>&rsquo;</dt>
  39519. <dd><p>cover it by the supplied image
  39520. </p></dd>
  39521. <dt>&lsquo;<samp class="samp">blur</samp>&rsquo;</dt>
  39522. <dd><p>cover it by interpolating the surrounding pixels
  39523. </p></dd>
  39524. </dl>
  39525. <p>Default value is <var class="var">blur</var>.
  39526. </p></dd>
  39527. </dl>
  39528. <ul class="mini-toc">
  39529. <li><a href="#Examples-102" accesskey="1">Examples</a></li>
  39530. </ul>
  39531. <div class="subsection-level-extent" id="Examples-102">
  39532. <h4 class="subsection"><span>39.49.1 Examples<a class="copiable-link" href="#Examples-102"> &para;</a></span></h4>
  39533. <ul class="itemize mark-bullet">
  39534. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  39535. <div class="example">
  39536. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  39537. </pre></div>
  39538. </li></ul>
  39539. </div>
  39540. </div>
  39541. <div class="section-level-extent" id="crop">
  39542. <h3 class="section"><span>39.50 crop<a class="copiable-link" href="#crop"> &para;</a></span></h3>
  39543. <p>Crop the input video to given dimensions.
  39544. </p>
  39545. <p>It accepts the following parameters:
  39546. </p>
  39547. <dl class="table">
  39548. <dt><samp class="option">w, out_w</samp></dt>
  39549. <dd><p>The width of the output video. It defaults to <code class="code">iw</code>.
  39550. This expression is evaluated only once during the filter
  39551. configuration, or when the &lsquo;<samp class="samp">w</samp>&rsquo; or &lsquo;<samp class="samp">out_w</samp>&rsquo; command is sent.
  39552. </p>
  39553. </dd>
  39554. <dt><samp class="option">h, out_h</samp></dt>
  39555. <dd><p>The height of the output video. It defaults to <code class="code">ih</code>.
  39556. This expression is evaluated only once during the filter
  39557. configuration, or when the &lsquo;<samp class="samp">h</samp>&rsquo; or &lsquo;<samp class="samp">out_h</samp>&rsquo; command is sent.
  39558. </p>
  39559. </dd>
  39560. <dt><samp class="option">x</samp></dt>
  39561. <dd><p>The horizontal position, in the input video, of the left edge of the output
  39562. video. It defaults to <code class="code">(in_w-out_w)/2</code>.
  39563. This expression is evaluated per-frame.
  39564. </p>
  39565. </dd>
  39566. <dt><samp class="option">y</samp></dt>
  39567. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  39568. It defaults to <code class="code">(in_h-out_h)/2</code>.
  39569. This expression is evaluated per-frame.
  39570. </p>
  39571. </dd>
  39572. <dt><samp class="option">keep_aspect</samp></dt>
  39573. <dd><p>If set to 1 will force the output display aspect ratio
  39574. to be the same of the input, by changing the output sample aspect
  39575. ratio. It defaults to 0.
  39576. </p>
  39577. </dd>
  39578. <dt><samp class="option">exact</samp></dt>
  39579. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  39580. width/height/x/y as specified and will not be rounded to nearest smaller value.
  39581. It defaults to 0.
  39582. </p></dd>
  39583. </dl>
  39584. <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
  39585. expressions containing the following constants:
  39586. </p>
  39587. <dl class="table">
  39588. <dt><samp class="option">x</samp></dt>
  39589. <dt><samp class="option">y</samp></dt>
  39590. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  39591. each new frame.
  39592. </p>
  39593. </dd>
  39594. <dt><samp class="option">in_w</samp></dt>
  39595. <dt><samp class="option">in_h</samp></dt>
  39596. <dd><p>The input width and height.
  39597. </p>
  39598. </dd>
  39599. <dt><samp class="option">iw</samp></dt>
  39600. <dt><samp class="option">ih</samp></dt>
  39601. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  39602. </p>
  39603. </dd>
  39604. <dt><samp class="option">out_w</samp></dt>
  39605. <dt><samp class="option">out_h</samp></dt>
  39606. <dd><p>The output (cropped) width and height.
  39607. </p>
  39608. </dd>
  39609. <dt><samp class="option">ow</samp></dt>
  39610. <dt><samp class="option">oh</samp></dt>
  39611. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  39612. </p>
  39613. </dd>
  39614. <dt><samp class="option">a</samp></dt>
  39615. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  39616. </p>
  39617. </dd>
  39618. <dt><samp class="option">sar</samp></dt>
  39619. <dd><p>input sample aspect ratio
  39620. </p>
  39621. </dd>
  39622. <dt><samp class="option">dar</samp></dt>
  39623. <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>
  39624. </p>
  39625. </dd>
  39626. <dt><samp class="option">hsub</samp></dt>
  39627. <dt><samp class="option">vsub</samp></dt>
  39628. <dd><p>horizontal and vertical chroma subsample values. For example for the
  39629. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  39630. </p>
  39631. </dd>
  39632. <dt><samp class="option">n</samp></dt>
  39633. <dd><p>The number of the input frame, starting from 0.
  39634. </p>
  39635. </dd>
  39636. <dt><samp class="option">pos</samp></dt>
  39637. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  39638. do not use
  39639. </p>
  39640. </dd>
  39641. <dt><samp class="option">t</samp></dt>
  39642. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  39643. </p>
  39644. </dd>
  39645. </dl>
  39646. <p>The expression for <var class="var">out_w</var> may depend on the value of <var class="var">out_h</var>,
  39647. and the expression for <var class="var">out_h</var> may depend on <var class="var">out_w</var>, but they
  39648. 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
  39649. evaluated after <var class="var">out_w</var> and <var class="var">out_h</var>.
  39650. </p>
  39651. <p>The <var class="var">x</var> and <var class="var">y</var> parameters specify the expressions for the
  39652. position of the top-left corner of the output (non-cropped) area. They
  39653. are evaluated for each frame. If the evaluated value is not valid, it
  39654. is approximated to the nearest valid value.
  39655. </p>
  39656. <p>The expression for <var class="var">x</var> may depend on <var class="var">y</var>, and the expression
  39657. for <var class="var">y</var> may depend on <var class="var">x</var>.
  39658. </p>
  39659. <ul class="mini-toc">
  39660. <li><a href="#Examples-103" accesskey="1">Examples</a></li>
  39661. <li><a href="#Commands-76" accesskey="2">Commands</a></li>
  39662. </ul>
  39663. <div class="subsection-level-extent" id="Examples-103">
  39664. <h4 class="subsection"><span>39.50.1 Examples<a class="copiable-link" href="#Examples-103"> &para;</a></span></h4>
  39665. <ul class="itemize mark-bullet">
  39666. <li>Crop area with size 100x100 at position (12,34).
  39667. <div class="example">
  39668. <pre class="example-preformatted">crop=100:100:12:34
  39669. </pre></div>
  39670. <p>Using named options, the example above becomes:
  39671. </p><div class="example">
  39672. <pre class="example-preformatted">crop=w=100:h=100:x=12:y=34
  39673. </pre></div>
  39674. </li><li>Crop the central input area with size 100x100:
  39675. <div class="example">
  39676. <pre class="example-preformatted">crop=100:100
  39677. </pre></div>
  39678. </li><li>Crop the central input area with size 2/3 of the input video:
  39679. <div class="example">
  39680. <pre class="example-preformatted">crop=2/3*in_w:2/3*in_h
  39681. </pre></div>
  39682. </li><li>Crop the input video central square:
  39683. <div class="example">
  39684. <pre class="example-preformatted">crop=out_w=in_h
  39685. crop=in_h
  39686. </pre></div>
  39687. </li><li>Delimit the rectangle with the top-left corner placed at position
  39688. 100:100 and the right-bottom corner corresponding to the right-bottom
  39689. corner of the input image.
  39690. <div class="example">
  39691. <pre class="example-preformatted">crop=in_w-100:in_h-100:100:100
  39692. </pre></div>
  39693. </li><li>Crop 10 pixels from the left and right borders, and 20 pixels from
  39694. the top and bottom borders
  39695. <div class="example">
  39696. <pre class="example-preformatted">crop=in_w-2*10:in_h-2*20
  39697. </pre></div>
  39698. </li><li>Keep only the bottom right quarter of the input image:
  39699. <div class="example">
  39700. <pre class="example-preformatted">crop=in_w/2:in_h/2:in_w/2:in_h/2
  39701. </pre></div>
  39702. </li><li>Crop height for getting Greek harmony:
  39703. <div class="example">
  39704. <pre class="example-preformatted">crop=in_w:1/PHI*in_w
  39705. </pre></div>
  39706. </li><li>Apply trembling effect:
  39707. <div class="example">
  39708. <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)
  39709. </pre></div>
  39710. </li><li>Apply erratic camera effect depending on timestamp:
  39711. <div class="example">
  39712. <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)
  39713. </pre></div>
  39714. </li><li>Set x depending on the value of y:
  39715. <div class="example">
  39716. <pre class="example-preformatted">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  39717. </pre></div>
  39718. </li></ul>
  39719. </div>
  39720. <div class="subsection-level-extent" id="Commands-76">
  39721. <h4 class="subsection"><span>39.50.2 Commands<a class="copiable-link" href="#Commands-76"> &para;</a></span></h4>
  39722. <p>This filter supports the following commands:
  39723. </p><dl class="table">
  39724. <dt><samp class="option">w, out_w</samp></dt>
  39725. <dt><samp class="option">h, out_h</samp></dt>
  39726. <dt><samp class="option">x</samp></dt>
  39727. <dt><samp class="option">y</samp></dt>
  39728. <dd><p>Set width/height of the output video and the horizontal/vertical position
  39729. in the input video.
  39730. The command accepts the same syntax of the corresponding option.
  39731. </p>
  39732. <p>If the specified expression is not valid, it is kept at its current
  39733. value.
  39734. </p></dd>
  39735. </dl>
  39736. </div>
  39737. </div>
  39738. <div class="section-level-extent" id="cropdetect">
  39739. <h3 class="section"><span>39.51 cropdetect<a class="copiable-link" href="#cropdetect"> &para;</a></span></h3>
  39740. <p>Auto-detect the crop size.
  39741. </p>
  39742. <p>It calculates the necessary cropping parameters and prints the
  39743. recommended parameters via the logging system. The detected dimensions
  39744. correspond to the non-black or video area of the input video according to <var class="var">mode</var>.
  39745. </p>
  39746. <p>It accepts the following parameters:
  39747. </p>
  39748. <dl class="table">
  39749. <dt><samp class="option">mode</samp></dt>
  39750. <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.
  39751. </p>
  39752. <dl class="table">
  39753. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  39754. <dd><p>Detect black pixels surrounding the playing video. For fine control use option <var class="var">limit</var>.
  39755. </p>
  39756. </dd>
  39757. <dt>&lsquo;<samp class="samp">mvedges</samp>&rsquo;</dt>
  39758. <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.
  39759. </p></dd>
  39760. </dl>
  39761. </dd>
  39762. <dt><samp class="option">limit</samp></dt>
  39763. <dd><p>Set higher black value threshold, which can be optionally specified
  39764. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  39765. value greater to the set value is considered non-black. It defaults to 24.
  39766. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  39767. on the bitdepth of the pixel format.
  39768. </p>
  39769. </dd>
  39770. <dt><samp class="option">round</samp></dt>
  39771. <dd><p>The value which the width/height should be divisible by. It defaults to
  39772. 16. The offset is automatically adjusted to center the video. Use 2 to
  39773. get only even dimensions (needed for 4:2:2 video). 16 is best when
  39774. encoding to most video codecs.
  39775. </p>
  39776. </dd>
  39777. <dt><samp class="option">skip</samp></dt>
  39778. <dd><p>Set the number of initial frames for which evaluation is skipped.
  39779. Default is 2. Range is 0 to INT_MAX.
  39780. </p>
  39781. </dd>
  39782. <dt><samp class="option">reset_count, reset</samp></dt>
  39783. <dd><p>Set the counter that determines after how many frames cropdetect will
  39784. reset the previously detected largest video area and start over to
  39785. detect the current optimal crop area. Default value is 0.
  39786. </p>
  39787. <p>This can be useful when channel logos distort the video area. 0
  39788. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  39789. playback.
  39790. </p>
  39791. </dd>
  39792. <dt><samp class="option">mv_threshold</samp></dt>
  39793. <dd><p>Set motion in pixel units as threshold for motion detection. It defaults to 8.
  39794. </p>
  39795. </dd>
  39796. <dt><samp class="option">low</samp></dt>
  39797. <dt><samp class="option">high</samp></dt>
  39798. <dd><p>Set low and high threshold values used by the Canny thresholding
  39799. algorithm.
  39800. </p>
  39801. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  39802. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  39803. by the low threshold.
  39804. </p>
  39805. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  39806. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  39807. </p>
  39808. <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>
  39809. is <code class="code">15/255</code>.
  39810. </p></dd>
  39811. </dl>
  39812. <ul class="mini-toc">
  39813. <li><a href="#Examples-104" accesskey="1">Examples</a></li>
  39814. <li><a href="#Commands-77" accesskey="2">Commands</a></li>
  39815. </ul>
  39816. <div class="subsection-level-extent" id="Examples-104">
  39817. <h4 class="subsection"><span>39.51.1 Examples<a class="copiable-link" href="#Examples-104"> &para;</a></span></h4>
  39818. <ul class="itemize mark-bullet">
  39819. <li>Find video area surrounded by black borders:
  39820. <div class="example">
  39821. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
  39822. </pre></div>
  39823. </li><li>Find an embedded video area, generate motion vectors beforehand:
  39824. <div class="example">
  39825. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
  39826. </pre></div>
  39827. </li><li>Find an embedded video area, use motion vectors from decoder:
  39828. <div class="example">
  39829. <pre class="example-preformatted">ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
  39830. </pre></div>
  39831. </li></ul>
  39832. </div>
  39833. <div class="subsection-level-extent" id="Commands-77">
  39834. <h4 class="subsection"><span>39.51.2 Commands<a class="copiable-link" href="#Commands-77"> &para;</a></span></h4>
  39835. <p>This filter supports the following commands:
  39836. </p>
  39837. <dl class="table">
  39838. <dt><samp class="option">limit</samp></dt>
  39839. <dd><p>The command accepts the same syntax of the corresponding option.
  39840. If the specified expression is not valid, it is kept at its current value.
  39841. </p></dd>
  39842. </dl>
  39843. <a class="anchor" id="cue"></a></div>
  39844. </div>
  39845. <div class="section-level-extent" id="cue-1">
  39846. <h3 class="section"><span>39.52 cue<a class="copiable-link" href="#cue-1"> &para;</a></span></h3>
  39847. <p>Delay video filtering until a given wallclock timestamp. The filter first
  39848. passes on <samp class="option">preroll</samp> amount of frames, then it buffers at most
  39849. <samp class="option">buffer</samp> amount of frames and waits for the cue. After reaching the cue
  39850. it forwards the buffered frames and also any subsequent frames coming in its
  39851. input.
  39852. </p>
  39853. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  39854. realtime output devices like decklink. By putting the delay in the filtering
  39855. chain and pre-buffering frames the process can pass on data to output almost
  39856. immediately after the target wallclock timestamp is reached.
  39857. </p>
  39858. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  39859. some use cases.
  39860. </p>
  39861. <dl class="table">
  39862. <dt><samp class="option">cue</samp></dt>
  39863. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  39864. </p>
  39865. </dd>
  39866. <dt><samp class="option">preroll</samp></dt>
  39867. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  39868. </p>
  39869. </dd>
  39870. <dt><samp class="option">buffer</samp></dt>
  39871. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  39872. in seconds. Default is 0.
  39873. </p>
  39874. </dd>
  39875. </dl>
  39876. <a class="anchor" id="curves"></a></div>
  39877. <div class="section-level-extent" id="curves-1">
  39878. <h3 class="section"><span>39.53 curves<a class="copiable-link" href="#curves-1"> &para;</a></span></h3>
  39879. <p>Apply color adjustments using curves.
  39880. </p>
  39881. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  39882. component (red, green and blue) has its values defined by <var class="var">N</var> key points
  39883. tied from each other using a smooth curve. The x-axis represents the pixel
  39884. values from the input frame, and the y-axis the new pixel values to be set for
  39885. the output frame.
  39886. </p>
  39887. <p>By default, a component curve is defined by the two points <var class="var">(0;0)</var> and
  39888. <var class="var">(1;1)</var>. This creates a straight line where each original pixel value is
  39889. &quot;adjusted&quot; to its own value, which means no change to the image.
  39890. </p>
  39891. <p>The filter allows you to redefine these two points and add some more. A new
  39892. curve will be define to pass smoothly through all these new coordinates. The
  39893. new defined points needs to be strictly increasing over the x-axis, and their
  39894. <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
  39895. formed by using a natural or monotonic cubic spline interpolation, depending
  39896. on the <var class="var">interp</var> option (default: <code class="code">natural</code>). The <code class="code">natural</code>
  39897. spline produces a smoother curve in general while the monotonic (<code class="code">pchip</code>)
  39898. spline guarantees the transitions between the specified points to be
  39899. monotonic. If the computed curves happened to go outside the vector spaces,
  39900. the values will be clipped accordingly.
  39901. </p>
  39902. <p>The filter accepts the following options:
  39903. </p>
  39904. <dl class="table">
  39905. <dt><samp class="option">preset</samp></dt>
  39906. <dd><p>Select one of the available color presets. This option can be used in addition
  39907. to the <samp class="option">r</samp>, <samp class="option">g</samp>, <samp class="option">b</samp> parameters; in this case, the later
  39908. options takes priority on the preset values.
  39909. Available presets are:
  39910. </p><dl class="table">
  39911. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  39912. <dt>&lsquo;<samp class="samp">color_negative</samp>&rsquo;</dt>
  39913. <dt>&lsquo;<samp class="samp">cross_process</samp>&rsquo;</dt>
  39914. <dt>&lsquo;<samp class="samp">darker</samp>&rsquo;</dt>
  39915. <dt>&lsquo;<samp class="samp">increase_contrast</samp>&rsquo;</dt>
  39916. <dt>&lsquo;<samp class="samp">lighter</samp>&rsquo;</dt>
  39917. <dt>&lsquo;<samp class="samp">linear_contrast</samp>&rsquo;</dt>
  39918. <dt>&lsquo;<samp class="samp">medium_contrast</samp>&rsquo;</dt>
  39919. <dt>&lsquo;<samp class="samp">negative</samp>&rsquo;</dt>
  39920. <dt>&lsquo;<samp class="samp">strong_contrast</samp>&rsquo;</dt>
  39921. <dt>&lsquo;<samp class="samp">vintage</samp>&rsquo;</dt>
  39922. </dl>
  39923. <p>Default is <code class="code">none</code>.
  39924. </p></dd>
  39925. <dt><samp class="option">master, m</samp></dt>
  39926. <dd><p>Set the master key points. These points will define a second pass mapping. It
  39927. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  39928. <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
  39929. post-processing LUT.
  39930. </p></dd>
  39931. <dt><samp class="option">red, r</samp></dt>
  39932. <dd><p>Set the key points for the red component.
  39933. </p></dd>
  39934. <dt><samp class="option">green, g</samp></dt>
  39935. <dd><p>Set the key points for the green component.
  39936. </p></dd>
  39937. <dt><samp class="option">blue, b</samp></dt>
  39938. <dd><p>Set the key points for the blue component.
  39939. </p></dd>
  39940. <dt><samp class="option">all</samp></dt>
  39941. <dd><p>Set the key points for all components (not including master).
  39942. Can be used in addition to the other key points component
  39943. options. In this case, the unset component(s) will fallback on this
  39944. <samp class="option">all</samp> setting.
  39945. </p></dd>
  39946. <dt><samp class="option">psfile</samp></dt>
  39947. <dd><p>Specify a Photoshop curves file (<code class="code">.acv</code>) to import the settings from.
  39948. </p></dd>
  39949. <dt><samp class="option">plot</samp></dt>
  39950. <dd><p>Save Gnuplot script of the curves in specified file.
  39951. </p></dd>
  39952. <dt><samp class="option">interp</samp></dt>
  39953. <dd><p>Specify the kind of interpolation. Available algorithms are:
  39954. </p><dl class="table">
  39955. <dt>&lsquo;<samp class="samp">natural</samp>&rsquo;</dt>
  39956. <dd><p>Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable.
  39957. </p></dd>
  39958. <dt>&lsquo;<samp class="samp">pchip</samp>&rsquo;</dt>
  39959. <dd><p>Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP).
  39960. </p></dd>
  39961. </dl>
  39962. </dd>
  39963. </dl>
  39964. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  39965. defined using the following syntax: <code class="code">x0/y0 x1/y1 x2/y2 ...</code>.
  39966. </p>
  39967. <ul class="mini-toc">
  39968. <li><a href="#Commands-78" accesskey="1">Commands</a></li>
  39969. <li><a href="#Examples-105" accesskey="2">Examples</a></li>
  39970. </ul>
  39971. <div class="subsection-level-extent" id="Commands-78">
  39972. <h4 class="subsection"><span>39.53.1 Commands<a class="copiable-link" href="#Commands-78"> &para;</a></span></h4>
  39973. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  39974. </p>
  39975. </div>
  39976. <div class="subsection-level-extent" id="Examples-105">
  39977. <h4 class="subsection"><span>39.53.2 Examples<a class="copiable-link" href="#Examples-105"> &para;</a></span></h4>
  39978. <ul class="itemize mark-bullet">
  39979. <li>Increase slightly the middle level of blue:
  39980. <div class="example">
  39981. <pre class="example-preformatted">curves=blue='0/0 0.5/0.58 1/1'
  39982. </pre></div>
  39983. </li><li>Vintage effect:
  39984. <div class="example">
  39985. <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'
  39986. </pre></div>
  39987. <p>Here we obtain the following coordinates for each components:
  39988. </p><dl class="table">
  39989. <dt><var class="var">red</var></dt>
  39990. <dd><p><code class="code">(0;0.11) (0.42;0.51) (1;0.95)</code>
  39991. </p></dd>
  39992. <dt><var class="var">green</var></dt>
  39993. <dd><p><code class="code">(0;0) (0.50;0.48) (1;1)</code>
  39994. </p></dd>
  39995. <dt><var class="var">blue</var></dt>
  39996. <dd><p><code class="code">(0;0.22) (0.49;0.44) (1;0.80)</code>
  39997. </p></dd>
  39998. </dl>
  39999. </li><li>The previous example can also be achieved with the associated built-in preset:
  40000. <div class="example">
  40001. <pre class="example-preformatted">curves=preset=vintage
  40002. </pre></div>
  40003. </li><li>Or simply:
  40004. <div class="example">
  40005. <pre class="example-preformatted">curves=vintage
  40006. </pre></div>
  40007. </li><li>Use a Photoshop preset and redefine the points of the green component:
  40008. <div class="example">
  40009. <pre class="example-preformatted">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  40010. </pre></div>
  40011. </li><li>Check out the curves of the <code class="code">cross_process</code> profile using <code class="command">ffmpeg</code>
  40012. and <code class="command">gnuplot</code>:
  40013. <div class="example">
  40014. <pre class="example-preformatted">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  40015. gnuplot -p /tmp/curves.plt
  40016. </pre></div>
  40017. </li></ul>
  40018. </div>
  40019. </div>
  40020. <div class="section-level-extent" id="datascope">
  40021. <h3 class="section"><span>39.54 datascope<a class="copiable-link" href="#datascope"> &para;</a></span></h3>
  40022. <p>Video data analysis filter.
  40023. </p>
  40024. <p>This filter shows hexadecimal pixel values of part of video.
  40025. </p>
  40026. <p>The filter accepts the following options:
  40027. </p>
  40028. <dl class="table">
  40029. <dt><samp class="option">size, s</samp></dt>
  40030. <dd><p>Set output video size.
  40031. </p>
  40032. </dd>
  40033. <dt><samp class="option">x</samp></dt>
  40034. <dd><p>Set x offset from where to pick pixels.
  40035. </p>
  40036. </dd>
  40037. <dt><samp class="option">y</samp></dt>
  40038. <dd><p>Set y offset from where to pick pixels.
  40039. </p>
  40040. </dd>
  40041. <dt><samp class="option">mode</samp></dt>
  40042. <dd><p>Set scope mode, can be one of the following:
  40043. </p><dl class="table">
  40044. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  40045. <dd><p>Draw hexadecimal pixel values with white color on black background.
  40046. </p>
  40047. </dd>
  40048. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  40049. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  40050. background.
  40051. </p>
  40052. </dd>
  40053. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  40054. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  40055. the text color is picked in such way so its always visible.
  40056. </p></dd>
  40057. </dl>
  40058. </dd>
  40059. <dt><samp class="option">axis</samp></dt>
  40060. <dd><p>Draw rows and columns numbers on left and top of video.
  40061. </p>
  40062. </dd>
  40063. <dt><samp class="option">opacity</samp></dt>
  40064. <dd><p>Set background opacity.
  40065. </p>
  40066. </dd>
  40067. <dt><samp class="option">format</samp></dt>
  40068. <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>.
  40069. </p>
  40070. </dd>
  40071. <dt><samp class="option">components</samp></dt>
  40072. <dd><p>Set pixel components to display. By default all pixel components are displayed.
  40073. </p></dd>
  40074. </dl>
  40075. <ul class="mini-toc">
  40076. <li><a href="#Commands-79" accesskey="1">Commands</a></li>
  40077. </ul>
  40078. <div class="subsection-level-extent" id="Commands-79">
  40079. <h4 class="subsection"><span>39.54.1 Commands<a class="copiable-link" href="#Commands-79"> &para;</a></span></h4>
  40080. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options excluding <code class="code">size</code> option.
  40081. </p>
  40082. </div>
  40083. </div>
  40084. <div class="section-level-extent" id="dblur">
  40085. <h3 class="section"><span>39.55 dblur<a class="copiable-link" href="#dblur"> &para;</a></span></h3>
  40086. <p>Apply Directional blur filter.
  40087. </p>
  40088. <p>The filter accepts the following options:
  40089. </p>
  40090. <dl class="table">
  40091. <dt><samp class="option">angle</samp></dt>
  40092. <dd><p>Set angle of directional blur. Default is <code class="code">45</code>.
  40093. </p>
  40094. </dd>
  40095. <dt><samp class="option">radius</samp></dt>
  40096. <dd><p>Set radius of directional blur. Default is <code class="code">5</code>.
  40097. </p>
  40098. </dd>
  40099. <dt><samp class="option">planes</samp></dt>
  40100. <dd><p>Set which planes to filter. By default all planes are filtered.
  40101. </p></dd>
  40102. </dl>
  40103. <ul class="mini-toc">
  40104. <li><a href="#Commands-80" accesskey="1">Commands</a></li>
  40105. </ul>
  40106. <div class="subsection-level-extent" id="Commands-80">
  40107. <h4 class="subsection"><span>39.55.1 Commands<a class="copiable-link" href="#Commands-80"> &para;</a></span></h4>
  40108. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  40109. The command accepts the same syntax of the corresponding option.
  40110. </p>
  40111. <p>If the specified expression is not valid, it is kept at its current
  40112. value.
  40113. </p>
  40114. </div>
  40115. </div>
  40116. <div class="section-level-extent" id="dctdnoiz">
  40117. <h3 class="section"><span>39.56 dctdnoiz<a class="copiable-link" href="#dctdnoiz"> &para;</a></span></h3>
  40118. <p>Denoise frames using 2D DCT (frequency domain filtering).
  40119. </p>
  40120. <p>This filter is not designed for real time.
  40121. </p>
  40122. <p>The filter accepts the following options:
  40123. </p>
  40124. <dl class="table">
  40125. <dt><samp class="option">sigma, s</samp></dt>
  40126. <dd><p>Set the noise sigma constant.
  40127. </p>
  40128. <p>This <var class="var">sigma</var> defines a hard threshold of <code class="code">3 * sigma</code>; every DCT
  40129. coefficient (absolute value) below this threshold with be dropped.
  40130. </p>
  40131. <p>If you need a more advanced filtering, see <samp class="option">expr</samp>.
  40132. </p>
  40133. <p>Default is <code class="code">0</code>.
  40134. </p>
  40135. </dd>
  40136. <dt><samp class="option">overlap</samp></dt>
  40137. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  40138. may want to reduce this value, at the cost of a less effective filter and the
  40139. risk of various artefacts.
  40140. </p>
  40141. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  40142. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  40143. </p>
  40144. <p>Default value is <var class="var">blocksize</var>-1, which is the best possible setting.
  40145. </p>
  40146. </dd>
  40147. <dt><samp class="option">expr, e</samp></dt>
  40148. <dd><p>Set the coefficient factor expression.
  40149. </p>
  40150. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  40151. multiplier value for the coefficient.
  40152. </p>
  40153. <p>If this is option is set, the <samp class="option">sigma</samp> option will be ignored.
  40154. </p>
  40155. <p>The absolute value of the coefficient can be accessed through the <var class="var">c</var>
  40156. variable.
  40157. </p>
  40158. </dd>
  40159. <dt><samp class="option">n</samp></dt>
  40160. <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
  40161. <var class="var">blocksize</var>, which is the width and height of the processed blocks.
  40162. </p>
  40163. <p>The default value is <var class="var">3</var> (8x8) and can be raised to <var class="var">4</var> for a
  40164. <var class="var">blocksize</var> of 16x16. Note that changing this setting has huge consequences
  40165. on the speed processing. Also, a larger block size does not necessarily means a
  40166. better de-noising.
  40167. </p></dd>
  40168. </dl>
  40169. <ul class="mini-toc">
  40170. <li><a href="#Examples-106" accesskey="1">Examples</a></li>
  40171. </ul>
  40172. <div class="subsection-level-extent" id="Examples-106">
  40173. <h4 class="subsection"><span>39.56.1 Examples<a class="copiable-link" href="#Examples-106"> &para;</a></span></h4>
  40174. <p>Apply a denoise with a <samp class="option">sigma</samp> of <code class="code">4.5</code>:
  40175. </p><div class="example">
  40176. <pre class="example-preformatted">dctdnoiz=4.5
  40177. </pre></div>
  40178. <p>The same operation can be achieved using the expression system:
  40179. </p><div class="example">
  40180. <pre class="example-preformatted">dctdnoiz=e='gte(c, 4.5*3)'
  40181. </pre></div>
  40182. <p>Violent denoise using a block size of <code class="code">16x16</code>:
  40183. </p><div class="example">
  40184. <pre class="example-preformatted">dctdnoiz=15:n=4
  40185. </pre></div>
  40186. </div>
  40187. </div>
  40188. <div class="section-level-extent" id="deband">
  40189. <h3 class="section"><span>39.57 deband<a class="copiable-link" href="#deband"> &para;</a></span></h3>
  40190. <p>Remove banding artifacts from input video.
  40191. It works by replacing banded pixels with average value of referenced pixels.
  40192. </p>
  40193. <p>The filter accepts the following options:
  40194. </p>
  40195. <dl class="table">
  40196. <dt><samp class="option">1thr</samp></dt>
  40197. <dt><samp class="option">2thr</samp></dt>
  40198. <dt><samp class="option">3thr</samp></dt>
  40199. <dt><samp class="option">4thr</samp></dt>
  40200. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  40201. Valid range is 0.00003 to 0.5.
  40202. If difference between current pixel and reference pixel is less than threshold,
  40203. it will be considered as banded.
  40204. </p>
  40205. </dd>
  40206. <dt><samp class="option">range, r</samp></dt>
  40207. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  40208. in range 0 to set value will be used. If negative, exact absolute value
  40209. will be used.
  40210. The range defines square of four pixels around current pixel.
  40211. </p>
  40212. </dd>
  40213. <dt><samp class="option">direction, d</samp></dt>
  40214. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  40215. random direction from 0 to set direction will be picked. If negative, exact of
  40216. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  40217. will pick only pixels on same row and -PI/2 will pick only pixels on same
  40218. column.
  40219. </p>
  40220. </dd>
  40221. <dt><samp class="option">blur, b</samp></dt>
  40222. <dd><p>If enabled, current pixel is compared with average value of all four
  40223. surrounding pixels. The default is enabled. If disabled current pixel is
  40224. compared with all four surrounding pixels. The pixel is considered banded
  40225. if only all four differences with surrounding pixels are less than threshold.
  40226. </p>
  40227. </dd>
  40228. <dt><samp class="option">coupling, c</samp></dt>
  40229. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  40230. e.g. banding detection threshold is triggered for all color components.
  40231. The default is disabled.
  40232. </p></dd>
  40233. </dl>
  40234. <ul class="mini-toc">
  40235. <li><a href="#Commands-81" accesskey="1">Commands</a></li>
  40236. </ul>
  40237. <div class="subsection-level-extent" id="Commands-81">
  40238. <h4 class="subsection"><span>39.57.1 Commands<a class="copiable-link" href="#Commands-81"> &para;</a></span></h4>
  40239. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  40240. </p>
  40241. </div>
  40242. </div>
  40243. <div class="section-level-extent" id="deblock">
  40244. <h3 class="section"><span>39.58 deblock<a class="copiable-link" href="#deblock"> &para;</a></span></h3>
  40245. <p>Remove blocking artifacts from input video.
  40246. </p>
  40247. <p>The filter accepts the following options:
  40248. </p>
  40249. <dl class="table">
  40250. <dt><samp class="option">filter</samp></dt>
  40251. <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>.
  40252. This controls what kind of deblocking is applied.
  40253. </p>
  40254. </dd>
  40255. <dt><samp class="option">block</samp></dt>
  40256. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var class="var">8</var>.
  40257. </p>
  40258. </dd>
  40259. <dt><samp class="option">alpha</samp></dt>
  40260. <dt><samp class="option">beta</samp></dt>
  40261. <dt><samp class="option">gamma</samp></dt>
  40262. <dt><samp class="option">delta</samp></dt>
  40263. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  40264. Defaults are: <var class="var">0.098</var> for <var class="var">alpha</var> and <var class="var">0.05</var> for the rest.
  40265. Using higher threshold gives more deblocking strength.
  40266. Setting <var class="var">alpha</var> controls threshold detection at exact edge of block.
  40267. Remaining options controls threshold detection near the edge. Each one for
  40268. below/above or left/right. Setting any of those to <var class="var">0</var> disables
  40269. deblocking.
  40270. </p>
  40271. </dd>
  40272. <dt><samp class="option">planes</samp></dt>
  40273. <dd><p>Set planes to filter. Default is to filter all available planes.
  40274. </p></dd>
  40275. </dl>
  40276. <ul class="mini-toc">
  40277. <li><a href="#Examples-107" accesskey="1">Examples</a></li>
  40278. <li><a href="#Commands-82" accesskey="2">Commands</a></li>
  40279. </ul>
  40280. <div class="subsection-level-extent" id="Examples-107">
  40281. <h4 class="subsection"><span>39.58.1 Examples<a class="copiable-link" href="#Examples-107"> &para;</a></span></h4>
  40282. <ul class="itemize mark-bullet">
  40283. <li>Deblock using weak filter and block size of 4 pixels.
  40284. <div class="example">
  40285. <pre class="example-preformatted">deblock=filter=weak:block=4
  40286. </pre></div>
  40287. </li><li>Deblock using strong filter, block size of 4 pixels and custom thresholds for
  40288. deblocking more edges.
  40289. <div class="example">
  40290. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  40291. </pre></div>
  40292. </li><li>Similar as above, but filter only first plane.
  40293. <div class="example">
  40294. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  40295. </pre></div>
  40296. </li><li>Similar as above, but filter only second and third plane.
  40297. <div class="example">
  40298. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  40299. </pre></div>
  40300. </li></ul>
  40301. </div>
  40302. <div class="subsection-level-extent" id="Commands-82">
  40303. <h4 class="subsection"><span>39.58.2 Commands<a class="copiable-link" href="#Commands-82"> &para;</a></span></h4>
  40304. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  40305. </p>
  40306. <a class="anchor" id="decimate"></a></div>
  40307. </div>
  40308. <div class="section-level-extent" id="decimate-1">
  40309. <h3 class="section"><span>39.59 decimate<a class="copiable-link" href="#decimate-1"> &para;</a></span></h3>
  40310. <p>Drop duplicated frames at regular intervals.
  40311. </p>
  40312. <p>The filter accepts the following options:
  40313. </p>
  40314. <dl class="table">
  40315. <dt><samp class="option">cycle</samp></dt>
  40316. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  40317. <var class="var">N</var> means one frame in every batch of <var class="var">N</var> frames will be dropped.
  40318. Default is <code class="code">5</code>.
  40319. </p>
  40320. </dd>
  40321. <dt><samp class="option">dupthresh</samp></dt>
  40322. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  40323. is less than or equal to this value, then it is declared as duplicate. Default
  40324. is <code class="code">1.1</code>
  40325. </p>
  40326. </dd>
  40327. <dt><samp class="option">scthresh</samp></dt>
  40328. <dd><p>Set scene change threshold. Default is <code class="code">15</code>.
  40329. </p>
  40330. </dd>
  40331. <dt><samp class="option">blockx</samp></dt>
  40332. <dt><samp class="option">blocky</samp></dt>
  40333. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  40334. Larger blocks give better noise suppression, but also give worse detection of
  40335. small movements. Must be a power of two. Default is <code class="code">32</code>.
  40336. </p>
  40337. </dd>
  40338. <dt><samp class="option">ppsrc</samp></dt>
  40339. <dd><p>Mark main input as a pre-processed input and activate clean source input
  40340. stream. This allows the input to be pre-processed with various filters to help
  40341. the metrics calculation while keeping the frame selection lossless. When set to
  40342. <code class="code">1</code>, the first stream is for the pre-processed input, and the second
  40343. stream is the clean source from where the kept frames are chosen. Default is
  40344. <code class="code">0</code>.
  40345. </p>
  40346. </dd>
  40347. <dt><samp class="option">chroma</samp></dt>
  40348. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  40349. <code class="code">1</code>.
  40350. </p>
  40351. </dd>
  40352. <dt><samp class="option">mixed</samp></dt>
  40353. <dd><p>Set whether or not the input only partially contains content to be decimated.
  40354. Default is <code class="code">false</code>.
  40355. If enabled video output stream will be in variable frame rate.
  40356. </p></dd>
  40357. </dl>
  40358. </div>
  40359. <div class="section-level-extent" id="deconvolve">
  40360. <h3 class="section"><span>39.60 deconvolve<a class="copiable-link" href="#deconvolve"> &para;</a></span></h3>
  40361. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  40362. as impulse.
  40363. </p>
  40364. <p>The filter accepts the following options:
  40365. </p>
  40366. <dl class="table">
  40367. <dt><samp class="option">planes</samp></dt>
  40368. <dd><p>Set which planes to process.
  40369. </p>
  40370. </dd>
  40371. <dt><samp class="option">impulse</samp></dt>
  40372. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  40373. or <var class="var">all</var>. Default is <var class="var">all</var>.
  40374. </p>
  40375. </dd>
  40376. <dt><samp class="option">noise</samp></dt>
  40377. <dd><p>Set noise when doing divisions. Default is <var class="var">0.0000001</var>. Useful when width
  40378. and height are not same and not power of 2 or if stream prior to convolving
  40379. had noise.
  40380. </p></dd>
  40381. </dl>
  40382. <p>The <code class="code">deconvolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  40383. </p>
  40384. </div>
  40385. <div class="section-level-extent" id="dedot">
  40386. <h3 class="section"><span>39.61 dedot<a class="copiable-link" href="#dedot"> &para;</a></span></h3>
  40387. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  40388. </p>
  40389. <p>It accepts the following options:
  40390. </p>
  40391. <dl class="table">
  40392. <dt><samp class="option">m</samp></dt>
  40393. <dd><p>Set mode of operation. Can be combination of <var class="var">dotcrawl</var> for cross-luminance reduction and/or
  40394. <var class="var">rainbows</var> for cross-color reduction.
  40395. </p>
  40396. </dd>
  40397. <dt><samp class="option">lt</samp></dt>
  40398. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  40399. </p>
  40400. </dd>
  40401. <dt><samp class="option">tl</samp></dt>
  40402. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  40403. </p>
  40404. </dd>
  40405. <dt><samp class="option">tc</samp></dt>
  40406. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  40407. </p>
  40408. </dd>
  40409. <dt><samp class="option">ct</samp></dt>
  40410. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  40411. </p></dd>
  40412. </dl>
  40413. </div>
  40414. <div class="section-level-extent" id="deflate">
  40415. <h3 class="section"><span>39.62 deflate<a class="copiable-link" href="#deflate"> &para;</a></span></h3>
  40416. <p>Apply deflate effect to the video.
  40417. </p>
  40418. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  40419. only values lower than the pixel.
  40420. </p>
  40421. <p>It accepts the following options:
  40422. </p>
  40423. <dl class="table">
  40424. <dt><samp class="option">threshold0</samp></dt>
  40425. <dt><samp class="option">threshold1</samp></dt>
  40426. <dt><samp class="option">threshold2</samp></dt>
  40427. <dt><samp class="option">threshold3</samp></dt>
  40428. <dd><p>Limit the maximum change for each plane, default is 65535.
  40429. If 0, plane will remain unchanged.
  40430. </p></dd>
  40431. </dl>
  40432. <ul class="mini-toc">
  40433. <li><a href="#Commands-83" accesskey="1">Commands</a></li>
  40434. </ul>
  40435. <div class="subsection-level-extent" id="Commands-83">
  40436. <h4 class="subsection"><span>39.62.1 Commands<a class="copiable-link" href="#Commands-83"> &para;</a></span></h4>
  40437. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  40438. </p>
  40439. </div>
  40440. </div>
  40441. <div class="section-level-extent" id="deflicker">
  40442. <h3 class="section"><span>39.63 deflicker<a class="copiable-link" href="#deflicker"> &para;</a></span></h3>
  40443. <p>Remove temporal frame luminance variations.
  40444. </p>
  40445. <p>It accepts the following options:
  40446. </p>
  40447. <dl class="table">
  40448. <dt><samp class="option">size, s</samp></dt>
  40449. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  40450. </p>
  40451. </dd>
  40452. <dt><samp class="option">mode, m</samp></dt>
  40453. <dd><p>Set averaging mode to smooth temporal luminance variations.
  40454. </p>
  40455. <p>Available values are:
  40456. </p><dl class="table">
  40457. <dt>&lsquo;<samp class="samp">am</samp>&rsquo;</dt>
  40458. <dd><p>Arithmetic mean
  40459. </p>
  40460. </dd>
  40461. <dt>&lsquo;<samp class="samp">gm</samp>&rsquo;</dt>
  40462. <dd><p>Geometric mean
  40463. </p>
  40464. </dd>
  40465. <dt>&lsquo;<samp class="samp">hm</samp>&rsquo;</dt>
  40466. <dd><p>Harmonic mean
  40467. </p>
  40468. </dd>
  40469. <dt>&lsquo;<samp class="samp">qm</samp>&rsquo;</dt>
  40470. <dd><p>Quadratic mean
  40471. </p>
  40472. </dd>
  40473. <dt>&lsquo;<samp class="samp">cm</samp>&rsquo;</dt>
  40474. <dd><p>Cubic mean
  40475. </p>
  40476. </dd>
  40477. <dt>&lsquo;<samp class="samp">pm</samp>&rsquo;</dt>
  40478. <dd><p>Power mean
  40479. </p>
  40480. </dd>
  40481. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  40482. <dd><p>Median
  40483. </p></dd>
  40484. </dl>
  40485. </dd>
  40486. <dt><samp class="option">bypass</samp></dt>
  40487. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  40488. </p></dd>
  40489. </dl>
  40490. </div>
  40491. <div class="section-level-extent" id="dejudder">
  40492. <h3 class="section"><span>39.64 dejudder<a class="copiable-link" href="#dejudder"> &para;</a></span></h3>
  40493. <p>Remove judder produced by partially interlaced telecined content.
  40494. </p>
  40495. <p>Judder can be introduced, for instance, by <a class="ref" href="#pullup">pullup</a> filter. If the original
  40496. source was partially telecined content then the output of <code class="code">pullup,dejudder</code>
  40497. will have a variable frame rate. May change the recorded frame rate of the
  40498. container. Aside from that change, this filter will not affect constant frame
  40499. rate video.
  40500. </p>
  40501. <p>The option available in this filter is:
  40502. </p><dl class="table">
  40503. <dt><samp class="option">cycle</samp></dt>
  40504. <dd><p>Specify the length of the window over which the judder repeats.
  40505. </p>
  40506. <p>Accepts any integer greater than 1. Useful values are:
  40507. </p><dl class="table">
  40508. <dt>&lsquo;<samp class="samp">4</samp>&rsquo;</dt>
  40509. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  40510. </p>
  40511. </dd>
  40512. <dt>&lsquo;<samp class="samp">5</samp>&rsquo;</dt>
  40513. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  40514. </p>
  40515. </dd>
  40516. <dt>&lsquo;<samp class="samp">20</samp>&rsquo;</dt>
  40517. <dd><p>If a mixture of the two.
  40518. </p></dd>
  40519. </dl>
  40520. <p>The default is &lsquo;<samp class="samp">4</samp>&rsquo;.
  40521. </p></dd>
  40522. </dl>
  40523. </div>
  40524. <div class="section-level-extent" id="delogo">
  40525. <h3 class="section"><span>39.65 delogo<a class="copiable-link" href="#delogo"> &para;</a></span></h3>
  40526. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  40527. pixels. Just set a rectangle covering the logo and watch it disappear
  40528. (and sometimes something even uglier appear - your mileage may vary).
  40529. </p>
  40530. <p>It accepts the following parameters:
  40531. </p><dl class="table">
  40532. <dt><samp class="option">x</samp></dt>
  40533. <dt><samp class="option">y</samp></dt>
  40534. <dd><p>Specify the top left corner coordinates of the logo. They must be
  40535. specified.
  40536. </p>
  40537. </dd>
  40538. <dt><samp class="option">w</samp></dt>
  40539. <dt><samp class="option">h</samp></dt>
  40540. <dd><p>Specify the width and height of the logo to clear. They must be
  40541. specified.
  40542. </p>
  40543. </dd>
  40544. <dt><samp class="option">show</samp></dt>
  40545. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  40546. 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.
  40547. The default value is 0.
  40548. </p>
  40549. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  40550. replaced with interpolated values. The values of the next pixels
  40551. immediately outside this rectangle in each direction will be used to
  40552. compute the interpolated pixel values inside the rectangle.
  40553. </p>
  40554. </dd>
  40555. </dl>
  40556. <ul class="mini-toc">
  40557. <li><a href="#Examples-108" accesskey="1">Examples</a></li>
  40558. </ul>
  40559. <div class="subsection-level-extent" id="Examples-108">
  40560. <h4 class="subsection"><span>39.65.1 Examples<a class="copiable-link" href="#Examples-108"> &para;</a></span></h4>
  40561. <ul class="itemize mark-bullet">
  40562. <li>Set a rectangle covering the area with top left corner coordinates 0,0
  40563. and size 100x77:
  40564. <div class="example">
  40565. <pre class="example-preformatted">delogo=x=0:y=0:w=100:h=77
  40566. </pre></div>
  40567. </li></ul>
  40568. <a class="anchor" id="derain"></a></div>
  40569. </div>
  40570. <div class="section-level-extent" id="derain-1">
  40571. <h3 class="section"><span>39.66 derain<a class="copiable-link" href="#derain-1"> &para;</a></span></h3>
  40572. <p>Remove the rain in the input image/video by applying the derain methods based on
  40573. convolutional neural networks. Supported models:
  40574. </p>
  40575. <ul class="itemize mark-bullet">
  40576. <li>Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  40577. 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>.
  40578. </li></ul>
  40579. <p>Training as well as model generation scripts are provided in
  40580. the repository at <a class="url" href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  40581. </p>
  40582. <p>The filter accepts the following options:
  40583. </p>
  40584. <dl class="table">
  40585. <dt><samp class="option">filter_type</samp></dt>
  40586. <dd><p>Specify which filter to use. This option accepts the following values:
  40587. </p>
  40588. <dl class="table">
  40589. <dt>&lsquo;<samp class="samp">derain</samp>&rsquo;</dt>
  40590. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  40591. </p>
  40592. </dd>
  40593. <dt>&lsquo;<samp class="samp">dehaze</samp>&rsquo;</dt>
  40594. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  40595. </p></dd>
  40596. </dl>
  40597. <p>Default value is &lsquo;<samp class="samp">derain</samp>&rsquo;.
  40598. </p>
  40599. </dd>
  40600. <dt><samp class="option">dnn_backend</samp></dt>
  40601. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  40602. the following values:
  40603. </p>
  40604. <dl class="table">
  40605. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  40606. <dd><p>TensorFlow backend. To enable this backend you
  40607. need to install the TensorFlow for C library (see
  40608. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  40609. <code class="code">--enable-libtensorflow</code>
  40610. </p></dd>
  40611. </dl>
  40612. </dd>
  40613. <dt><samp class="option">model</samp></dt>
  40614. <dd><p>Set path to model file specifying network architecture and its parameters.
  40615. Note that different backends use different file formats. TensorFlow can load files for only its format.
  40616. </p></dd>
  40617. </dl>
  40618. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  40619. </p>
  40620. </div>
  40621. <div class="section-level-extent" id="deshake">
  40622. <h3 class="section"><span>39.67 deshake<a class="copiable-link" href="#deshake"> &para;</a></span></h3>
  40623. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  40624. filter helps remove camera shake from hand-holding a camera, bumping a
  40625. tripod, moving on a vehicle, etc.
  40626. </p>
  40627. <p>The filter accepts the following options:
  40628. </p>
  40629. <dl class="table">
  40630. <dt><samp class="option">x</samp></dt>
  40631. <dt><samp class="option">y</samp></dt>
  40632. <dt><samp class="option">w</samp></dt>
  40633. <dt><samp class="option">h</samp></dt>
  40634. <dd><p>Specify a rectangular area where to limit the search for motion
  40635. vectors.
  40636. If desired the search for motion vectors can be limited to a
  40637. rectangular area of the frame defined by its top left corner, width
  40638. and height. These parameters have the same meaning as the drawbox
  40639. filter which can be used to visualise the position of the bounding
  40640. box.
  40641. </p>
  40642. <p>This is useful when simultaneous movement of subjects within the frame
  40643. might be confused for camera motion by the motion vector search.
  40644. </p>
  40645. <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
  40646. then the full frame is used. This allows later options to be set
  40647. without specifying the bounding box for the motion vector search.
  40648. </p>
  40649. <p>Default - search the whole frame.
  40650. </p>
  40651. </dd>
  40652. <dt><samp class="option">rx</samp></dt>
  40653. <dt><samp class="option">ry</samp></dt>
  40654. <dd><p>Specify the maximum extent of movement in x and y directions in the
  40655. range 0-64 pixels. Default 16.
  40656. </p>
  40657. </dd>
  40658. <dt><samp class="option">edge</samp></dt>
  40659. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  40660. frame. Available values are:
  40661. </p><dl class="table">
  40662. <dt>&lsquo;<samp class="samp">blank, 0</samp>&rsquo;</dt>
  40663. <dd><p>Fill zeroes at blank locations
  40664. </p></dd>
  40665. <dt>&lsquo;<samp class="samp">original, 1</samp>&rsquo;</dt>
  40666. <dd><p>Original image at blank locations
  40667. </p></dd>
  40668. <dt>&lsquo;<samp class="samp">clamp, 2</samp>&rsquo;</dt>
  40669. <dd><p>Extruded edge value at blank locations
  40670. </p></dd>
  40671. <dt>&lsquo;<samp class="samp">mirror, 3</samp>&rsquo;</dt>
  40672. <dd><p>Mirrored edge at blank locations
  40673. </p></dd>
  40674. </dl>
  40675. <p>Default value is &lsquo;<samp class="samp">mirror</samp>&rsquo;.
  40676. </p>
  40677. </dd>
  40678. <dt><samp class="option">blocksize</samp></dt>
  40679. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  40680. default 8.
  40681. </p>
  40682. </dd>
  40683. <dt><samp class="option">contrast</samp></dt>
  40684. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  40685. the specified contrast (difference between darkest and lightest
  40686. pixels) will be considered. Range 1-255, default 125.
  40687. </p>
  40688. </dd>
  40689. <dt><samp class="option">search</samp></dt>
  40690. <dd><p>Specify the search strategy. Available values are:
  40691. </p><dl class="table">
  40692. <dt>&lsquo;<samp class="samp">exhaustive, 0</samp>&rsquo;</dt>
  40693. <dd><p>Set exhaustive search
  40694. </p></dd>
  40695. <dt>&lsquo;<samp class="samp">less, 1</samp>&rsquo;</dt>
  40696. <dd><p>Set less exhaustive search.
  40697. </p></dd>
  40698. </dl>
  40699. <p>Default value is &lsquo;<samp class="samp">exhaustive</samp>&rsquo;.
  40700. </p>
  40701. </dd>
  40702. <dt><samp class="option">filename</samp></dt>
  40703. <dd><p>If set then a detailed log of the motion search is written to the
  40704. specified file.
  40705. </p>
  40706. </dd>
  40707. </dl>
  40708. </div>
  40709. <div class="section-level-extent" id="despill">
  40710. <h3 class="section"><span>39.68 despill<a class="copiable-link" href="#despill"> &para;</a></span></h3>
  40711. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  40712. greenscreen or bluescreen.
  40713. </p>
  40714. <p>This filter accepts the following options:
  40715. </p>
  40716. <dl class="table">
  40717. <dt><samp class="option">type</samp></dt>
  40718. <dd><p>Set what type of despill to use.
  40719. </p>
  40720. </dd>
  40721. <dt><samp class="option">mix</samp></dt>
  40722. <dd><p>Set how spillmap will be generated.
  40723. </p>
  40724. </dd>
  40725. <dt><samp class="option">expand</samp></dt>
  40726. <dd><p>Set how much to get rid of still remaining spill.
  40727. </p>
  40728. </dd>
  40729. <dt><samp class="option">red</samp></dt>
  40730. <dd><p>Controls amount of red in spill area.
  40731. </p>
  40732. </dd>
  40733. <dt><samp class="option">green</samp></dt>
  40734. <dd><p>Controls amount of green in spill area.
  40735. Should be -1 for greenscreen.
  40736. </p>
  40737. </dd>
  40738. <dt><samp class="option">blue</samp></dt>
  40739. <dd><p>Controls amount of blue in spill area.
  40740. Should be -1 for bluescreen.
  40741. </p>
  40742. </dd>
  40743. <dt><samp class="option">brightness</samp></dt>
  40744. <dd><p>Controls brightness of spill area, preserving colors.
  40745. </p>
  40746. </dd>
  40747. <dt><samp class="option">alpha</samp></dt>
  40748. <dd><p>Modify alpha from generated spillmap.
  40749. </p></dd>
  40750. </dl>
  40751. <ul class="mini-toc">
  40752. <li><a href="#Commands-84" accesskey="1">Commands</a></li>
  40753. </ul>
  40754. <div class="subsection-level-extent" id="Commands-84">
  40755. <h4 class="subsection"><span>39.68.1 Commands<a class="copiable-link" href="#Commands-84"> &para;</a></span></h4>
  40756. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  40757. </p>
  40758. </div>
  40759. </div>
  40760. <div class="section-level-extent" id="detelecine">
  40761. <h3 class="section"><span>39.69 detelecine<a class="copiable-link" href="#detelecine"> &para;</a></span></h3>
  40762. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  40763. pattern specified using the pattern option which must be the same as that passed
  40764. to the telecine filter.
  40765. </p>
  40766. <p>This filter accepts the following options:
  40767. </p>
  40768. <dl class="table">
  40769. <dt><samp class="option">first_field</samp></dt>
  40770. <dd><dl class="table">
  40771. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  40772. <dd><p>top field first
  40773. </p></dd>
  40774. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  40775. <dd><p>bottom field first
  40776. The default value is <code class="code">top</code>.
  40777. </p></dd>
  40778. </dl>
  40779. </dd>
  40780. <dt><samp class="option">pattern</samp></dt>
  40781. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  40782. The default value is <code class="code">23</code>.
  40783. </p>
  40784. </dd>
  40785. <dt><samp class="option">start_frame</samp></dt>
  40786. <dd><p>A number representing position of the first frame with respect to the telecine
  40787. pattern. This is to be used if the stream is cut. The default value is <code class="code">0</code>.
  40788. </p></dd>
  40789. </dl>
  40790. <a class="anchor" id="dilation"></a></div>
  40791. <div class="section-level-extent" id="dilation-1">
  40792. <h3 class="section"><span>39.70 dilation<a class="copiable-link" href="#dilation-1"> &para;</a></span></h3>
  40793. <p>Apply dilation effect to the video.
  40794. </p>
  40795. <p>This filter replaces the pixel by the local(3x3) maximum.
  40796. </p>
  40797. <p>It accepts the following options:
  40798. </p>
  40799. <dl class="table">
  40800. <dt><samp class="option">threshold0</samp></dt>
  40801. <dt><samp class="option">threshold1</samp></dt>
  40802. <dt><samp class="option">threshold2</samp></dt>
  40803. <dt><samp class="option">threshold3</samp></dt>
  40804. <dd><p>Limit the maximum change for each plane, default is 65535.
  40805. If 0, plane will remain unchanged.
  40806. </p>
  40807. </dd>
  40808. <dt><samp class="option">coordinates</samp></dt>
  40809. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  40810. pixels are used.
  40811. </p>
  40812. <p>Flags to local 3x3 coordinates maps like this:
  40813. </p>
  40814. <p>1 2 3
  40815. 4 5
  40816. 6 7 8
  40817. </p></dd>
  40818. </dl>
  40819. <ul class="mini-toc">
  40820. <li><a href="#Commands-85" accesskey="1">Commands</a></li>
  40821. </ul>
  40822. <div class="subsection-level-extent" id="Commands-85">
  40823. <h4 class="subsection"><span>39.70.1 Commands<a class="copiable-link" href="#Commands-85"> &para;</a></span></h4>
  40824. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  40825. </p>
  40826. </div>
  40827. </div>
  40828. <div class="section-level-extent" id="displace">
  40829. <h3 class="section"><span>39.71 displace<a class="copiable-link" href="#displace"> &para;</a></span></h3>
  40830. <p>Displace pixels as indicated by second and third input stream.
  40831. </p>
  40832. <p>It takes three input streams and outputs one stream, the first input is the
  40833. source, and second and third input are displacement maps.
  40834. </p>
  40835. <p>The second input specifies how much to displace pixels along the
  40836. x-axis, while the third input specifies how much to displace pixels
  40837. along the y-axis.
  40838. If one of displacement map streams terminates, last frame from that
  40839. displacement map will be used.
  40840. </p>
  40841. <p>Note that once generated, displacements maps can be reused over and over again.
  40842. </p>
  40843. <p>A description of the accepted options follows.
  40844. </p>
  40845. <dl class="table">
  40846. <dt><samp class="option">edge</samp></dt>
  40847. <dd><p>Set displace behavior for pixels that are out of range.
  40848. </p>
  40849. <p>Available values are:
  40850. </p><dl class="table">
  40851. <dt>&lsquo;<samp class="samp">blank</samp>&rsquo;</dt>
  40852. <dd><p>Missing pixels are replaced by black pixels.
  40853. </p>
  40854. </dd>
  40855. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  40856. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  40857. </p>
  40858. </dd>
  40859. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  40860. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  40861. </p>
  40862. </dd>
  40863. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  40864. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  40865. </p></dd>
  40866. </dl>
  40867. <p>Default is &lsquo;<samp class="samp">smear</samp>&rsquo;.
  40868. </p>
  40869. </dd>
  40870. </dl>
  40871. <ul class="mini-toc">
  40872. <li><a href="#Examples-109" accesskey="1">Examples</a></li>
  40873. </ul>
  40874. <div class="subsection-level-extent" id="Examples-109">
  40875. <h4 class="subsection"><span>39.71.1 Examples<a class="copiable-link" href="#Examples-109"> &para;</a></span></h4>
  40876. <ul class="itemize mark-bullet">
  40877. <li>Add ripple effect to rgb input of video size hd720:
  40878. <div class="example">
  40879. <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
  40880. </pre></div>
  40881. </li><li>Add wave effect to rgb input of video size hd720:
  40882. <div class="example">
  40883. <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
  40884. </pre></div>
  40885. </li></ul>
  40886. </div>
  40887. </div>
  40888. <div class="section-level-extent" id="dnn_005fclassify">
  40889. <h3 class="section"><span>39.72 dnn_classify<a class="copiable-link" href="#dnn_005fclassify"> &para;</a></span></h3>
  40890. <p>Do classification with deep neural networks based on bounding boxes.
  40891. </p>
  40892. <p>The filter accepts the following options:
  40893. </p>
  40894. <dl class="table">
  40895. <dt><samp class="option">dnn_backend</samp></dt>
  40896. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  40897. only openvino now, tensorflow backends will be added.
  40898. </p>
  40899. </dd>
  40900. <dt><samp class="option">model</samp></dt>
  40901. <dd><p>Set path to model file specifying network architecture and its parameters.
  40902. Note that different backends use different file formats.
  40903. </p>
  40904. </dd>
  40905. <dt><samp class="option">input</samp></dt>
  40906. <dd><p>Set the input name of the dnn network.
  40907. </p>
  40908. </dd>
  40909. <dt><samp class="option">output</samp></dt>
  40910. <dd><p>Set the output name of the dnn network.
  40911. </p>
  40912. </dd>
  40913. <dt><samp class="option">confidence</samp></dt>
  40914. <dd><p>Set the confidence threshold (default: 0.5).
  40915. </p>
  40916. </dd>
  40917. <dt><samp class="option">labels</samp></dt>
  40918. <dd><p>Set path to label file specifying the mapping between label id and name.
  40919. Each label name is written in one line, tailing spaces and empty lines are skipped.
  40920. The first line is the name of label id 0,
  40921. and the second line is the name of label id 1, etc.
  40922. The label id is considered as name if the label file is not provided.
  40923. </p>
  40924. </dd>
  40925. <dt><samp class="option">backend_configs</samp></dt>
  40926. <dd><p>Set the configs to be passed into backend
  40927. </p>
  40928. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  40929. please use tools/python/tf_sess_config.py to get the configs for your system.
  40930. </p>
  40931. </dd>
  40932. </dl>
  40933. </div>
  40934. <div class="section-level-extent" id="dnn_005fdetect">
  40935. <h3 class="section"><span>39.73 dnn_detect<a class="copiable-link" href="#dnn_005fdetect"> &para;</a></span></h3>
  40936. <p>Do object detection with deep neural networks.
  40937. </p>
  40938. <p>The filter accepts the following options:
  40939. </p>
  40940. <dl class="table">
  40941. <dt><samp class="option">dnn_backend</samp></dt>
  40942. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  40943. only openvino now, tensorflow backends will be added.
  40944. </p>
  40945. </dd>
  40946. <dt><samp class="option">model</samp></dt>
  40947. <dd><p>Set path to model file specifying network architecture and its parameters.
  40948. Note that different backends use different file formats.
  40949. </p>
  40950. </dd>
  40951. <dt><samp class="option">input</samp></dt>
  40952. <dd><p>Set the input name of the dnn network.
  40953. </p>
  40954. </dd>
  40955. <dt><samp class="option">output</samp></dt>
  40956. <dd><p>Set the output name of the dnn network.
  40957. </p>
  40958. </dd>
  40959. <dt><samp class="option">confidence</samp></dt>
  40960. <dd><p>Set the confidence threshold (default: 0.5).
  40961. </p>
  40962. </dd>
  40963. <dt><samp class="option">labels</samp></dt>
  40964. <dd><p>Set path to label file specifying the mapping between label id and name.
  40965. Each label name is written in one line, tailing spaces and empty lines are skipped.
  40966. The first line is the name of label id 0 (usually it is &rsquo;background&rsquo;),
  40967. and the second line is the name of label id 1, etc.
  40968. The label id is considered as name if the label file is not provided.
  40969. </p>
  40970. </dd>
  40971. <dt><samp class="option">backend_configs</samp></dt>
  40972. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  40973. Roll back to sync execution if the backend does not support async.
  40974. </p>
  40975. </dd>
  40976. </dl>
  40977. <a class="anchor" id="dnn_005fprocessing"></a></div>
  40978. <div class="section-level-extent" id="dnn_005fprocessing-1">
  40979. <h3 class="section"><span>39.74 dnn_processing<a class="copiable-link" href="#dnn_005fprocessing-1"> &para;</a></span></h3>
  40980. <p>Do image processing with deep neural networks. It works together with another filter
  40981. which converts the pixel format of the Frame to what the dnn network requires.
  40982. </p>
  40983. <p>The filter accepts the following options:
  40984. </p>
  40985. <dl class="table">
  40986. <dt><samp class="option">dnn_backend</samp></dt>
  40987. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  40988. the following values:
  40989. </p>
  40990. <dl class="table">
  40991. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  40992. <dd><p>TensorFlow backend. To enable this backend you
  40993. need to install the TensorFlow for C library (see
  40994. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  40995. <code class="code">--enable-libtensorflow</code>
  40996. </p>
  40997. </dd>
  40998. <dt>&lsquo;<samp class="samp">openvino</samp>&rsquo;</dt>
  40999. <dd><p>OpenVINO backend. To enable this backend you
  41000. need to build and install the OpenVINO for C library (see
  41001. <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
  41002. <code class="code">--enable-libopenvino</code> (&ndash;extra-cflags=-I... &ndash;extra-ldflags=-L... might
  41003. be needed if the header files and libraries are not installed into system path)
  41004. </p>
  41005. </dd>
  41006. <dt>&lsquo;<samp class="samp">torch</samp>&rsquo;</dt>
  41007. <dd><p>Libtorch backend. To enable this backend you need to build and install Libtroch
  41008. for C++ library. Please download cxx11 ABI version (see
  41009. <a class="url" href="https://pytorch.org/get-started/locally">https://pytorch.org/get-started/locally</a>)
  41010. and configure FFmpeg with <code class="code">--enable-libtorch
  41011. --extra-cflags=-I/libtorch_root/libtorch/include
  41012. --extra-cflags=-I/libtorch_root/libtorch/include/torch/csrc/api/include
  41013. --extra-ldflags=-L/libtorch_root/libtorch/lib/</code>
  41014. </p>
  41015. </dd>
  41016. </dl>
  41017. </dd>
  41018. <dt><samp class="option">model</samp></dt>
  41019. <dd><p>Set path to model file specifying network architecture and its parameters.
  41020. Note that different backends use different file formats. TensorFlow, OpenVINO
  41021. and Libtorch backend can load files for only its format.
  41022. </p>
  41023. </dd>
  41024. <dt><samp class="option">input</samp></dt>
  41025. <dd><p>Set the input name of the dnn network.
  41026. </p>
  41027. </dd>
  41028. <dt><samp class="option">output</samp></dt>
  41029. <dd><p>Set the output name of the dnn network.
  41030. </p>
  41031. </dd>
  41032. <dt><samp class="option">backend_configs</samp></dt>
  41033. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  41034. Roll back to sync execution if the backend does not support async.
  41035. </p>
  41036. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  41037. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  41038. </p>
  41039. </dd>
  41040. </dl>
  41041. <ul class="mini-toc">
  41042. <li><a href="#Examples-110" accesskey="1">Examples</a></li>
  41043. </ul>
  41044. <div class="subsection-level-extent" id="Examples-110">
  41045. <h4 class="subsection"><span>39.74.1 Examples<a class="copiable-link" href="#Examples-110"> &para;</a></span></h4>
  41046. <ul class="itemize mark-bullet">
  41047. <li>Remove rain in rgb24 frame with can.pb (see <a class="ref" href="#derain">derain</a> filter):
  41048. <div class="example">
  41049. <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
  41050. </pre></div>
  41051. </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):
  41052. <div class="example">
  41053. <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
  41054. </pre></div>
  41055. </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),
  41056. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  41057. <div class="example">
  41058. <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
  41059. </pre></div>
  41060. </li></ul>
  41061. </div>
  41062. </div>
  41063. <div class="section-level-extent" id="drawbox">
  41064. <h3 class="section"><span>39.75 drawbox<a class="copiable-link" href="#drawbox"> &para;</a></span></h3>
  41065. <p>Draw a colored box on the input image.
  41066. </p>
  41067. <p>It accepts the following parameters:
  41068. </p>
  41069. <dl class="table">
  41070. <dt><samp class="option">x</samp></dt>
  41071. <dt><samp class="option">y</samp></dt>
  41072. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  41073. </p>
  41074. </dd>
  41075. <dt><samp class="option">width, w</samp></dt>
  41076. <dt><samp class="option">height, h</samp></dt>
  41077. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  41078. the input width and height. It defaults to 0.
  41079. </p>
  41080. </dd>
  41081. <dt><samp class="option">color, c</samp></dt>
  41082. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  41083. 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
  41084. value <code class="code">invert</code> is used, the box edge color is the same as the
  41085. video with inverted luma.
  41086. </p>
  41087. </dd>
  41088. <dt><samp class="option">thickness, t</samp></dt>
  41089. <dd><p>The expression which sets the thickness of the box edge.
  41090. A value of <code class="code">fill</code> will create a filled box. Default value is <code class="code">3</code>.
  41091. </p>
  41092. <p>See below for the list of accepted constants.
  41093. </p>
  41094. </dd>
  41095. <dt><samp class="option">replace</samp></dt>
  41096. <dd><p>Applicable if the input has alpha. With value <code class="code">1</code>, the pixels of the painted box
  41097. will overwrite the video&rsquo;s color and alpha pixels.
  41098. Default is <code class="code">0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  41099. </p></dd>
  41100. </dl>
  41101. <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
  41102. following constants:
  41103. </p>
  41104. <dl class="table">
  41105. <dt><samp class="option">dar</samp></dt>
  41106. <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>.
  41107. </p>
  41108. </dd>
  41109. <dt><samp class="option">hsub</samp></dt>
  41110. <dt><samp class="option">vsub</samp></dt>
  41111. <dd><p>horizontal and vertical chroma subsample values. For example for the
  41112. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  41113. </p>
  41114. </dd>
  41115. <dt><samp class="option">in_h, ih</samp></dt>
  41116. <dt><samp class="option">in_w, iw</samp></dt>
  41117. <dd><p>The input width and height.
  41118. </p>
  41119. </dd>
  41120. <dt><samp class="option">sar</samp></dt>
  41121. <dd><p>The input sample aspect ratio.
  41122. </p>
  41123. </dd>
  41124. <dt><samp class="option">x</samp></dt>
  41125. <dt><samp class="option">y</samp></dt>
  41126. <dd><p>The x and y offset coordinates where the box is drawn.
  41127. </p>
  41128. </dd>
  41129. <dt><samp class="option">w</samp></dt>
  41130. <dt><samp class="option">h</samp></dt>
  41131. <dd><p>The width and height of the drawn box.
  41132. </p>
  41133. </dd>
  41134. <dt><samp class="option">box_source</samp></dt>
  41135. <dd><p>Box source can be set as side_data_detection_bboxes if you want to use box data in
  41136. detection bboxes of side data.
  41137. </p>
  41138. <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
  41139. still use box data in detection bboxes of side data. So please do not use this parameter if you were
  41140. not sure about the box source.
  41141. </p>
  41142. </dd>
  41143. <dt><samp class="option">t</samp></dt>
  41144. <dd><p>The thickness of the drawn box.
  41145. </p>
  41146. <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
  41147. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  41148. </p>
  41149. </dd>
  41150. </dl>
  41151. <ul class="mini-toc">
  41152. <li><a href="#Examples-111" accesskey="1">Examples</a></li>
  41153. <li><a href="#Commands-86" accesskey="2">Commands</a></li>
  41154. </ul>
  41155. <div class="subsection-level-extent" id="Examples-111">
  41156. <h4 class="subsection"><span>39.75.1 Examples<a class="copiable-link" href="#Examples-111"> &para;</a></span></h4>
  41157. <ul class="itemize mark-bullet">
  41158. <li>Draw a black box around the edge of the input image:
  41159. <div class="example">
  41160. <pre class="example-preformatted">drawbox
  41161. </pre></div>
  41162. </li><li>Draw a box with color red and an opacity of 50%:
  41163. <div class="example">
  41164. <pre class="example-preformatted">drawbox=10:20:200:60:red@0.5
  41165. </pre></div>
  41166. <p>The previous example can be specified as:
  41167. </p><div class="example">
  41168. <pre class="example-preformatted">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  41169. </pre></div>
  41170. </li><li>Fill the box with pink color:
  41171. <div class="example">
  41172. <pre class="example-preformatted">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  41173. </pre></div>
  41174. </li><li>Draw a 2-pixel red 2.40:1 mask:
  41175. <div class="example">
  41176. <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
  41177. </pre></div>
  41178. </li></ul>
  41179. </div>
  41180. <div class="subsection-level-extent" id="Commands-86">
  41181. <h4 class="subsection"><span>39.75.2 Commands<a class="copiable-link" href="#Commands-86"> &para;</a></span></h4>
  41182. <p>This filter supports same commands as options.
  41183. The command accepts the same syntax of the corresponding option.
  41184. </p>
  41185. <p>If the specified expression is not valid, it is kept at its current
  41186. value.
  41187. </p>
  41188. <a class="anchor" id="drawgraph"></a></div>
  41189. </div>
  41190. <div class="section-level-extent" id="drawgraph-1">
  41191. <h3 class="section"><span>39.76 drawgraph<a class="copiable-link" href="#drawgraph-1"> &para;</a></span></h3>
  41192. <p>Draw a graph using input video metadata.
  41193. </p>
  41194. <p>It accepts the following parameters:
  41195. </p>
  41196. <dl class="table">
  41197. <dt><samp class="option">m1</samp></dt>
  41198. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  41199. </p>
  41200. </dd>
  41201. <dt><samp class="option">fg1</samp></dt>
  41202. <dd><p>Set 1st foreground color expression.
  41203. </p>
  41204. </dd>
  41205. <dt><samp class="option">m2</samp></dt>
  41206. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  41207. </p>
  41208. </dd>
  41209. <dt><samp class="option">fg2</samp></dt>
  41210. <dd><p>Set 2nd foreground color expression.
  41211. </p>
  41212. </dd>
  41213. <dt><samp class="option">m3</samp></dt>
  41214. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  41215. </p>
  41216. </dd>
  41217. <dt><samp class="option">fg3</samp></dt>
  41218. <dd><p>Set 3rd foreground color expression.
  41219. </p>
  41220. </dd>
  41221. <dt><samp class="option">m4</samp></dt>
  41222. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  41223. </p>
  41224. </dd>
  41225. <dt><samp class="option">fg4</samp></dt>
  41226. <dd><p>Set 4th foreground color expression.
  41227. </p>
  41228. </dd>
  41229. <dt><samp class="option">min</samp></dt>
  41230. <dd><p>Set minimal value of metadata value.
  41231. </p>
  41232. </dd>
  41233. <dt><samp class="option">max</samp></dt>
  41234. <dd><p>Set maximal value of metadata value.
  41235. </p>
  41236. </dd>
  41237. <dt><samp class="option">bg</samp></dt>
  41238. <dd><p>Set graph background color. Default is white.
  41239. </p>
  41240. </dd>
  41241. <dt><samp class="option">mode</samp></dt>
  41242. <dd><p>Set graph mode.
  41243. </p>
  41244. <p>Available values for mode is:
  41245. </p><dl class="table">
  41246. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  41247. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  41248. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  41249. </dl>
  41250. <p>Default is <code class="code">line</code>.
  41251. </p>
  41252. </dd>
  41253. <dt><samp class="option">slide</samp></dt>
  41254. <dd><p>Set slide mode.
  41255. </p>
  41256. <p>Available values for slide is:
  41257. </p><dl class="table">
  41258. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  41259. <dd><p>Draw new frame when right border is reached.
  41260. </p>
  41261. </dd>
  41262. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  41263. <dd><p>Replace old columns with new ones.
  41264. </p>
  41265. </dd>
  41266. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  41267. <dd><p>Scroll from right to left.
  41268. </p>
  41269. </dd>
  41270. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  41271. <dd><p>Scroll from left to right.
  41272. </p>
  41273. </dd>
  41274. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  41275. <dd><p>Draw single picture.
  41276. </p></dd>
  41277. </dl>
  41278. <p>Default is <code class="code">frame</code>.
  41279. </p>
  41280. </dd>
  41281. <dt><samp class="option">size</samp></dt>
  41282. <dd><p>Set size of graph video. For the syntax of this option, check the
  41283. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  41284. The default value is <code class="code">900x256</code>.
  41285. </p>
  41286. </dd>
  41287. <dt><samp class="option">rate, r</samp></dt>
  41288. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  41289. </p>
  41290. <p>The foreground color expressions can use the following variables:
  41291. </p><dl class="table">
  41292. <dt><samp class="option">MIN</samp></dt>
  41293. <dd><p>Minimal value of metadata value.
  41294. </p>
  41295. </dd>
  41296. <dt><samp class="option">MAX</samp></dt>
  41297. <dd><p>Maximal value of metadata value.
  41298. </p>
  41299. </dd>
  41300. <dt><samp class="option">VAL</samp></dt>
  41301. <dd><p>Current metadata key value.
  41302. </p></dd>
  41303. </dl>
  41304. <p>The color is defined as 0xAABBGGRR.
  41305. </p></dd>
  41306. </dl>
  41307. <p>Example using metadata from <a class="ref" href="#signalstats">signalstats</a> filter:
  41308. </p><div class="example">
  41309. <pre class="example-preformatted">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  41310. </pre></div>
  41311. <p>Example using metadata from <a class="ref" href="#ebur128">ebur128</a> filter:
  41312. </p><div class="example">
  41313. <pre class="example-preformatted">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  41314. </pre></div>
  41315. </div>
  41316. <div class="section-level-extent" id="drawgrid">
  41317. <h3 class="section"><span>39.77 drawgrid<a class="copiable-link" href="#drawgrid"> &para;</a></span></h3>
  41318. <p>Draw a grid on the input image.
  41319. </p>
  41320. <p>It accepts the following parameters:
  41321. </p>
  41322. <dl class="table">
  41323. <dt><samp class="option">x</samp></dt>
  41324. <dt><samp class="option">y</samp></dt>
  41325. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  41326. </p>
  41327. </dd>
  41328. <dt><samp class="option">width, w</samp></dt>
  41329. <dt><samp class="option">height, h</samp></dt>
  41330. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  41331. input width and height, respectively, minus <code class="code">thickness</code>, so image gets
  41332. framed. Default to 0.
  41333. </p>
  41334. </dd>
  41335. <dt><samp class="option">color, c</samp></dt>
  41336. <dd><p>Specify the color of the grid. For the general syntax of this option,
  41337. 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
  41338. value <code class="code">invert</code> is used, the grid color is the same as the
  41339. video with inverted luma.
  41340. </p>
  41341. </dd>
  41342. <dt><samp class="option">thickness, t</samp></dt>
  41343. <dd><p>The expression which sets the thickness of the grid line. Default value is <code class="code">1</code>.
  41344. </p>
  41345. <p>See below for the list of accepted constants.
  41346. </p>
  41347. </dd>
  41348. <dt><samp class="option">replace</samp></dt>
  41349. <dd><p>Applicable if the input has alpha. With <code class="code">1</code> the pixels of the painted grid
  41350. will overwrite the video&rsquo;s color and alpha pixels.
  41351. Default is <code class="code">0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  41352. </p></dd>
  41353. </dl>
  41354. <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
  41355. following constants:
  41356. </p>
  41357. <dl class="table">
  41358. <dt><samp class="option">dar</samp></dt>
  41359. <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>.
  41360. </p>
  41361. </dd>
  41362. <dt><samp class="option">hsub</samp></dt>
  41363. <dt><samp class="option">vsub</samp></dt>
  41364. <dd><p>horizontal and vertical chroma subsample values. For example for the
  41365. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  41366. </p>
  41367. </dd>
  41368. <dt><samp class="option">in_h, ih</samp></dt>
  41369. <dt><samp class="option">in_w, iw</samp></dt>
  41370. <dd><p>The input grid cell width and height.
  41371. </p>
  41372. </dd>
  41373. <dt><samp class="option">sar</samp></dt>
  41374. <dd><p>The input sample aspect ratio.
  41375. </p>
  41376. </dd>
  41377. <dt><samp class="option">x</samp></dt>
  41378. <dt><samp class="option">y</samp></dt>
  41379. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  41380. </p>
  41381. </dd>
  41382. <dt><samp class="option">w</samp></dt>
  41383. <dt><samp class="option">h</samp></dt>
  41384. <dd><p>The width and height of the drawn cell.
  41385. </p>
  41386. </dd>
  41387. <dt><samp class="option">t</samp></dt>
  41388. <dd><p>The thickness of the drawn cell.
  41389. </p>
  41390. <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
  41391. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  41392. </p>
  41393. </dd>
  41394. </dl>
  41395. <ul class="mini-toc">
  41396. <li><a href="#Examples-112" accesskey="1">Examples</a></li>
  41397. <li><a href="#Commands-87" accesskey="2">Commands</a></li>
  41398. </ul>
  41399. <div class="subsection-level-extent" id="Examples-112">
  41400. <h4 class="subsection"><span>39.77.1 Examples<a class="copiable-link" href="#Examples-112"> &para;</a></span></h4>
  41401. <ul class="itemize mark-bullet">
  41402. <li>Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  41403. <div class="example">
  41404. <pre class="example-preformatted">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  41405. </pre></div>
  41406. </li><li>Draw a white 3x3 grid with an opacity of 50%:
  41407. <div class="example">
  41408. <pre class="example-preformatted">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  41409. </pre></div>
  41410. </li></ul>
  41411. </div>
  41412. <div class="subsection-level-extent" id="Commands-87">
  41413. <h4 class="subsection"><span>39.77.2 Commands<a class="copiable-link" href="#Commands-87"> &para;</a></span></h4>
  41414. <p>This filter supports same commands as options.
  41415. The command accepts the same syntax of the corresponding option.
  41416. </p>
  41417. <p>If the specified expression is not valid, it is kept at its current
  41418. value.
  41419. </p>
  41420. <a class="anchor" id="drawtext"></a></div>
  41421. </div>
  41422. <div class="section-level-extent" id="drawtext-1">
  41423. <h3 class="section"><span>39.78 drawtext<a class="copiable-link" href="#drawtext-1"> &para;</a></span></h3>
  41424. <p>Draw a text string or text from a specified file on top of a video, using the
  41425. libfreetype library.
  41426. </p>
  41427. <p>To enable compilation of this filter, you need to configure FFmpeg with
  41428. <code class="code">--enable-libfreetype</code> and <code class="code">--enable-libharfbuzz</code>.
  41429. To enable default font fallback and the <var class="var">font</var> option you need to
  41430. configure FFmpeg with <code class="code">--enable-libfontconfig</code>.
  41431. To enable the <var class="var">text_shaping</var> option, you need to configure FFmpeg with
  41432. <code class="code">--enable-libfribidi</code>.
  41433. </p>
  41434. <ul class="mini-toc">
  41435. <li><a href="#Syntax-2" accesskey="1">Syntax</a></li>
  41436. <li><a href="#Text-expansion" accesskey="2">Text expansion</a></li>
  41437. <li><a href="#Commands-88" accesskey="3">Commands</a></li>
  41438. <li><a href="#Examples-113" accesskey="4">Examples</a></li>
  41439. </ul>
  41440. <div class="subsection-level-extent" id="Syntax-2">
  41441. <h4 class="subsection"><span>39.78.1 Syntax<a class="copiable-link" href="#Syntax-2"> &para;</a></span></h4>
  41442. <p>It accepts the following parameters:
  41443. </p>
  41444. <dl class="table">
  41445. <dt><samp class="option">box</samp></dt>
  41446. <dd><p>Used to draw a box around text using the background color.
  41447. The value must be either 1 (enable) or 0 (disable).
  41448. The default value of <var class="var">box</var> is 0.
  41449. </p>
  41450. </dd>
  41451. <dt><samp class="option">boxborderw</samp></dt>
  41452. <dd><p>Set the width of the border to be drawn around the box using <var class="var">boxcolor</var>.
  41453. The value must be specified using one of the following formats:
  41454. </p><ul class="itemize mark-bullet">
  41455. <li><code class="code">boxborderw=10</code> set the width of all the borders to 10
  41456. </li><li><code class="code">boxborderw=10|20</code> set the width of the top and bottom borders to 10
  41457. and the width of the left and right borders to 20
  41458. </li><li><code class="code">boxborderw=10|20|30</code> set the width of the top border to 10, the width
  41459. of the bottom border to 30 and the width of the left and right borders to 20
  41460. </li><li><code class="code">boxborderw=10|20|30|40</code> set the borders width to 10 (top), 20 (right),
  41461. 30 (bottom), 40 (left)
  41462. </li></ul>
  41463. <p>The default value of <var class="var">boxborderw</var> is &quot;0&quot;.
  41464. </p>
  41465. </dd>
  41466. <dt><samp class="option">boxcolor</samp></dt>
  41467. <dd><p>The color to be used for drawing box around text. For the syntax of this
  41468. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  41469. </p>
  41470. <p>The default value of <var class="var">boxcolor</var> is &quot;white&quot;.
  41471. </p>
  41472. </dd>
  41473. <dt><samp class="option">line_spacing</samp></dt>
  41474. <dd><p>Set the line spacing in pixels. The default value of <var class="var">line_spacing</var> is 0.
  41475. </p>
  41476. </dd>
  41477. <dt><samp class="option">text_align</samp></dt>
  41478. <dd><p>Set the vertical and horizontal alignment of the text with respect to the box boundaries.
  41479. The value is combination of flags, one for the vertical alignment (T=top,
  41480. M=middle, B=bottom) and one for the horizontal alignment (L=left, C=center, R=right).
  41481. Please note that tab characters are only supported with the left horizontal alignment.
  41482. </p>
  41483. </dd>
  41484. <dt><samp class="option">y_align</samp></dt>
  41485. <dd><p>Specify what the <var class="var">y</var> value is referred to. Possible values are:
  41486. </p><ul class="itemize mark-bullet">
  41487. <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>
  41488. </li><li><code class="code">baseline</code> the baseline of the first text line is placed at <var class="var">y</var>
  41489. </li><li><code class="code">font</code> the baseline of the first text line is placed at <var class="var">y</var> plus the
  41490. ascent (in pixels) defined in the font metrics
  41491. </li></ul>
  41492. <p>The default value of <var class="var">y_align</var> is &quot;text&quot; for backward compatibility.
  41493. </p>
  41494. </dd>
  41495. <dt><samp class="option">borderw</samp></dt>
  41496. <dd><p>Set the width of the border to be drawn around the text using <var class="var">bordercolor</var>.
  41497. The default value of <var class="var">borderw</var> is 0.
  41498. </p>
  41499. </dd>
  41500. <dt><samp class="option">bordercolor</samp></dt>
  41501. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  41502. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  41503. </p>
  41504. <p>The default value of <var class="var">bordercolor</var> is &quot;black&quot;.
  41505. </p>
  41506. </dd>
  41507. <dt><samp class="option">expansion</samp></dt>
  41508. <dd><p>Select how the <var class="var">text</var> is expanded. Can be either <code class="code">none</code>,
  41509. <code class="code">strftime</code> (deprecated) or <code class="code">normal</code> (default). See the
  41510. <a class="ref" href="#drawtext_005fexpansion">Text expansion</a> section below for details.
  41511. </p>
  41512. </dd>
  41513. <dt><samp class="option">basetime</samp></dt>
  41514. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  41515. in the deprecated <code class="code">strftime</code> expansion mode. To emulate in normal expansion
  41516. mode use the <code class="code">pts</code> function, supplying the start time (in seconds)
  41517. as the second argument.
  41518. </p>
  41519. </dd>
  41520. <dt><samp class="option">fix_bounds</samp></dt>
  41521. <dd><p>If true, check and fix text coords to avoid clipping.
  41522. </p>
  41523. </dd>
  41524. <dt><samp class="option">fontcolor</samp></dt>
  41525. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  41526. the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  41527. </p>
  41528. <p>The default value of <var class="var">fontcolor</var> is &quot;black&quot;.
  41529. </p>
  41530. </dd>
  41531. <dt><samp class="option">fontcolor_expr</samp></dt>
  41532. <dd><p>String which is expanded the same way as <var class="var">text</var> to obtain dynamic
  41533. <var class="var">fontcolor</var> value. By default this option has empty value and is not
  41534. processed. When this option is set, it overrides <var class="var">fontcolor</var> option.
  41535. </p>
  41536. </dd>
  41537. <dt><samp class="option">font</samp></dt>
  41538. <dd><p>The font family to be used for drawing text. By default Sans.
  41539. </p>
  41540. </dd>
  41541. <dt><samp class="option">fontfile</samp></dt>
  41542. <dd><p>The font file to be used for drawing text. The path must be included.
  41543. This parameter is mandatory if the fontconfig support is disabled.
  41544. </p>
  41545. </dd>
  41546. <dt><samp class="option">alpha</samp></dt>
  41547. <dd><p>Draw the text applying alpha blending. The value can
  41548. be a number between 0.0 and 1.0.
  41549. The expression accepts the same variables <var class="var">x, y</var> as well.
  41550. The default value is 1.
  41551. Please see <var class="var">fontcolor_expr</var>.
  41552. </p>
  41553. </dd>
  41554. <dt><samp class="option">fontsize</samp></dt>
  41555. <dd><p>The font size to be used for drawing text.
  41556. The default value of <var class="var">fontsize</var> is 16.
  41557. </p>
  41558. </dd>
  41559. <dt><samp class="option">text_shaping</samp></dt>
  41560. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  41561. right-to-left text and join Arabic characters) before drawing it.
  41562. Otherwise, just draw the text exactly as given.
  41563. By default 1 (if supported).
  41564. </p>
  41565. </dd>
  41566. <dt><samp class="option">ft_load_flags</samp></dt>
  41567. <dd><p>The flags to be used for loading the fonts.
  41568. </p>
  41569. <p>The flags map the corresponding flags supported by libfreetype, and are
  41570. a combination of the following values:
  41571. </p><dl class="table">
  41572. <dt><var class="var">default</var></dt>
  41573. <dt><var class="var">no_scale</var></dt>
  41574. <dt><var class="var">no_hinting</var></dt>
  41575. <dt><var class="var">render</var></dt>
  41576. <dt><var class="var">no_bitmap</var></dt>
  41577. <dt><var class="var">vertical_layout</var></dt>
  41578. <dt><var class="var">force_autohint</var></dt>
  41579. <dt><var class="var">crop_bitmap</var></dt>
  41580. <dt><var class="var">pedantic</var></dt>
  41581. <dt><var class="var">ignore_global_advance_width</var></dt>
  41582. <dt><var class="var">no_recurse</var></dt>
  41583. <dt><var class="var">ignore_transform</var></dt>
  41584. <dt><var class="var">monochrome</var></dt>
  41585. <dt><var class="var">linear_design</var></dt>
  41586. <dt><var class="var">no_autohint</var></dt>
  41587. </dl>
  41588. <p>Default value is &quot;default&quot;.
  41589. </p>
  41590. <p>For more information consult the documentation for the FT_LOAD_*
  41591. libfreetype flags.
  41592. </p>
  41593. </dd>
  41594. <dt><samp class="option">shadowcolor</samp></dt>
  41595. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  41596. syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the
  41597. ffmpeg-utils manual</a>.
  41598. </p>
  41599. <p>The default value of <var class="var">shadowcolor</var> is &quot;black&quot;.
  41600. </p>
  41601. </dd>
  41602. <dt><samp class="option">boxw</samp></dt>
  41603. <dd><p>Set the width of the box to be drawn around text.
  41604. The default value of <var class="var">boxw</var> is computed automatically to match the text width
  41605. </p>
  41606. </dd>
  41607. <dt><samp class="option">boxh</samp></dt>
  41608. <dd><p>Set the height of the box to be drawn around text.
  41609. The default value of <var class="var">boxh</var> is computed automatically to match the text height
  41610. </p>
  41611. </dd>
  41612. <dt><samp class="option">shadowx</samp></dt>
  41613. <dt><samp class="option">shadowy</samp></dt>
  41614. <dd><p>The x and y offsets for the text shadow position with respect to the
  41615. position of the text. They can be either positive or negative
  41616. values. The default value for both is &quot;0&quot;.
  41617. </p>
  41618. </dd>
  41619. <dt><samp class="option">start_number</samp></dt>
  41620. <dd><p>The starting frame number for the n/frame_num variable. The default value
  41621. is &quot;0&quot;.
  41622. </p>
  41623. </dd>
  41624. <dt><samp class="option">tabsize</samp></dt>
  41625. <dd><p>The size in number of spaces to use for rendering the tab.
  41626. Default value is 4.
  41627. </p>
  41628. </dd>
  41629. <dt><samp class="option">timecode</samp></dt>
  41630. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  41631. format. It can be used with or without text parameter. <var class="var">timecode_rate</var>
  41632. option must be specified.
  41633. </p>
  41634. </dd>
  41635. <dt><samp class="option">timecode_rate, rate, r</samp></dt>
  41636. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  41637. integer. Minimum value is &quot;1&quot;.
  41638. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  41639. </p>
  41640. </dd>
  41641. <dt><samp class="option">tc24hmax</samp></dt>
  41642. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  41643. Default is 0 (disabled).
  41644. </p>
  41645. </dd>
  41646. <dt><samp class="option">text</samp></dt>
  41647. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  41648. encoded characters.
  41649. This parameter is mandatory if no file is specified with the parameter
  41650. <var class="var">textfile</var>.
  41651. </p>
  41652. </dd>
  41653. <dt><samp class="option">textfile</samp></dt>
  41654. <dd><p>A text file containing text to be drawn. The text must be a sequence
  41655. of UTF-8 encoded characters.
  41656. </p>
  41657. <p>This parameter is mandatory if no text string is specified with the
  41658. parameter <var class="var">text</var>.
  41659. </p>
  41660. <p>If both <var class="var">text</var> and <var class="var">textfile</var> are specified, an error is thrown.
  41661. </p>
  41662. </dd>
  41663. <dt><samp class="option">text_source</samp></dt>
  41664. <dd><p>Text source should be set as side_data_detection_bboxes if you want to use text data in
  41665. detection bboxes of side data.
  41666. </p>
  41667. <p>If text source is set, <var class="var">text</var> and <var class="var">textfile</var> will be ignored and still use
  41668. text data in detection bboxes of side data. So please do not use this parameter
  41669. if you are not sure about the text source.
  41670. </p>
  41671. </dd>
  41672. <dt><samp class="option">reload</samp></dt>
  41673. <dd><p>The <var class="var">textfile</var> will be reloaded at specified frame interval.
  41674. Be sure to update <var class="var">textfile</var> atomically, or it may be read partially,
  41675. or even fail.
  41676. Range is 0 to INT_MAX. Default is 0.
  41677. </p>
  41678. </dd>
  41679. <dt><samp class="option">x</samp></dt>
  41680. <dt><samp class="option">y</samp></dt>
  41681. <dd><p>The expressions which specify the offsets where text will be drawn
  41682. within the video frame. They are relative to the top/left border of the
  41683. output image.
  41684. </p>
  41685. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is &quot;0&quot;.
  41686. </p>
  41687. <p>See below for the list of accepted constants and functions.
  41688. </p></dd>
  41689. </dl>
  41690. <p>The parameters for <var class="var">x</var> and <var class="var">y</var> are expressions containing the
  41691. following constants and functions:
  41692. </p>
  41693. <dl class="table">
  41694. <dt><samp class="option">dar</samp></dt>
  41695. <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>
  41696. </p>
  41697. </dd>
  41698. <dt><samp class="option">hsub</samp></dt>
  41699. <dt><samp class="option">vsub</samp></dt>
  41700. <dd><p>horizontal and vertical chroma subsample values. For example for the
  41701. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  41702. </p>
  41703. </dd>
  41704. <dt><samp class="option">line_h, lh</samp></dt>
  41705. <dd><p>the height of each text line
  41706. </p>
  41707. </dd>
  41708. <dt><samp class="option">main_h, h, H</samp></dt>
  41709. <dd><p>the input height
  41710. </p>
  41711. </dd>
  41712. <dt><samp class="option">main_w, w, W</samp></dt>
  41713. <dd><p>the input width
  41714. </p>
  41715. </dd>
  41716. <dt><samp class="option">max_glyph_a, ascent</samp></dt>
  41717. <dd><p>the maximum distance from the baseline to the highest/upper grid
  41718. coordinate used to place a glyph outline point, for all the rendered
  41719. glyphs.
  41720. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  41721. upwards.
  41722. </p>
  41723. </dd>
  41724. <dt><samp class="option">max_glyph_d, descent</samp></dt>
  41725. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  41726. used to place a glyph outline point, for all the rendered glyphs.
  41727. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  41728. upwards.
  41729. </p>
  41730. </dd>
  41731. <dt><samp class="option">max_glyph_h</samp></dt>
  41732. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  41733. contained in the rendered text, it is equivalent to <var class="var">ascent</var> -
  41734. <var class="var">descent</var>.
  41735. </p>
  41736. </dd>
  41737. <dt><samp class="option">max_glyph_w</samp></dt>
  41738. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  41739. contained in the rendered text
  41740. </p>
  41741. </dd>
  41742. <dt><samp class="option">font_a</samp></dt>
  41743. <dd><p>the ascent size defined in the font metrics
  41744. </p>
  41745. </dd>
  41746. <dt><samp class="option">font_d</samp></dt>
  41747. <dd><p>the descent size defined in the font metrics
  41748. </p>
  41749. </dd>
  41750. <dt><samp class="option">top_a</samp></dt>
  41751. <dd><p>the maximum ascender of the glyphs of the first text line
  41752. </p>
  41753. </dd>
  41754. <dt><samp class="option">bottom_d</samp></dt>
  41755. <dd><p>the maximum descender of the glyphs of the last text line
  41756. </p>
  41757. </dd>
  41758. <dt><samp class="option">n</samp></dt>
  41759. <dd><p>the number of input frame, starting from 0
  41760. </p>
  41761. </dd>
  41762. <dt><samp class="option">rand(min, max)</samp></dt>
  41763. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  41764. </p>
  41765. </dd>
  41766. <dt><samp class="option">sar</samp></dt>
  41767. <dd><p>The input sample aspect ratio.
  41768. </p>
  41769. </dd>
  41770. <dt><samp class="option">t</samp></dt>
  41771. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  41772. </p>
  41773. </dd>
  41774. <dt><samp class="option">text_h, th</samp></dt>
  41775. <dd><p>the height of the rendered text
  41776. </p>
  41777. </dd>
  41778. <dt><samp class="option">text_w, tw</samp></dt>
  41779. <dd><p>the width of the rendered text
  41780. </p>
  41781. </dd>
  41782. <dt><samp class="option">x</samp></dt>
  41783. <dt><samp class="option">y</samp></dt>
  41784. <dd><p>the x and y offset coordinates where the text is drawn.
  41785. </p>
  41786. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer
  41787. to each other, so you can for example specify <code class="code">y=x/dar</code>.
  41788. </p>
  41789. </dd>
  41790. <dt><samp class="option">pict_type</samp></dt>
  41791. <dd><p>A one character description of the current frame&rsquo;s picture type.
  41792. </p>
  41793. </dd>
  41794. <dt><samp class="option">pkt_pos</samp></dt>
  41795. <dd><p>The current packet&rsquo;s position in the input file or stream
  41796. (in bytes, from the start of the input). A value of -1 indicates
  41797. this info is not available.
  41798. </p>
  41799. </dd>
  41800. <dt><samp class="option">duration</samp></dt>
  41801. <dd><p>The current packet&rsquo;s duration, in seconds.
  41802. </p>
  41803. </dd>
  41804. <dt><samp class="option">pkt_size</samp></dt>
  41805. <dd><p>The current packet&rsquo;s size (in bytes).
  41806. </p></dd>
  41807. </dl>
  41808. <a class="anchor" id="drawtext_005fexpansion"></a></div>
  41809. <div class="subsection-level-extent" id="Text-expansion">
  41810. <h4 class="subsection"><span>39.78.2 Text expansion<a class="copiable-link" href="#Text-expansion"> &para;</a></span></h4>
  41811. <p>If <samp class="option">expansion</samp> is set to <code class="code">strftime</code>, the filter recognizes
  41812. sequences accepted by the <code class="code">strftime</code> C function in the provided
  41813. text and expands them accordingly. Check the documentation of
  41814. <code class="code">strftime</code>. This feature is deprecated in favor of <code class="code">normal</code>
  41815. expansion with the <code class="code">gmtime</code> or <code class="code">localtime</code> expansion
  41816. functions.
  41817. </p>
  41818. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  41819. </p>
  41820. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  41821. the following expansion mechanism is used.
  41822. </p>
  41823. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  41824. the second character.
  41825. </p>
  41826. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  41827. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  41828. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  41829. they should be escaped.
  41830. </p>
  41831. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  41832. option in the filter argument string and as the filter argument in the
  41833. filtergraph description, and possibly also for the shell, that makes up to four
  41834. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  41835. these problems.
  41836. </p>
  41837. <p>The following functions are available:
  41838. </p>
  41839. <dl class="table">
  41840. <dt><code class="command">expr, e</code></dt>
  41841. <dd><p>The expression evaluation result.
  41842. </p>
  41843. <p>It must take one argument specifying the expression to be evaluated,
  41844. which accepts the same constants and functions as the <var class="var">x</var> and
  41845. <var class="var">y</var> values. Note that not all constants should be used, for
  41846. example the text size is not known when evaluating the expression, so
  41847. the constants <var class="var">text_w</var> and <var class="var">text_h</var> will have an undefined
  41848. value.
  41849. </p>
  41850. </dd>
  41851. <dt><code class="command">expr_int_format, eif</code></dt>
  41852. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  41853. </p>
  41854. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  41855. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  41856. &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
  41857. <code class="code">printf</code> function.
  41858. The third parameter is optional and sets the number of positions taken by the output.
  41859. It can be used to add padding with zeros from the left.
  41860. </p>
  41861. </dd>
  41862. <dt><code class="command">gmtime</code></dt>
  41863. <dd><p>The time at which the filter is running, expressed in UTC.
  41864. It can accept an argument: a <code class="code">strftime</code> C function format string.
  41865. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  41866. which prints fractions of the second with optionally specified number of digits.
  41867. </p>
  41868. </dd>
  41869. <dt><code class="command">localtime</code></dt>
  41870. <dd><p>The time at which the filter is running, expressed in the local time zone.
  41871. It can accept an argument: a <code class="code">strftime</code> C function format string.
  41872. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  41873. which prints fractions of the second with optionally specified number of digits.
  41874. </p>
  41875. </dd>
  41876. <dt><code class="command">metadata</code></dt>
  41877. <dd><p>Frame metadata. Takes one or two arguments.
  41878. </p>
  41879. <p>The first argument is mandatory and specifies the metadata key.
  41880. </p>
  41881. <p>The second argument is optional and specifies a default value, used when the
  41882. metadata key is not found or empty.
  41883. </p>
  41884. <p>Available metadata can be identified by inspecting entries
  41885. starting with TAG included within each frame section
  41886. printed by running <code class="code">ffprobe -show_frames</code>.
  41887. </p>
  41888. <p>String metadata generated in filters leading to
  41889. the drawtext filter are also available.
  41890. </p>
  41891. </dd>
  41892. <dt><code class="command">n, frame_num</code></dt>
  41893. <dd><p>The frame number, starting from 0.
  41894. </p>
  41895. </dd>
  41896. <dt><code class="command">pict_type</code></dt>
  41897. <dd><p>A one character description of the current picture type.
  41898. </p>
  41899. </dd>
  41900. <dt><code class="command">pts</code></dt>
  41901. <dd><p>The timestamp of the current frame.
  41902. It can take up to three arguments.
  41903. </p>
  41904. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code>
  41905. for seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands
  41906. for a formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  41907. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  41908. <code class="code">localtime</code> stands for the timestamp of the frame formatted as
  41909. local time zone time.
  41910. </p>
  41911. <p>The second argument is an offset added to the timestamp.
  41912. </p>
  41913. <p>If the format is set to <code class="code">hms</code>, a third argument <code class="code">24HH</code> may be
  41914. supplied to present the hour part of the formatted timestamp in 24h format
  41915. (00-23).
  41916. </p>
  41917. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third
  41918. argument may be supplied: a <code class="code">strftime</code> C function format string.
  41919. By default, <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  41920. </p></dd>
  41921. </dl>
  41922. </div>
  41923. <div class="subsection-level-extent" id="Commands-88">
  41924. <h4 class="subsection"><span>39.78.3 Commands<a class="copiable-link" href="#Commands-88"> &para;</a></span></h4>
  41925. <p>This filter supports altering parameters via commands:
  41926. </p><dl class="table">
  41927. <dt><samp class="option">reinit</samp></dt>
  41928. <dd><p>Alter existing filter parameters.
  41929. </p>
  41930. <p>Syntax for the argument is the same as for filter invocation, e.g.
  41931. </p>
  41932. <div class="example">
  41933. <pre class="example-preformatted">fontsize=56:fontcolor=green:text='Hello World'
  41934. </pre></div>
  41935. <p>Full filter invocation with sendcmd would look like this:
  41936. </p>
  41937. <div class="example">
  41938. <pre class="example-preformatted">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  41939. </pre></div>
  41940. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  41941. continue with its existing parameters.
  41942. </p>
  41943. </dd>
  41944. </dl>
  41945. <p>The following options are also supported as <a class="ref" href="#commands">commands</a>:
  41946. </p>
  41947. <ul class="itemize mark-bullet">
  41948. <li>x
  41949. </li><li>y
  41950. </li><li>alpha
  41951. </li><li>fontsize
  41952. </li><li>fontcolor
  41953. </li><li>boxcolor
  41954. </li><li>bordercolor
  41955. </li><li>shadowcolor
  41956. </li><li>box
  41957. </li><li>boxw
  41958. </li><li>boxh
  41959. </li><li>boxborderw
  41960. </li><li>line_spacing
  41961. </li><li>text_align
  41962. </li><li>shadowx
  41963. </li><li>shadowy
  41964. </li><li>borderw
  41965. </li></ul>
  41966. </div>
  41967. <div class="subsection-level-extent" id="Examples-113">
  41968. <h4 class="subsection"><span>39.78.4 Examples<a class="copiable-link" href="#Examples-113"> &para;</a></span></h4>
  41969. <ul class="itemize mark-bullet">
  41970. <li>Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  41971. optional parameters.
  41972. <div class="example">
  41973. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  41974. </pre></div>
  41975. </li><li>Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  41976. and y=50 (counting from the top-left corner of the screen), text is
  41977. yellow with a red box around it. Both the text and the box have an
  41978. opacity of 20%.
  41979. <div class="example">
  41980. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  41981. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  41982. </pre></div>
  41983. <p>Note that the double quotes are not necessary if spaces are not used
  41984. within the parameter list.
  41985. </p>
  41986. </li><li>Show the text at the center of the video frame:
  41987. <div class="example">
  41988. <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;
  41989. </pre></div>
  41990. </li><li>Show the text at a random position, switching to a new position every 30 seconds:
  41991. <div class="example">
  41992. <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;
  41993. </pre></div>
  41994. </li><li>Show a text line sliding from right to left in the last row of the video
  41995. frame. The file <samp class="file">LONG_LINE</samp> is assumed to contain a single line
  41996. with no newlines.
  41997. <div class="example">
  41998. <pre class="example-preformatted">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  41999. </pre></div>
  42000. </li><li>Show the content of file <samp class="file">CREDITS</samp> off the bottom of the frame and scroll up.
  42001. <div class="example">
  42002. <pre class="example-preformatted">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  42003. </pre></div>
  42004. </li><li>Draw a single green letter &quot;g&quot;, at the center of the input video.
  42005. The glyph baseline is placed at half screen height.
  42006. <div class="example">
  42007. <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;
  42008. </pre></div>
  42009. </li><li>Show text for 1 second every 3 seconds:
  42010. <div class="example">
  42011. <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;
  42012. </pre></div>
  42013. </li><li>Use fontconfig to set the font. Note that the colons need to be escaped.
  42014. <div class="example">
  42015. <pre class="example-preformatted">drawtext='fontfile=Linux Libertine O-40\\:style=Semibold:text=FFmpeg'
  42016. </pre></div>
  42017. </li><li>Draw &quot;Test Text&quot; with font size dependent on height of the video.
  42018. <div class="example">
  42019. <pre class="example-preformatted">drawtext=&quot;text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)&quot;
  42020. </pre></div>
  42021. </li><li>Print the date of a real-time encoding (see documentation for the
  42022. <code class="code">strftime</code> C function):
  42023. <div class="example">
  42024. <pre class="example-preformatted">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  42025. </pre></div>
  42026. </li><li>Show text fading in and out (appearing/disappearing):
  42027. <div class="example">
  42028. <pre class="example-preformatted">#!/bin/sh
  42029. DS=1.0 # display start
  42030. DE=10.0 # display end
  42031. FID=1.5 # fade in duration
  42032. FOD=5 # fade out duration
  42033. 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;
  42034. </pre></div>
  42035. </li><li>Horizontally align multiple separate texts. Note that <samp class="option">max_glyph_a</samp>
  42036. and the <samp class="option">fontsize</samp> value are included in the <samp class="option">y</samp> offset.
  42037. <div class="example">
  42038. <pre class="example-preformatted">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  42039. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  42040. </pre></div>
  42041. </li><li>Plot special <var class="var">lavf.image2dec.source_basename</var> metadata onto each frame if
  42042. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  42043. must have option <samp class="option">-export_path_metadata 1</samp> for the special metadata fields
  42044. to be available for filters.
  42045. <div class="example">
  42046. <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;
  42047. </pre></div>
  42048. </li></ul>
  42049. <p>For more information about libfreetype, check:
  42050. <a class="url" href="http://www.freetype.org/">http://www.freetype.org/</a>.
  42051. </p>
  42052. <p>For more information about fontconfig, check:
  42053. <a class="url" href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  42054. </p>
  42055. <p>For more information about libfribidi, check:
  42056. <a class="url" href="http://fribidi.org/">http://fribidi.org/</a>.
  42057. </p>
  42058. <p>For more information about libharfbuzz, check:
  42059. <a class="url" href="https://github.com/harfbuzz/harfbuzz">https://github.com/harfbuzz/harfbuzz</a>.
  42060. </p>
  42061. </div>
  42062. </div>
  42063. <div class="section-level-extent" id="edgedetect">
  42064. <h3 class="section"><span>39.79 edgedetect<a class="copiable-link" href="#edgedetect"> &para;</a></span></h3>
  42065. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  42066. </p>
  42067. <p>The filter accepts the following options:
  42068. </p>
  42069. <dl class="table">
  42070. <dt><samp class="option">low</samp></dt>
  42071. <dt><samp class="option">high</samp></dt>
  42072. <dd><p>Set low and high threshold values used by the Canny thresholding
  42073. algorithm.
  42074. </p>
  42075. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  42076. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  42077. by the low threshold.
  42078. </p>
  42079. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  42080. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  42081. </p>
  42082. <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>
  42083. is <code class="code">50/255</code>.
  42084. </p>
  42085. </dd>
  42086. <dt><samp class="option">mode</samp></dt>
  42087. <dd><p>Define the drawing mode.
  42088. </p>
  42089. <dl class="table">
  42090. <dt>&lsquo;<samp class="samp">wires</samp>&rsquo;</dt>
  42091. <dd><p>Draw white/gray wires on black background.
  42092. </p>
  42093. </dd>
  42094. <dt>&lsquo;<samp class="samp">colormix</samp>&rsquo;</dt>
  42095. <dd><p>Mix the colors to create a paint/cartoon effect.
  42096. </p>
  42097. </dd>
  42098. <dt>&lsquo;<samp class="samp">canny</samp>&rsquo;</dt>
  42099. <dd><p>Apply Canny edge detector on all selected planes.
  42100. </p></dd>
  42101. </dl>
  42102. <p>Default value is <var class="var">wires</var>.
  42103. </p>
  42104. </dd>
  42105. <dt><samp class="option">planes</samp></dt>
  42106. <dd><p>Select planes for filtering. By default all available planes are filtered.
  42107. </p></dd>
  42108. </dl>
  42109. <ul class="mini-toc">
  42110. <li><a href="#Examples-114" accesskey="1">Examples</a></li>
  42111. </ul>
  42112. <div class="subsection-level-extent" id="Examples-114">
  42113. <h4 class="subsection"><span>39.79.1 Examples<a class="copiable-link" href="#Examples-114"> &para;</a></span></h4>
  42114. <ul class="itemize mark-bullet">
  42115. <li>Standard edge detection with custom values for the hysteresis thresholding:
  42116. <div class="example">
  42117. <pre class="example-preformatted">edgedetect=low=0.1:high=0.4
  42118. </pre></div>
  42119. </li><li>Painting effect without thresholding:
  42120. <div class="example">
  42121. <pre class="example-preformatted">edgedetect=mode=colormix:high=0
  42122. </pre></div>
  42123. </li></ul>
  42124. </div>
  42125. </div>
  42126. <div class="section-level-extent" id="elbg">
  42127. <h3 class="section"><span>39.80 elbg<a class="copiable-link" href="#elbg"> &para;</a></span></h3>
  42128. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  42129. </p>
  42130. <p>For each input image, the filter will compute the optimal mapping from
  42131. the input to the output given the codebook length, that is the number
  42132. of distinct output colors.
  42133. </p>
  42134. <p>This filter accepts the following options.
  42135. </p>
  42136. <dl class="table">
  42137. <dt><samp class="option">codebook_length, l</samp></dt>
  42138. <dd><p>Set codebook length. The value must be a positive integer, and
  42139. represents the number of distinct output colors. Default value is 256.
  42140. </p>
  42141. </dd>
  42142. <dt><samp class="option">nb_steps, n</samp></dt>
  42143. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  42144. mapping. The higher the value the better the result and the higher the
  42145. computation time. Default value is 1.
  42146. </p>
  42147. </dd>
  42148. <dt><samp class="option">seed, s</samp></dt>
  42149. <dd><p>Set a random seed, must be an integer included between 0 and
  42150. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  42151. will try to use a good random seed on a best effort basis.
  42152. </p>
  42153. </dd>
  42154. <dt><samp class="option">pal8</samp></dt>
  42155. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  42156. length greater than 256. Default is disabled.
  42157. </p>
  42158. </dd>
  42159. <dt><samp class="option">use_alpha</samp></dt>
  42160. <dd><p>Include alpha values in the quantization calculation. Allows creating
  42161. palettized output images (e.g. PNG8) with multiple alpha smooth blending.
  42162. </p></dd>
  42163. </dl>
  42164. </div>
  42165. <div class="section-level-extent" id="entropy">
  42166. <h3 class="section"><span>39.81 entropy<a class="copiable-link" href="#entropy"> &para;</a></span></h3>
  42167. <p>Measure graylevel entropy in histogram of color channels of video frames.
  42168. </p>
  42169. <p>It accepts the following parameters:
  42170. </p>
  42171. <dl class="table">
  42172. <dt><samp class="option">mode</samp></dt>
  42173. <dd><p>Can be either <var class="var">normal</var> or <var class="var">diff</var>. Default is <var class="var">normal</var>.
  42174. </p>
  42175. <p><var class="var">diff</var> mode measures entropy of histogram delta values, absolute differences
  42176. between neighbour histogram values.
  42177. </p></dd>
  42178. </dl>
  42179. </div>
  42180. <div class="section-level-extent" id="epx">
  42181. <h3 class="section"><span>39.82 epx<a class="copiable-link" href="#epx"> &para;</a></span></h3>
  42182. <p>Apply the EPX magnification filter which is designed for pixel art.
  42183. </p>
  42184. <p>It accepts the following option:
  42185. </p>
  42186. <dl class="table">
  42187. <dt><samp class="option">n</samp></dt>
  42188. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xEPX</code>, <code class="code">3</code> for
  42189. <code class="code">3xEPX</code>.
  42190. Default is <code class="code">3</code>.
  42191. </p></dd>
  42192. </dl>
  42193. </div>
  42194. <div class="section-level-extent" id="eq">
  42195. <h3 class="section"><span>39.83 eq<a class="copiable-link" href="#eq"> &para;</a></span></h3>
  42196. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  42197. </p>
  42198. <p>The filter accepts the following options:
  42199. </p>
  42200. <dl class="table">
  42201. <dt><samp class="option">contrast</samp></dt>
  42202. <dd><p>Set the contrast expression. The value must be a float value in range
  42203. <code class="code">-1000.0</code> to <code class="code">1000.0</code>. The default value is &quot;1&quot;.
  42204. </p>
  42205. </dd>
  42206. <dt><samp class="option">brightness</samp></dt>
  42207. <dd><p>Set the brightness expression. The value must be a float value in
  42208. range <code class="code">-1.0</code> to <code class="code">1.0</code>. The default value is &quot;0&quot;.
  42209. </p>
  42210. </dd>
  42211. <dt><samp class="option">saturation</samp></dt>
  42212. <dd><p>Set the saturation expression. The value must be a float in
  42213. range <code class="code">0.0</code> to <code class="code">3.0</code>. The default value is &quot;1&quot;.
  42214. </p>
  42215. </dd>
  42216. <dt><samp class="option">gamma</samp></dt>
  42217. <dd><p>Set the gamma expression. The value must be a float in range
  42218. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  42219. </p>
  42220. </dd>
  42221. <dt><samp class="option">gamma_r</samp></dt>
  42222. <dd><p>Set the gamma expression for red. The value must be a float in
  42223. range <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  42224. </p>
  42225. </dd>
  42226. <dt><samp class="option">gamma_g</samp></dt>
  42227. <dd><p>Set the gamma expression for green. The value must be a float in range
  42228. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  42229. </p>
  42230. </dd>
  42231. <dt><samp class="option">gamma_b</samp></dt>
  42232. <dd><p>Set the gamma expression for blue. The value must be a float in range
  42233. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  42234. </p>
  42235. </dd>
  42236. <dt><samp class="option">gamma_weight</samp></dt>
  42237. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  42238. of a high gamma value on bright image areas, e.g. keep them from
  42239. getting overamplified and just plain white. The value must be a float
  42240. 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
  42241. gamma correction all the way down while <code class="code">1.0</code> leaves it at its
  42242. full strength. Default is &quot;1&quot;.
  42243. </p>
  42244. </dd>
  42245. <dt><samp class="option">eval</samp></dt>
  42246. <dd><p>Set when the expressions for brightness, contrast, saturation and
  42247. gamma expressions are evaluated.
  42248. </p>
  42249. <p>It accepts the following values:
  42250. </p><dl class="table">
  42251. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  42252. <dd><p>only evaluate expressions once during the filter initialization or
  42253. when a command is processed
  42254. </p>
  42255. </dd>
  42256. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  42257. <dd><p>evaluate expressions for each incoming frame
  42258. </p></dd>
  42259. </dl>
  42260. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  42261. </p></dd>
  42262. </dl>
  42263. <p>The expressions accept the following parameters:
  42264. </p><dl class="table">
  42265. <dt><samp class="option">n</samp></dt>
  42266. <dd><p>frame count of the input frame starting from 0
  42267. </p>
  42268. </dd>
  42269. <dt><samp class="option">pos</samp></dt>
  42270. <dd><p>byte position of the corresponding packet in the input file, NAN if
  42271. unspecified; deprecated, do not use
  42272. </p>
  42273. </dd>
  42274. <dt><samp class="option">r</samp></dt>
  42275. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  42276. </p>
  42277. </dd>
  42278. <dt><samp class="option">t</samp></dt>
  42279. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  42280. </p></dd>
  42281. </dl>
  42282. <ul class="mini-toc">
  42283. <li><a href="#Commands-89" accesskey="1">Commands</a></li>
  42284. </ul>
  42285. <div class="subsection-level-extent" id="Commands-89">
  42286. <h4 class="subsection"><span>39.83.1 Commands<a class="copiable-link" href="#Commands-89"> &para;</a></span></h4>
  42287. <p>The filter supports the following commands:
  42288. </p>
  42289. <dl class="table">
  42290. <dt><samp class="option">contrast</samp></dt>
  42291. <dd><p>Set the contrast expression.
  42292. </p>
  42293. </dd>
  42294. <dt><samp class="option">brightness</samp></dt>
  42295. <dd><p>Set the brightness expression.
  42296. </p>
  42297. </dd>
  42298. <dt><samp class="option">saturation</samp></dt>
  42299. <dd><p>Set the saturation expression.
  42300. </p>
  42301. </dd>
  42302. <dt><samp class="option">gamma</samp></dt>
  42303. <dd><p>Set the gamma expression.
  42304. </p>
  42305. </dd>
  42306. <dt><samp class="option">gamma_r</samp></dt>
  42307. <dd><p>Set the gamma_r expression.
  42308. </p>
  42309. </dd>
  42310. <dt><samp class="option">gamma_g</samp></dt>
  42311. <dd><p>Set gamma_g expression.
  42312. </p>
  42313. </dd>
  42314. <dt><samp class="option">gamma_b</samp></dt>
  42315. <dd><p>Set gamma_b expression.
  42316. </p>
  42317. </dd>
  42318. <dt><samp class="option">gamma_weight</samp></dt>
  42319. <dd><p>Set gamma_weight expression.
  42320. </p>
  42321. <p>The command accepts the same syntax of the corresponding option.
  42322. </p>
  42323. <p>If the specified expression is not valid, it is kept at its current
  42324. value.
  42325. </p>
  42326. </dd>
  42327. </dl>
  42328. <a class="anchor" id="erosion"></a></div>
  42329. </div>
  42330. <div class="section-level-extent" id="erosion-1">
  42331. <h3 class="section"><span>39.84 erosion<a class="copiable-link" href="#erosion-1"> &para;</a></span></h3>
  42332. <p>Apply erosion effect to the video.
  42333. </p>
  42334. <p>This filter replaces the pixel by the local(3x3) minimum.
  42335. </p>
  42336. <p>It accepts the following options:
  42337. </p>
  42338. <dl class="table">
  42339. <dt><samp class="option">threshold0</samp></dt>
  42340. <dt><samp class="option">threshold1</samp></dt>
  42341. <dt><samp class="option">threshold2</samp></dt>
  42342. <dt><samp class="option">threshold3</samp></dt>
  42343. <dd><p>Limit the maximum change for each plane, default is 65535.
  42344. If 0, plane will remain unchanged.
  42345. </p>
  42346. </dd>
  42347. <dt><samp class="option">coordinates</samp></dt>
  42348. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  42349. pixels are used.
  42350. </p>
  42351. <p>Flags to local 3x3 coordinates maps like this:
  42352. </p>
  42353. <p>1 2 3
  42354. 4 5
  42355. 6 7 8
  42356. </p></dd>
  42357. </dl>
  42358. <ul class="mini-toc">
  42359. <li><a href="#Commands-90" accesskey="1">Commands</a></li>
  42360. </ul>
  42361. <div class="subsection-level-extent" id="Commands-90">
  42362. <h4 class="subsection"><span>39.84.1 Commands<a class="copiable-link" href="#Commands-90"> &para;</a></span></h4>
  42363. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  42364. </p>
  42365. </div>
  42366. </div>
  42367. <div class="section-level-extent" id="estdif">
  42368. <h3 class="section"><span>39.85 estdif<a class="copiable-link" href="#estdif"> &para;</a></span></h3>
  42369. <p>Deinterlace the input video (&quot;estdif&quot; stands for &quot;Edge Slope
  42370. Tracing Deinterlacing Filter&quot;).
  42371. </p>
  42372. <p>Spatial only filter that uses edge slope tracing algorithm
  42373. to interpolate missing lines.
  42374. It accepts the following parameters:
  42375. </p>
  42376. <dl class="table">
  42377. <dt><samp class="option">mode</samp></dt>
  42378. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  42379. </p>
  42380. <dl class="table">
  42381. <dt><samp class="option">frame</samp></dt>
  42382. <dd><p>Output one frame for each frame.
  42383. </p></dd>
  42384. <dt><samp class="option">field</samp></dt>
  42385. <dd><p>Output one frame for each field.
  42386. </p></dd>
  42387. </dl>
  42388. <p>The default value is <code class="code">field</code>.
  42389. </p>
  42390. </dd>
  42391. <dt><samp class="option">parity</samp></dt>
  42392. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  42393. of the following values:
  42394. </p>
  42395. <dl class="table">
  42396. <dt><samp class="option">tff</samp></dt>
  42397. <dd><p>Assume the top field is first.
  42398. </p></dd>
  42399. <dt><samp class="option">bff</samp></dt>
  42400. <dd><p>Assume the bottom field is first.
  42401. </p></dd>
  42402. <dt><samp class="option">auto</samp></dt>
  42403. <dd><p>Enable automatic detection of field parity.
  42404. </p></dd>
  42405. </dl>
  42406. <p>The default value is <code class="code">auto</code>.
  42407. If the interlacing is unknown or the decoder does not export this information,
  42408. top field first will be assumed.
  42409. </p>
  42410. </dd>
  42411. <dt><samp class="option">deint</samp></dt>
  42412. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  42413. values:
  42414. </p>
  42415. <dl class="table">
  42416. <dt><samp class="option">all</samp></dt>
  42417. <dd><p>Deinterlace all frames.
  42418. </p></dd>
  42419. <dt><samp class="option">interlaced</samp></dt>
  42420. <dd><p>Only deinterlace frames marked as interlaced.
  42421. </p></dd>
  42422. </dl>
  42423. <p>The default value is <code class="code">all</code>.
  42424. </p>
  42425. </dd>
  42426. <dt><samp class="option">rslope</samp></dt>
  42427. <dd><p>Specify the search radius for edge slope tracing. Default value is 1.
  42428. Allowed range is from 1 to 15.
  42429. </p>
  42430. </dd>
  42431. <dt><samp class="option">redge</samp></dt>
  42432. <dd><p>Specify the search radius for best edge matching. Default value is 2.
  42433. Allowed range is from 0 to 15.
  42434. </p>
  42435. </dd>
  42436. <dt><samp class="option">ecost</samp></dt>
  42437. <dd><p>Specify the edge cost for edge matching. Default value is 2.
  42438. Allowed range is from 0 to 50.
  42439. </p>
  42440. </dd>
  42441. <dt><samp class="option">mcost</samp></dt>
  42442. <dd><p>Specify the middle cost for edge matching. Default value is 1.
  42443. Allowed range is from 0 to 50.
  42444. </p>
  42445. </dd>
  42446. <dt><samp class="option">dcost</samp></dt>
  42447. <dd><p>Specify the distance cost for edge matching. Default value is 1.
  42448. Allowed range is from 0 to 50.
  42449. </p>
  42450. </dd>
  42451. <dt><samp class="option">interp</samp></dt>
  42452. <dd><p>Specify the interpolation used. Default is 4-point interpolation. It accepts one
  42453. of the following values:
  42454. </p>
  42455. <dl class="table">
  42456. <dt><samp class="option">2p</samp></dt>
  42457. <dd><p>Two-point interpolation.
  42458. </p></dd>
  42459. <dt><samp class="option">4p</samp></dt>
  42460. <dd><p>Four-point interpolation.
  42461. </p></dd>
  42462. <dt><samp class="option">6p</samp></dt>
  42463. <dd><p>Six-point interpolation.
  42464. </p></dd>
  42465. </dl>
  42466. </dd>
  42467. </dl>
  42468. <ul class="mini-toc">
  42469. <li><a href="#Commands-91" accesskey="1">Commands</a></li>
  42470. </ul>
  42471. <div class="subsection-level-extent" id="Commands-91">
  42472. <h4 class="subsection"><span>39.85.1 Commands<a class="copiable-link" href="#Commands-91"> &para;</a></span></h4>
  42473. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  42474. </p>
  42475. </div>
  42476. </div>
  42477. <div class="section-level-extent" id="exposure">
  42478. <h3 class="section"><span>39.86 exposure<a class="copiable-link" href="#exposure"> &para;</a></span></h3>
  42479. <p>Adjust exposure of the video stream.
  42480. </p>
  42481. <p>The filter accepts the following options:
  42482. </p>
  42483. <dl class="table">
  42484. <dt><samp class="option">exposure</samp></dt>
  42485. <dd><p>Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV
  42486. Default value is 0 EV.
  42487. </p>
  42488. </dd>
  42489. <dt><samp class="option">black</samp></dt>
  42490. <dd><p>Set the black level correction. Allowed range is from -1.0 to 1.0.
  42491. Default value is 0.
  42492. </p></dd>
  42493. </dl>
  42494. <ul class="mini-toc">
  42495. <li><a href="#Commands-92" accesskey="1">Commands</a></li>
  42496. </ul>
  42497. <div class="subsection-level-extent" id="Commands-92">
  42498. <h4 class="subsection"><span>39.86.1 Commands<a class="copiable-link" href="#Commands-92"> &para;</a></span></h4>
  42499. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  42500. </p>
  42501. </div>
  42502. </div>
  42503. <div class="section-level-extent" id="extractplanes">
  42504. <h3 class="section"><span>39.87 extractplanes<a class="copiable-link" href="#extractplanes"> &para;</a></span></h3>
  42505. <p>Extract color channel components from input video stream into
  42506. separate grayscale video streams.
  42507. </p>
  42508. <p>The filter accepts the following option:
  42509. </p>
  42510. <dl class="table">
  42511. <dt><samp class="option">planes</samp></dt>
  42512. <dd><p>Set plane(s) to extract.
  42513. </p>
  42514. <p>Available values for planes are:
  42515. </p><dl class="table">
  42516. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  42517. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  42518. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  42519. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  42520. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  42521. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  42522. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  42523. </dl>
  42524. <p>Choosing planes not available in the input will result in an error.
  42525. That means you cannot select <code class="code">r</code>, <code class="code">g</code>, <code class="code">b</code> planes
  42526. with <code class="code">y</code>, <code class="code">u</code>, <code class="code">v</code> planes at same time.
  42527. </p></dd>
  42528. </dl>
  42529. <ul class="mini-toc">
  42530. <li><a href="#Examples-115" accesskey="1">Examples</a></li>
  42531. </ul>
  42532. <div class="subsection-level-extent" id="Examples-115">
  42533. <h4 class="subsection"><span>39.87.1 Examples<a class="copiable-link" href="#Examples-115"> &para;</a></span></h4>
  42534. <ul class="itemize mark-bullet">
  42535. <li>Extract luma, u and v color channel component from input video frame
  42536. into 3 grayscale outputs:
  42537. <div class="example">
  42538. <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
  42539. </pre></div>
  42540. </li></ul>
  42541. </div>
  42542. </div>
  42543. <div class="section-level-extent" id="fade">
  42544. <h3 class="section"><span>39.88 fade<a class="copiable-link" href="#fade"> &para;</a></span></h3>
  42545. <p>Apply a fade-in/out effect to the input video.
  42546. </p>
  42547. <p>It accepts the following parameters:
  42548. </p>
  42549. <dl class="table">
  42550. <dt><samp class="option">type, t</samp></dt>
  42551. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  42552. effect.
  42553. Default is <code class="code">in</code>.
  42554. </p>
  42555. </dd>
  42556. <dt><samp class="option">start_frame, s</samp></dt>
  42557. <dd><p>Specify the number of the frame to start applying the fade
  42558. effect at. Default is 0.
  42559. </p>
  42560. </dd>
  42561. <dt><samp class="option">nb_frames, n</samp></dt>
  42562. <dd><p>The number of frames that the fade effect lasts. At the end of the
  42563. fade-in effect, the output video will have the same intensity as the input video.
  42564. At the end of the fade-out transition, the output video will be filled with the
  42565. selected <samp class="option">color</samp>.
  42566. Default is 25.
  42567. </p>
  42568. </dd>
  42569. <dt><samp class="option">alpha</samp></dt>
  42570. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  42571. Default value is 0.
  42572. </p>
  42573. </dd>
  42574. <dt><samp class="option">start_time, st</samp></dt>
  42575. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  42576. effect. If both start_frame and start_time are specified, the fade will start at
  42577. whichever comes last. Default is 0.
  42578. </p>
  42579. </dd>
  42580. <dt><samp class="option">duration, d</samp></dt>
  42581. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  42582. fade-in effect the output video will have the same intensity as the input video,
  42583. at the end of the fade-out transition the output video will be filled with the
  42584. selected <samp class="option">color</samp>.
  42585. If both duration and nb_frames are specified, duration is used. Default is 0
  42586. (nb_frames is used by default).
  42587. </p>
  42588. </dd>
  42589. <dt><samp class="option">color, c</samp></dt>
  42590. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  42591. </p></dd>
  42592. </dl>
  42593. <ul class="mini-toc">
  42594. <li><a href="#Examples-116" accesskey="1">Examples</a></li>
  42595. </ul>
  42596. <div class="subsection-level-extent" id="Examples-116">
  42597. <h4 class="subsection"><span>39.88.1 Examples<a class="copiable-link" href="#Examples-116"> &para;</a></span></h4>
  42598. <ul class="itemize mark-bullet">
  42599. <li>Fade in the first 30 frames of video:
  42600. <div class="example">
  42601. <pre class="example-preformatted">fade=in:0:30
  42602. </pre></div>
  42603. <p>The command above is equivalent to:
  42604. </p><div class="example">
  42605. <pre class="example-preformatted">fade=t=in:s=0:n=30
  42606. </pre></div>
  42607. </li><li>Fade out the last 45 frames of a 200-frame video:
  42608. <div class="example">
  42609. <pre class="example-preformatted">fade=out:155:45
  42610. fade=type=out:start_frame=155:nb_frames=45
  42611. </pre></div>
  42612. </li><li>Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  42613. <div class="example">
  42614. <pre class="example-preformatted">fade=in:0:25, fade=out:975:25
  42615. </pre></div>
  42616. </li><li>Make the first 5 frames yellow, then fade in from frame 5-24:
  42617. <div class="example">
  42618. <pre class="example-preformatted">fade=in:5:20:color=yellow
  42619. </pre></div>
  42620. </li><li>Fade in alpha over first 25 frames of video:
  42621. <div class="example">
  42622. <pre class="example-preformatted">fade=in:0:25:alpha=1
  42623. </pre></div>
  42624. </li><li>Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  42625. <div class="example">
  42626. <pre class="example-preformatted">fade=t=in:st=5.5:d=0.5
  42627. </pre></div>
  42628. </li></ul>
  42629. </div>
  42630. </div>
  42631. <div class="section-level-extent" id="feedback">
  42632. <h3 class="section"><span>39.89 feedback<a class="copiable-link" href="#feedback"> &para;</a></span></h3>
  42633. <p>Apply feedback video filter.
  42634. </p>
  42635. <p>This filter pass cropped input frames to 2nd output.
  42636. From there it can be filtered with other video filters.
  42637. After filter receives frame from 2nd input, that frame
  42638. is combined on top of original frame from 1st input and passed
  42639. to 1st output.
  42640. </p>
  42641. <p>The typical usage is filter only part of frame.
  42642. </p>
  42643. <p>The filter accepts the following options:
  42644. </p><dl class="table">
  42645. <dt><samp class="option">x</samp></dt>
  42646. <dt><samp class="option">y</samp></dt>
  42647. <dd><p>Set the top left crop position.
  42648. </p>
  42649. </dd>
  42650. <dt><samp class="option">w</samp></dt>
  42651. <dt><samp class="option">h</samp></dt>
  42652. <dd><p>Set the crop size.
  42653. </p></dd>
  42654. </dl>
  42655. <ul class="mini-toc">
  42656. <li><a href="#Examples-117" accesskey="1">Examples</a></li>
  42657. </ul>
  42658. <div class="subsection-level-extent" id="Examples-117">
  42659. <h4 class="subsection"><span>39.89.1 Examples<a class="copiable-link" href="#Examples-117"> &para;</a></span></h4>
  42660. <ul class="itemize mark-bullet">
  42661. <li>Blur only top left rectangular part of video frame size 100x100 with gblur filter.
  42662. <div class="example">
  42663. <pre class="example-preformatted">[in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
  42664. </pre></div>
  42665. </li><li>Draw black box on top left part of video frame of size 100x100 with drawbox filter.
  42666. <div class="example">
  42667. <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]
  42668. </pre></div>
  42669. </li><li>Pixelize rectangular part of video frame of size 100x100 with pixelize filter.
  42670. <div class="example">
  42671. <pre class="example-preformatted">[in][blurin]feedback=x=320:y=240:w=100:h=100[out][blurout];[blurout]pixelize[blurin]
  42672. </pre></div>
  42673. </li></ul>
  42674. </div>
  42675. </div>
  42676. <div class="section-level-extent" id="fftdnoiz">
  42677. <h3 class="section"><span>39.90 fftdnoiz<a class="copiable-link" href="#fftdnoiz"> &para;</a></span></h3>
  42678. <p>Denoise frames using 3D FFT (frequency domain filtering).
  42679. </p>
  42680. <p>The filter accepts the following options:
  42681. </p>
  42682. <dl class="table">
  42683. <dt><samp class="option">sigma</samp></dt>
  42684. <dd><p>Set the noise sigma constant. This sets denoising strength.
  42685. Default value is 1. Allowed range is from 0 to 30.
  42686. Using very high sigma with low overlap may give blocking artifacts.
  42687. </p>
  42688. </dd>
  42689. <dt><samp class="option">amount</samp></dt>
  42690. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  42691. Default value is 1. Allowed range is from 0 to 1.
  42692. </p>
  42693. </dd>
  42694. <dt><samp class="option">block</samp></dt>
  42695. <dd><p>Set size of block in pixels, Default is 32, can be 8 to 256.
  42696. </p>
  42697. </dd>
  42698. <dt><samp class="option">overlap</samp></dt>
  42699. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  42700. </p>
  42701. </dd>
  42702. <dt><samp class="option">method</samp></dt>
  42703. <dd><p>Set denoising method. Default is <code class="code">wiener</code>, can also be <code class="code">hard</code>.
  42704. </p>
  42705. </dd>
  42706. <dt><samp class="option">prev</samp></dt>
  42707. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  42708. </p>
  42709. </dd>
  42710. <dt><samp class="option">next</samp></dt>
  42711. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  42712. </p>
  42713. </dd>
  42714. <dt><samp class="option">planes</samp></dt>
  42715. <dd><p>Set planes which will be filtered, by default are all available filtered
  42716. except alpha.
  42717. </p></dd>
  42718. </dl>
  42719. </div>
  42720. <div class="section-level-extent" id="fftfilt">
  42721. <h3 class="section"><span>39.91 fftfilt<a class="copiable-link" href="#fftfilt"> &para;</a></span></h3>
  42722. <p>Apply arbitrary expressions to samples in frequency domain
  42723. </p>
  42724. <dl class="table">
  42725. <dt><samp class="option">dc_Y</samp></dt>
  42726. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  42727. accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The default
  42728. value is set to <code class="code">0</code>.
  42729. </p>
  42730. </dd>
  42731. <dt><samp class="option">dc_U</samp></dt>
  42732. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  42733. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  42734. default value is set to <code class="code">0</code>.
  42735. </p>
  42736. </dd>
  42737. <dt><samp class="option">dc_V</samp></dt>
  42738. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  42739. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  42740. default value is set to <code class="code">0</code>.
  42741. </p>
  42742. </dd>
  42743. <dt><samp class="option">weight_Y</samp></dt>
  42744. <dd><p>Set the frequency domain weight expression for the luma plane.
  42745. </p>
  42746. </dd>
  42747. <dt><samp class="option">weight_U</samp></dt>
  42748. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  42749. </p>
  42750. </dd>
  42751. <dt><samp class="option">weight_V</samp></dt>
  42752. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  42753. </p>
  42754. </dd>
  42755. <dt><samp class="option">eval</samp></dt>
  42756. <dd><p>Set when the expressions are evaluated.
  42757. </p>
  42758. <p>It accepts the following values:
  42759. </p><dl class="table">
  42760. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  42761. <dd><p>Only evaluate expressions once during the filter initialization.
  42762. </p>
  42763. </dd>
  42764. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  42765. <dd><p>Evaluate expressions for each incoming frame.
  42766. </p></dd>
  42767. </dl>
  42768. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  42769. </p>
  42770. <p>The filter accepts the following variables:
  42771. </p></dd>
  42772. <dt><samp class="option">X</samp></dt>
  42773. <dt><samp class="option">Y</samp></dt>
  42774. <dd><p>The coordinates of the current sample.
  42775. </p>
  42776. </dd>
  42777. <dt><samp class="option">W</samp></dt>
  42778. <dt><samp class="option">H</samp></dt>
  42779. <dd><p>The width and height of the image.
  42780. </p>
  42781. </dd>
  42782. <dt><samp class="option">N</samp></dt>
  42783. <dd><p>The number of input frame, starting from 0.
  42784. </p>
  42785. </dd>
  42786. <dt><samp class="option">WS</samp></dt>
  42787. <dt><samp class="option">HS</samp></dt>
  42788. <dd><p>The size of FFT array for horizontal and vertical processing.
  42789. </p></dd>
  42790. </dl>
  42791. <ul class="mini-toc">
  42792. <li><a href="#Examples-118" accesskey="1">Examples</a></li>
  42793. </ul>
  42794. <div class="subsection-level-extent" id="Examples-118">
  42795. <h4 class="subsection"><span>39.91.1 Examples<a class="copiable-link" href="#Examples-118"> &para;</a></span></h4>
  42796. <ul class="itemize mark-bullet">
  42797. <li>High-pass:
  42798. <div class="example">
  42799. <pre class="example-preformatted">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  42800. </pre></div>
  42801. </li><li>Low-pass:
  42802. <div class="example">
  42803. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  42804. </pre></div>
  42805. </li><li>Sharpen:
  42806. <div class="example">
  42807. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  42808. </pre></div>
  42809. </li><li>Blur:
  42810. <div class="example">
  42811. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  42812. </pre></div>
  42813. </li></ul>
  42814. </div>
  42815. </div>
  42816. <div class="section-level-extent" id="field">
  42817. <h3 class="section"><span>39.92 field<a class="copiable-link" href="#field"> &para;</a></span></h3>
  42818. <p>Extract a single field from an interlaced image using stride
  42819. arithmetic to avoid wasting CPU time. The output frames are marked as
  42820. non-interlaced.
  42821. </p>
  42822. <p>The filter accepts the following options:
  42823. </p>
  42824. <dl class="table">
  42825. <dt><samp class="option">type</samp></dt>
  42826. <dd><p>Specify whether to extract the top (if the value is <code class="code">0</code> or
  42827. <code class="code">top</code>) or the bottom field (if the value is <code class="code">1</code> or
  42828. <code class="code">bottom</code>).
  42829. </p></dd>
  42830. </dl>
  42831. </div>
  42832. <div class="section-level-extent" id="fieldhint">
  42833. <h3 class="section"><span>39.93 fieldhint<a class="copiable-link" href="#fieldhint"> &para;</a></span></h3>
  42834. <p>Create new frames by copying the top and bottom fields from surrounding frames
  42835. supplied as numbers by the hint file.
  42836. </p>
  42837. <dl class="table">
  42838. <dt><samp class="option">hint</samp></dt>
  42839. <dd><p>Set file containing hints: absolute/relative frame numbers.
  42840. </p>
  42841. <p>There must be one line for each frame in a clip. Each line must contain two
  42842. numbers separated by the comma, optionally followed by <code class="code">-</code> or <code class="code">+</code>.
  42843. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  42844. is current frame number for <code class="code">absolute</code> mode or out of [-1, 1] range
  42845. for <code class="code">relative</code> mode. First number tells from which frame to pick up top
  42846. field and second number tells from which frame to pick up bottom field.
  42847. </p>
  42848. <p>If optionally followed by <code class="code">+</code> output frame will be marked as interlaced,
  42849. else if followed by <code class="code">-</code> output frame will be marked as progressive, else
  42850. it will be marked same as input frame.
  42851. If optionally followed by <code class="code">t</code> output frame will use only top field, or in
  42852. case of <code class="code">b</code> it will use only bottom field.
  42853. If line starts with <code class="code">#</code> or <code class="code">;</code> that line is skipped.
  42854. </p>
  42855. </dd>
  42856. <dt><samp class="option">mode</samp></dt>
  42857. <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>.
  42858. The <code class="code">pattern</code> mode is same as <code class="code">relative</code> mode, except at last entry of file if there
  42859. are more frames to process than <code class="code">hint</code> file is seek back to start.
  42860. </p></dd>
  42861. </dl>
  42862. <p>Example of first several lines of <code class="code">hint</code> file for <code class="code">relative</code> mode:
  42863. </p><div class="example">
  42864. <pre class="example-preformatted">0,0 - # first frame
  42865. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  42866. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  42867. 1,0 -
  42868. 0,0 -
  42869. 0,0 -
  42870. 1,0 -
  42871. 1,0 -
  42872. 1,0 -
  42873. 0,0 -
  42874. 0,0 -
  42875. 1,0 -
  42876. 1,0 -
  42877. 1,0 -
  42878. 0,0 -
  42879. </pre></div>
  42880. </div>
  42881. <div class="section-level-extent" id="fieldmatch">
  42882. <h3 class="section"><span>39.94 fieldmatch<a class="copiable-link" href="#fieldmatch"> &para;</a></span></h3>
  42883. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  42884. progressive frames from a telecined stream. The filter does not drop duplicated
  42885. frames, so to achieve a complete inverse telecine <code class="code">fieldmatch</code> needs to be
  42886. followed by a decimation filter such as <a class="ref" href="#decimate">decimate</a> in the filtergraph.
  42887. </p>
  42888. <p>The separation of the field matching and the decimation is notably motivated by
  42889. the possibility of inserting a de-interlacing filter fallback between the two.
  42890. If the source has mixed telecined and real interlaced content,
  42891. <code class="code">fieldmatch</code> will not be able to match fields for the interlaced parts.
  42892. But these remaining combed frames will be marked as interlaced, and thus can be
  42893. de-interlaced by a later filter such as <a class="ref" href="#yadif">yadif</a> before decimation.
  42894. </p>
  42895. <p>In addition to the various configuration options, <code class="code">fieldmatch</code> can take an
  42896. optional second stream, activated through the <samp class="option">ppsrc</samp> option. If
  42897. enabled, the frames reconstruction will be based on the fields and frames from
  42898. this second stream. This allows the first input to be pre-processed in order to
  42899. help the various algorithms of the filter, while keeping the output lossless
  42900. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  42901. or brightness/contrast adjustments can help.
  42902. </p>
  42903. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  42904. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  42905. which <code class="code">fieldmatch</code> is based on. While the semantic and usage are very
  42906. close, some behaviour and options names can differ.
  42907. </p>
  42908. <p>The <a class="ref" href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  42909. If your input has mixed telecined (30fps) and progressive content with a lower
  42910. framerate like 24fps use the following filterchain to produce the necessary cfr
  42911. stream: <code class="code">dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  42912. </p>
  42913. <p>The filter accepts the following options:
  42914. </p>
  42915. <dl class="table">
  42916. <dt><samp class="option">order</samp></dt>
  42917. <dd><p>Specify the assumed field order of the input stream. Available values are:
  42918. </p>
  42919. <dl class="table">
  42920. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  42921. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  42922. </p></dd>
  42923. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  42924. <dd><p>Assume bottom field first.
  42925. </p></dd>
  42926. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  42927. <dd><p>Assume top field first.
  42928. </p></dd>
  42929. </dl>
  42930. <p>Note that it is sometimes recommended not to trust the parity announced by the
  42931. stream.
  42932. </p>
  42933. <p>Default value is <var class="var">auto</var>.
  42934. </p>
  42935. </dd>
  42936. <dt><samp class="option">mode</samp></dt>
  42937. <dd><p>Set the matching mode or strategy to use. <samp class="option">pc</samp> mode is the safest in the
  42938. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  42939. possible, but if there are bad edits or blended fields it will end up
  42940. outputting combed frames when a good match might actually exist. On the other
  42941. hand, <samp class="option">pcn_ub</samp> mode is the most risky in terms of creating jerkiness,
  42942. but will almost always find a good frame if there is one. The other values are
  42943. all somewhere in between <samp class="option">pc</samp> and <samp class="option">pcn_ub</samp> in terms of risking
  42944. jerkiness and creating duplicate frames versus finding good matches in sections
  42945. with bad edits, orphaned fields, blended fields, etc.
  42946. </p>
  42947. <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.
  42948. </p>
  42949. <p>Available values are:
  42950. </p>
  42951. <dl class="table">
  42952. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  42953. <dd><p>2-way matching (p/c)
  42954. </p></dd>
  42955. <dt>&lsquo;<samp class="samp">pc_n</samp>&rsquo;</dt>
  42956. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  42957. </p></dd>
  42958. <dt>&lsquo;<samp class="samp">pc_u</samp>&rsquo;</dt>
  42959. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  42960. </p></dd>
  42961. <dt>&lsquo;<samp class="samp">pc_n_ub</samp>&rsquo;</dt>
  42962. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  42963. still combed (p/c + n + u/b)
  42964. </p></dd>
  42965. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  42966. <dd><p>3-way matching (p/c/n)
  42967. </p></dd>
  42968. <dt>&lsquo;<samp class="samp">pcn_ub</samp>&rsquo;</dt>
  42969. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  42970. detected as combed (p/c/n + u/b)
  42971. </p></dd>
  42972. </dl>
  42973. <p>The parenthesis at the end indicate the matches that would be used for that
  42974. 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
  42975. <var class="var">top</var>).
  42976. </p>
  42977. <p>In terms of speed <samp class="option">pc</samp> mode is by far the fastest and <samp class="option">pcn_ub</samp> is
  42978. the slowest.
  42979. </p>
  42980. <p>Default value is <var class="var">pc_n</var>.
  42981. </p>
  42982. </dd>
  42983. <dt><samp class="option">ppsrc</samp></dt>
  42984. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  42985. input stream as the clean source to pick the fields from. See the filter
  42986. introduction for more details. It is similar to the <samp class="option">clip2</samp> feature from
  42987. VFM/TFM.
  42988. </p>
  42989. <p>Default value is <code class="code">0</code> (disabled).
  42990. </p>
  42991. </dd>
  42992. <dt><samp class="option">field</samp></dt>
  42993. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  42994. <samp class="option">order</samp> unless you experience matching failures with that setting. In
  42995. certain circumstances changing the field that is used to match from can have a
  42996. large impact on matching performance. Available values are:
  42997. </p>
  42998. <dl class="table">
  42999. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  43000. <dd><p>Automatic (same value as <samp class="option">order</samp>).
  43001. </p></dd>
  43002. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  43003. <dd><p>Match from the bottom field.
  43004. </p></dd>
  43005. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  43006. <dd><p>Match from the top field.
  43007. </p></dd>
  43008. </dl>
  43009. <p>Default value is <var class="var">auto</var>.
  43010. </p>
  43011. </dd>
  43012. <dt><samp class="option">mchroma</samp></dt>
  43013. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  43014. cases it is recommended to leave this enabled. You should set this to <code class="code">0</code>
  43015. only if your clip has bad chroma problems such as heavy rainbowing or other
  43016. artifacts. Setting this to <code class="code">0</code> could also be used to speed things up at
  43017. the cost of some accuracy.
  43018. </p>
  43019. <p>Default value is <code class="code">1</code>.
  43020. </p>
  43021. </dd>
  43022. <dt><samp class="option">y0</samp></dt>
  43023. <dt><samp class="option">y1</samp></dt>
  43024. <dd><p>These define an exclusion band which excludes the lines between <samp class="option">y0</samp> and
  43025. <samp class="option">y1</samp> from being included in the field matching decision. An exclusion
  43026. band can be used to ignore subtitles, a logo, or other things that may
  43027. interfere with the matching. <samp class="option">y0</samp> sets the starting scan line and
  43028. <samp class="option">y1</samp> sets the ending line; all lines in between <samp class="option">y0</samp> and
  43029. <samp class="option">y1</samp> (including <samp class="option">y0</samp> and <samp class="option">y1</samp>) will be ignored. Setting
  43030. <samp class="option">y0</samp> and <samp class="option">y1</samp> to the same value will disable the feature.
  43031. <samp class="option">y0</samp> and <samp class="option">y1</samp> defaults to <code class="code">0</code>.
  43032. </p>
  43033. </dd>
  43034. <dt><samp class="option">scthresh</samp></dt>
  43035. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  43036. the luma plane. Good values are in the <code class="code">[8.0, 14.0]</code> range. Scene change
  43037. detection is only relevant in case <samp class="option">combmatch</samp>=<var class="var">sc</var>. The range for
  43038. <samp class="option">scthresh</samp> is <code class="code">[0.0, 100.0]</code>.
  43039. </p>
  43040. <p>Default value is <code class="code">12.0</code>.
  43041. </p>
  43042. </dd>
  43043. <dt><samp class="option">combmatch</samp></dt>
  43044. <dd><p>When <samp class="option">combatch</samp> is not <var class="var">none</var>, <code class="code">fieldmatch</code> will take into
  43045. account the combed scores of matches when deciding what match to use as the
  43046. final match. Available values are:
  43047. </p>
  43048. <dl class="table">
  43049. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  43050. <dd><p>No final matching based on combed scores.
  43051. </p></dd>
  43052. <dt>&lsquo;<samp class="samp">sc</samp>&rsquo;</dt>
  43053. <dd><p>Combed scores are only used when a scene change is detected.
  43054. </p></dd>
  43055. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  43056. <dd><p>Use combed scores all the time.
  43057. </p></dd>
  43058. </dl>
  43059. <p>Default is <var class="var">sc</var>.
  43060. </p>
  43061. </dd>
  43062. <dt><samp class="option">combdbg</samp></dt>
  43063. <dd><p>Force <code class="code">fieldmatch</code> to calculate the combed metrics for certain matches and
  43064. print them. This setting is known as <samp class="option">micout</samp> in TFM/VFM vocabulary.
  43065. Available values are:
  43066. </p>
  43067. <dl class="table">
  43068. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  43069. <dd><p>No forced calculation.
  43070. </p></dd>
  43071. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  43072. <dd><p>Force p/c/n calculations.
  43073. </p></dd>
  43074. <dt>&lsquo;<samp class="samp">pcnub</samp>&rsquo;</dt>
  43075. <dd><p>Force p/c/n/u/b calculations.
  43076. </p></dd>
  43077. </dl>
  43078. <p>Default value is <var class="var">none</var>.
  43079. </p>
  43080. </dd>
  43081. <dt><samp class="option">cthresh</samp></dt>
  43082. <dd><p>This is the area combing threshold used for combed frame detection. This
  43083. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  43084. Larger values mean combing must be more visible and smaller values mean combing
  43085. can be less visible or strong and still be detected. Valid settings are from
  43086. <code class="code">-1</code> (every pixel will be detected as combed) to <code class="code">255</code> (no pixel will
  43087. be detected as combed). This is basically a pixel difference value. A good
  43088. range is <code class="code">[8, 12]</code>.
  43089. </p>
  43090. <p>Default value is <code class="code">9</code>.
  43091. </p>
  43092. </dd>
  43093. <dt><samp class="option">chroma</samp></dt>
  43094. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  43095. disable this if your source has chroma problems (rainbowing, etc.) that are
  43096. causing problems for the combed frame detection with chroma enabled. Actually,
  43097. using <samp class="option">chroma</samp>=<var class="var">0</var> is usually more reliable, except for the case
  43098. where there is chroma only combing in the source.
  43099. </p>
  43100. <p>Default value is <code class="code">0</code>.
  43101. </p>
  43102. </dd>
  43103. <dt><samp class="option">blockx</samp></dt>
  43104. <dt><samp class="option">blocky</samp></dt>
  43105. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  43106. frame detection. This has to do with the size of the area in which
  43107. <samp class="option">combpel</samp> pixels are required to be detected as combed for a frame to be
  43108. declared combed. See the <samp class="option">combpel</samp> parameter description for more info.
  43109. Possible values are any number that is a power of 2 starting at 4 and going up
  43110. to 512.
  43111. </p>
  43112. <p>Default value is <code class="code">16</code>.
  43113. </p>
  43114. </dd>
  43115. <dt><samp class="option">combpel</samp></dt>
  43116. <dd><p>The number of combed pixels inside any of the <samp class="option">blocky</samp> by
  43117. <samp class="option">blockx</samp> size blocks on the frame for the frame to be detected as
  43118. combed. While <samp class="option">cthresh</samp> controls how &quot;visible&quot; the combing must be, this
  43119. setting controls &quot;how much&quot; combing there must be in any localized area (a
  43120. window defined by the <samp class="option">blockx</samp> and <samp class="option">blocky</samp> settings) on the
  43121. frame. Minimum value is <code class="code">0</code> and maximum is <code class="code">blocky x blockx</code> (at
  43122. which point no frames will ever be detected as combed). This setting is known
  43123. as <samp class="option">MI</samp> in TFM/VFM vocabulary.
  43124. </p>
  43125. <p>Default value is <code class="code">80</code>.
  43126. </p></dd>
  43127. </dl>
  43128. <a class="anchor" id="p_002fc_002fn_002fu_002fb-meaning"></a><ul class="mini-toc">
  43129. <li><a href="#p_002fc_002fn_002fu_002fb-meaning-1" accesskey="1">p/c/n/u/b meaning</a></li>
  43130. <li><a href="#Examples-119" accesskey="2">Examples</a></li>
  43131. </ul>
  43132. <div class="subsection-level-extent" id="p_002fc_002fn_002fu_002fb-meaning-1">
  43133. <h4 class="subsection"><span>39.94.1 p/c/n/u/b meaning<a class="copiable-link" href="#p_002fc_002fn_002fu_002fb-meaning-1"> &para;</a></span></h4>
  43134. <ul class="mini-toc">
  43135. <li><a href="#p_002fc_002fn" accesskey="1">p/c/n</a></li>
  43136. <li><a href="#u_002fb" accesskey="2">u/b</a></li>
  43137. </ul>
  43138. <div class="subsubsection-level-extent" id="p_002fc_002fn">
  43139. <h4 class="subsubsection"><span>39.94.1.1 p/c/n<a class="copiable-link" href="#p_002fc_002fn"> &para;</a></span></h4>
  43140. <p>We assume the following telecined stream:
  43141. </p>
  43142. <div class="example">
  43143. <pre class="example-preformatted">Top fields: 1 2 2 3 4
  43144. Bottom fields: 1 2 3 4 4
  43145. </pre></div>
  43146. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  43147. first two frames are progressive, the 3rd and 4th are combed, and so on.
  43148. </p>
  43149. <p>When <code class="code">fieldmatch</code> is configured to run a matching from bottom
  43150. (<samp class="option">field</samp>=<var class="var">bottom</var>) this is how this input stream get transformed:
  43151. </p>
  43152. <div class="example">
  43153. <pre class="example-preformatted">Input stream:
  43154. T 1 2 2 3 4
  43155. B 1 2 3 4 4 &lt;-- matching reference
  43156. Matches: c c n n c
  43157. Output stream:
  43158. T 1 2 3 4 4
  43159. B 1 2 3 4 4
  43160. </pre></div>
  43161. <p>As a result of the field matching, we can see that some frames get duplicated.
  43162. To perform a complete inverse telecine, you need to rely on a decimation filter
  43163. after this operation. See for instance the <a class="ref" href="#decimate">decimate</a> filter.
  43164. </p>
  43165. <p>The same operation now matching from top fields (<samp class="option">field</samp>=<var class="var">top</var>)
  43166. looks like this:
  43167. </p>
  43168. <div class="example">
  43169. <pre class="example-preformatted">Input stream:
  43170. T 1 2 2 3 4 &lt;-- matching reference
  43171. B 1 2 3 4 4
  43172. Matches: c c p p c
  43173. Output stream:
  43174. T 1 2 2 3 4
  43175. B 1 2 2 3 4
  43176. </pre></div>
  43177. <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;
  43178. basically, they refer to the frame and field of the opposite parity:
  43179. </p>
  43180. <ul class="itemize mark-bullet">
  43181. <li><var class="var">p</var> matches the field of the opposite parity in the previous frame
  43182. </li><li><var class="var">c</var> matches the field of the opposite parity in the current frame
  43183. </li><li><var class="var">n</var> matches the field of the opposite parity in the next frame
  43184. </li></ul>
  43185. </div>
  43186. <div class="subsubsection-level-extent" id="u_002fb">
  43187. <h4 class="subsubsection"><span>39.94.1.2 u/b<a class="copiable-link" href="#u_002fb"> &para;</a></span></h4>
  43188. <p>The <var class="var">u</var> and <var class="var">b</var> matching are a bit special in the sense that they match
  43189. from the opposite parity flag. In the following examples, we assume that we are
  43190. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  43191. &rsquo;x&rsquo; is placed above and below each matched fields.
  43192. </p>
  43193. <p>With bottom matching (<samp class="option">field</samp>=<var class="var">bottom</var>):
  43194. </p><div class="example">
  43195. <pre class="example-preformatted">Match: c p n b u
  43196. x x x x x
  43197. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  43198. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  43199. x x x x x
  43200. Output frames:
  43201. 2 1 2 2 2
  43202. 2 2 2 1 3
  43203. </pre></div>
  43204. <p>With top matching (<samp class="option">field</samp>=<var class="var">top</var>):
  43205. </p><div class="example">
  43206. <pre class="example-preformatted">Match: c p n b u
  43207. x x x x x
  43208. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  43209. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  43210. x x x x x
  43211. Output frames:
  43212. 2 2 2 1 2
  43213. 2 1 3 2 2
  43214. </pre></div>
  43215. </div>
  43216. </div>
  43217. <div class="subsection-level-extent" id="Examples-119">
  43218. <h4 class="subsection"><span>39.94.2 Examples<a class="copiable-link" href="#Examples-119"> &para;</a></span></h4>
  43219. <p>Simple IVTC of a top field first telecined stream:
  43220. </p><div class="example">
  43221. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=none, decimate
  43222. </pre></div>
  43223. <p>Advanced IVTC, with fallback on <a class="ref" href="#yadif">yadif</a> for still combed frames:
  43224. </p><div class="example">
  43225. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  43226. </pre></div>
  43227. </div>
  43228. </div>
  43229. <div class="section-level-extent" id="fieldorder">
  43230. <h3 class="section"><span>39.95 fieldorder<a class="copiable-link" href="#fieldorder"> &para;</a></span></h3>
  43231. <p>Transform the field order of the input video.
  43232. </p>
  43233. <p>It accepts the following parameters:
  43234. </p>
  43235. <dl class="table">
  43236. <dt><samp class="option">order</samp></dt>
  43237. <dd><p>The output field order. Valid values are <var class="var">tff</var> for top field first or <var class="var">bff</var>
  43238. for bottom field first.
  43239. </p></dd>
  43240. </dl>
  43241. <p>The default value is &lsquo;<samp class="samp">tff</samp>&rsquo;.
  43242. </p>
  43243. <p>The transformation is done by shifting the picture content up or down
  43244. by one line, and filling the remaining line with appropriate picture content.
  43245. This method is consistent with most broadcast field order converters.
  43246. </p>
  43247. <p>If the input video is not flagged as being interlaced, or it is already
  43248. flagged as being of the required output field order, then this filter does
  43249. not alter the incoming video.
  43250. </p>
  43251. <p>It is very useful when converting to or from PAL DV material,
  43252. which is bottom field first.
  43253. </p>
  43254. <p>For example:
  43255. </p><div class="example">
  43256. <pre class="example-preformatted">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  43257. </pre></div>
  43258. </div>
  43259. <div class="section-level-extent" id="fillborders">
  43260. <h3 class="section"><span>39.96 fillborders<a class="copiable-link" href="#fillborders"> &para;</a></span></h3>
  43261. <p>Fill borders of the input video, without changing video stream dimensions.
  43262. Sometimes video can have garbage at the four edges and you may not want to
  43263. crop video input to keep size multiple of some number.
  43264. </p>
  43265. <p>This filter accepts the following options:
  43266. </p>
  43267. <dl class="table">
  43268. <dt><samp class="option">left</samp></dt>
  43269. <dd><p>Number of pixels to fill from left border.
  43270. </p>
  43271. </dd>
  43272. <dt><samp class="option">right</samp></dt>
  43273. <dd><p>Number of pixels to fill from right border.
  43274. </p>
  43275. </dd>
  43276. <dt><samp class="option">top</samp></dt>
  43277. <dd><p>Number of pixels to fill from top border.
  43278. </p>
  43279. </dd>
  43280. <dt><samp class="option">bottom</samp></dt>
  43281. <dd><p>Number of pixels to fill from bottom border.
  43282. </p>
  43283. </dd>
  43284. <dt><samp class="option">mode</samp></dt>
  43285. <dd><p>Set fill mode.
  43286. </p>
  43287. <p>It accepts the following values:
  43288. </p><dl class="table">
  43289. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  43290. <dd><p>fill pixels using outermost pixels
  43291. </p>
  43292. </dd>
  43293. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  43294. <dd><p>fill pixels using mirroring (half sample symmetric)
  43295. </p>
  43296. </dd>
  43297. <dt>&lsquo;<samp class="samp">fixed</samp>&rsquo;</dt>
  43298. <dd><p>fill pixels with constant value
  43299. </p>
  43300. </dd>
  43301. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  43302. <dd><p>fill pixels using reflecting (whole sample symmetric)
  43303. </p>
  43304. </dd>
  43305. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  43306. <dd><p>fill pixels using wrapping
  43307. </p>
  43308. </dd>
  43309. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  43310. <dd><p>fade pixels to constant value
  43311. </p>
  43312. </dd>
  43313. <dt>&lsquo;<samp class="samp">margins</samp>&rsquo;</dt>
  43314. <dd><p>fill pixels at top and bottom with weighted averages pixels near borders
  43315. </p></dd>
  43316. </dl>
  43317. <p>Default is <var class="var">smear</var>.
  43318. </p>
  43319. </dd>
  43320. <dt><samp class="option">color</samp></dt>
  43321. <dd><p>Set color for pixels in fixed or fade mode. Default is <var class="var">black</var>.
  43322. </p></dd>
  43323. </dl>
  43324. <ul class="mini-toc">
  43325. <li><a href="#Commands-93" accesskey="1">Commands</a></li>
  43326. </ul>
  43327. <div class="subsection-level-extent" id="Commands-93">
  43328. <h4 class="subsection"><span>39.96.1 Commands<a class="copiable-link" href="#Commands-93"> &para;</a></span></h4>
  43329. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  43330. The command accepts the same syntax of the corresponding option.
  43331. </p>
  43332. <p>If the specified expression is not valid, it is kept at its current
  43333. value.
  43334. </p>
  43335. </div>
  43336. </div>
  43337. <div class="section-level-extent" id="find_005frect">
  43338. <h3 class="section"><span>39.97 find_rect<a class="copiable-link" href="#find_005frect"> &para;</a></span></h3>
  43339. <p>Find a rectangular object in the input video.
  43340. </p>
  43341. <p>The object to search for must be specified as a gray8 image specified with the
  43342. <samp class="option">object</samp> option.
  43343. </p>
  43344. <p>For each possible match, a score is computed. If the score reaches the specified
  43345. threshold, the object is considered found.
  43346. </p>
  43347. <p>If the input video contains multiple instances of the object, the filter will
  43348. find only one of them.
  43349. </p>
  43350. <p>When an object is found, the following metadata entries are set in the matching
  43351. frame:
  43352. </p><dl class="table">
  43353. <dt><samp class="option">lavfi.rect.w</samp></dt>
  43354. <dd><p>width of object
  43355. </p>
  43356. </dd>
  43357. <dt><samp class="option">lavfi.rect.h</samp></dt>
  43358. <dd><p>height of object
  43359. </p>
  43360. </dd>
  43361. <dt><samp class="option">lavfi.rect.x</samp></dt>
  43362. <dd><p>x position of object
  43363. </p>
  43364. </dd>
  43365. <dt><samp class="option">lavfi.rect.y</samp></dt>
  43366. <dd><p>y position of object
  43367. </p>
  43368. </dd>
  43369. <dt><samp class="option">lavfi.rect.score</samp></dt>
  43370. <dd><p>match score of the found object
  43371. </p></dd>
  43372. </dl>
  43373. <p>It accepts the following options:
  43374. </p>
  43375. <dl class="table">
  43376. <dt><samp class="option">object</samp></dt>
  43377. <dd><p>Filepath of the object image, needs to be in gray8.
  43378. </p>
  43379. </dd>
  43380. <dt><samp class="option">threshold</samp></dt>
  43381. <dd><p>Detection threshold, expressed as a decimal number in the range 0-1.
  43382. </p>
  43383. <p>A threshold value of 0.01 means only exact matches, a threshold of 0.99 means
  43384. almost everything matches.
  43385. </p>
  43386. <p>Default value is 0.5.
  43387. </p>
  43388. </dd>
  43389. <dt><samp class="option">mipmaps</samp></dt>
  43390. <dd><p>Number of mipmaps, default is 3.
  43391. </p>
  43392. </dd>
  43393. <dt><samp class="option">xmin, ymin, xmax, ymax</samp></dt>
  43394. <dd><p>Specifies the rectangle in which to search.
  43395. </p>
  43396. </dd>
  43397. <dt><samp class="option">discard</samp></dt>
  43398. <dd><p>Discard frames where object is not detected. Default is disabled.
  43399. </p></dd>
  43400. </dl>
  43401. <ul class="mini-toc">
  43402. <li><a href="#Examples-120" accesskey="1">Examples</a></li>
  43403. </ul>
  43404. <div class="subsection-level-extent" id="Examples-120">
  43405. <h4 class="subsection"><span>39.97.1 Examples<a class="copiable-link" href="#Examples-120"> &para;</a></span></h4>
  43406. <ul class="itemize mark-bullet">
  43407. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  43408. <div class="example">
  43409. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  43410. </pre></div>
  43411. </li><li>Find the position of an object in each frame using <code class="command">ffprobe</code> and write
  43412. it to a log file:
  43413. <div class="example">
  43414. <pre class="example-preformatted">ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
  43415. -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
  43416. -of csv -o find_rect.csv
  43417. </pre></div>
  43418. </li></ul>
  43419. </div>
  43420. </div>
  43421. <div class="section-level-extent" id="floodfill">
  43422. <h3 class="section"><span>39.98 floodfill<a class="copiable-link" href="#floodfill"> &para;</a></span></h3>
  43423. <p>Flood area with values of same pixel components with another values.
  43424. </p>
  43425. <p>It accepts the following options:
  43426. </p><dl class="table">
  43427. <dt><samp class="option">x</samp></dt>
  43428. <dd><p>Set pixel x coordinate.
  43429. </p>
  43430. </dd>
  43431. <dt><samp class="option">y</samp></dt>
  43432. <dd><p>Set pixel y coordinate.
  43433. </p>
  43434. </dd>
  43435. <dt><samp class="option">s0</samp></dt>
  43436. <dd><p>Set source #0 component value.
  43437. </p>
  43438. </dd>
  43439. <dt><samp class="option">s1</samp></dt>
  43440. <dd><p>Set source #1 component value.
  43441. </p>
  43442. </dd>
  43443. <dt><samp class="option">s2</samp></dt>
  43444. <dd><p>Set source #2 component value.
  43445. </p>
  43446. </dd>
  43447. <dt><samp class="option">s3</samp></dt>
  43448. <dd><p>Set source #3 component value.
  43449. </p>
  43450. </dd>
  43451. <dt><samp class="option">d0</samp></dt>
  43452. <dd><p>Set destination #0 component value.
  43453. </p>
  43454. </dd>
  43455. <dt><samp class="option">d1</samp></dt>
  43456. <dd><p>Set destination #1 component value.
  43457. </p>
  43458. </dd>
  43459. <dt><samp class="option">d2</samp></dt>
  43460. <dd><p>Set destination #2 component value.
  43461. </p>
  43462. </dd>
  43463. <dt><samp class="option">d3</samp></dt>
  43464. <dd><p>Set destination #3 component value.
  43465. </p></dd>
  43466. </dl>
  43467. <a class="anchor" id="format"></a></div>
  43468. <div class="section-level-extent" id="format-1">
  43469. <h3 class="section"><span>39.99 format<a class="copiable-link" href="#format-1"> &para;</a></span></h3>
  43470. <p>Convert the input video to one of the specified pixel formats.
  43471. Libavfilter will try to pick one that is suitable as input to
  43472. the next filter.
  43473. </p>
  43474. <p>It accepts the following parameters:
  43475. </p><dl class="table">
  43476. <dt><samp class="option">pix_fmts</samp></dt>
  43477. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  43478. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  43479. </p>
  43480. </dd>
  43481. <dt><samp class="option">color_spaces</samp></dt>
  43482. <dd><p>A &rsquo;|&rsquo;-separated list of color space names, such as
  43483. &quot;color_spaces=bt709|bt470bg|bt2020nc&quot;.
  43484. </p>
  43485. </dd>
  43486. <dt><samp class="option">color_ranges</samp></dt>
  43487. <dd><p>A &rsquo;|&rsquo;-separated list of color range names, such as
  43488. &quot;color_spaces=tv|pc&quot;.
  43489. </p>
  43490. </dd>
  43491. </dl>
  43492. <ul class="mini-toc">
  43493. <li><a href="#Examples-121" accesskey="1">Examples</a></li>
  43494. </ul>
  43495. <div class="subsection-level-extent" id="Examples-121">
  43496. <h4 class="subsection"><span>39.99.1 Examples<a class="copiable-link" href="#Examples-121"> &para;</a></span></h4>
  43497. <ul class="itemize mark-bullet">
  43498. <li>Convert the input video to the <var class="var">yuv420p</var> format
  43499. <div class="example">
  43500. <pre class="example-preformatted">format=pix_fmts=yuv420p
  43501. </pre></div>
  43502. <p>Convert the input video to any of the formats in the list
  43503. </p><div class="example">
  43504. <pre class="example-preformatted">format=pix_fmts=yuv420p|yuv444p|yuv410p
  43505. </pre></div>
  43506. </li></ul>
  43507. <a class="anchor" id="fps"></a></div>
  43508. </div>
  43509. <div class="section-level-extent" id="fps-1">
  43510. <h3 class="section"><span>39.100 fps<a class="copiable-link" href="#fps-1"> &para;</a></span></h3>
  43511. <p>Convert the video to specified constant frame rate by duplicating or dropping
  43512. frames as necessary.
  43513. </p>
  43514. <p>It accepts the following parameters:
  43515. </p><dl class="table">
  43516. <dt><samp class="option">fps</samp></dt>
  43517. <dd><p>The desired output frame rate. It accepts expressions containing the following
  43518. constants:
  43519. </p>
  43520. <dl class="table">
  43521. <dt>&lsquo;<samp class="samp">source_fps</samp>&rsquo;</dt>
  43522. <dd><p>The input&rsquo;s frame rate
  43523. </p>
  43524. </dd>
  43525. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  43526. <dd><p>NTSC frame rate of <code class="code">30000/1001</code>
  43527. </p>
  43528. </dd>
  43529. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  43530. <dd><p>PAL frame rate of <code class="code">25.0</code>
  43531. </p>
  43532. </dd>
  43533. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  43534. <dd><p>Film frame rate of <code class="code">24.0</code>
  43535. </p>
  43536. </dd>
  43537. <dt>&lsquo;<samp class="samp">ntsc_film</samp>&rsquo;</dt>
  43538. <dd><p>NTSC-film frame rate of <code class="code">24000/1001</code>
  43539. </p></dd>
  43540. </dl>
  43541. <p>The default is <code class="code">25</code>.
  43542. </p>
  43543. </dd>
  43544. <dt><samp class="option">start_time</samp></dt>
  43545. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  43546. padding/trimming at the start of stream. By default, no assumption is made
  43547. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  43548. For example, this could be set to 0 to pad the beginning with duplicates of
  43549. the first frame if a video stream starts after the audio stream or to trim any
  43550. frames with a negative PTS.
  43551. </p>
  43552. </dd>
  43553. <dt><samp class="option">round</samp></dt>
  43554. <dd><p>Timestamp (PTS) rounding method.
  43555. </p>
  43556. <p>Possible values are:
  43557. </p><dl class="table">
  43558. <dt><samp class="option">zero</samp></dt>
  43559. <dd><p>round towards 0
  43560. </p></dd>
  43561. <dt><samp class="option">inf</samp></dt>
  43562. <dd><p>round away from 0
  43563. </p></dd>
  43564. <dt><samp class="option">down</samp></dt>
  43565. <dd><p>round towards -infinity
  43566. </p></dd>
  43567. <dt><samp class="option">up</samp></dt>
  43568. <dd><p>round towards +infinity
  43569. </p></dd>
  43570. <dt><samp class="option">near</samp></dt>
  43571. <dd><p>round to nearest
  43572. </p></dd>
  43573. </dl>
  43574. <p>The default is <code class="code">near</code>.
  43575. </p>
  43576. </dd>
  43577. <dt><samp class="option">eof_action</samp></dt>
  43578. <dd><p>Action performed when reading the last frame.
  43579. </p>
  43580. <p>Possible values are:
  43581. </p><dl class="table">
  43582. <dt><samp class="option">round</samp></dt>
  43583. <dd><p>Use same timestamp rounding method as used for other frames.
  43584. </p></dd>
  43585. <dt><samp class="option">pass</samp></dt>
  43586. <dd><p>Pass through last frame if input duration has not been reached yet.
  43587. </p></dd>
  43588. </dl>
  43589. <p>The default is <code class="code">round</code>.
  43590. </p>
  43591. </dd>
  43592. </dl>
  43593. <p>Alternatively, the options can be specified as a flat string:
  43594. <var class="var">fps</var>[:<var class="var">start_time</var>[:<var class="var">round</var>]].
  43595. </p>
  43596. <p>See also the <a class="ref" href="#setpts">setpts</a> filter.
  43597. </p>
  43598. <ul class="mini-toc">
  43599. <li><a href="#Examples-122" accesskey="1">Examples</a></li>
  43600. </ul>
  43601. <div class="subsection-level-extent" id="Examples-122">
  43602. <h4 class="subsection"><span>39.100.1 Examples<a class="copiable-link" href="#Examples-122"> &para;</a></span></h4>
  43603. <ul class="itemize mark-bullet">
  43604. <li>A typical usage in order to set the fps to 25:
  43605. <div class="example">
  43606. <pre class="example-preformatted">fps=fps=25
  43607. </pre></div>
  43608. </li><li>Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  43609. <div class="example">
  43610. <pre class="example-preformatted">fps=fps=film:round=near
  43611. </pre></div>
  43612. </li></ul>
  43613. </div>
  43614. </div>
  43615. <div class="section-level-extent" id="framepack">
  43616. <h3 class="section"><span>39.101 framepack<a class="copiable-link" href="#framepack"> &para;</a></span></h3>
  43617. <p>Pack two different video streams into a stereoscopic video, setting proper
  43618. metadata on supported codecs. The two views should have the same size and
  43619. framerate and processing will stop when the shorter video ends. Please note
  43620. that you may conveniently adjust view properties with the <a class="ref" href="#scale">scale</a> and
  43621. <a class="ref" href="#fps">fps</a> filters.
  43622. </p>
  43623. <p>It accepts the following parameters:
  43624. </p><dl class="table">
  43625. <dt><samp class="option">format</samp></dt>
  43626. <dd><p>The desired packing format. Supported values are:
  43627. </p>
  43628. <dl class="table">
  43629. <dt><samp class="option">sbs</samp></dt>
  43630. <dd><p>The views are next to each other (default).
  43631. </p>
  43632. </dd>
  43633. <dt><samp class="option">tab</samp></dt>
  43634. <dd><p>The views are on top of each other.
  43635. </p>
  43636. </dd>
  43637. <dt><samp class="option">lines</samp></dt>
  43638. <dd><p>The views are packed by line.
  43639. </p>
  43640. </dd>
  43641. <dt><samp class="option">columns</samp></dt>
  43642. <dd><p>The views are packed by column.
  43643. </p>
  43644. </dd>
  43645. <dt><samp class="option">frameseq</samp></dt>
  43646. <dd><p>The views are temporally interleaved.
  43647. </p>
  43648. </dd>
  43649. </dl>
  43650. </dd>
  43651. </dl>
  43652. <p>Some examples:
  43653. </p>
  43654. <div class="example">
  43655. <pre class="example-preformatted"># Convert left and right views into a frame-sequential video
  43656. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  43657. # Convert views into a side-by-side video with the same output resolution as the input
  43658. 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
  43659. </pre></div>
  43660. </div>
  43661. <div class="section-level-extent" id="framerate">
  43662. <h3 class="section"><span>39.102 framerate<a class="copiable-link" href="#framerate"> &para;</a></span></h3>
  43663. <p>Change the frame rate by interpolating new video output frames from the source
  43664. frames.
  43665. </p>
  43666. <p>This filter is not designed to function correctly with interlaced media. If
  43667. you wish to change the frame rate of interlaced media then you are required
  43668. to deinterlace before this filter and re-interlace after this filter.
  43669. </p>
  43670. <p>A description of the accepted options follows.
  43671. </p>
  43672. <dl class="table">
  43673. <dt><samp class="option">fps</samp></dt>
  43674. <dd><p>Specify the output frames per second. This option can also be specified
  43675. as a value alone. The default is <code class="code">50</code>.
  43676. </p>
  43677. </dd>
  43678. <dt><samp class="option">interp_start</samp></dt>
  43679. <dd><p>Specify the start of a range where the output frame will be created as a
  43680. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  43681. the default is <code class="code">15</code>.
  43682. </p>
  43683. </dd>
  43684. <dt><samp class="option">interp_end</samp></dt>
  43685. <dd><p>Specify the end of a range where the output frame will be created as a
  43686. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  43687. the default is <code class="code">240</code>.
  43688. </p>
  43689. </dd>
  43690. <dt><samp class="option">scene</samp></dt>
  43691. <dd><p>Specify the level at which a scene change is detected as a value between
  43692. 0 and 100 to indicate a new scene; a low value reflects a low
  43693. probability for the current frame to introduce a new scene, while a higher
  43694. value means the current frame is more likely to be one.
  43695. The default is <code class="code">8.2</code>.
  43696. </p>
  43697. </dd>
  43698. <dt><samp class="option">flags</samp></dt>
  43699. <dd><p>Specify flags influencing the filter process.
  43700. </p>
  43701. <p>Available value for <var class="var">flags</var> is:
  43702. </p>
  43703. <dl class="table">
  43704. <dt><samp class="option">scene_change_detect, scd</samp></dt>
  43705. <dd><p>Enable scene change detection using the value of the option <var class="var">scene</var>.
  43706. This flag is enabled by default.
  43707. </p></dd>
  43708. </dl>
  43709. </dd>
  43710. </dl>
  43711. </div>
  43712. <div class="section-level-extent" id="framestep">
  43713. <h3 class="section"><span>39.103 framestep<a class="copiable-link" href="#framestep"> &para;</a></span></h3>
  43714. <p>Select one frame every N-th frame.
  43715. </p>
  43716. <p>This filter accepts the following option:
  43717. </p><dl class="table">
  43718. <dt><samp class="option">step</samp></dt>
  43719. <dd><p>Select frame after every <code class="code">step</code> frames.
  43720. Allowed values are positive integers higher than 0. Default value is <code class="code">1</code>.
  43721. </p></dd>
  43722. </dl>
  43723. </div>
  43724. <div class="section-level-extent" id="freezedetect">
  43725. <h3 class="section"><span>39.104 freezedetect<a class="copiable-link" href="#freezedetect"> &para;</a></span></h3>
  43726. <p>Detect frozen video.
  43727. </p>
  43728. <p>This filter logs a message and sets frame metadata when it detects that the
  43729. input video has no significant change in content during a specified duration.
  43730. Video freeze detection calculates the mean average absolute difference of all
  43731. the components of video frames and compares it to a noise floor.
  43732. </p>
  43733. <p>The printed times and duration are expressed in seconds. The
  43734. <code class="code">lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  43735. whose timestamp equals or exceeds the detection duration and it contains the
  43736. timestamp of the first frame of the freeze. The
  43737. <code class="code">lavfi.freezedetect.freeze_duration</code> and
  43738. <code class="code">lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  43739. after the freeze.
  43740. </p>
  43741. <p>The filter accepts the following options:
  43742. </p>
  43743. <dl class="table">
  43744. <dt><samp class="option">noise, n</samp></dt>
  43745. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  43746. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  43747. 0.001.
  43748. </p>
  43749. </dd>
  43750. <dt><samp class="option">duration, d</samp></dt>
  43751. <dd><p>Set freeze duration until notification (default is 2 seconds).
  43752. </p></dd>
  43753. </dl>
  43754. </div>
  43755. <div class="section-level-extent" id="freezeframes">
  43756. <h3 class="section"><span>39.105 freezeframes<a class="copiable-link" href="#freezeframes"> &para;</a></span></h3>
  43757. <p>Freeze video frames.
  43758. </p>
  43759. <p>This filter freezes video frames using frame from 2nd input.
  43760. </p>
  43761. <p>The filter accepts the following options:
  43762. </p>
  43763. <dl class="table">
  43764. <dt><samp class="option">first</samp></dt>
  43765. <dd><p>Set number of first frame from which to start freeze.
  43766. </p>
  43767. </dd>
  43768. <dt><samp class="option">last</samp></dt>
  43769. <dd><p>Set number of last frame from which to end freeze.
  43770. </p>
  43771. </dd>
  43772. <dt><samp class="option">replace</samp></dt>
  43773. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  43774. </p></dd>
  43775. </dl>
  43776. <a class="anchor" id="frei0r"></a></div>
  43777. <div class="section-level-extent" id="frei0r-1">
  43778. <h3 class="section"><span>39.106 frei0r<a class="copiable-link" href="#frei0r-1"> &para;</a></span></h3>
  43779. <p>Apply a frei0r effect to the input video.
  43780. </p>
  43781. <p>To enable the compilation of this filter, you need to install the frei0r
  43782. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  43783. </p>
  43784. <p>It accepts the following parameters:
  43785. </p>
  43786. <dl class="table">
  43787. <dt><samp class="option">filter_name</samp></dt>
  43788. <dd><p>The name of the frei0r effect to load. If the environment variable
  43789. <code class="env">FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  43790. directories specified by the colon-separated list in <code class="env">FREI0R_PATH</code>.
  43791. Otherwise, the standard frei0r paths are searched, in this order:
  43792. <samp class="file">HOME/.frei0r-1/lib/</samp>, <samp class="file">/usr/local/lib/frei0r-1/</samp>,
  43793. <samp class="file">/usr/lib/frei0r-1/</samp>.
  43794. </p>
  43795. </dd>
  43796. <dt><samp class="option">filter_params</samp></dt>
  43797. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  43798. </p>
  43799. </dd>
  43800. </dl>
  43801. <p>A frei0r effect parameter can be a boolean (its value is either
  43802. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  43803. <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
  43804. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  43805. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  43806. a position (specified as <var class="var">X</var>/<var class="var">Y</var>, where
  43807. <var class="var">X</var> and <var class="var">Y</var> are floating point numbers) and/or a string.
  43808. </p>
  43809. <p>The number and types of parameters depend on the loaded effect. If an
  43810. effect parameter is not specified, the default value is set.
  43811. </p>
  43812. <ul class="mini-toc">
  43813. <li><a href="#Examples-123" accesskey="1">Examples</a></li>
  43814. <li><a href="#Commands-94" accesskey="2">Commands</a></li>
  43815. </ul>
  43816. <div class="subsection-level-extent" id="Examples-123">
  43817. <h4 class="subsection"><span>39.106.1 Examples<a class="copiable-link" href="#Examples-123"> &para;</a></span></h4>
  43818. <ul class="itemize mark-bullet">
  43819. <li>Apply the distort0r effect, setting the first two double parameters:
  43820. <div class="example">
  43821. <pre class="example-preformatted">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  43822. </pre></div>
  43823. </li><li>Apply the colordistance effect, taking a color as the first parameter:
  43824. <div class="example">
  43825. <pre class="example-preformatted">frei0r=colordistance:0.2/0.3/0.4
  43826. frei0r=colordistance:violet
  43827. frei0r=colordistance:0x112233
  43828. </pre></div>
  43829. </li><li>Apply the perspective effect, specifying the top left and top right image
  43830. positions:
  43831. <div class="example">
  43832. <pre class="example-preformatted">frei0r=perspective:0.2/0.2|0.8/0.2
  43833. </pre></div>
  43834. </li></ul>
  43835. <p>For more information, see
  43836. <a class="url" href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  43837. </p>
  43838. </div>
  43839. <div class="subsection-level-extent" id="Commands-94">
  43840. <h4 class="subsection"><span>39.106.2 Commands<a class="copiable-link" href="#Commands-94"> &para;</a></span></h4>
  43841. <p>This filter supports the <samp class="option">filter_params</samp> option as <a class="ref" href="#commands">commands</a>.
  43842. </p>
  43843. </div>
  43844. </div>
  43845. <div class="section-level-extent" id="fspp">
  43846. <h3 class="section"><span>39.107 fspp<a class="copiable-link" href="#fspp"> &para;</a></span></h3>
  43847. <p>Apply fast and simple postprocessing. It is a faster version of <a class="ref" href="#spp">spp</a>.
  43848. </p>
  43849. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  43850. processing filter, one of them is performed once per block, not per pixel.
  43851. This allows for much higher speed.
  43852. </p>
  43853. <p>The filter accepts the following options:
  43854. </p>
  43855. <dl class="table">
  43856. <dt><samp class="option">quality</samp></dt>
  43857. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  43858. an integer in the range 4-5. Default value is <code class="code">4</code>.
  43859. </p>
  43860. </dd>
  43861. <dt><samp class="option">qp</samp></dt>
  43862. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  43863. If not set, the filter will use the QP from the video stream (if available).
  43864. </p>
  43865. </dd>
  43866. <dt><samp class="option">strength</samp></dt>
  43867. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  43868. more details but also more artifacts, while higher values make the image smoother
  43869. but also blurrier. Default value is <code class="code">0</code> − PSNR optimal.
  43870. </p>
  43871. </dd>
  43872. <dt><samp class="option">use_bframe_qp</samp></dt>
  43873. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  43874. option may cause flicker since the B-Frames have often larger QP. Default is
  43875. <code class="code">0</code> (not enabled).
  43876. </p>
  43877. </dd>
  43878. </dl>
  43879. <a class="anchor" id="fsync"></a></div>
  43880. <div class="section-level-extent" id="fsync-1">
  43881. <h3 class="section"><span>39.108 fsync<a class="copiable-link" href="#fsync-1"> &para;</a></span></h3>
  43882. <p>Synchronize video frames with an external mapping from a file.
  43883. </p>
  43884. <p>For each input PTS given in the map file it either drops or creates as many
  43885. frames as necessary to recreate the sequence of output frames given in the
  43886. map file.
  43887. </p>
  43888. <p>This filter is useful to recreate the output frames of a framerate conversion
  43889. by the <a class="ref" href="#fps">fps</a> filter, recorded into a map file using the ffmpeg option
  43890. <code class="code">-stats_mux_pre</code>, and do further processing to the corresponding frames
  43891. e.g. quality comparison.
  43892. </p>
  43893. <p>Each line of the map file must contain three items per input frame, the input
  43894. PTS (decimal), the output PTS (decimal) and the
  43895. output TIMEBASE (decimal/decimal), seperated by a space.
  43896. This file format corresponds to the output
  43897. of <code class="code">-stats_mux_pre_fmt=&quot;{ptsi} {pts} {tb}&quot;</code>.
  43898. </p>
  43899. <p>The filter assumes the map file is sorted by increasing input PTS.
  43900. </p>
  43901. <p>The filter accepts the following options:
  43902. </p><dl class="table">
  43903. <dt><samp class="option">file, f</samp></dt>
  43904. <dd><p>The filename of the map file to be used.
  43905. </p></dd>
  43906. </dl>
  43907. <p>Example:
  43908. </p><div class="example">
  43909. <pre class="example-preformatted"># Convert a video to 25 fps and record a MAP_FILE file with the default format of this filter
  43910. ffmpeg -i INPUT -vf fps=fps=25 -stats_mux_pre MAP_FILE -stats_mux_pre_fmt &quot;{ptsi} {pts} {tb}&quot; OUTPUT
  43911. # Sort MAP_FILE by increasing input PTS
  43912. sort -n MAP_FILE
  43913. # Use INPUT, OUTPUT and the MAP_FILE from above to compare the corresponding frames in INPUT and OUTPUT via SSIM
  43914. ffmpeg -i INPUT -i OUTPUT -filter_complex '[0:v]fsync=file=MAP_FILE[ref];[1:v][ref]ssim' -f null -
  43915. </pre></div>
  43916. </div>
  43917. <div class="section-level-extent" id="gblur">
  43918. <h3 class="section"><span>39.109 gblur<a class="copiable-link" href="#gblur"> &para;</a></span></h3>
  43919. <p>Apply Gaussian blur filter.
  43920. </p>
  43921. <p>The filter accepts the following options:
  43922. </p>
  43923. <dl class="table">
  43924. <dt><samp class="option">sigma</samp></dt>
  43925. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  43926. </p>
  43927. </dd>
  43928. <dt><samp class="option">steps</samp></dt>
  43929. <dd><p>Set number of steps for Gaussian approximation. Default is <code class="code">1</code>.
  43930. </p>
  43931. </dd>
  43932. <dt><samp class="option">planes</samp></dt>
  43933. <dd><p>Set which planes to filter. By default all planes are filtered.
  43934. </p>
  43935. </dd>
  43936. <dt><samp class="option">sigmaV</samp></dt>
  43937. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  43938. Default is <code class="code">-1</code>.
  43939. </p></dd>
  43940. </dl>
  43941. <ul class="mini-toc">
  43942. <li><a href="#Commands-95" accesskey="1">Commands</a></li>
  43943. </ul>
  43944. <div class="subsection-level-extent" id="Commands-95">
  43945. <h4 class="subsection"><span>39.109.1 Commands<a class="copiable-link" href="#Commands-95"> &para;</a></span></h4>
  43946. <p>This filter supports same commands as options.
  43947. The command accepts the same syntax of the corresponding option.
  43948. </p>
  43949. <p>If the specified expression is not valid, it is kept at its current
  43950. value.
  43951. </p>
  43952. </div>
  43953. </div>
  43954. <div class="section-level-extent" id="geq">
  43955. <h3 class="section"><span>39.110 geq<a class="copiable-link" href="#geq"> &para;</a></span></h3>
  43956. <p>Apply generic equation to each pixel.
  43957. </p>
  43958. <p>The filter accepts the following options:
  43959. </p>
  43960. <dl class="table">
  43961. <dt><samp class="option">lum_expr, lum</samp></dt>
  43962. <dd><p>Set the luma expression.
  43963. </p></dd>
  43964. <dt><samp class="option">cb_expr, cb</samp></dt>
  43965. <dd><p>Set the chrominance blue expression.
  43966. </p></dd>
  43967. <dt><samp class="option">cr_expr, cr</samp></dt>
  43968. <dd><p>Set the chrominance red expression.
  43969. </p></dd>
  43970. <dt><samp class="option">alpha_expr, a</samp></dt>
  43971. <dd><p>Set the alpha expression.
  43972. </p></dd>
  43973. <dt><samp class="option">red_expr, r</samp></dt>
  43974. <dd><p>Set the red expression.
  43975. </p></dd>
  43976. <dt><samp class="option">green_expr, g</samp></dt>
  43977. <dd><p>Set the green expression.
  43978. </p></dd>
  43979. <dt><samp class="option">blue_expr, b</samp></dt>
  43980. <dd><p>Set the blue expression.
  43981. </p></dd>
  43982. </dl>
  43983. <p>The colorspace is selected according to the specified options. If one
  43984. of the <samp class="option">lum_expr</samp>, <samp class="option">cb_expr</samp>, or <samp class="option">cr_expr</samp>
  43985. options is specified, the filter will automatically select a YCbCr
  43986. colorspace. If one of the <samp class="option">red_expr</samp>, <samp class="option">green_expr</samp>, or
  43987. <samp class="option">blue_expr</samp> options is specified, it will select an RGB
  43988. colorspace.
  43989. </p>
  43990. <p>If one of the chrominance expression is not defined, it falls back on the other
  43991. one. If no alpha expression is specified it will evaluate to opaque value.
  43992. If none of chrominance expressions are specified, they will evaluate
  43993. to the luma expression.
  43994. </p>
  43995. <p>The expressions can use the following variables and functions:
  43996. </p>
  43997. <dl class="table">
  43998. <dt><samp class="option">N</samp></dt>
  43999. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  44000. </p>
  44001. </dd>
  44002. <dt><samp class="option">X</samp></dt>
  44003. <dt><samp class="option">Y</samp></dt>
  44004. <dd><p>The coordinates of the current sample.
  44005. </p>
  44006. </dd>
  44007. <dt><samp class="option">W</samp></dt>
  44008. <dt><samp class="option">H</samp></dt>
  44009. <dd><p>The width and height of the image.
  44010. </p>
  44011. </dd>
  44012. <dt><samp class="option">SW</samp></dt>
  44013. <dt><samp class="option">SH</samp></dt>
  44014. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  44015. ratio between the corresponding luma plane number of pixels and the current
  44016. plane ones. E.g. for YUV4:2:0 the values are <code class="code">1,1</code> for the luma plane, and
  44017. <code class="code">0.5,0.5</code> for chroma planes.
  44018. </p>
  44019. </dd>
  44020. <dt><samp class="option">T</samp></dt>
  44021. <dd><p>Time of the current frame, expressed in seconds.
  44022. </p>
  44023. </dd>
  44024. <dt><samp class="option">p(x, y)</samp></dt>
  44025. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the current
  44026. plane.
  44027. </p>
  44028. </dd>
  44029. <dt><samp class="option">lum(x, y)</samp></dt>
  44030. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the luma
  44031. plane.
  44032. </p>
  44033. </dd>
  44034. <dt><samp class="option">cb(x, y)</samp></dt>
  44035. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  44036. blue-difference chroma plane. Return 0 if there is no such plane.
  44037. </p>
  44038. </dd>
  44039. <dt><samp class="option">cr(x, y)</samp></dt>
  44040. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  44041. red-difference chroma plane. Return 0 if there is no such plane.
  44042. </p>
  44043. </dd>
  44044. <dt><samp class="option">r(x, y)</samp></dt>
  44045. <dt><samp class="option">g(x, y)</samp></dt>
  44046. <dt><samp class="option">b(x, y)</samp></dt>
  44047. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  44048. red/green/blue component. Return 0 if there is no such component.
  44049. </p>
  44050. </dd>
  44051. <dt><samp class="option">alpha(x, y)</samp></dt>
  44052. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the alpha
  44053. plane. Return 0 if there is no such plane.
  44054. </p>
  44055. </dd>
  44056. <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>
  44057. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  44058. sums of samples within a rectangle. See the functions without the sum postfix.
  44059. </p>
  44060. </dd>
  44061. <dt><samp class="option">interpolation</samp></dt>
  44062. <dd><p>Set one of interpolation methods:
  44063. </p><dl class="table">
  44064. <dt><samp class="option">nearest, n</samp></dt>
  44065. <dt><samp class="option">bilinear, b</samp></dt>
  44066. </dl>
  44067. <p>Default is bilinear.
  44068. </p></dd>
  44069. </dl>
  44070. <p>For functions, if <var class="var">x</var> and <var class="var">y</var> are outside the area, the value will be
  44071. automatically clipped to the closer edge.
  44072. </p>
  44073. <p>Please note that this filter can use multiple threads in which case each slice
  44074. will have its own expression state. If you want to use only a single expression
  44075. state because your expressions depend on previous state then you should limit
  44076. the number of filter threads to 1.
  44077. </p>
  44078. <ul class="mini-toc">
  44079. <li><a href="#Examples-124" accesskey="1">Examples</a></li>
  44080. </ul>
  44081. <div class="subsection-level-extent" id="Examples-124">
  44082. <h4 class="subsection"><span>39.110.1 Examples<a class="copiable-link" href="#Examples-124"> &para;</a></span></h4>
  44083. <ul class="itemize mark-bullet">
  44084. <li>Flip the image horizontally:
  44085. <div class="example">
  44086. <pre class="example-preformatted">geq=p(W-X\,Y)
  44087. </pre></div>
  44088. </li><li>Generate a bidimensional sine wave, with angle <code class="code">PI/3</code> and a
  44089. wavelength of 100 pixels:
  44090. <div class="example">
  44091. <pre class="example-preformatted">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  44092. </pre></div>
  44093. </li><li>Generate a fancy enigmatic moving light:
  44094. <div class="example">
  44095. <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
  44096. </pre></div>
  44097. </li><li>Generate a quick emboss effect:
  44098. <div class="example">
  44099. <pre class="example-preformatted">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  44100. </pre></div>
  44101. </li><li>Modify RGB components depending on pixel position:
  44102. <div class="example">
  44103. <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)'
  44104. </pre></div>
  44105. </li><li>Create a radial gradient that is the same size as the input (also see
  44106. the <a class="ref" href="#vignette">vignette</a> filter):
  44107. <div class="example">
  44108. <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
  44109. </pre></div>
  44110. </li></ul>
  44111. </div>
  44112. </div>
  44113. <div class="section-level-extent" id="gradfun">
  44114. <h3 class="section"><span>39.111 gradfun<a class="copiable-link" href="#gradfun"> &para;</a></span></h3>
  44115. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  44116. regions by truncation to 8-bit color depth.
  44117. Interpolate the gradients that should go where the bands are, and
  44118. dither them.
  44119. </p>
  44120. <p>It is designed for playback only. Do not use it prior to
  44121. lossy compression, because compression tends to lose the dither and
  44122. bring back the bands.
  44123. </p>
  44124. <p>It accepts the following parameters:
  44125. </p>
  44126. <dl class="table">
  44127. <dt><samp class="option">strength</samp></dt>
  44128. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  44129. the threshold for detecting nearly flat regions. Acceptable values range from
  44130. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  44131. valid range.
  44132. </p>
  44133. </dd>
  44134. <dt><samp class="option">radius</samp></dt>
  44135. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  44136. gradients, but also prevents the filter from modifying the pixels near detailed
  44137. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  44138. values will be clipped to the valid range.
  44139. </p>
  44140. </dd>
  44141. </dl>
  44142. <p>Alternatively, the options can be specified as a flat string:
  44143. <var class="var">strength</var>[:<var class="var">radius</var>]
  44144. </p>
  44145. <ul class="mini-toc">
  44146. <li><a href="#Examples-125" accesskey="1">Examples</a></li>
  44147. </ul>
  44148. <div class="subsection-level-extent" id="Examples-125">
  44149. <h4 class="subsection"><span>39.111.1 Examples<a class="copiable-link" href="#Examples-125"> &para;</a></span></h4>
  44150. <ul class="itemize mark-bullet">
  44151. <li>Apply the filter with a <code class="code">3.5</code> strength and radius of <code class="code">8</code>:
  44152. <div class="example">
  44153. <pre class="example-preformatted">gradfun=3.5:8
  44154. </pre></div>
  44155. </li><li>Specify radius, omitting the strength (which will fall-back to the default
  44156. value):
  44157. <div class="example">
  44158. <pre class="example-preformatted">gradfun=radius=8
  44159. </pre></div>
  44160. </li></ul>
  44161. <a class="anchor" id="graphmonitor"></a></div>
  44162. </div>
  44163. <div class="section-level-extent" id="graphmonitor-1">
  44164. <h3 class="section"><span>39.112 graphmonitor<a class="copiable-link" href="#graphmonitor-1"> &para;</a></span></h3>
  44165. <p>Show various filtergraph stats.
  44166. </p>
  44167. <p>With this filter one can debug complete filtergraph.
  44168. Especially issues with links filling with queued frames.
  44169. </p>
  44170. <p>The filter accepts the following options:
  44171. </p>
  44172. <dl class="table">
  44173. <dt><samp class="option">size, s</samp></dt>
  44174. <dd><p>Set video output size. Default is <var class="var">hd720</var>.
  44175. </p>
  44176. </dd>
  44177. <dt><samp class="option">opacity, o</samp></dt>
  44178. <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>.
  44179. </p>
  44180. </dd>
  44181. <dt><samp class="option">mode, m</samp></dt>
  44182. <dd><p>Set output mode flags.
  44183. </p>
  44184. <p>Available values for flags are:
  44185. </p><dl class="table">
  44186. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  44187. <dd><p>No any filtering. Default.
  44188. </p></dd>
  44189. <dt>&lsquo;<samp class="samp">compact</samp>&rsquo;</dt>
  44190. <dd><p>Show only filters with queued frames.
  44191. </p></dd>
  44192. <dt>&lsquo;<samp class="samp">nozero</samp>&rsquo;</dt>
  44193. <dd><p>Show only filters with non-zero stats.
  44194. </p></dd>
  44195. <dt>&lsquo;<samp class="samp">noeof</samp>&rsquo;</dt>
  44196. <dd><p>Show only filters with non-eof stat.
  44197. </p></dd>
  44198. <dt>&lsquo;<samp class="samp">nodisabled</samp>&rsquo;</dt>
  44199. <dd><p>Show only filters that are enabled in timeline.
  44200. </p></dd>
  44201. </dl>
  44202. </dd>
  44203. <dt><samp class="option">flags, f</samp></dt>
  44204. <dd><p>Set flags which enable which stats are shown in video.
  44205. </p>
  44206. <p>Available values for flags are:
  44207. </p><dl class="table">
  44208. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  44209. <dd><p>All flags turned off.
  44210. </p>
  44211. </dd>
  44212. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  44213. <dd><p>All flags turned on.
  44214. </p>
  44215. </dd>
  44216. <dt>&lsquo;<samp class="samp">queue</samp>&rsquo;</dt>
  44217. <dd><p>Display number of queued frames in each link.
  44218. </p>
  44219. </dd>
  44220. <dt>&lsquo;<samp class="samp">frame_count_in</samp>&rsquo;</dt>
  44221. <dd><p>Display number of frames taken from filter.
  44222. </p>
  44223. </dd>
  44224. <dt>&lsquo;<samp class="samp">frame_count_out</samp>&rsquo;</dt>
  44225. <dd><p>Display number of frames given out from filter.
  44226. </p>
  44227. </dd>
  44228. <dt>&lsquo;<samp class="samp">frame_count_delta</samp>&rsquo;</dt>
  44229. <dd><p>Display delta number of frames between above two values.
  44230. </p>
  44231. </dd>
  44232. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  44233. <dd><p>Display current filtered frame pts.
  44234. </p>
  44235. </dd>
  44236. <dt>&lsquo;<samp class="samp">pts_delta</samp>&rsquo;</dt>
  44237. <dd><p>Display pts delta between current and previous frame.
  44238. </p>
  44239. </dd>
  44240. <dt>&lsquo;<samp class="samp">time</samp>&rsquo;</dt>
  44241. <dd><p>Display current filtered frame time.
  44242. </p>
  44243. </dd>
  44244. <dt>&lsquo;<samp class="samp">time_delta</samp>&rsquo;</dt>
  44245. <dd><p>Display time delta between current and previous frame.
  44246. </p>
  44247. </dd>
  44248. <dt>&lsquo;<samp class="samp">timebase</samp>&rsquo;</dt>
  44249. <dd><p>Display time base for filter link.
  44250. </p>
  44251. </dd>
  44252. <dt>&lsquo;<samp class="samp">format</samp>&rsquo;</dt>
  44253. <dd><p>Display used format for filter link.
  44254. </p>
  44255. </dd>
  44256. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  44257. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  44258. </p>
  44259. </dd>
  44260. <dt>&lsquo;<samp class="samp">rate</samp>&rsquo;</dt>
  44261. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  44262. </p>
  44263. </dd>
  44264. <dt>&lsquo;<samp class="samp">eof</samp>&rsquo;</dt>
  44265. <dd><p>Display link output status.
  44266. </p>
  44267. </dd>
  44268. <dt>&lsquo;<samp class="samp">sample_count_in</samp>&rsquo;</dt>
  44269. <dd><p>Display number of samples taken from filter.
  44270. </p>
  44271. </dd>
  44272. <dt>&lsquo;<samp class="samp">sample_count_out</samp>&rsquo;</dt>
  44273. <dd><p>Display number of samples given out from filter.
  44274. </p>
  44275. </dd>
  44276. <dt>&lsquo;<samp class="samp">sample_count_delta</samp>&rsquo;</dt>
  44277. <dd><p>Display delta number of samples between above two values.
  44278. </p>
  44279. </dd>
  44280. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  44281. <dd><p>Show the timeline filter status.
  44282. </p></dd>
  44283. </dl>
  44284. </dd>
  44285. <dt><samp class="option">rate, r</samp></dt>
  44286. <dd><p>Set upper limit for video rate of output stream, Default value is <var class="var">25</var>.
  44287. This guarantee that output video frame rate will not be higher than this value.
  44288. </p></dd>
  44289. </dl>
  44290. </div>
  44291. <div class="section-level-extent" id="grayworld">
  44292. <h3 class="section"><span>39.113 grayworld<a class="copiable-link" href="#grayworld"> &para;</a></span></h3>
  44293. <p>A color constancy filter that applies color correction based on the grayworld assumption
  44294. </p>
  44295. <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>
  44296. </p>
  44297. <p>The algorithm uses linear light, so input
  44298. data should be linearized beforehand (and possibly correctly tagged).
  44299. </p>
  44300. <div class="example">
  44301. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
  44302. </pre></div>
  44303. </div>
  44304. <div class="section-level-extent" id="greyedge">
  44305. <h3 class="section"><span>39.114 greyedge<a class="copiable-link" href="#greyedge"> &para;</a></span></h3>
  44306. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  44307. and corrects the scene colors accordingly.
  44308. </p>
  44309. <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>
  44310. </p>
  44311. <p>The filter accepts the following options:
  44312. </p>
  44313. <dl class="table">
  44314. <dt><samp class="option">difford</samp></dt>
  44315. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  44316. [0,2] and default value is 1.
  44317. </p>
  44318. </dd>
  44319. <dt><samp class="option">minknorm</samp></dt>
  44320. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  44321. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  44322. max value instead of calculating Minkowski distance.
  44323. </p>
  44324. </dd>
  44325. <dt><samp class="option">sigma</samp></dt>
  44326. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  44327. chosen in the range [0,1024.0] and default value = 1. floor( <var class="var">sigma</var> * break_off_sigma(3) )
  44328. can&rsquo;t be equal to 0 if <var class="var">difford</var> is greater than 0.
  44329. </p></dd>
  44330. </dl>
  44331. <ul class="mini-toc">
  44332. <li><a href="#Examples-126" accesskey="1">Examples</a></li>
  44333. </ul>
  44334. <div class="subsection-level-extent" id="Examples-126">
  44335. <h4 class="subsection"><span>39.114.1 Examples<a class="copiable-link" href="#Examples-126"> &para;</a></span></h4>
  44336. <ul class="itemize mark-bullet">
  44337. <li>Grey Edge:
  44338. <div class="example">
  44339. <pre class="example-preformatted">greyedge=difford=1:minknorm=5:sigma=2
  44340. </pre></div>
  44341. </li><li>Max Edge:
  44342. <div class="example">
  44343. <pre class="example-preformatted">greyedge=difford=1:minknorm=0:sigma=2
  44344. </pre></div>
  44345. </li></ul>
  44346. </div>
  44347. </div>
  44348. <div class="section-level-extent" id="guided">
  44349. <h3 class="section"><span>39.115 guided<a class="copiable-link" href="#guided"> &para;</a></span></h3>
  44350. <p>Apply guided filter for edge-preserving smoothing, dehazing and so on.
  44351. </p>
  44352. <p>The filter accepts the following options:
  44353. </p><dl class="table">
  44354. <dt><samp class="option">radius</samp></dt>
  44355. <dd><p>Set the box radius in pixels.
  44356. Allowed range is 1 to 20. Default is 3.
  44357. </p>
  44358. </dd>
  44359. <dt><samp class="option">eps</samp></dt>
  44360. <dd><p>Set regularization parameter (with square).
  44361. Allowed range is 0 to 1. Default is 0.01.
  44362. </p>
  44363. </dd>
  44364. <dt><samp class="option">mode</samp></dt>
  44365. <dd><p>Set filter mode. Can be <code class="code">basic</code> or <code class="code">fast</code>.
  44366. Default is <code class="code">basic</code>.
  44367. </p>
  44368. </dd>
  44369. <dt><samp class="option">sub</samp></dt>
  44370. <dd><p>Set subsampling ratio for <code class="code">fast</code> mode.
  44371. Range is 2 to 64. Default is 4.
  44372. No subsampling occurs in <code class="code">basic</code> mode.
  44373. </p>
  44374. </dd>
  44375. <dt><samp class="option">guidance</samp></dt>
  44376. <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>.
  44377. If <code class="code">off</code>, single input is required.
  44378. If <code class="code">on</code>, two inputs of the same resolution and pixel format are required.
  44379. The second input serves as the guidance.
  44380. </p>
  44381. </dd>
  44382. <dt><samp class="option">planes</samp></dt>
  44383. <dd><p>Set planes to filter. Default is first only.
  44384. </p></dd>
  44385. </dl>
  44386. <ul class="mini-toc">
  44387. <li><a href="#Commands-96" accesskey="1">Commands</a></li>
  44388. <li><a href="#Examples-127" accesskey="2">Examples</a></li>
  44389. </ul>
  44390. <div class="subsection-level-extent" id="Commands-96">
  44391. <h4 class="subsection"><span>39.115.1 Commands<a class="copiable-link" href="#Commands-96"> &para;</a></span></h4>
  44392. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  44393. </p>
  44394. </div>
  44395. <div class="subsection-level-extent" id="Examples-127">
  44396. <h4 class="subsection"><span>39.115.2 Examples<a class="copiable-link" href="#Examples-127"> &para;</a></span></h4>
  44397. <ul class="itemize mark-bullet">
  44398. <li>Edge-preserving smoothing with guided filter:
  44399. <div class="example">
  44400. <pre class="example-preformatted">ffmpeg -i in.png -vf guided out.png
  44401. </pre></div>
  44402. </li><li>Dehazing, structure-transferring filtering, detail enhancement with guided filter.
  44403. For the generation of guidance image, refer to paper &quot;Guided Image Filtering&quot;.
  44404. See: <a class="url" href="http://kaiminghe.com/publications/pami12guidedfilter.pdf">http://kaiminghe.com/publications/pami12guidedfilter.pdf</a>.
  44405. <div class="example">
  44406. <pre class="example-preformatted">ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
  44407. </pre></div>
  44408. </li></ul>
  44409. <a class="anchor" id="haldclut"></a></div>
  44410. </div>
  44411. <div class="section-level-extent" id="haldclut-1">
  44412. <h3 class="section"><span>39.116 haldclut<a class="copiable-link" href="#haldclut-1"> &para;</a></span></h3>
  44413. <p>Apply a Hald CLUT to a video stream.
  44414. </p>
  44415. <p>First input is the video stream to process, and second one is the Hald CLUT.
  44416. The Hald CLUT input can be a simple picture or a complete video stream.
  44417. </p>
  44418. <p>The filter accepts the following options:
  44419. </p>
  44420. <dl class="table">
  44421. <dt><samp class="option">clut</samp></dt>
  44422. <dd><p>Set which CLUT video frames will be processed from second input stream,
  44423. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  44424. </p>
  44425. </dd>
  44426. <dt><samp class="option">shortest</samp></dt>
  44427. <dd><p>Force termination when the shortest input terminates. Default is <code class="code">0</code>.
  44428. </p></dd>
  44429. <dt><samp class="option">repeatlast</samp></dt>
  44430. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  44431. <code class="code">0</code> disable the filter after the last frame of the CLUT is reached.
  44432. Default is <code class="code">1</code>.
  44433. </p></dd>
  44434. </dl>
  44435. <p><code class="code">haldclut</code> also has the same interpolation options as <a class="ref" href="#lut3d">lut3d</a> (both
  44436. filters share the same internals).
  44437. </p>
  44438. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  44439. </p>
  44440. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  44441. (Hald CLUT author) at <a class="url" href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  44442. </p>
  44443. <ul class="mini-toc">
  44444. <li><a href="#Commands-97" accesskey="1">Commands</a></li>
  44445. <li><a href="#Workflow-examples" accesskey="2">Workflow examples</a></li>
  44446. </ul>
  44447. <div class="subsection-level-extent" id="Commands-97">
  44448. <h4 class="subsection"><span>39.116.1 Commands<a class="copiable-link" href="#Commands-97"> &para;</a></span></h4>
  44449. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  44450. </p>
  44451. </div>
  44452. <div class="subsection-level-extent" id="Workflow-examples">
  44453. <h4 class="subsection"><span>39.116.2 Workflow examples<a class="copiable-link" href="#Workflow-examples"> &para;</a></span></h4>
  44454. <ul class="mini-toc">
  44455. <li><a href="#Hald-CLUT-video-stream" accesskey="1">Hald CLUT video stream</a></li>
  44456. <li><a href="#Hald-CLUT-with-preview" accesskey="2">Hald CLUT with preview</a></li>
  44457. </ul>
  44458. <div class="subsubsection-level-extent" id="Hald-CLUT-video-stream">
  44459. <h4 class="subsubsection"><span>39.116.2.1 Hald CLUT video stream<a class="copiable-link" href="#Hald-CLUT-video-stream"> &para;</a></span></h4>
  44460. <p>Generate an identity Hald CLUT stream altered with various effects:
  44461. </p><div class="example">
  44462. <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
  44463. </pre></div>
  44464. <p>Note: make sure you use a lossless codec.
  44465. </p>
  44466. <p>Then use it with <code class="code">haldclut</code> to apply it on some random stream:
  44467. </p><div class="example">
  44468. <pre class="example-preformatted">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  44469. </pre></div>
  44470. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  44471. <samp class="file">clut.nut</samp>), then the latest picture of that CLUT stream will be applied
  44472. to the remaining frames of the <code class="code">mandelbrot</code> stream.
  44473. </p>
  44474. </div>
  44475. <div class="subsubsection-level-extent" id="Hald-CLUT-with-preview">
  44476. <h4 class="subsubsection"><span>39.116.2.2 Hald CLUT with preview<a class="copiable-link" href="#Hald-CLUT-with-preview"> &para;</a></span></h4>
  44477. <p>A Hald CLUT is supposed to be a squared image of <code class="code">Level*Level*Level</code> by
  44478. <code class="code">Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  44479. biggest possible square starting at the top left of the picture. The remaining
  44480. padding pixels (bottom or right) will be ignored. This area can be used to add
  44481. a preview of the Hald CLUT.
  44482. </p>
  44483. <p>Typically, the following generated Hald CLUT will be supported by the
  44484. <code class="code">haldclut</code> filter:
  44485. </p>
  44486. <div class="example">
  44487. <pre class="example-preformatted">ffmpeg -f lavfi -i <a class="ref" href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  44488. pad=iw+320 [padded_clut];
  44489. smptebars=s=320x256, split [a][b];
  44490. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  44491. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  44492. </pre></div>
  44493. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  44494. bars are displayed on the right-top, and below the same color bars processed by
  44495. the color changes.
  44496. </p>
  44497. <p>Then, the effect of this Hald CLUT can be visualized with:
  44498. </p><div class="example">
  44499. <pre class="example-preformatted">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  44500. </pre></div>
  44501. </div>
  44502. </div>
  44503. </div>
  44504. <div class="section-level-extent" id="hflip">
  44505. <h3 class="section"><span>39.117 hflip<a class="copiable-link" href="#hflip"> &para;</a></span></h3>
  44506. <p>Flip the input video horizontally.
  44507. </p>
  44508. <p>For example, to horizontally flip the input video with <code class="command">ffmpeg</code>:
  44509. </p><div class="example">
  44510. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  44511. </pre></div>
  44512. </div>
  44513. <div class="section-level-extent" id="histeq">
  44514. <h3 class="section"><span>39.118 histeq<a class="copiable-link" href="#histeq"> &para;</a></span></h3>
  44515. <p>This filter applies a global color histogram equalization on a
  44516. per-frame basis.
  44517. </p>
  44518. <p>It can be used to correct video that has a compressed range of pixel
  44519. intensities. The filter redistributes the pixel intensities to
  44520. equalize their distribution across the intensity range. It may be
  44521. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  44522. useful only for correcting degraded or poorly captured source
  44523. video.
  44524. </p>
  44525. <p>The filter accepts the following options:
  44526. </p>
  44527. <dl class="table">
  44528. <dt><samp class="option">strength</samp></dt>
  44529. <dd><p>Determine the amount of equalization to be applied. As the strength
  44530. is reduced, the distribution of pixel intensities more-and-more
  44531. approaches that of the input frame. The value must be a float number
  44532. in the range [0,1] and defaults to 0.200.
  44533. </p>
  44534. </dd>
  44535. <dt><samp class="option">intensity</samp></dt>
  44536. <dd><p>Set the maximum intensity that can generated and scale the output
  44537. values appropriately. The strength should be set as desired and then
  44538. the intensity can be limited if needed to avoid washing-out. The value
  44539. must be a float number in the range [0,1] and defaults to 0.210.
  44540. </p>
  44541. </dd>
  44542. <dt><samp class="option">antibanding</samp></dt>
  44543. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  44544. the luminance of output pixels by a small amount to avoid banding of
  44545. the histogram. Possible values are <code class="code">none</code>, <code class="code">weak</code> or
  44546. <code class="code">strong</code>. It defaults to <code class="code">none</code>.
  44547. </p></dd>
  44548. </dl>
  44549. <a class="anchor" id="histogram"></a></div>
  44550. <div class="section-level-extent" id="histogram-1">
  44551. <h3 class="section"><span>39.119 histogram<a class="copiable-link" href="#histogram-1"> &para;</a></span></h3>
  44552. <p>Compute and draw a color distribution histogram for the input video.
  44553. </p>
  44554. <p>The computed histogram is a representation of the color component
  44555. distribution in an image.
  44556. </p>
  44557. <p>Standard histogram displays the color components distribution in an image.
  44558. Displays color graph for each color component. Shows distribution of
  44559. the Y, U, V, A or R, G, B components, depending on input format, in the
  44560. current frame. Below each graph a color component scale meter is shown.
  44561. </p>
  44562. <p>The filter accepts the following options:
  44563. </p>
  44564. <dl class="table">
  44565. <dt><samp class="option">level_height</samp></dt>
  44566. <dd><p>Set height of level. Default value is <code class="code">200</code>.
  44567. Allowed range is [50, 2048].
  44568. </p>
  44569. </dd>
  44570. <dt><samp class="option">scale_height</samp></dt>
  44571. <dd><p>Set height of color scale. Default value is <code class="code">12</code>.
  44572. Allowed range is [0, 40].
  44573. </p>
  44574. </dd>
  44575. <dt><samp class="option">display_mode</samp></dt>
  44576. <dd><p>Set display mode.
  44577. It accepts the following values:
  44578. </p><dl class="table">
  44579. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  44580. <dd><p>Per color component graphs are placed below each other.
  44581. </p>
  44582. </dd>
  44583. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  44584. <dd><p>Per color component graphs are placed side by side.
  44585. </p>
  44586. </dd>
  44587. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  44588. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  44589. that the graphs representing color components are superimposed directly
  44590. over one another.
  44591. </p></dd>
  44592. </dl>
  44593. <p>Default is <code class="code">stack</code>.
  44594. </p>
  44595. </dd>
  44596. <dt><samp class="option">levels_mode</samp></dt>
  44597. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  44598. Default is <code class="code">linear</code>.
  44599. </p>
  44600. </dd>
  44601. <dt><samp class="option">components</samp></dt>
  44602. <dd><p>Set what color components to display.
  44603. Default is <code class="code">7</code>.
  44604. </p>
  44605. </dd>
  44606. <dt><samp class="option">fgopacity</samp></dt>
  44607. <dd><p>Set foreground opacity. Default is <code class="code">0.7</code>.
  44608. </p>
  44609. </dd>
  44610. <dt><samp class="option">bgopacity</samp></dt>
  44611. <dd><p>Set background opacity. Default is <code class="code">0.5</code>.
  44612. </p>
  44613. </dd>
  44614. <dt><samp class="option">colors_mode</samp></dt>
  44615. <dd><p>Set colors mode.
  44616. It accepts the following values:
  44617. </p><dl class="table">
  44618. <dt>&lsquo;<samp class="samp">whiteonblack</samp>&rsquo;</dt>
  44619. <dt>&lsquo;<samp class="samp">blackonwhite</samp>&rsquo;</dt>
  44620. <dt>&lsquo;<samp class="samp">whiteongray</samp>&rsquo;</dt>
  44621. <dt>&lsquo;<samp class="samp">blackongray</samp>&rsquo;</dt>
  44622. <dt>&lsquo;<samp class="samp">coloronblack</samp>&rsquo;</dt>
  44623. <dt>&lsquo;<samp class="samp">coloronwhite</samp>&rsquo;</dt>
  44624. <dt>&lsquo;<samp class="samp">colorongray</samp>&rsquo;</dt>
  44625. <dt>&lsquo;<samp class="samp">blackoncolor</samp>&rsquo;</dt>
  44626. <dt>&lsquo;<samp class="samp">whiteoncolor</samp>&rsquo;</dt>
  44627. <dt>&lsquo;<samp class="samp">grayoncolor</samp>&rsquo;</dt>
  44628. </dl>
  44629. <p>Default is <code class="code">whiteonblack</code>.
  44630. </p></dd>
  44631. </dl>
  44632. <ul class="mini-toc">
  44633. <li><a href="#Examples-128" accesskey="1">Examples</a></li>
  44634. </ul>
  44635. <div class="subsection-level-extent" id="Examples-128">
  44636. <h4 class="subsection"><span>39.119.1 Examples<a class="copiable-link" href="#Examples-128"> &para;</a></span></h4>
  44637. <ul class="itemize mark-bullet">
  44638. <li>Calculate and draw histogram:
  44639. <div class="example">
  44640. <pre class="example-preformatted">ffplay -i input -vf histogram
  44641. </pre></div>
  44642. </li></ul>
  44643. <a class="anchor" id="hqdn3d"></a></div>
  44644. </div>
  44645. <div class="section-level-extent" id="hqdn3d-1">
  44646. <h3 class="section"><span>39.120 hqdn3d<a class="copiable-link" href="#hqdn3d-1"> &para;</a></span></h3>
  44647. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  44648. image noise, producing smooth images and making still images really
  44649. still. It should enhance compressibility.
  44650. </p>
  44651. <p>It accepts the following optional parameters:
  44652. </p>
  44653. <dl class="table">
  44654. <dt><samp class="option">luma_spatial</samp></dt>
  44655. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  44656. It defaults to 4.0.
  44657. </p>
  44658. </dd>
  44659. <dt><samp class="option">chroma_spatial</samp></dt>
  44660. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  44661. It defaults to 3.0*<var class="var">luma_spatial</var>/4.0.
  44662. </p>
  44663. </dd>
  44664. <dt><samp class="option">luma_tmp</samp></dt>
  44665. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  44666. 6.0*<var class="var">luma_spatial</var>/4.0.
  44667. </p>
  44668. </dd>
  44669. <dt><samp class="option">chroma_tmp</samp></dt>
  44670. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  44671. <var class="var">luma_tmp</var>*<var class="var">chroma_spatial</var>/<var class="var">luma_spatial</var>.
  44672. </p></dd>
  44673. </dl>
  44674. <ul class="mini-toc">
  44675. <li><a href="#Commands-98" accesskey="1">Commands</a></li>
  44676. </ul>
  44677. <div class="subsection-level-extent" id="Commands-98">
  44678. <h4 class="subsection"><span>39.120.1 Commands<a class="copiable-link" href="#Commands-98"> &para;</a></span></h4>
  44679. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  44680. The command accepts the same syntax of the corresponding option.
  44681. </p>
  44682. <p>If the specified expression is not valid, it is kept at its current
  44683. value.
  44684. </p>
  44685. <a class="anchor" id="hwdownload"></a></div>
  44686. </div>
  44687. <div class="section-level-extent" id="hwdownload-1">
  44688. <h3 class="section"><span>39.121 hwdownload<a class="copiable-link" href="#hwdownload-1"> &para;</a></span></h3>
  44689. <p>Download hardware frames to system memory.
  44690. </p>
  44691. <p>The input must be in hardware frames, and the output a non-hardware format.
  44692. Not all formats will be supported on the output - it may be necessary to insert
  44693. an additional <samp class="option">format</samp> filter immediately following in the graph to get
  44694. the output in a supported format.
  44695. </p>
  44696. </div>
  44697. <div class="section-level-extent" id="hwmap">
  44698. <h3 class="section"><span>39.122 hwmap<a class="copiable-link" href="#hwmap"> &para;</a></span></h3>
  44699. <p>Map hardware frames to system memory or to another device.
  44700. </p>
  44701. <p>This filter has several different modes of operation; which one is used depends
  44702. on the input and output formats:
  44703. </p><ul class="itemize mark-bullet">
  44704. <li>Hardware frame input, normal frame output
  44705. <p>Map the input frames to system memory and pass them to the output. If the
  44706. original hardware frame is later required (for example, after overlaying
  44707. something else on part of it), the <samp class="option">hwmap</samp> filter can be used again
  44708. in the next mode to retrieve it.
  44709. </p></li><li>Normal frame input, hardware frame output
  44710. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  44711. that is, return the original hardware frame.
  44712. </p>
  44713. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  44714. device for the output, then map them back to the software format at the input
  44715. and give those frames to the preceding filter. This will then act like the
  44716. <samp class="option">hwupload</samp> filter, but may be able to avoid an additional copy when
  44717. the input is already in a compatible format.
  44718. </p></li><li>Hardware frame input and output
  44719. <p>A device must be supplied for the output, either directly or with the
  44720. <samp class="option">derive_device</samp> option. The input and output devices must be of
  44721. different types and compatible - the exact meaning of this is
  44722. system-dependent, but typically it means that they must refer to the same
  44723. underlying hardware context (for example, refer to the same graphics card).
  44724. </p>
  44725. <p>If the input frames were originally created on the output device, then unmap
  44726. to retrieve the original frames.
  44727. </p>
  44728. <p>Otherwise, map the frames to the output device - create new hardware frames
  44729. on the output corresponding to the frames on the input.
  44730. </p></li></ul>
  44731. <p>The following additional parameters are accepted:
  44732. </p>
  44733. <dl class="table">
  44734. <dt><samp class="option">mode</samp></dt>
  44735. <dd><p>Set the frame mapping mode. Some combination of:
  44736. </p><dl class="table">
  44737. <dt><var class="var">read</var></dt>
  44738. <dd><p>The mapped frame should be readable.
  44739. </p></dd>
  44740. <dt><var class="var">write</var></dt>
  44741. <dd><p>The mapped frame should be writeable.
  44742. </p></dd>
  44743. <dt><var class="var">overwrite</var></dt>
  44744. <dd><p>The mapping will always overwrite the entire frame.
  44745. </p>
  44746. <p>This may improve performance in some cases, as the original contents of the
  44747. frame need not be loaded.
  44748. </p></dd>
  44749. <dt><var class="var">direct</var></dt>
  44750. <dd><p>The mapping must not involve any copying.
  44751. </p>
  44752. <p>Indirect mappings to copies of frames are created in some cases where either
  44753. direct mapping is not possible or it would have unexpected properties.
  44754. Setting this flag ensures that the mapping is direct and will fail if that is
  44755. not possible.
  44756. </p></dd>
  44757. </dl>
  44758. <p>Defaults to <var class="var">read+write</var> if not specified.
  44759. </p>
  44760. </dd>
  44761. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  44762. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  44763. device of type <var class="var">type</var> from the device the input frames exist on.
  44764. </p>
  44765. </dd>
  44766. <dt><samp class="option">reverse</samp></dt>
  44767. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  44768. and map them back to the source. This may be necessary in some cases where
  44769. a mapping in one direction is required but only the opposite direction is
  44770. supported by the devices being used.
  44771. </p>
  44772. <p>This option is dangerous - it may break the preceding filter in undefined
  44773. ways if there are any additional constraints on that filter&rsquo;s output.
  44774. Do not use it without fully understanding the implications of its use.
  44775. </p></dd>
  44776. </dl>
  44777. <a class="anchor" id="hwupload"></a></div>
  44778. <div class="section-level-extent" id="hwupload-1">
  44779. <h3 class="section"><span>39.123 hwupload<a class="copiable-link" href="#hwupload-1"> &para;</a></span></h3>
  44780. <p>Upload system memory frames to hardware surfaces.
  44781. </p>
  44782. <p>The device to upload to must be supplied when the filter is initialised. If
  44783. using ffmpeg, select the appropriate device with the <samp class="option">-filter_hw_device</samp>
  44784. option or with the <samp class="option">derive_device</samp> option. The input and output devices
  44785. must be of different types and compatible - the exact meaning of this is
  44786. system-dependent, but typically it means that they must refer to the same
  44787. underlying hardware context (for example, refer to the same graphics card).
  44788. </p>
  44789. <p>The following additional parameters are accepted:
  44790. </p>
  44791. <dl class="table">
  44792. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  44793. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  44794. device of type <var class="var">type</var> from the device the input frames exist on.
  44795. </p></dd>
  44796. </dl>
  44797. <a class="anchor" id="hwupload_005fcuda"></a></div>
  44798. <div class="section-level-extent" id="hwupload_005fcuda-1">
  44799. <h3 class="section"><span>39.124 hwupload_cuda<a class="copiable-link" href="#hwupload_005fcuda-1"> &para;</a></span></h3>
  44800. <p>Upload system memory frames to a CUDA device.
  44801. </p>
  44802. <p>It accepts the following optional parameters:
  44803. </p>
  44804. <dl class="table">
  44805. <dt><samp class="option">device</samp></dt>
  44806. <dd><p>The number of the CUDA device to use
  44807. </p></dd>
  44808. </dl>
  44809. </div>
  44810. <div class="section-level-extent" id="hqx">
  44811. <h3 class="section"><span>39.125 hqx<a class="copiable-link" href="#hqx"> &para;</a></span></h3>
  44812. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  44813. was originally created by Maxim Stepin.
  44814. </p>
  44815. <p>It accepts the following option:
  44816. </p>
  44817. <dl class="table">
  44818. <dt><samp class="option">n</samp></dt>
  44819. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">hq2x</code>, <code class="code">3</code> for
  44820. <code class="code">hq3x</code> and <code class="code">4</code> for <code class="code">hq4x</code>.
  44821. Default is <code class="code">3</code>.
  44822. </p></dd>
  44823. </dl>
  44824. <a class="anchor" id="hstack"></a></div>
  44825. <div class="section-level-extent" id="hstack-1">
  44826. <h3 class="section"><span>39.126 hstack<a class="copiable-link" href="#hstack-1"> &para;</a></span></h3>
  44827. <p>Stack input videos horizontally.
  44828. </p>
  44829. <p>All streams must be of same pixel format and of same height.
  44830. </p>
  44831. <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
  44832. to create same output.
  44833. </p>
  44834. <p>The filter accepts the following option:
  44835. </p>
  44836. <dl class="table">
  44837. <dt><samp class="option">inputs</samp></dt>
  44838. <dd><p>Set number of input streams. Default is 2.
  44839. </p>
  44840. </dd>
  44841. <dt><samp class="option">shortest</samp></dt>
  44842. <dd><p>If set to 1, force the output to terminate when the shortest input
  44843. terminates. Default value is 0.
  44844. </p></dd>
  44845. </dl>
  44846. </div>
  44847. <div class="section-level-extent" id="hsvhold">
  44848. <h3 class="section"><span>39.127 hsvhold<a class="copiable-link" href="#hsvhold"> &para;</a></span></h3>
  44849. <p>Turns a certain HSV range into gray values.
  44850. </p>
  44851. <p>This filter measures color difference between set HSV color in options
  44852. and ones measured in video stream. Depending on options, output
  44853. colors can be changed to be gray or not.
  44854. </p>
  44855. <p>The filter accepts the following options:
  44856. </p>
  44857. <dl class="table">
  44858. <dt><samp class="option">hue</samp></dt>
  44859. <dd><p>Set the hue value which will be used in color difference calculation.
  44860. Allowed range is from -360 to 360. Default value is 0.
  44861. </p>
  44862. </dd>
  44863. <dt><samp class="option">sat</samp></dt>
  44864. <dd><p>Set the saturation value which will be used in color difference calculation.
  44865. Allowed range is from -1 to 1. Default value is 0.
  44866. </p>
  44867. </dd>
  44868. <dt><samp class="option">val</samp></dt>
  44869. <dd><p>Set the value which will be used in color difference calculation.
  44870. Allowed range is from -1 to 1. Default value is 0.
  44871. </p>
  44872. </dd>
  44873. <dt><samp class="option">similarity</samp></dt>
  44874. <dd><p>Set similarity percentage with the key color.
  44875. Allowed range is from 0 to 1. Default value is 0.01.
  44876. </p>
  44877. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  44878. </p>
  44879. </dd>
  44880. <dt><samp class="option">blend</samp></dt>
  44881. <dd><p>Blend percentage.
  44882. Allowed range is from 0 to 1. Default value is 0.
  44883. </p>
  44884. <p>0.0 makes pixels either fully gray, or not gray at all.
  44885. </p>
  44886. <p>Higher values result in more gray pixels, with a higher gray pixel
  44887. the more similar the pixels color is to the key color.
  44888. </p></dd>
  44889. </dl>
  44890. </div>
  44891. <div class="section-level-extent" id="hsvkey">
  44892. <h3 class="section"><span>39.128 hsvkey<a class="copiable-link" href="#hsvkey"> &para;</a></span></h3>
  44893. <p>Turns a certain HSV range into transparency.
  44894. </p>
  44895. <p>This filter measures color difference between set HSV color in options
  44896. and ones measured in video stream. Depending on options, output
  44897. colors can be changed to transparent by adding alpha channel.
  44898. </p>
  44899. <p>The filter accepts the following options:
  44900. </p>
  44901. <dl class="table">
  44902. <dt><samp class="option">hue</samp></dt>
  44903. <dd><p>Set the hue value which will be used in color difference calculation.
  44904. Allowed range is from -360 to 360. Default value is 0.
  44905. </p>
  44906. </dd>
  44907. <dt><samp class="option">sat</samp></dt>
  44908. <dd><p>Set the saturation value which will be used in color difference calculation.
  44909. Allowed range is from -1 to 1. Default value is 0.
  44910. </p>
  44911. </dd>
  44912. <dt><samp class="option">val</samp></dt>
  44913. <dd><p>Set the value which will be used in color difference calculation.
  44914. Allowed range is from -1 to 1. Default value is 0.
  44915. </p>
  44916. </dd>
  44917. <dt><samp class="option">similarity</samp></dt>
  44918. <dd><p>Set similarity percentage with the key color.
  44919. Allowed range is from 0 to 1. Default value is 0.01.
  44920. </p>
  44921. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  44922. </p>
  44923. </dd>
  44924. <dt><samp class="option">blend</samp></dt>
  44925. <dd><p>Blend percentage.
  44926. Allowed range is from 0 to 1. Default value is 0.
  44927. </p>
  44928. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  44929. </p>
  44930. <p>Higher values result in semi-transparent pixels, with a higher transparency
  44931. the more similar the pixels color is to the key color.
  44932. </p></dd>
  44933. </dl>
  44934. </div>
  44935. <div class="section-level-extent" id="hue">
  44936. <h3 class="section"><span>39.129 hue<a class="copiable-link" href="#hue"> &para;</a></span></h3>
  44937. <p>Modify the hue and/or the saturation of the input.
  44938. </p>
  44939. <p>It accepts the following parameters:
  44940. </p>
  44941. <dl class="table">
  44942. <dt><samp class="option">h</samp></dt>
  44943. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  44944. and defaults to &quot;0&quot;.
  44945. </p>
  44946. </dd>
  44947. <dt><samp class="option">s</samp></dt>
  44948. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  44949. defaults to &quot;1&quot;.
  44950. </p>
  44951. </dd>
  44952. <dt><samp class="option">H</samp></dt>
  44953. <dd><p>Specify the hue angle as a number of radians. It accepts an
  44954. expression, and defaults to &quot;0&quot;.
  44955. </p>
  44956. </dd>
  44957. <dt><samp class="option">b</samp></dt>
  44958. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  44959. defaults to &quot;0&quot;.
  44960. </p></dd>
  44961. </dl>
  44962. <p><samp class="option">h</samp> and <samp class="option">H</samp> are mutually exclusive, and can&rsquo;t be
  44963. specified at the same time.
  44964. </p>
  44965. <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
  44966. expressions containing the following constants:
  44967. </p>
  44968. <dl class="table">
  44969. <dt><samp class="option">n</samp></dt>
  44970. <dd><p>frame count of the input frame starting from 0
  44971. </p>
  44972. </dd>
  44973. <dt><samp class="option">pts</samp></dt>
  44974. <dd><p>presentation timestamp of the input frame expressed in time base units
  44975. </p>
  44976. </dd>
  44977. <dt><samp class="option">r</samp></dt>
  44978. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  44979. </p>
  44980. </dd>
  44981. <dt><samp class="option">t</samp></dt>
  44982. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  44983. </p>
  44984. </dd>
  44985. <dt><samp class="option">tb</samp></dt>
  44986. <dd><p>time base of the input video
  44987. </p></dd>
  44988. </dl>
  44989. <ul class="mini-toc">
  44990. <li><a href="#Examples-129" accesskey="1">Examples</a></li>
  44991. <li><a href="#Commands-99" accesskey="2">Commands</a></li>
  44992. </ul>
  44993. <div class="subsection-level-extent" id="Examples-129">
  44994. <h4 class="subsection"><span>39.129.1 Examples<a class="copiable-link" href="#Examples-129"> &para;</a></span></h4>
  44995. <ul class="itemize mark-bullet">
  44996. <li>Set the hue to 90 degrees and the saturation to 1.0:
  44997. <div class="example">
  44998. <pre class="example-preformatted">hue=h=90:s=1
  44999. </pre></div>
  45000. </li><li>Same command but expressing the hue in radians:
  45001. <div class="example">
  45002. <pre class="example-preformatted">hue=H=PI/2:s=1
  45003. </pre></div>
  45004. </li><li>Rotate hue and make the saturation swing between 0
  45005. and 2 over a period of 1 second:
  45006. <div class="example">
  45007. <pre class="example-preformatted">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  45008. </pre></div>
  45009. </li><li>Apply a 3 seconds saturation fade-in effect starting at 0:
  45010. <div class="example">
  45011. <pre class="example-preformatted">hue=&quot;s=min(t/3\,1)&quot;
  45012. </pre></div>
  45013. <p>The general fade-in expression can be written as:
  45014. </p><div class="example">
  45015. <pre class="example-preformatted">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  45016. </pre></div>
  45017. </li><li>Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  45018. <div class="example">
  45019. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  45020. </pre></div>
  45021. <p>The general fade-out expression can be written as:
  45022. </p><div class="example">
  45023. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  45024. </pre></div>
  45025. </li></ul>
  45026. </div>
  45027. <div class="subsection-level-extent" id="Commands-99">
  45028. <h4 class="subsection"><span>39.129.2 Commands<a class="copiable-link" href="#Commands-99"> &para;</a></span></h4>
  45029. <p>This filter supports the following commands:
  45030. </p><dl class="table">
  45031. <dt><samp class="option">b</samp></dt>
  45032. <dt><samp class="option">s</samp></dt>
  45033. <dt><samp class="option">h</samp></dt>
  45034. <dt><samp class="option">H</samp></dt>
  45035. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  45036. The command accepts the same syntax of the corresponding option.
  45037. </p>
  45038. <p>If the specified expression is not valid, it is kept at its current
  45039. value.
  45040. </p></dd>
  45041. </dl>
  45042. </div>
  45043. </div>
  45044. <div class="section-level-extent" id="huesaturation">
  45045. <h3 class="section"><span>39.130 huesaturation<a class="copiable-link" href="#huesaturation"> &para;</a></span></h3>
  45046. <p>Apply hue-saturation-intensity adjustments to input video stream.
  45047. </p>
  45048. <p>This filter operates in RGB colorspace.
  45049. </p>
  45050. <p>This filter accepts the following options:
  45051. </p>
  45052. <dl class="table">
  45053. <dt><samp class="option">hue</samp></dt>
  45054. <dd><p>Set the hue shift in degrees to apply. Default is 0.
  45055. Allowed range is from -180 to 180.
  45056. </p>
  45057. </dd>
  45058. <dt><samp class="option">saturation</samp></dt>
  45059. <dd><p>Set the saturation shift. Default is 0.
  45060. Allowed range is from -1 to 1.
  45061. </p>
  45062. </dd>
  45063. <dt><samp class="option">intensity</samp></dt>
  45064. <dd><p>Set the intensity shift. Default is 0.
  45065. Allowed range is from -1 to 1.
  45066. </p>
  45067. </dd>
  45068. <dt><samp class="option">colors</samp></dt>
  45069. <dd><p>Set which primary and complementary colors are going to be adjusted.
  45070. This options is set by providing one or multiple values.
  45071. This can select multiple colors at once. By default all colors are selected.
  45072. </p><dl class="table">
  45073. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  45074. <dd><p>Adjust reds.
  45075. </p></dd>
  45076. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  45077. <dd><p>Adjust yellows.
  45078. </p></dd>
  45079. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  45080. <dd><p>Adjust greens.
  45081. </p></dd>
  45082. <dt>&lsquo;<samp class="samp">c</samp>&rsquo;</dt>
  45083. <dd><p>Adjust cyans.
  45084. </p></dd>
  45085. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  45086. <dd><p>Adjust blues.
  45087. </p></dd>
  45088. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  45089. <dd><p>Adjust magentas.
  45090. </p></dd>
  45091. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  45092. <dd><p>Adjust all colors.
  45093. </p></dd>
  45094. </dl>
  45095. </dd>
  45096. <dt><samp class="option">strength</samp></dt>
  45097. <dd><p>Set strength of filtering. Allowed range is from 0 to 100.
  45098. Default value is 1.
  45099. </p>
  45100. </dd>
  45101. <dt><samp class="option">rw, gw, bw</samp></dt>
  45102. <dd><p>Set weight for each RGB component. Allowed range is from 0 to 1.
  45103. By default is set to 0.333, 0.334, 0.333.
  45104. Those options are used in saturation and lightess processing.
  45105. </p>
  45106. </dd>
  45107. <dt><samp class="option">lightness</samp></dt>
  45108. <dd><p>Set preserving lightness, by default is disabled.
  45109. Adjusting hues can change lightness from original RGB triplet,
  45110. with this option enabled lightness is kept at same value.
  45111. </p></dd>
  45112. </dl>
  45113. </div>
  45114. <div class="section-level-extent" id="hysteresis">
  45115. <h3 class="section"><span>39.131 hysteresis<a class="copiable-link" href="#hysteresis"> &para;</a></span></h3>
  45116. <p>Grow first stream into second stream by connecting components.
  45117. This makes it possible to build more robust edge masks.
  45118. </p>
  45119. <p>This filter accepts the following options:
  45120. </p>
  45121. <dl class="table">
  45122. <dt><samp class="option">planes</samp></dt>
  45123. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  45124. copied from first stream.
  45125. By default value 0xf, all planes will be processed.
  45126. </p>
  45127. </dd>
  45128. <dt><samp class="option">threshold</samp></dt>
  45129. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  45130. this value filter algorithm for connecting components is activated.
  45131. By default value is 0.
  45132. </p></dd>
  45133. </dl>
  45134. <p>The <code class="code">hysteresis</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  45135. </p>
  45136. </div>
  45137. <div class="section-level-extent" id="iccdetect">
  45138. <h3 class="section"><span>39.132 iccdetect<a class="copiable-link" href="#iccdetect"> &para;</a></span></h3>
  45139. <p>Detect the colorspace from an embedded ICC profile (if present), and update
  45140. the frame&rsquo;s tags accordingly.
  45141. </p>
  45142. <p>This filter accepts the following options:
  45143. </p>
  45144. <dl class="table">
  45145. <dt><samp class="option">force</samp></dt>
  45146. <dd><p>If true, the frame&rsquo;s existing colorspace tags will always be overridden by
  45147. values detected from an ICC profile. Otherwise, they will only be assigned if
  45148. they contain <code class="code">unknown</code>. Enabled by default.
  45149. </p></dd>
  45150. </dl>
  45151. </div>
  45152. <div class="section-level-extent" id="iccgen">
  45153. <h3 class="section"><span>39.133 iccgen<a class="copiable-link" href="#iccgen"> &para;</a></span></h3>
  45154. <p>Generate ICC profiles and attach them to frames.
  45155. </p>
  45156. <p>This filter accepts the following options:
  45157. </p>
  45158. <dl class="table">
  45159. <dt><samp class="option">color_primaries</samp></dt>
  45160. <dt><samp class="option">color_trc</samp></dt>
  45161. <dd><p>Configure the colorspace that the ICC profile will be generated for. The
  45162. default value of <code class="code">auto</code> infers the value from the input frame&rsquo;s metadata,
  45163. defaulting to BT.709/sRGB as appropriate.
  45164. </p>
  45165. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values, but note that
  45166. <code class="code">unknown</code> are not valid values for this filter.
  45167. </p>
  45168. </dd>
  45169. <dt><samp class="option">force</samp></dt>
  45170. <dd><p>If true, an ICC profile will be generated even if it would overwrite an
  45171. already existing ICC profile. Disabled by default.
  45172. </p></dd>
  45173. </dl>
  45174. </div>
  45175. <div class="section-level-extent" id="identity">
  45176. <h3 class="section"><span>39.134 identity<a class="copiable-link" href="#identity"> &para;</a></span></h3>
  45177. <p>Obtain the identity score between two input videos.
  45178. </p>
  45179. <p>This filter takes two input videos.
  45180. </p>
  45181. <p>Both input videos must have the same resolution and pixel format for
  45182. this filter to work correctly. Also it assumes that both inputs
  45183. have the same number of frames, which are compared one by one.
  45184. </p>
  45185. <p>The obtained per component, average, min and max identity score is printed through
  45186. the logging system.
  45187. </p>
  45188. <p>The filter stores the calculated identity scores of each frame in frame metadata.
  45189. </p>
  45190. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  45191. </p>
  45192. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  45193. with the reference file <samp class="file">ref.mpg</samp>.
  45194. </p>
  45195. <div class="example">
  45196. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
  45197. </pre></div>
  45198. </div>
  45199. <div class="section-level-extent" id="idet">
  45200. <h3 class="section"><span>39.135 idet<a class="copiable-link" href="#idet"> &para;</a></span></h3>
  45201. <p>Detect video interlacing type.
  45202. </p>
  45203. <p>This filter tries to detect if the input frames are interlaced, progressive,
  45204. top or bottom field first. It will also try to detect fields that are
  45205. repeated between adjacent frames (a sign of telecine).
  45206. </p>
  45207. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  45208. Multiple frame detection incorporates the classification history of previous frames.
  45209. </p>
  45210. <p>The filter will log these metadata values:
  45211. </p>
  45212. <dl class="table">
  45213. <dt><samp class="option">single.current_frame</samp></dt>
  45214. <dd><p>Detected type of current frame using single-frame detection. One of:
  45215. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  45216. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  45217. </p>
  45218. </dd>
  45219. <dt><samp class="option">single.tff</samp></dt>
  45220. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  45221. </p>
  45222. </dd>
  45223. <dt><samp class="option">multiple.tff</samp></dt>
  45224. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  45225. </p>
  45226. </dd>
  45227. <dt><samp class="option">single.bff</samp></dt>
  45228. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  45229. </p>
  45230. </dd>
  45231. <dt><samp class="option">multiple.current_frame</samp></dt>
  45232. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  45233. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  45234. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  45235. </p>
  45236. </dd>
  45237. <dt><samp class="option">multiple.bff</samp></dt>
  45238. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  45239. </p>
  45240. </dd>
  45241. <dt><samp class="option">single.progressive</samp></dt>
  45242. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  45243. </p>
  45244. </dd>
  45245. <dt><samp class="option">multiple.progressive</samp></dt>
  45246. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  45247. </p>
  45248. </dd>
  45249. <dt><samp class="option">single.undetermined</samp></dt>
  45250. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  45251. </p>
  45252. </dd>
  45253. <dt><samp class="option">multiple.undetermined</samp></dt>
  45254. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  45255. </p>
  45256. </dd>
  45257. <dt><samp class="option">repeated.current_frame</samp></dt>
  45258. <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;.
  45259. </p>
  45260. </dd>
  45261. <dt><samp class="option">repeated.neither</samp></dt>
  45262. <dd><p>Cumulative number of frames with no repeated field.
  45263. </p>
  45264. </dd>
  45265. <dt><samp class="option">repeated.top</samp></dt>
  45266. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  45267. </p>
  45268. </dd>
  45269. <dt><samp class="option">repeated.bottom</samp></dt>
  45270. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  45271. </p></dd>
  45272. </dl>
  45273. <p>The filter accepts the following options:
  45274. </p>
  45275. <dl class="table">
  45276. <dt><samp class="option">intl_thres</samp></dt>
  45277. <dd><p>Set interlacing threshold.
  45278. </p></dd>
  45279. <dt><samp class="option">prog_thres</samp></dt>
  45280. <dd><p>Set progressive threshold.
  45281. </p></dd>
  45282. <dt><samp class="option">rep_thres</samp></dt>
  45283. <dd><p>Threshold for repeated field detection.
  45284. </p></dd>
  45285. <dt><samp class="option">half_life</samp></dt>
  45286. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  45287. statistics is halved (i.e., it contributes only 0.5 to its
  45288. classification). The default of 0 means that all frames seen are given
  45289. full weight of 1.0 forever.
  45290. </p></dd>
  45291. <dt><samp class="option">analyze_interlaced_flag</samp></dt>
  45292. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  45293. if the interlaced flag is accurate, it will not count undetermined frames.
  45294. If the flag is found to be accurate it will be used without any further
  45295. computations, if it is found to be inaccurate it will be cleared without any
  45296. further computations. This allows inserting the idet filter as a low computational
  45297. method to clean up the interlaced flag
  45298. </p></dd>
  45299. </dl>
  45300. <ul class="mini-toc">
  45301. <li><a href="#Examples-130" accesskey="1">Examples</a></li>
  45302. </ul>
  45303. <div class="subsection-level-extent" id="Examples-130">
  45304. <h4 class="subsection"><span>39.135.1 Examples<a class="copiable-link" href="#Examples-130"> &para;</a></span></h4>
  45305. <p>Inspect the field order of the first 360 frames in a video, in verbose detail:
  45306. </p><div class="example">
  45307. <pre class="example-preformatted">ffmpeg -i INPUT -filter:v idet,metadata=mode=print -frames:v 360 -an -f null -
  45308. </pre></div>
  45309. <p>The idet filter will add analysis metadata to each frame, which will then be
  45310. discarded. At the end, the filter will also print a final report with statistics.
  45311. </p>
  45312. </div>
  45313. </div>
  45314. <div class="section-level-extent" id="il">
  45315. <h3 class="section"><span>39.136 il<a class="copiable-link" href="#il"> &para;</a></span></h3>
  45316. <p>Deinterleave or interleave fields.
  45317. </p>
  45318. <p>This filter allows one to process interlaced images fields without
  45319. deinterlacing them. Deinterleaving splits the input frame into 2
  45320. fields (so called half pictures). Odd lines are moved to the top
  45321. half of the output image, even lines to the bottom half.
  45322. You can process (filter) them independently and then re-interleave them.
  45323. </p>
  45324. <p>The filter accepts the following options:
  45325. </p>
  45326. <dl class="table">
  45327. <dt><samp class="option">luma_mode, l</samp></dt>
  45328. <dt><samp class="option">chroma_mode, c</samp></dt>
  45329. <dt><samp class="option">alpha_mode, a</samp></dt>
  45330. <dd><p>Available values for <var class="var">luma_mode</var>, <var class="var">chroma_mode</var> and
  45331. <var class="var">alpha_mode</var> are:
  45332. </p>
  45333. <dl class="table">
  45334. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  45335. <dd><p>Do nothing.
  45336. </p>
  45337. </dd>
  45338. <dt>&lsquo;<samp class="samp">deinterleave, d</samp>&rsquo;</dt>
  45339. <dd><p>Deinterleave fields, placing one above the other.
  45340. </p>
  45341. </dd>
  45342. <dt>&lsquo;<samp class="samp">interleave, i</samp>&rsquo;</dt>
  45343. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  45344. </p></dd>
  45345. </dl>
  45346. <p>Default value is <code class="code">none</code>.
  45347. </p>
  45348. </dd>
  45349. <dt><samp class="option">luma_swap, ls</samp></dt>
  45350. <dt><samp class="option">chroma_swap, cs</samp></dt>
  45351. <dt><samp class="option">alpha_swap, as</samp></dt>
  45352. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code class="code">0</code>.
  45353. </p></dd>
  45354. </dl>
  45355. <ul class="mini-toc">
  45356. <li><a href="#Commands-100" accesskey="1">Commands</a></li>
  45357. </ul>
  45358. <div class="subsection-level-extent" id="Commands-100">
  45359. <h4 class="subsection"><span>39.136.1 Commands<a class="copiable-link" href="#Commands-100"> &para;</a></span></h4>
  45360. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  45361. </p>
  45362. </div>
  45363. </div>
  45364. <div class="section-level-extent" id="inflate">
  45365. <h3 class="section"><span>39.137 inflate<a class="copiable-link" href="#inflate"> &para;</a></span></h3>
  45366. <p>Apply inflate effect to the video.
  45367. </p>
  45368. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  45369. only values higher than the pixel.
  45370. </p>
  45371. <p>It accepts the following options:
  45372. </p>
  45373. <dl class="table">
  45374. <dt><samp class="option">threshold0</samp></dt>
  45375. <dt><samp class="option">threshold1</samp></dt>
  45376. <dt><samp class="option">threshold2</samp></dt>
  45377. <dt><samp class="option">threshold3</samp></dt>
  45378. <dd><p>Limit the maximum change for each plane, default is 65535.
  45379. If 0, plane will remain unchanged.
  45380. </p></dd>
  45381. </dl>
  45382. <ul class="mini-toc">
  45383. <li><a href="#Commands-101" accesskey="1">Commands</a></li>
  45384. </ul>
  45385. <div class="subsection-level-extent" id="Commands-101">
  45386. <h4 class="subsection"><span>39.137.1 Commands<a class="copiable-link" href="#Commands-101"> &para;</a></span></h4>
  45387. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  45388. </p>
  45389. </div>
  45390. </div>
  45391. <div class="section-level-extent" id="interlace">
  45392. <h3 class="section"><span>39.138 interlace<a class="copiable-link" href="#interlace"> &para;</a></span></h3>
  45393. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  45394. lower) lines from odd frames with lower (or upper) lines from even frames,
  45395. halving the frame rate and preserving image height.
  45396. </p>
  45397. <div class="example">
  45398. <pre class="example-preformatted"> Original Original New Frame
  45399. Frame 'j' Frame 'j+1' (tff)
  45400. ========== =========== ==================
  45401. Line 0 --------------------&gt; Frame 'j' Line 0
  45402. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  45403. Line 2 ---------------------&gt; Frame 'j' Line 2
  45404. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  45405. ... ... ...
  45406. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  45407. </pre></div>
  45408. <p>It accepts the following optional parameters:
  45409. </p>
  45410. <dl class="table">
  45411. <dt><samp class="option">scan</samp></dt>
  45412. <dd><p>This determines whether the interlaced frame is taken from the even
  45413. (tff - default) or odd (bff) lines of the progressive frame.
  45414. </p>
  45415. </dd>
  45416. <dt><samp class="option">lowpass</samp></dt>
  45417. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  45418. reduce moire patterns.
  45419. </p>
  45420. <dl class="table">
  45421. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  45422. <dd><p>Disable vertical lowpass filter
  45423. </p>
  45424. </dd>
  45425. <dt>&lsquo;<samp class="samp">1, linear</samp>&rsquo;</dt>
  45426. <dd><p>Enable linear filter (default)
  45427. </p>
  45428. </dd>
  45429. <dt>&lsquo;<samp class="samp">2, complex</samp>&rsquo;</dt>
  45430. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  45431. but better retain detail and subjective sharpness impression.
  45432. </p>
  45433. </dd>
  45434. </dl>
  45435. </dd>
  45436. </dl>
  45437. </div>
  45438. <div class="section-level-extent" id="kerndeint">
  45439. <h3 class="section"><span>39.139 kerndeint<a class="copiable-link" href="#kerndeint"> &para;</a></span></h3>
  45440. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  45441. deinterling. Work on interlaced parts of a video to produce
  45442. progressive frames.
  45443. </p>
  45444. <p>The description of the accepted parameters follows.
  45445. </p>
  45446. <dl class="table">
  45447. <dt><samp class="option">thresh</samp></dt>
  45448. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  45449. determining if a pixel line must be processed. It must be an integer
  45450. in the range [0,255] and defaults to 10. A value of 0 will result in
  45451. applying the process on every pixels.
  45452. </p>
  45453. </dd>
  45454. <dt><samp class="option">map</samp></dt>
  45455. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  45456. Default is 0.
  45457. </p>
  45458. </dd>
  45459. <dt><samp class="option">order</samp></dt>
  45460. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  45461. 0. Default is 0.
  45462. </p>
  45463. </dd>
  45464. <dt><samp class="option">sharp</samp></dt>
  45465. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  45466. </p>
  45467. </dd>
  45468. <dt><samp class="option">twoway</samp></dt>
  45469. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  45470. </p></dd>
  45471. </dl>
  45472. <ul class="mini-toc">
  45473. <li><a href="#Examples-131" accesskey="1">Examples</a></li>
  45474. </ul>
  45475. <div class="subsection-level-extent" id="Examples-131">
  45476. <h4 class="subsection"><span>39.139.1 Examples<a class="copiable-link" href="#Examples-131"> &para;</a></span></h4>
  45477. <ul class="itemize mark-bullet">
  45478. <li>Apply default values:
  45479. <div class="example">
  45480. <pre class="example-preformatted">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  45481. </pre></div>
  45482. </li><li>Enable additional sharpening:
  45483. <div class="example">
  45484. <pre class="example-preformatted">kerndeint=sharp=1
  45485. </pre></div>
  45486. </li><li>Paint processed pixels in white:
  45487. <div class="example">
  45488. <pre class="example-preformatted">kerndeint=map=1
  45489. </pre></div>
  45490. </li></ul>
  45491. </div>
  45492. </div>
  45493. <div class="section-level-extent" id="kirsch">
  45494. <h3 class="section"><span>39.140 kirsch<a class="copiable-link" href="#kirsch"> &para;</a></span></h3>
  45495. <p>Apply kirsch operator to input video stream.
  45496. </p>
  45497. <p>The filter accepts the following option:
  45498. </p>
  45499. <dl class="table">
  45500. <dt><samp class="option">planes</samp></dt>
  45501. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  45502. By default value 0xf, all planes will be processed.
  45503. </p>
  45504. </dd>
  45505. <dt><samp class="option">scale</samp></dt>
  45506. <dd><p>Set value which will be multiplied with filtered result.
  45507. </p>
  45508. </dd>
  45509. <dt><samp class="option">delta</samp></dt>
  45510. <dd><p>Set value which will be added to filtered result.
  45511. </p></dd>
  45512. </dl>
  45513. <ul class="mini-toc">
  45514. <li><a href="#Commands-102" accesskey="1">Commands</a></li>
  45515. </ul>
  45516. <div class="subsection-level-extent" id="Commands-102">
  45517. <h4 class="subsection"><span>39.140.1 Commands<a class="copiable-link" href="#Commands-102"> &para;</a></span></h4>
  45518. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  45519. </p>
  45520. </div>
  45521. </div>
  45522. <div class="section-level-extent" id="lagfun">
  45523. <h3 class="section"><span>39.141 lagfun<a class="copiable-link" href="#lagfun"> &para;</a></span></h3>
  45524. <p>Slowly update darker pixels.
  45525. </p>
  45526. <p>This filter makes short flashes of light appear longer.
  45527. This filter accepts the following options:
  45528. </p>
  45529. <dl class="table">
  45530. <dt><samp class="option">decay</samp></dt>
  45531. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  45532. </p>
  45533. </dd>
  45534. <dt><samp class="option">planes</samp></dt>
  45535. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  45536. </p></dd>
  45537. </dl>
  45538. <ul class="mini-toc">
  45539. <li><a href="#Commands-103" accesskey="1">Commands</a></li>
  45540. </ul>
  45541. <div class="subsection-level-extent" id="Commands-103">
  45542. <h4 class="subsection"><span>39.141.1 Commands<a class="copiable-link" href="#Commands-103"> &para;</a></span></h4>
  45543. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  45544. </p>
  45545. </div>
  45546. </div>
  45547. <div class="section-level-extent" id="lenscorrection">
  45548. <h3 class="section"><span>39.142 lenscorrection<a class="copiable-link" href="#lenscorrection"> &para;</a></span></h3>
  45549. <p>Correct radial lens distortion
  45550. </p>
  45551. <p>This filter can be used to correct for radial distortion as can result from the use
  45552. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  45553. one can use tools available for example as part of opencv or simply trial-and-error.
  45554. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  45555. and extract the k1 and k2 coefficients from the resulting matrix.
  45556. </p>
  45557. <p>Note that effectively the same filter is available in the open-source tools Krita and
  45558. Digikam from the KDE project.
  45559. </p>
  45560. <p>In contrast to the <a class="ref" href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  45561. this filter corrects the distortion of the image, whereas <a class="ref" href="#vignette">vignette</a> corrects the
  45562. brightness distribution, so you may want to use both filters together in certain
  45563. cases, though you will have to take care of ordering, i.e. whether vignetting should
  45564. be applied before or after lens correction.
  45565. </p>
  45566. <ul class="mini-toc">
  45567. <li><a href="#Options-111" accesskey="1">Options</a></li>
  45568. <li><a href="#Commands-104" accesskey="2">Commands</a></li>
  45569. </ul>
  45570. <div class="subsection-level-extent" id="Options-111">
  45571. <h4 class="subsection"><span>39.142.1 Options<a class="copiable-link" href="#Options-111"> &para;</a></span></h4>
  45572. <p>The filter accepts the following options:
  45573. </p>
  45574. <dl class="table">
  45575. <dt><samp class="option">cx</samp></dt>
  45576. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  45577. distortion. This value has a range [0,1] and is expressed as fractions of the image
  45578. width. Default is 0.5.
  45579. </p></dd>
  45580. <dt><samp class="option">cy</samp></dt>
  45581. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  45582. distortion. This value has a range [0,1] and is expressed as fractions of the image
  45583. height. Default is 0.5.
  45584. </p></dd>
  45585. <dt><samp class="option">k1</samp></dt>
  45586. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  45587. no correction. Default is 0.
  45588. </p></dd>
  45589. <dt><samp class="option">k2</samp></dt>
  45590. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  45591. 0 means no correction. Default is 0.
  45592. </p></dd>
  45593. <dt><samp class="option">i</samp></dt>
  45594. <dd><p>Set interpolation type. Can be <code class="code">nearest</code> or <code class="code">bilinear</code>.
  45595. Default is <code class="code">nearest</code>.
  45596. </p></dd>
  45597. <dt><samp class="option">fc</samp></dt>
  45598. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  45599. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  45600. manual</a>. Default color is <code class="code">black@0</code>.
  45601. </p></dd>
  45602. </dl>
  45603. <p>The formula that generates the correction is:
  45604. </p>
  45605. <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)
  45606. </p>
  45607. <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
  45608. distances from the focal point in the source and target images, respectively.
  45609. </p>
  45610. </div>
  45611. <div class="subsection-level-extent" id="Commands-104">
  45612. <h4 class="subsection"><span>39.142.2 Commands<a class="copiable-link" href="#Commands-104"> &para;</a></span></h4>
  45613. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  45614. </p>
  45615. </div>
  45616. </div>
  45617. <div class="section-level-extent" id="lensfun">
  45618. <h3 class="section"><span>39.143 lensfun<a class="copiable-link" href="#lensfun"> &para;</a></span></h3>
  45619. <p>Apply lens correction via the lensfun library (<a class="url" href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  45620. </p>
  45621. <p>The <code class="code">lensfun</code> filter requires the camera make, camera model, and lens model
  45622. to apply the lens correction. The filter will load the lensfun database and
  45623. query it to find the corresponding camera and lens entries in the database. As
  45624. long as these entries can be found with the given options, the filter can
  45625. perform corrections on frames. Note that incomplete strings will result in the
  45626. filter choosing the best match with the given options, and the filter will
  45627. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  45628. provide the make, camera model, and lens model as they are required.
  45629. </p>
  45630. <p>To obtain a list of available makes and models, leave out one or both of <code class="code">make</code> and
  45631. <code class="code">model</code> options. The filter will send the full list to the log with level <code class="code">INFO</code>.
  45632. The first column is the make and the second column is the model.
  45633. To obtain a list of available lenses, set any values for make and model and leave out the
  45634. <code class="code">lens_model</code> option. The filter will send the full list of lenses in the log with level
  45635. <code class="code">INFO</code>. The ffmpeg tool will exit after the list is printed.
  45636. </p>
  45637. <p>The filter accepts the following options:
  45638. </p>
  45639. <dl class="table">
  45640. <dt><samp class="option">make</samp></dt>
  45641. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  45642. </p>
  45643. </dd>
  45644. <dt><samp class="option">model</samp></dt>
  45645. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  45646. required.
  45647. </p>
  45648. </dd>
  45649. <dt><samp class="option">lens_model</samp></dt>
  45650. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  45651. option is required.
  45652. </p>
  45653. </dd>
  45654. <dt><samp class="option">db_path</samp></dt>
  45655. <dd><p>The full path to the lens database folder. If not set, the filter will attempt to
  45656. load the database from the install path when the library was built. Default is unset.
  45657. </p>
  45658. </dd>
  45659. <dt><samp class="option">mode</samp></dt>
  45660. <dd><p>The type of correction to apply. The following values are valid options:
  45661. </p>
  45662. <dl class="table">
  45663. <dt>&lsquo;<samp class="samp">vignetting</samp>&rsquo;</dt>
  45664. <dd><p>Enables fixing lens vignetting.
  45665. </p>
  45666. </dd>
  45667. <dt>&lsquo;<samp class="samp">geometry</samp>&rsquo;</dt>
  45668. <dd><p>Enables fixing lens geometry. This is the default.
  45669. </p>
  45670. </dd>
  45671. <dt>&lsquo;<samp class="samp">subpixel</samp>&rsquo;</dt>
  45672. <dd><p>Enables fixing chromatic aberrations.
  45673. </p>
  45674. </dd>
  45675. <dt>&lsquo;<samp class="samp">vig_geo</samp>&rsquo;</dt>
  45676. <dd><p>Enables fixing lens vignetting and lens geometry.
  45677. </p>
  45678. </dd>
  45679. <dt>&lsquo;<samp class="samp">vig_subpixel</samp>&rsquo;</dt>
  45680. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  45681. </p>
  45682. </dd>
  45683. <dt>&lsquo;<samp class="samp">distortion</samp>&rsquo;</dt>
  45684. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  45685. </p>
  45686. </dd>
  45687. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  45688. <dd><p>Enables all possible corrections.
  45689. </p>
  45690. </dd>
  45691. </dl>
  45692. </dd>
  45693. <dt><samp class="option">focal_length</samp></dt>
  45694. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  45695. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  45696. range should be chosen when using that lens. Default 18.
  45697. </p>
  45698. </dd>
  45699. <dt><samp class="option">aperture</samp></dt>
  45700. <dd><p>The aperture of the image/video (expected constant for video). Note that
  45701. aperture is only used for vignetting correction. Default 3.5.
  45702. </p>
  45703. </dd>
  45704. <dt><samp class="option">focus_distance</samp></dt>
  45705. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  45706. focus distance is only used for vignetting and only slightly affects the
  45707. vignetting correction process. If unknown, leave it at the default value (which
  45708. is 1000).
  45709. </p>
  45710. </dd>
  45711. <dt><samp class="option">scale</samp></dt>
  45712. <dd><p>The scale factor which is applied after transformation. After correction the
  45713. video is no longer necessarily rectangular. This parameter controls how much of
  45714. the resulting image is visible. The value 0 means that a value will be chosen
  45715. automatically such that there is little or no unmapped area in the output
  45716. image. 1.0 means that no additional scaling is done. Lower values may result
  45717. in more of the corrected image being visible, while higher values may avoid
  45718. unmapped areas in the output.
  45719. </p>
  45720. </dd>
  45721. <dt><samp class="option">target_geometry</samp></dt>
  45722. <dd><p>The target geometry of the output image/video. The following values are valid
  45723. options:
  45724. </p>
  45725. <dl class="table">
  45726. <dt>&lsquo;<samp class="samp">rectilinear (default)</samp>&rsquo;</dt>
  45727. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  45728. <dt>&lsquo;<samp class="samp">panoramic</samp>&rsquo;</dt>
  45729. <dt>&lsquo;<samp class="samp">equirectangular</samp>&rsquo;</dt>
  45730. <dt>&lsquo;<samp class="samp">fisheye_orthographic</samp>&rsquo;</dt>
  45731. <dt>&lsquo;<samp class="samp">fisheye_stereographic</samp>&rsquo;</dt>
  45732. <dt>&lsquo;<samp class="samp">fisheye_equisolid</samp>&rsquo;</dt>
  45733. <dt>&lsquo;<samp class="samp">fisheye_thoby</samp>&rsquo;</dt>
  45734. </dl>
  45735. </dd>
  45736. <dt><samp class="option">reverse</samp></dt>
  45737. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  45738. it).
  45739. </p>
  45740. </dd>
  45741. <dt><samp class="option">interpolation</samp></dt>
  45742. <dd><p>The type of interpolation used when correcting distortion. The following values
  45743. are valid options:
  45744. </p>
  45745. <dl class="table">
  45746. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  45747. <dt>&lsquo;<samp class="samp">linear (default)</samp>&rsquo;</dt>
  45748. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  45749. </dl>
  45750. </dd>
  45751. </dl>
  45752. <ul class="mini-toc">
  45753. <li><a href="#Examples-132" accesskey="1">Examples</a></li>
  45754. </ul>
  45755. <div class="subsection-level-extent" id="Examples-132">
  45756. <h4 class="subsection"><span>39.143.1 Examples<a class="copiable-link" href="#Examples-132"> &para;</a></span></h4>
  45757. <ul class="itemize mark-bullet">
  45758. <li>Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  45759. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  45760. aperture of &quot;8.0&quot;.
  45761. <div class="example">
  45762. <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
  45763. </pre></div>
  45764. </li><li>Apply the same as before, but only for the first 5 seconds of video.
  45765. <div class="example">
  45766. <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
  45767. </pre></div>
  45768. </li></ul>
  45769. </div>
  45770. </div>
  45771. <div class="section-level-extent" id="libplacebo">
  45772. <h3 class="section"><span>39.144 libplacebo<a class="copiable-link" href="#libplacebo"> &para;</a></span></h3>
  45773. <p>Flexible GPU-accelerated processing filter based on libplacebo
  45774. (<a class="url" href="https://code.videolan.org/videolan/libplacebo">https://code.videolan.org/videolan/libplacebo</a>).
  45775. </p>
  45776. <ul class="mini-toc">
  45777. <li><a href="#Options-112" accesskey="1">Options</a></li>
  45778. <li><a href="#Commands-105" accesskey="2">Commands</a></li>
  45779. <li><a href="#Examples-133" accesskey="3">Examples</a></li>
  45780. </ul>
  45781. <div class="subsection-level-extent" id="Options-112">
  45782. <h4 class="subsection"><span>39.144.1 Options<a class="copiable-link" href="#Options-112"> &para;</a></span></h4>
  45783. <p>The options for this filter are divided into the following sections:
  45784. </p>
  45785. <ul class="mini-toc">
  45786. <li><a href="#Output-mode" accesskey="1">Output mode</a></li>
  45787. <li><a href="#Scaling" accesskey="2">Scaling</a></li>
  45788. <li><a href="#Debanding" accesskey="3">Debanding</a></li>
  45789. <li><a href="#Color-adjustment" accesskey="4">Color adjustment</a></li>
  45790. <li><a href="#Peak-detection" accesskey="5">Peak detection</a></li>
  45791. <li><a href="#Tone-mapping" accesskey="6">Tone mapping</a></li>
  45792. <li><a href="#Dithering" accesskey="7">Dithering</a></li>
  45793. <li><a href="#Custom-shaders" accesskey="8">Custom shaders</a></li>
  45794. <li><a href="#Debugging-_002f-performance" accesskey="9">Debugging / performance</a></li>
  45795. </ul>
  45796. <div class="subsubsection-level-extent" id="Output-mode">
  45797. <h4 class="subsubsection"><span>39.144.1.1 Output mode<a class="copiable-link" href="#Output-mode"> &para;</a></span></h4>
  45798. <p>These options control the overall output mode. By default, libplacebo will try
  45799. to preserve the source colorimetry and size as best as it can, but it will
  45800. apply any embedded film grain, dolby vision metadata or anamorphic SAR present
  45801. in source frames.
  45802. </p><dl class="table">
  45803. <dt><samp class="option">inputs</samp></dt>
  45804. <dd><p>Set the number of inputs. This can be used, alongside the <code class="code">idx</code> variable,
  45805. to allow placing/blending multiple inputs inside the output frame. This
  45806. effectively enables functionality similar to <a class="ref" href="#hstack">hstack</a>, <a class="ref" href="#overlay">overlay</a>, etc.
  45807. </p>
  45808. </dd>
  45809. <dt><samp class="option">w</samp></dt>
  45810. <dt><samp class="option">h</samp></dt>
  45811. <dd><p>Set the output video dimension expression. Default values are <code class="code">iw</code> and
  45812. <code class="code">ih</code>.
  45813. </p>
  45814. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  45815. </p>
  45816. </dd>
  45817. <dt><samp class="option">crop_x</samp></dt>
  45818. <dt><samp class="option">crop_y</samp></dt>
  45819. <dd><p>Set the input crop x/y expressions, default values are <code class="code">(iw-cw)/2</code> and
  45820. <code class="code">(ih-ch)/2</code>.
  45821. </p>
  45822. </dd>
  45823. <dt><samp class="option">crop_w</samp></dt>
  45824. <dt><samp class="option">crop_h</samp></dt>
  45825. <dd><p>Set the input crop width/height expressions, default values are <code class="code">iw</code> and
  45826. <code class="code">ih</code>.
  45827. </p>
  45828. </dd>
  45829. <dt><samp class="option">pos_x</samp></dt>
  45830. <dt><samp class="option">pos_y</samp></dt>
  45831. <dd><p>Set the output placement x/y expressions, default values are <code class="code">(ow-pw)/2</code>
  45832. and <code class="code">(oh-ph)/2</code>.
  45833. </p>
  45834. </dd>
  45835. <dt><samp class="option">pos_w</samp></dt>
  45836. <dt><samp class="option">pos_h</samp></dt>
  45837. <dd><p>Set the output placement width/height expressions, default values are <code class="code">ow</code>
  45838. and <code class="code">oh</code>.
  45839. </p>
  45840. </dd>
  45841. <dt><samp class="option">fps</samp></dt>
  45842. <dd><p>Set the output frame rate. This can be rational, e.g. <code class="code">60000/1001</code>. If
  45843. set to the special string <code class="code">none</code> (the default), input timestamps will
  45844. instead be passed through to the output unmodified. Otherwise, the input video
  45845. frames will be interpolated as necessary to rescale the video to the specified
  45846. target framerate, in a manner as determined by the <samp class="option">frame_mixer</samp> option.
  45847. </p>
  45848. </dd>
  45849. <dt><samp class="option">format</samp></dt>
  45850. <dd><p>Set the output format override. If unset (the default), frames will be output
  45851. in the same format as the respective input frames. Otherwise, format conversion
  45852. will be performed.
  45853. </p>
  45854. </dd>
  45855. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  45856. <dt><samp class="option">force_divisible_by</samp></dt>
  45857. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  45858. </p>
  45859. </dd>
  45860. <dt><samp class="option">normalize_sar</samp></dt>
  45861. <dd><p>If enabled, output frames will always have a pixel aspect ratio of 1:1. This
  45862. will introduce additional padding/cropping as necessary. If disabled (the
  45863. default), any aspect ratio mismatches, including those from e.g. anamorphic
  45864. video sources, are forwarded to the output pixel aspect ratio.
  45865. </p>
  45866. </dd>
  45867. <dt><samp class="option">pad_crop_ratio</samp></dt>
  45868. <dd><p>Specifies a ratio (between <code class="code">0.0</code> and <code class="code">1.0</code>) between padding and
  45869. cropping when the input aspect ratio does not match the output aspect ratio and
  45870. <samp class="option">normalize_sar</samp> is in effect. The default of <code class="code">0.0</code> always pads the
  45871. content with black borders, while a value of <code class="code">1.0</code> always crops off parts
  45872. of the content. Intermediate values are possible, leading to a mix of the two
  45873. approaches.
  45874. </p>
  45875. </dd>
  45876. <dt><samp class="option">fillcolor</samp></dt>
  45877. <dd><p>Set the color used to fill the output area not covered by the output image, for
  45878. example as a result of <samp class="option">normalize_sar</samp>. For the general syntax of this
  45879. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  45880. manual</a>. Defaults to <code class="code">black</code>.
  45881. </p>
  45882. </dd>
  45883. <dt><samp class="option">corner_rounding</samp></dt>
  45884. <dd><p>Render frames with rounded corners. The value, given as a float ranging from
  45885. <code class="code">0.0</code> to <code class="code">1.0</code>, indicates the relative degree of rounding, from fully
  45886. square to fully circular. In other words, it gives the radius divided by half
  45887. the smaller side length. Defaults to <code class="code">0.0</code>.
  45888. </p>
  45889. </dd>
  45890. <dt><samp class="option">extra_opts</samp></dt>
  45891. <dd><p>Pass extra libplacebo internal configuration options. These can be specified
  45892. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  45893. shows how to configure a custom filter kernel (&quot;EWA LanczosSharp&quot;) and use it
  45894. to double the input image resolution:
  45895. </p>
  45896. <div class="example">
  45897. <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;
  45898. </pre></div>
  45899. </dd>
  45900. <dt><samp class="option">colorspace</samp></dt>
  45901. <dt><samp class="option">color_primaries</samp></dt>
  45902. <dt><samp class="option">color_trc</samp></dt>
  45903. <dt><samp class="option">range</samp></dt>
  45904. <dd><p>Configure the colorspace that output frames will be delivered in. The default
  45905. value of <code class="code">auto</code> outputs frames in the same format as the input frames,
  45906. leading to no change. For any other value, conversion will be performed.
  45907. </p>
  45908. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values.
  45909. </p>
  45910. </dd>
  45911. <dt><samp class="option">apply_filmgrain</samp></dt>
  45912. <dd><p>Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip
  45913. it from the output. Enabled by default.
  45914. </p>
  45915. </dd>
  45916. <dt><samp class="option">apply_dolbyvision</samp></dt>
  45917. <dd><p>Apply Dolby Vision RPU metadata if present in source frames, and strip it from
  45918. the output. Enabled by default. Note that Dolby Vision will always output
  45919. BT.2020+PQ, overriding the usual input frame metadata. These will also be
  45920. picked as the values of <code class="code">auto</code> for the respective frame output options.
  45921. </p></dd>
  45922. </dl>
  45923. <p>In addition to the expression constants documented for the <a class="ref" href="#scale">scale</a> filter,
  45924. 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>,
  45925. <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
  45926. also contain the following constants:
  45927. </p>
  45928. <dl class="table">
  45929. <dt><samp class="option">in_idx, idx</samp></dt>
  45930. <dd><p>The (0-based) numeric index of the currently active input stream.
  45931. </p></dd>
  45932. <dt><samp class="option">crop_w, cw</samp></dt>
  45933. <dt><samp class="option">crop_h, ch</samp></dt>
  45934. <dd><p>The computed values of <samp class="option">crop_w</samp> and <samp class="option">crop_h</samp>.
  45935. </p>
  45936. </dd>
  45937. <dt><samp class="option">pos_w, pw</samp></dt>
  45938. <dt><samp class="option">pos_h, ph</samp></dt>
  45939. <dd><p>The computed values of <samp class="option">pos_w</samp> and <samp class="option">pos_h</samp>.
  45940. </p>
  45941. </dd>
  45942. <dt><samp class="option">in_t, t</samp></dt>
  45943. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  45944. </p>
  45945. </dd>
  45946. <dt><samp class="option">out_t, ot</samp></dt>
  45947. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  45948. </p>
  45949. </dd>
  45950. <dt><samp class="option">n</samp></dt>
  45951. <dd><p>The input frame number, starting with 0.
  45952. </p></dd>
  45953. </dl>
  45954. </div>
  45955. <div class="subsubsection-level-extent" id="Scaling">
  45956. <h4 class="subsubsection"><span>39.144.1.2 Scaling<a class="copiable-link" href="#Scaling"> &para;</a></span></h4>
  45957. <p>The options in this section control how libplacebo performs upscaling and (if
  45958. necessary) downscaling. Note that libplacebo will always internally operate on
  45959. 4:4:4 content, so any sub-sampled chroma formats such as <code class="code">yuv420p</code> will
  45960. necessarily be upsampled and downsampled as part of the rendering process. That
  45961. means scaling might be in effect even if the source and destination resolution
  45962. are the same.
  45963. </p><dl class="table">
  45964. <dt><samp class="option">upscaler</samp></dt>
  45965. <dt><samp class="option">downscaler</samp></dt>
  45966. <dd><p>Configure the filter kernel used for upscaling and downscaling. The respective
  45967. defaults are <code class="code">spline36</code> and <code class="code">mitchell</code>. For a full list of possible
  45968. values, pass <code class="code">help</code> to these options. The most important values are:
  45969. </p><dl class="table">
  45970. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  45971. <dd><p>Forces the use of built-in GPU texture sampling (typically bilinear). Extremely
  45972. fast but poor quality, especially when downscaling.
  45973. </p>
  45974. </dd>
  45975. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  45976. <dd><p>Bilinear interpolation. Can generally be done for free on GPUs, except when
  45977. doing so would lead to aliasing. Fast and low quality.
  45978. </p>
  45979. </dd>
  45980. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  45981. <dd><p>Nearest-neighbour interpolation. Sharp but highly aliasing.
  45982. </p>
  45983. </dd>
  45984. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  45985. <dd><p>Algorithm that looks visually similar to nearest-neighbour interpolation but
  45986. tries to preserve pixel aspect ratio. Good for pixel art, since it results in
  45987. minimal distortion of the artistic appearance.
  45988. </p>
  45989. </dd>
  45990. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  45991. <dd><p>Standard sinc-sinc interpolation kernel.
  45992. </p>
  45993. </dd>
  45994. <dt>&lsquo;<samp class="samp">spline36</samp>&rsquo;</dt>
  45995. <dd><p>Cubic spline approximation of lanczos. No difference in performance, but has
  45996. very slightly less ringing.
  45997. </p>
  45998. </dd>
  45999. <dt>&lsquo;<samp class="samp">ewa_lanczos</samp>&rsquo;</dt>
  46000. <dd><p>Elliptically weighted average version of lanczos, based on a jinc-sinc kernel.
  46001. This is also popularly referred to as just &quot;Jinc scaling&quot;. Slow but very high
  46002. quality.
  46003. </p>
  46004. </dd>
  46005. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  46006. <dd><p>Gaussian kernel. Has certain ideal mathematical properties, but subjectively
  46007. very blurry.
  46008. </p>
  46009. </dd>
  46010. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  46011. <dd><p>Cubic BC spline with parameters recommended by Mitchell and Netravali. Very
  46012. little ringing.
  46013. </p></dd>
  46014. </dl>
  46015. </dd>
  46016. <dt><samp class="option">frame_mixer</samp></dt>
  46017. <dd><p>Controls the kernel used for mixing frames temporally. The default value is
  46018. <code class="code">none</code>, which disables frame mixing. For a full list of possible values,
  46019. pass <code class="code">help</code> to this option. The most important values are:
  46020. </p><dl class="table">
  46021. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  46022. <dd><p>Disables frame mixing, giving a result equivalent to &quot;nearest neighbour&quot;
  46023. semantics.
  46024. </p>
  46025. </dd>
  46026. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  46027. <dd><p>Oversamples the input video to create a &quot;Smooth Motion&quot;-type effect: if an
  46028. output frame would exactly fall on the transition between two video frames, it
  46029. is blended according to the relative overlap. This is the recommended option
  46030. whenever preserving the original subjective appearance is desired.
  46031. </p>
  46032. </dd>
  46033. <dt>&lsquo;<samp class="samp">mitchell_clamp</samp>&rsquo;</dt>
  46034. <dd><p>Larger filter kernel that smoothly interpolates multiple frames in a manner
  46035. designed to eliminate ringing and other artefacts as much as possible. This is
  46036. the recommended option wherever maximum visual smoothness is desired.
  46037. </p>
  46038. </dd>
  46039. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  46040. <dd><p>Linear blend/fade between frames. Especially useful for constructing e.g.
  46041. slideshows.
  46042. </p></dd>
  46043. </dl>
  46044. </dd>
  46045. <dt><samp class="option">lut_entries</samp></dt>
  46046. <dd><p>Configures the size of scaler LUTs, ranging from <code class="code">1</code> to <code class="code">256</code>. The
  46047. default of <code class="code">0</code> will pick libplacebo&rsquo;s internal default, typically
  46048. <code class="code">64</code>.
  46049. </p>
  46050. </dd>
  46051. <dt><samp class="option">antiringing</samp></dt>
  46052. <dd><p>Enables anti-ringing (for non-EWA filters). The value (between <code class="code">0.0</code> and
  46053. <code class="code">1.0</code>) configures the strength of the anti-ringing algorithm. May increase
  46054. aliasing if set too high. Disabled by default.
  46055. </p>
  46056. </dd>
  46057. <dt><samp class="option">sigmoid</samp></dt>
  46058. <dd><p>Enable sigmoidal compression during upscaling. Reduces ringing slightly.
  46059. Enabled by default.
  46060. </p></dd>
  46061. </dl>
  46062. </div>
  46063. <div class="subsubsection-level-extent" id="Debanding">
  46064. <h4 class="subsubsection"><span>39.144.1.3 Debanding<a class="copiable-link" href="#Debanding"> &para;</a></span></h4>
  46065. <p>Libplacebo comes with a built-in debanding filter that is good at counteracting
  46066. many common sources of banding and blocking. Turning this on is highly
  46067. recommended whenever quality is desired.
  46068. </p><dl class="table">
  46069. <dt><samp class="option">deband</samp></dt>
  46070. <dd><p>Enable (fast) debanding algorithm. Disabled by default.
  46071. </p>
  46072. </dd>
  46073. <dt><samp class="option">deband_iterations</samp></dt>
  46074. <dd><p>Number of deband iterations of the debanding algorithm. Each iteration is
  46075. performed with progressively increased radius (and diminished threshold).
  46076. Recommended values are in the range <code class="code">1</code> to <code class="code">4</code>. Defaults to <code class="code">1</code>.
  46077. </p>
  46078. </dd>
  46079. <dt><samp class="option">deband_threshold</samp></dt>
  46080. <dd><p>Debanding filter strength. Higher numbers lead to more aggressive debanding.
  46081. Defaults to <code class="code">4.0</code>.
  46082. </p>
  46083. </dd>
  46084. <dt><samp class="option">deband_radius</samp></dt>
  46085. <dd><p>Debanding filter radius. A higher radius is better for slow gradients, while
  46086. a lower radius is better for steep gradients. Defaults to <code class="code">16.0</code>.
  46087. </p>
  46088. </dd>
  46089. <dt><samp class="option">deband_grain</samp></dt>
  46090. <dd><p>Amount of extra output grain to add. Helps hide imperfections. Defaults to
  46091. <code class="code">6.0</code>.
  46092. </p></dd>
  46093. </dl>
  46094. </div>
  46095. <div class="subsubsection-level-extent" id="Color-adjustment">
  46096. <h4 class="subsubsection"><span>39.144.1.4 Color adjustment<a class="copiable-link" href="#Color-adjustment"> &para;</a></span></h4>
  46097. <p>A collection of subjective color controls. Not very rigorous, so the exact
  46098. effect will vary somewhat depending on the input primaries and colorspace.
  46099. </p><dl class="table">
  46100. <dt><samp class="option">brightness</samp></dt>
  46101. <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>.
  46102. </p>
  46103. </dd>
  46104. <dt><samp class="option">contrast</samp></dt>
  46105. <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>.
  46106. </p>
  46107. </dd>
  46108. <dt><samp class="option">saturation</samp></dt>
  46109. <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>.
  46110. </p>
  46111. </dd>
  46112. <dt><samp class="option">hue</samp></dt>
  46113. <dd><p>Hue shift in radians, between <code class="code">-3.14</code> and <code class="code">3.14</code>. Defaults to
  46114. <code class="code">0.0</code>. This will rotate the UV subvector, defaulting to BT.709
  46115. coefficients for RGB inputs.
  46116. </p>
  46117. </dd>
  46118. <dt><samp class="option">gamma</samp></dt>
  46119. <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>.
  46120. </p>
  46121. </dd>
  46122. <dt><samp class="option">cones</samp></dt>
  46123. <dd><p>Cone model to use for color blindness simulation. Accepts any combination of
  46124. <code class="code">l</code>, <code class="code">m</code> and <code class="code">s</code>. Here are some examples:
  46125. </p><dl class="table">
  46126. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  46127. <dd><p>Deuteranomaly / deuteranopia (affecting 3%-4% of the population)
  46128. </p></dd>
  46129. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  46130. <dd><p>Protanomaly / protanopia (affecting 1%-2% of the population)
  46131. </p></dd>
  46132. <dt>&lsquo;<samp class="samp">l+m</samp>&rsquo;</dt>
  46133. <dd><p>Monochromacy (very rare)
  46134. </p></dd>
  46135. <dt>&lsquo;<samp class="samp">l+m+s</samp>&rsquo;</dt>
  46136. <dd><p>Achromatopsy (complete loss of daytime vision, extremely rare)
  46137. </p></dd>
  46138. </dl>
  46139. </dd>
  46140. <dt><samp class="option">cone-strength</samp></dt>
  46141. <dd><p>Gain factor for the cones specified by <code class="code">cones</code>, between <code class="code">0.0</code> and
  46142. <code class="code">10.0</code>. A value of <code class="code">1.0</code> results in no change to color vision. A
  46143. value of <code class="code">0.0</code> (the default) simulates complete loss of those cones. Values
  46144. above <code class="code">1.0</code> result in exaggerating the differences between cones, which
  46145. may help compensate for reduced color vision.
  46146. </p></dd>
  46147. </dl>
  46148. </div>
  46149. <div class="subsubsection-level-extent" id="Peak-detection">
  46150. <h4 class="subsubsection"><span>39.144.1.5 Peak detection<a class="copiable-link" href="#Peak-detection"> &para;</a></span></h4>
  46151. <p>To help deal with sources that only have static HDR10 metadata (or no tagging
  46152. whatsoever), libplacebo uses its own internal frame analysis compute shader to
  46153. analyze source frames and adapt the tone mapping function in realtime. If this
  46154. is too slow, or if exactly reproducible frame-perfect results are needed, it&rsquo;s
  46155. recommended to turn this feature off.
  46156. </p><dl class="table">
  46157. <dt><samp class="option">peak_detect</samp></dt>
  46158. <dd><p>Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of
  46159. dynamic detection from the input. Note that the detected values do not get
  46160. written back to the output frames, they merely guide the internal tone mapping
  46161. process. Enabled by default.
  46162. </p>
  46163. </dd>
  46164. <dt><samp class="option">smoothing_period</samp></dt>
  46165. <dd><p>Peak detection smoothing period, between <code class="code">0.0</code> and <code class="code">1000.0</code>. Higher
  46166. values result in peak detection becoming less responsive to changes in the
  46167. input. Defaults to <code class="code">100.0</code>.
  46168. </p>
  46169. </dd>
  46170. <dt><samp class="option">minimum_peak</samp></dt>
  46171. <dd><p>Lower bound on the detected peak (relative to SDR white), between <code class="code">0.0</code>
  46172. and <code class="code">100.0</code>. Defaults to <code class="code">1.0</code>.
  46173. </p>
  46174. </dd>
  46175. <dt><samp class="option">scene_threshold_low</samp></dt>
  46176. <dt><samp class="option">scene_threshold_high</samp></dt>
  46177. <dd><p>Lower and upper thresholds for scene change detection. Expressed in a
  46178. logarithmic scale between <code class="code">0.0</code> and <code class="code">100.0</code>. Default to <code class="code">5.5</code>
  46179. and <code class="code">10.0</code>, respectively. Setting either to a negative value disables
  46180. this functionality.
  46181. </p>
  46182. </dd>
  46183. <dt><samp class="option">percentile</samp></dt>
  46184. <dd><p>Which percentile of the frame brightness histogram to use as the source peak
  46185. for tone-mapping. Defaults to <code class="code">99.995</code>, a fairly conservative value.
  46186. Setting this to <code class="code">100.0</code> disables frame histogram measurement and instead
  46187. uses the true peak brightness for tone-mapping.
  46188. </p></dd>
  46189. </dl>
  46190. </div>
  46191. <div class="subsubsection-level-extent" id="Tone-mapping">
  46192. <h4 class="subsubsection"><span>39.144.1.6 Tone mapping<a class="copiable-link" href="#Tone-mapping"> &para;</a></span></h4>
  46193. <p>The options in this section control how libplacebo performs tone-mapping and
  46194. gamut-mapping when dealing with mismatches between wide-gamut or HDR content.
  46195. In general, libplacebo relies on accurate source tagging and mastering display
  46196. gamut information to produce the best results.
  46197. </p><dl class="table">
  46198. <dt><samp class="option">gamut_mode</samp></dt>
  46199. <dd><p>How to handle out-of-gamut colors that can occur as a result of colorimetric
  46200. gamut mapping.
  46201. </p><dl class="table">
  46202. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  46203. <dd><p>Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but
  46204. extremely fast.
  46205. </p></dd>
  46206. <dt>&lsquo;<samp class="samp">perceptual</samp>&rsquo;</dt>
  46207. <dd><p>Perceptually soft-clip colors to the gamut volume. This is the default.
  46208. </p></dd>
  46209. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  46210. <dd><p>Relative colorimetric hard-clip. Similar to <code class="code">perceptual</code> but without
  46211. the soft knee.
  46212. </p></dd>
  46213. <dt>&lsquo;<samp class="samp">saturation</samp>&rsquo;</dt>
  46214. <dd><p>Saturation mapping, maps primaries directly to primaries in RGB space.
  46215. Not recommended except for artificial computer graphics for which a bright,
  46216. saturated display is desired.
  46217. </p></dd>
  46218. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  46219. <dd><p>Absolute colorimetric hard-clip. Performs no adjustment of the white point.
  46220. </p></dd>
  46221. <dt>&lsquo;<samp class="samp">desaturate</samp>&rsquo;</dt>
  46222. <dd><p>Hard-desaturates out-of-gamut colors towards white, while preserving the
  46223. luminance. Has a tendency to distort the visual appearance of bright objects.
  46224. </p></dd>
  46225. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  46226. <dd><p>Linearly reduces content brightness to preserves saturated details, followed by
  46227. clipping the remaining out-of-gamut colors.
  46228. </p></dd>
  46229. <dt>&lsquo;<samp class="samp">warn</samp>&rsquo;</dt>
  46230. <dd><p>Highlight out-of-gamut pixels (by inverting/marking them).
  46231. </p></dd>
  46232. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  46233. <dd><p>Linearly reduces chromaticity of the entire image to make it fit within the
  46234. target color volume. Be careful when using this on BT.2020 sources without
  46235. proper mastering metadata, as doing so will lead to excessive desaturation.
  46236. </p></dd>
  46237. </dl>
  46238. </dd>
  46239. <dt><samp class="option">tonemapping</samp></dt>
  46240. <dd><p>Tone-mapping algorithm to use. Available values are:
  46241. </p><dl class="table">
  46242. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  46243. <dd><p>Automatic selection based on internal heuristics. This is the default.
  46244. </p></dd>
  46245. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  46246. <dd><p>Performs no tone-mapping, just clips out-of-range colors. Retains perfect color
  46247. accuracy for in-range colors but completely destroys out-of-range information.
  46248. Does not perform any black point adaptation. Not configurable.
  46249. </p></dd>
  46250. <dt>&lsquo;<samp class="samp">st2094-40</samp>&rsquo;</dt>
  46251. <dd><p>EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+
  46252. dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used
  46253. is adjusted based on the ratio between the targeted and actual display peak
  46254. luminances.
  46255. </p></dd>
  46256. <dt>&lsquo;<samp class="samp">st2094-10</samp>&rsquo;</dt>
  46257. <dd><p>EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal
  46258. average luminance in addition to the maximum/minimum. The configurable contrast
  46259. parameter influences the slope of the linear output segment, defaulting to
  46260. <code class="code">1.0</code> for no increase/decrease in contrast. Note that this does not
  46261. currently include the subjective gain/offset/gamma controls defined in Annex
  46262. B.3.
  46263. </p></dd>
  46264. <dt>&lsquo;<samp class="samp">bt.2390</samp>&rsquo;</dt>
  46265. <dd><p>EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear
  46266. segment. The knee point offset is configurable. Note that this parameter
  46267. defaults to <code class="code">1.0</code>, rather than the value of <code class="code">0.5</code> from the ITU-R
  46268. spec.
  46269. </p></dd>
  46270. <dt>&lsquo;<samp class="samp">bt.2446a</samp>&rsquo;</dt>
  46271. <dd><p>EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR
  46272. sources. Can be used for both forward and inverse tone mapping. Not
  46273. configurable.
  46274. </p></dd>
  46275. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  46276. <dd><p>Simple spline consisting of two polynomials, joined by a single pivot point.
  46277. The parameter gives the pivot point (in PQ space), defaulting to <code class="code">0.30</code>.
  46278. Can be used for both forward and inverse tone mapping.
  46279. </p></dd>
  46280. <dt>&lsquo;<samp class="samp">reinhard</samp>&rsquo;</dt>
  46281. <dd><p>Simple non-linear, global tone mapping algorithm. The parameter specifies the
  46282. local contrast coefficient at the display peak. Essentially, a parameter of
  46283. <code class="code">0.5</code> implies that the reference white will be about half as bright as
  46284. when clipping. Defaults to <code class="code">0.5</code>, which results in the simplest
  46285. formulation of this function.
  46286. </p></dd>
  46287. <dt>&lsquo;<samp class="samp">mobius</samp>&rsquo;</dt>
  46288. <dd><p>Generalization of the reinhard tone mapping algorithm to support an additional
  46289. linear slope near black. The tone mapping parameter indicates the trade-off
  46290. between the linear section and the non-linear section. Essentially, for a given
  46291. parameter <var class="var">x</var>, every color value below <var class="var">x</var> will be mapped linearly,
  46292. while higher values get non-linearly tone-mapped. Values near <code class="code">1.0</code> make
  46293. this curve behave like <code class="code">clip</code>, while values near <code class="code">0.0</code> make this
  46294. curve behave like <code class="code">reinhard</code>. The default value is <code class="code">0.3</code>, which
  46295. provides a good balance between colorimetric accuracy and preserving
  46296. out-of-gamut details.
  46297. </p></dd>
  46298. <dt>&lsquo;<samp class="samp">hable</samp>&rsquo;</dt>
  46299. <dd><p>Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in
  46300. Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak.
  46301. Popularized by its use in video games with HDR rendering. Preserves both dark
  46302. and bright details very well, but comes with the drawback of changing the
  46303. average brightness quite significantly. This is sort of similar to
  46304. <code class="code">reinhard</code> with parameter <code class="code">0.24</code>.
  46305. </p></dd>
  46306. <dt>&lsquo;<samp class="samp">gamma</samp>&rsquo;</dt>
  46307. <dd><p>Fits a gamma (power) function to transfer between the source and target color
  46308. spaces, effectively resulting in a perceptual hard-knee joining two roughly
  46309. linear sections. This preserves details at all scales fairly accurately, but
  46310. can result in an image with a muted or dull appearance. The parameter is used
  46311. as the cutoff point, defaulting to <code class="code">0.5</code>.
  46312. </p></dd>
  46313. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  46314. <dd><p>Linearly stretches the input range to the output range, in PQ space. This will
  46315. preserve all details accurately, but results in a significantly different
  46316. average brightness. Can be used for inverse tone-mapping in addition to regular
  46317. tone-mapping. The parameter can be used as an additional linear gain
  46318. coefficient (defaulting to <code class="code">1.0</code>).
  46319. </p></dd>
  46320. </dl>
  46321. </dd>
  46322. <dt><samp class="option">tonemapping_param</samp></dt>
  46323. <dd><p>For tunable tone mapping functions, this parameter can be used to fine-tune the
  46324. curve behavior. Refer to the documentation of <code class="code">tonemapping</code>. The default
  46325. value of <code class="code">0.0</code> is replaced by the curve&rsquo;s preferred default setting.
  46326. </p>
  46327. </dd>
  46328. <dt><samp class="option">inverse_tonemapping</samp></dt>
  46329. <dd><p>If enabled, this filter will also attempt stretching SDR signals to fill HDR
  46330. output color volumes. Disabled by default.
  46331. </p>
  46332. </dd>
  46333. <dt><samp class="option">tonemapping_lut_size</samp></dt>
  46334. <dd><p>Size of the tone-mapping LUT, between <code class="code">2</code> and <code class="code">1024</code>. Defaults to
  46335. <code class="code">256</code>. Note that this figure is squared when combined with
  46336. <code class="code">peak_detect</code>.
  46337. </p>
  46338. </dd>
  46339. <dt><samp class="option">contrast_recovery</samp></dt>
  46340. <dd><p>Contrast recovery strength. If set to a value above <code class="code">0.0</code>, the source
  46341. image will be divided into high-frequency and low-frequency components, and a
  46342. portion of the high-frequency image is added back onto the tone-mapped output.
  46343. May cause excessive ringing artifacts for some HDR sources, but can improve the
  46344. subjective sharpness and detail left over in the image after tone-mapping.
  46345. Defaults to <code class="code">0.30</code>.
  46346. </p>
  46347. </dd>
  46348. <dt><samp class="option">contrast_smoothness</samp></dt>
  46349. <dd><p>Contrast recovery lowpass kernel size. Defaults to <code class="code">3.5</code>. Increasing or
  46350. decreasing this will affect the visual appearance substantially. Has no effect
  46351. when <code class="code">contrast_recovery</code> is disabled.
  46352. </p></dd>
  46353. </dl>
  46354. </div>
  46355. <div class="subsubsection-level-extent" id="Dithering">
  46356. <h4 class="subsubsection"><span>39.144.1.7 Dithering<a class="copiable-link" href="#Dithering"> &para;</a></span></h4>
  46357. <p>By default, libplacebo will dither whenever necessary, which includes rendering
  46358. to any integer format below 16-bit precision. It&rsquo;s recommended to always leave
  46359. this on, since not doing so may result in visible banding in the output, even
  46360. if the <code class="code">debanding</code> filter is enabled. If maximum performance is needed,
  46361. use <code class="code">ordered_fixed</code> instead of disabling dithering.
  46362. </p><dl class="table">
  46363. <dt><samp class="option">dithering</samp></dt>
  46364. <dd><p>Dithering method to use. Accepts the following values:
  46365. </p><dl class="table">
  46366. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  46367. <dd><p>Disables dithering completely. May result in visible banding.
  46368. </p></dd>
  46369. <dt>&lsquo;<samp class="samp">blue</samp>&rsquo;</dt>
  46370. <dd><p>Dither with pseudo-blue noise. This is the default.
  46371. </p></dd>
  46372. <dt>&lsquo;<samp class="samp">ordered</samp>&rsquo;</dt>
  46373. <dd><p>Tunable ordered dither pattern.
  46374. </p></dd>
  46375. <dt>&lsquo;<samp class="samp">ordered_fixed</samp>&rsquo;</dt>
  46376. <dd><p>Faster ordered dither with a fixed size of <code class="code">6</code>. Texture-less.
  46377. </p></dd>
  46378. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  46379. <dd><p>Dither with white noise. Texture-less.
  46380. </p></dd>
  46381. </dl>
  46382. </dd>
  46383. <dt><samp class="option">dither_lut_size</samp></dt>
  46384. <dd><p>Dither LUT size, as log base2 between <code class="code">1</code> and <code class="code">8</code>. Defaults to
  46385. <code class="code">6</code>, corresponding to a LUT size of <code class="code">64x64</code>.
  46386. </p>
  46387. </dd>
  46388. <dt><samp class="option">dither_temporal</samp></dt>
  46389. <dd><p>Enables temporal dithering. Disabled by default.
  46390. </p></dd>
  46391. </dl>
  46392. </div>
  46393. <div class="subsubsection-level-extent" id="Custom-shaders">
  46394. <h4 class="subsubsection"><span>39.144.1.8 Custom shaders<a class="copiable-link" href="#Custom-shaders"> &para;</a></span></h4>
  46395. <p>libplacebo supports a number of custom shaders based on the mpv .hook GLSL
  46396. syntax. A collection of such shaders can be found here:
  46397. <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>
  46398. </p>
  46399. <p>A full description of the mpv shader format is beyond the scope of this
  46400. section, but a summary can be found here:
  46401. <a class="url" href="https://mpv.io/manual/master/#options-glsl-shader">https://mpv.io/manual/master/#options-glsl-shader</a>
  46402. </p><dl class="table">
  46403. <dt><samp class="option">custom_shader_path</samp></dt>
  46404. <dd><p>Specifies a path to a custom shader file to load at runtime.
  46405. </p>
  46406. </dd>
  46407. <dt><samp class="option">custom_shader_bin</samp></dt>
  46408. <dd><p>Specifies a complete custom shader as a raw string.
  46409. </p></dd>
  46410. </dl>
  46411. </div>
  46412. <div class="subsubsection-level-extent" id="Debugging-_002f-performance">
  46413. <h4 class="subsubsection"><span>39.144.1.9 Debugging / performance<a class="copiable-link" href="#Debugging-_002f-performance"> &para;</a></span></h4>
  46414. <p>All of the options in this section default off. They may be of assistance when
  46415. attempting to squeeze the maximum performance at the cost of quality.
  46416. </p><dl class="table">
  46417. <dt><samp class="option">skip_aa</samp></dt>
  46418. <dd><p>Disable anti-aliasing when downscaling.
  46419. </p>
  46420. </dd>
  46421. <dt><samp class="option">polar_cutoff</samp></dt>
  46422. <dd><p>Truncate polar (EWA) scaler kernels below this absolute magnitude, between
  46423. <code class="code">0.0</code> and <code class="code">1.0</code>.
  46424. </p>
  46425. </dd>
  46426. <dt><samp class="option">disable_linear</samp></dt>
  46427. <dd><p>Disable linear light scaling.
  46428. </p>
  46429. </dd>
  46430. <dt><samp class="option">disable_builtin</samp></dt>
  46431. <dd><p>Disable built-in GPU sampling (forces LUT).
  46432. </p>
  46433. </dd>
  46434. <dt><samp class="option">disable_fbos</samp></dt>
  46435. <dd><p>Forcibly disable FBOs, resulting in loss of almost all functionality, but
  46436. offering the maximum possible speed.
  46437. </p></dd>
  46438. </dl>
  46439. </div>
  46440. </div>
  46441. <div class="subsection-level-extent" id="Commands-105">
  46442. <h4 class="subsection"><span>39.144.2 Commands<a class="copiable-link" href="#Commands-105"> &para;</a></span></h4>
  46443. <p>This filter supports almost all of the above options as <a class="ref" href="#commands">commands</a>.
  46444. </p>
  46445. </div>
  46446. <div class="subsection-level-extent" id="Examples-133">
  46447. <h4 class="subsection"><span>39.144.3 Examples<a class="copiable-link" href="#Examples-133"> &para;</a></span></h4>
  46448. <ul class="itemize mark-bullet">
  46449. <li>Tone-map input to standard gamut BT.709 output:
  46450. <div class="example">
  46451. <pre class="example-preformatted">libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
  46452. </pre></div>
  46453. </li><li>Rescale input to fit into standard 1080p, with high quality scaling:
  46454. <div class="example">
  46455. <pre class="example-preformatted">libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
  46456. </pre></div>
  46457. </li><li>Interpolate low FPS / VFR input to smoothed constant 60 fps output:
  46458. <div class="example">
  46459. <pre class="example-preformatted">libplacebo=fps=60:frame_mixer=mitchell_clamp
  46460. </pre></div>
  46461. </li><li>Convert input to standard sRGB JPEG:
  46462. <div class="example">
  46463. <pre class="example-preformatted">libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
  46464. </pre></div>
  46465. </li><li>Use higher quality debanding settings:
  46466. <div class="example">
  46467. <pre class="example-preformatted">libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
  46468. </pre></div>
  46469. </li><li>Run this filter on the CPU, on systems with Mesa installed (and with the most
  46470. expensive options disabled):
  46471. <div class="example">
  46472. <pre class="example-preformatted">ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
  46473. </pre></div>
  46474. </li><li>Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of
  46475. doing it with this filter. Note that this is only a gain if the frames are
  46476. either already on the GPU, or if you&rsquo;re using libplacebo for other purposes,
  46477. since otherwise the VRAM roundtrip will more than offset any expected speedup.
  46478. <div class="example">
  46479. <pre class="example-preformatted">ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
  46480. </pre></div>
  46481. </li><li>Interop with VAAPI hwdec to avoid round-tripping through RAM:
  46482. <div class="example">
  46483. <pre class="example-preformatted">ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
  46484. </pre></div>
  46485. </li></ul>
  46486. <a class="anchor" id="libvmaf"></a></div>
  46487. </div>
  46488. <div class="section-level-extent" id="libvmaf-1">
  46489. <h3 class="section"><span>39.145 libvmaf<a class="copiable-link" href="#libvmaf-1"> &para;</a></span></h3>
  46490. <p>Calculate the VMAF (Video Multi-Method Assessment Fusion) score for a
  46491. reference/distorted pair of input videos.
  46492. </p>
  46493. <p>The first input is the distorted video, and the second input is the reference video.
  46494. </p>
  46495. <p>The obtained VMAF score is printed through the logging system.
  46496. </p>
  46497. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  46498. After installing the library it can be enabled using:
  46499. <code class="code">./configure --enable-libvmaf</code>.
  46500. </p>
  46501. <p>The filter has following options:
  46502. </p>
  46503. <dl class="table">
  46504. <dt><samp class="option">model</samp></dt>
  46505. <dd><p>A &lsquo;|&lsquo; delimited list of vmaf models. Each model can be configured with a number of parameters.
  46506. Default value: <code class="code">&quot;version=vmaf_v0.6.1&quot;</code>
  46507. </p>
  46508. </dd>
  46509. <dt><samp class="option">feature</samp></dt>
  46510. <dd><p>A &lsquo;|&lsquo; delimited list of features. Each feature can be configured with a number of parameters.
  46511. </p>
  46512. </dd>
  46513. <dt><samp class="option">log_path</samp></dt>
  46514. <dd><p>Set the file path to be used to store log files.
  46515. </p>
  46516. </dd>
  46517. <dt><samp class="option">log_fmt</samp></dt>
  46518. <dd><p>Set the format of the log file (xml, json, csv, or sub).
  46519. </p>
  46520. </dd>
  46521. <dt><samp class="option">pool</samp></dt>
  46522. <dd><p>Set the pool method to be used for computing vmaf.
  46523. Options are <code class="code">min</code>, <code class="code">harmonic_mean</code> or <code class="code">mean</code> (default).
  46524. </p>
  46525. </dd>
  46526. <dt><samp class="option">n_threads</samp></dt>
  46527. <dd><p>Set number of threads to be used when initializing libvmaf.
  46528. Default value: <code class="code">0</code>, no threads.
  46529. </p>
  46530. </dd>
  46531. <dt><samp class="option">n_subsample</samp></dt>
  46532. <dd><p>Set frame subsampling interval to be used.
  46533. </p></dd>
  46534. </dl>
  46535. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  46536. </p>
  46537. <ul class="mini-toc">
  46538. <li><a href="#Examples-134" accesskey="1">Examples</a></li>
  46539. </ul>
  46540. <div class="subsection-level-extent" id="Examples-134">
  46541. <h4 class="subsection"><span>39.145.1 Examples<a class="copiable-link" href="#Examples-134"> &para;</a></span></h4>
  46542. <ul class="itemize mark-bullet">
  46543. <li>In the examples below, a distorted video <samp class="file">distorted.mpg</samp> is
  46544. compared with a reference file <samp class="file">reference.mpg</samp>.
  46545. </li><li>Basic usage:
  46546. <div class="example">
  46547. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
  46548. </pre></div>
  46549. </li><li>Example with multiple models:
  46550. <div class="example">
  46551. <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 -
  46552. </pre></div>
  46553. </li><li>Example with multiple additional features:
  46554. <div class="example">
  46555. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
  46556. </pre></div>
  46557. </li><li>Example with options and different containers:
  46558. <div class="example">
  46559. <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 -
  46560. </pre></div>
  46561. </li></ul>
  46562. </div>
  46563. </div>
  46564. <div class="section-level-extent" id="libvmaf_005fcuda">
  46565. <h3 class="section"><span>39.146 libvmaf_cuda<a class="copiable-link" href="#libvmaf_005fcuda"> &para;</a></span></h3>
  46566. <p>This is the CUDA variant of the <a class="ref" href="#libvmaf">libvmaf</a> filter. It only accepts CUDA frames.
  46567. </p>
  46568. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  46569. After installing the library it can be enabled using:
  46570. <code class="code">./configure --enable-nonfree --enable-ffnvcodec --enable-libvmaf</code>.
  46571. </p>
  46572. <ul class="mini-toc">
  46573. <li><a href="#Examples-135" accesskey="1">Examples</a></li>
  46574. </ul>
  46575. <div class="subsection-level-extent" id="Examples-135">
  46576. <h4 class="subsection"><span>39.146.1 Examples<a class="copiable-link" href="#Examples-135"> &para;</a></span></h4>
  46577. <ul class="itemize mark-bullet">
  46578. <li>Basic usage showing CUVID hardware decoding and CUDA scaling with <a class="ref" href="#scale_005fcuda">scale_cuda</a>:
  46579. <div class="example">
  46580. <pre class="example-preformatted">ffmpeg \
  46581. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i dis.obu \
  46582. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i ref.obu \
  46583. -filter_complex &quot;
  46584. [0:v]scale_cuda=format=yuv420p[ref]; \
  46585. [1:v]scale_cuda=format=yuv420p[dis]; \
  46586. [dis][ref]libvmaf_cuda=log_fmt=json:log_path=output.json
  46587. &quot; \
  46588. -f null -
  46589. </pre></div>
  46590. </li></ul>
  46591. </div>
  46592. </div>
  46593. <div class="section-level-extent" id="limitdiff">
  46594. <h3 class="section"><span>39.147 limitdiff<a class="copiable-link" href="#limitdiff"> &para;</a></span></h3>
  46595. <p>Apply limited difference filter using second and optionally third video stream.
  46596. </p>
  46597. <p>The filter accepts the following options:
  46598. </p>
  46599. <dl class="table">
  46600. <dt><samp class="option">threshold</samp></dt>
  46601. <dd><p>Set the threshold to use when allowing certain differences between video streams.
  46602. Any absolute difference value lower or exact than this threshold will pick pixel components from
  46603. first video stream.
  46604. </p>
  46605. </dd>
  46606. <dt><samp class="option">elasticity</samp></dt>
  46607. <dd><p>Set the elasticity of soft thresholding when processing video streams.
  46608. This value multiplied with first one sets second threshold.
  46609. Any absolute difference value greater or exact than second threshold will pick pixel components
  46610. from second video stream. For values between those two threshold
  46611. linear interpolation between first and second video stream will be used.
  46612. </p>
  46613. </dd>
  46614. <dt><samp class="option">reference</samp></dt>
  46615. <dd><p>Enable the reference (third) video stream processing. By default is disabled.
  46616. If set, this video stream will be used for calculating absolute difference with first video
  46617. stream.
  46618. </p>
  46619. </dd>
  46620. <dt><samp class="option">planes</samp></dt>
  46621. <dd><p>Specify which planes will be processed. Defaults to all available.
  46622. </p></dd>
  46623. </dl>
  46624. <ul class="mini-toc">
  46625. <li><a href="#Commands-106" accesskey="1">Commands</a></li>
  46626. </ul>
  46627. <div class="subsection-level-extent" id="Commands-106">
  46628. <h4 class="subsection"><span>39.147.1 Commands<a class="copiable-link" href="#Commands-106"> &para;</a></span></h4>
  46629. <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;.
  46630. </p>
  46631. </div>
  46632. </div>
  46633. <div class="section-level-extent" id="limiter">
  46634. <h3 class="section"><span>39.148 limiter<a class="copiable-link" href="#limiter"> &para;</a></span></h3>
  46635. <p>Limits the pixel components values to the specified range [min, max].
  46636. </p>
  46637. <p>The filter accepts the following options:
  46638. </p>
  46639. <dl class="table">
  46640. <dt><samp class="option">min</samp></dt>
  46641. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  46642. </p>
  46643. </dd>
  46644. <dt><samp class="option">max</samp></dt>
  46645. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  46646. </p>
  46647. </dd>
  46648. <dt><samp class="option">planes</samp></dt>
  46649. <dd><p>Specify which planes will be processed. Defaults to all available.
  46650. </p></dd>
  46651. </dl>
  46652. <ul class="mini-toc">
  46653. <li><a href="#Commands-107" accesskey="1">Commands</a></li>
  46654. </ul>
  46655. <div class="subsection-level-extent" id="Commands-107">
  46656. <h4 class="subsection"><span>39.148.1 Commands<a class="copiable-link" href="#Commands-107"> &para;</a></span></h4>
  46657. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46658. </p>
  46659. </div>
  46660. </div>
  46661. <div class="section-level-extent" id="loop">
  46662. <h3 class="section"><span>39.149 loop<a class="copiable-link" href="#loop"> &para;</a></span></h3>
  46663. <p>Loop video frames.
  46664. </p>
  46665. <p>The filter accepts the following options:
  46666. </p>
  46667. <dl class="table">
  46668. <dt><samp class="option">loop</samp></dt>
  46669. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  46670. Default is 0.
  46671. </p>
  46672. </dd>
  46673. <dt><samp class="option">size</samp></dt>
  46674. <dd><p>Set maximal size in number of frames. Default is 0.
  46675. </p>
  46676. </dd>
  46677. <dt><samp class="option">start</samp></dt>
  46678. <dd><p>Set first frame of loop. Default is 0.
  46679. </p>
  46680. </dd>
  46681. <dt><samp class="option">time</samp></dt>
  46682. <dd><p>Set the time of loop start in seconds.
  46683. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  46684. </p></dd>
  46685. </dl>
  46686. <ul class="mini-toc">
  46687. <li><a href="#Examples-136" accesskey="1">Examples</a></li>
  46688. </ul>
  46689. <div class="subsection-level-extent" id="Examples-136">
  46690. <h4 class="subsection"><span>39.149.1 Examples<a class="copiable-link" href="#Examples-136"> &para;</a></span></h4>
  46691. <ul class="itemize mark-bullet">
  46692. <li>Loop single first frame infinitely:
  46693. <div class="example">
  46694. <pre class="example-preformatted">loop=loop=-1:size=1:start=0
  46695. </pre></div>
  46696. </li><li>Loop single first frame 10 times:
  46697. <div class="example">
  46698. <pre class="example-preformatted">loop=loop=10:size=1:start=0
  46699. </pre></div>
  46700. </li><li>Loop 10 first frames 5 times:
  46701. <div class="example">
  46702. <pre class="example-preformatted">loop=loop=5:size=10:start=0
  46703. </pre></div>
  46704. </li></ul>
  46705. </div>
  46706. </div>
  46707. <div class="section-level-extent" id="lut1d">
  46708. <h3 class="section"><span>39.150 lut1d<a class="copiable-link" href="#lut1d"> &para;</a></span></h3>
  46709. <p>Apply a 1D LUT to an input video.
  46710. </p>
  46711. <p>The filter accepts the following options:
  46712. </p>
  46713. <dl class="table">
  46714. <dt><samp class="option">file</samp></dt>
  46715. <dd><p>Set the 1D LUT file name.
  46716. </p>
  46717. <p>Currently supported formats:
  46718. </p><dl class="table">
  46719. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  46720. <dd><p>Iridas
  46721. </p></dd>
  46722. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  46723. <dd><p>cineSpace
  46724. </p></dd>
  46725. </dl>
  46726. </dd>
  46727. <dt><samp class="option">interp</samp></dt>
  46728. <dd><p>Select interpolation mode.
  46729. </p>
  46730. <p>Available values are:
  46731. </p>
  46732. <dl class="table">
  46733. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  46734. <dd><p>Use values from the nearest defined point.
  46735. </p></dd>
  46736. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  46737. <dd><p>Interpolate values using the linear interpolation.
  46738. </p></dd>
  46739. <dt>&lsquo;<samp class="samp">cosine</samp>&rsquo;</dt>
  46740. <dd><p>Interpolate values using the cosine interpolation.
  46741. </p></dd>
  46742. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  46743. <dd><p>Interpolate values using the cubic interpolation.
  46744. </p></dd>
  46745. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  46746. <dd><p>Interpolate values using the spline interpolation.
  46747. </p></dd>
  46748. </dl>
  46749. </dd>
  46750. </dl>
  46751. <ul class="mini-toc">
  46752. <li><a href="#Commands-108" accesskey="1">Commands</a></li>
  46753. </ul>
  46754. <div class="subsection-level-extent" id="Commands-108">
  46755. <h4 class="subsection"><span>39.150.1 Commands<a class="copiable-link" href="#Commands-108"> &para;</a></span></h4>
  46756. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  46757. </p>
  46758. <a class="anchor" id="lut3d"></a></div>
  46759. </div>
  46760. <div class="section-level-extent" id="lut3d-1">
  46761. <h3 class="section"><span>39.151 lut3d<a class="copiable-link" href="#lut3d-1"> &para;</a></span></h3>
  46762. <p>Apply a 3D LUT to an input video.
  46763. </p>
  46764. <p>The filter accepts the following options:
  46765. </p>
  46766. <dl class="table">
  46767. <dt><samp class="option">file</samp></dt>
  46768. <dd><p>Set the 3D LUT file name.
  46769. </p>
  46770. <p>Currently supported formats:
  46771. </p><dl class="table">
  46772. <dt>&lsquo;<samp class="samp">3dl</samp>&rsquo;</dt>
  46773. <dd><p>AfterEffects
  46774. </p></dd>
  46775. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  46776. <dd><p>Iridas
  46777. </p></dd>
  46778. <dt>&lsquo;<samp class="samp">dat</samp>&rsquo;</dt>
  46779. <dd><p>DaVinci
  46780. </p></dd>
  46781. <dt>&lsquo;<samp class="samp">m3d</samp>&rsquo;</dt>
  46782. <dd><p>Pandora
  46783. </p></dd>
  46784. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  46785. <dd><p>cineSpace
  46786. </p></dd>
  46787. </dl>
  46788. </dd>
  46789. <dt><samp class="option">interp</samp></dt>
  46790. <dd><p>Select interpolation mode.
  46791. </p>
  46792. <p>Available values are:
  46793. </p>
  46794. <dl class="table">
  46795. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  46796. <dd><p>Use values from the nearest defined point.
  46797. </p></dd>
  46798. <dt>&lsquo;<samp class="samp">trilinear</samp>&rsquo;</dt>
  46799. <dd><p>Interpolate values using the 8 points defining a cube.
  46800. </p></dd>
  46801. <dt>&lsquo;<samp class="samp">tetrahedral</samp>&rsquo;</dt>
  46802. <dd><p>Interpolate values using a tetrahedron.
  46803. </p></dd>
  46804. <dt>&lsquo;<samp class="samp">pyramid</samp>&rsquo;</dt>
  46805. <dd><p>Interpolate values using a pyramid.
  46806. </p></dd>
  46807. <dt>&lsquo;<samp class="samp">prism</samp>&rsquo;</dt>
  46808. <dd><p>Interpolate values using a prism.
  46809. </p></dd>
  46810. </dl>
  46811. </dd>
  46812. </dl>
  46813. <ul class="mini-toc">
  46814. <li><a href="#Commands-109" accesskey="1">Commands</a></li>
  46815. </ul>
  46816. <div class="subsection-level-extent" id="Commands-109">
  46817. <h4 class="subsection"><span>39.151.1 Commands<a class="copiable-link" href="#Commands-109"> &para;</a></span></h4>
  46818. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  46819. </p>
  46820. </div>
  46821. </div>
  46822. <div class="section-level-extent" id="lumakey">
  46823. <h3 class="section"><span>39.152 lumakey<a class="copiable-link" href="#lumakey"> &para;</a></span></h3>
  46824. <p>Turn certain luma values into transparency.
  46825. </p>
  46826. <p>The filter accepts the following options:
  46827. </p>
  46828. <dl class="table">
  46829. <dt><samp class="option">threshold</samp></dt>
  46830. <dd><p>Set the luma which will be used as base for transparency.
  46831. Default value is <code class="code">0</code>.
  46832. </p>
  46833. </dd>
  46834. <dt><samp class="option">tolerance</samp></dt>
  46835. <dd><p>Set the range of luma values to be keyed out.
  46836. Default value is <code class="code">0.01</code>.
  46837. </p>
  46838. </dd>
  46839. <dt><samp class="option">softness</samp></dt>
  46840. <dd><p>Set the range of softness. Default value is <code class="code">0</code>.
  46841. Use this to control gradual transition from zero to full transparency.
  46842. </p></dd>
  46843. </dl>
  46844. <ul class="mini-toc">
  46845. <li><a href="#Commands-110" accesskey="1">Commands</a></li>
  46846. </ul>
  46847. <div class="subsection-level-extent" id="Commands-110">
  46848. <h4 class="subsection"><span>39.152.1 Commands<a class="copiable-link" href="#Commands-110"> &para;</a></span></h4>
  46849. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  46850. The command accepts the same syntax of the corresponding option.
  46851. </p>
  46852. <p>If the specified expression is not valid, it is kept at its current
  46853. value.
  46854. </p>
  46855. </div>
  46856. </div>
  46857. <div class="section-level-extent" id="lut_002c-lutrgb_002c-lutyuv">
  46858. <h3 class="section"><span>39.153 lut, lutrgb, lutyuv<a class="copiable-link" href="#lut_002c-lutrgb_002c-lutyuv"> &para;</a></span></h3>
  46859. <p>Compute a look-up table for binding each pixel component input value
  46860. to an output value, and apply it to the input video.
  46861. </p>
  46862. <p><var class="var">lutyuv</var> applies a lookup table to a YUV input video, <var class="var">lutrgb</var>
  46863. to an RGB input video.
  46864. </p>
  46865. <p>These filters accept the following parameters:
  46866. </p><dl class="table">
  46867. <dt><samp class="option">c0</samp></dt>
  46868. <dd><p>set first pixel component expression
  46869. </p></dd>
  46870. <dt><samp class="option">c1</samp></dt>
  46871. <dd><p>set second pixel component expression
  46872. </p></dd>
  46873. <dt><samp class="option">c2</samp></dt>
  46874. <dd><p>set third pixel component expression
  46875. </p></dd>
  46876. <dt><samp class="option">c3</samp></dt>
  46877. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  46878. </p>
  46879. </dd>
  46880. <dt><samp class="option">r</samp></dt>
  46881. <dd><p>set red component expression
  46882. </p></dd>
  46883. <dt><samp class="option">g</samp></dt>
  46884. <dd><p>set green component expression
  46885. </p></dd>
  46886. <dt><samp class="option">b</samp></dt>
  46887. <dd><p>set blue component expression
  46888. </p></dd>
  46889. <dt><samp class="option">a</samp></dt>
  46890. <dd><p>alpha component expression
  46891. </p>
  46892. </dd>
  46893. <dt><samp class="option">y</samp></dt>
  46894. <dd><p>set Y/luma component expression
  46895. </p></dd>
  46896. <dt><samp class="option">u</samp></dt>
  46897. <dd><p>set U/Cb component expression
  46898. </p></dd>
  46899. <dt><samp class="option">v</samp></dt>
  46900. <dd><p>set V/Cr component expression
  46901. </p></dd>
  46902. </dl>
  46903. <p>Each of them specifies the expression to use for computing the lookup table for
  46904. the corresponding pixel component values.
  46905. </p>
  46906. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  46907. format in input.
  46908. </p>
  46909. <p>The <var class="var">lut</var> filter requires either YUV or RGB pixel formats in input,
  46910. <var class="var">lutrgb</var> requires RGB pixel formats in input, and <var class="var">lutyuv</var> requires YUV.
  46911. </p>
  46912. <p>The expressions can contain the following constants and functions:
  46913. </p>
  46914. <dl class="table">
  46915. <dt><samp class="option">w</samp></dt>
  46916. <dt><samp class="option">h</samp></dt>
  46917. <dd><p>The input width and height.
  46918. </p>
  46919. </dd>
  46920. <dt><samp class="option">val</samp></dt>
  46921. <dd><p>The input value for the pixel component.
  46922. </p>
  46923. </dd>
  46924. <dt><samp class="option">clipval</samp></dt>
  46925. <dd><p>The input value, clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range.
  46926. </p>
  46927. </dd>
  46928. <dt><samp class="option">maxval</samp></dt>
  46929. <dd><p>The maximum value for the pixel component.
  46930. </p>
  46931. </dd>
  46932. <dt><samp class="option">minval</samp></dt>
  46933. <dd><p>The minimum value for the pixel component.
  46934. </p>
  46935. </dd>
  46936. <dt><samp class="option">negval</samp></dt>
  46937. <dd><p>The negated value for the pixel component value, clipped to the
  46938. <var class="var">minval</var>-<var class="var">maxval</var> range; it corresponds to the expression
  46939. &quot;maxval-clipval+minval&quot;.
  46940. </p>
  46941. </dd>
  46942. <dt><samp class="option">clip(val)</samp></dt>
  46943. <dd><p>The computed value in <var class="var">val</var>, clipped to the
  46944. <var class="var">minval</var>-<var class="var">maxval</var> range.
  46945. </p>
  46946. </dd>
  46947. <dt><samp class="option">gammaval(gamma)</samp></dt>
  46948. <dd><p>The computed gamma correction value of the pixel component value,
  46949. clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range. It corresponds to the
  46950. expression
  46951. &quot;pow((clipval-minval)/(maxval-minval)\,<var class="var">gamma</var>)*(maxval-minval)+minval&quot;
  46952. </p>
  46953. </dd>
  46954. </dl>
  46955. <p>All expressions default to &quot;clipval&quot;.
  46956. </p>
  46957. <ul class="mini-toc">
  46958. <li><a href="#Commands-111" accesskey="1">Commands</a></li>
  46959. <li><a href="#Examples-137" accesskey="2">Examples</a></li>
  46960. </ul>
  46961. <div class="subsection-level-extent" id="Commands-111">
  46962. <h4 class="subsection"><span>39.153.1 Commands<a class="copiable-link" href="#Commands-111"> &para;</a></span></h4>
  46963. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  46964. </p>
  46965. </div>
  46966. <div class="subsection-level-extent" id="Examples-137">
  46967. <h4 class="subsection"><span>39.153.2 Examples<a class="copiable-link" href="#Examples-137"> &para;</a></span></h4>
  46968. <ul class="itemize mark-bullet">
  46969. <li>Negate input video:
  46970. <div class="example">
  46971. <pre class="example-preformatted">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  46972. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  46973. </pre></div>
  46974. <p>The above is the same as:
  46975. </p><div class="example">
  46976. <pre class="example-preformatted">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  46977. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  46978. </pre></div>
  46979. </li><li>Negate luma:
  46980. <div class="example">
  46981. <pre class="example-preformatted">lutyuv=y=negval
  46982. </pre></div>
  46983. </li><li>Remove chroma components, turning the video into a graytone image:
  46984. <div class="example">
  46985. <pre class="example-preformatted">lutyuv=&quot;u=128:v=128&quot;
  46986. </pre></div>
  46987. </li><li>Apply a luma burning effect:
  46988. <div class="example">
  46989. <pre class="example-preformatted">lutyuv=&quot;y=2*val&quot;
  46990. </pre></div>
  46991. </li><li>Remove green and blue components:
  46992. <div class="example">
  46993. <pre class="example-preformatted">lutrgb=&quot;g=0:b=0&quot;
  46994. </pre></div>
  46995. </li><li>Set a constant alpha channel value on input:
  46996. <div class="example">
  46997. <pre class="example-preformatted">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  46998. </pre></div>
  46999. </li><li>Correct luma gamma by a factor of 0.5:
  47000. <div class="example">
  47001. <pre class="example-preformatted">lutyuv=y=gammaval(0.5)
  47002. </pre></div>
  47003. </li><li>Discard least significant bits of luma:
  47004. <div class="example">
  47005. <pre class="example-preformatted">lutyuv=y='bitand(val, 128+64+32)'
  47006. </pre></div>
  47007. </li><li>Technicolor like effect:
  47008. <div class="example">
  47009. <pre class="example-preformatted">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  47010. </pre></div>
  47011. </li></ul>
  47012. </div>
  47013. </div>
  47014. <div class="section-level-extent" id="lut2_002c-tlut2">
  47015. <h3 class="section"><span>39.154 lut2, tlut2<a class="copiable-link" href="#lut2_002c-tlut2"> &para;</a></span></h3>
  47016. <p>The <code class="code">lut2</code> filter takes two input streams and outputs one
  47017. stream.
  47018. </p>
  47019. <p>The <code class="code">tlut2</code> (time lut2) filter takes two consecutive frames
  47020. from one single stream.
  47021. </p>
  47022. <p>This filter accepts the following parameters:
  47023. </p><dl class="table">
  47024. <dt><samp class="option">c0</samp></dt>
  47025. <dd><p>set first pixel component expression
  47026. </p></dd>
  47027. <dt><samp class="option">c1</samp></dt>
  47028. <dd><p>set second pixel component expression
  47029. </p></dd>
  47030. <dt><samp class="option">c2</samp></dt>
  47031. <dd><p>set third pixel component expression
  47032. </p></dd>
  47033. <dt><samp class="option">c3</samp></dt>
  47034. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  47035. </p>
  47036. </dd>
  47037. <dt><samp class="option">d</samp></dt>
  47038. <dd><p>set output bit depth, only available for <code class="code">lut2</code> filter. By default is 0,
  47039. which means bit depth is automatically picked from first input format.
  47040. </p></dd>
  47041. </dl>
  47042. <p>The <code class="code">lut2</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  47043. </p>
  47044. <p>Each of them specifies the expression to use for computing the lookup table for
  47045. the corresponding pixel component values.
  47046. </p>
  47047. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  47048. format in inputs.
  47049. </p>
  47050. <p>The expressions can contain the following constants:
  47051. </p>
  47052. <dl class="table">
  47053. <dt><samp class="option">w</samp></dt>
  47054. <dt><samp class="option">h</samp></dt>
  47055. <dd><p>The input width and height.
  47056. </p>
  47057. </dd>
  47058. <dt><samp class="option">x</samp></dt>
  47059. <dd><p>The first input value for the pixel component.
  47060. </p>
  47061. </dd>
  47062. <dt><samp class="option">y</samp></dt>
  47063. <dd><p>The second input value for the pixel component.
  47064. </p>
  47065. </dd>
  47066. <dt><samp class="option">bdx</samp></dt>
  47067. <dd><p>The first input video bit depth.
  47068. </p>
  47069. </dd>
  47070. <dt><samp class="option">bdy</samp></dt>
  47071. <dd><p>The second input video bit depth.
  47072. </p></dd>
  47073. </dl>
  47074. <p>All expressions default to &quot;x&quot;.
  47075. </p>
  47076. <ul class="mini-toc">
  47077. <li><a href="#Commands-112" accesskey="1">Commands</a></li>
  47078. <li><a href="#Examples-138" accesskey="2">Examples</a></li>
  47079. </ul>
  47080. <div class="subsection-level-extent" id="Commands-112">
  47081. <h4 class="subsection"><span>39.154.1 Commands<a class="copiable-link" href="#Commands-112"> &para;</a></span></h4>
  47082. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a> except option <code class="code">d</code>.
  47083. </p>
  47084. </div>
  47085. <div class="subsection-level-extent" id="Examples-138">
  47086. <h4 class="subsection"><span>39.154.2 Examples<a class="copiable-link" href="#Examples-138"> &para;</a></span></h4>
  47087. <ul class="itemize mark-bullet">
  47088. <li>Highlight differences between two RGB video streams:
  47089. <div class="example">
  47090. <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)'
  47091. </pre></div>
  47092. </li><li>Highlight differences between two YUV video streams:
  47093. <div class="example">
  47094. <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)'
  47095. </pre></div>
  47096. </li><li>Show max difference between two video streams:
  47097. <div class="example">
  47098. <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)))'
  47099. </pre></div>
  47100. </li></ul>
  47101. </div>
  47102. </div>
  47103. <div class="section-level-extent" id="maskedclamp">
  47104. <h3 class="section"><span>39.155 maskedclamp<a class="copiable-link" href="#maskedclamp"> &para;</a></span></h3>
  47105. <p>Clamp the first input stream with the second input and third input stream.
  47106. </p>
  47107. <p>Returns the value of first stream to be between second input
  47108. stream - <code class="code">undershoot</code> and third input stream + <code class="code">overshoot</code>.
  47109. </p>
  47110. <p>This filter accepts the following options:
  47111. </p><dl class="table">
  47112. <dt><samp class="option">undershoot</samp></dt>
  47113. <dd><p>Default value is <code class="code">0</code>.
  47114. </p>
  47115. </dd>
  47116. <dt><samp class="option">overshoot</samp></dt>
  47117. <dd><p>Default value is <code class="code">0</code>.
  47118. </p>
  47119. </dd>
  47120. <dt><samp class="option">planes</samp></dt>
  47121. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  47122. copied from first stream.
  47123. By default value 0xf, all planes will be processed.
  47124. </p></dd>
  47125. </dl>
  47126. <ul class="mini-toc">
  47127. <li><a href="#Commands-113" accesskey="1">Commands</a></li>
  47128. </ul>
  47129. <div class="subsection-level-extent" id="Commands-113">
  47130. <h4 class="subsection"><span>39.155.1 Commands<a class="copiable-link" href="#Commands-113"> &para;</a></span></h4>
  47131. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  47132. </p>
  47133. </div>
  47134. </div>
  47135. <div class="section-level-extent" id="maskedmax">
  47136. <h3 class="section"><span>39.156 maskedmax<a class="copiable-link" href="#maskedmax"> &para;</a></span></h3>
  47137. <p>Merge the second and third input stream into output stream using absolute differences
  47138. between second input stream and first input stream and absolute difference between
  47139. third input stream and first input stream. The picked value will be from second input
  47140. stream if second absolute difference is greater than first one or from third input stream
  47141. otherwise.
  47142. </p>
  47143. <p>This filter accepts the following options:
  47144. </p><dl class="table">
  47145. <dt><samp class="option">planes</samp></dt>
  47146. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  47147. copied from first stream.
  47148. By default value 0xf, all planes will be processed.
  47149. </p></dd>
  47150. </dl>
  47151. <ul class="mini-toc">
  47152. <li><a href="#Commands-114" accesskey="1">Commands</a></li>
  47153. </ul>
  47154. <div class="subsection-level-extent" id="Commands-114">
  47155. <h4 class="subsection"><span>39.156.1 Commands<a class="copiable-link" href="#Commands-114"> &para;</a></span></h4>
  47156. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  47157. </p>
  47158. </div>
  47159. </div>
  47160. <div class="section-level-extent" id="maskedmerge">
  47161. <h3 class="section"><span>39.157 maskedmerge<a class="copiable-link" href="#maskedmerge"> &para;</a></span></h3>
  47162. <p>Merge the first input stream with the second input stream using per pixel
  47163. weights in the third input stream.
  47164. </p>
  47165. <p>A value of 0 in the third stream pixel component means that pixel component
  47166. from first stream is returned unchanged, while maximum value (eg. 255 for
  47167. 8-bit videos) means that pixel component from second stream is returned
  47168. unchanged. Intermediate values define the amount of merging between both
  47169. input stream&rsquo;s pixel components.
  47170. </p>
  47171. <p>This filter accepts the following options:
  47172. </p><dl class="table">
  47173. <dt><samp class="option">planes</samp></dt>
  47174. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  47175. copied from first stream.
  47176. By default value 0xf, all planes will be processed.
  47177. </p></dd>
  47178. </dl>
  47179. <ul class="mini-toc">
  47180. <li><a href="#Commands-115" accesskey="1">Commands</a></li>
  47181. </ul>
  47182. <div class="subsection-level-extent" id="Commands-115">
  47183. <h4 class="subsection"><span>39.157.1 Commands<a class="copiable-link" href="#Commands-115"> &para;</a></span></h4>
  47184. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  47185. </p>
  47186. </div>
  47187. </div>
  47188. <div class="section-level-extent" id="maskedmin">
  47189. <h3 class="section"><span>39.158 maskedmin<a class="copiable-link" href="#maskedmin"> &para;</a></span></h3>
  47190. <p>Merge the second and third input stream into output stream using absolute differences
  47191. between second input stream and first input stream and absolute difference between
  47192. third input stream and first input stream. The picked value will be from second input
  47193. stream if second absolute difference is less than first one or from third input stream
  47194. otherwise.
  47195. </p>
  47196. <p>This filter accepts the following options:
  47197. </p><dl class="table">
  47198. <dt><samp class="option">planes</samp></dt>
  47199. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  47200. copied from first stream.
  47201. By default value 0xf, all planes will be processed.
  47202. </p></dd>
  47203. </dl>
  47204. <ul class="mini-toc">
  47205. <li><a href="#Commands-116" accesskey="1">Commands</a></li>
  47206. </ul>
  47207. <div class="subsection-level-extent" id="Commands-116">
  47208. <h4 class="subsection"><span>39.158.1 Commands<a class="copiable-link" href="#Commands-116"> &para;</a></span></h4>
  47209. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  47210. </p>
  47211. </div>
  47212. </div>
  47213. <div class="section-level-extent" id="maskedthreshold">
  47214. <h3 class="section"><span>39.159 maskedthreshold<a class="copiable-link" href="#maskedthreshold"> &para;</a></span></h3>
  47215. <p>Pick pixels comparing absolute difference of two video streams with fixed
  47216. threshold.
  47217. </p>
  47218. <p>If absolute difference between pixel component of first and second video
  47219. stream is equal or lower than user supplied threshold than pixel component
  47220. from first video stream is picked, otherwise pixel component from second
  47221. video stream is picked.
  47222. </p>
  47223. <p>This filter accepts the following options:
  47224. </p><dl class="table">
  47225. <dt><samp class="option">threshold</samp></dt>
  47226. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  47227. video streams.
  47228. </p>
  47229. </dd>
  47230. <dt><samp class="option">planes</samp></dt>
  47231. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  47232. copied from second stream.
  47233. By default value 0xf, all planes will be processed.
  47234. </p>
  47235. </dd>
  47236. <dt><samp class="option">mode</samp></dt>
  47237. <dd><p>Set mode of filter operation. Can be <code class="code">abs</code> or <code class="code">diff</code>.
  47238. Default is <code class="code">abs</code>.
  47239. </p></dd>
  47240. </dl>
  47241. <ul class="mini-toc">
  47242. <li><a href="#Commands-117" accesskey="1">Commands</a></li>
  47243. </ul>
  47244. <div class="subsection-level-extent" id="Commands-117">
  47245. <h4 class="subsection"><span>39.159.1 Commands<a class="copiable-link" href="#Commands-117"> &para;</a></span></h4>
  47246. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  47247. </p>
  47248. </div>
  47249. </div>
  47250. <div class="section-level-extent" id="maskfun">
  47251. <h3 class="section"><span>39.160 maskfun<a class="copiable-link" href="#maskfun"> &para;</a></span></h3>
  47252. <p>Create mask from input video.
  47253. </p>
  47254. <p>For example it is useful to create motion masks after <code class="code">tblend</code> filter.
  47255. </p>
  47256. <p>This filter accepts the following options:
  47257. </p>
  47258. <dl class="table">
  47259. <dt><samp class="option">low</samp></dt>
  47260. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  47261. </p>
  47262. </dd>
  47263. <dt><samp class="option">high</samp></dt>
  47264. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  47265. allowed for current pixel format.
  47266. </p>
  47267. </dd>
  47268. <dt><samp class="option">planes</samp></dt>
  47269. <dd><p>Set planes to filter, by default all available planes are filtered.
  47270. </p>
  47271. </dd>
  47272. <dt><samp class="option">fill</samp></dt>
  47273. <dd><p>Fill all frame pixels with this value.
  47274. </p>
  47275. </dd>
  47276. <dt><samp class="option">sum</samp></dt>
  47277. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  47278. average, output frame will be completely filled with value set by <var class="var">fill</var> option.
  47279. Typically useful for scene changes when used in combination with <code class="code">tblend</code> filter.
  47280. </p></dd>
  47281. </dl>
  47282. <ul class="mini-toc">
  47283. <li><a href="#Commands-118" accesskey="1">Commands</a></li>
  47284. </ul>
  47285. <div class="subsection-level-extent" id="Commands-118">
  47286. <h4 class="subsection"><span>39.160.1 Commands<a class="copiable-link" href="#Commands-118"> &para;</a></span></h4>
  47287. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  47288. </p>
  47289. </div>
  47290. </div>
  47291. <div class="section-level-extent" id="mcdeint">
  47292. <h3 class="section"><span>39.161 mcdeint<a class="copiable-link" href="#mcdeint"> &para;</a></span></h3>
  47293. <p>Apply motion-compensation deinterlacing.
  47294. </p>
  47295. <p>It needs one field per frame as input and must thus be used together
  47296. with yadif=1/3 or equivalent.
  47297. </p>
  47298. <p>This filter accepts the following options:
  47299. </p><dl class="table">
  47300. <dt><samp class="option">mode</samp></dt>
  47301. <dd><p>Set the deinterlacing mode.
  47302. </p>
  47303. <p>It accepts one of the following values:
  47304. </p><dl class="table">
  47305. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  47306. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  47307. <dt>&lsquo;<samp class="samp">slow</samp>&rsquo;</dt>
  47308. <dd><p>use iterative motion estimation
  47309. </p></dd>
  47310. <dt>&lsquo;<samp class="samp">extra_slow</samp>&rsquo;</dt>
  47311. <dd><p>like &lsquo;<samp class="samp">slow</samp>&rsquo;, but use multiple reference frames.
  47312. </p></dd>
  47313. </dl>
  47314. <p>Default value is &lsquo;<samp class="samp">fast</samp>&rsquo;.
  47315. </p>
  47316. </dd>
  47317. <dt><samp class="option">parity</samp></dt>
  47318. <dd><p>Set the picture field parity assumed for the input video. It must be
  47319. one of the following values:
  47320. </p>
  47321. <dl class="table">
  47322. <dt>&lsquo;<samp class="samp">0, tff</samp>&rsquo;</dt>
  47323. <dd><p>assume top field first
  47324. </p></dd>
  47325. <dt>&lsquo;<samp class="samp">1, bff</samp>&rsquo;</dt>
  47326. <dd><p>assume bottom field first
  47327. </p></dd>
  47328. </dl>
  47329. <p>Default value is &lsquo;<samp class="samp">bff</samp>&rsquo;.
  47330. </p>
  47331. </dd>
  47332. <dt><samp class="option">qp</samp></dt>
  47333. <dd><p>Set per-block quantization parameter (QP) used by the internal
  47334. encoder.
  47335. </p>
  47336. <p>Higher values should result in a smoother motion vector field but less
  47337. optimal individual vectors. Default value is 1.
  47338. </p></dd>
  47339. </dl>
  47340. </div>
  47341. <div class="section-level-extent" id="median">
  47342. <h3 class="section"><span>39.162 median<a class="copiable-link" href="#median"> &para;</a></span></h3>
  47343. <p>Pick median pixel from certain rectangle defined by radius.
  47344. </p>
  47345. <p>This filter accepts the following options:
  47346. </p>
  47347. <dl class="table">
  47348. <dt><samp class="option">radius</samp></dt>
  47349. <dd><p>Set horizontal radius size. Default value is <code class="code">1</code>.
  47350. Allowed range is integer from 1 to 127.
  47351. </p>
  47352. </dd>
  47353. <dt><samp class="option">planes</samp></dt>
  47354. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  47355. </p>
  47356. </dd>
  47357. <dt><samp class="option">radiusV</samp></dt>
  47358. <dd><p>Set vertical radius size. Default value is <code class="code">0</code>.
  47359. Allowed range is integer from 0 to 127.
  47360. If it is 0, value will be picked from horizontal <code class="code">radius</code> option.
  47361. </p>
  47362. </dd>
  47363. <dt><samp class="option">percentile</samp></dt>
  47364. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  47365. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  47366. minimum values, and <code class="code">1</code> maximum values.
  47367. </p></dd>
  47368. </dl>
  47369. <ul class="mini-toc">
  47370. <li><a href="#Commands-119" accesskey="1">Commands</a></li>
  47371. </ul>
  47372. <div class="subsection-level-extent" id="Commands-119">
  47373. <h4 class="subsection"><span>39.162.1 Commands<a class="copiable-link" href="#Commands-119"> &para;</a></span></h4>
  47374. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  47375. The command accepts the same syntax of the corresponding option.
  47376. </p>
  47377. <p>If the specified expression is not valid, it is kept at its current
  47378. value.
  47379. </p>
  47380. </div>
  47381. </div>
  47382. <div class="section-level-extent" id="mergeplanes">
  47383. <h3 class="section"><span>39.163 mergeplanes<a class="copiable-link" href="#mergeplanes"> &para;</a></span></h3>
  47384. <p>Merge color channel components from several video streams.
  47385. </p>
  47386. <p>The filter accepts up to 4 input streams, and merge selected input
  47387. planes to the output video.
  47388. </p>
  47389. <p>This filter accepts the following options:
  47390. </p><dl class="table">
  47391. <dt><samp class="option">mapping</samp></dt>
  47392. <dd><p>Set input to output plane mapping. Default is <code class="code">0</code>.
  47393. </p>
  47394. <p>The mappings is specified as a bitmap. It should be specified as a
  47395. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  47396. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  47397. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  47398. corresponding input to use (from 0 to 3). The rest of the mappings is
  47399. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  47400. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  47401. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  47402. </p>
  47403. </dd>
  47404. <dt><samp class="option">format</samp></dt>
  47405. <dd><p>Set output pixel format. Default is <code class="code">yuva444p</code>.
  47406. </p>
  47407. </dd>
  47408. <dt><samp class="option">map0s</samp></dt>
  47409. <dt><samp class="option">map1s</samp></dt>
  47410. <dt><samp class="option">map2s</samp></dt>
  47411. <dt><samp class="option">map3s</samp></dt>
  47412. <dd><p>Set input to output stream mapping for output Nth plane. Default is <code class="code">0</code>.
  47413. </p>
  47414. </dd>
  47415. <dt><samp class="option">map0p</samp></dt>
  47416. <dt><samp class="option">map1p</samp></dt>
  47417. <dt><samp class="option">map2p</samp></dt>
  47418. <dt><samp class="option">map3p</samp></dt>
  47419. <dd><p>Set input to output plane mapping for output Nth plane. Default is <code class="code">0</code>.
  47420. </p></dd>
  47421. </dl>
  47422. <ul class="mini-toc">
  47423. <li><a href="#Examples-139" accesskey="1">Examples</a></li>
  47424. </ul>
  47425. <div class="subsection-level-extent" id="Examples-139">
  47426. <h4 class="subsection"><span>39.163.1 Examples<a class="copiable-link" href="#Examples-139"> &para;</a></span></h4>
  47427. <ul class="itemize mark-bullet">
  47428. <li>Merge three gray video streams of same width and height into single video stream:
  47429. <div class="example">
  47430. <pre class="example-preformatted">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  47431. </pre></div>
  47432. </li><li>Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  47433. <div class="example">
  47434. <pre class="example-preformatted">[a0][a1]mergeplanes=0x00010210:yuva444p
  47435. </pre></div>
  47436. </li><li>Swap Y and A plane in yuva444p stream:
  47437. <div class="example">
  47438. <pre class="example-preformatted">format=yuva444p,mergeplanes=0x03010200:yuva444p
  47439. </pre></div>
  47440. </li><li>Swap U and V plane in yuv420p stream:
  47441. <div class="example">
  47442. <pre class="example-preformatted">format=yuv420p,mergeplanes=0x000201:yuv420p
  47443. </pre></div>
  47444. </li><li>Cast a rgb24 clip to yuv444p:
  47445. <div class="example">
  47446. <pre class="example-preformatted">format=rgb24,mergeplanes=0x000102:yuv444p
  47447. </pre></div>
  47448. </li></ul>
  47449. </div>
  47450. </div>
  47451. <div class="section-level-extent" id="mestimate">
  47452. <h3 class="section"><span>39.164 mestimate<a class="copiable-link" href="#mestimate"> &para;</a></span></h3>
  47453. <p>Estimate and export motion vectors using block matching algorithms.
  47454. Motion vectors are stored in frame side data to be used by other filters.
  47455. </p>
  47456. <p>This filter accepts the following options:
  47457. </p><dl class="table">
  47458. <dt><samp class="option">method</samp></dt>
  47459. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  47460. </p>
  47461. <dl class="table">
  47462. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  47463. <dd><p>Exhaustive search algorithm.
  47464. </p></dd>
  47465. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  47466. <dd><p>Three step search algorithm.
  47467. </p></dd>
  47468. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  47469. <dd><p>Two dimensional logarithmic search algorithm.
  47470. </p></dd>
  47471. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  47472. <dd><p>New three step search algorithm.
  47473. </p></dd>
  47474. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  47475. <dd><p>Four step search algorithm.
  47476. </p></dd>
  47477. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  47478. <dd><p>Diamond search algorithm.
  47479. </p></dd>
  47480. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  47481. <dd><p>Hexagon-based search algorithm.
  47482. </p></dd>
  47483. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  47484. <dd><p>Enhanced predictive zonal search algorithm.
  47485. </p></dd>
  47486. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  47487. <dd><p>Uneven multi-hexagon search algorithm.
  47488. </p></dd>
  47489. </dl>
  47490. <p>Default value is &lsquo;<samp class="samp">esa</samp>&rsquo;.
  47491. </p>
  47492. </dd>
  47493. <dt><samp class="option">mb_size</samp></dt>
  47494. <dd><p>Macroblock size. Default <code class="code">16</code>.
  47495. </p>
  47496. </dd>
  47497. <dt><samp class="option">search_param</samp></dt>
  47498. <dd><p>Search parameter. Default <code class="code">7</code>.
  47499. </p></dd>
  47500. </dl>
  47501. </div>
  47502. <div class="section-level-extent" id="midequalizer">
  47503. <h3 class="section"><span>39.165 midequalizer<a class="copiable-link" href="#midequalizer"> &para;</a></span></h3>
  47504. <p>Apply Midway Image Equalization effect using two video streams.
  47505. </p>
  47506. <p>Midway Image Equalization adjusts a pair of images to have the same
  47507. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  47508. useful for e.g. matching exposures from a pair of stereo cameras.
  47509. </p>
  47510. <p>This filter has two inputs and one output, which must be of same pixel format, but
  47511. may be of different sizes. The output of filter is first input adjusted with
  47512. midway histogram of both inputs.
  47513. </p>
  47514. <p>This filter accepts the following option:
  47515. </p>
  47516. <dl class="table">
  47517. <dt><samp class="option">planes</samp></dt>
  47518. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  47519. </p></dd>
  47520. </dl>
  47521. </div>
  47522. <div class="section-level-extent" id="minterpolate">
  47523. <h3 class="section"><span>39.166 minterpolate<a class="copiable-link" href="#minterpolate"> &para;</a></span></h3>
  47524. <p>Convert the video to specified frame rate using motion interpolation.
  47525. </p>
  47526. <p>This filter accepts the following options:
  47527. </p><dl class="table">
  47528. <dt><samp class="option">fps</samp></dt>
  47529. <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>.
  47530. </p>
  47531. </dd>
  47532. <dt><samp class="option">mi_mode</samp></dt>
  47533. <dd><p>Motion interpolation mode. Following values are accepted:
  47534. </p><dl class="table">
  47535. <dt>&lsquo;<samp class="samp">dup</samp>&rsquo;</dt>
  47536. <dd><p>Duplicate previous or next frame for interpolating new ones.
  47537. </p></dd>
  47538. <dt>&lsquo;<samp class="samp">blend</samp>&rsquo;</dt>
  47539. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  47540. </p></dd>
  47541. <dt>&lsquo;<samp class="samp">mci</samp>&rsquo;</dt>
  47542. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  47543. </p>
  47544. <dl class="table">
  47545. <dt>&lsquo;<samp class="samp">mc_mode</samp>&rsquo;</dt>
  47546. <dd><p>Motion compensation mode. Following values are accepted:
  47547. </p><dl class="table">
  47548. <dt>&lsquo;<samp class="samp">obmc</samp>&rsquo;</dt>
  47549. <dd><p>Overlapped block motion compensation.
  47550. </p></dd>
  47551. <dt>&lsquo;<samp class="samp">aobmc</samp>&rsquo;</dt>
  47552. <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.
  47553. </p></dd>
  47554. </dl>
  47555. <p>Default mode is &lsquo;<samp class="samp">obmc</samp>&rsquo;.
  47556. </p>
  47557. </dd>
  47558. <dt>&lsquo;<samp class="samp">me_mode</samp>&rsquo;</dt>
  47559. <dd><p>Motion estimation mode. Following values are accepted:
  47560. </p><dl class="table">
  47561. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  47562. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  47563. </p></dd>
  47564. <dt>&lsquo;<samp class="samp">bilat</samp>&rsquo;</dt>
  47565. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  47566. </p></dd>
  47567. </dl>
  47568. <p>Default mode is &lsquo;<samp class="samp">bilat</samp>&rsquo;.
  47569. </p>
  47570. </dd>
  47571. <dt>&lsquo;<samp class="samp">me</samp>&rsquo;</dt>
  47572. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  47573. </p><dl class="table">
  47574. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  47575. <dd><p>Exhaustive search algorithm.
  47576. </p></dd>
  47577. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  47578. <dd><p>Three step search algorithm.
  47579. </p></dd>
  47580. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  47581. <dd><p>Two dimensional logarithmic search algorithm.
  47582. </p></dd>
  47583. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  47584. <dd><p>New three step search algorithm.
  47585. </p></dd>
  47586. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  47587. <dd><p>Four step search algorithm.
  47588. </p></dd>
  47589. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  47590. <dd><p>Diamond search algorithm.
  47591. </p></dd>
  47592. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  47593. <dd><p>Hexagon-based search algorithm.
  47594. </p></dd>
  47595. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  47596. <dd><p>Enhanced predictive zonal search algorithm.
  47597. </p></dd>
  47598. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  47599. <dd><p>Uneven multi-hexagon search algorithm.
  47600. </p></dd>
  47601. </dl>
  47602. <p>Default algorithm is &lsquo;<samp class="samp">epzs</samp>&rsquo;.
  47603. </p>
  47604. </dd>
  47605. <dt>&lsquo;<samp class="samp">mb_size</samp>&rsquo;</dt>
  47606. <dd><p>Macroblock size. Default <code class="code">16</code>.
  47607. </p>
  47608. </dd>
  47609. <dt>&lsquo;<samp class="samp">search_param</samp>&rsquo;</dt>
  47610. <dd><p>Motion estimation search parameter. Default <code class="code">32</code>.
  47611. </p>
  47612. </dd>
  47613. <dt>&lsquo;<samp class="samp">vsbmc</samp>&rsquo;</dt>
  47614. <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).
  47615. </p></dd>
  47616. </dl>
  47617. </dd>
  47618. </dl>
  47619. </dd>
  47620. <dt><samp class="option">scd</samp></dt>
  47621. <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:
  47622. </p><dl class="table">
  47623. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  47624. <dd><p>Disable scene change detection.
  47625. </p></dd>
  47626. <dt>&lsquo;<samp class="samp">fdiff</samp>&rsquo;</dt>
  47627. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var class="var">scd_threshold</var> scene change is detected.
  47628. </p></dd>
  47629. </dl>
  47630. <p>Default method is &lsquo;<samp class="samp">fdiff</samp>&rsquo;.
  47631. </p>
  47632. </dd>
  47633. <dt><samp class="option">scd_threshold</samp></dt>
  47634. <dd><p>Scene change detection threshold. Default is <code class="code">10.</code>.
  47635. </p></dd>
  47636. </dl>
  47637. </div>
  47638. <div class="section-level-extent" id="mix">
  47639. <h3 class="section"><span>39.167 mix<a class="copiable-link" href="#mix"> &para;</a></span></h3>
  47640. <p>Mix several video input streams into one video stream.
  47641. </p>
  47642. <p>A description of the accepted options follows.
  47643. </p>
  47644. <dl class="table">
  47645. <dt><samp class="option">inputs</samp></dt>
  47646. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  47647. </p>
  47648. </dd>
  47649. <dt><samp class="option">weights</samp></dt>
  47650. <dd><p>Specify weight of each input video stream as sequence.
  47651. Each weight is separated by space. If number of weights
  47652. is smaller than number of <var class="var">frames</var> last specified
  47653. weight will be used for all remaining unset weights.
  47654. </p>
  47655. </dd>
  47656. <dt><samp class="option">scale</samp></dt>
  47657. <dd><p>Specify scale, if it is set it will be multiplied with sum
  47658. of each weight multiplied with pixel values to give final destination
  47659. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  47660. </p>
  47661. </dd>
  47662. <dt><samp class="option">planes</samp></dt>
  47663. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  47664. </p>
  47665. </dd>
  47666. <dt><samp class="option">duration</samp></dt>
  47667. <dd><p>Specify how end of stream is determined.
  47668. </p><dl class="table">
  47669. <dt>&lsquo;<samp class="samp">longest</samp>&rsquo;</dt>
  47670. <dd><p>The duration of the longest input. (default)
  47671. </p>
  47672. </dd>
  47673. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  47674. <dd><p>The duration of the shortest input.
  47675. </p>
  47676. </dd>
  47677. <dt>&lsquo;<samp class="samp">first</samp>&rsquo;</dt>
  47678. <dd><p>The duration of the first input.
  47679. </p></dd>
  47680. </dl>
  47681. </dd>
  47682. </dl>
  47683. <ul class="mini-toc">
  47684. <li><a href="#Commands-120" accesskey="1">Commands</a></li>
  47685. </ul>
  47686. <div class="subsection-level-extent" id="Commands-120">
  47687. <h4 class="subsection"><span>39.167.1 Commands<a class="copiable-link" href="#Commands-120"> &para;</a></span></h4>
  47688. <p>This filter supports the following commands:
  47689. </p><dl class="table">
  47690. <dt><samp class="option">weights</samp></dt>
  47691. <dt><samp class="option">scale</samp></dt>
  47692. <dt><samp class="option">planes</samp></dt>
  47693. <dd><p>Syntax is same as option with same name.
  47694. </p></dd>
  47695. </dl>
  47696. </div>
  47697. </div>
  47698. <div class="section-level-extent" id="monochrome">
  47699. <h3 class="section"><span>39.168 monochrome<a class="copiable-link" href="#monochrome"> &para;</a></span></h3>
  47700. <p>Convert video to gray using custom color filter.
  47701. </p>
  47702. <p>A description of the accepted options follows.
  47703. </p>
  47704. <dl class="table">
  47705. <dt><samp class="option">cb</samp></dt>
  47706. <dd><p>Set the chroma blue spot. Allowed range is from -1 to 1.
  47707. Default value is 0.
  47708. </p>
  47709. </dd>
  47710. <dt><samp class="option">cr</samp></dt>
  47711. <dd><p>Set the chroma red spot. Allowed range is from -1 to 1.
  47712. Default value is 0.
  47713. </p>
  47714. </dd>
  47715. <dt><samp class="option">size</samp></dt>
  47716. <dd><p>Set the color filter size. Allowed range is from .1 to 10.
  47717. Default value is 1.
  47718. </p>
  47719. </dd>
  47720. <dt><samp class="option">high</samp></dt>
  47721. <dd><p>Set the highlights strength. Allowed range is from 0 to 1.
  47722. Default value is 0.
  47723. </p></dd>
  47724. </dl>
  47725. <ul class="mini-toc">
  47726. <li><a href="#Commands-121" accesskey="1">Commands</a></li>
  47727. </ul>
  47728. <div class="subsection-level-extent" id="Commands-121">
  47729. <h4 class="subsection"><span>39.168.1 Commands<a class="copiable-link" href="#Commands-121"> &para;</a></span></h4>
  47730. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  47731. </p>
  47732. </div>
  47733. </div>
  47734. <div class="section-level-extent" id="morpho">
  47735. <h3 class="section"><span>39.169 morpho<a class="copiable-link" href="#morpho"> &para;</a></span></h3>
  47736. <p>This filter allows to apply main morphological grayscale transforms,
  47737. erode and dilate with arbitrary structures set in second input stream.
  47738. </p>
  47739. <p>Unlike naive implementation and much slower performance in <a class="ref" href="#erosion">erosion</a>
  47740. and <a class="ref" href="#dilation">dilation</a> filters, when speed is critical <code class="code">morpho</code> filter
  47741. should be used instead.
  47742. </p>
  47743. <p>A description of accepted options follows,
  47744. </p>
  47745. <dl class="table">
  47746. <dt><samp class="option">mode</samp></dt>
  47747. <dd><p>Set morphological transform to apply, can be:
  47748. </p>
  47749. <dl class="table">
  47750. <dt>&lsquo;<samp class="samp">erode</samp>&rsquo;</dt>
  47751. <dt>&lsquo;<samp class="samp">dilate</samp>&rsquo;</dt>
  47752. <dt>&lsquo;<samp class="samp">open</samp>&rsquo;</dt>
  47753. <dt>&lsquo;<samp class="samp">close</samp>&rsquo;</dt>
  47754. <dt>&lsquo;<samp class="samp">gradient</samp>&rsquo;</dt>
  47755. <dt>&lsquo;<samp class="samp">tophat</samp>&rsquo;</dt>
  47756. <dt>&lsquo;<samp class="samp">blackhat</samp>&rsquo;</dt>
  47757. </dl>
  47758. <p>Default is <code class="code">erode</code>.
  47759. </p>
  47760. </dd>
  47761. <dt><samp class="option">planes</samp></dt>
  47762. <dd><p>Set planes to filter, by default all planes except alpha are filtered.
  47763. </p>
  47764. </dd>
  47765. <dt><samp class="option">structure</samp></dt>
  47766. <dd><p>Set which structure video frames will be processed from second input stream,
  47767. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  47768. </p></dd>
  47769. </dl>
  47770. <p>The <code class="code">morpho</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  47771. </p>
  47772. <ul class="mini-toc">
  47773. <li><a href="#Commands-122" accesskey="1">Commands</a></li>
  47774. </ul>
  47775. <div class="subsection-level-extent" id="Commands-122">
  47776. <h4 class="subsection"><span>39.169.1 Commands<a class="copiable-link" href="#Commands-122"> &para;</a></span></h4>
  47777. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  47778. </p>
  47779. </div>
  47780. </div>
  47781. <div class="section-level-extent" id="mpdecimate">
  47782. <h3 class="section"><span>39.170 mpdecimate<a class="copiable-link" href="#mpdecimate"> &para;</a></span></h3>
  47783. <p>Drop frames that do not differ greatly from the previous frame in
  47784. order to reduce frame rate.
  47785. </p>
  47786. <p>The main use of this filter is for very-low-bitrate encoding
  47787. (e.g. streaming over dialup modem), but it could in theory be used for
  47788. fixing movies that were inverse-telecined incorrectly.
  47789. </p>
  47790. <p>A description of the accepted options follows.
  47791. </p>
  47792. <dl class="table">
  47793. <dt><samp class="option">max</samp></dt>
  47794. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  47795. positive), or the minimum interval between dropped frames (if
  47796. negative). If the value is 0, the frame is dropped disregarding the
  47797. number of previous sequentially dropped frames.
  47798. </p>
  47799. <p>Default value is 0.
  47800. </p>
  47801. </dd>
  47802. <dt><samp class="option">keep</samp></dt>
  47803. <dd><p>Set the maximum number of consecutive similar frames to ignore before to start dropping them.
  47804. If the value is 0, the frame is dropped disregarding the
  47805. number of previous sequentially similar frames.
  47806. </p>
  47807. <p>Default value is 0.
  47808. </p>
  47809. </dd>
  47810. <dt><samp class="option">hi</samp></dt>
  47811. <dt><samp class="option">lo</samp></dt>
  47812. <dt><samp class="option">frac</samp></dt>
  47813. <dd><p>Set the dropping threshold values.
  47814. </p>
  47815. <p>Values for <samp class="option">hi</samp> and <samp class="option">lo</samp> are for 8x8 pixel blocks and
  47816. represent actual pixel value differences, so a threshold of 64
  47817. corresponds to 1 unit of difference for each pixel, or the same spread
  47818. out differently over the block.
  47819. </p>
  47820. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  47821. than a threshold of <samp class="option">hi</samp>, and if no more than <samp class="option">frac</samp> blocks (1
  47822. meaning the whole image) differ by more than a threshold of <samp class="option">lo</samp>.
  47823. </p>
  47824. <p>Default value for <samp class="option">hi</samp> is 64*12, default value for <samp class="option">lo</samp> is
  47825. 64*5, and default value for <samp class="option">frac</samp> is 0.33.
  47826. </p></dd>
  47827. </dl>
  47828. </div>
  47829. <div class="section-level-extent" id="msad">
  47830. <h3 class="section"><span>39.171 msad<a class="copiable-link" href="#msad"> &para;</a></span></h3>
  47831. <p>Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos.
  47832. </p>
  47833. <p>This filter takes two input videos.
  47834. </p>
  47835. <p>Both input videos must have the same resolution and pixel format for
  47836. this filter to work correctly. Also it assumes that both inputs
  47837. have the same number of frames, which are compared one by one.
  47838. </p>
  47839. <p>The obtained per component, average, min and max MSAD is printed through
  47840. the logging system.
  47841. </p>
  47842. <p>The filter stores the calculated MSAD of each frame in frame metadata.
  47843. </p>
  47844. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  47845. </p>
  47846. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  47847. with the reference file <samp class="file">ref.mpg</samp>.
  47848. </p>
  47849. <div class="example">
  47850. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
  47851. </pre></div>
  47852. </div>
  47853. <div class="section-level-extent" id="multiply">
  47854. <h3 class="section"><span>39.172 multiply<a class="copiable-link" href="#multiply"> &para;</a></span></h3>
  47855. <p>Multiply first video stream pixels values with second video stream pixels values.
  47856. </p>
  47857. <p>The filter accepts the following options:
  47858. </p>
  47859. <dl class="table">
  47860. <dt><samp class="option">scale</samp></dt>
  47861. <dd><p>Set the scale applied to second video stream. By default is <code class="code">1</code>.
  47862. Allowed range is from <code class="code">0</code> to <code class="code">9</code>.
  47863. </p>
  47864. </dd>
  47865. <dt><samp class="option">offset</samp></dt>
  47866. <dd><p>Set the offset applied to second video stream. By default is <code class="code">0.5</code>.
  47867. Allowed range is from <code class="code">-1</code> to <code class="code">1</code>.
  47868. </p>
  47869. </dd>
  47870. <dt><samp class="option">planes</samp></dt>
  47871. <dd><p>Specify planes from input video stream that will be processed.
  47872. By default all planes are processed.
  47873. </p></dd>
  47874. </dl>
  47875. <ul class="mini-toc">
  47876. <li><a href="#Commands-123" accesskey="1">Commands</a></li>
  47877. </ul>
  47878. <div class="subsection-level-extent" id="Commands-123">
  47879. <h4 class="subsection"><span>39.172.1 Commands<a class="copiable-link" href="#Commands-123"> &para;</a></span></h4>
  47880. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  47881. </p>
  47882. </div>
  47883. </div>
  47884. <div class="section-level-extent" id="negate">
  47885. <h3 class="section"><span>39.173 negate<a class="copiable-link" href="#negate"> &para;</a></span></h3>
  47886. <p>Negate (invert) the input video.
  47887. </p>
  47888. <p>It accepts the following option:
  47889. </p>
  47890. <dl class="table">
  47891. <dt><samp class="option">components</samp></dt>
  47892. <dd><p>Set components to negate.
  47893. </p>
  47894. <p>Available values for components are:
  47895. </p><dl class="table">
  47896. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  47897. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  47898. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  47899. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  47900. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  47901. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  47902. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  47903. </dl>
  47904. </dd>
  47905. <dt><samp class="option">negate_alpha</samp></dt>
  47906. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  47907. </p></dd>
  47908. </dl>
  47909. <ul class="mini-toc">
  47910. <li><a href="#Commands-124" accesskey="1">Commands</a></li>
  47911. </ul>
  47912. <div class="subsection-level-extent" id="Commands-124">
  47913. <h4 class="subsection"><span>39.173.1 Commands<a class="copiable-link" href="#Commands-124"> &para;</a></span></h4>
  47914. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  47915. </p>
  47916. <a class="anchor" id="nlmeans"></a></div>
  47917. </div>
  47918. <div class="section-level-extent" id="nlmeans-1">
  47919. <h3 class="section"><span>39.174 nlmeans<a class="copiable-link" href="#nlmeans-1"> &para;</a></span></h3>
  47920. <p>Denoise frames using Non-Local Means algorithm.
  47921. </p>
  47922. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  47923. context similarity is defined by comparing their surrounding patches of size
  47924. <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>
  47925. around the pixel.
  47926. </p>
  47927. <p>Note that the research area defines centers for patches, which means some
  47928. patches will be made of pixels outside that research area.
  47929. </p>
  47930. <p>The filter accepts the following options.
  47931. </p>
  47932. <dl class="table">
  47933. <dt><samp class="option">s</samp></dt>
  47934. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  47935. </p>
  47936. </dd>
  47937. <dt><samp class="option">p</samp></dt>
  47938. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  47939. </p>
  47940. </dd>
  47941. <dt><samp class="option">pc</samp></dt>
  47942. <dd><p>Same as <samp class="option">p</samp> but for chroma planes.
  47943. </p>
  47944. <p>The default value is <var class="var">0</var> and means automatic.
  47945. </p>
  47946. </dd>
  47947. <dt><samp class="option">r</samp></dt>
  47948. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  47949. </p>
  47950. </dd>
  47951. <dt><samp class="option">rc</samp></dt>
  47952. <dd><p>Same as <samp class="option">r</samp> but for chroma planes.
  47953. </p>
  47954. <p>The default value is <var class="var">0</var> and means automatic.
  47955. </p></dd>
  47956. </dl>
  47957. </div>
  47958. <div class="section-level-extent" id="nnedi">
  47959. <h3 class="section"><span>39.175 nnedi<a class="copiable-link" href="#nnedi"> &para;</a></span></h3>
  47960. <p>Deinterlace video using neural network edge directed interpolation.
  47961. </p>
  47962. <p>This filter accepts the following options:
  47963. </p>
  47964. <dl class="table">
  47965. <dt><samp class="option">weights</samp></dt>
  47966. <dd><p>Mandatory option, without binary file filter can not work.
  47967. Currently file can be found here:
  47968. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  47969. </p>
  47970. </dd>
  47971. <dt><samp class="option">deint</samp></dt>
  47972. <dd><p>Set which frames to deinterlace, by default it is <code class="code">all</code>.
  47973. Can be <code class="code">all</code> or <code class="code">interlaced</code>.
  47974. </p>
  47975. </dd>
  47976. <dt><samp class="option">field</samp></dt>
  47977. <dd><p>Set mode of operation.
  47978. </p>
  47979. <p>Can be one of the following:
  47980. </p>
  47981. <dl class="table">
  47982. <dt>&lsquo;<samp class="samp">af</samp>&rsquo;</dt>
  47983. <dd><p>Use frame flags, both fields.
  47984. </p></dd>
  47985. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  47986. <dd><p>Use frame flags, single field.
  47987. </p></dd>
  47988. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  47989. <dd><p>Use top field only.
  47990. </p></dd>
  47991. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  47992. <dd><p>Use bottom field only.
  47993. </p></dd>
  47994. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  47995. <dd><p>Use both fields, top first.
  47996. </p></dd>
  47997. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  47998. <dd><p>Use both fields, bottom first.
  47999. </p></dd>
  48000. </dl>
  48001. </dd>
  48002. <dt><samp class="option">planes</samp></dt>
  48003. <dd><p>Set which planes to process, by default filter process all frames.
  48004. </p>
  48005. </dd>
  48006. <dt><samp class="option">nsize</samp></dt>
  48007. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  48008. network.
  48009. </p>
  48010. <p>Can be one of the following:
  48011. </p>
  48012. <dl class="table">
  48013. <dt>&lsquo;<samp class="samp">s8x6</samp>&rsquo;</dt>
  48014. <dt>&lsquo;<samp class="samp">s16x6</samp>&rsquo;</dt>
  48015. <dt>&lsquo;<samp class="samp">s32x6</samp>&rsquo;</dt>
  48016. <dt>&lsquo;<samp class="samp">s48x6</samp>&rsquo;</dt>
  48017. <dt>&lsquo;<samp class="samp">s8x4</samp>&rsquo;</dt>
  48018. <dt>&lsquo;<samp class="samp">s16x4</samp>&rsquo;</dt>
  48019. <dt>&lsquo;<samp class="samp">s32x4</samp>&rsquo;</dt>
  48020. </dl>
  48021. </dd>
  48022. <dt><samp class="option">nns</samp></dt>
  48023. <dd><p>Set the number of neurons in predictor neural network.
  48024. Can be one of the following:
  48025. </p>
  48026. <dl class="table">
  48027. <dt>&lsquo;<samp class="samp">n16</samp>&rsquo;</dt>
  48028. <dt>&lsquo;<samp class="samp">n32</samp>&rsquo;</dt>
  48029. <dt>&lsquo;<samp class="samp">n64</samp>&rsquo;</dt>
  48030. <dt>&lsquo;<samp class="samp">n128</samp>&rsquo;</dt>
  48031. <dt>&lsquo;<samp class="samp">n256</samp>&rsquo;</dt>
  48032. </dl>
  48033. </dd>
  48034. <dt><samp class="option">qual</samp></dt>
  48035. <dd><p>Controls the number of different neural network predictions that are blended
  48036. together to compute the final output value. Can be <code class="code">fast</code>, default or
  48037. <code class="code">slow</code>.
  48038. </p>
  48039. </dd>
  48040. <dt><samp class="option">etype</samp></dt>
  48041. <dd><p>Set which set of weights to use in the predictor.
  48042. Can be one of the following:
  48043. </p>
  48044. <dl class="table">
  48045. <dt>&lsquo;<samp class="samp">a, abs</samp>&rsquo;</dt>
  48046. <dd><p>weights trained to minimize absolute error
  48047. </p></dd>
  48048. <dt>&lsquo;<samp class="samp">s, mse</samp>&rsquo;</dt>
  48049. <dd><p>weights trained to minimize squared error
  48050. </p></dd>
  48051. </dl>
  48052. </dd>
  48053. <dt><samp class="option">pscrn</samp></dt>
  48054. <dd><p>Controls whether or not the prescreener neural network is used to decide
  48055. which pixels should be processed by the predictor neural network and which
  48056. can be handled by simple cubic interpolation.
  48057. The prescreener is trained to know whether cubic interpolation will be
  48058. sufficient for a pixel or whether it should be predicted by the predictor nn.
  48059. The computational complexity of the prescreener nn is much less than that of
  48060. the predictor nn. Since most pixels can be handled by cubic interpolation,
  48061. using the prescreener generally results in much faster processing.
  48062. The prescreener is pretty accurate, so the difference between using it and not
  48063. using it is almost always unnoticeable.
  48064. </p>
  48065. <p>Can be one of the following:
  48066. </p>
  48067. <dl class="table">
  48068. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  48069. <dt>&lsquo;<samp class="samp">original</samp>&rsquo;</dt>
  48070. <dt>&lsquo;<samp class="samp">new</samp>&rsquo;</dt>
  48071. <dt>&lsquo;<samp class="samp">new2</samp>&rsquo;</dt>
  48072. <dt>&lsquo;<samp class="samp">new3</samp>&rsquo;</dt>
  48073. </dl>
  48074. <p>Default is <code class="code">new</code>.
  48075. </p></dd>
  48076. </dl>
  48077. <ul class="mini-toc">
  48078. <li><a href="#Commands-125" accesskey="1">Commands</a></li>
  48079. </ul>
  48080. <div class="subsection-level-extent" id="Commands-125">
  48081. <h4 class="subsection"><span>39.175.1 Commands<a class="copiable-link" href="#Commands-125"> &para;</a></span></h4>
  48082. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">weights</var> option.
  48083. </p>
  48084. </div>
  48085. </div>
  48086. <div class="section-level-extent" id="noformat">
  48087. <h3 class="section"><span>39.176 noformat<a class="copiable-link" href="#noformat"> &para;</a></span></h3>
  48088. <p>Force libavfilter not to use any of the specified pixel formats for the
  48089. input to the next filter.
  48090. </p>
  48091. <p>It accepts the following parameters:
  48092. </p><dl class="table">
  48093. <dt><samp class="option">pix_fmts</samp></dt>
  48094. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  48095. pix_fmts=yuv420p|monow|rgb24&quot;.
  48096. </p>
  48097. </dd>
  48098. </dl>
  48099. <ul class="mini-toc">
  48100. <li><a href="#Examples-140" accesskey="1">Examples</a></li>
  48101. </ul>
  48102. <div class="subsection-level-extent" id="Examples-140">
  48103. <h4 class="subsection"><span>39.176.1 Examples<a class="copiable-link" href="#Examples-140"> &para;</a></span></h4>
  48104. <ul class="itemize mark-bullet">
  48105. <li>Force libavfilter to use a format different from <var class="var">yuv420p</var> for the
  48106. input to the vflip filter:
  48107. <div class="example">
  48108. <pre class="example-preformatted">noformat=pix_fmts=yuv420p,vflip
  48109. </pre></div>
  48110. </li><li>Convert the input video to any of the formats not contained in the list:
  48111. <div class="example">
  48112. <pre class="example-preformatted">noformat=yuv420p|yuv444p|yuv410p
  48113. </pre></div>
  48114. </li></ul>
  48115. </div>
  48116. </div>
  48117. <div class="section-level-extent" id="noise-1">
  48118. <h3 class="section"><span>39.177 noise<a class="copiable-link" href="#noise-1"> &para;</a></span></h3>
  48119. <p>Add noise on video input frame.
  48120. </p>
  48121. <p>The filter accepts the following options:
  48122. </p>
  48123. <dl class="table">
  48124. <dt><samp class="option">all_seed</samp></dt>
  48125. <dt><samp class="option">c0_seed</samp></dt>
  48126. <dt><samp class="option">c1_seed</samp></dt>
  48127. <dt><samp class="option">c2_seed</samp></dt>
  48128. <dt><samp class="option">c3_seed</samp></dt>
  48129. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  48130. of <var class="var">all_seed</var>. Default value is <code class="code">123457</code>.
  48131. </p>
  48132. </dd>
  48133. <dt><samp class="option">all_strength, alls</samp></dt>
  48134. <dt><samp class="option">c0_strength, c0s</samp></dt>
  48135. <dt><samp class="option">c1_strength, c1s</samp></dt>
  48136. <dt><samp class="option">c2_strength, c2s</samp></dt>
  48137. <dt><samp class="option">c3_strength, c3s</samp></dt>
  48138. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  48139. <var class="var">all_strength</var>. Default value is <code class="code">0</code>. Allowed range is [0, 100].
  48140. </p>
  48141. </dd>
  48142. <dt><samp class="option">all_flags, allf</samp></dt>
  48143. <dt><samp class="option">c0_flags, c0f</samp></dt>
  48144. <dt><samp class="option">c1_flags, c1f</samp></dt>
  48145. <dt><samp class="option">c2_flags, c2f</samp></dt>
  48146. <dt><samp class="option">c3_flags, c3f</samp></dt>
  48147. <dd><p>Set pixel component flags or set flags for all components if <var class="var">all_flags</var>.
  48148. Available values for component flags are:
  48149. </p><dl class="table">
  48150. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  48151. <dd><p>averaged temporal noise (smoother)
  48152. </p></dd>
  48153. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  48154. <dd><p>mix random noise with a (semi)regular pattern
  48155. </p></dd>
  48156. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  48157. <dd><p>temporal noise (noise pattern changes between frames)
  48158. </p></dd>
  48159. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  48160. <dd><p>uniform noise (gaussian otherwise)
  48161. </p></dd>
  48162. </dl>
  48163. </dd>
  48164. </dl>
  48165. <ul class="mini-toc">
  48166. <li><a href="#Examples-141" accesskey="1">Examples</a></li>
  48167. </ul>
  48168. <div class="subsection-level-extent" id="Examples-141">
  48169. <h4 class="subsection"><span>39.177.1 Examples<a class="copiable-link" href="#Examples-141"> &para;</a></span></h4>
  48170. <p>Add temporal and uniform noise to input video:
  48171. </p><div class="example">
  48172. <pre class="example-preformatted">noise=alls=20:allf=t+u
  48173. </pre></div>
  48174. </div>
  48175. </div>
  48176. <div class="section-level-extent" id="normalize">
  48177. <h3 class="section"><span>39.178 normalize<a class="copiable-link" href="#normalize"> &para;</a></span></h3>
  48178. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  48179. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  48180. </p>
  48181. <p>For each channel of each frame, the filter computes the input range and maps
  48182. it linearly to the user-specified output range. The output range defaults
  48183. to the full dynamic range from pure black to pure white.
  48184. </p>
  48185. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  48186. changes in brightness) caused when small dark or bright objects enter or leave
  48187. the scene. This is similar to the auto-exposure (automatic gain control) on a
  48188. video camera, and, like a video camera, it may cause a period of over- or
  48189. under-exposure of the video.
  48190. </p>
  48191. <p>The R,G,B channels can be normalized independently, which may cause some
  48192. color shifting, or linked together as a single channel, which prevents
  48193. color shifting. Linked normalization preserves hue. Independent normalization
  48194. does not, so it can be used to remove some color casts. Independent and linked
  48195. normalization can be combined in any ratio.
  48196. </p>
  48197. <p>The normalize filter accepts the following options:
  48198. </p>
  48199. <dl class="table">
  48200. <dt><samp class="option">blackpt</samp></dt>
  48201. <dt><samp class="option">whitept</samp></dt>
  48202. <dd><p>Colors which define the output range. The minimum input value is mapped to
  48203. the <var class="var">blackpt</var>. The maximum input value is mapped to the <var class="var">whitept</var>.
  48204. The defaults are black and white respectively. Specifying white for
  48205. <var class="var">blackpt</var> and black for <var class="var">whitept</var> will give color-inverted,
  48206. normalized video. Shades of grey can be used to reduce the dynamic range
  48207. (contrast). Specifying saturated colors here can create some interesting
  48208. effects.
  48209. </p>
  48210. </dd>
  48211. <dt><samp class="option">smoothing</samp></dt>
  48212. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  48213. of each channel is smoothed using a rolling average over the current frame
  48214. and the <var class="var">smoothing</var> previous frames. The default is 0 (no temporal
  48215. smoothing).
  48216. </p>
  48217. </dd>
  48218. <dt><samp class="option">independence</samp></dt>
  48219. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  48220. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  48221. independent. Defaults to 1.0 (fully independent).
  48222. </p>
  48223. </dd>
  48224. <dt><samp class="option">strength</samp></dt>
  48225. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  48226. expensive no-op. Defaults to 1.0 (full strength).
  48227. </p>
  48228. </dd>
  48229. </dl>
  48230. <ul class="mini-toc">
  48231. <li><a href="#Commands-126" accesskey="1">Commands</a></li>
  48232. <li><a href="#Examples-142" accesskey="2">Examples</a></li>
  48233. </ul>
  48234. <div class="subsection-level-extent" id="Commands-126">
  48235. <h4 class="subsection"><span>39.178.1 Commands<a class="copiable-link" href="#Commands-126"> &para;</a></span></h4>
  48236. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">smoothing</var> option.
  48237. The command accepts the same syntax of the corresponding option.
  48238. </p>
  48239. <p>If the specified expression is not valid, it is kept at its current
  48240. value.
  48241. </p>
  48242. </div>
  48243. <div class="subsection-level-extent" id="Examples-142">
  48244. <h4 class="subsection"><span>39.178.2 Examples<a class="copiable-link" href="#Examples-142"> &para;</a></span></h4>
  48245. <p>Stretch video contrast to use the full dynamic range, with no temporal
  48246. smoothing; may flicker depending on the source content:
  48247. </p><div class="example">
  48248. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=0
  48249. </pre></div>
  48250. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  48251. reduced, depending on the source content:
  48252. </p><div class="example">
  48253. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50
  48254. </pre></div>
  48255. <p>As above, but with hue-preserving linked channel normalization:
  48256. </p><div class="example">
  48257. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  48258. </pre></div>
  48259. <p>As above, but with half strength:
  48260. </p><div class="example">
  48261. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  48262. </pre></div>
  48263. <p>Map the darkest input color to red, the brightest input color to cyan:
  48264. </p><div class="example">
  48265. <pre class="example-preformatted">normalize=blackpt=red:whitept=cyan
  48266. </pre></div>
  48267. </div>
  48268. </div>
  48269. <div class="section-level-extent" id="null-2">
  48270. <h3 class="section"><span>39.179 null<a class="copiable-link" href="#null-2"> &para;</a></span></h3>
  48271. <p>Pass the video source unchanged to the output.
  48272. </p>
  48273. </div>
  48274. <div class="section-level-extent" id="ocr">
  48275. <h3 class="section"><span>39.180 ocr<a class="copiable-link" href="#ocr"> &para;</a></span></h3>
  48276. <p>Optical Character Recognition
  48277. </p>
  48278. <p>This filter uses Tesseract for optical character recognition. To enable
  48279. compilation of this filter, you need to configure FFmpeg with
  48280. <code class="code">--enable-libtesseract</code>.
  48281. </p>
  48282. <p>It accepts the following options:
  48283. </p>
  48284. <dl class="table">
  48285. <dt><samp class="option">datapath</samp></dt>
  48286. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  48287. set at installation.
  48288. </p>
  48289. </dd>
  48290. <dt><samp class="option">language</samp></dt>
  48291. <dd><p>Set language, default is &quot;eng&quot;.
  48292. </p>
  48293. </dd>
  48294. <dt><samp class="option">whitelist</samp></dt>
  48295. <dd><p>Set character whitelist.
  48296. </p>
  48297. </dd>
  48298. <dt><samp class="option">blacklist</samp></dt>
  48299. <dd><p>Set character blacklist.
  48300. </p></dd>
  48301. </dl>
  48302. <p>The filter exports recognized text as the frame metadata <code class="code">lavfi.ocr.text</code>.
  48303. The filter exports confidence of recognized words as the frame metadata <code class="code">lavfi.ocr.confidence</code>.
  48304. </p>
  48305. </div>
  48306. <div class="section-level-extent" id="ocv">
  48307. <h3 class="section"><span>39.181 ocv<a class="copiable-link" href="#ocv"> &para;</a></span></h3>
  48308. <p>Apply a video transform using libopencv.
  48309. </p>
  48310. <p>To enable this filter, install the libopencv library and headers and
  48311. configure FFmpeg with <code class="code">--enable-libopencv</code>.
  48312. </p>
  48313. <p>It accepts the following parameters:
  48314. </p>
  48315. <dl class="table">
  48316. <dt><samp class="option">filter_name</samp></dt>
  48317. <dd><p>The name of the libopencv filter to apply.
  48318. </p>
  48319. </dd>
  48320. <dt><samp class="option">filter_params</samp></dt>
  48321. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  48322. values are assumed.
  48323. </p>
  48324. </dd>
  48325. </dl>
  48326. <p>Refer to the official libopencv documentation for more precise
  48327. information:
  48328. <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>
  48329. </p>
  48330. <p>Several libopencv filters are supported; see the following subsections.
  48331. </p>
  48332. <a class="anchor" id="dilate"></a><ul class="mini-toc">
  48333. <li><a href="#dilate-1" accesskey="1">dilate</a></li>
  48334. <li><a href="#erode" accesskey="2">erode</a></li>
  48335. <li><a href="#smooth" accesskey="3">smooth</a></li>
  48336. </ul>
  48337. <div class="subsection-level-extent" id="dilate-1">
  48338. <h4 class="subsection"><span>39.181.1 dilate<a class="copiable-link" href="#dilate-1"> &para;</a></span></h4>
  48339. <p>Dilate an image by using a specific structuring element.
  48340. It corresponds to the libopencv function <code class="code">cvDilate</code>.
  48341. </p>
  48342. <p>It accepts the parameters: <var class="var">struct_el</var>|<var class="var">nb_iterations</var>.
  48343. </p>
  48344. <p><var class="var">struct_el</var> represents a structuring element, and has the syntax:
  48345. <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>
  48346. </p>
  48347. <p><var class="var">cols</var> and <var class="var">rows</var> represent the number of columns and rows of
  48348. the structuring element, <var class="var">anchor_x</var> and <var class="var">anchor_y</var> the anchor
  48349. point, and <var class="var">shape</var> the shape for the structuring element. <var class="var">shape</var>
  48350. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  48351. </p>
  48352. <p>If the value for <var class="var">shape</var> is &quot;custom&quot;, it must be followed by a
  48353. string of the form &quot;=<var class="var">filename</var>&quot;. The file with name
  48354. <var class="var">filename</var> is assumed to represent a binary image, with each
  48355. printable character corresponding to a bright pixel. When a custom
  48356. <var class="var">shape</var> is used, <var class="var">cols</var> and <var class="var">rows</var> are ignored, the number
  48357. or columns and rows of the read file are assumed instead.
  48358. </p>
  48359. <p>The default value for <var class="var">struct_el</var> is &quot;3x3+0x0/rect&quot;.
  48360. </p>
  48361. <p><var class="var">nb_iterations</var> specifies the number of times the transform is
  48362. applied to the image, and defaults to 1.
  48363. </p>
  48364. <p>Some examples:
  48365. </p><div class="example">
  48366. <pre class="example-preformatted"># Use the default values
  48367. ocv=dilate
  48368. # Dilate using a structuring element with a 5x5 cross, iterating two times
  48369. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  48370. # Read the shape from the file diamond.shape, iterating two times.
  48371. # The file diamond.shape may contain a pattern of characters like this
  48372. # *
  48373. # ***
  48374. # *****
  48375. # ***
  48376. # *
  48377. # The specified columns and rows are ignored
  48378. # but the anchor point coordinates are not
  48379. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  48380. </pre></div>
  48381. </div>
  48382. <div class="subsection-level-extent" id="erode">
  48383. <h4 class="subsection"><span>39.181.2 erode<a class="copiable-link" href="#erode"> &para;</a></span></h4>
  48384. <p>Erode an image by using a specific structuring element.
  48385. It corresponds to the libopencv function <code class="code">cvErode</code>.
  48386. </p>
  48387. <p>It accepts the parameters: <var class="var">struct_el</var>:<var class="var">nb_iterations</var>,
  48388. with the same syntax and semantics as the <a class="ref" href="#dilate">dilate</a> filter.
  48389. </p>
  48390. </div>
  48391. <div class="subsection-level-extent" id="smooth">
  48392. <h4 class="subsection"><span>39.181.3 smooth<a class="copiable-link" href="#smooth"> &para;</a></span></h4>
  48393. <p>Smooth the input video.
  48394. </p>
  48395. <p>The filter takes the following parameters:
  48396. <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>.
  48397. </p>
  48398. <p><var class="var">type</var> is the type of smooth filter to apply, and must be one of
  48399. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  48400. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  48401. </p>
  48402. <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>
  48403. depends on the smooth type. <var class="var">param1</var> and
  48404. <var class="var">param2</var> accept integer positive values or 0. <var class="var">param3</var> and
  48405. <var class="var">param4</var> accept floating point values.
  48406. </p>
  48407. <p>The default value for <var class="var">param1</var> is 3. The default value for the
  48408. other parameters is 0.
  48409. </p>
  48410. <p>These parameters correspond to the parameters assigned to the
  48411. libopencv function <code class="code">cvSmooth</code>.
  48412. </p>
  48413. </div>
  48414. </div>
  48415. <div class="section-level-extent" id="oscilloscope">
  48416. <h3 class="section"><span>39.182 oscilloscope<a class="copiable-link" href="#oscilloscope"> &para;</a></span></h3>
  48417. <p>2D Video Oscilloscope.
  48418. </p>
  48419. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  48420. </p>
  48421. <p>It accepts the following parameters:
  48422. </p>
  48423. <dl class="table">
  48424. <dt><samp class="option">x</samp></dt>
  48425. <dd><p>Set scope center x position.
  48426. </p>
  48427. </dd>
  48428. <dt><samp class="option">y</samp></dt>
  48429. <dd><p>Set scope center y position.
  48430. </p>
  48431. </dd>
  48432. <dt><samp class="option">s</samp></dt>
  48433. <dd><p>Set scope size, relative to frame diagonal.
  48434. </p>
  48435. </dd>
  48436. <dt><samp class="option">t</samp></dt>
  48437. <dd><p>Set scope tilt/rotation.
  48438. </p>
  48439. </dd>
  48440. <dt><samp class="option">o</samp></dt>
  48441. <dd><p>Set trace opacity.
  48442. </p>
  48443. </dd>
  48444. <dt><samp class="option">tx</samp></dt>
  48445. <dd><p>Set trace center x position.
  48446. </p>
  48447. </dd>
  48448. <dt><samp class="option">ty</samp></dt>
  48449. <dd><p>Set trace center y position.
  48450. </p>
  48451. </dd>
  48452. <dt><samp class="option">tw</samp></dt>
  48453. <dd><p>Set trace width, relative to width of frame.
  48454. </p>
  48455. </dd>
  48456. <dt><samp class="option">th</samp></dt>
  48457. <dd><p>Set trace height, relative to height of frame.
  48458. </p>
  48459. </dd>
  48460. <dt><samp class="option">c</samp></dt>
  48461. <dd><p>Set which components to trace. By default it traces first three components.
  48462. </p>
  48463. </dd>
  48464. <dt><samp class="option">g</samp></dt>
  48465. <dd><p>Draw trace grid. By default is enabled.
  48466. </p>
  48467. </dd>
  48468. <dt><samp class="option">st</samp></dt>
  48469. <dd><p>Draw some statistics. By default is enabled.
  48470. </p>
  48471. </dd>
  48472. <dt><samp class="option">sc</samp></dt>
  48473. <dd><p>Draw scope. By default is enabled.
  48474. </p></dd>
  48475. </dl>
  48476. <ul class="mini-toc">
  48477. <li><a href="#Commands-127" accesskey="1">Commands</a></li>
  48478. <li><a href="#Examples-143" accesskey="2">Examples</a></li>
  48479. </ul>
  48480. <div class="subsection-level-extent" id="Commands-127">
  48481. <h4 class="subsection"><span>39.182.1 Commands<a class="copiable-link" href="#Commands-127"> &para;</a></span></h4>
  48482. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  48483. The command accepts the same syntax of the corresponding option.
  48484. </p>
  48485. <p>If the specified expression is not valid, it is kept at its current
  48486. value.
  48487. </p>
  48488. </div>
  48489. <div class="subsection-level-extent" id="Examples-143">
  48490. <h4 class="subsection"><span>39.182.2 Examples<a class="copiable-link" href="#Examples-143"> &para;</a></span></h4>
  48491. <ul class="itemize mark-bullet">
  48492. <li>Inspect full first row of video frame.
  48493. <div class="example">
  48494. <pre class="example-preformatted">oscilloscope=x=0.5:y=0:s=1
  48495. </pre></div>
  48496. </li><li>Inspect full last row of video frame.
  48497. <div class="example">
  48498. <pre class="example-preformatted">oscilloscope=x=0.5:y=1:s=1
  48499. </pre></div>
  48500. </li><li>Inspect full 5th line of video frame of height 1080.
  48501. <div class="example">
  48502. <pre class="example-preformatted">oscilloscope=x=0.5:y=5/1080:s=1
  48503. </pre></div>
  48504. </li><li>Inspect full last column of video frame.
  48505. <div class="example">
  48506. <pre class="example-preformatted">oscilloscope=x=1:y=0.5:s=1:t=1
  48507. </pre></div>
  48508. </li></ul>
  48509. <a class="anchor" id="overlay"></a></div>
  48510. </div>
  48511. <div class="section-level-extent" id="overlay-1">
  48512. <h3 class="section"><span>39.183 overlay<a class="copiable-link" href="#overlay-1"> &para;</a></span></h3>
  48513. <p>Overlay one video on top of another.
  48514. </p>
  48515. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  48516. video on which the second input is overlaid.
  48517. </p>
  48518. <p>It accepts the following parameters:
  48519. </p>
  48520. <p>A description of the accepted options follows.
  48521. </p>
  48522. <dl class="table">
  48523. <dt><samp class="option">x</samp></dt>
  48524. <dt><samp class="option">y</samp></dt>
  48525. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  48526. on the main video. Default value is &quot;0&quot; for both expressions. In case
  48527. the expression is invalid, it is set to a huge value (meaning that the
  48528. overlay will not be displayed within the output visible area).
  48529. </p>
  48530. </dd>
  48531. <dt><samp class="option">eof_action</samp></dt>
  48532. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  48533. </p>
  48534. </dd>
  48535. <dt><samp class="option">eval</samp></dt>
  48536. <dd><p>Set when the expressions for <samp class="option">x</samp>, and <samp class="option">y</samp> are evaluated.
  48537. </p>
  48538. <p>It accepts the following values:
  48539. </p><dl class="table">
  48540. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  48541. <dd><p>only evaluate expressions once during the filter initialization or
  48542. when a command is processed
  48543. </p>
  48544. </dd>
  48545. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  48546. <dd><p>evaluate expressions for each incoming frame
  48547. </p></dd>
  48548. </dl>
  48549. <p>Default value is &lsquo;<samp class="samp">frame</samp>&rsquo;.
  48550. </p>
  48551. </dd>
  48552. <dt><samp class="option">shortest</samp></dt>
  48553. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  48554. </p>
  48555. </dd>
  48556. <dt><samp class="option">format</samp></dt>
  48557. <dd><p>Set the format for the output video.
  48558. </p>
  48559. <p>It accepts the following values:
  48560. </p><dl class="table">
  48561. <dt>&lsquo;<samp class="samp">yuv420</samp>&rsquo;</dt>
  48562. <dd><p>force YUV 4:2:0 8-bit planar output
  48563. </p>
  48564. </dd>
  48565. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  48566. <dd><p>force YUV 4:2:0 10-bit planar output
  48567. </p>
  48568. </dd>
  48569. <dt>&lsquo;<samp class="samp">yuv422</samp>&rsquo;</dt>
  48570. <dd><p>force YUV 4:2:2 8-bit planar output
  48571. </p>
  48572. </dd>
  48573. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  48574. <dd><p>force YUV 4:2:2 10-bit planar output
  48575. </p>
  48576. </dd>
  48577. <dt>&lsquo;<samp class="samp">yuv444</samp>&rsquo;</dt>
  48578. <dd><p>force YUV 4:4:4 8-bit planar output
  48579. </p>
  48580. </dd>
  48581. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  48582. <dd><p>force YUV 4:4:4 10-bit planar output
  48583. </p>
  48584. </dd>
  48585. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  48586. <dd><p>force RGB 8-bit packed output
  48587. </p>
  48588. </dd>
  48589. <dt>&lsquo;<samp class="samp">gbrp</samp>&rsquo;</dt>
  48590. <dd><p>force RGB 8-bit planar output
  48591. </p>
  48592. </dd>
  48593. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  48594. <dd><p>automatically pick format
  48595. </p></dd>
  48596. </dl>
  48597. <p>Default value is &lsquo;<samp class="samp">yuv420</samp>&rsquo;.
  48598. </p>
  48599. </dd>
  48600. <dt><samp class="option">repeatlast</samp></dt>
  48601. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  48602. </p>
  48603. </dd>
  48604. <dt><samp class="option">alpha</samp></dt>
  48605. <dd><p>Set format of alpha of the overlaid video, it can be <var class="var">straight</var> or
  48606. <var class="var">premultiplied</var>. Default is <var class="var">straight</var>.
  48607. </p></dd>
  48608. </dl>
  48609. <p>The <samp class="option">x</samp>, and <samp class="option">y</samp> expressions can contain the following
  48610. parameters.
  48611. </p>
  48612. <dl class="table">
  48613. <dt><samp class="option">main_w, W</samp></dt>
  48614. <dt><samp class="option">main_h, H</samp></dt>
  48615. <dd><p>The main input width and height.
  48616. </p>
  48617. </dd>
  48618. <dt><samp class="option">overlay_w, w</samp></dt>
  48619. <dt><samp class="option">overlay_h, h</samp></dt>
  48620. <dd><p>The overlay input width and height.
  48621. </p>
  48622. </dd>
  48623. <dt><samp class="option">x</samp></dt>
  48624. <dt><samp class="option">y</samp></dt>
  48625. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  48626. each new frame.
  48627. </p>
  48628. </dd>
  48629. <dt><samp class="option">hsub</samp></dt>
  48630. <dt><samp class="option">vsub</samp></dt>
  48631. <dd><p>horizontal and vertical chroma subsample values of the output
  48632. format. For example for the pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and
  48633. <var class="var">vsub</var> is 1.
  48634. </p>
  48635. </dd>
  48636. <dt><samp class="option">n</samp></dt>
  48637. <dd><p>the number of input frame, starting from 0
  48638. </p>
  48639. </dd>
  48640. <dt><samp class="option">pos</samp></dt>
  48641. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  48642. do not use
  48643. </p>
  48644. </dd>
  48645. <dt><samp class="option">t</samp></dt>
  48646. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  48647. </p>
  48648. </dd>
  48649. </dl>
  48650. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  48651. </p>
  48652. <p>Note that the <var class="var">n</var>, <var class="var">t</var> variables are available only
  48653. when evaluation is done <em class="emph">per frame</em>, and will evaluate to NAN
  48654. when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">init</samp>&rsquo;.
  48655. </p>
  48656. <p>Be aware that frames are taken from each input video in timestamp
  48657. order, hence, if their initial timestamps differ, it is a good idea
  48658. to pass the two inputs through a <var class="var">setpts=PTS-STARTPTS</var> filter to
  48659. have them begin in the same zero timestamp, as the example for
  48660. the <var class="var">movie</var> filter does.
  48661. </p>
  48662. <p>You can chain together more overlays but you should test the
  48663. efficiency of such approach.
  48664. </p>
  48665. <ul class="mini-toc">
  48666. <li><a href="#Commands-128" accesskey="1">Commands</a></li>
  48667. <li><a href="#Examples-144" accesskey="2">Examples</a></li>
  48668. </ul>
  48669. <div class="subsection-level-extent" id="Commands-128">
  48670. <h4 class="subsection"><span>39.183.1 Commands<a class="copiable-link" href="#Commands-128"> &para;</a></span></h4>
  48671. <p>This filter supports the following commands:
  48672. </p><dl class="table">
  48673. <dt><samp class="option">x</samp></dt>
  48674. <dt><samp class="option">y</samp></dt>
  48675. <dd><p>Modify the x and y of the overlay input.
  48676. The command accepts the same syntax of the corresponding option.
  48677. </p>
  48678. <p>If the specified expression is not valid, it is kept at its current
  48679. value.
  48680. </p></dd>
  48681. </dl>
  48682. </div>
  48683. <div class="subsection-level-extent" id="Examples-144">
  48684. <h4 class="subsection"><span>39.183.2 Examples<a class="copiable-link" href="#Examples-144"> &para;</a></span></h4>
  48685. <ul class="itemize mark-bullet">
  48686. <li>Draw the overlay at 10 pixels from the bottom right corner of the main
  48687. video:
  48688. <div class="example">
  48689. <pre class="example-preformatted">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  48690. </pre></div>
  48691. <p>Using named options the example above becomes:
  48692. </p><div class="example">
  48693. <pre class="example-preformatted">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  48694. </pre></div>
  48695. </li><li>Insert a transparent PNG logo in the bottom left corner of the input,
  48696. using the <code class="command">ffmpeg</code> tool with the <code class="code">-filter_complex</code> option:
  48697. <div class="example">
  48698. <pre class="example-preformatted">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  48699. </pre></div>
  48700. </li><li>Insert 2 different transparent PNG logos (second logo on bottom
  48701. right corner) using the <code class="command">ffmpeg</code> tool:
  48702. <div class="example">
  48703. <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
  48704. </pre></div>
  48705. </li><li>Add a transparent color layer on top of the main video; <code class="code">WxH</code>
  48706. must specify the size of the main input to the overlay filter:
  48707. <div class="example">
  48708. <pre class="example-preformatted">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  48709. </pre></div>
  48710. </li><li>Play an original video and a filtered version (here with the deshake
  48711. filter) side by side using the <code class="command">ffplay</code> tool:
  48712. <div class="example">
  48713. <pre class="example-preformatted">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  48714. </pre></div>
  48715. <p>The above command is the same as:
  48716. </p><div class="example">
  48717. <pre class="example-preformatted">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  48718. </pre></div>
  48719. </li><li>Make a sliding overlay appearing from the left to the right top part of the
  48720. screen starting since time 2:
  48721. <div class="example">
  48722. <pre class="example-preformatted">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  48723. </pre></div>
  48724. </li><li>Compose output by putting two input videos side to side:
  48725. <div class="example">
  48726. <pre class="example-preformatted">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  48727. nullsrc=size=200x100 [background];
  48728. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  48729. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  48730. [background][left] overlay=shortest=1 [background+left];
  48731. [background+left][right] overlay=shortest=1:x=100 [left+right]
  48732. &quot;
  48733. </pre></div>
  48734. </li><li>Mask 10-20 seconds of a video by applying the delogo filter to a section
  48735. <div class="example">
  48736. <pre class="example-preformatted">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  48737. -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]'
  48738. masked.avi
  48739. </pre></div>
  48740. </li><li>Chain several overlays in cascade:
  48741. <div class="example">
  48742. <pre class="example-preformatted">nullsrc=s=200x200 [bg];
  48743. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  48744. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  48745. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  48746. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  48747. [in3] null, [mid2] overlay=100:100 [out0]
  48748. </pre></div>
  48749. </li></ul>
  48750. <a class="anchor" id="overlay_005fcuda"></a></div>
  48751. </div>
  48752. <div class="section-level-extent" id="overlay_005fcuda-1">
  48753. <h3 class="section"><span>39.184 overlay_cuda<a class="copiable-link" href="#overlay_005fcuda-1"> &para;</a></span></h3>
  48754. <p>Overlay one video on top of another.
  48755. </p>
  48756. <p>This is the CUDA variant of the <a class="ref" href="#overlay">overlay</a> filter.
  48757. It only accepts CUDA frames. The underlying input pixel formats have to match.
  48758. </p>
  48759. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  48760. video on which the second input is overlaid.
  48761. </p>
  48762. <p>It accepts the following parameters:
  48763. </p>
  48764. <dl class="table">
  48765. <dt><samp class="option">x</samp></dt>
  48766. <dt><samp class="option">y</samp></dt>
  48767. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  48768. on the main video.
  48769. </p>
  48770. <p>They can contain the following parameters:
  48771. </p>
  48772. <dl class="table">
  48773. <dt><samp class="option">main_w, W</samp></dt>
  48774. <dt><samp class="option">main_h, H</samp></dt>
  48775. <dd><p>The main input width and height.
  48776. </p>
  48777. </dd>
  48778. <dt><samp class="option">overlay_w, w</samp></dt>
  48779. <dt><samp class="option">overlay_h, h</samp></dt>
  48780. <dd><p>The overlay input width and height.
  48781. </p>
  48782. </dd>
  48783. <dt><samp class="option">x</samp></dt>
  48784. <dt><samp class="option">y</samp></dt>
  48785. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  48786. each new frame.
  48787. </p>
  48788. </dd>
  48789. <dt><samp class="option">n</samp></dt>
  48790. <dd><p>The ordinal index of the main input frame, starting from 0.
  48791. </p>
  48792. </dd>
  48793. <dt><samp class="option">pos</samp></dt>
  48794. <dd><p>The byte offset position in the file of the main input frame, NAN if unknown.
  48795. Deprecated, do not use.
  48796. </p>
  48797. </dd>
  48798. <dt><samp class="option">t</samp></dt>
  48799. <dd><p>The timestamp of the main input frame, expressed in seconds, NAN if unknown.
  48800. </p>
  48801. </dd>
  48802. </dl>
  48803. <p>Default value is &quot;0&quot; for both expressions.
  48804. </p>
  48805. </dd>
  48806. <dt><samp class="option">eval</samp></dt>
  48807. <dd><p>Set when the expressions for <samp class="option">x</samp> and <samp class="option">y</samp> are evaluated.
  48808. </p>
  48809. <p>It accepts the following values:
  48810. </p><dl class="table">
  48811. <dt><samp class="option">init</samp></dt>
  48812. <dd><p>Evaluate expressions once during filter initialization or
  48813. when a command is processed.
  48814. </p>
  48815. </dd>
  48816. <dt><samp class="option">frame</samp></dt>
  48817. <dd><p>Evaluate expressions for each incoming frame
  48818. </p></dd>
  48819. </dl>
  48820. <p>Default value is <samp class="option">frame</samp>.
  48821. </p>
  48822. </dd>
  48823. <dt><samp class="option">eof_action</samp></dt>
  48824. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  48825. </p>
  48826. </dd>
  48827. <dt><samp class="option">shortest</samp></dt>
  48828. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  48829. </p>
  48830. </dd>
  48831. <dt><samp class="option">repeatlast</samp></dt>
  48832. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  48833. </p>
  48834. </dd>
  48835. </dl>
  48836. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  48837. </p>
  48838. </div>
  48839. <div class="section-level-extent" id="owdenoise">
  48840. <h3 class="section"><span>39.185 owdenoise<a class="copiable-link" href="#owdenoise"> &para;</a></span></h3>
  48841. <p>Apply Overcomplete Wavelet denoiser.
  48842. </p>
  48843. <p>The filter accepts the following options:
  48844. </p>
  48845. <dl class="table">
  48846. <dt><samp class="option">depth</samp></dt>
  48847. <dd><p>Set depth.
  48848. </p>
  48849. <p>Larger depth values will denoise lower frequency components more, but
  48850. slow down filtering.
  48851. </p>
  48852. <p>Must be an int in the range 8-16, default is <code class="code">8</code>.
  48853. </p>
  48854. </dd>
  48855. <dt><samp class="option">luma_strength, ls</samp></dt>
  48856. <dd><p>Set luma strength.
  48857. </p>
  48858. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  48859. </p>
  48860. </dd>
  48861. <dt><samp class="option">chroma_strength, cs</samp></dt>
  48862. <dd><p>Set chroma strength.
  48863. </p>
  48864. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  48865. </p></dd>
  48866. </dl>
  48867. <a class="anchor" id="pad"></a></div>
  48868. <div class="section-level-extent" id="pad-1">
  48869. <h3 class="section"><span>39.186 pad<a class="copiable-link" href="#pad-1"> &para;</a></span></h3>
  48870. <p>Add paddings to the input image, and place the original input at the
  48871. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  48872. </p>
  48873. <p>It accepts the following parameters:
  48874. </p>
  48875. <dl class="table">
  48876. <dt><samp class="option">width, w</samp></dt>
  48877. <dt><samp class="option">height, h</samp></dt>
  48878. <dd><p>Specify an expression for the size of the output image with the
  48879. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  48880. corresponding input size is used for the output.
  48881. </p>
  48882. <p>The <var class="var">width</var> expression can reference the value set by the
  48883. <var class="var">height</var> expression, and vice versa.
  48884. </p>
  48885. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  48886. </p>
  48887. </dd>
  48888. <dt><samp class="option">x</samp></dt>
  48889. <dt><samp class="option">y</samp></dt>
  48890. <dd><p>Specify the offsets to place the input image at within the padded area,
  48891. with respect to the top/left border of the output image.
  48892. </p>
  48893. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  48894. expression, and vice versa.
  48895. </p>
  48896. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  48897. </p>
  48898. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  48899. so the input image is centered on the padded area.
  48900. </p>
  48901. </dd>
  48902. <dt><samp class="option">color</samp></dt>
  48903. <dd><p>Specify the color of the padded area. For the syntax of this option,
  48904. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  48905. manual</a>.
  48906. </p>
  48907. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  48908. </p>
  48909. </dd>
  48910. <dt><samp class="option">eval</samp></dt>
  48911. <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.
  48912. </p>
  48913. <p>It accepts the following values:
  48914. </p>
  48915. <dl class="table">
  48916. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  48917. <dd><p>Only evaluate expressions once during the filter initialization or when
  48918. a command is processed.
  48919. </p>
  48920. </dd>
  48921. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  48922. <dd><p>Evaluate expressions for each incoming frame.
  48923. </p>
  48924. </dd>
  48925. </dl>
  48926. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  48927. </p>
  48928. </dd>
  48929. <dt><samp class="option">aspect</samp></dt>
  48930. <dd><p>Pad to aspect instead to a resolution.
  48931. </p>
  48932. </dd>
  48933. </dl>
  48934. <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>
  48935. options are expressions containing the following constants:
  48936. </p>
  48937. <dl class="table">
  48938. <dt><samp class="option">in_w</samp></dt>
  48939. <dt><samp class="option">in_h</samp></dt>
  48940. <dd><p>The input video width and height.
  48941. </p>
  48942. </dd>
  48943. <dt><samp class="option">iw</samp></dt>
  48944. <dt><samp class="option">ih</samp></dt>
  48945. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  48946. </p>
  48947. </dd>
  48948. <dt><samp class="option">out_w</samp></dt>
  48949. <dt><samp class="option">out_h</samp></dt>
  48950. <dd><p>The output width and height (the size of the padded area), as
  48951. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  48952. </p>
  48953. </dd>
  48954. <dt><samp class="option">ow</samp></dt>
  48955. <dt><samp class="option">oh</samp></dt>
  48956. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  48957. </p>
  48958. </dd>
  48959. <dt><samp class="option">x</samp></dt>
  48960. <dt><samp class="option">y</samp></dt>
  48961. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  48962. expressions, or NAN if not yet specified.
  48963. </p>
  48964. </dd>
  48965. <dt><samp class="option">a</samp></dt>
  48966. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  48967. </p>
  48968. </dd>
  48969. <dt><samp class="option">sar</samp></dt>
  48970. <dd><p>input sample aspect ratio
  48971. </p>
  48972. </dd>
  48973. <dt><samp class="option">dar</samp></dt>
  48974. <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>
  48975. </p>
  48976. </dd>
  48977. <dt><samp class="option">hsub</samp></dt>
  48978. <dt><samp class="option">vsub</samp></dt>
  48979. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  48980. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  48981. </p></dd>
  48982. </dl>
  48983. <ul class="mini-toc">
  48984. <li><a href="#Examples-145" accesskey="1">Examples</a></li>
  48985. </ul>
  48986. <div class="subsection-level-extent" id="Examples-145">
  48987. <h4 class="subsection"><span>39.186.1 Examples<a class="copiable-link" href="#Examples-145"> &para;</a></span></h4>
  48988. <ul class="itemize mark-bullet">
  48989. <li>Add paddings with the color &quot;violet&quot; to the input video. The output video
  48990. size is 640x480, and the top-left corner of the input video is placed at
  48991. column 0, row 40
  48992. <div class="example">
  48993. <pre class="example-preformatted">pad=640:480:0:40:violet
  48994. </pre></div>
  48995. <p>The example above is equivalent to the following command:
  48996. </p><div class="example">
  48997. <pre class="example-preformatted">pad=width=640:height=480:x=0:y=40:color=violet
  48998. </pre></div>
  48999. </li><li>Pad the input to get an output with dimensions increased by 3/2,
  49000. and put the input video at the center of the padded area:
  49001. <div class="example">
  49002. <pre class="example-preformatted">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  49003. </pre></div>
  49004. </li><li>Pad the input to get a squared output with size equal to the maximum
  49005. value between the input width and height, and put the input video at
  49006. the center of the padded area:
  49007. <div class="example">
  49008. <pre class="example-preformatted">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  49009. </pre></div>
  49010. </li><li>Pad the input to get a final w/h ratio of 16:9:
  49011. <div class="example">
  49012. <pre class="example-preformatted">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  49013. </pre></div>
  49014. </li><li>In case of anamorphic video, in order to set the output display aspect
  49015. correctly, it is necessary to use <var class="var">sar</var> in the expression,
  49016. according to the relation:
  49017. <div class="example">
  49018. <pre class="example-preformatted">(ih * X / ih) * sar = output_dar
  49019. X = output_dar / sar
  49020. </pre></div>
  49021. <p>Thus the previous example needs to be modified to:
  49022. </p><div class="example">
  49023. <pre class="example-preformatted">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  49024. </pre></div>
  49025. </li><li>Double the output size and put the input video in the bottom-right
  49026. corner of the output padded area:
  49027. <div class="example">
  49028. <pre class="example-preformatted">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  49029. </pre></div>
  49030. </li></ul>
  49031. <a class="anchor" id="palettegen"></a></div>
  49032. </div>
  49033. <div class="section-level-extent" id="palettegen-1">
  49034. <h3 class="section"><span>39.187 palettegen<a class="copiable-link" href="#palettegen-1"> &para;</a></span></h3>
  49035. <p>Generate one palette for a whole video stream.
  49036. </p>
  49037. <p>It accepts the following options:
  49038. </p>
  49039. <dl class="table">
  49040. <dt><samp class="option">max_colors</samp></dt>
  49041. <dd><p>Set the maximum number of colors to quantize in the palette.
  49042. Note: the palette will still contain 256 colors; the unused palette entries
  49043. will be black.
  49044. </p>
  49045. </dd>
  49046. <dt><samp class="option">reserve_transparent</samp></dt>
  49047. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  49048. transparency. Reserving the transparency color is useful for GIF optimization.
  49049. If not set, the maximum of colors in the palette will be 256. You probably want
  49050. to disable this option for a standalone image.
  49051. Set by default.
  49052. </p>
  49053. </dd>
  49054. <dt><samp class="option">transparency_color</samp></dt>
  49055. <dd><p>Set the color that will be used as background for transparency.
  49056. </p>
  49057. </dd>
  49058. <dt><samp class="option">stats_mode</samp></dt>
  49059. <dd><p>Set statistics mode.
  49060. </p>
  49061. <p>It accepts the following values:
  49062. </p><dl class="table">
  49063. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  49064. <dd><p>Compute full frame histograms.
  49065. </p></dd>
  49066. <dt>&lsquo;<samp class="samp">diff</samp>&rsquo;</dt>
  49067. <dd><p>Compute histograms only for the part that differs from previous frame. This
  49068. might be relevant to give more importance to the moving part of your input if
  49069. the background is static.
  49070. </p></dd>
  49071. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  49072. <dd><p>Compute new histogram for each frame.
  49073. </p></dd>
  49074. </dl>
  49075. <p>Default value is <var class="var">full</var>.
  49076. </p></dd>
  49077. </dl>
  49078. <p>The filter also exports the frame metadata <code class="code">lavfi.color_quant_ratio</code>
  49079. (<code class="code">nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  49080. color quantization of the palette. This information is also visible at
  49081. <var class="var">info</var> logging level.
  49082. </p>
  49083. <ul class="mini-toc">
  49084. <li><a href="#Examples-146" accesskey="1">Examples</a></li>
  49085. </ul>
  49086. <div class="subsection-level-extent" id="Examples-146">
  49087. <h4 class="subsection"><span>39.187.1 Examples<a class="copiable-link" href="#Examples-146"> &para;</a></span></h4>
  49088. <ul class="itemize mark-bullet">
  49089. <li>Generate a representative palette of a given video using <code class="command">ffmpeg</code>:
  49090. <div class="example">
  49091. <pre class="example-preformatted">ffmpeg -i input.mkv -vf palettegen palette.png
  49092. </pre></div>
  49093. </li></ul>
  49094. </div>
  49095. </div>
  49096. <div class="section-level-extent" id="paletteuse">
  49097. <h3 class="section"><span>39.188 paletteuse<a class="copiable-link" href="#paletteuse"> &para;</a></span></h3>
  49098. <p>Use a palette to downsample an input video stream.
  49099. </p>
  49100. <p>The filter takes two inputs: one video stream and a palette. The palette must
  49101. be a 256 pixels image.
  49102. </p>
  49103. <p>It accepts the following options:
  49104. </p>
  49105. <dl class="table">
  49106. <dt><samp class="option">dither</samp></dt>
  49107. <dd><p>Select dithering mode. Available algorithms are:
  49108. </p><dl class="table">
  49109. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  49110. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  49111. </p></dd>
  49112. <dt>&lsquo;<samp class="samp">heckbert</samp>&rsquo;</dt>
  49113. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  49114. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  49115. reference.
  49116. </p></dd>
  49117. <dt>&lsquo;<samp class="samp">floyd_steinberg</samp>&rsquo;</dt>
  49118. <dd><p>Floyd and Steingberg dithering (error diffusion)
  49119. </p></dd>
  49120. <dt>&lsquo;<samp class="samp">sierra2</samp>&rsquo;</dt>
  49121. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  49122. </p></dd>
  49123. <dt>&lsquo;<samp class="samp">sierra2_4a</samp>&rsquo;</dt>
  49124. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  49125. </p></dd>
  49126. <dt>&lsquo;<samp class="samp">sierra3</samp>&rsquo;</dt>
  49127. <dd><p>Frankie Sierra dithering v3 (error diffusion)
  49128. </p></dd>
  49129. <dt>&lsquo;<samp class="samp">burkes</samp>&rsquo;</dt>
  49130. <dd><p>Burkes dithering (error diffusion)
  49131. </p></dd>
  49132. <dt>&lsquo;<samp class="samp">atkinson</samp>&rsquo;</dt>
  49133. <dd><p>Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion)
  49134. </p></dd>
  49135. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  49136. <dd><p>Disable dithering.
  49137. </p></dd>
  49138. </dl>
  49139. <p>Default is <var class="var">sierra2_4a</var>.
  49140. </p>
  49141. </dd>
  49142. <dt><samp class="option">bayer_scale</samp></dt>
  49143. <dd><p>When <var class="var">bayer</var> dithering is selected, this option defines the scale of the
  49144. pattern (how much the crosshatch pattern is visible). A low value means more
  49145. visible pattern for less banding, and higher value means less visible pattern
  49146. at the cost of more banding.
  49147. </p>
  49148. <p>The option must be an integer value in the range [0,5]. Default is <var class="var">2</var>.
  49149. </p>
  49150. </dd>
  49151. <dt><samp class="option">diff_mode</samp></dt>
  49152. <dd><p>If set, define the zone to process
  49153. </p>
  49154. <dl class="table">
  49155. <dt>&lsquo;<samp class="samp">rectangle</samp>&rsquo;</dt>
  49156. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  49157. cropping/offsetting compression mechanism. This option can be useful for speed
  49158. if only a part of the image is changing, and has use cases such as limiting the
  49159. scope of the error diffusal <samp class="option">dither</samp> to the rectangle that bounds the
  49160. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  49161. much, and as a result less moving noise and better GIF compression).
  49162. </p></dd>
  49163. </dl>
  49164. <p>Default is <var class="var">none</var>.
  49165. </p>
  49166. </dd>
  49167. <dt><samp class="option">new</samp></dt>
  49168. <dd><p>Take new palette for each output frame.
  49169. </p>
  49170. </dd>
  49171. <dt><samp class="option">alpha_threshold</samp></dt>
  49172. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  49173. will be treated as completely opaque, and values below this threshold will be
  49174. treated as completely transparent.
  49175. </p>
  49176. <p>The option must be an integer value in the range [0,255]. Default is <var class="var">128</var>.
  49177. </p></dd>
  49178. </dl>
  49179. <ul class="mini-toc">
  49180. <li><a href="#Examples-147" accesskey="1">Examples</a></li>
  49181. </ul>
  49182. <div class="subsection-level-extent" id="Examples-147">
  49183. <h4 class="subsection"><span>39.188.1 Examples<a class="copiable-link" href="#Examples-147"> &para;</a></span></h4>
  49184. <ul class="itemize mark-bullet">
  49185. <li>Use a palette (generated for example with <a class="ref" href="#palettegen">palettegen</a>) to encode a GIF
  49186. using <code class="command">ffmpeg</code>:
  49187. <div class="example">
  49188. <pre class="example-preformatted">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  49189. </pre></div>
  49190. </li></ul>
  49191. </div>
  49192. </div>
  49193. <div class="section-level-extent" id="perspective">
  49194. <h3 class="section"><span>39.189 perspective<a class="copiable-link" href="#perspective"> &para;</a></span></h3>
  49195. <p>Correct perspective of video not recorded perpendicular to the screen.
  49196. </p>
  49197. <p>A description of the accepted parameters follows.
  49198. </p>
  49199. <dl class="table">
  49200. <dt><samp class="option">x0</samp></dt>
  49201. <dt><samp class="option">y0</samp></dt>
  49202. <dt><samp class="option">x1</samp></dt>
  49203. <dt><samp class="option">y1</samp></dt>
  49204. <dt><samp class="option">x2</samp></dt>
  49205. <dt><samp class="option">y2</samp></dt>
  49206. <dt><samp class="option">x3</samp></dt>
  49207. <dt><samp class="option">y3</samp></dt>
  49208. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  49209. Default values are <code class="code">0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  49210. If the <code class="code">sense</code> option is set to <code class="code">source</code>, then the specified points will be sent
  49211. to the corners of the destination. If the <code class="code">sense</code> option is set to <code class="code">destination</code>,
  49212. then the corners of the source will be sent to the specified coordinates.
  49213. </p>
  49214. <p>The expressions can use the following variables:
  49215. </p>
  49216. <dl class="table">
  49217. <dt><samp class="option">W</samp></dt>
  49218. <dt><samp class="option">H</samp></dt>
  49219. <dd><p>the width and height of video frame.
  49220. </p></dd>
  49221. <dt><samp class="option">in</samp></dt>
  49222. <dd><p>Input frame count.
  49223. </p></dd>
  49224. <dt><samp class="option">on</samp></dt>
  49225. <dd><p>Output frame count.
  49226. </p></dd>
  49227. </dl>
  49228. </dd>
  49229. <dt><samp class="option">interpolation</samp></dt>
  49230. <dd><p>Set interpolation for perspective correction.
  49231. </p>
  49232. <p>It accepts the following values:
  49233. </p><dl class="table">
  49234. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  49235. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  49236. </dl>
  49237. <p>Default value is &lsquo;<samp class="samp">linear</samp>&rsquo;.
  49238. </p>
  49239. </dd>
  49240. <dt><samp class="option">sense</samp></dt>
  49241. <dd><p>Set interpretation of coordinate options.
  49242. </p>
  49243. <p>It accepts the following values:
  49244. </p><dl class="table">
  49245. <dt>&lsquo;<samp class="samp">0, source</samp>&rsquo;</dt>
  49246. <dd>
  49247. <p>Send point in the source specified by the given coordinates to
  49248. the corners of the destination.
  49249. </p>
  49250. </dd>
  49251. <dt>&lsquo;<samp class="samp">1, destination</samp>&rsquo;</dt>
  49252. <dd>
  49253. <p>Send the corners of the source to the point in the destination specified
  49254. by the given coordinates.
  49255. </p>
  49256. <p>Default value is &lsquo;<samp class="samp">source</samp>&rsquo;.
  49257. </p></dd>
  49258. </dl>
  49259. </dd>
  49260. <dt><samp class="option">eval</samp></dt>
  49261. <dd><p>Set when the expressions for coordinates <samp class="option">x0,y0,...x3,y3</samp> are evaluated.
  49262. </p>
  49263. <p>It accepts the following values:
  49264. </p><dl class="table">
  49265. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  49266. <dd><p>only evaluate expressions once during the filter initialization or
  49267. when a command is processed
  49268. </p>
  49269. </dd>
  49270. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  49271. <dd><p>evaluate expressions for each incoming frame
  49272. </p></dd>
  49273. </dl>
  49274. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  49275. </p></dd>
  49276. </dl>
  49277. </div>
  49278. <div class="section-level-extent" id="phase">
  49279. <h3 class="section"><span>39.190 phase<a class="copiable-link" href="#phase"> &para;</a></span></h3>
  49280. <p>Delay interlaced video by one field time so that the field order changes.
  49281. </p>
  49282. <p>The intended use is to fix PAL movies that have been captured with the
  49283. opposite field order to the film-to-video transfer.
  49284. </p>
  49285. <p>A description of the accepted parameters follows.
  49286. </p>
  49287. <dl class="table">
  49288. <dt><samp class="option">mode</samp></dt>
  49289. <dd><p>Set phase mode.
  49290. </p>
  49291. <p>It accepts the following values:
  49292. </p><dl class="table">
  49293. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  49294. <dd><p>Capture field order top-first, transfer bottom-first.
  49295. Filter will delay the bottom field.
  49296. </p>
  49297. </dd>
  49298. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  49299. <dd><p>Capture field order bottom-first, transfer top-first.
  49300. Filter will delay the top field.
  49301. </p>
  49302. </dd>
  49303. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  49304. <dd><p>Capture and transfer with the same field order. This mode only exists
  49305. for the documentation of the other options to refer to, but if you
  49306. actually select it, the filter will faithfully do nothing.
  49307. </p>
  49308. </dd>
  49309. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  49310. <dd><p>Capture field order determined automatically by field flags, transfer
  49311. opposite.
  49312. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">b</samp>&rsquo; modes on a frame by frame
  49313. basis using field flags. If no field information is available,
  49314. then this works just like &lsquo;<samp class="samp">u</samp>&rsquo;.
  49315. </p>
  49316. </dd>
  49317. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  49318. <dd><p>Capture unknown or varying, transfer opposite.
  49319. 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
  49320. analyzing the images and selecting the alternative that produces best
  49321. match between the fields.
  49322. </p>
  49323. </dd>
  49324. <dt>&lsquo;<samp class="samp">T</samp>&rsquo;</dt>
  49325. <dd><p>Capture top-first, transfer unknown or varying.
  49326. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  49327. </p>
  49328. </dd>
  49329. <dt>&lsquo;<samp class="samp">B</samp>&rsquo;</dt>
  49330. <dd><p>Capture bottom-first, transfer unknown or varying.
  49331. Filter selects among &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  49332. </p>
  49333. </dd>
  49334. <dt>&lsquo;<samp class="samp">A</samp>&rsquo;</dt>
  49335. <dd><p>Capture determined by field flags, transfer unknown or varying.
  49336. 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
  49337. image analysis. If no field information is available, then this works just
  49338. like &lsquo;<samp class="samp">U</samp>&rsquo;. This is the default mode.
  49339. </p>
  49340. </dd>
  49341. <dt>&lsquo;<samp class="samp">U</samp>&rsquo;</dt>
  49342. <dd><p>Both capture and transfer unknown or varying.
  49343. 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.
  49344. </p></dd>
  49345. </dl>
  49346. </dd>
  49347. </dl>
  49348. <ul class="mini-toc">
  49349. <li><a href="#Commands-129" accesskey="1">Commands</a></li>
  49350. </ul>
  49351. <div class="subsection-level-extent" id="Commands-129">
  49352. <h4 class="subsection"><span>39.190.1 Commands<a class="copiable-link" href="#Commands-129"> &para;</a></span></h4>
  49353. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  49354. </p>
  49355. </div>
  49356. </div>
  49357. <div class="section-level-extent" id="photosensitivity">
  49358. <h3 class="section"><span>39.191 photosensitivity<a class="copiable-link" href="#photosensitivity"> &para;</a></span></h3>
  49359. <p>Reduce various flashes in video, so to help users with epilepsy.
  49360. </p>
  49361. <p>It accepts the following options:
  49362. </p><dl class="table">
  49363. <dt><samp class="option">frames, f</samp></dt>
  49364. <dd><p>Set how many frames to use when filtering. Default is 30.
  49365. </p>
  49366. </dd>
  49367. <dt><samp class="option">threshold, t</samp></dt>
  49368. <dd><p>Set detection threshold factor. Default is 1.
  49369. Lower is stricter.
  49370. </p>
  49371. </dd>
  49372. <dt><samp class="option">skip</samp></dt>
  49373. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  49374. Allowed range is from 1 to 1024.
  49375. </p>
  49376. </dd>
  49377. <dt><samp class="option">bypass</samp></dt>
  49378. <dd><p>Leave frames unchanged. Default is disabled.
  49379. </p></dd>
  49380. </dl>
  49381. </div>
  49382. <div class="section-level-extent" id="pixdesctest">
  49383. <h3 class="section"><span>39.192 pixdesctest<a class="copiable-link" href="#pixdesctest"> &para;</a></span></h3>
  49384. <p>Pixel format descriptor test filter, mainly useful for internal
  49385. testing. The output video should be equal to the input video.
  49386. </p>
  49387. <p>For example:
  49388. </p><div class="example">
  49389. <pre class="example-preformatted">format=monow, pixdesctest
  49390. </pre></div>
  49391. <p>can be used to test the monowhite pixel format descriptor definition.
  49392. </p>
  49393. </div>
  49394. <div class="section-level-extent" id="pixelize">
  49395. <h3 class="section"><span>39.193 pixelize<a class="copiable-link" href="#pixelize"> &para;</a></span></h3>
  49396. <p>Apply pixelization to video stream.
  49397. </p>
  49398. <p>The filter accepts the following options:
  49399. </p><dl class="table">
  49400. <dt><samp class="option">width, w</samp></dt>
  49401. <dt><samp class="option">height, h</samp></dt>
  49402. <dd><p>Set block dimensions that will be used for pixelization.
  49403. Default value is <code class="code">16</code>.
  49404. </p>
  49405. </dd>
  49406. <dt><samp class="option">mode, m</samp></dt>
  49407. <dd><p>Set the mode of pixelization used.
  49408. </p>
  49409. <p>Possible values are:
  49410. </p><dl class="table">
  49411. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  49412. <dt>&lsquo;<samp class="samp">min</samp>&rsquo;</dt>
  49413. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  49414. </dl>
  49415. <p>Default value is <code class="code">avg</code>.
  49416. </p>
  49417. </dd>
  49418. <dt><samp class="option">planes, p</samp></dt>
  49419. <dd><p>Set what planes to filter. Default is to filter all planes.
  49420. </p></dd>
  49421. </dl>
  49422. <ul class="mini-toc">
  49423. <li><a href="#Commands-130" accesskey="1">Commands</a></li>
  49424. </ul>
  49425. <div class="subsection-level-extent" id="Commands-130">
  49426. <h4 class="subsection"><span>39.193.1 Commands<a class="copiable-link" href="#Commands-130"> &para;</a></span></h4>
  49427. <p>This filter supports all options as <a class="ref" href="#commands">commands</a>.
  49428. </p>
  49429. </div>
  49430. </div>
  49431. <div class="section-level-extent" id="pixscope">
  49432. <h3 class="section"><span>39.194 pixscope<a class="copiable-link" href="#pixscope"> &para;</a></span></h3>
  49433. <p>Display sample values of color channels. Mainly useful for checking color
  49434. and levels. Minimum supported resolution is 640x480.
  49435. </p>
  49436. <p>The filters accept the following options:
  49437. </p>
  49438. <dl class="table">
  49439. <dt><samp class="option">x</samp></dt>
  49440. <dd><p>Set scope X position, relative offset on X axis.
  49441. </p>
  49442. </dd>
  49443. <dt><samp class="option">y</samp></dt>
  49444. <dd><p>Set scope Y position, relative offset on Y axis.
  49445. </p>
  49446. </dd>
  49447. <dt><samp class="option">w</samp></dt>
  49448. <dd><p>Set scope width.
  49449. </p>
  49450. </dd>
  49451. <dt><samp class="option">h</samp></dt>
  49452. <dd><p>Set scope height.
  49453. </p>
  49454. </dd>
  49455. <dt><samp class="option">o</samp></dt>
  49456. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  49457. </p>
  49458. </dd>
  49459. <dt><samp class="option">wx</samp></dt>
  49460. <dd><p>Set window X position, relative offset on X axis.
  49461. </p>
  49462. </dd>
  49463. <dt><samp class="option">wy</samp></dt>
  49464. <dd><p>Set window Y position, relative offset on Y axis.
  49465. </p></dd>
  49466. </dl>
  49467. <ul class="mini-toc">
  49468. <li><a href="#Commands-131" accesskey="1">Commands</a></li>
  49469. </ul>
  49470. <div class="subsection-level-extent" id="Commands-131">
  49471. <h4 class="subsection"><span>39.194.1 Commands<a class="copiable-link" href="#Commands-131"> &para;</a></span></h4>
  49472. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  49473. </p>
  49474. </div>
  49475. </div>
  49476. <div class="section-level-extent" id="pp">
  49477. <h3 class="section"><span>39.195 pp<a class="copiable-link" href="#pp"> &para;</a></span></h3>
  49478. <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
  49479. library should be automatically selected with a GPL build (<code class="code">--enable-gpl</code>).
  49480. Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
  49481. Each subfilter and some options have a short and a long name that can be used
  49482. interchangeably, i.e. dr/dering are the same.
  49483. </p>
  49484. <p>The filters accept the following options:
  49485. </p>
  49486. <dl class="table">
  49487. <dt><samp class="option">subfilters</samp></dt>
  49488. <dd><p>Set postprocessing subfilters string.
  49489. </p></dd>
  49490. </dl>
  49491. <p>All subfilters share common options to determine their scope:
  49492. </p>
  49493. <dl class="table">
  49494. <dt><samp class="option">a/autoq</samp></dt>
  49495. <dd><p>Honor the quality commands for this subfilter.
  49496. </p>
  49497. </dd>
  49498. <dt><samp class="option">c/chrom</samp></dt>
  49499. <dd><p>Do chrominance filtering, too (default).
  49500. </p>
  49501. </dd>
  49502. <dt><samp class="option">y/nochrom</samp></dt>
  49503. <dd><p>Do luma filtering only (no chrominance).
  49504. </p>
  49505. </dd>
  49506. <dt><samp class="option">n/noluma</samp></dt>
  49507. <dd><p>Do chrominance filtering only (no luma).
  49508. </p></dd>
  49509. </dl>
  49510. <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
  49511. </p>
  49512. <p>Available subfilters are:
  49513. </p>
  49514. <dl class="table">
  49515. <dt><samp class="option">hb/hdeblock[|difference[|flatness]]</samp></dt>
  49516. <dd><p>Horizontal deblocking filter
  49517. </p><dl class="table">
  49518. <dt><samp class="option">difference</samp></dt>
  49519. <dd><p>Difference factor where higher values mean more deblocking (default: <code class="code">32</code>).
  49520. </p></dd>
  49521. <dt><samp class="option">flatness</samp></dt>
  49522. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code class="code">39</code>).
  49523. </p></dd>
  49524. </dl>
  49525. </dd>
  49526. <dt><samp class="option">vb/vdeblock[|difference[|flatness]]</samp></dt>
  49527. <dd><p>Vertical deblocking filter
  49528. </p><dl class="table">
  49529. <dt><samp class="option">difference</samp></dt>
  49530. <dd><p>Difference factor where higher values mean more deblocking (default: <code class="code">32</code>).
  49531. </p></dd>
  49532. <dt><samp class="option">flatness</samp></dt>
  49533. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code class="code">39</code>).
  49534. </p></dd>
  49535. </dl>
  49536. </dd>
  49537. <dt><samp class="option">ha/hadeblock[|difference[|flatness]]</samp></dt>
  49538. <dd><p>Accurate horizontal deblocking filter
  49539. </p><dl class="table">
  49540. <dt><samp class="option">difference</samp></dt>
  49541. <dd><p>Difference factor where higher values mean more deblocking (default: <code class="code">32</code>).
  49542. </p></dd>
  49543. <dt><samp class="option">flatness</samp></dt>
  49544. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code class="code">39</code>).
  49545. </p></dd>
  49546. </dl>
  49547. </dd>
  49548. <dt><samp class="option">va/vadeblock[|difference[|flatness]]</samp></dt>
  49549. <dd><p>Accurate vertical deblocking filter
  49550. </p><dl class="table">
  49551. <dt><samp class="option">difference</samp></dt>
  49552. <dd><p>Difference factor where higher values mean more deblocking (default: <code class="code">32</code>).
  49553. </p></dd>
  49554. <dt><samp class="option">flatness</samp></dt>
  49555. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code class="code">39</code>).
  49556. </p></dd>
  49557. </dl>
  49558. </dd>
  49559. </dl>
  49560. <p>The horizontal and vertical deblocking filters share the difference and
  49561. flatness values so you cannot set different horizontal and vertical
  49562. thresholds.
  49563. </p>
  49564. <dl class="table">
  49565. <dt><samp class="option">h1/x1hdeblock</samp></dt>
  49566. <dd><p>Experimental horizontal deblocking filter
  49567. </p>
  49568. </dd>
  49569. <dt><samp class="option">v1/x1vdeblock</samp></dt>
  49570. <dd><p>Experimental vertical deblocking filter
  49571. </p>
  49572. </dd>
  49573. <dt><samp class="option">dr/dering</samp></dt>
  49574. <dd><p>Deringing filter
  49575. </p>
  49576. </dd>
  49577. <dt><samp class="option">tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp></dt>
  49578. <dd><dl class="table">
  49579. <dt><samp class="option">threshold1</samp></dt>
  49580. <dd><p>larger -&gt; stronger filtering
  49581. </p></dd>
  49582. <dt><samp class="option">threshold2</samp></dt>
  49583. <dd><p>larger -&gt; stronger filtering
  49584. </p></dd>
  49585. <dt><samp class="option">threshold3</samp></dt>
  49586. <dd><p>larger -&gt; stronger filtering
  49587. </p></dd>
  49588. </dl>
  49589. </dd>
  49590. <dt><samp class="option">al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp></dt>
  49591. <dd><dl class="table">
  49592. <dt><samp class="option">f/fullyrange</samp></dt>
  49593. <dd><p>Stretch luma to <code class="code">0-255</code>.
  49594. </p></dd>
  49595. </dl>
  49596. </dd>
  49597. <dt><samp class="option">lb/linblenddeint</samp></dt>
  49598. <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
  49599. filtering all lines with a <code class="code">(1 2 1)</code> filter.
  49600. </p>
  49601. </dd>
  49602. <dt><samp class="option">li/linipoldeint</samp></dt>
  49603. <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
  49604. linearly interpolating every second line.
  49605. </p>
  49606. </dd>
  49607. <dt><samp class="option">ci/cubicipoldeint</samp></dt>
  49608. <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
  49609. cubically interpolating every second line.
  49610. </p>
  49611. </dd>
  49612. <dt><samp class="option">md/mediandeint</samp></dt>
  49613. <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
  49614. median filter to every second line.
  49615. </p>
  49616. </dd>
  49617. <dt><samp class="option">fd/ffmpegdeint</samp></dt>
  49618. <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
  49619. second line with a <code class="code">(-1 4 2 4 -1)</code> filter.
  49620. </p>
  49621. </dd>
  49622. <dt><samp class="option">l5/lowpass5</samp></dt>
  49623. <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
  49624. block by filtering all lines with a <code class="code">(-1 2 6 2 -1)</code> filter.
  49625. </p>
  49626. </dd>
  49627. <dt><samp class="option">fq/forceQuant[|quantizer]</samp></dt>
  49628. <dd><p>Overrides the quantizer table from the input with the constant quantizer you
  49629. specify.
  49630. </p><dl class="table">
  49631. <dt><samp class="option">quantizer</samp></dt>
  49632. <dd><p>Quantizer to use
  49633. </p></dd>
  49634. </dl>
  49635. </dd>
  49636. <dt><samp class="option">de/default</samp></dt>
  49637. <dd><p>Default pp filter combination (<code class="code">hb|a,vb|a,dr|a</code>)
  49638. </p>
  49639. </dd>
  49640. <dt><samp class="option">fa/fast</samp></dt>
  49641. <dd><p>Fast pp filter combination (<code class="code">h1|a,v1|a,dr|a</code>)
  49642. </p>
  49643. </dd>
  49644. <dt><samp class="option">ac</samp></dt>
  49645. <dd><p>High quality pp filter combination (<code class="code">ha|a|128|7,va|a,dr|a</code>)
  49646. </p></dd>
  49647. </dl>
  49648. <ul class="mini-toc">
  49649. <li><a href="#Examples-148" accesskey="1">Examples</a></li>
  49650. </ul>
  49651. <div class="subsection-level-extent" id="Examples-148">
  49652. <h4 class="subsection"><span>39.195.1 Examples<a class="copiable-link" href="#Examples-148"> &para;</a></span></h4>
  49653. <ul class="itemize mark-bullet">
  49654. <li>Apply horizontal and vertical deblocking, deringing and automatic
  49655. brightness/contrast:
  49656. <div class="example">
  49657. <pre class="example-preformatted">pp=hb/vb/dr/al
  49658. </pre></div>
  49659. </li><li>Apply default filters without brightness/contrast correction:
  49660. <div class="example">
  49661. <pre class="example-preformatted">pp=de/-al
  49662. </pre></div>
  49663. </li><li>Apply default filters and temporal denoiser:
  49664. <div class="example">
  49665. <pre class="example-preformatted">pp=default/tmpnoise|1|2|3
  49666. </pre></div>
  49667. </li><li>Apply deblocking on luma only, and switch vertical deblocking on or off
  49668. automatically depending on available CPU time:
  49669. <div class="example">
  49670. <pre class="example-preformatted">pp=hb|y/vb|a
  49671. </pre></div>
  49672. </li></ul>
  49673. </div>
  49674. </div>
  49675. <div class="section-level-extent" id="pp7">
  49676. <h3 class="section"><span>39.196 pp7<a class="copiable-link" href="#pp7"> &para;</a></span></h3>
  49677. <p>Apply Postprocessing filter 7. It is variant of the <a class="ref" href="#spp">spp</a> filter,
  49678. similar to spp = 6 with 7 point DCT, where only the center sample is
  49679. used after IDCT.
  49680. </p>
  49681. <p>The filter accepts the following options:
  49682. </p>
  49683. <dl class="table">
  49684. <dt><samp class="option">qp</samp></dt>
  49685. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  49686. 0 to 63. If not set, the filter will use the QP from the video stream
  49687. (if available).
  49688. </p>
  49689. </dd>
  49690. <dt><samp class="option">mode</samp></dt>
  49691. <dd><p>Set thresholding mode. Available modes are:
  49692. </p>
  49693. <dl class="table">
  49694. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  49695. <dd><p>Set hard thresholding.
  49696. </p></dd>
  49697. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  49698. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  49699. </p></dd>
  49700. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  49701. <dd><p>Set medium thresholding (good results, default).
  49702. </p></dd>
  49703. </dl>
  49704. </dd>
  49705. </dl>
  49706. </div>
  49707. <div class="section-level-extent" id="premultiply">
  49708. <h3 class="section"><span>39.197 premultiply<a class="copiable-link" href="#premultiply"> &para;</a></span></h3>
  49709. <p>Apply alpha premultiply effect to input video stream using first plane
  49710. of second stream as alpha.
  49711. </p>
  49712. <p>Both streams must have same dimensions and same pixel format.
  49713. </p>
  49714. <p>The filter accepts the following option:
  49715. </p>
  49716. <dl class="table">
  49717. <dt><samp class="option">planes</samp></dt>
  49718. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  49719. By default value 0xf, all planes will be processed.
  49720. </p>
  49721. </dd>
  49722. <dt><samp class="option">inplace</samp></dt>
  49723. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  49724. </p></dd>
  49725. </dl>
  49726. </div>
  49727. <div class="section-level-extent" id="prewitt">
  49728. <h3 class="section"><span>39.198 prewitt<a class="copiable-link" href="#prewitt"> &para;</a></span></h3>
  49729. <p>Apply prewitt operator to input video stream.
  49730. </p>
  49731. <p>The filter accepts the following option:
  49732. </p>
  49733. <dl class="table">
  49734. <dt><samp class="option">planes</samp></dt>
  49735. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  49736. By default value 0xf, all planes will be processed.
  49737. </p>
  49738. </dd>
  49739. <dt><samp class="option">scale</samp></dt>
  49740. <dd><p>Set value which will be multiplied with filtered result.
  49741. </p>
  49742. </dd>
  49743. <dt><samp class="option">delta</samp></dt>
  49744. <dd><p>Set value which will be added to filtered result.
  49745. </p></dd>
  49746. </dl>
  49747. <ul class="mini-toc">
  49748. <li><a href="#Commands-132" accesskey="1">Commands</a></li>
  49749. </ul>
  49750. <div class="subsection-level-extent" id="Commands-132">
  49751. <h4 class="subsection"><span>39.198.1 Commands<a class="copiable-link" href="#Commands-132"> &para;</a></span></h4>
  49752. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  49753. </p>
  49754. </div>
  49755. </div>
  49756. <div class="section-level-extent" id="pseudocolor">
  49757. <h3 class="section"><span>39.199 pseudocolor<a class="copiable-link" href="#pseudocolor"> &para;</a></span></h3>
  49758. <p>Alter frame colors in video with pseudocolors.
  49759. </p>
  49760. <p>This filter accepts the following options:
  49761. </p>
  49762. <dl class="table">
  49763. <dt><samp class="option">c0</samp></dt>
  49764. <dd><p>set pixel first component expression
  49765. </p>
  49766. </dd>
  49767. <dt><samp class="option">c1</samp></dt>
  49768. <dd><p>set pixel second component expression
  49769. </p>
  49770. </dd>
  49771. <dt><samp class="option">c2</samp></dt>
  49772. <dd><p>set pixel third component expression
  49773. </p>
  49774. </dd>
  49775. <dt><samp class="option">c3</samp></dt>
  49776. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  49777. </p>
  49778. </dd>
  49779. <dt><samp class="option">index, i</samp></dt>
  49780. <dd><p>set component to use as base for altering colors
  49781. </p>
  49782. </dd>
  49783. <dt><samp class="option">preset, p</samp></dt>
  49784. <dd><p>Pick one of built-in LUTs. By default is set to none.
  49785. </p>
  49786. <p>Available LUTs:
  49787. </p><dl class="table">
  49788. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  49789. <dt>&lsquo;<samp class="samp">inferno</samp>&rsquo;</dt>
  49790. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  49791. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  49792. <dt>&lsquo;<samp class="samp">turbo</samp>&rsquo;</dt>
  49793. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  49794. <dt>&lsquo;<samp class="samp">range1</samp>&rsquo;</dt>
  49795. <dt>&lsquo;<samp class="samp">range2</samp>&rsquo;</dt>
  49796. <dt>&lsquo;<samp class="samp">shadows</samp>&rsquo;</dt>
  49797. <dt>&lsquo;<samp class="samp">highlights</samp>&rsquo;</dt>
  49798. <dt>&lsquo;<samp class="samp">solar</samp>&rsquo;</dt>
  49799. <dt>&lsquo;<samp class="samp">nominal</samp>&rsquo;</dt>
  49800. <dt>&lsquo;<samp class="samp">preferred</samp>&rsquo;</dt>
  49801. <dt>&lsquo;<samp class="samp">total</samp>&rsquo;</dt>
  49802. <dt>&lsquo;<samp class="samp">spectral</samp>&rsquo;</dt>
  49803. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  49804. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  49805. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  49806. <dt>&lsquo;<samp class="samp">blues</samp>&rsquo;</dt>
  49807. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  49808. <dt>&lsquo;<samp class="samp">helix</samp>&rsquo;</dt>
  49809. </dl>
  49810. </dd>
  49811. <dt><samp class="option">opacity</samp></dt>
  49812. <dd><p>Set opacity of output colors. Allowed range is from 0 to 1.
  49813. Default value is set to 1.
  49814. </p></dd>
  49815. </dl>
  49816. <p>Each of the expression options specifies the expression to use for computing
  49817. the lookup table for the corresponding pixel component values.
  49818. </p>
  49819. <p>The expressions can contain the following constants and functions:
  49820. </p>
  49821. <dl class="table">
  49822. <dt><samp class="option">w</samp></dt>
  49823. <dt><samp class="option">h</samp></dt>
  49824. <dd><p>The input width and height.
  49825. </p>
  49826. </dd>
  49827. <dt><samp class="option">val</samp></dt>
  49828. <dd><p>The input value for the pixel component.
  49829. </p>
  49830. </dd>
  49831. <dt><samp class="option">ymin, umin, vmin, amin</samp></dt>
  49832. <dd><p>The minimum allowed component value.
  49833. </p>
  49834. </dd>
  49835. <dt><samp class="option">ymax, umax, vmax, amax</samp></dt>
  49836. <dd><p>The maximum allowed component value.
  49837. </p></dd>
  49838. </dl>
  49839. <p>All expressions default to &quot;val&quot;.
  49840. </p>
  49841. <ul class="mini-toc">
  49842. <li><a href="#Commands-133" accesskey="1">Commands</a></li>
  49843. <li><a href="#Examples-149" accesskey="2">Examples</a></li>
  49844. </ul>
  49845. <div class="subsection-level-extent" id="Commands-133">
  49846. <h4 class="subsection"><span>39.199.1 Commands<a class="copiable-link" href="#Commands-133"> &para;</a></span></h4>
  49847. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  49848. </p>
  49849. </div>
  49850. <div class="subsection-level-extent" id="Examples-149">
  49851. <h4 class="subsection"><span>39.199.2 Examples<a class="copiable-link" href="#Examples-149"> &para;</a></span></h4>
  49852. <ul class="itemize mark-bullet">
  49853. <li>Change too high luma values to gradient:
  49854. <div class="example">
  49855. <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;
  49856. </pre></div>
  49857. </li></ul>
  49858. </div>
  49859. </div>
  49860. <div class="section-level-extent" id="psnr">
  49861. <h3 class="section"><span>39.200 psnr<a class="copiable-link" href="#psnr"> &para;</a></span></h3>
  49862. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  49863. Ratio) between two input videos.
  49864. </p>
  49865. <p>This filter takes in input two input videos, the first input is
  49866. considered the &quot;main&quot; source and is passed unchanged to the
  49867. output. The second input is used as a &quot;reference&quot; video for computing
  49868. the PSNR.
  49869. </p>
  49870. <p>Both video inputs must have the same resolution and pixel format for
  49871. this filter to work correctly. Also it assumes that both inputs
  49872. have the same number of frames, which are compared one by one.
  49873. </p>
  49874. <p>The obtained average PSNR is printed through the logging system.
  49875. </p>
  49876. <p>The filter stores the accumulated MSE (mean squared error) of each
  49877. frame, and at the end of the processing it is averaged across all frames
  49878. equally, and the following formula is applied to obtain the PSNR:
  49879. </p>
  49880. <div class="example">
  49881. <pre class="example-preformatted">PSNR = 10*log10(MAX^2/MSE)
  49882. </pre></div>
  49883. <p>Where MAX is the average of the maximum values of each component of the
  49884. image.
  49885. </p>
  49886. <p>The description of the accepted parameters follows.
  49887. </p>
  49888. <dl class="table">
  49889. <dt><samp class="option">stats_file, f</samp></dt>
  49890. <dd><p>If specified the filter will use the named file to save the PSNR of
  49891. each individual frame. When filename equals &quot;-&quot; the data is sent to
  49892. standard output.
  49893. </p>
  49894. </dd>
  49895. <dt><samp class="option">stats_version</samp></dt>
  49896. <dd><p>Specifies which version of the stats file format to use. Details of
  49897. each format are written below.
  49898. Default value is 1.
  49899. </p>
  49900. </dd>
  49901. <dt><samp class="option">stats_add_max</samp></dt>
  49902. <dd><p>Determines whether the max value is output to the stats log.
  49903. Default value is 0.
  49904. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  49905. the filter will return an error.
  49906. </p></dd>
  49907. </dl>
  49908. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  49909. </p>
  49910. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  49911. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  49912. couple of frames.
  49913. </p>
  49914. <p>If a <var class="var">stats_version</var> greater than 1 is specified, a header line precedes
  49915. the list of per-frame-pair stats, with key value pairs following the frame
  49916. format with the following parameters:
  49917. </p>
  49918. <dl class="table">
  49919. <dt><samp class="option">psnr_log_version</samp></dt>
  49920. <dd><p>The version of the log file format. Will match <var class="var">stats_version</var>.
  49921. </p>
  49922. </dd>
  49923. <dt><samp class="option">fields</samp></dt>
  49924. <dd><p>A comma separated list of the per-frame-pair parameters included in
  49925. the log.
  49926. </p></dd>
  49927. </dl>
  49928. <p>A description of each shown per-frame-pair parameter follows:
  49929. </p>
  49930. <dl class="table">
  49931. <dt><samp class="option">n</samp></dt>
  49932. <dd><p>sequential number of the input frame, starting from 1
  49933. </p>
  49934. </dd>
  49935. <dt><samp class="option">mse_avg</samp></dt>
  49936. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  49937. frames, averaged over all the image components.
  49938. </p>
  49939. </dd>
  49940. <dt><samp class="option">mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp></dt>
  49941. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  49942. frames for the component specified by the suffix.
  49943. </p>
  49944. </dd>
  49945. <dt><samp class="option">psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp></dt>
  49946. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  49947. specified by the suffix.
  49948. </p>
  49949. </dd>
  49950. <dt><samp class="option">max_avg, max_y, max_u, max_v</samp></dt>
  49951. <dd><p>Maximum allowed value for each channel, and average over all
  49952. channels.
  49953. </p></dd>
  49954. </dl>
  49955. <ul class="mini-toc">
  49956. <li><a href="#Examples-150" accesskey="1">Examples</a></li>
  49957. </ul>
  49958. <div class="subsection-level-extent" id="Examples-150">
  49959. <h4 class="subsection"><span>39.200.1 Examples<a class="copiable-link" href="#Examples-150"> &para;</a></span></h4>
  49960. <ul class="itemize mark-bullet">
  49961. <li>For example:
  49962. <div class="example">
  49963. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  49964. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  49965. </pre></div>
  49966. <p>On this example the input file being processed is compared with the
  49967. reference file <samp class="file">ref_movie.mpg</samp>. The PSNR of each individual frame
  49968. is stored in <samp class="file">stats.log</samp>.
  49969. </p>
  49970. </li><li>Another example with different containers:
  49971. <div class="example">
  49972. <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 -
  49973. </pre></div>
  49974. </li></ul>
  49975. <a class="anchor" id="pullup"></a></div>
  49976. </div>
  49977. <div class="section-level-extent" id="pullup-1">
  49978. <h3 class="section"><span>39.201 pullup<a class="copiable-link" href="#pullup-1"> &para;</a></span></h3>
  49979. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  49980. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  49981. content.
  49982. </p>
  49983. <p>The pullup filter is designed to take advantage of future context in making
  49984. its decisions. This filter is stateless in the sense that it does not lock
  49985. onto a pattern to follow, but it instead looks forward to the following
  49986. fields in order to identify matches and rebuild progressive frames.
  49987. </p>
  49988. <p>To produce content with an even framerate, insert the fps filter after
  49989. pullup, use <code class="code">fps=24000/1001</code> if the input frame rate is 29.97fps,
  49990. <code class="code">fps=24</code> for 30fps and the (rare) telecined 25fps input.
  49991. </p>
  49992. <p>The filter accepts the following options:
  49993. </p>
  49994. <dl class="table">
  49995. <dt><samp class="option">jl</samp></dt>
  49996. <dt><samp class="option">jr</samp></dt>
  49997. <dt><samp class="option">jt</samp></dt>
  49998. <dt><samp class="option">jb</samp></dt>
  49999. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  50000. bottom of the image, respectively. Left and right are in units of 8 pixels,
  50001. while top and bottom are in units of 2 lines.
  50002. The default is 8 pixels on each side.
  50003. </p>
  50004. </dd>
  50005. <dt><samp class="option">sb</samp></dt>
  50006. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  50007. filter generating an occasional mismatched frame, but it may also cause an
  50008. excessive number of frames to be dropped during high motion sequences.
  50009. Conversely, setting it to -1 will make filter match fields more easily.
  50010. This may help processing of video where there is slight blurring between
  50011. the fields, but may also cause there to be interlaced frames in the output.
  50012. Default value is <code class="code">0</code>.
  50013. </p>
  50014. </dd>
  50015. <dt><samp class="option">mp</samp></dt>
  50016. <dd><p>Set the metric plane to use. It accepts the following values:
  50017. </p><dl class="table">
  50018. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  50019. <dd><p>Use luma plane.
  50020. </p>
  50021. </dd>
  50022. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  50023. <dd><p>Use chroma blue plane.
  50024. </p>
  50025. </dd>
  50026. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  50027. <dd><p>Use chroma red plane.
  50028. </p></dd>
  50029. </dl>
  50030. <p>This option may be set to use chroma plane instead of the default luma plane
  50031. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  50032. source material, but more likely will decrease accuracy, especially if there
  50033. is chroma noise (rainbow effect) or any grayscale video.
  50034. The main purpose of setting <samp class="option">mp</samp> to a chroma plane is to reduce CPU
  50035. load and make pullup usable in realtime on slow machines.
  50036. </p></dd>
  50037. </dl>
  50038. <p>For best results (without duplicated frames in the output file) it is
  50039. necessary to change the output frame rate. For example, to inverse
  50040. telecine NTSC input:
  50041. </p><div class="example">
  50042. <pre class="example-preformatted">ffmpeg -i input -vf pullup -r 24000/1001 ...
  50043. </pre></div>
  50044. </div>
  50045. <div class="section-level-extent" id="qp">
  50046. <h3 class="section"><span>39.202 qp<a class="copiable-link" href="#qp"> &para;</a></span></h3>
  50047. <p>Change video quantization parameters (QP).
  50048. </p>
  50049. <p>The filter accepts the following option:
  50050. </p>
  50051. <dl class="table">
  50052. <dt><samp class="option">qp</samp></dt>
  50053. <dd><p>Set expression for quantization parameter.
  50054. </p></dd>
  50055. </dl>
  50056. <p>The expression is evaluated through the eval API and can contain, among others,
  50057. the following constants:
  50058. </p>
  50059. <dl class="table">
  50060. <dt><var class="var">known</var></dt>
  50061. <dd><p>1 if index is not 129, 0 otherwise.
  50062. </p>
  50063. </dd>
  50064. <dt><var class="var">qp</var></dt>
  50065. <dd><p>Sequential index starting from -129 to 128.
  50066. </p></dd>
  50067. </dl>
  50068. <ul class="mini-toc">
  50069. <li><a href="#Examples-151" accesskey="1">Examples</a></li>
  50070. </ul>
  50071. <div class="subsection-level-extent" id="Examples-151">
  50072. <h4 class="subsection"><span>39.202.1 Examples<a class="copiable-link" href="#Examples-151"> &para;</a></span></h4>
  50073. <ul class="itemize mark-bullet">
  50074. <li>Some equation like:
  50075. <div class="example">
  50076. <pre class="example-preformatted">qp=2+2*sin(PI*qp)
  50077. </pre></div>
  50078. </li></ul>
  50079. </div>
  50080. </div>
  50081. <div class="section-level-extent" id="qrencode">
  50082. <h3 class="section"><span>39.203 qrencode<a class="copiable-link" href="#qrencode"> &para;</a></span></h3>
  50083. <p>Generate a QR code using the libqrencode library (see
  50084. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>), and overlay it on top of the current
  50085. frame.
  50086. </p>
  50087. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  50088. <code class="code">--enable-libqrencode</code>.
  50089. </p>
  50090. <p>The QR code is generated from the provided text or text pattern. The
  50091. corresponding QR code is scaled and overlayed into the video output according to
  50092. the specified options.
  50093. </p>
  50094. <p>In case no text is specified, no QR code is overlaied.
  50095. </p>
  50096. <p>This filter accepts the following options:
  50097. </p>
  50098. <dl class="table">
  50099. <dt><samp class="option">qrcode_width, q</samp></dt>
  50100. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  50101. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  50102. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  50103. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  50104. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  50105. there is no padding.
  50106. </p>
  50107. <p>These expressions are evaluated for each new frame.
  50108. </p>
  50109. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  50110. </p>
  50111. </dd>
  50112. <dt><samp class="option">x</samp></dt>
  50113. <dt><samp class="option">y</samp></dt>
  50114. <dd><p>Specify an expression for positioning the padded QR code top-left corner. The
  50115. <var class="var">x</var> expression can reference the value set by the <var class="var">y</var> expression, and
  50116. vice.
  50117. </p>
  50118. <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
  50119. is placed in the top left corner of the input.
  50120. </p>
  50121. <p>These expressions are evaluated for each new frame.
  50122. </p>
  50123. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  50124. </p>
  50125. </dd>
  50126. <dt><samp class="option">case_sensitive, cs</samp></dt>
  50127. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  50128. default. This can be disabled to reduce the QR encoding size.
  50129. </p>
  50130. </dd>
  50131. <dt><samp class="option">level, l</samp></dt>
  50132. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  50133. the encoding size will increase but the code will be more robust to corruption.
  50134. Lower level is <var class="var">L</var>.
  50135. </p>
  50136. <p>It accepts the following values:
  50137. </p><dl class="table">
  50138. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  50139. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  50140. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  50141. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  50142. </dl>
  50143. </dd>
  50144. <dt><samp class="option">expansion</samp></dt>
  50145. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  50146. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  50147. section below for details.
  50148. </p>
  50149. </dd>
  50150. <dt><samp class="option">text</samp></dt>
  50151. <dt><samp class="option">textfile</samp></dt>
  50152. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  50153. (just an empty colored frame).
  50154. </p>
  50155. <p>In case expansion is enabled, the text is treated as a text template, using the
  50156. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  50157. Text expansion</a> section below for details.
  50158. </p>
  50159. </dd>
  50160. <dt><samp class="option">background_color, bc</samp></dt>
  50161. <dt><samp class="option">foreground_color, fc</samp></dt>
  50162. <dd><p>Set the QR code and background color. The default value of
  50163. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  50164. is &quot;white&quot;.
  50165. </p>
  50166. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  50167. section in the ffmpeg-utils manual</a>.
  50168. </p></dd>
  50169. </dl>
  50170. <a class="anchor" id="qrencode_005fexpressions"></a><ul class="mini-toc">
  50171. <li><a href="#qrencode-Expressions" accesskey="1">qrencode Expressions</a></li>
  50172. <li><a href="#qrencode-Text-expansion" accesskey="2">qrencode Text expansion</a></li>
  50173. <li><a href="#Examples-152" accesskey="3">Examples</a></li>
  50174. </ul>
  50175. <div class="subsection-level-extent" id="qrencode-Expressions">
  50176. <h4 class="subsection"><span>39.203.1 qrencode Expressions<a class="copiable-link" href="#qrencode-Expressions"> &para;</a></span></h4>
  50177. <p>The expressions set by the options contain the following constants and functions.
  50178. </p>
  50179. <dl class="table">
  50180. <dt><samp class="option">dar</samp></dt>
  50181. <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>
  50182. </p>
  50183. </dd>
  50184. <dt><samp class="option">duration</samp></dt>
  50185. <dd><p>the current frame&rsquo;s duration, in seconds
  50186. </p>
  50187. </dd>
  50188. <dt><samp class="option">hsub</samp></dt>
  50189. <dt><samp class="option">vsub</samp></dt>
  50190. <dd><p>horizontal and vertical chroma subsample values. For example for the
  50191. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  50192. </p>
  50193. </dd>
  50194. <dt><samp class="option">main_h, H</samp></dt>
  50195. <dd><p>the input height
  50196. </p>
  50197. </dd>
  50198. <dt><samp class="option">main_w, W</samp></dt>
  50199. <dd><p>the input width
  50200. </p>
  50201. </dd>
  50202. <dt><samp class="option">n</samp></dt>
  50203. <dd><p>the number of input frame, starting from 0
  50204. </p>
  50205. </dd>
  50206. <dt><samp class="option">pict_type</samp></dt>
  50207. <dd><p>a number representing the picture type
  50208. </p>
  50209. </dd>
  50210. <dt><samp class="option">qr_w, w</samp></dt>
  50211. <dd><p>the width of the encoded QR code
  50212. </p>
  50213. </dd>
  50214. <dt><samp class="option">rendered_qr_w, q</samp></dt>
  50215. <dt><samp class="option">rendered_padded_qr_w, Q</samp></dt>
  50216. <dd><p>the width of the rendered QR code, without and without padding.
  50217. </p>
  50218. <p>These parameters allow the <var class="var">q</var> and <var class="var">Q</var> expressions to refer to each
  50219. other, so you can for example specify <code class="code">q=3/4*Q</code>.
  50220. </p>
  50221. </dd>
  50222. <dt><samp class="option">rand(min, max)</samp></dt>
  50223. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  50224. </p>
  50225. </dd>
  50226. <dt><samp class="option">sar</samp></dt>
  50227. <dd><p>the input sample aspect ratio
  50228. </p>
  50229. </dd>
  50230. <dt><samp class="option">t</samp></dt>
  50231. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  50232. </p>
  50233. </dd>
  50234. <dt><samp class="option">x</samp></dt>
  50235. <dt><samp class="option">y</samp></dt>
  50236. <dd><p>the x and y offset coordinates where the text is drawn.
  50237. </p>
  50238. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer to each
  50239. other, so you can for example specify <code class="code">y=x/dar</code>.
  50240. </p></dd>
  50241. </dl>
  50242. <a class="anchor" id="qrencode_005ftext_005fexpansion"></a></div>
  50243. <div class="subsection-level-extent" id="qrencode-Text-expansion">
  50244. <h4 class="subsection"><span>39.203.2 qrencode Text expansion<a class="copiable-link" href="#qrencode-Text-expansion"> &para;</a></span></h4>
  50245. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  50246. </p>
  50247. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  50248. the following expansion mechanism is used.
  50249. </p>
  50250. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  50251. the second character.
  50252. </p>
  50253. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  50254. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  50255. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  50256. they should be escaped.
  50257. </p>
  50258. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  50259. option in the filter argument string and as the filter argument in the
  50260. filtergraph description, and possibly also for the shell, that makes up to four
  50261. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  50262. these problems.
  50263. </p>
  50264. <p>The following functions are available:
  50265. </p>
  50266. <dl class="table">
  50267. <dt><code class="command">n, frame_num</code></dt>
  50268. <dd><p>return the frame number
  50269. </p>
  50270. </dd>
  50271. <dt><code class="command">pts</code></dt>
  50272. <dd><p>Return the presentation timestamp of the current frame.
  50273. </p>
  50274. <p>It can take up to two arguments.
  50275. </p>
  50276. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code> for
  50277. seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands for a
  50278. formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  50279. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  50280. <code class="code">localtime</code> stands for the timestamp of the frame formatted as local time
  50281. zone time. If the format is set to <code class="code">hms24hh</code>, the time is formatted in 24h
  50282. format (00-23).
  50283. </p>
  50284. <p>The second argument is an offset added to the timestamp.
  50285. </p>
  50286. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third argument may
  50287. be supplied: a <code class="code">strftime</code> C function format string. By default,
  50288. <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  50289. </p>
  50290. </dd>
  50291. <dt><code class="command">expr, e</code></dt>
  50292. <dd><p>Evaluate the expression&rsquo;s value and output as a double.
  50293. </p>
  50294. <p>It must take one argument specifying the expression to be evaluated, accepting
  50295. the constants and functions defined in <a class="ref" href="#qrencode_005fexpressions">qrencode_expressions</a>.
  50296. </p>
  50297. </dd>
  50298. <dt><code class="command">expr_formatted, ef</code></dt>
  50299. <dd><p>Evaluate the expression&rsquo;s value and output as a formatted string.
  50300. </p>
  50301. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  50302. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  50303. &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
  50304. <code class="code">printf</code> function.
  50305. The third parameter is optional and sets the number of positions taken by the output.
  50306. It can be used to add padding with zeros from the left.
  50307. </p>
  50308. </dd>
  50309. <dt><code class="command">gmtime</code></dt>
  50310. <dd><p>The time at which the filter is running, expressed in UTC.
  50311. It can accept an argument: a <code class="code">strftime</code> C function format string.
  50312. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  50313. which prints fractions of the second with optionally specified number of digits.
  50314. </p>
  50315. </dd>
  50316. <dt><code class="command">localtime</code></dt>
  50317. <dd><p>The time at which the filter is running, expressed in the local time zone.
  50318. It can accept an argument: a <code class="code">strftime</code> C function format string.
  50319. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  50320. which prints fractions of the second with optionally specified number of digits.
  50321. </p>
  50322. </dd>
  50323. <dt><code class="command">metadata</code></dt>
  50324. <dd><p>Frame metadata. Takes one or two arguments.
  50325. </p>
  50326. <p>The first argument is mandatory and specifies the metadata key.
  50327. </p>
  50328. <p>The second argument is optional and specifies a default value, used when the
  50329. metadata key is not found or empty.
  50330. </p>
  50331. <p>Available metadata can be identified by inspecting entries starting with TAG
  50332. included within each frame section printed by running <code class="code">ffprobe
  50333. -show_frames</code>.
  50334. </p>
  50335. <p>String metadata generated in filters leading to the qrencode filter are also
  50336. available.
  50337. </p>
  50338. </dd>
  50339. <dt><code class="command">rand(min, max)</code></dt>
  50340. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  50341. </p></dd>
  50342. </dl>
  50343. </div>
  50344. <div class="subsection-level-extent" id="Examples-152">
  50345. <h4 class="subsection"><span>39.203.3 Examples<a class="copiable-link" href="#Examples-152"> &para;</a></span></h4>
  50346. <ul class="itemize mark-bullet">
  50347. <li>Generate a QR code encoding the specified text with the default size, overalaid
  50348. in the top left corner of the input video, with the default size:
  50349. <div class="example">
  50350. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org
  50351. </pre></div>
  50352. </li><li>Same as below, but select blue on pink colors:
  50353. <div class="example">
  50354. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:bc=pink@0.5:fc=blue
  50355. </pre></div>
  50356. </li><li>Place the QR code in the bottom right corner of the input video:
  50357. <div class="example">
  50358. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:x=W-Q:y=H-Q
  50359. </pre></div>
  50360. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  50361. 4/3 of the QR code width:
  50362. <div class="example">
  50363. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=200:Q=4/3*q
  50364. </pre></div>
  50365. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  50366. code width 3/4 of the padded width:
  50367. <div class="example">
  50368. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:Q=200:q=3/4*Q
  50369. </pre></div>
  50370. </li><li>Make the QR code a fraction of the input video width:
  50371. <div class="example">
  50372. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=W/5
  50373. </pre></div>
  50374. </li><li>Generate a QR code encoding the frame number:
  50375. <div class="example">
  50376. <pre class="example-preformatted">qrencode=text=%{n}
  50377. </pre></div>
  50378. </li><li>Generate a QR code encoding the GMT timestamp:
  50379. <div class="example">
  50380. <pre class="example-preformatted">qrencode=text=%{gmtime}
  50381. </pre></div>
  50382. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  50383. <div class="example">
  50384. <pre class="example-preformatted">qrencode=text=%{pts}
  50385. </pre></div>
  50386. </li></ul>
  50387. </div>
  50388. </div>
  50389. <div class="section-level-extent" id="quirc">
  50390. <h3 class="section"><span>39.204 quirc<a class="copiable-link" href="#quirc"> &para;</a></span></h3>
  50391. <p>Identify and decode a QR code using the libquirc library (see
  50392. <a class="url" href="https://github.com/dlbeer/quirc/">https://github.com/dlbeer/quirc/</a>), and print the identified QR codes
  50393. positions and payload as metadata.
  50394. </p>
  50395. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  50396. <code class="code">--enable-libquirc</code>.
  50397. </p>
  50398. <p>For each found QR code in the input video, some metadata entries are added with
  50399. the prefix <var class="var">lavfi.quirc.N</var>, where <var class="var">N</var> is the index, starting from 0,
  50400. associated to the QR code.
  50401. </p>
  50402. <p>A description of each metadata value follows:
  50403. </p>
  50404. <dl class="table">
  50405. <dt><samp class="option">lavfi.quirc.count</samp></dt>
  50406. <dd><p>the number of found QR codes, it is not set in case none was found
  50407. </p>
  50408. </dd>
  50409. <dt><samp class="option">lavfi.quirc.N.corner.M.x</samp></dt>
  50410. <dt><samp class="option">lavfi.quirc.N.coreer.M.y</samp></dt>
  50411. <dd><p>the x/y positions of the four corners of the square containing the QR code,
  50412. where <var class="var">M</var> is the index of the corner starting from 0
  50413. </p>
  50414. </dd>
  50415. <dt><samp class="option">lavfi.quirc.N.payload</samp></dt>
  50416. <dd><p>the payload of the QR code
  50417. </p></dd>
  50418. </dl>
  50419. </div>
  50420. <div class="section-level-extent" id="random">
  50421. <h3 class="section"><span>39.205 random<a class="copiable-link" href="#random"> &para;</a></span></h3>
  50422. <p>Flush video frames from internal cache of frames into a random order.
  50423. No frame is discarded.
  50424. Inspired by <a class="ref" href="#frei0r">frei0r</a> nervous filter.
  50425. </p>
  50426. <dl class="table">
  50427. <dt><samp class="option">frames</samp></dt>
  50428. <dd><p>Set size in number of frames of internal cache, in range from <code class="code">2</code> to
  50429. <code class="code">512</code>. Default is <code class="code">30</code>.
  50430. </p>
  50431. </dd>
  50432. <dt><samp class="option">seed</samp></dt>
  50433. <dd><p>Set seed for random number generator, must be an integer included between
  50434. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  50435. less than <code class="code">0</code>, the filter will try to use a good random seed on a
  50436. best effort basis.
  50437. </p></dd>
  50438. </dl>
  50439. </div>
  50440. <div class="section-level-extent" id="readeia608">
  50441. <h3 class="section"><span>39.206 readeia608<a class="copiable-link" href="#readeia608"> &para;</a></span></h3>
  50442. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  50443. </p>
  50444. <p>This filter adds frame metadata for <code class="code">lavfi.readeia608.X.cc</code> and
  50445. <code class="code">lavfi.readeia608.X.line</code>, where <code class="code">X</code> is the number of the identified line
  50446. with EIA-608 data (starting from 0). A description of each metadata value follows:
  50447. </p>
  50448. <dl class="table">
  50449. <dt><samp class="option">lavfi.readeia608.X.cc</samp></dt>
  50450. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  50451. </p>
  50452. </dd>
  50453. <dt><samp class="option">lavfi.readeia608.X.line</samp></dt>
  50454. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  50455. </p></dd>
  50456. </dl>
  50457. <p>This filter accepts the following options:
  50458. </p>
  50459. <dl class="table">
  50460. <dt><samp class="option">scan_min</samp></dt>
  50461. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code class="code">0</code>.
  50462. </p>
  50463. </dd>
  50464. <dt><samp class="option">scan_max</samp></dt>
  50465. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code class="code">29</code>.
  50466. </p>
  50467. </dd>
  50468. <dt><samp class="option">spw</samp></dt>
  50469. <dd><p>Set the ratio of width reserved for sync code detection.
  50470. Default is <code class="code">0.27</code>. Allowed range is <code class="code">[0.1 - 0.7]</code>.
  50471. </p>
  50472. </dd>
  50473. <dt><samp class="option">chp</samp></dt>
  50474. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  50475. <code class="code">0x00</code> for that character. Default is false.
  50476. </p>
  50477. </dd>
  50478. <dt><samp class="option">lp</samp></dt>
  50479. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  50480. </p></dd>
  50481. </dl>
  50482. <ul class="mini-toc">
  50483. <li><a href="#Commands-134" accesskey="1">Commands</a></li>
  50484. <li><a href="#Examples-153" accesskey="2">Examples</a></li>
  50485. </ul>
  50486. <div class="subsection-level-extent" id="Commands-134">
  50487. <h4 class="subsection"><span>39.206.1 Commands<a class="copiable-link" href="#Commands-134"> &para;</a></span></h4>
  50488. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  50489. </p>
  50490. </div>
  50491. <div class="subsection-level-extent" id="Examples-153">
  50492. <h4 class="subsection"><span>39.206.2 Examples<a class="copiable-link" href="#Examples-153"> &para;</a></span></h4>
  50493. <ul class="itemize mark-bullet">
  50494. <li>Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  50495. <div class="example">
  50496. <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
  50497. </pre></div>
  50498. </li></ul>
  50499. </div>
  50500. </div>
  50501. <div class="section-level-extent" id="readvitc">
  50502. <h3 class="section"><span>39.207 readvitc<a class="copiable-link" href="#readvitc"> &para;</a></span></h3>
  50503. <p>Read vertical interval timecode (VITC) information from the top lines of a
  50504. video frame.
  50505. </p>
  50506. <p>The filter adds frame metadata key <code class="code">lavfi.readvitc.tc_str</code> with the
  50507. timecode value, if a valid timecode has been detected. Further metadata key
  50508. <code class="code">lavfi.readvitc.found</code> is set to 0/1 depending on whether
  50509. timecode data has been found or not.
  50510. </p>
  50511. <p>This filter accepts the following options:
  50512. </p>
  50513. <dl class="table">
  50514. <dt><samp class="option">scan_max</samp></dt>
  50515. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  50516. <code class="code">-1</code> the full video frame is scanned. Default is <code class="code">45</code>.
  50517. </p>
  50518. </dd>
  50519. <dt><samp class="option">thr_b</samp></dt>
  50520. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  50521. default value is <code class="code">0.2</code>. The value must be equal or less than <code class="code">thr_w</code>.
  50522. </p>
  50523. </dd>
  50524. <dt><samp class="option">thr_w</samp></dt>
  50525. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  50526. default value is <code class="code">0.6</code>. The value must be equal or greater than <code class="code">thr_b</code>.
  50527. </p></dd>
  50528. </dl>
  50529. <ul class="mini-toc">
  50530. <li><a href="#Examples-154" accesskey="1">Examples</a></li>
  50531. </ul>
  50532. <div class="subsection-level-extent" id="Examples-154">
  50533. <h4 class="subsection"><span>39.207.1 Examples<a class="copiable-link" href="#Examples-154"> &para;</a></span></h4>
  50534. <ul class="itemize mark-bullet">
  50535. <li>Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  50536. draw <code class="code">--:--:--:--</code> as a placeholder:
  50537. <div class="example">
  50538. <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'
  50539. </pre></div>
  50540. </li></ul>
  50541. </div>
  50542. </div>
  50543. <div class="section-level-extent" id="remap">
  50544. <h3 class="section"><span>39.208 remap<a class="copiable-link" href="#remap"> &para;</a></span></h3>
  50545. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  50546. </p>
  50547. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  50548. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  50549. value for pixel will be used for destination pixel.
  50550. </p>
  50551. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  50552. will have Xmap/Ymap video stream dimensions.
  50553. Xmap and Ymap input video streams are 16bit depth, single channel.
  50554. </p>
  50555. <dl class="table">
  50556. <dt><samp class="option">format</samp></dt>
  50557. <dd><p>Specify pixel format of output from this filter. Can be <code class="code">color</code> or <code class="code">gray</code>.
  50558. Default is <code class="code">color</code>.
  50559. </p>
  50560. </dd>
  50561. <dt><samp class="option">fill</samp></dt>
  50562. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  50563. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  50564. manual</a>. Default color is <code class="code">black</code>.
  50565. </p></dd>
  50566. </dl>
  50567. </div>
  50568. <div class="section-level-extent" id="removegrain">
  50569. <h3 class="section"><span>39.209 removegrain<a class="copiable-link" href="#removegrain"> &para;</a></span></h3>
  50570. <p>The removegrain filter is a spatial denoiser for progressive video.
  50571. </p>
  50572. <dl class="table">
  50573. <dt><samp class="option">m0</samp></dt>
  50574. <dd><p>Set mode for the first plane.
  50575. </p>
  50576. </dd>
  50577. <dt><samp class="option">m1</samp></dt>
  50578. <dd><p>Set mode for the second plane.
  50579. </p>
  50580. </dd>
  50581. <dt><samp class="option">m2</samp></dt>
  50582. <dd><p>Set mode for the third plane.
  50583. </p>
  50584. </dd>
  50585. <dt><samp class="option">m3</samp></dt>
  50586. <dd><p>Set mode for the fourth plane.
  50587. </p></dd>
  50588. </dl>
  50589. <p>Range of mode is from 0 to 24. Description of each mode follows:
  50590. </p>
  50591. <dl class="table">
  50592. <dt><var class="var">0</var></dt>
  50593. <dd><p>Leave input plane unchanged. Default.
  50594. </p>
  50595. </dd>
  50596. <dt><var class="var">1</var></dt>
  50597. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  50598. </p>
  50599. </dd>
  50600. <dt><var class="var">2</var></dt>
  50601. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  50602. </p>
  50603. </dd>
  50604. <dt><var class="var">3</var></dt>
  50605. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  50606. </p>
  50607. </dd>
  50608. <dt><var class="var">4</var></dt>
  50609. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  50610. This is equivalent to a median filter.
  50611. </p>
  50612. </dd>
  50613. <dt><var class="var">5</var></dt>
  50614. <dd><p>Line-sensitive clipping giving the minimal change.
  50615. </p>
  50616. </dd>
  50617. <dt><var class="var">6</var></dt>
  50618. <dd><p>Line-sensitive clipping, intermediate.
  50619. </p>
  50620. </dd>
  50621. <dt><var class="var">7</var></dt>
  50622. <dd><p>Line-sensitive clipping, intermediate.
  50623. </p>
  50624. </dd>
  50625. <dt><var class="var">8</var></dt>
  50626. <dd><p>Line-sensitive clipping, intermediate.
  50627. </p>
  50628. </dd>
  50629. <dt><var class="var">9</var></dt>
  50630. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  50631. </p>
  50632. </dd>
  50633. <dt><var class="var">10</var></dt>
  50634. <dd><p>Replaces the target pixel with the closest neighbour.
  50635. </p>
  50636. </dd>
  50637. <dt><var class="var">11</var></dt>
  50638. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  50639. </p>
  50640. </dd>
  50641. <dt><var class="var">12</var></dt>
  50642. <dd><p>Same as mode 11.
  50643. </p>
  50644. </dd>
  50645. <dt><var class="var">13</var></dt>
  50646. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  50647. pixels are the closest.
  50648. </p>
  50649. </dd>
  50650. <dt><var class="var">14</var></dt>
  50651. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  50652. pixels are the closest.
  50653. </p>
  50654. </dd>
  50655. <dt><var class="var">15</var></dt>
  50656. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  50657. interpolation formula.
  50658. </p>
  50659. </dd>
  50660. <dt><var class="var">16</var></dt>
  50661. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  50662. interpolation formula.
  50663. </p>
  50664. </dd>
  50665. <dt><var class="var">17</var></dt>
  50666. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  50667. minimum of each pair of opposite neighbour pixels.
  50668. </p>
  50669. </dd>
  50670. <dt><var class="var">18</var></dt>
  50671. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  50672. the current pixel is minimal.
  50673. </p>
  50674. </dd>
  50675. <dt><var class="var">19</var></dt>
  50676. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  50677. </p>
  50678. </dd>
  50679. <dt><var class="var">20</var></dt>
  50680. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  50681. </p>
  50682. </dd>
  50683. <dt><var class="var">21</var></dt>
  50684. <dd><p>Clips pixels using the averages of opposite neighbour.
  50685. </p>
  50686. </dd>
  50687. <dt><var class="var">22</var></dt>
  50688. <dd><p>Same as mode 21 but simpler and faster.
  50689. </p>
  50690. </dd>
  50691. <dt><var class="var">23</var></dt>
  50692. <dd><p>Small edge and halo removal, but reputed useless.
  50693. </p>
  50694. </dd>
  50695. <dt><var class="var">24</var></dt>
  50696. <dd><p>Similar as 23.
  50697. </p></dd>
  50698. </dl>
  50699. </div>
  50700. <div class="section-level-extent" id="removelogo">
  50701. <h3 class="section"><span>39.210 removelogo<a class="copiable-link" href="#removelogo"> &para;</a></span></h3>
  50702. <p>Suppress a TV station logo, using an image file to determine which
  50703. pixels comprise the logo. It works by filling in the pixels that
  50704. comprise the logo with neighboring pixels.
  50705. </p>
  50706. <p>The filter accepts the following options:
  50707. </p>
  50708. <dl class="table">
  50709. <dt><samp class="option">filename, f</samp></dt>
  50710. <dd><p>Set the filter bitmap file, which can be any image format supported by
  50711. libavformat. The width and height of the image file must match those of the
  50712. video stream being processed.
  50713. </p></dd>
  50714. </dl>
  50715. <p>Pixels in the provided bitmap image with a value of zero are not
  50716. considered part of the logo, non-zero pixels are considered part of
  50717. the logo. If you use white (255) for the logo and black (0) for the
  50718. rest, you will be safe. For making the filter bitmap, it is
  50719. recommended to take a screen capture of a black frame with the logo
  50720. visible, and then using a threshold filter followed by the erode
  50721. filter once or twice.
  50722. </p>
  50723. <p>If needed, little splotches can be fixed manually. Remember that if
  50724. logo pixels are not covered, the filter quality will be much
  50725. reduced. Marking too many pixels as part of the logo does not hurt as
  50726. much, but it will increase the amount of blurring needed to cover over
  50727. the image and will destroy more information than necessary, and extra
  50728. pixels will slow things down on a large logo.
  50729. </p>
  50730. </div>
  50731. <div class="section-level-extent" id="repeatfields">
  50732. <h3 class="section"><span>39.211 repeatfields<a class="copiable-link" href="#repeatfields"> &para;</a></span></h3>
  50733. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  50734. fields based on its value.
  50735. </p>
  50736. </div>
  50737. <div class="section-level-extent" id="reverse">
  50738. <h3 class="section"><span>39.212 reverse<a class="copiable-link" href="#reverse"> &para;</a></span></h3>
  50739. <p>Reverse a video clip.
  50740. </p>
  50741. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  50742. is suggested.
  50743. </p>
  50744. <ul class="mini-toc">
  50745. <li><a href="#Examples-155" accesskey="1">Examples</a></li>
  50746. </ul>
  50747. <div class="subsection-level-extent" id="Examples-155">
  50748. <h4 class="subsection"><span>39.212.1 Examples<a class="copiable-link" href="#Examples-155"> &para;</a></span></h4>
  50749. <ul class="itemize mark-bullet">
  50750. <li>Take the first 5 seconds of a clip, and reverse it.
  50751. <div class="example">
  50752. <pre class="example-preformatted">trim=end=5,reverse
  50753. </pre></div>
  50754. </li></ul>
  50755. </div>
  50756. </div>
  50757. <div class="section-level-extent" id="rgbashift">
  50758. <h3 class="section"><span>39.213 rgbashift<a class="copiable-link" href="#rgbashift"> &para;</a></span></h3>
  50759. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  50760. </p>
  50761. <p>The filter accepts the following options:
  50762. </p><dl class="table">
  50763. <dt><samp class="option">rh</samp></dt>
  50764. <dd><p>Set amount to shift red horizontally.
  50765. </p></dd>
  50766. <dt><samp class="option">rv</samp></dt>
  50767. <dd><p>Set amount to shift red vertically.
  50768. </p></dd>
  50769. <dt><samp class="option">gh</samp></dt>
  50770. <dd><p>Set amount to shift green horizontally.
  50771. </p></dd>
  50772. <dt><samp class="option">gv</samp></dt>
  50773. <dd><p>Set amount to shift green vertically.
  50774. </p></dd>
  50775. <dt><samp class="option">bh</samp></dt>
  50776. <dd><p>Set amount to shift blue horizontally.
  50777. </p></dd>
  50778. <dt><samp class="option">bv</samp></dt>
  50779. <dd><p>Set amount to shift blue vertically.
  50780. </p></dd>
  50781. <dt><samp class="option">ah</samp></dt>
  50782. <dd><p>Set amount to shift alpha horizontally.
  50783. </p></dd>
  50784. <dt><samp class="option">av</samp></dt>
  50785. <dd><p>Set amount to shift alpha vertically.
  50786. </p></dd>
  50787. <dt><samp class="option">edge</samp></dt>
  50788. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  50789. </p></dd>
  50790. </dl>
  50791. <ul class="mini-toc">
  50792. <li><a href="#Commands-135" accesskey="1">Commands</a></li>
  50793. </ul>
  50794. <div class="subsection-level-extent" id="Commands-135">
  50795. <h4 class="subsection"><span>39.213.1 Commands<a class="copiable-link" href="#Commands-135"> &para;</a></span></h4>
  50796. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  50797. </p>
  50798. </div>
  50799. </div>
  50800. <div class="section-level-extent" id="roberts">
  50801. <h3 class="section"><span>39.214 roberts<a class="copiable-link" href="#roberts"> &para;</a></span></h3>
  50802. <p>Apply roberts cross operator to input video stream.
  50803. </p>
  50804. <p>The filter accepts the following option:
  50805. </p>
  50806. <dl class="table">
  50807. <dt><samp class="option">planes</samp></dt>
  50808. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  50809. By default value 0xf, all planes will be processed.
  50810. </p>
  50811. </dd>
  50812. <dt><samp class="option">scale</samp></dt>
  50813. <dd><p>Set value which will be multiplied with filtered result.
  50814. </p>
  50815. </dd>
  50816. <dt><samp class="option">delta</samp></dt>
  50817. <dd><p>Set value which will be added to filtered result.
  50818. </p></dd>
  50819. </dl>
  50820. <ul class="mini-toc">
  50821. <li><a href="#Commands-136" accesskey="1">Commands</a></li>
  50822. </ul>
  50823. <div class="subsection-level-extent" id="Commands-136">
  50824. <h4 class="subsection"><span>39.214.1 Commands<a class="copiable-link" href="#Commands-136"> &para;</a></span></h4>
  50825. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  50826. </p>
  50827. </div>
  50828. </div>
  50829. <div class="section-level-extent" id="rotate">
  50830. <h3 class="section"><span>39.215 rotate<a class="copiable-link" href="#rotate"> &para;</a></span></h3>
  50831. <p>Rotate video by an arbitrary angle expressed in radians.
  50832. </p>
  50833. <p>The filter accepts the following options:
  50834. </p>
  50835. <p>A description of the optional parameters follows.
  50836. </p><dl class="table">
  50837. <dt><samp class="option">angle, a</samp></dt>
  50838. <dd><p>Set an expression for the angle by which to rotate the input video
  50839. clockwise, expressed as a number of radians. A negative value will
  50840. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  50841. </p>
  50842. <p>This expression is evaluated for each frame.
  50843. </p>
  50844. </dd>
  50845. <dt><samp class="option">out_w, ow</samp></dt>
  50846. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  50847. This expression is evaluated just once during configuration.
  50848. </p>
  50849. </dd>
  50850. <dt><samp class="option">out_h, oh</samp></dt>
  50851. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  50852. This expression is evaluated just once during configuration.
  50853. </p>
  50854. </dd>
  50855. <dt><samp class="option">bilinear</samp></dt>
  50856. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  50857. it. Default value is 1.
  50858. </p>
  50859. </dd>
  50860. <dt><samp class="option">fillcolor, c</samp></dt>
  50861. <dd><p>Set the color used to fill the output area not covered by the rotated
  50862. image. For the general syntax of this option, check the
  50863. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  50864. If the special value &quot;none&quot; is selected then no
  50865. background is printed (useful for example if the background is never shown).
  50866. </p>
  50867. <p>Default value is &quot;black&quot;.
  50868. </p></dd>
  50869. </dl>
  50870. <p>The expressions for the angle and the output size can contain the
  50871. following constants and functions:
  50872. </p>
  50873. <dl class="table">
  50874. <dt><samp class="option">n</samp></dt>
  50875. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  50876. before the first frame is filtered.
  50877. </p>
  50878. </dd>
  50879. <dt><samp class="option">t</samp></dt>
  50880. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  50881. configured. It is always NAN before the first frame is filtered.
  50882. </p>
  50883. </dd>
  50884. <dt><samp class="option">hsub</samp></dt>
  50885. <dt><samp class="option">vsub</samp></dt>
  50886. <dd><p>horizontal and vertical chroma subsample values. For example for the
  50887. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  50888. </p>
  50889. </dd>
  50890. <dt><samp class="option">in_w, iw</samp></dt>
  50891. <dt><samp class="option">in_h, ih</samp></dt>
  50892. <dd><p>the input video width and height
  50893. </p>
  50894. </dd>
  50895. <dt><samp class="option">out_w, ow</samp></dt>
  50896. <dt><samp class="option">out_h, oh</samp></dt>
  50897. <dd><p>the output width and height, that is the size of the padded area as
  50898. specified by the <var class="var">width</var> and <var class="var">height</var> expressions
  50899. </p>
  50900. </dd>
  50901. <dt><samp class="option">rotw(a)</samp></dt>
  50902. <dt><samp class="option">roth(a)</samp></dt>
  50903. <dd><p>the minimal width/height required for completely containing the input
  50904. video rotated by <var class="var">a</var> radians.
  50905. </p>
  50906. <p>These are only available when computing the <samp class="option">out_w</samp> and
  50907. <samp class="option">out_h</samp> expressions.
  50908. </p></dd>
  50909. </dl>
  50910. <ul class="mini-toc">
  50911. <li><a href="#Examples-156" accesskey="1">Examples</a></li>
  50912. <li><a href="#Commands-137" accesskey="2">Commands</a></li>
  50913. </ul>
  50914. <div class="subsection-level-extent" id="Examples-156">
  50915. <h4 class="subsection"><span>39.215.1 Examples<a class="copiable-link" href="#Examples-156"> &para;</a></span></h4>
  50916. <ul class="itemize mark-bullet">
  50917. <li>Rotate the input by PI/6 radians clockwise:
  50918. <div class="example">
  50919. <pre class="example-preformatted">rotate=PI/6
  50920. </pre></div>
  50921. </li><li>Rotate the input by PI/6 radians counter-clockwise:
  50922. <div class="example">
  50923. <pre class="example-preformatted">rotate=-PI/6
  50924. </pre></div>
  50925. </li><li>Rotate the input by 45 degrees clockwise:
  50926. <div class="example">
  50927. <pre class="example-preformatted">rotate=45*PI/180
  50928. </pre></div>
  50929. </li><li>Apply a constant rotation with period T, starting from an angle of PI/3:
  50930. <div class="example">
  50931. <pre class="example-preformatted">rotate=PI/3+2*PI*t/T
  50932. </pre></div>
  50933. </li><li>Make the input video rotation oscillating with a period of T
  50934. seconds and an amplitude of A radians:
  50935. <div class="example">
  50936. <pre class="example-preformatted">rotate=A*sin(2*PI/T*t)
  50937. </pre></div>
  50938. </li><li>Rotate the video, output size is chosen so that the whole rotating
  50939. input video is always completely contained in the output:
  50940. <div class="example">
  50941. <pre class="example-preformatted">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  50942. </pre></div>
  50943. </li><li>Rotate the video, reduce the output size so that no background is ever
  50944. shown:
  50945. <div class="example">
  50946. <pre class="example-preformatted">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  50947. </pre></div>
  50948. </li></ul>
  50949. </div>
  50950. <div class="subsection-level-extent" id="Commands-137">
  50951. <h4 class="subsection"><span>39.215.2 Commands<a class="copiable-link" href="#Commands-137"> &para;</a></span></h4>
  50952. <p>The filter supports the following commands:
  50953. </p>
  50954. <dl class="table">
  50955. <dt><samp class="option">a, angle</samp></dt>
  50956. <dd><p>Set the angle expression.
  50957. The command accepts the same syntax of the corresponding option.
  50958. </p>
  50959. <p>If the specified expression is not valid, it is kept at its current
  50960. value.
  50961. </p></dd>
  50962. </dl>
  50963. </div>
  50964. </div>
  50965. <div class="section-level-extent" id="sab">
  50966. <h3 class="section"><span>39.216 sab<a class="copiable-link" href="#sab"> &para;</a></span></h3>
  50967. <p>Apply Shape Adaptive Blur.
  50968. </p>
  50969. <p>The filter accepts the following options:
  50970. </p>
  50971. <dl class="table">
  50972. <dt><samp class="option">luma_radius, lr</samp></dt>
  50973. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  50974. value is 1.0. A greater value will result in a more blurred image, and
  50975. in slower processing.
  50976. </p>
  50977. </dd>
  50978. <dt><samp class="option">luma_pre_filter_radius, lpfr</samp></dt>
  50979. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  50980. value is 1.0.
  50981. </p>
  50982. </dd>
  50983. <dt><samp class="option">luma_strength, ls</samp></dt>
  50984. <dd><p>Set luma maximum difference between pixels to still be considered, must
  50985. be a value in the 0.1-100.0 range, default value is 1.0.
  50986. </p>
  50987. </dd>
  50988. <dt><samp class="option">chroma_radius, cr</samp></dt>
  50989. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  50990. greater value will result in a more blurred image, and in slower
  50991. processing.
  50992. </p>
  50993. </dd>
  50994. <dt><samp class="option">chroma_pre_filter_radius, cpfr</samp></dt>
  50995. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  50996. </p>
  50997. </dd>
  50998. <dt><samp class="option">chroma_strength, cs</samp></dt>
  50999. <dd><p>Set chroma maximum difference between pixels to still be considered,
  51000. must be a value in the -0.9-100.0 range.
  51001. </p></dd>
  51002. </dl>
  51003. <p>Each chroma option value, if not explicitly specified, is set to the
  51004. corresponding luma option value.
  51005. </p>
  51006. <a class="anchor" id="scale"></a></div>
  51007. <div class="section-level-extent" id="scale-1">
  51008. <h3 class="section"><span>39.217 scale<a class="copiable-link" href="#scale-1"> &para;</a></span></h3>
  51009. <p>Scale (resize) the input video, using the libswscale library.
  51010. </p>
  51011. <p>The scale filter forces the output display aspect ratio to be the same
  51012. of the input, by changing the output sample aspect ratio.
  51013. </p>
  51014. <p>If the input image format is different from the format requested by
  51015. the next filter, the scale filter will convert the input to the
  51016. requested format.
  51017. </p>
  51018. <ul class="mini-toc">
  51019. <li><a href="#Options-113" accesskey="1">Options</a></li>
  51020. <li><a href="#Examples-157" accesskey="2">Examples</a></li>
  51021. <li><a href="#Commands-138" accesskey="3">Commands</a></li>
  51022. </ul>
  51023. <div class="subsection-level-extent" id="Options-113">
  51024. <h4 class="subsection"><span>39.217.1 Options<a class="copiable-link" href="#Options-113"> &para;</a></span></h4>
  51025. <p>The filter accepts the following options, or any of the options
  51026. supported by the libswscale scaler.
  51027. </p>
  51028. <p>See <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#scaler_005foptions">the ffmpeg-scaler manual</a> for
  51029. the complete list of scaler options.
  51030. </p>
  51031. <dl class="table">
  51032. <dt><samp class="option">width, w</samp></dt>
  51033. <dt><samp class="option">height, h</samp></dt>
  51034. <dd><p>Set the output video dimension expression. Default value is the input
  51035. dimension.
  51036. </p>
  51037. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  51038. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  51039. is used for the output.
  51040. </p>
  51041. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  51042. will use a value that maintains the aspect ratio of the input image,
  51043. calculated from the other specified dimension. After that it will,
  51044. however, make sure that the calculated dimension is divisible by n and
  51045. adjust the value if necessary.
  51046. </p>
  51047. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  51048. both values being set to 0 as previously detailed.
  51049. </p>
  51050. <p>See below for the list of accepted constants for use in the dimension
  51051. expression.
  51052. </p>
  51053. </dd>
  51054. <dt><samp class="option">eval</samp></dt>
  51055. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  51056. </p>
  51057. <dl class="table">
  51058. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  51059. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  51060. </p>
  51061. </dd>
  51062. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  51063. <dd><p>Evaluate expressions for each incoming frame.
  51064. </p>
  51065. </dd>
  51066. </dl>
  51067. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  51068. </p>
  51069. </dd>
  51070. <dt><samp class="option">interl</samp></dt>
  51071. <dd><p>Set the interlacing mode. It accepts the following values:
  51072. </p>
  51073. <dl class="table">
  51074. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  51075. <dd><p>Force interlaced aware scaling.
  51076. </p>
  51077. </dd>
  51078. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  51079. <dd><p>Do not apply interlaced scaling.
  51080. </p>
  51081. </dd>
  51082. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  51083. <dd><p>Select interlaced aware scaling depending on whether the source frames
  51084. are flagged as interlaced or not.
  51085. </p></dd>
  51086. </dl>
  51087. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  51088. </p>
  51089. </dd>
  51090. <dt><samp class="option">flags</samp></dt>
  51091. <dd><p>Set libswscale scaling flags. See
  51092. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fflags">the ffmpeg-scaler manual</a> for the
  51093. complete list of values. If not explicitly specified the filter applies
  51094. the default flags.
  51095. </p>
  51096. </dd>
  51097. <dt><samp class="option">param0, param1</samp></dt>
  51098. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  51099. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fparams">the ffmpeg-scaler manual</a> for the
  51100. complete documentation. If not explicitly specified the filter applies
  51101. empty parameters.
  51102. </p>
  51103. </dd>
  51104. <dt><samp class="option">size, s</samp></dt>
  51105. <dd><p>Set the video size. For the syntax of this option, check the
  51106. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  51107. </p>
  51108. </dd>
  51109. <dt><samp class="option">in_color_matrix</samp></dt>
  51110. <dt><samp class="option">out_color_matrix</samp></dt>
  51111. <dd><p>Set in/output YCbCr color space type.
  51112. </p>
  51113. <p>This allows the autodetected value to be overridden as well as allows forcing
  51114. a specific value used for the output and encoder.
  51115. </p>
  51116. <p>If not specified, the color space type depends on the pixel format.
  51117. </p>
  51118. <p>Possible values:
  51119. </p>
  51120. <dl class="table">
  51121. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  51122. <dd><p>Choose automatically.
  51123. </p>
  51124. </dd>
  51125. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  51126. <dd><p>Format conforming to International Telecommunication Union (ITU)
  51127. Recommendation BT.709.
  51128. </p>
  51129. </dd>
  51130. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  51131. <dd><p>Set color space conforming to the United States Federal Communications
  51132. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  51133. </p>
  51134. </dd>
  51135. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  51136. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  51137. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  51138. <dd><p>Set color space conforming to:
  51139. </p>
  51140. <ul class="itemize mark-bullet">
  51141. <li>ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  51142. </li><li>ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  51143. </li><li>Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  51144. </li></ul>
  51145. </dd>
  51146. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  51147. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  51148. </p>
  51149. </dd>
  51150. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  51151. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  51152. </p></dd>
  51153. </dl>
  51154. </dd>
  51155. <dt><samp class="option">in_range</samp></dt>
  51156. <dt><samp class="option">out_range</samp></dt>
  51157. <dd><p>Set in/output YCbCr sample range.
  51158. </p>
  51159. <p>This allows the autodetected value to be overridden as well as allows forcing
  51160. a specific value used for the output and encoder. If not specified, the
  51161. range depends on the pixel format. Possible values:
  51162. </p>
  51163. <dl class="table">
  51164. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  51165. <dd><p>Choose automatically.
  51166. </p>
  51167. </dd>
  51168. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  51169. <dd><p>Set full range (0-255 in case of 8-bit luma).
  51170. </p>
  51171. </dd>
  51172. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  51173. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  51174. </p></dd>
  51175. </dl>
  51176. </dd>
  51177. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  51178. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  51179. keep the original aspect ratio. Possible values:
  51180. </p>
  51181. <dl class="table">
  51182. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  51183. <dd><p>Scale the video as specified and disable this feature.
  51184. </p>
  51185. </dd>
  51186. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  51187. <dd><p>The output video dimensions will automatically be decreased if needed.
  51188. </p>
  51189. </dd>
  51190. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  51191. <dd><p>The output video dimensions will automatically be increased if needed.
  51192. </p>
  51193. </dd>
  51194. </dl>
  51195. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  51196. maximum allowed resolution, you can use this to limit the output video to
  51197. that, while retaining the aspect ratio. For example, device A allows
  51198. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  51199. decrease) and specifying 1280x720 to the command line makes the output
  51200. 1280x533.
  51201. </p>
  51202. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  51203. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  51204. to work.
  51205. </p>
  51206. </dd>
  51207. <dt><samp class="option">force_divisible_by</samp></dt>
  51208. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  51209. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  51210. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  51211. </p>
  51212. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  51213. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  51214. may be slightly modified.
  51215. </p>
  51216. <p>This option can be handy if you need to have a video fit within or exceed
  51217. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  51218. encoder restrictions on width or height divisibility.
  51219. </p>
  51220. </dd>
  51221. </dl>
  51222. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  51223. containing the following constants:
  51224. </p>
  51225. <dl class="table">
  51226. <dt><var class="var">in_w</var></dt>
  51227. <dt><var class="var">in_h</var></dt>
  51228. <dd><p>The input width and height
  51229. </p>
  51230. </dd>
  51231. <dt><var class="var">iw</var></dt>
  51232. <dt><var class="var">ih</var></dt>
  51233. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  51234. </p>
  51235. </dd>
  51236. <dt><var class="var">out_w</var></dt>
  51237. <dt><var class="var">out_h</var></dt>
  51238. <dd><p>The output (scaled) width and height
  51239. </p>
  51240. </dd>
  51241. <dt><var class="var">ow</var></dt>
  51242. <dt><var class="var">oh</var></dt>
  51243. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  51244. </p>
  51245. </dd>
  51246. <dt><var class="var">a</var></dt>
  51247. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  51248. </p>
  51249. </dd>
  51250. <dt><var class="var">sar</var></dt>
  51251. <dd><p>input sample aspect ratio
  51252. </p>
  51253. </dd>
  51254. <dt><var class="var">dar</var></dt>
  51255. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  51256. </p>
  51257. </dd>
  51258. <dt><var class="var">hsub</var></dt>
  51259. <dt><var class="var">vsub</var></dt>
  51260. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  51261. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  51262. </p>
  51263. </dd>
  51264. <dt><var class="var">ohsub</var></dt>
  51265. <dt><var class="var">ovsub</var></dt>
  51266. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  51267. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  51268. </p>
  51269. </dd>
  51270. <dt><var class="var">n</var></dt>
  51271. <dd><p>The (sequential) number of the input frame, starting from 0.
  51272. Only available with <code class="code">eval=frame</code>.
  51273. </p>
  51274. </dd>
  51275. <dt><var class="var">t</var></dt>
  51276. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  51277. seconds. Only available with <code class="code">eval=frame</code>.
  51278. </p>
  51279. </dd>
  51280. <dt><var class="var">pos</var></dt>
  51281. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  51282. this information is unavailable and/or meaningless (for example in case of synthetic video).
  51283. Only available with <code class="code">eval=frame</code>.
  51284. Deprecated, do not use.
  51285. </p></dd>
  51286. </dl>
  51287. </div>
  51288. <div class="subsection-level-extent" id="Examples-157">
  51289. <h4 class="subsection"><span>39.217.2 Examples<a class="copiable-link" href="#Examples-157"> &para;</a></span></h4>
  51290. <ul class="itemize mark-bullet">
  51291. <li>Scale the input video to a size of 200x100
  51292. <div class="example">
  51293. <pre class="example-preformatted">scale=w=200:h=100
  51294. </pre></div>
  51295. <p>This is equivalent to:
  51296. </p><div class="example">
  51297. <pre class="example-preformatted">scale=200:100
  51298. </pre></div>
  51299. <p>or:
  51300. </p><div class="example">
  51301. <pre class="example-preformatted">scale=200x100
  51302. </pre></div>
  51303. </li><li>Specify a size abbreviation for the output size:
  51304. <div class="example">
  51305. <pre class="example-preformatted">scale=qcif
  51306. </pre></div>
  51307. <p>which can also be written as:
  51308. </p><div class="example">
  51309. <pre class="example-preformatted">scale=size=qcif
  51310. </pre></div>
  51311. </li><li>Scale the input to 2x:
  51312. <div class="example">
  51313. <pre class="example-preformatted">scale=w=2*iw:h=2*ih
  51314. </pre></div>
  51315. </li><li>The above is the same as:
  51316. <div class="example">
  51317. <pre class="example-preformatted">scale=2*in_w:2*in_h
  51318. </pre></div>
  51319. </li><li>Scale the input to 2x with forced interlaced scaling:
  51320. <div class="example">
  51321. <pre class="example-preformatted">scale=2*iw:2*ih:interl=1
  51322. </pre></div>
  51323. </li><li>Scale the input to half size:
  51324. <div class="example">
  51325. <pre class="example-preformatted">scale=w=iw/2:h=ih/2
  51326. </pre></div>
  51327. </li><li>Increase the width, and set the height to the same size:
  51328. <div class="example">
  51329. <pre class="example-preformatted">scale=3/2*iw:ow
  51330. </pre></div>
  51331. </li><li>Seek Greek harmony:
  51332. <div class="example">
  51333. <pre class="example-preformatted">scale=iw:1/PHI*iw
  51334. scale=ih*PHI:ih
  51335. </pre></div>
  51336. </li><li>Increase the height, and set the width to 3/2 of the height:
  51337. <div class="example">
  51338. <pre class="example-preformatted">scale=w=3/2*oh:h=3/5*ih
  51339. </pre></div>
  51340. </li><li>Increase the size, making the size a multiple of the chroma
  51341. subsample values:
  51342. <div class="example">
  51343. <pre class="example-preformatted">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  51344. </pre></div>
  51345. </li><li>Increase the width to a maximum of 500 pixels,
  51346. keeping the same aspect ratio as the input:
  51347. <div class="example">
  51348. <pre class="example-preformatted">scale=w='min(500\, iw*3/2):h=-1'
  51349. </pre></div>
  51350. </li><li>Make pixels square by combining scale and setsar:
  51351. <div class="example">
  51352. <pre class="example-preformatted">scale='trunc(ih*dar):ih',setsar=1/1
  51353. </pre></div>
  51354. </li><li>Make pixels square by combining scale and setsar,
  51355. making sure the resulting resolution is even (required by some codecs):
  51356. <div class="example">
  51357. <pre class="example-preformatted">scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
  51358. </pre></div>
  51359. </li></ul>
  51360. </div>
  51361. <div class="subsection-level-extent" id="Commands-138">
  51362. <h4 class="subsection"><span>39.217.3 Commands<a class="copiable-link" href="#Commands-138"> &para;</a></span></h4>
  51363. <p>This filter supports the following commands:
  51364. </p><dl class="table">
  51365. <dt><samp class="option">width, w</samp></dt>
  51366. <dt><samp class="option">height, h</samp></dt>
  51367. <dd><p>Set the output video dimension expression.
  51368. The command accepts the same syntax of the corresponding option.
  51369. </p>
  51370. <p>If the specified expression is not valid, it is kept at its current
  51371. value.
  51372. </p></dd>
  51373. </dl>
  51374. <a class="anchor" id="scale_005fcuda"></a></div>
  51375. </div>
  51376. <div class="section-level-extent" id="scale_005fcuda-1">
  51377. <h3 class="section"><span>39.218 scale_cuda<a class="copiable-link" href="#scale_005fcuda-1"> &para;</a></span></h3>
  51378. <p>Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels.
  51379. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  51380. </p>
  51381. <p>The filter accepts the following options:
  51382. </p><dl class="table">
  51383. <dt><samp class="option">w</samp></dt>
  51384. <dt><samp class="option">h</samp></dt>
  51385. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  51386. </p>
  51387. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  51388. </p>
  51389. </dd>
  51390. <dt><samp class="option">interp_algo</samp></dt>
  51391. <dd><p>Sets the algorithm used for scaling:
  51392. </p>
  51393. <dl class="table">
  51394. <dt><var class="var">nearest</var></dt>
  51395. <dd><p>Nearest neighbour
  51396. </p>
  51397. <p>Used by default if input parameters match the desired output.
  51398. </p>
  51399. </dd>
  51400. <dt><var class="var">bilinear</var></dt>
  51401. <dd><p>Bilinear
  51402. </p>
  51403. </dd>
  51404. <dt><var class="var">bicubic</var></dt>
  51405. <dd><p>Bicubic
  51406. </p>
  51407. <p>This is the default.
  51408. </p>
  51409. </dd>
  51410. <dt><var class="var">lanczos</var></dt>
  51411. <dd><p>Lanczos
  51412. </p>
  51413. </dd>
  51414. </dl>
  51415. </dd>
  51416. <dt><samp class="option">format</samp></dt>
  51417. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  51418. pixel format is used.
  51419. </p>
  51420. <p>The filter does not support converting between YUV and RGB pixel formats.
  51421. </p>
  51422. </dd>
  51423. <dt><samp class="option">passthrough</samp></dt>
  51424. <dd><p>If set to 0, every frame is processed, even if no conversion is necessary.
  51425. This mode can be useful to use the filter as a buffer for a downstream
  51426. frame-consumer that exhausts the limited decoder frame pool.
  51427. </p>
  51428. <p>If set to 1, frames are passed through as-is if they match the desired output
  51429. parameters. This is the default behaviour.
  51430. </p>
  51431. </dd>
  51432. <dt><samp class="option">param</samp></dt>
  51433. <dd><p>Algorithm-Specific parameter.
  51434. </p>
  51435. <p>Affects the curves of the bicubic algorithm.
  51436. </p>
  51437. </dd>
  51438. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  51439. <dt><samp class="option">force_divisible_by</samp></dt>
  51440. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  51441. </p>
  51442. </dd>
  51443. </dl>
  51444. <ul class="mini-toc">
  51445. <li><a href="#Examples-158" accesskey="1">Examples</a></li>
  51446. </ul>
  51447. <div class="subsection-level-extent" id="Examples-158">
  51448. <h4 class="subsection"><span>39.218.1 Examples<a class="copiable-link" href="#Examples-158"> &para;</a></span></h4>
  51449. <ul class="itemize mark-bullet">
  51450. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  51451. <div class="example">
  51452. <pre class="example-preformatted">scale_cuda=-2:720:format=yuv420p
  51453. </pre></div>
  51454. </li><li>Upscale to 4K using nearest neighbour algorithm.
  51455. <div class="example">
  51456. <pre class="example-preformatted">scale_cuda=4096:2160:interp_algo=nearest
  51457. </pre></div>
  51458. </li><li>Don&rsquo;t do any conversion or scaling, but copy all input frames into newly allocated ones.
  51459. This can be useful to deal with a filter and encode chain that otherwise exhausts the
  51460. decoders frame pool.
  51461. <div class="example">
  51462. <pre class="example-preformatted">scale_cuda=passthrough=0
  51463. </pre></div>
  51464. </li></ul>
  51465. <a class="anchor" id="scale_005fnpp"></a></div>
  51466. </div>
  51467. <div class="section-level-extent" id="scale_005fnpp-1">
  51468. <h3 class="section"><span>39.219 scale_npp<a class="copiable-link" href="#scale_005fnpp-1"> &para;</a></span></h3>
  51469. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  51470. format conversion on CUDA video frames. Setting the output width and height
  51471. works in the same way as for the <var class="var">scale</var> filter.
  51472. </p>
  51473. <p>The following additional options are accepted:
  51474. </p><dl class="table">
  51475. <dt><samp class="option">format</samp></dt>
  51476. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  51477. default), the input format will be kept. Note that automatic format negotiation
  51478. and conversion is not yet supported for hardware frames
  51479. </p>
  51480. </dd>
  51481. <dt><samp class="option">interp_algo</samp></dt>
  51482. <dd><p>The interpolation algorithm used for resizing. One of the following:
  51483. </p><dl class="table">
  51484. <dt><samp class="option">nn</samp></dt>
  51485. <dd><p>Nearest neighbour.
  51486. </p>
  51487. </dd>
  51488. <dt><samp class="option">linear</samp></dt>
  51489. <dt><samp class="option">cubic</samp></dt>
  51490. <dt><samp class="option">cubic2p_bspline</samp></dt>
  51491. <dd><p>2-parameter cubic (B=1, C=0)
  51492. </p>
  51493. </dd>
  51494. <dt><samp class="option">cubic2p_catmullrom</samp></dt>
  51495. <dd><p>2-parameter cubic (B=0, C=1/2)
  51496. </p>
  51497. </dd>
  51498. <dt><samp class="option">cubic2p_b05c03</samp></dt>
  51499. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  51500. </p>
  51501. </dd>
  51502. <dt><samp class="option">super</samp></dt>
  51503. <dd><p>Supersampling
  51504. </p>
  51505. </dd>
  51506. <dt><samp class="option">lanczos</samp></dt>
  51507. </dl>
  51508. </dd>
  51509. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  51510. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  51511. keep the original aspect ratio. Possible values:
  51512. </p>
  51513. <dl class="table">
  51514. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  51515. <dd><p>Scale the video as specified and disable this feature.
  51516. </p>
  51517. </dd>
  51518. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  51519. <dd><p>The output video dimensions will automatically be decreased if needed.
  51520. </p>
  51521. </dd>
  51522. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  51523. <dd><p>The output video dimensions will automatically be increased if needed.
  51524. </p>
  51525. </dd>
  51526. </dl>
  51527. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  51528. maximum allowed resolution, you can use this to limit the output video to
  51529. that, while retaining the aspect ratio. For example, device A allows
  51530. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  51531. decrease) and specifying 1280x720 to the command line makes the output
  51532. 1280x533.
  51533. </p>
  51534. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  51535. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  51536. to work.
  51537. </p>
  51538. </dd>
  51539. <dt><samp class="option">force_divisible_by</samp></dt>
  51540. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  51541. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  51542. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  51543. </p>
  51544. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  51545. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  51546. may be slightly modified.
  51547. </p>
  51548. <p>This option can be handy if you need to have a video fit within or exceed
  51549. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  51550. encoder restrictions on width or height divisibility.
  51551. </p>
  51552. </dd>
  51553. <dt><samp class="option">eval</samp></dt>
  51554. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  51555. </p>
  51556. <dl class="table">
  51557. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  51558. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  51559. </p>
  51560. </dd>
  51561. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  51562. <dd><p>Evaluate expressions for each incoming frame.
  51563. </p>
  51564. </dd>
  51565. </dl>
  51566. </dd>
  51567. </dl>
  51568. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  51569. containing the following constants:
  51570. </p>
  51571. <dl class="table">
  51572. <dt><var class="var">in_w</var></dt>
  51573. <dt><var class="var">in_h</var></dt>
  51574. <dd><p>The input width and height
  51575. </p>
  51576. </dd>
  51577. <dt><var class="var">iw</var></dt>
  51578. <dt><var class="var">ih</var></dt>
  51579. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  51580. </p>
  51581. </dd>
  51582. <dt><var class="var">out_w</var></dt>
  51583. <dt><var class="var">out_h</var></dt>
  51584. <dd><p>The output (scaled) width and height
  51585. </p>
  51586. </dd>
  51587. <dt><var class="var">ow</var></dt>
  51588. <dt><var class="var">oh</var></dt>
  51589. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  51590. </p>
  51591. </dd>
  51592. <dt><var class="var">a</var></dt>
  51593. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  51594. </p>
  51595. </dd>
  51596. <dt><var class="var">sar</var></dt>
  51597. <dd><p>input sample aspect ratio
  51598. </p>
  51599. </dd>
  51600. <dt><var class="var">dar</var></dt>
  51601. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  51602. </p>
  51603. </dd>
  51604. <dt><var class="var">n</var></dt>
  51605. <dd><p>The (sequential) number of the input frame, starting from 0.
  51606. Only available with <code class="code">eval=frame</code>.
  51607. </p>
  51608. </dd>
  51609. <dt><var class="var">t</var></dt>
  51610. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  51611. seconds. Only available with <code class="code">eval=frame</code>.
  51612. </p>
  51613. </dd>
  51614. <dt><var class="var">pos</var></dt>
  51615. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  51616. this information is unavailable and/or meaningless (for example in case of synthetic video).
  51617. Only available with <code class="code">eval=frame</code>.
  51618. Deprecated, do not use.
  51619. </p></dd>
  51620. </dl>
  51621. </div>
  51622. <div class="section-level-extent" id="scale2ref">
  51623. <h3 class="section"><span>39.220 scale2ref<a class="copiable-link" href="#scale2ref"> &para;</a></span></h3>
  51624. <p>Scale (resize) the input video, based on a reference video.
  51625. </p>
  51626. <p>See the scale filter for available options, scale2ref supports the same but
  51627. uses the reference video instead of the main input as basis. scale2ref also
  51628. supports the following additional constants for the <samp class="option">w</samp> and
  51629. <samp class="option">h</samp> options:
  51630. </p>
  51631. <dl class="table">
  51632. <dt><var class="var">main_w</var></dt>
  51633. <dt><var class="var">main_h</var></dt>
  51634. <dd><p>The main input video&rsquo;s width and height
  51635. </p>
  51636. </dd>
  51637. <dt><var class="var">main_a</var></dt>
  51638. <dd><p>The same as <var class="var">main_w</var> / <var class="var">main_h</var>
  51639. </p>
  51640. </dd>
  51641. <dt><var class="var">main_sar</var></dt>
  51642. <dd><p>The main input video&rsquo;s sample aspect ratio
  51643. </p>
  51644. </dd>
  51645. <dt><var class="var">main_dar, mdar</var></dt>
  51646. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  51647. <code class="code">(main_w / main_h) * main_sar</code>.
  51648. </p>
  51649. </dd>
  51650. <dt><var class="var">main_hsub</var></dt>
  51651. <dt><var class="var">main_vsub</var></dt>
  51652. <dd><p>The main input video&rsquo;s horizontal and vertical chroma subsample values.
  51653. For example for the pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var>
  51654. is 1.
  51655. </p>
  51656. </dd>
  51657. <dt><var class="var">main_n</var></dt>
  51658. <dd><p>The (sequential) number of the main input frame, starting from 0.
  51659. Only available with <code class="code">eval=frame</code>.
  51660. </p>
  51661. </dd>
  51662. <dt><var class="var">main_t</var></dt>
  51663. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  51664. seconds. Only available with <code class="code">eval=frame</code>.
  51665. </p>
  51666. </dd>
  51667. <dt><var class="var">main_pos</var></dt>
  51668. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  51669. this information is unavailable and/or meaningless (for example in case of synthetic video).
  51670. Only available with <code class="code">eval=frame</code>.
  51671. </p></dd>
  51672. </dl>
  51673. <ul class="mini-toc">
  51674. <li><a href="#Examples-159" accesskey="1">Examples</a></li>
  51675. <li><a href="#Commands-139" accesskey="2">Commands</a></li>
  51676. </ul>
  51677. <div class="subsection-level-extent" id="Examples-159">
  51678. <h4 class="subsection"><span>39.220.1 Examples<a class="copiable-link" href="#Examples-159"> &para;</a></span></h4>
  51679. <ul class="itemize mark-bullet">
  51680. <li>Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  51681. <div class="example">
  51682. <pre class="example-preformatted">'scale2ref[b][a];[a][b]overlay'
  51683. </pre></div>
  51684. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  51685. <div class="example">
  51686. <pre class="example-preformatted">[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
  51687. </pre></div>
  51688. </li></ul>
  51689. </div>
  51690. <div class="subsection-level-extent" id="Commands-139">
  51691. <h4 class="subsection"><span>39.220.2 Commands<a class="copiable-link" href="#Commands-139"> &para;</a></span></h4>
  51692. <p>This filter supports the following commands:
  51693. </p><dl class="table">
  51694. <dt><samp class="option">width, w</samp></dt>
  51695. <dt><samp class="option">height, h</samp></dt>
  51696. <dd><p>Set the output video dimension expression.
  51697. The command accepts the same syntax of the corresponding option.
  51698. </p>
  51699. <p>If the specified expression is not valid, it is kept at its current
  51700. value.
  51701. </p></dd>
  51702. </dl>
  51703. </div>
  51704. </div>
  51705. <div class="section-level-extent" id="scale2ref_005fnpp">
  51706. <h3 class="section"><span>39.221 scale2ref_npp<a class="copiable-link" href="#scale2ref_005fnpp"> &para;</a></span></h3>
  51707. <p>Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input
  51708. video, based on a reference video.
  51709. </p>
  51710. <p>See the <a class="ref" href="#scale_005fnpp">scale_npp</a> filter for available options, scale2ref_npp supports the same
  51711. but uses the reference video instead of the main input as basis. scale2ref_npp
  51712. also supports the following additional constants for the <samp class="option">w</samp> and
  51713. <samp class="option">h</samp> options:
  51714. </p>
  51715. <dl class="table">
  51716. <dt><var class="var">main_w</var></dt>
  51717. <dt><var class="var">main_h</var></dt>
  51718. <dd><p>The main input video&rsquo;s width and height
  51719. </p>
  51720. </dd>
  51721. <dt><var class="var">main_a</var></dt>
  51722. <dd><p>The same as <var class="var">main_w</var> / <var class="var">main_h</var>
  51723. </p>
  51724. </dd>
  51725. <dt><var class="var">main_sar</var></dt>
  51726. <dd><p>The main input video&rsquo;s sample aspect ratio
  51727. </p>
  51728. </dd>
  51729. <dt><var class="var">main_dar, mdar</var></dt>
  51730. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  51731. <code class="code">(main_w / main_h) * main_sar</code>.
  51732. </p>
  51733. </dd>
  51734. <dt><var class="var">main_n</var></dt>
  51735. <dd><p>The (sequential) number of the main input frame, starting from 0.
  51736. Only available with <code class="code">eval=frame</code>.
  51737. </p>
  51738. </dd>
  51739. <dt><var class="var">main_t</var></dt>
  51740. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  51741. seconds. Only available with <code class="code">eval=frame</code>.
  51742. </p>
  51743. </dd>
  51744. <dt><var class="var">main_pos</var></dt>
  51745. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  51746. this information is unavailable and/or meaningless (for example in case of synthetic video).
  51747. Only available with <code class="code">eval=frame</code>.
  51748. </p></dd>
  51749. </dl>
  51750. <ul class="mini-toc">
  51751. <li><a href="#Examples-160" accesskey="1">Examples</a></li>
  51752. </ul>
  51753. <div class="subsection-level-extent" id="Examples-160">
  51754. <h4 class="subsection"><span>39.221.1 Examples<a class="copiable-link" href="#Examples-160"> &para;</a></span></h4>
  51755. <ul class="itemize mark-bullet">
  51756. <li>Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  51757. <div class="example">
  51758. <pre class="example-preformatted">'scale2ref_npp[b][a];[a][b]overlay_cuda'
  51759. </pre></div>
  51760. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  51761. <div class="example">
  51762. <pre class="example-preformatted">[logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
  51763. </pre></div>
  51764. </li></ul>
  51765. </div>
  51766. </div>
  51767. <div class="section-level-extent" id="scale_005fvt">
  51768. <h3 class="section"><span>39.222 scale_vt<a class="copiable-link" href="#scale_005fvt"> &para;</a></span></h3>
  51769. <p>Scale and convert the color parameters using VTPixelTransferSession.
  51770. </p>
  51771. <p>The filter accepts the following options:
  51772. </p><dl class="table">
  51773. <dt><samp class="option">w</samp></dt>
  51774. <dt><samp class="option">h</samp></dt>
  51775. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  51776. </p>
  51777. </dd>
  51778. <dt><samp class="option">color_matrix</samp></dt>
  51779. <dd><p>Set the output colorspace matrix.
  51780. </p>
  51781. </dd>
  51782. <dt><samp class="option">color_primaries</samp></dt>
  51783. <dd><p>Set the output color primaries.
  51784. </p>
  51785. </dd>
  51786. <dt><samp class="option">color_transfer</samp></dt>
  51787. <dd><p>Set the output transfer characteristics.
  51788. </p>
  51789. </dd>
  51790. </dl>
  51791. </div>
  51792. <div class="section-level-extent" id="scharr">
  51793. <h3 class="section"><span>39.223 scharr<a class="copiable-link" href="#scharr"> &para;</a></span></h3>
  51794. <p>Apply scharr operator to input video stream.
  51795. </p>
  51796. <p>The filter accepts the following option:
  51797. </p>
  51798. <dl class="table">
  51799. <dt><samp class="option">planes</samp></dt>
  51800. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  51801. By default value 0xf, all planes will be processed.
  51802. </p>
  51803. </dd>
  51804. <dt><samp class="option">scale</samp></dt>
  51805. <dd><p>Set value which will be multiplied with filtered result.
  51806. </p>
  51807. </dd>
  51808. <dt><samp class="option">delta</samp></dt>
  51809. <dd><p>Set value which will be added to filtered result.
  51810. </p></dd>
  51811. </dl>
  51812. <ul class="mini-toc">
  51813. <li><a href="#Commands-140" accesskey="1">Commands</a></li>
  51814. </ul>
  51815. <div class="subsection-level-extent" id="Commands-140">
  51816. <h4 class="subsection"><span>39.223.1 Commands<a class="copiable-link" href="#Commands-140"> &para;</a></span></h4>
  51817. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  51818. </p>
  51819. </div>
  51820. </div>
  51821. <div class="section-level-extent" id="scroll">
  51822. <h3 class="section"><span>39.224 scroll<a class="copiable-link" href="#scroll"> &para;</a></span></h3>
  51823. <p>Scroll input video horizontally and/or vertically by constant speed.
  51824. </p>
  51825. <p>The filter accepts the following options:
  51826. </p><dl class="table">
  51827. <dt><samp class="option">horizontal, h</samp></dt>
  51828. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  51829. Negative values changes scrolling direction.
  51830. </p>
  51831. </dd>
  51832. <dt><samp class="option">vertical, v</samp></dt>
  51833. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  51834. Negative values changes scrolling direction.
  51835. </p>
  51836. </dd>
  51837. <dt><samp class="option">hpos</samp></dt>
  51838. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  51839. </p>
  51840. </dd>
  51841. <dt><samp class="option">vpos</samp></dt>
  51842. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  51843. </p></dd>
  51844. </dl>
  51845. <ul class="mini-toc">
  51846. <li><a href="#Commands-141" accesskey="1">Commands</a></li>
  51847. </ul>
  51848. <div class="subsection-level-extent" id="Commands-141">
  51849. <h4 class="subsection"><span>39.224.1 Commands<a class="copiable-link" href="#Commands-141"> &para;</a></span></h4>
  51850. <p>This filter supports the following <a class="ref" href="#commands">commands</a>:
  51851. </p><dl class="table">
  51852. <dt><samp class="option">horizontal, h</samp></dt>
  51853. <dd><p>Set the horizontal scrolling speed.
  51854. </p></dd>
  51855. <dt><samp class="option">vertical, v</samp></dt>
  51856. <dd><p>Set the vertical scrolling speed.
  51857. </p></dd>
  51858. </dl>
  51859. <a class="anchor" id="scdet"></a></div>
  51860. </div>
  51861. <div class="section-level-extent" id="scdet-1">
  51862. <h3 class="section"><span>39.225 scdet<a class="copiable-link" href="#scdet-1"> &para;</a></span></h3>
  51863. <p>Detect video scene change.
  51864. </p>
  51865. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  51866. forward the frame to the next filter, so they can use these metadata to detect
  51867. scene change or others.
  51868. </p>
  51869. <p>In addition, this filter logs a message and sets frame metadata when it detects
  51870. a scene change by <samp class="option">threshold</samp>.
  51871. </p>
  51872. <p><code class="code">lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  51873. </p>
  51874. <p><code class="code">lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  51875. to detect scene change.
  51876. </p>
  51877. <p><code class="code">lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  51878. detect scene change with <samp class="option">threshold</samp>.
  51879. </p>
  51880. <p>The filter accepts the following options:
  51881. </p>
  51882. <dl class="table">
  51883. <dt><samp class="option">threshold, t</samp></dt>
  51884. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  51885. values are in the <code class="code">[8.0, 14.0]</code> range. The range for <samp class="option">threshold</samp> is
  51886. <code class="code">[0., 100.]</code>.
  51887. </p>
  51888. <p>Default value is <code class="code">10.</code>.
  51889. </p>
  51890. </dd>
  51891. <dt><samp class="option">sc_pass, s</samp></dt>
  51892. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code class="code">0</code>
  51893. You can enable it if you want to get snapshot of scene change frames only.
  51894. </p></dd>
  51895. </dl>
  51896. <a class="anchor" id="selectivecolor"></a></div>
  51897. <div class="section-level-extent" id="selectivecolor-1">
  51898. <h3 class="section"><span>39.226 selectivecolor<a class="copiable-link" href="#selectivecolor-1"> &para;</a></span></h3>
  51899. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  51900. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  51901. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  51902. </p>
  51903. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  51904. </p>
  51905. <p>The filter accepts the following options:
  51906. </p>
  51907. <dl class="table">
  51908. <dt><samp class="option">correction_method</samp></dt>
  51909. <dd><p>Select color correction method.
  51910. </p>
  51911. <p>Available values are:
  51912. </p><dl class="table">
  51913. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  51914. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  51915. component value).
  51916. </p></dd>
  51917. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  51918. <dd><p>Specified adjustments are relative to the original component value.
  51919. </p></dd>
  51920. </dl>
  51921. <p>Default is <code class="code">absolute</code>.
  51922. </p></dd>
  51923. <dt><samp class="option">reds</samp></dt>
  51924. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  51925. </p></dd>
  51926. <dt><samp class="option">yellows</samp></dt>
  51927. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  51928. </p></dd>
  51929. <dt><samp class="option">greens</samp></dt>
  51930. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  51931. </p></dd>
  51932. <dt><samp class="option">cyans</samp></dt>
  51933. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  51934. </p></dd>
  51935. <dt><samp class="option">blues</samp></dt>
  51936. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  51937. </p></dd>
  51938. <dt><samp class="option">magentas</samp></dt>
  51939. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  51940. </p></dd>
  51941. <dt><samp class="option">whites</samp></dt>
  51942. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  51943. </p></dd>
  51944. <dt><samp class="option">neutrals</samp></dt>
  51945. <dd><p>Adjustments for all pixels except pure black and pure white
  51946. </p></dd>
  51947. <dt><samp class="option">blacks</samp></dt>
  51948. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  51949. </p></dd>
  51950. <dt><samp class="option">psfile</samp></dt>
  51951. <dd><p>Specify a Photoshop selective color file (<code class="code">.asv</code>) to import the settings from.
  51952. </p></dd>
  51953. </dl>
  51954. <p>All the adjustment settings (<samp class="option">reds</samp>, <samp class="option">yellows</samp>, ...) accept up to
  51955. 4 space separated floating point adjustment values in the [-1,1] range,
  51956. respectively to adjust the amount of cyan, magenta, yellow and black for the
  51957. pixels of its range.
  51958. </p>
  51959. <ul class="mini-toc">
  51960. <li><a href="#Examples-161" accesskey="1">Examples</a></li>
  51961. </ul>
  51962. <div class="subsection-level-extent" id="Examples-161">
  51963. <h4 class="subsection"><span>39.226.1 Examples<a class="copiable-link" href="#Examples-161"> &para;</a></span></h4>
  51964. <ul class="itemize mark-bullet">
  51965. <li>Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  51966. increase magenta by 27% in blue areas:
  51967. <div class="example">
  51968. <pre class="example-preformatted">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  51969. </pre></div>
  51970. </li><li>Use a Photoshop selective color preset:
  51971. <div class="example">
  51972. <pre class="example-preformatted">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  51973. </pre></div>
  51974. </li></ul>
  51975. <a class="anchor" id="separatefields"></a></div>
  51976. </div>
  51977. <div class="section-level-extent" id="separatefields-1">
  51978. <h3 class="section"><span>39.227 separatefields<a class="copiable-link" href="#separatefields-1"> &para;</a></span></h3>
  51979. <p>The <code class="code">separatefields</code> takes a frame-based video input and splits
  51980. each frame into its components fields, producing a new half height clip
  51981. with twice the frame rate and twice the frame count.
  51982. </p>
  51983. <p>This filter use field-dominance information in frame to decide which
  51984. of each pair of fields to place first in the output.
  51985. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">separatefields</code> filter.
  51986. </p>
  51987. </div>
  51988. <div class="section-level-extent" id="setdar_002c-setsar">
  51989. <h3 class="section"><span>39.228 setdar, setsar<a class="copiable-link" href="#setdar_002c-setsar"> &para;</a></span></h3>
  51990. <p>The <code class="code">setdar</code> filter sets the Display Aspect Ratio for the filter
  51991. output video.
  51992. </p>
  51993. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  51994. Ratio, according to the following equation:
  51995. </p><div class="example">
  51996. <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>
  51997. </pre></div>
  51998. <p>Keep in mind that the <code class="code">setdar</code> filter does not modify the pixel
  51999. dimensions of the video frame. Also, the display aspect ratio set by
  52000. this filter may be changed by later filters in the filterchain,
  52001. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  52002. applied.
  52003. </p>
  52004. <p>The <code class="code">setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  52005. the filter output video.
  52006. </p>
  52007. <p>Note that as a consequence of the application of this filter, the
  52008. output display aspect ratio will change according to the equation
  52009. above.
  52010. </p>
  52011. <p>Keep in mind that the sample aspect ratio set by the <code class="code">setsar</code>
  52012. filter may be changed by later filters in the filterchain, e.g. if
  52013. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  52014. </p>
  52015. <p>It accepts the following parameters:
  52016. </p>
  52017. <dl class="table">
  52018. <dt><samp class="option">r, ratio, dar (<code class="code">setdar</code> only), sar (<code class="code">setsar</code> only)</samp></dt>
  52019. <dd><p>Set the aspect ratio used by the filter.
  52020. </p>
  52021. <p>The parameter can be a floating point number string, or an expression. If the
  52022. parameter is not specified, the value &quot;0&quot; is assumed, meaning that the same
  52023. input value is used.
  52024. </p>
  52025. </dd>
  52026. <dt><samp class="option">max</samp></dt>
  52027. <dd><p>Set the maximum integer value to use for expressing numerator and
  52028. denominator when reducing the expressed aspect ratio to a rational.
  52029. Default value is <code class="code">100</code>.
  52030. </p>
  52031. </dd>
  52032. </dl>
  52033. <p>The parameter <var class="var">sar</var> is an expression containing the following constants:
  52034. </p>
  52035. <dl class="table">
  52036. <dt><samp class="option">w, h</samp></dt>
  52037. <dd><p>The input width and height.
  52038. </p>
  52039. </dd>
  52040. <dt><samp class="option">a</samp></dt>
  52041. <dd><p>Same as <var class="var">w</var> / <var class="var">h</var>.
  52042. </p>
  52043. </dd>
  52044. <dt><samp class="option">sar</samp></dt>
  52045. <dd><p>The input sample aspect ratio.
  52046. </p>
  52047. </dd>
  52048. <dt><samp class="option">dar</samp></dt>
  52049. <dd><p>The input display aspect ratio. It is the same as
  52050. (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  52051. </p>
  52052. </dd>
  52053. <dt><samp class="option">hsub, vsub</samp></dt>
  52054. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  52055. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  52056. </p></dd>
  52057. </dl>
  52058. <ul class="mini-toc">
  52059. <li><a href="#Examples-162" accesskey="1">Examples</a></li>
  52060. </ul>
  52061. <div class="subsection-level-extent" id="Examples-162">
  52062. <h4 class="subsection"><span>39.228.1 Examples<a class="copiable-link" href="#Examples-162"> &para;</a></span></h4>
  52063. <ul class="itemize mark-bullet">
  52064. <li>To change the display aspect ratio to 16:9, specify one of the following:
  52065. <div class="example">
  52066. <pre class="example-preformatted">setdar=dar=1.77777
  52067. setdar=dar=16/9
  52068. </pre></div>
  52069. </li><li>To change the sample aspect ratio to 10:11, specify:
  52070. <div class="example">
  52071. <pre class="example-preformatted">setsar=sar=10/11
  52072. </pre></div>
  52073. </li><li>To set a display aspect ratio of 16:9, and specify a maximum integer value of
  52074. 1000 in the aspect ratio reduction, use the command:
  52075. <div class="example">
  52076. <pre class="example-preformatted">setdar=ratio=16/9:max=1000
  52077. </pre></div>
  52078. </li></ul>
  52079. <a class="anchor" id="setfield"></a></div>
  52080. </div>
  52081. <div class="section-level-extent" id="setfield-1">
  52082. <h3 class="section"><span>39.229 setfield<a class="copiable-link" href="#setfield-1"> &para;</a></span></h3>
  52083. <p>Force field for the output video frame.
  52084. </p>
  52085. <p>The <code class="code">setfield</code> filter marks the interlace type field for the
  52086. output frames. It does not change the input frame, but only sets the
  52087. corresponding property, which affects how the frame is treated by
  52088. following filters (e.g. <code class="code">fieldorder</code> or <code class="code">yadif</code>).
  52089. </p>
  52090. <p>The filter accepts the following options:
  52091. </p>
  52092. <dl class="table">
  52093. <dt><samp class="option">mode</samp></dt>
  52094. <dd><p>Available values are:
  52095. </p>
  52096. <dl class="table">
  52097. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  52098. <dd><p>Keep the same field property.
  52099. </p>
  52100. </dd>
  52101. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  52102. <dd><p>Mark the frame as bottom-field-first.
  52103. </p>
  52104. </dd>
  52105. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  52106. <dd><p>Mark the frame as top-field-first.
  52107. </p>
  52108. </dd>
  52109. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  52110. <dd><p>Mark the frame as progressive.
  52111. </p></dd>
  52112. </dl>
  52113. </dd>
  52114. </dl>
  52115. <a class="anchor" id="setparams"></a></div>
  52116. <div class="section-level-extent" id="setparams-1">
  52117. <h3 class="section"><span>39.230 setparams<a class="copiable-link" href="#setparams-1"> &para;</a></span></h3>
  52118. <p>Force frame parameter for the output video frame.
  52119. </p>
  52120. <p>The <code class="code">setparams</code> filter marks interlace and color range for the
  52121. output frames. It does not change the input frame, but only sets the
  52122. corresponding property, which affects how the frame is treated by
  52123. filters/encoders.
  52124. </p>
  52125. <dl class="table">
  52126. <dt><samp class="option">field_mode</samp></dt>
  52127. <dd><p>Available values are:
  52128. </p>
  52129. <dl class="table">
  52130. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  52131. <dd><p>Keep the same field property (default).
  52132. </p>
  52133. </dd>
  52134. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  52135. <dd><p>Mark the frame as bottom-field-first.
  52136. </p>
  52137. </dd>
  52138. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  52139. <dd><p>Mark the frame as top-field-first.
  52140. </p>
  52141. </dd>
  52142. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  52143. <dd><p>Mark the frame as progressive.
  52144. </p></dd>
  52145. </dl>
  52146. </dd>
  52147. <dt><samp class="option">range</samp></dt>
  52148. <dd><p>Available values are:
  52149. </p>
  52150. <dl class="table">
  52151. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  52152. <dd><p>Keep the same color range property (default).
  52153. </p>
  52154. </dd>
  52155. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  52156. <dd><p>Mark the frame as unspecified color range.
  52157. </p>
  52158. </dd>
  52159. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  52160. <dd><p>Mark the frame as limited range.
  52161. </p>
  52162. </dd>
  52163. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  52164. <dd><p>Mark the frame as full range.
  52165. </p></dd>
  52166. </dl>
  52167. </dd>
  52168. <dt><samp class="option">color_primaries</samp></dt>
  52169. <dd><p>Set the color primaries.
  52170. Available values are:
  52171. </p>
  52172. <dl class="table">
  52173. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  52174. <dd><p>Keep the same color primaries property (default).
  52175. </p>
  52176. </dd>
  52177. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  52178. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  52179. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  52180. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  52181. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  52182. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  52183. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  52184. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  52185. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  52186. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  52187. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  52188. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  52189. </dl>
  52190. </dd>
  52191. <dt><samp class="option">color_trc</samp></dt>
  52192. <dd><p>Set the color transfer.
  52193. Available values are:
  52194. </p>
  52195. <dl class="table">
  52196. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  52197. <dd><p>Keep the same color trc property (default).
  52198. </p>
  52199. </dd>
  52200. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  52201. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  52202. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  52203. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  52204. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  52205. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  52206. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  52207. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  52208. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  52209. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  52210. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  52211. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  52212. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  52213. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  52214. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  52215. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  52216. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  52217. </dl>
  52218. </dd>
  52219. <dt><samp class="option">colorspace</samp></dt>
  52220. <dd><p>Set the colorspace.
  52221. Available values are:
  52222. </p>
  52223. <dl class="table">
  52224. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  52225. <dd><p>Keep the same colorspace property (default).
  52226. </p>
  52227. </dd>
  52228. <dt>&lsquo;<samp class="samp">gbr</samp>&rsquo;</dt>
  52229. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  52230. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  52231. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  52232. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  52233. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  52234. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  52235. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  52236. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  52237. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  52238. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  52239. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  52240. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  52241. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  52242. </dl>
  52243. </dd>
  52244. </dl>
  52245. </div>
  52246. <div class="section-level-extent" id="sharpen_005fnpp">
  52247. <h3 class="section"><span>39.231 sharpen_npp<a class="copiable-link" href="#sharpen_005fnpp"> &para;</a></span></h3>
  52248. <p>Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with
  52249. border control.
  52250. </p>
  52251. <p>The following additional options are accepted:
  52252. </p><dl class="table">
  52253. <dt><samp class="option">border_type</samp></dt>
  52254. <dd><p>Type of sampling to be used ad frame borders. One of the following:
  52255. </p><dl class="table">
  52256. <dt><samp class="option">replicate</samp></dt>
  52257. <dd><p>Replicate pixel values.
  52258. </p>
  52259. </dd>
  52260. </dl>
  52261. </dd>
  52262. </dl>
  52263. </div>
  52264. <div class="section-level-extent" id="shear">
  52265. <h3 class="section"><span>39.232 shear<a class="copiable-link" href="#shear"> &para;</a></span></h3>
  52266. <p>Apply shear transform to input video.
  52267. </p>
  52268. <p>This filter supports the following options:
  52269. </p>
  52270. <dl class="table">
  52271. <dt><samp class="option">shx</samp></dt>
  52272. <dd><p>Shear factor in X-direction. Default value is 0.
  52273. Allowed range is from -2 to 2.
  52274. </p>
  52275. </dd>
  52276. <dt><samp class="option">shy</samp></dt>
  52277. <dd><p>Shear factor in Y-direction. Default value is 0.
  52278. Allowed range is from -2 to 2.
  52279. </p>
  52280. </dd>
  52281. <dt><samp class="option">fillcolor, c</samp></dt>
  52282. <dd><p>Set the color used to fill the output area not covered by the transformed
  52283. video. For the general syntax of this option, check the
  52284. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  52285. If the special value &quot;none&quot; is selected then no
  52286. background is printed (useful for example if the background is never shown).
  52287. </p>
  52288. <p>Default value is &quot;black&quot;.
  52289. </p>
  52290. </dd>
  52291. <dt><samp class="option">interp</samp></dt>
  52292. <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>.
  52293. </p></dd>
  52294. </dl>
  52295. <ul class="mini-toc">
  52296. <li><a href="#Commands-142" accesskey="1">Commands</a></li>
  52297. </ul>
  52298. <div class="subsection-level-extent" id="Commands-142">
  52299. <h4 class="subsection"><span>39.232.1 Commands<a class="copiable-link" href="#Commands-142"> &para;</a></span></h4>
  52300. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  52301. </p>
  52302. </div>
  52303. </div>
  52304. <div class="section-level-extent" id="showinfo-1">
  52305. <h3 class="section"><span>39.233 showinfo<a class="copiable-link" href="#showinfo-1"> &para;</a></span></h3>
  52306. <p>Show a line containing various information for each input video frame.
  52307. The input video is not modified.
  52308. </p>
  52309. <p>This filter supports the following options:
  52310. </p>
  52311. <dl class="table">
  52312. <dt><samp class="option">checksum</samp></dt>
  52313. <dd><p>Calculate checksums of each plane. By default enabled.
  52314. </p>
  52315. </dd>
  52316. <dt><samp class="option">udu_sei_as_ascii</samp></dt>
  52317. <dd><p>Try to print user data unregistered SEI as ascii character when possible,
  52318. in hex format otherwise.
  52319. </p></dd>
  52320. </dl>
  52321. <p>The shown line contains a sequence of key/value pairs of the form
  52322. <var class="var">key</var>:<var class="var">value</var>.
  52323. </p>
  52324. <p>The following values are shown in the output:
  52325. </p>
  52326. <dl class="table">
  52327. <dt><samp class="option">n</samp></dt>
  52328. <dd><p>The (sequential) number of the input frame, starting from 0.
  52329. </p>
  52330. </dd>
  52331. <dt><samp class="option">pts</samp></dt>
  52332. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  52333. time base units. The time base unit depends on the filter input pad.
  52334. </p>
  52335. </dd>
  52336. <dt><samp class="option">pts_time</samp></dt>
  52337. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  52338. seconds.
  52339. </p>
  52340. </dd>
  52341. <dt><samp class="option">fmt</samp></dt>
  52342. <dd><p>The pixel format name.
  52343. </p>
  52344. </dd>
  52345. <dt><samp class="option">sar</samp></dt>
  52346. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  52347. <var class="var">num</var>/<var class="var">den</var>.
  52348. </p>
  52349. </dd>
  52350. <dt><samp class="option">s</samp></dt>
  52351. <dd><p>The size of the input frame. For the syntax of this option, check the
  52352. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  52353. </p>
  52354. </dd>
  52355. <dt><samp class="option">i</samp></dt>
  52356. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  52357. for bottom field first).
  52358. </p>
  52359. </dd>
  52360. <dt><samp class="option">iskey</samp></dt>
  52361. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  52362. </p>
  52363. </dd>
  52364. <dt><samp class="option">type</samp></dt>
  52365. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  52366. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  52367. Also refer to the documentation of the <code class="code">AVPictureType</code> enum and of
  52368. the <code class="code">av_get_picture_type_char</code> function defined in
  52369. <samp class="file">libavutil/avutil.h</samp>.
  52370. </p>
  52371. </dd>
  52372. <dt><samp class="option">checksum</samp></dt>
  52373. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  52374. </p>
  52375. </dd>
  52376. <dt><samp class="option">plane_checksum</samp></dt>
  52377. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  52378. 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;.
  52379. </p>
  52380. </dd>
  52381. <dt><samp class="option">mean</samp></dt>
  52382. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  52383. &quot;[<var class="var">mean0</var> <var class="var">mean1</var> <var class="var">mean2</var> <var class="var">mean3</var>]&quot;.
  52384. </p>
  52385. </dd>
  52386. <dt><samp class="option">stdev</samp></dt>
  52387. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  52388. 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;.
  52389. </p>
  52390. </dd>
  52391. </dl>
  52392. </div>
  52393. <div class="section-level-extent" id="showpalette">
  52394. <h3 class="section"><span>39.234 showpalette<a class="copiable-link" href="#showpalette"> &para;</a></span></h3>
  52395. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  52396. <var class="var">pal8</var> pixel format frames.
  52397. </p>
  52398. <p>It accepts the following option:
  52399. </p>
  52400. <dl class="table">
  52401. <dt><samp class="option">s</samp></dt>
  52402. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  52403. <code class="code">30</code> (for a <code class="code">30x30</code> pixel box).
  52404. </p></dd>
  52405. </dl>
  52406. </div>
  52407. <div class="section-level-extent" id="shuffleframes">
  52408. <h3 class="section"><span>39.235 shuffleframes<a class="copiable-link" href="#shuffleframes"> &para;</a></span></h3>
  52409. <p>Reorder and/or duplicate and/or drop video frames.
  52410. </p>
  52411. <p>It accepts the following parameters:
  52412. </p>
  52413. <dl class="table">
  52414. <dt><samp class="option">mapping</samp></dt>
  52415. <dd><p>Set the destination indexes of input frames.
  52416. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  52417. frames. Number of indexes also sets maximal value that each index may have.
  52418. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  52419. </p></dd>
  52420. </dl>
  52421. <p>The first frame has the index 0. The default is to keep the input unchanged.
  52422. </p>
  52423. <ul class="mini-toc">
  52424. <li><a href="#Examples-163" accesskey="1">Examples</a></li>
  52425. </ul>
  52426. <div class="subsection-level-extent" id="Examples-163">
  52427. <h4 class="subsection"><span>39.235.1 Examples<a class="copiable-link" href="#Examples-163"> &para;</a></span></h4>
  52428. <ul class="itemize mark-bullet">
  52429. <li>Swap second and third frame of every three frames of the input:
  52430. <div class="example">
  52431. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  52432. </pre></div>
  52433. </li><li>Swap 10th and 1st frame of every ten frames of the input:
  52434. <div class="example">
  52435. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  52436. </pre></div>
  52437. </li></ul>
  52438. </div>
  52439. </div>
  52440. <div class="section-level-extent" id="shufflepixels">
  52441. <h3 class="section"><span>39.236 shufflepixels<a class="copiable-link" href="#shufflepixels"> &para;</a></span></h3>
  52442. <p>Reorder pixels in video frames.
  52443. </p>
  52444. <p>This filter accepts the following options:
  52445. </p>
  52446. <dl class="table">
  52447. <dt><samp class="option">direction, d</samp></dt>
  52448. <dd><p>Set shuffle direction. Can be forward or inverse direction.
  52449. Default direction is forward.
  52450. </p>
  52451. </dd>
  52452. <dt><samp class="option">mode, m</samp></dt>
  52453. <dd><p>Set shuffle mode. Can be horizontal, vertical or block mode.
  52454. </p>
  52455. </dd>
  52456. <dt><samp class="option">width, w</samp></dt>
  52457. <dt><samp class="option">height, h</samp></dt>
  52458. <dd><p>Set shuffle block_size. In case of horizontal shuffle mode only width
  52459. part of size is used, and in case of vertical shuffle mode only height
  52460. part of size is used.
  52461. </p>
  52462. </dd>
  52463. <dt><samp class="option">seed, s</samp></dt>
  52464. <dd><p>Set random seed used with shuffling pixels. Mainly useful to set to be able
  52465. to reverse filtering process to get original input.
  52466. For example, to reverse forward shuffle you need to use same parameters
  52467. and exact same seed and to set direction to inverse.
  52468. </p></dd>
  52469. </dl>
  52470. </div>
  52471. <div class="section-level-extent" id="shuffleplanes">
  52472. <h3 class="section"><span>39.237 shuffleplanes<a class="copiable-link" href="#shuffleplanes"> &para;</a></span></h3>
  52473. <p>Reorder and/or duplicate video planes.
  52474. </p>
  52475. <p>It accepts the following parameters:
  52476. </p>
  52477. <dl class="table">
  52478. <dt><samp class="option">map0</samp></dt>
  52479. <dd><p>The index of the input plane to be used as the first output plane.
  52480. </p>
  52481. </dd>
  52482. <dt><samp class="option">map1</samp></dt>
  52483. <dd><p>The index of the input plane to be used as the second output plane.
  52484. </p>
  52485. </dd>
  52486. <dt><samp class="option">map2</samp></dt>
  52487. <dd><p>The index of the input plane to be used as the third output plane.
  52488. </p>
  52489. </dd>
  52490. <dt><samp class="option">map3</samp></dt>
  52491. <dd><p>The index of the input plane to be used as the fourth output plane.
  52492. </p>
  52493. </dd>
  52494. </dl>
  52495. <p>The first plane has the index 0. The default is to keep the input unchanged.
  52496. </p>
  52497. <ul class="mini-toc">
  52498. <li><a href="#Examples-164" accesskey="1">Examples</a></li>
  52499. </ul>
  52500. <div class="subsection-level-extent" id="Examples-164">
  52501. <h4 class="subsection"><span>39.237.1 Examples<a class="copiable-link" href="#Examples-164"> &para;</a></span></h4>
  52502. <ul class="itemize mark-bullet">
  52503. <li>Swap the second and third planes of the input:
  52504. <div class="example">
  52505. <pre class="example-preformatted">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  52506. </pre></div>
  52507. </li></ul>
  52508. <a class="anchor" id="signalstats"></a></div>
  52509. </div>
  52510. <div class="section-level-extent" id="signalstats-1">
  52511. <h3 class="section"><span>39.238 signalstats<a class="copiable-link" href="#signalstats-1"> &para;</a></span></h3>
  52512. <p>Evaluate various visual metrics that assist in determining issues associated
  52513. with the digitization of analog video media.
  52514. </p>
  52515. <p>By default the filter will log these metadata values:
  52516. </p>
  52517. <dl class="table">
  52518. <dt><samp class="option">YMIN</samp></dt>
  52519. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  52520. range of [0-255].
  52521. </p>
  52522. </dd>
  52523. <dt><samp class="option">YLOW</samp></dt>
  52524. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  52525. range of [0-255].
  52526. </p>
  52527. </dd>
  52528. <dt><samp class="option">YAVG</samp></dt>
  52529. <dd><p>Display the average Y value within the input frame. Expressed in range of
  52530. [0-255].
  52531. </p>
  52532. </dd>
  52533. <dt><samp class="option">YHIGH</samp></dt>
  52534. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  52535. range of [0-255].
  52536. </p>
  52537. </dd>
  52538. <dt><samp class="option">YMAX</samp></dt>
  52539. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  52540. range of [0-255].
  52541. </p>
  52542. </dd>
  52543. <dt><samp class="option">UMIN</samp></dt>
  52544. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  52545. range of [0-255].
  52546. </p>
  52547. </dd>
  52548. <dt><samp class="option">ULOW</samp></dt>
  52549. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  52550. range of [0-255].
  52551. </p>
  52552. </dd>
  52553. <dt><samp class="option">UAVG</samp></dt>
  52554. <dd><p>Display the average U value within the input frame. Expressed in range of
  52555. [0-255].
  52556. </p>
  52557. </dd>
  52558. <dt><samp class="option">UHIGH</samp></dt>
  52559. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  52560. range of [0-255].
  52561. </p>
  52562. </dd>
  52563. <dt><samp class="option">UMAX</samp></dt>
  52564. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  52565. range of [0-255].
  52566. </p>
  52567. </dd>
  52568. <dt><samp class="option">VMIN</samp></dt>
  52569. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  52570. range of [0-255].
  52571. </p>
  52572. </dd>
  52573. <dt><samp class="option">VLOW</samp></dt>
  52574. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  52575. range of [0-255].
  52576. </p>
  52577. </dd>
  52578. <dt><samp class="option">VAVG</samp></dt>
  52579. <dd><p>Display the average V value within the input frame. Expressed in range of
  52580. [0-255].
  52581. </p>
  52582. </dd>
  52583. <dt><samp class="option">VHIGH</samp></dt>
  52584. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  52585. range of [0-255].
  52586. </p>
  52587. </dd>
  52588. <dt><samp class="option">VMAX</samp></dt>
  52589. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  52590. range of [0-255].
  52591. </p>
  52592. </dd>
  52593. <dt><samp class="option">SATMIN</samp></dt>
  52594. <dd><p>Display the minimal saturation value contained within the input frame.
  52595. Expressed in range of [0-~181.02].
  52596. </p>
  52597. </dd>
  52598. <dt><samp class="option">SATLOW</samp></dt>
  52599. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  52600. Expressed in range of [0-~181.02].
  52601. </p>
  52602. </dd>
  52603. <dt><samp class="option">SATAVG</samp></dt>
  52604. <dd><p>Display the average saturation value within the input frame. Expressed in range
  52605. of [0-~181.02].
  52606. </p>
  52607. </dd>
  52608. <dt><samp class="option">SATHIGH</samp></dt>
  52609. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  52610. Expressed in range of [0-~181.02].
  52611. </p>
  52612. </dd>
  52613. <dt><samp class="option">SATMAX</samp></dt>
  52614. <dd><p>Display the maximum saturation value contained within the input frame.
  52615. Expressed in range of [0-~181.02].
  52616. </p>
  52617. </dd>
  52618. <dt><samp class="option">HUEMED</samp></dt>
  52619. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  52620. [0-360].
  52621. </p>
  52622. </dd>
  52623. <dt><samp class="option">HUEAVG</samp></dt>
  52624. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  52625. [0-360].
  52626. </p>
  52627. </dd>
  52628. <dt><samp class="option">YDIF</samp></dt>
  52629. <dd><p>Display the average of sample value difference between all values of the Y
  52630. plane in the current frame and corresponding values of the previous input frame.
  52631. Expressed in range of [0-255].
  52632. </p>
  52633. </dd>
  52634. <dt><samp class="option">UDIF</samp></dt>
  52635. <dd><p>Display the average of sample value difference between all values of the U
  52636. plane in the current frame and corresponding values of the previous input frame.
  52637. Expressed in range of [0-255].
  52638. </p>
  52639. </dd>
  52640. <dt><samp class="option">VDIF</samp></dt>
  52641. <dd><p>Display the average of sample value difference between all values of the V
  52642. plane in the current frame and corresponding values of the previous input frame.
  52643. Expressed in range of [0-255].
  52644. </p>
  52645. </dd>
  52646. <dt><samp class="option">YBITDEPTH</samp></dt>
  52647. <dd><p>Display bit depth of Y plane in current frame.
  52648. Expressed in range of [0-16].
  52649. </p>
  52650. </dd>
  52651. <dt><samp class="option">UBITDEPTH</samp></dt>
  52652. <dd><p>Display bit depth of U plane in current frame.
  52653. Expressed in range of [0-16].
  52654. </p>
  52655. </dd>
  52656. <dt><samp class="option">VBITDEPTH</samp></dt>
  52657. <dd><p>Display bit depth of V plane in current frame.
  52658. Expressed in range of [0-16].
  52659. </p></dd>
  52660. </dl>
  52661. <p>The filter accepts the following options:
  52662. </p>
  52663. <dl class="table">
  52664. <dt><samp class="option">stat</samp></dt>
  52665. <dt><samp class="option">out</samp></dt>
  52666. <dd>
  52667. <p><samp class="option">stat</samp> specify an additional form of image analysis.
  52668. <samp class="option">out</samp> output video with the specified type of pixel highlighted.
  52669. </p>
  52670. <p>Both options accept the following values:
  52671. </p>
  52672. <dl class="table">
  52673. <dt>&lsquo;<samp class="samp">tout</samp>&rsquo;</dt>
  52674. <dd><p>Identify <var class="var">temporal outliers</var> pixels. A <var class="var">temporal outlier</var> is a pixel
  52675. unlike the neighboring pixels of the same field. Examples of temporal outliers
  52676. include the results of video dropouts, head clogs, or tape tracking issues.
  52677. </p>
  52678. </dd>
  52679. <dt>&lsquo;<samp class="samp">vrep</samp>&rsquo;</dt>
  52680. <dd><p>Identify <var class="var">vertical line repetition</var>. Vertical line repetition includes
  52681. similar rows of pixels within a frame. In born-digital video vertical line
  52682. repetition is common, but this pattern is uncommon in video digitized from an
  52683. analog source. When it occurs in video that results from the digitization of an
  52684. analog source it can indicate concealment from a dropout compensator.
  52685. </p>
  52686. </dd>
  52687. <dt>&lsquo;<samp class="samp">brng</samp>&rsquo;</dt>
  52688. <dd><p>Identify pixels that fall outside of legal broadcast range.
  52689. </p></dd>
  52690. </dl>
  52691. </dd>
  52692. <dt><samp class="option">color, c</samp></dt>
  52693. <dd><p>Set the highlight color for the <samp class="option">out</samp> option. The default color is
  52694. yellow.
  52695. </p></dd>
  52696. </dl>
  52697. <ul class="mini-toc">
  52698. <li><a href="#Examples-165" accesskey="1">Examples</a></li>
  52699. </ul>
  52700. <div class="subsection-level-extent" id="Examples-165">
  52701. <h4 class="subsection"><span>39.238.1 Examples<a class="copiable-link" href="#Examples-165"> &para;</a></span></h4>
  52702. <ul class="itemize mark-bullet">
  52703. <li>Output data of various video metrics:
  52704. <div class="example">
  52705. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  52706. </pre></div>
  52707. </li><li>Output specific data about the minimum and maximum values of the Y plane per frame:
  52708. <div class="example">
  52709. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  52710. </pre></div>
  52711. </li><li>Playback video while highlighting pixels that are outside of broadcast range in red.
  52712. <div class="example">
  52713. <pre class="example-preformatted">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  52714. </pre></div>
  52715. </li><li>Playback video with signalstats metadata drawn over the frame.
  52716. <div class="example">
  52717. <pre class="example-preformatted">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  52718. </pre></div>
  52719. <p>The contents of signalstat_drawtext.txt used in the command are:
  52720. </p><div class="example">
  52721. <pre class="example-preformatted">time %{pts:hms}
  52722. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  52723. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  52724. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  52725. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  52726. </pre></div>
  52727. </li></ul>
  52728. <a class="anchor" id="signature"></a></div>
  52729. </div>
  52730. <div class="section-level-extent" id="signature-1">
  52731. <h3 class="section"><span>39.239 signature<a class="copiable-link" href="#signature-1"> &para;</a></span></h3>
  52732. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  52733. input. In this case the matching between the inputs can be calculated additionally.
  52734. The filter always passes through the first input. The signature of each stream can
  52735. be written into a file.
  52736. </p>
  52737. <p>It accepts the following options:
  52738. </p>
  52739. <dl class="table">
  52740. <dt><samp class="option">detectmode</samp></dt>
  52741. <dd><p>Enable or disable the matching process.
  52742. </p>
  52743. <p>Available values are:
  52744. </p>
  52745. <dl class="table">
  52746. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  52747. <dd><p>Disable the calculation of a matching (default).
  52748. </p></dd>
  52749. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  52750. <dd><p>Calculate the matching for the whole video and output whether the whole video
  52751. matches or only parts.
  52752. </p></dd>
  52753. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  52754. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  52755. some cases.
  52756. </p></dd>
  52757. </dl>
  52758. </dd>
  52759. <dt><samp class="option">nb_inputs</samp></dt>
  52760. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  52761. Default value is 1.
  52762. </p>
  52763. </dd>
  52764. <dt><samp class="option">filename</samp></dt>
  52765. <dd><p>Set the path to which the output is written. If there is more than one input,
  52766. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  52767. integer), that will be replaced with the input number. If no filename is
  52768. specified, no output will be written. This is the default.
  52769. </p>
  52770. </dd>
  52771. <dt><samp class="option">format</samp></dt>
  52772. <dd><p>Choose the output format.
  52773. </p>
  52774. <p>Available values are:
  52775. </p>
  52776. <dl class="table">
  52777. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  52778. <dd><p>Use the specified binary representation (default).
  52779. </p></dd>
  52780. <dt>&lsquo;<samp class="samp">xml</samp>&rsquo;</dt>
  52781. <dd><p>Use the specified xml representation.
  52782. </p></dd>
  52783. </dl>
  52784. </dd>
  52785. <dt><samp class="option">th_d</samp></dt>
  52786. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  52787. greater than zero. The default value is 9000.
  52788. </p>
  52789. </dd>
  52790. <dt><samp class="option">th_dc</samp></dt>
  52791. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  52792. greater than zero. The default value is 60000.
  52793. </p>
  52794. </dd>
  52795. <dt><samp class="option">th_xh</samp></dt>
  52796. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  52797. greater than zero. The default value is 116.
  52798. </p>
  52799. </dd>
  52800. <dt><samp class="option">th_di</samp></dt>
  52801. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  52802. sequence. The option value must be a non negative integer value.
  52803. The default value is 0.
  52804. </p>
  52805. </dd>
  52806. <dt><samp class="option">th_it</samp></dt>
  52807. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  52808. The option value must be a double value between 0 and 1. The default value is 0.5.
  52809. </p></dd>
  52810. </dl>
  52811. <ul class="mini-toc">
  52812. <li><a href="#Examples-166" accesskey="1">Examples</a></li>
  52813. </ul>
  52814. <div class="subsection-level-extent" id="Examples-166">
  52815. <h4 class="subsection"><span>39.239.1 Examples<a class="copiable-link" href="#Examples-166"> &para;</a></span></h4>
  52816. <ul class="itemize mark-bullet">
  52817. <li>To calculate the signature of an input video and store it in signature.bin:
  52818. <div class="example">
  52819. <pre class="example-preformatted">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  52820. </pre></div>
  52821. </li><li>To detect whether two videos match and store the signatures in XML format in
  52822. signature0.xml and signature1.xml:
  52823. <div class="example">
  52824. <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 -
  52825. </pre></div>
  52826. </li></ul>
  52827. <a class="anchor" id="siti"></a></div>
  52828. </div>
  52829. <div class="section-level-extent" id="siti-1">
  52830. <h3 class="section"><span>39.240 siti<a class="copiable-link" href="#siti-1"> &para;</a></span></h3>
  52831. <p>Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video,
  52832. as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods
  52833. 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>.
  52834. Note that this is a legacy implementation that corresponds to a superseded recommendation.
  52835. 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>
  52836. </p>
  52837. <p>It accepts the following option:
  52838. </p>
  52839. <dl class="table">
  52840. <dt><samp class="option">print_summary</samp></dt>
  52841. <dd><p>If set to 1, Summary statistics will be printed to the console. Default 0.
  52842. </p></dd>
  52843. </dl>
  52844. <ul class="mini-toc">
  52845. <li><a href="#Examples-167" accesskey="1">Examples</a></li>
  52846. </ul>
  52847. <div class="subsection-level-extent" id="Examples-167">
  52848. <h4 class="subsection"><span>39.240.1 Examples<a class="copiable-link" href="#Examples-167"> &para;</a></span></h4>
  52849. <ul class="itemize mark-bullet">
  52850. <li>To calculate SI/TI metrics and print summary:
  52851. <div class="example">
  52852. <pre class="example-preformatted">ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
  52853. </pre></div>
  52854. </li></ul>
  52855. <a class="anchor" id="smartblur"></a></div>
  52856. </div>
  52857. <div class="section-level-extent" id="smartblur-1">
  52858. <h3 class="section"><span>39.241 smartblur<a class="copiable-link" href="#smartblur-1"> &para;</a></span></h3>
  52859. <p>Blur the input video without impacting the outlines.
  52860. </p>
  52861. <p>It accepts the following options:
  52862. </p>
  52863. <dl class="table">
  52864. <dt><samp class="option">luma_radius, lr</samp></dt>
  52865. <dd><p>Set the luma radius. The option value must be a float number in
  52866. the range [0.1,5.0] that specifies the variance of the gaussian filter
  52867. used to blur the image (slower if larger). Default value is 1.0.
  52868. </p>
  52869. </dd>
  52870. <dt><samp class="option">luma_strength, ls</samp></dt>
  52871. <dd><p>Set the luma strength. The option value must be a float number
  52872. in the range [-1.0,1.0] that configures the blurring. A value included
  52873. in [0.0,1.0] will blur the image whereas a value included in
  52874. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  52875. </p>
  52876. </dd>
  52877. <dt><samp class="option">luma_threshold, lt</samp></dt>
  52878. <dd><p>Set the luma threshold used as a coefficient to determine
  52879. whether a pixel should be blurred or not. The option value must be an
  52880. integer in the range [-30,30]. A value of 0 will filter all the image,
  52881. a value included in [0,30] will filter flat areas and a value included
  52882. in [-30,0] will filter edges. Default value is 0.
  52883. </p>
  52884. </dd>
  52885. <dt><samp class="option">chroma_radius, cr</samp></dt>
  52886. <dd><p>Set the chroma radius. The option value must be a float number in
  52887. the range [0.1,5.0] that specifies the variance of the gaussian filter
  52888. used to blur the image (slower if larger). Default value is <samp class="option">luma_radius</samp>.
  52889. </p>
  52890. </dd>
  52891. <dt><samp class="option">chroma_strength, cs</samp></dt>
  52892. <dd><p>Set the chroma strength. The option value must be a float number
  52893. in the range [-1.0,1.0] that configures the blurring. A value included
  52894. in [0.0,1.0] will blur the image whereas a value included in
  52895. [-1.0,0.0] will sharpen the image. Default value is <samp class="option">luma_strength</samp>.
  52896. </p>
  52897. </dd>
  52898. <dt><samp class="option">chroma_threshold, ct</samp></dt>
  52899. <dd><p>Set the chroma threshold used as a coefficient to determine
  52900. whether a pixel should be blurred or not. The option value must be an
  52901. integer in the range [-30,30]. A value of 0 will filter all the image,
  52902. a value included in [0,30] will filter flat areas and a value included
  52903. in [-30,0] will filter edges. Default value is <samp class="option">luma_threshold</samp>.
  52904. </p></dd>
  52905. </dl>
  52906. <p>If a chroma option is not explicitly set, the corresponding luma value
  52907. is set.
  52908. </p>
  52909. </div>
  52910. <div class="section-level-extent" id="sobel">
  52911. <h3 class="section"><span>39.242 sobel<a class="copiable-link" href="#sobel"> &para;</a></span></h3>
  52912. <p>Apply sobel operator to input video stream.
  52913. </p>
  52914. <p>The filter accepts the following option:
  52915. </p>
  52916. <dl class="table">
  52917. <dt><samp class="option">planes</samp></dt>
  52918. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  52919. By default value 0xf, all planes will be processed.
  52920. </p>
  52921. </dd>
  52922. <dt><samp class="option">scale</samp></dt>
  52923. <dd><p>Set value which will be multiplied with filtered result.
  52924. </p>
  52925. </dd>
  52926. <dt><samp class="option">delta</samp></dt>
  52927. <dd><p>Set value which will be added to filtered result.
  52928. </p></dd>
  52929. </dl>
  52930. <ul class="mini-toc">
  52931. <li><a href="#Commands-143" accesskey="1">Commands</a></li>
  52932. </ul>
  52933. <div class="subsection-level-extent" id="Commands-143">
  52934. <h4 class="subsection"><span>39.242.1 Commands<a class="copiable-link" href="#Commands-143"> &para;</a></span></h4>
  52935. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  52936. </p>
  52937. <a class="anchor" id="spp"></a></div>
  52938. </div>
  52939. <div class="section-level-extent" id="spp-1">
  52940. <h3 class="section"><span>39.243 spp<a class="copiable-link" href="#spp-1"> &para;</a></span></h3>
  52941. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  52942. at several (or - in the case of <samp class="option">quality</samp> level <code class="code">6</code> - all) shifts
  52943. and average the results.
  52944. </p>
  52945. <p>The filter accepts the following options:
  52946. </p>
  52947. <dl class="table">
  52948. <dt><samp class="option">quality</samp></dt>
  52949. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  52950. an integer in the range 0-6. If set to <code class="code">0</code>, the filter will have no
  52951. effect. A value of <code class="code">6</code> means the higher quality. For each increment of
  52952. that value the speed drops by a factor of approximately 2. Default value is
  52953. <code class="code">3</code>.
  52954. </p>
  52955. </dd>
  52956. <dt><samp class="option">qp</samp></dt>
  52957. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  52958. from the video stream (if available).
  52959. </p>
  52960. </dd>
  52961. <dt><samp class="option">mode</samp></dt>
  52962. <dd><p>Set thresholding mode. Available modes are:
  52963. </p>
  52964. <dl class="table">
  52965. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  52966. <dd><p>Set hard thresholding (default).
  52967. </p></dd>
  52968. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  52969. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  52970. </p></dd>
  52971. </dl>
  52972. </dd>
  52973. <dt><samp class="option">use_bframe_qp</samp></dt>
  52974. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  52975. option may cause flicker since the B-Frames have often larger QP. Default is
  52976. <code class="code">0</code> (not enabled).
  52977. </p></dd>
  52978. </dl>
  52979. <ul class="mini-toc">
  52980. <li><a href="#Commands-144" accesskey="1">Commands</a></li>
  52981. </ul>
  52982. <div class="subsection-level-extent" id="Commands-144">
  52983. <h4 class="subsection"><span>39.243.1 Commands<a class="copiable-link" href="#Commands-144"> &para;</a></span></h4>
  52984. <p>This filter supports the following commands:
  52985. </p><dl class="table">
  52986. <dt><samp class="option">quality, level</samp></dt>
  52987. <dd><p>Set quality level. The value <code class="code">max</code> can be used to set the maximum level,
  52988. currently <code class="code">6</code>.
  52989. </p></dd>
  52990. </dl>
  52991. <a class="anchor" id="sr"></a></div>
  52992. </div>
  52993. <div class="section-level-extent" id="sr-1">
  52994. <h3 class="section"><span>39.244 sr<a class="copiable-link" href="#sr-1"> &para;</a></span></h3>
  52995. <p>Scale the input by applying one of the super-resolution methods based on
  52996. convolutional neural networks. Supported models:
  52997. </p>
  52998. <ul class="itemize mark-bullet">
  52999. <li>Super-Resolution Convolutional Neural Network model (SRCNN).
  53000. See <a class="url" href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  53001. </li><li>Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  53002. See <a class="url" href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  53003. </li></ul>
  53004. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  53005. <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
  53006. is at <a class="url" href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  53007. </p>
  53008. <p>The filter accepts the following options:
  53009. </p>
  53010. <dl class="table">
  53011. <dt><samp class="option">dnn_backend</samp></dt>
  53012. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  53013. the following values:
  53014. </p>
  53015. <dl class="table">
  53016. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  53017. <dd><p>TensorFlow backend. To enable this backend you
  53018. need to install the TensorFlow for C library (see
  53019. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  53020. <code class="code">--enable-libtensorflow</code>
  53021. </p></dd>
  53022. </dl>
  53023. </dd>
  53024. <dt><samp class="option">model</samp></dt>
  53025. <dd><p>Set path to model file specifying network architecture and its parameters.
  53026. Note that different backends use different file formats. TensorFlow, OpenVINO backend
  53027. can load files for only its format.
  53028. </p>
  53029. </dd>
  53030. <dt><samp class="option">scale_factor</samp></dt>
  53031. <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>.
  53032. Default value is <code class="code">2</code>. Scale factor is necessary for SRCNN model, because it accepts
  53033. input upscaled using bicubic upscaling with proper scale factor.
  53034. </p></dd>
  53035. </dl>
  53036. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  53037. </p>
  53038. </div>
  53039. <div class="section-level-extent" id="ssim">
  53040. <h3 class="section"><span>39.245 ssim<a class="copiable-link" href="#ssim"> &para;</a></span></h3>
  53041. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  53042. </p>
  53043. <p>This filter takes in input two input videos, the first input is
  53044. considered the &quot;main&quot; source and is passed unchanged to the
  53045. output. The second input is used as a &quot;reference&quot; video for computing
  53046. the SSIM.
  53047. </p>
  53048. <p>Both video inputs must have the same resolution and pixel format for
  53049. this filter to work correctly. Also it assumes that both inputs
  53050. have the same number of frames, which are compared one by one.
  53051. </p>
  53052. <p>The filter stores the calculated SSIM of each frame.
  53053. </p>
  53054. <p>The description of the accepted parameters follows.
  53055. </p>
  53056. <dl class="table">
  53057. <dt><samp class="option">stats_file, f</samp></dt>
  53058. <dd><p>If specified the filter will use the named file to save the SSIM of
  53059. each individual frame. When filename equals &quot;-&quot; the data is sent to
  53060. standard output.
  53061. </p></dd>
  53062. </dl>
  53063. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  53064. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  53065. couple of frames.
  53066. </p>
  53067. <p>A description of each shown parameter follows:
  53068. </p>
  53069. <dl class="table">
  53070. <dt><samp class="option">n</samp></dt>
  53071. <dd><p>sequential number of the input frame, starting from 1
  53072. </p>
  53073. </dd>
  53074. <dt><samp class="option">Y, U, V, R, G, B</samp></dt>
  53075. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  53076. </p>
  53077. </dd>
  53078. <dt><samp class="option">All</samp></dt>
  53079. <dd><p>SSIM of the compared frames for the whole frame.
  53080. </p>
  53081. </dd>
  53082. <dt><samp class="option">dB</samp></dt>
  53083. <dd><p>Same as above but in dB representation.
  53084. </p></dd>
  53085. </dl>
  53086. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  53087. </p>
  53088. <ul class="mini-toc">
  53089. <li><a href="#Examples-168" accesskey="1">Examples</a></li>
  53090. </ul>
  53091. <div class="subsection-level-extent" id="Examples-168">
  53092. <h4 class="subsection"><span>39.245.1 Examples<a class="copiable-link" href="#Examples-168"> &para;</a></span></h4>
  53093. <ul class="itemize mark-bullet">
  53094. <li>For example:
  53095. <div class="example">
  53096. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  53097. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  53098. </pre></div>
  53099. <p>On this example the input file being processed is compared with the
  53100. reference file <samp class="file">ref_movie.mpg</samp>. The SSIM of each individual frame
  53101. is stored in <samp class="file">stats.log</samp>.
  53102. </p>
  53103. </li><li>Another example with both psnr and ssim at same time:
  53104. <div class="example">
  53105. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  53106. </pre></div>
  53107. </li><li>Another example with different containers:
  53108. <div class="example">
  53109. <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 -
  53110. </pre></div>
  53111. </li></ul>
  53112. </div>
  53113. </div>
  53114. <div class="section-level-extent" id="stereo3d">
  53115. <h3 class="section"><span>39.246 stereo3d<a class="copiable-link" href="#stereo3d"> &para;</a></span></h3>
  53116. <p>Convert between different stereoscopic image formats.
  53117. </p>
  53118. <p>The filters accept the following options:
  53119. </p>
  53120. <dl class="table">
  53121. <dt><samp class="option">in</samp></dt>
  53122. <dd><p>Set stereoscopic image format of input.
  53123. </p>
  53124. <p>Available values for input image formats are:
  53125. </p><dl class="table">
  53126. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  53127. <dd><p>side by side parallel (left eye left, right eye right)
  53128. </p>
  53129. </dd>
  53130. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  53131. <dd><p>side by side crosseye (right eye left, left eye right)
  53132. </p>
  53133. </dd>
  53134. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  53135. <dd><p>side by side parallel with half width resolution
  53136. (left eye left, right eye right)
  53137. </p>
  53138. </dd>
  53139. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  53140. <dd><p>side by side crosseye with half width resolution
  53141. (right eye left, left eye right)
  53142. </p>
  53143. </dd>
  53144. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  53145. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  53146. <dd><p>above-below (left eye above, right eye below)
  53147. </p>
  53148. </dd>
  53149. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  53150. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  53151. <dd><p>above-below (right eye above, left eye below)
  53152. </p>
  53153. </dd>
  53154. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  53155. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  53156. <dd><p>above-below with half height resolution
  53157. (left eye above, right eye below)
  53158. </p>
  53159. </dd>
  53160. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  53161. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  53162. <dd><p>above-below with half height resolution
  53163. (right eye above, left eye below)
  53164. </p>
  53165. </dd>
  53166. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  53167. <dd><p>alternating frames (left eye first, right eye second)
  53168. </p>
  53169. </dd>
  53170. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  53171. <dd><p>alternating frames (right eye first, left eye second)
  53172. </p>
  53173. </dd>
  53174. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  53175. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  53176. </p>
  53177. </dd>
  53178. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  53179. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  53180. </p>
  53181. </dd>
  53182. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  53183. <dd><p>interleaved columns, left eye first
  53184. </p>
  53185. </dd>
  53186. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  53187. <dd><p>interleaved columns, right eye first
  53188. </p>
  53189. <p>Default value is &lsquo;<samp class="samp">sbsl</samp>&rsquo;.
  53190. </p></dd>
  53191. </dl>
  53192. </dd>
  53193. <dt><samp class="option">out</samp></dt>
  53194. <dd><p>Set stereoscopic image format of output.
  53195. </p>
  53196. <dl class="table">
  53197. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  53198. <dd><p>side by side parallel (left eye left, right eye right)
  53199. </p>
  53200. </dd>
  53201. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  53202. <dd><p>side by side crosseye (right eye left, left eye right)
  53203. </p>
  53204. </dd>
  53205. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  53206. <dd><p>side by side parallel with half width resolution
  53207. (left eye left, right eye right)
  53208. </p>
  53209. </dd>
  53210. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  53211. <dd><p>side by side crosseye with half width resolution
  53212. (right eye left, left eye right)
  53213. </p>
  53214. </dd>
  53215. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  53216. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  53217. <dd><p>above-below (left eye above, right eye below)
  53218. </p>
  53219. </dd>
  53220. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  53221. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  53222. <dd><p>above-below (right eye above, left eye below)
  53223. </p>
  53224. </dd>
  53225. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  53226. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  53227. <dd><p>above-below with half height resolution
  53228. (left eye above, right eye below)
  53229. </p>
  53230. </dd>
  53231. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  53232. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  53233. <dd><p>above-below with half height resolution
  53234. (right eye above, left eye below)
  53235. </p>
  53236. </dd>
  53237. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  53238. <dd><p>alternating frames (left eye first, right eye second)
  53239. </p>
  53240. </dd>
  53241. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  53242. <dd><p>alternating frames (right eye first, left eye second)
  53243. </p>
  53244. </dd>
  53245. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  53246. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  53247. </p>
  53248. </dd>
  53249. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  53250. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  53251. </p>
  53252. </dd>
  53253. <dt>&lsquo;<samp class="samp">arbg</samp>&rsquo;</dt>
  53254. <dd><p>anaglyph red/blue gray
  53255. (red filter on left eye, blue filter on right eye)
  53256. </p>
  53257. </dd>
  53258. <dt>&lsquo;<samp class="samp">argg</samp>&rsquo;</dt>
  53259. <dd><p>anaglyph red/green gray
  53260. (red filter on left eye, green filter on right eye)
  53261. </p>
  53262. </dd>
  53263. <dt>&lsquo;<samp class="samp">arcg</samp>&rsquo;</dt>
  53264. <dd><p>anaglyph red/cyan gray
  53265. (red filter on left eye, cyan filter on right eye)
  53266. </p>
  53267. </dd>
  53268. <dt>&lsquo;<samp class="samp">arch</samp>&rsquo;</dt>
  53269. <dd><p>anaglyph red/cyan half colored
  53270. (red filter on left eye, cyan filter on right eye)
  53271. </p>
  53272. </dd>
  53273. <dt>&lsquo;<samp class="samp">arcc</samp>&rsquo;</dt>
  53274. <dd><p>anaglyph red/cyan color
  53275. (red filter on left eye, cyan filter on right eye)
  53276. </p>
  53277. </dd>
  53278. <dt>&lsquo;<samp class="samp">arcd</samp>&rsquo;</dt>
  53279. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  53280. (red filter on left eye, cyan filter on right eye)
  53281. </p>
  53282. </dd>
  53283. <dt>&lsquo;<samp class="samp">agmg</samp>&rsquo;</dt>
  53284. <dd><p>anaglyph green/magenta gray
  53285. (green filter on left eye, magenta filter on right eye)
  53286. </p>
  53287. </dd>
  53288. <dt>&lsquo;<samp class="samp">agmh</samp>&rsquo;</dt>
  53289. <dd><p>anaglyph green/magenta half colored
  53290. (green filter on left eye, magenta filter on right eye)
  53291. </p>
  53292. </dd>
  53293. <dt>&lsquo;<samp class="samp">agmc</samp>&rsquo;</dt>
  53294. <dd><p>anaglyph green/magenta colored
  53295. (green filter on left eye, magenta filter on right eye)
  53296. </p>
  53297. </dd>
  53298. <dt>&lsquo;<samp class="samp">agmd</samp>&rsquo;</dt>
  53299. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  53300. (green filter on left eye, magenta filter on right eye)
  53301. </p>
  53302. </dd>
  53303. <dt>&lsquo;<samp class="samp">aybg</samp>&rsquo;</dt>
  53304. <dd><p>anaglyph yellow/blue gray
  53305. (yellow filter on left eye, blue filter on right eye)
  53306. </p>
  53307. </dd>
  53308. <dt>&lsquo;<samp class="samp">aybh</samp>&rsquo;</dt>
  53309. <dd><p>anaglyph yellow/blue half colored
  53310. (yellow filter on left eye, blue filter on right eye)
  53311. </p>
  53312. </dd>
  53313. <dt>&lsquo;<samp class="samp">aybc</samp>&rsquo;</dt>
  53314. <dd><p>anaglyph yellow/blue colored
  53315. (yellow filter on left eye, blue filter on right eye)
  53316. </p>
  53317. </dd>
  53318. <dt>&lsquo;<samp class="samp">aybd</samp>&rsquo;</dt>
  53319. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  53320. (yellow filter on left eye, blue filter on right eye)
  53321. </p>
  53322. </dd>
  53323. <dt>&lsquo;<samp class="samp">ml</samp>&rsquo;</dt>
  53324. <dd><p>mono output (left eye only)
  53325. </p>
  53326. </dd>
  53327. <dt>&lsquo;<samp class="samp">mr</samp>&rsquo;</dt>
  53328. <dd><p>mono output (right eye only)
  53329. </p>
  53330. </dd>
  53331. <dt>&lsquo;<samp class="samp">chl</samp>&rsquo;</dt>
  53332. <dd><p>checkerboard, left eye first
  53333. </p>
  53334. </dd>
  53335. <dt>&lsquo;<samp class="samp">chr</samp>&rsquo;</dt>
  53336. <dd><p>checkerboard, right eye first
  53337. </p>
  53338. </dd>
  53339. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  53340. <dd><p>interleaved columns, left eye first
  53341. </p>
  53342. </dd>
  53343. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  53344. <dd><p>interleaved columns, right eye first
  53345. </p>
  53346. </dd>
  53347. <dt>&lsquo;<samp class="samp">hdmi</samp>&rsquo;</dt>
  53348. <dd><p>HDMI frame pack
  53349. </p></dd>
  53350. </dl>
  53351. <p>Default value is &lsquo;<samp class="samp">arcd</samp>&rsquo;.
  53352. </p></dd>
  53353. </dl>
  53354. <ul class="mini-toc">
  53355. <li><a href="#Examples-169" accesskey="1">Examples</a></li>
  53356. </ul>
  53357. <div class="subsection-level-extent" id="Examples-169">
  53358. <h4 class="subsection"><span>39.246.1 Examples<a class="copiable-link" href="#Examples-169"> &para;</a></span></h4>
  53359. <ul class="itemize mark-bullet">
  53360. <li>Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  53361. <div class="example">
  53362. <pre class="example-preformatted">stereo3d=sbsl:aybd
  53363. </pre></div>
  53364. </li><li>Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  53365. <div class="example">
  53366. <pre class="example-preformatted">stereo3d=abl:sbsr
  53367. </pre></div>
  53368. </li></ul>
  53369. </div>
  53370. </div>
  53371. <div class="section-level-extent" id="streamselect_002c-astreamselect">
  53372. <h3 class="section"><span>39.247 streamselect, astreamselect<a class="copiable-link" href="#streamselect_002c-astreamselect"> &para;</a></span></h3>
  53373. <p>Select video or audio streams.
  53374. </p>
  53375. <p>The filter accepts the following options:
  53376. </p>
  53377. <dl class="table">
  53378. <dt><samp class="option">inputs</samp></dt>
  53379. <dd><p>Set number of inputs. Default is 2.
  53380. </p>
  53381. </dd>
  53382. <dt><samp class="option">map</samp></dt>
  53383. <dd><p>Set input indexes to remap to outputs.
  53384. </p></dd>
  53385. </dl>
  53386. <ul class="mini-toc">
  53387. <li><a href="#Commands-145" accesskey="1">Commands</a></li>
  53388. <li><a href="#Examples-170" accesskey="2">Examples</a></li>
  53389. </ul>
  53390. <div class="subsection-level-extent" id="Commands-145">
  53391. <h4 class="subsection"><span>39.247.1 Commands<a class="copiable-link" href="#Commands-145"> &para;</a></span></h4>
  53392. <p>The <code class="code">streamselect</code> and <code class="code">astreamselect</code> filter supports the following
  53393. commands:
  53394. </p>
  53395. <dl class="table">
  53396. <dt><samp class="option">map</samp></dt>
  53397. <dd><p>Set input indexes to remap to outputs.
  53398. </p></dd>
  53399. </dl>
  53400. </div>
  53401. <div class="subsection-level-extent" id="Examples-170">
  53402. <h4 class="subsection"><span>39.247.2 Examples<a class="copiable-link" href="#Examples-170"> &para;</a></span></h4>
  53403. <ul class="itemize mark-bullet">
  53404. <li>Select first 5 seconds 1st stream and rest of time 2nd stream:
  53405. <div class="example">
  53406. <pre class="example-preformatted">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  53407. </pre></div>
  53408. </li><li>Same as above, but for audio:
  53409. <div class="example">
  53410. <pre class="example-preformatted">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  53411. </pre></div>
  53412. </li></ul>
  53413. <a class="anchor" id="subtitles"></a></div>
  53414. </div>
  53415. <div class="section-level-extent" id="subtitles-1">
  53416. <h3 class="section"><span>39.248 subtitles<a class="copiable-link" href="#subtitles-1"> &para;</a></span></h3>
  53417. <p>Draw subtitles on top of input video using the libass library.
  53418. </p>
  53419. <p>To enable compilation of this filter you need to configure FFmpeg with
  53420. <code class="code">--enable-libass</code>. This filter also requires a build with libavcodec and
  53421. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  53422. Alpha) subtitles format.
  53423. </p>
  53424. <p>The filter accepts the following options:
  53425. </p>
  53426. <dl class="table">
  53427. <dt><samp class="option">filename, f</samp></dt>
  53428. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  53429. </p>
  53430. </dd>
  53431. <dt><samp class="option">original_size</samp></dt>
  53432. <dd><p>Specify the size of the original video, the video for which the ASS file
  53433. was composed. For the syntax of this option, check the
  53434. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  53435. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  53436. correctly scale the fonts if the aspect ratio has been changed.
  53437. </p>
  53438. </dd>
  53439. <dt><samp class="option">fontsdir</samp></dt>
  53440. <dd><p>Set a directory path containing fonts that can be used by the filter.
  53441. These fonts will be used in addition to whatever the font provider uses.
  53442. </p>
  53443. </dd>
  53444. <dt><samp class="option">alpha</samp></dt>
  53445. <dd><p>Process alpha channel, by default alpha channel is untouched.
  53446. </p>
  53447. </dd>
  53448. <dt><samp class="option">charenc</samp></dt>
  53449. <dd><p>Set subtitles input character encoding. <code class="code">subtitles</code> filter only. Only
  53450. useful if not UTF-8.
  53451. </p>
  53452. </dd>
  53453. <dt><samp class="option">stream_index, si</samp></dt>
  53454. <dd><p>Set subtitles stream index. <code class="code">subtitles</code> filter only.
  53455. </p>
  53456. </dd>
  53457. <dt><samp class="option">force_style</samp></dt>
  53458. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  53459. string containing ASS style format <code class="code">KEY=VALUE</code> couples separated by &quot;,&quot;.
  53460. </p>
  53461. </dd>
  53462. <dt><samp class="option">wrap_unicode</samp></dt>
  53463. <dd><p>Break lines according to the Unicode Line Breaking Algorithm. Availability requires
  53464. at least libass release 0.17.0 (or LIBASS_VERSION 0x01600010), <em class="emph">and</em> libass must
  53465. have been built with libunibreak.
  53466. </p>
  53467. <p>The option is enabled by default except for native ASS.
  53468. </p></dd>
  53469. </dl>
  53470. <p>If the first key is not specified, it is assumed that the first value
  53471. specifies the <samp class="option">filename</samp>.
  53472. </p>
  53473. <p>For example, to render the file <samp class="file">sub.srt</samp> on top of the input
  53474. video, use the command:
  53475. </p><div class="example">
  53476. <pre class="example-preformatted">subtitles=sub.srt
  53477. </pre></div>
  53478. <p>which is equivalent to:
  53479. </p><div class="example">
  53480. <pre class="example-preformatted">subtitles=filename=sub.srt
  53481. </pre></div>
  53482. <p>To render the default subtitles stream from file <samp class="file">video.mkv</samp>, use:
  53483. </p><div class="example">
  53484. <pre class="example-preformatted">subtitles=video.mkv
  53485. </pre></div>
  53486. <p>To render the second subtitles stream from that file, use:
  53487. </p><div class="example">
  53488. <pre class="example-preformatted">subtitles=video.mkv:si=1
  53489. </pre></div>
  53490. <p>To make the subtitles stream from <samp class="file">sub.srt</samp> appear in 80% transparent blue
  53491. <code class="code">DejaVu Serif</code>, use:
  53492. </p><div class="example">
  53493. <pre class="example-preformatted">subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  53494. </pre></div>
  53495. </div>
  53496. <div class="section-level-extent" id="super2xsai">
  53497. <h3 class="section"><span>39.249 super2xsai<a class="copiable-link" href="#super2xsai"> &para;</a></span></h3>
  53498. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  53499. Interpolate) pixel art scaling algorithm.
  53500. </p>
  53501. <p>Useful for enlarging pixel art images without reducing sharpness.
  53502. </p>
  53503. </div>
  53504. <div class="section-level-extent" id="swaprect">
  53505. <h3 class="section"><span>39.250 swaprect<a class="copiable-link" href="#swaprect"> &para;</a></span></h3>
  53506. <p>Swap two rectangular objects in video.
  53507. </p>
  53508. <p>This filter accepts the following options:
  53509. </p>
  53510. <dl class="table">
  53511. <dt><samp class="option">w</samp></dt>
  53512. <dd><p>Set object width.
  53513. </p>
  53514. </dd>
  53515. <dt><samp class="option">h</samp></dt>
  53516. <dd><p>Set object height.
  53517. </p>
  53518. </dd>
  53519. <dt><samp class="option">x1</samp></dt>
  53520. <dd><p>Set 1st rect x coordinate.
  53521. </p>
  53522. </dd>
  53523. <dt><samp class="option">y1</samp></dt>
  53524. <dd><p>Set 1st rect y coordinate.
  53525. </p>
  53526. </dd>
  53527. <dt><samp class="option">x2</samp></dt>
  53528. <dd><p>Set 2nd rect x coordinate.
  53529. </p>
  53530. </dd>
  53531. <dt><samp class="option">y2</samp></dt>
  53532. <dd><p>Set 2nd rect y coordinate.
  53533. </p>
  53534. <p>All expressions are evaluated once for each frame.
  53535. </p></dd>
  53536. </dl>
  53537. <p>The all options are expressions containing the following constants:
  53538. </p>
  53539. <dl class="table">
  53540. <dt><samp class="option">w</samp></dt>
  53541. <dt><samp class="option">h</samp></dt>
  53542. <dd><p>The input width and height.
  53543. </p>
  53544. </dd>
  53545. <dt><samp class="option">a</samp></dt>
  53546. <dd><p>same as <var class="var">w</var> / <var class="var">h</var>
  53547. </p>
  53548. </dd>
  53549. <dt><samp class="option">sar</samp></dt>
  53550. <dd><p>input sample aspect ratio
  53551. </p>
  53552. </dd>
  53553. <dt><samp class="option">dar</samp></dt>
  53554. <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>
  53555. </p>
  53556. </dd>
  53557. <dt><samp class="option">n</samp></dt>
  53558. <dd><p>The number of the input frame, starting from 0.
  53559. </p>
  53560. </dd>
  53561. <dt><samp class="option">t</samp></dt>
  53562. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  53563. </p>
  53564. </dd>
  53565. <dt><samp class="option">pos</samp></dt>
  53566. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  53567. do not use
  53568. </p></dd>
  53569. </dl>
  53570. <ul class="mini-toc">
  53571. <li><a href="#Commands-146" accesskey="1">Commands</a></li>
  53572. </ul>
  53573. <div class="subsection-level-extent" id="Commands-146">
  53574. <h4 class="subsection"><span>39.250.1 Commands<a class="copiable-link" href="#Commands-146"> &para;</a></span></h4>
  53575. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  53576. </p>
  53577. </div>
  53578. </div>
  53579. <div class="section-level-extent" id="swapuv">
  53580. <h3 class="section"><span>39.251 swapuv<a class="copiable-link" href="#swapuv"> &para;</a></span></h3>
  53581. <p>Swap U &amp; V plane.
  53582. </p>
  53583. </div>
  53584. <div class="section-level-extent" id="tblend">
  53585. <h3 class="section"><span>39.252 tblend<a class="copiable-link" href="#tblend"> &para;</a></span></h3>
  53586. <p>Blend successive video frames.
  53587. </p>
  53588. <p>See <a class="ref" href="#blend">blend</a>
  53589. </p>
  53590. </div>
  53591. <div class="section-level-extent" id="telecine">
  53592. <h3 class="section"><span>39.253 telecine<a class="copiable-link" href="#telecine"> &para;</a></span></h3>
  53593. <p>Apply telecine process to the video.
  53594. </p>
  53595. <p>This filter accepts the following options:
  53596. </p>
  53597. <dl class="table">
  53598. <dt><samp class="option">first_field</samp></dt>
  53599. <dd><dl class="table">
  53600. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  53601. <dd><p>top field first
  53602. </p></dd>
  53603. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  53604. <dd><p>bottom field first
  53605. The default value is <code class="code">top</code>.
  53606. </p></dd>
  53607. </dl>
  53608. </dd>
  53609. <dt><samp class="option">pattern</samp></dt>
  53610. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  53611. The default value is <code class="code">23</code>.
  53612. </p></dd>
  53613. </dl>
  53614. <div class="example">
  53615. <pre class="example-preformatted">Some typical patterns:
  53616. NTSC output (30i):
  53617. 27.5p: 32222
  53618. 24p: 23 (classic)
  53619. 24p: 2332 (preferred)
  53620. 20p: 33
  53621. 18p: 334
  53622. 16p: 3444
  53623. PAL output (25i):
  53624. 27.5p: 12222
  53625. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  53626. 16.67p: 33
  53627. 16p: 33333334
  53628. </pre></div>
  53629. </div>
  53630. <div class="section-level-extent" id="thistogram">
  53631. <h3 class="section"><span>39.254 thistogram<a class="copiable-link" href="#thistogram"> &para;</a></span></h3>
  53632. <p>Compute and draw a color distribution histogram for the input video across time.
  53633. </p>
  53634. <p>Unlike <a class="ref" href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  53635. at certain time, this filter shows also past histograms of number of frames defined
  53636. by <code class="code">width</code> option.
  53637. </p>
  53638. <p>The computed histogram is a representation of the color component
  53639. distribution in an image.
  53640. </p>
  53641. <p>The filter accepts the following options:
  53642. </p>
  53643. <dl class="table">
  53644. <dt><samp class="option">width, w</samp></dt>
  53645. <dd><p>Set width of single color component output. Default value is <code class="code">0</code>.
  53646. Value of <code class="code">0</code> means width will be picked from input video.
  53647. This also set number of passed histograms to keep.
  53648. Allowed range is [0, 8192].
  53649. </p>
  53650. </dd>
  53651. <dt><samp class="option">display_mode, d</samp></dt>
  53652. <dd><p>Set display mode.
  53653. It accepts the following values:
  53654. </p><dl class="table">
  53655. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  53656. <dd><p>Per color component graphs are placed below each other.
  53657. </p>
  53658. </dd>
  53659. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  53660. <dd><p>Per color component graphs are placed side by side.
  53661. </p>
  53662. </dd>
  53663. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  53664. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  53665. that the graphs representing color components are superimposed directly
  53666. over one another.
  53667. </p></dd>
  53668. </dl>
  53669. <p>Default is <code class="code">stack</code>.
  53670. </p>
  53671. </dd>
  53672. <dt><samp class="option">levels_mode, m</samp></dt>
  53673. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  53674. Default is <code class="code">linear</code>.
  53675. </p>
  53676. </dd>
  53677. <dt><samp class="option">components, c</samp></dt>
  53678. <dd><p>Set what color components to display.
  53679. Default is <code class="code">7</code>.
  53680. </p>
  53681. </dd>
  53682. <dt><samp class="option">bgopacity, b</samp></dt>
  53683. <dd><p>Set background opacity. Default is <code class="code">0.9</code>.
  53684. </p>
  53685. </dd>
  53686. <dt><samp class="option">envelope, e</samp></dt>
  53687. <dd><p>Show envelope. Default is disabled.
  53688. </p>
  53689. </dd>
  53690. <dt><samp class="option">ecolor, ec</samp></dt>
  53691. <dd><p>Set envelope color. Default is <code class="code">gold</code>.
  53692. </p>
  53693. </dd>
  53694. <dt><samp class="option">slide</samp></dt>
  53695. <dd><p>Set slide mode.
  53696. </p>
  53697. <p>Available values for slide is:
  53698. </p><dl class="table">
  53699. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  53700. <dd><p>Draw new frame when right border is reached.
  53701. </p>
  53702. </dd>
  53703. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  53704. <dd><p>Replace old columns with new ones.
  53705. </p>
  53706. </dd>
  53707. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  53708. <dd><p>Scroll from right to left.
  53709. </p>
  53710. </dd>
  53711. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  53712. <dd><p>Scroll from left to right.
  53713. </p>
  53714. </dd>
  53715. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  53716. <dd><p>Draw single picture.
  53717. </p></dd>
  53718. </dl>
  53719. <p>Default is <code class="code">replace</code>.
  53720. </p></dd>
  53721. </dl>
  53722. </div>
  53723. <div class="section-level-extent" id="threshold">
  53724. <h3 class="section"><span>39.255 threshold<a class="copiable-link" href="#threshold"> &para;</a></span></h3>
  53725. <p>Apply threshold effect to video stream.
  53726. </p>
  53727. <p>This filter needs four video streams to perform thresholding.
  53728. First stream is stream we are filtering.
  53729. Second stream is holding threshold values, third stream is holding min values,
  53730. and last, fourth stream is holding max values.
  53731. </p>
  53732. <p>The filter accepts the following option:
  53733. </p>
  53734. <dl class="table">
  53735. <dt><samp class="option">planes</samp></dt>
  53736. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  53737. By default value 0xf, all planes will be processed.
  53738. </p></dd>
  53739. </dl>
  53740. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  53741. of pixel component from 2nd threshold stream, third stream value will picked,
  53742. otherwise fourth stream pixel component value will be picked.
  53743. </p>
  53744. <p>Using color source filter one can perform various types of thresholding:
  53745. </p>
  53746. <ul class="mini-toc">
  53747. <li><a href="#Commands-147" accesskey="1">Commands</a></li>
  53748. <li><a href="#Examples-171" accesskey="2">Examples</a></li>
  53749. </ul>
  53750. <div class="subsection-level-extent" id="Commands-147">
  53751. <h4 class="subsection"><span>39.255.1 Commands<a class="copiable-link" href="#Commands-147"> &para;</a></span></h4>
  53752. <p>This filter supports the all options as <a class="ref" href="#commands">commands</a>.
  53753. </p>
  53754. </div>
  53755. <div class="subsection-level-extent" id="Examples-171">
  53756. <h4 class="subsection"><span>39.255.2 Examples<a class="copiable-link" href="#Examples-171"> &para;</a></span></h4>
  53757. <ul class="itemize mark-bullet">
  53758. <li>Binary threshold, using gray color as threshold:
  53759. <div class="example">
  53760. <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
  53761. </pre></div>
  53762. </li><li>Inverted binary threshold, using gray color as threshold:
  53763. <div class="example">
  53764. <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
  53765. </pre></div>
  53766. </li><li>Truncate binary threshold, using gray color as threshold:
  53767. <div class="example">
  53768. <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
  53769. </pre></div>
  53770. </li><li>Threshold to zero, using gray color as threshold:
  53771. <div class="example">
  53772. <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
  53773. </pre></div>
  53774. </li><li>Inverted threshold to zero, using gray color as threshold:
  53775. <div class="example">
  53776. <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
  53777. </pre></div>
  53778. </li></ul>
  53779. </div>
  53780. </div>
  53781. <div class="section-level-extent" id="thumbnail">
  53782. <h3 class="section"><span>39.256 thumbnail<a class="copiable-link" href="#thumbnail"> &para;</a></span></h3>
  53783. <p>Select the most representative frame in a given sequence of consecutive frames.
  53784. </p>
  53785. <p>The filter accepts the following options:
  53786. </p>
  53787. <dl class="table">
  53788. <dt><samp class="option">n</samp></dt>
  53789. <dd><p>Set the frames batch size to analyze; in a set of <var class="var">n</var> frames, the filter
  53790. will pick one of them, and then handle the next batch of <var class="var">n</var> frames until
  53791. the end. Default is <code class="code">100</code>.
  53792. </p>
  53793. </dd>
  53794. <dt><samp class="option">log</samp></dt>
  53795. <dd><p>Set the log level to display picked frame stats.
  53796. Default is <code class="code">info</code>.
  53797. </p></dd>
  53798. </dl>
  53799. <p>Since the filter keeps track of the whole frames sequence, a bigger <var class="var">n</var>
  53800. value will result in a higher memory usage, so a high value is not recommended.
  53801. </p>
  53802. <ul class="mini-toc">
  53803. <li><a href="#Examples-172" accesskey="1">Examples</a></li>
  53804. </ul>
  53805. <div class="subsection-level-extent" id="Examples-172">
  53806. <h4 class="subsection"><span>39.256.1 Examples<a class="copiable-link" href="#Examples-172"> &para;</a></span></h4>
  53807. <ul class="itemize mark-bullet">
  53808. <li>Extract one picture each 50 frames:
  53809. <div class="example">
  53810. <pre class="example-preformatted">thumbnail=50
  53811. </pre></div>
  53812. </li><li>Complete example of a thumbnail creation with <code class="command">ffmpeg</code>:
  53813. <div class="example">
  53814. <pre class="example-preformatted">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  53815. </pre></div>
  53816. </li></ul>
  53817. <a class="anchor" id="tile"></a></div>
  53818. </div>
  53819. <div class="section-level-extent" id="tile-1">
  53820. <h3 class="section"><span>39.257 tile<a class="copiable-link" href="#tile-1"> &para;</a></span></h3>
  53821. <p>Tile several successive frames together.
  53822. </p>
  53823. <p>The <a class="ref" href="#untile">untile</a> filter can do the reverse.
  53824. </p>
  53825. <p>The filter accepts the following options:
  53826. </p>
  53827. <dl class="table">
  53828. <dt><samp class="option">layout</samp></dt>
  53829. <dd><p>Set the grid size in the form <code class="code">COLUMNSxROWS</code>. Range is up to UINT_MAX cells.
  53830. Default is <code class="code">6x5</code>.
  53831. </p>
  53832. </dd>
  53833. <dt><samp class="option">nb_frames</samp></dt>
  53834. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  53835. 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
  53836. the area will be used.
  53837. </p>
  53838. </dd>
  53839. <dt><samp class="option">margin</samp></dt>
  53840. <dd><p>Set the outer border margin in pixels. Range is 0 to 1024. Default is <code class="code">0</code>.
  53841. </p>
  53842. </dd>
  53843. <dt><samp class="option">padding</samp></dt>
  53844. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  53845. more advanced padding options (such as having different values for the edges),
  53846. refer to the pad video filter. Range is 0 to 1024. Default is <code class="code">0</code>.
  53847. </p>
  53848. </dd>
  53849. <dt><samp class="option">color</samp></dt>
  53850. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  53851. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  53852. The default value of <var class="var">color</var> is &quot;black&quot;.
  53853. </p>
  53854. </dd>
  53855. <dt><samp class="option">overlap</samp></dt>
  53856. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  53857. 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>.
  53858. </p>
  53859. </dd>
  53860. <dt><samp class="option">init_padding</samp></dt>
  53861. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  53862. This controls how soon will one get first output frame.
  53863. 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>.
  53864. </p></dd>
  53865. </dl>
  53866. <ul class="mini-toc">
  53867. <li><a href="#Examples-173" accesskey="1">Examples</a></li>
  53868. </ul>
  53869. <div class="subsection-level-extent" id="Examples-173">
  53870. <h4 class="subsection"><span>39.257.1 Examples<a class="copiable-link" href="#Examples-173"> &para;</a></span></h4>
  53871. <ul class="itemize mark-bullet">
  53872. <li>Produce 8x8 PNG tiles of all keyframes (<samp class="option">-skip_frame nokey</samp>) in a movie:
  53873. <div class="example">
  53874. <pre class="example-preformatted">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  53875. </pre></div>
  53876. <p>The <samp class="option">-vsync 0</samp> is necessary to prevent <code class="command">ffmpeg</code> from
  53877. duplicating each output frame to accommodate the originally detected frame
  53878. rate.
  53879. </p>
  53880. </li><li>Display <code class="code">5</code> pictures in an area of <code class="code">3x2</code> frames,
  53881. with <code class="code">7</code> pixels between them, and <code class="code">2</code> pixels of initial margin, using
  53882. mixed flat and named options:
  53883. <div class="example">
  53884. <pre class="example-preformatted">tile=3x2:nb_frames=5:padding=7:margin=2
  53885. </pre></div>
  53886. </li></ul>
  53887. </div>
  53888. </div>
  53889. <div class="section-level-extent" id="tiltandshift">
  53890. <h3 class="section"><span>39.258 tiltandshift<a class="copiable-link" href="#tiltandshift"> &para;</a></span></h3>
  53891. <p>What happens when you invert time and space?
  53892. </p>
  53893. <p>Normally a video is composed of several frames that represent a different
  53894. instant of time and shows a scence that evolves in the space captured by the
  53895. frame. This filter is the antipode of that concept, taking inspiration by
  53896. tilt and shift photography.
  53897. </p>
  53898. <p>A filtered frame contains the whole timeline of events composing the sequence,
  53899. and this is obtained by placing a slice of pixels from each frame into a single
  53900. one. However, since there are no infinite-width frames, this is done up the
  53901. width of the input frame, and a video is recomposed by shifting away one
  53902. column for each subsequent frame. In order to map space to time, the filter
  53903. tilts each input frame as well, so that motion is preseved. This is accomplished
  53904. by progressively selecting a different column from each input frame.
  53905. </p>
  53906. <p>The end result is a sort of inverted parralax, so that far away objects move
  53907. much faster that the ones in the front. The ideal conditions for this video
  53908. effect are when there is either very little motion and the backgroud is static,
  53909. or when there is a lot of motion and a very wide depth of field (eg. wide
  53910. panorama, while moving on a train).
  53911. </p>
  53912. <p>The filter accepts the following parameters:
  53913. </p>
  53914. <dl class="table">
  53915. <dt><samp class="option">tilt</samp></dt>
  53916. <dd><p>Tilt video while shifting (default). When unset, video will be sliding a
  53917. static image, composed of the first column of each frame.
  53918. </p>
  53919. </dd>
  53920. <dt><samp class="option">start</samp></dt>
  53921. <dd><p>What to do at the start of filtering (see below).
  53922. </p>
  53923. </dd>
  53924. <dt><samp class="option">end</samp></dt>
  53925. <dd><p>What to do at the end of filtering (see below).
  53926. </p>
  53927. </dd>
  53928. <dt><samp class="option">hold</samp></dt>
  53929. <dd><p>How many columns should pass through before start of filtering.
  53930. </p>
  53931. </dd>
  53932. <dt><samp class="option">pad</samp></dt>
  53933. <dd><p>How many columns should be inserted before end of filtering.
  53934. </p>
  53935. </dd>
  53936. </dl>
  53937. <p>Normally the filter shifts and tils from the very first frame, and stops when
  53938. the last one is received. However, before filtering starts, normal video may
  53939. be preseved, so that the effect is slowly shifted in its place. Similarly,
  53940. the last video frame may be reconstructed at the end. Alternatively it is
  53941. possible to just start and end with black.
  53942. </p>
  53943. <dl class="table">
  53944. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  53945. <dd><p>Filtering is starts immediately and ends when the last frame is received.
  53946. </p>
  53947. </dd>
  53948. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  53949. <dd><p>The first frames or the very last frame are kept intact during processing.
  53950. </p>
  53951. </dd>
  53952. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  53953. <dd><p>Black is padded at the beginning or at the end of filtering.
  53954. </p>
  53955. </dd>
  53956. </dl>
  53957. </div>
  53958. <div class="section-level-extent" id="tinterlace">
  53959. <h3 class="section"><span>39.259 tinterlace<a class="copiable-link" href="#tinterlace"> &para;</a></span></h3>
  53960. <p>Perform various types of temporal field interlacing.
  53961. </p>
  53962. <p>Frames are counted starting from 1, so the first input frame is
  53963. considered odd.
  53964. </p>
  53965. <p>The filter accepts the following options:
  53966. </p>
  53967. <dl class="table">
  53968. <dt><samp class="option">mode</samp></dt>
  53969. <dd><p>Specify the mode of the interlacing. This option can also be specified
  53970. as a value alone. See below for a list of values for this option.
  53971. </p>
  53972. <p>Available values are:
  53973. </p>
  53974. <dl class="table">
  53975. <dt>&lsquo;<samp class="samp">merge, 0</samp>&rsquo;</dt>
  53976. <dd><p>Move odd frames into the upper field, even into the lower field,
  53977. generating a double height frame at half frame rate.
  53978. </p><div class="example">
  53979. <pre class="example-preformatted"> ------&gt; time
  53980. Input:
  53981. Frame 1 Frame 2 Frame 3 Frame 4
  53982. 11111 22222 33333 44444
  53983. 11111 22222 33333 44444
  53984. 11111 22222 33333 44444
  53985. 11111 22222 33333 44444
  53986. Output:
  53987. 11111 33333
  53988. 22222 44444
  53989. 11111 33333
  53990. 22222 44444
  53991. 11111 33333
  53992. 22222 44444
  53993. 11111 33333
  53994. 22222 44444
  53995. </pre></div>
  53996. </dd>
  53997. <dt>&lsquo;<samp class="samp">drop_even, 1</samp>&rsquo;</dt>
  53998. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  53999. unchanged height at half frame rate.
  54000. </p>
  54001. <div class="example">
  54002. <pre class="example-preformatted"> ------&gt; time
  54003. Input:
  54004. Frame 1 Frame 2 Frame 3 Frame 4
  54005. 11111 22222 33333 44444
  54006. 11111 22222 33333 44444
  54007. 11111 22222 33333 44444
  54008. 11111 22222 33333 44444
  54009. Output:
  54010. 11111 33333
  54011. 11111 33333
  54012. 11111 33333
  54013. 11111 33333
  54014. </pre></div>
  54015. </dd>
  54016. <dt>&lsquo;<samp class="samp">drop_odd, 2</samp>&rsquo;</dt>
  54017. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  54018. unchanged height at half frame rate.
  54019. </p>
  54020. <div class="example">
  54021. <pre class="example-preformatted"> ------&gt; time
  54022. Input:
  54023. Frame 1 Frame 2 Frame 3 Frame 4
  54024. 11111 22222 33333 44444
  54025. 11111 22222 33333 44444
  54026. 11111 22222 33333 44444
  54027. 11111 22222 33333 44444
  54028. Output:
  54029. 22222 44444
  54030. 22222 44444
  54031. 22222 44444
  54032. 22222 44444
  54033. </pre></div>
  54034. </dd>
  54035. <dt>&lsquo;<samp class="samp">pad, 3</samp>&rsquo;</dt>
  54036. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  54037. generating a frame with double height at the same input frame rate.
  54038. </p>
  54039. <div class="example">
  54040. <pre class="example-preformatted"> ------&gt; time
  54041. Input:
  54042. Frame 1 Frame 2 Frame 3 Frame 4
  54043. 11111 22222 33333 44444
  54044. 11111 22222 33333 44444
  54045. 11111 22222 33333 44444
  54046. 11111 22222 33333 44444
  54047. Output:
  54048. 11111 ..... 33333 .....
  54049. ..... 22222 ..... 44444
  54050. 11111 ..... 33333 .....
  54051. ..... 22222 ..... 44444
  54052. 11111 ..... 33333 .....
  54053. ..... 22222 ..... 44444
  54054. 11111 ..... 33333 .....
  54055. ..... 22222 ..... 44444
  54056. </pre></div>
  54057. </dd>
  54058. <dt>&lsquo;<samp class="samp">interleave_top, 4</samp>&rsquo;</dt>
  54059. <dd><p>Interleave the upper field from odd frames with the lower field from
  54060. even frames, generating a frame with unchanged height at half frame rate.
  54061. </p>
  54062. <div class="example">
  54063. <pre class="example-preformatted"> ------&gt; time
  54064. Input:
  54065. Frame 1 Frame 2 Frame 3 Frame 4
  54066. 11111&lt;- 22222 33333&lt;- 44444
  54067. 11111 22222&lt;- 33333 44444&lt;-
  54068. 11111&lt;- 22222 33333&lt;- 44444
  54069. 11111 22222&lt;- 33333 44444&lt;-
  54070. Output:
  54071. 11111 33333
  54072. 22222 44444
  54073. 11111 33333
  54074. 22222 44444
  54075. </pre></div>
  54076. </dd>
  54077. <dt>&lsquo;<samp class="samp">interleave_bottom, 5</samp>&rsquo;</dt>
  54078. <dd><p>Interleave the lower field from odd frames with the upper field from
  54079. even frames, generating a frame with unchanged height at half frame rate.
  54080. </p>
  54081. <div class="example">
  54082. <pre class="example-preformatted"> ------&gt; time
  54083. Input:
  54084. Frame 1 Frame 2 Frame 3 Frame 4
  54085. 11111 22222&lt;- 33333 44444&lt;-
  54086. 11111&lt;- 22222 33333&lt;- 44444
  54087. 11111 22222&lt;- 33333 44444&lt;-
  54088. 11111&lt;- 22222 33333&lt;- 44444
  54089. Output:
  54090. 22222 44444
  54091. 11111 33333
  54092. 22222 44444
  54093. 11111 33333
  54094. </pre></div>
  54095. </dd>
  54096. <dt>&lsquo;<samp class="samp">interlacex2, 6</samp>&rsquo;</dt>
  54097. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  54098. containing the second temporal field from the previous input frame and
  54099. the first temporal field from the next input frame. This mode relies on
  54100. the top_field_first flag. Useful for interlaced video displays with no
  54101. field synchronisation.
  54102. </p>
  54103. <div class="example">
  54104. <pre class="example-preformatted"> ------&gt; time
  54105. Input:
  54106. Frame 1 Frame 2 Frame 3 Frame 4
  54107. 11111 22222 33333 44444
  54108. 11111 22222 33333 44444
  54109. 11111 22222 33333 44444
  54110. 11111 22222 33333 44444
  54111. Output:
  54112. 11111 22222 22222 33333 33333 44444 44444
  54113. 11111 11111 22222 22222 33333 33333 44444
  54114. 11111 22222 22222 33333 33333 44444 44444
  54115. 11111 11111 22222 22222 33333 33333 44444
  54116. </pre></div>
  54117. </dd>
  54118. <dt>&lsquo;<samp class="samp">mergex2, 7</samp>&rsquo;</dt>
  54119. <dd><p>Move odd frames into the upper field, even into the lower field,
  54120. generating a double height frame at same frame rate.
  54121. </p>
  54122. <div class="example">
  54123. <pre class="example-preformatted"> ------&gt; time
  54124. Input:
  54125. Frame 1 Frame 2 Frame 3 Frame 4
  54126. 11111 22222 33333 44444
  54127. 11111 22222 33333 44444
  54128. 11111 22222 33333 44444
  54129. 11111 22222 33333 44444
  54130. Output:
  54131. 11111 33333 33333 55555
  54132. 22222 22222 44444 44444
  54133. 11111 33333 33333 55555
  54134. 22222 22222 44444 44444
  54135. 11111 33333 33333 55555
  54136. 22222 22222 44444 44444
  54137. 11111 33333 33333 55555
  54138. 22222 22222 44444 44444
  54139. </pre></div>
  54140. </dd>
  54141. </dl>
  54142. <p>Numeric values are deprecated but are accepted for backward
  54143. compatibility reasons.
  54144. </p>
  54145. <p>Default mode is <code class="code">merge</code>.
  54146. </p>
  54147. </dd>
  54148. <dt><samp class="option">flags</samp></dt>
  54149. <dd><p>Specify flags influencing the filter process.
  54150. </p>
  54151. <p>Available value for <var class="var">flags</var> is:
  54152. </p>
  54153. <dl class="table">
  54154. <dt><samp class="option">low_pass_filter, vlpf</samp></dt>
  54155. <dd><p>Enable linear vertical low-pass filtering in the filter.
  54156. Vertical low-pass filtering is required when creating an interlaced
  54157. destination from a progressive source which contains high-frequency
  54158. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  54159. patterning.
  54160. </p>
  54161. </dd>
  54162. <dt><samp class="option">complex_filter, cvlpf</samp></dt>
  54163. <dd><p>Enable complex vertical low-pass filtering.
  54164. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  54165. patterning but better retain detail and subjective sharpness impression.
  54166. </p>
  54167. </dd>
  54168. <dt><samp class="option">bypass_il</samp></dt>
  54169. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  54170. </p></dd>
  54171. </dl>
  54172. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  54173. enabled for <samp class="option">mode</samp> <var class="var">interleave_top</var> and <var class="var">interleave_bottom</var>.
  54174. </p>
  54175. </dd>
  54176. </dl>
  54177. </div>
  54178. <div class="section-level-extent" id="tmedian">
  54179. <h3 class="section"><span>39.260 tmedian<a class="copiable-link" href="#tmedian"> &para;</a></span></h3>
  54180. <p>Pick median pixels from several successive input video frames.
  54181. </p>
  54182. <p>The filter accepts the following options:
  54183. </p>
  54184. <dl class="table">
  54185. <dt><samp class="option">radius</samp></dt>
  54186. <dd><p>Set radius of median filter.
  54187. Default is 1. Allowed range is from 1 to 127.
  54188. </p>
  54189. </dd>
  54190. <dt><samp class="option">planes</samp></dt>
  54191. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  54192. </p>
  54193. </dd>
  54194. <dt><samp class="option">percentile</samp></dt>
  54195. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  54196. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  54197. minimum values, and <code class="code">1</code> maximum values.
  54198. </p></dd>
  54199. </dl>
  54200. <ul class="mini-toc">
  54201. <li><a href="#Commands-148" accesskey="1">Commands</a></li>
  54202. </ul>
  54203. <div class="subsection-level-extent" id="Commands-148">
  54204. <h4 class="subsection"><span>39.260.1 Commands<a class="copiable-link" href="#Commands-148"> &para;</a></span></h4>
  54205. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">radius</code>.
  54206. </p>
  54207. </div>
  54208. </div>
  54209. <div class="section-level-extent" id="tmidequalizer">
  54210. <h3 class="section"><span>39.261 tmidequalizer<a class="copiable-link" href="#tmidequalizer"> &para;</a></span></h3>
  54211. <p>Apply Temporal Midway Video Equalization effect.
  54212. </p>
  54213. <p>Midway Video Equalization adjusts a sequence of video frames to have the same
  54214. histograms, while maintaining their dynamics as much as possible. It&rsquo;s
  54215. useful for e.g. matching exposures from a video frames sequence.
  54216. </p>
  54217. <p>This filter accepts the following option:
  54218. </p>
  54219. <dl class="table">
  54220. <dt><samp class="option">radius</samp></dt>
  54221. <dd><p>Set filtering radius. Default is <code class="code">5</code>. Allowed range is from 1 to 127.
  54222. </p>
  54223. </dd>
  54224. <dt><samp class="option">sigma</samp></dt>
  54225. <dd><p>Set filtering sigma. Default is <code class="code">0.5</code>. This controls strength of filtering.
  54226. Setting this option to 0 effectively does nothing.
  54227. </p>
  54228. </dd>
  54229. <dt><samp class="option">planes</samp></dt>
  54230. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  54231. </p></dd>
  54232. </dl>
  54233. </div>
  54234. <div class="section-level-extent" id="tmix">
  54235. <h3 class="section"><span>39.262 tmix<a class="copiable-link" href="#tmix"> &para;</a></span></h3>
  54236. <p>Mix successive video frames.
  54237. </p>
  54238. <p>A description of the accepted options follows.
  54239. </p>
  54240. <dl class="table">
  54241. <dt><samp class="option">frames</samp></dt>
  54242. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  54243. </p>
  54244. </dd>
  54245. <dt><samp class="option">weights</samp></dt>
  54246. <dd><p>Specify weight of each input video frame.
  54247. Each weight is separated by space. If number of weights is smaller than
  54248. number of <var class="var">frames</var> last specified weight will be used for all remaining
  54249. unset weights.
  54250. </p>
  54251. </dd>
  54252. <dt><samp class="option">scale</samp></dt>
  54253. <dd><p>Specify scale, if it is set it will be multiplied with sum
  54254. of each weight multiplied with pixel values to give final destination
  54255. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  54256. </p>
  54257. </dd>
  54258. <dt><samp class="option">planes</samp></dt>
  54259. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  54260. </p></dd>
  54261. </dl>
  54262. <ul class="mini-toc">
  54263. <li><a href="#Examples-174" accesskey="1">Examples</a></li>
  54264. <li><a href="#Commands-149" accesskey="2">Commands</a></li>
  54265. </ul>
  54266. <div class="subsection-level-extent" id="Examples-174">
  54267. <h4 class="subsection"><span>39.262.1 Examples<a class="copiable-link" href="#Examples-174"> &para;</a></span></h4>
  54268. <ul class="itemize mark-bullet">
  54269. <li>Average 7 successive frames:
  54270. <div class="example">
  54271. <pre class="example-preformatted">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  54272. </pre></div>
  54273. </li><li>Apply simple temporal convolution:
  54274. <div class="example">
  54275. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  54276. </pre></div>
  54277. </li><li>Similar as above but only showing temporal differences:
  54278. <div class="example">
  54279. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  54280. </pre></div>
  54281. </li></ul>
  54282. </div>
  54283. <div class="subsection-level-extent" id="Commands-149">
  54284. <h4 class="subsection"><span>39.262.2 Commands<a class="copiable-link" href="#Commands-149"> &para;</a></span></h4>
  54285. <p>This filter supports the following commands:
  54286. </p><dl class="table">
  54287. <dt><samp class="option">weights</samp></dt>
  54288. <dt><samp class="option">scale</samp></dt>
  54289. <dt><samp class="option">planes</samp></dt>
  54290. <dd><p>Syntax is same as option with same name.
  54291. </p></dd>
  54292. </dl>
  54293. <a class="anchor" id="tonemap"></a></div>
  54294. </div>
  54295. <div class="section-level-extent" id="tonemap-1">
  54296. <h3 class="section"><span>39.263 tonemap<a class="copiable-link" href="#tonemap-1"> &para;</a></span></h3>
  54297. <p>Tone map colors from different dynamic ranges.
  54298. </p>
  54299. <p>This filter expects data in single precision floating point, as it needs to
  54300. operate on (and can output) out-of-range values. Another filter, such as
  54301. <a class="ref" href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  54302. </p>
  54303. <p>The tonemapping algorithms implemented only work on linear light, so input
  54304. data should be linearized beforehand (and possibly correctly tagged).
  54305. </p>
  54306. <div class="example">
  54307. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  54308. </pre></div>
  54309. <ul class="mini-toc">
  54310. <li><a href="#Options-114" accesskey="1">Options</a></li>
  54311. </ul>
  54312. <div class="subsection-level-extent" id="Options-114">
  54313. <h4 class="subsection"><span>39.263.1 Options<a class="copiable-link" href="#Options-114"> &para;</a></span></h4>
  54314. <p>The filter accepts the following options.
  54315. </p>
  54316. <dl class="table">
  54317. <dt><samp class="option">tonemap</samp></dt>
  54318. <dd><p>Set the tone map algorithm to use.
  54319. </p>
  54320. <p>Possible values are:
  54321. </p><dl class="table">
  54322. <dt><var class="var">none</var></dt>
  54323. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  54324. </p>
  54325. </dd>
  54326. <dt><var class="var">clip</var></dt>
  54327. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  54328. in-range values, while distorting out-of-range values.
  54329. </p>
  54330. </dd>
  54331. <dt><var class="var">linear</var></dt>
  54332. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  54333. </p>
  54334. </dd>
  54335. <dt><var class="var">gamma</var></dt>
  54336. <dd><p>Fit a logarithmic transfer between the tone curves.
  54337. </p>
  54338. </dd>
  54339. <dt><var class="var">reinhard</var></dt>
  54340. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  54341. contrast, which results in flattening details and degrading color accuracy.
  54342. </p>
  54343. </dd>
  54344. <dt><var class="var">hable</var></dt>
  54345. <dd><p>Preserve both dark and bright details better than <var class="var">reinhard</var>, at the cost
  54346. of slightly darkening everything. Use it when detail preservation is more
  54347. important than color and brightness accuracy.
  54348. </p>
  54349. </dd>
  54350. <dt><var class="var">mobius</var></dt>
  54351. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  54352. in-range material as much as possible. Use it when color accuracy is more
  54353. important than detail preservation.
  54354. </p></dd>
  54355. </dl>
  54356. <p>Default is none.
  54357. </p>
  54358. </dd>
  54359. <dt><samp class="option">param</samp></dt>
  54360. <dd><p>Tune the tone mapping algorithm.
  54361. </p>
  54362. <p>This affects the following algorithms:
  54363. </p><dl class="table">
  54364. <dt><var class="var">none</var></dt>
  54365. <dd><p>Ignored.
  54366. </p>
  54367. </dd>
  54368. <dt><var class="var">linear</var></dt>
  54369. <dd><p>Specifies the scale factor to use while stretching.
  54370. Default to 1.0.
  54371. </p>
  54372. </dd>
  54373. <dt><var class="var">gamma</var></dt>
  54374. <dd><p>Specifies the exponent of the function.
  54375. Default to 1.8.
  54376. </p>
  54377. </dd>
  54378. <dt><var class="var">clip</var></dt>
  54379. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  54380. Default to 1.0.
  54381. </p>
  54382. </dd>
  54383. <dt><var class="var">reinhard</var></dt>
  54384. <dd><p>Specify the local contrast coefficient at the display peak.
  54385. Default to 0.5, which means that in-gamut values will be about half as bright
  54386. as when clipping.
  54387. </p>
  54388. </dd>
  54389. <dt><var class="var">hable</var></dt>
  54390. <dd><p>Ignored.
  54391. </p>
  54392. </dd>
  54393. <dt><var class="var">mobius</var></dt>
  54394. <dd><p>Specify the transition point from linear to mobius transform. Every value
  54395. below this point is guaranteed to be mapped 1:1. The higher the value, the
  54396. more accurate the result will be, at the cost of losing bright details.
  54397. Default to 0.3, which due to the steep initial slope still preserves in-range
  54398. colors fairly accurately.
  54399. </p></dd>
  54400. </dl>
  54401. </dd>
  54402. <dt><samp class="option">desat</samp></dt>
  54403. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  54404. higher the parameter, the more color information will be preserved. This
  54405. setting helps prevent unnaturally blown-out colors for super-highlights, by
  54406. (smoothly) turning into white instead. This makes images feel more natural,
  54407. at the cost of reducing information about out-of-range colors.
  54408. </p>
  54409. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  54410. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  54411. </p>
  54412. <p>This option works only if the input frame has a supported color tag.
  54413. </p>
  54414. </dd>
  54415. <dt><samp class="option">peak</samp></dt>
  54416. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  54417. embedded peak information in display metadata is not reliable or when tone
  54418. mapping from a lower range to a higher range.
  54419. </p></dd>
  54420. </dl>
  54421. </div>
  54422. </div>
  54423. <div class="section-level-extent" id="tpad">
  54424. <h3 class="section"><span>39.264 tpad<a class="copiable-link" href="#tpad"> &para;</a></span></h3>
  54425. <p>Temporarily pad video frames.
  54426. </p>
  54427. <p>The filter accepts the following options:
  54428. </p>
  54429. <dl class="table">
  54430. <dt><samp class="option">start</samp></dt>
  54431. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  54432. </p>
  54433. </dd>
  54434. <dt><samp class="option">stop</samp></dt>
  54435. <dd><p>Specify number of padding frames after input video stream.
  54436. Set to -1 to pad indefinitely. Default is 0.
  54437. </p>
  54438. </dd>
  54439. <dt><samp class="option">start_mode</samp></dt>
  54440. <dd><p>Set kind of frames added to beginning of stream.
  54441. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  54442. With <var class="var">add</var> frames of solid-color are added.
  54443. With <var class="var">clone</var> frames are clones of first frame.
  54444. Default is <var class="var">add</var>.
  54445. </p>
  54446. </dd>
  54447. <dt><samp class="option">stop_mode</samp></dt>
  54448. <dd><p>Set kind of frames added to end of stream.
  54449. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  54450. With <var class="var">add</var> frames of solid-color are added.
  54451. With <var class="var">clone</var> frames are clones of last frame.
  54452. Default is <var class="var">add</var>.
  54453. </p>
  54454. </dd>
  54455. <dt><samp class="option">start_duration, stop_duration</samp></dt>
  54456. <dd><p>Specify the duration of the start/stop delay. See
  54457. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  54458. for the accepted syntax.
  54459. These options override <var class="var">start</var> and <var class="var">stop</var>. Default is 0.
  54460. </p>
  54461. </dd>
  54462. <dt><samp class="option">color</samp></dt>
  54463. <dd><p>Specify the color of the padded area. For the syntax of this option,
  54464. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  54465. manual</a>.
  54466. </p>
  54467. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  54468. </p></dd>
  54469. </dl>
  54470. <a class="anchor" id="transpose"></a></div>
  54471. <div class="section-level-extent" id="transpose-1">
  54472. <h3 class="section"><span>39.265 transpose<a class="copiable-link" href="#transpose-1"> &para;</a></span></h3>
  54473. <p>Transpose rows with columns in the input video and optionally flip it.
  54474. </p>
  54475. <p>It accepts the following parameters:
  54476. </p>
  54477. <dl class="table">
  54478. <dt><samp class="option">dir</samp></dt>
  54479. <dd><p>Specify the transposition direction.
  54480. </p>
  54481. <p>Can assume the following values:
  54482. </p><dl class="table">
  54483. <dt>&lsquo;<samp class="samp">0, 4, cclock_flip</samp>&rsquo;</dt>
  54484. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  54485. </p><div class="example">
  54486. <pre class="example-preformatted">L.R L.l
  54487. . . -&gt; . .
  54488. l.r R.r
  54489. </pre></div>
  54490. </dd>
  54491. <dt>&lsquo;<samp class="samp">1, 5, clock</samp>&rsquo;</dt>
  54492. <dd><p>Rotate by 90 degrees clockwise, that is:
  54493. </p><div class="example">
  54494. <pre class="example-preformatted">L.R l.L
  54495. . . -&gt; . .
  54496. l.r r.R
  54497. </pre></div>
  54498. </dd>
  54499. <dt>&lsquo;<samp class="samp">2, 6, cclock</samp>&rsquo;</dt>
  54500. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  54501. </p><div class="example">
  54502. <pre class="example-preformatted">L.R R.r
  54503. . . -&gt; . .
  54504. l.r L.l
  54505. </pre></div>
  54506. </dd>
  54507. <dt>&lsquo;<samp class="samp">3, 7, clock_flip</samp>&rsquo;</dt>
  54508. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  54509. </p><div class="example">
  54510. <pre class="example-preformatted">L.R r.R
  54511. . . -&gt; . .
  54512. l.r l.L
  54513. </pre></div>
  54514. </dd>
  54515. </dl>
  54516. <p>For values between 4-7, the transposition is only done if the input
  54517. video geometry is portrait and not landscape. These values are
  54518. deprecated, the <code class="code">passthrough</code> option should be used instead.
  54519. </p>
  54520. <p>Numerical values are deprecated, and should be dropped in favor of
  54521. symbolic constants.
  54522. </p>
  54523. </dd>
  54524. <dt><samp class="option">passthrough</samp></dt>
  54525. <dd><p>Do not apply the transposition if the input geometry matches the one
  54526. specified by the specified value. It accepts the following values:
  54527. </p><dl class="table">
  54528. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  54529. <dd><p>Always apply transposition.
  54530. </p></dd>
  54531. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  54532. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  54533. </p></dd>
  54534. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  54535. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  54536. </p></dd>
  54537. </dl>
  54538. <p>Default value is <code class="code">none</code>.
  54539. </p></dd>
  54540. </dl>
  54541. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  54542. layout:
  54543. </p><div class="example">
  54544. <pre class="example-preformatted">transpose=dir=1:passthrough=portrait
  54545. </pre></div>
  54546. <p>The command above can also be specified as:
  54547. </p><div class="example">
  54548. <pre class="example-preformatted">transpose=1:portrait
  54549. </pre></div>
  54550. </div>
  54551. <div class="section-level-extent" id="transpose_005fnpp">
  54552. <h3 class="section"><span>39.266 transpose_npp<a class="copiable-link" href="#transpose_005fnpp"> &para;</a></span></h3>
  54553. <p>Transpose rows with columns in the input video and optionally flip it.
  54554. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  54555. </p>
  54556. <p>It accepts the following parameters:
  54557. </p>
  54558. <dl class="table">
  54559. <dt><samp class="option">dir</samp></dt>
  54560. <dd><p>Specify the transposition direction.
  54561. </p>
  54562. <p>Can assume the following values:
  54563. </p><dl class="table">
  54564. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  54565. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  54566. </p>
  54567. </dd>
  54568. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  54569. <dd><p>Rotate by 90 degrees clockwise.
  54570. </p>
  54571. </dd>
  54572. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  54573. <dd><p>Rotate by 90 degrees counterclockwise.
  54574. </p>
  54575. </dd>
  54576. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  54577. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  54578. </p></dd>
  54579. </dl>
  54580. </dd>
  54581. <dt><samp class="option">passthrough</samp></dt>
  54582. <dd><p>Do not apply the transposition if the input geometry matches the one
  54583. specified by the specified value. It accepts the following values:
  54584. </p><dl class="table">
  54585. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  54586. <dd><p>Always apply transposition. (default)
  54587. </p></dd>
  54588. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  54589. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  54590. </p></dd>
  54591. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  54592. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  54593. </p></dd>
  54594. </dl>
  54595. </dd>
  54596. </dl>
  54597. </div>
  54598. <div class="section-level-extent" id="trim">
  54599. <h3 class="section"><span>39.267 trim<a class="copiable-link" href="#trim"> &para;</a></span></h3>
  54600. <p>Trim the input so that the output contains one continuous subpart of the input.
  54601. </p>
  54602. <p>It accepts the following parameters:
  54603. </p><dl class="table">
  54604. <dt><samp class="option">start</samp></dt>
  54605. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  54606. timestamp <var class="var">start</var> will be the first frame in the output.
  54607. </p>
  54608. </dd>
  54609. <dt><samp class="option">end</samp></dt>
  54610. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  54611. immediately preceding the one with the timestamp <var class="var">end</var> will be the last
  54612. frame in the output.
  54613. </p>
  54614. </dd>
  54615. <dt><samp class="option">start_pts</samp></dt>
  54616. <dd><p>This is the same as <var class="var">start</var>, except this option sets the start timestamp
  54617. in timebase units instead of seconds.
  54618. </p>
  54619. </dd>
  54620. <dt><samp class="option">end_pts</samp></dt>
  54621. <dd><p>This is the same as <var class="var">end</var>, except this option sets the end timestamp
  54622. in timebase units instead of seconds.
  54623. </p>
  54624. </dd>
  54625. <dt><samp class="option">duration</samp></dt>
  54626. <dd><p>The maximum duration of the output in seconds.
  54627. </p>
  54628. </dd>
  54629. <dt><samp class="option">start_frame</samp></dt>
  54630. <dd><p>The number of the first frame that should be passed to the output.
  54631. </p>
  54632. </dd>
  54633. <dt><samp class="option">end_frame</samp></dt>
  54634. <dd><p>The number of the first frame that should be dropped.
  54635. </p></dd>
  54636. </dl>
  54637. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  54638. duration specifications; see
  54639. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  54640. for the accepted syntax.
  54641. </p>
  54642. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  54643. option look at the frame timestamp, while the _frame variants simply count the
  54644. frames that pass through the filter. Also note that this filter does not modify
  54645. the timestamps. If you wish for the output timestamps to start at zero, insert a
  54646. setpts filter after the trim filter.
  54647. </p>
  54648. <p>If multiple start or end options are set, this filter tries to be greedy and
  54649. keep all the frames that match at least one of the specified constraints. To keep
  54650. only the part that matches all the constraints at once, chain multiple trim
  54651. filters.
  54652. </p>
  54653. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  54654. just the end values to keep everything before the specified time.
  54655. </p>
  54656. <p>Examples:
  54657. </p><ul class="itemize mark-bullet">
  54658. <li>Drop everything except the second minute of input:
  54659. <div class="example">
  54660. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=60:120
  54661. </pre></div>
  54662. </li><li>Keep only the first second:
  54663. <div class="example">
  54664. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=duration=1
  54665. </pre></div>
  54666. </li></ul>
  54667. </div>
  54668. <div class="section-level-extent" id="unpremultiply">
  54669. <h3 class="section"><span>39.268 unpremultiply<a class="copiable-link" href="#unpremultiply"> &para;</a></span></h3>
  54670. <p>Apply alpha unpremultiply effect to input video stream using first plane
  54671. of second stream as alpha.
  54672. </p>
  54673. <p>Both streams must have same dimensions and same pixel format.
  54674. </p>
  54675. <p>The filter accepts the following option:
  54676. </p>
  54677. <dl class="table">
  54678. <dt><samp class="option">planes</samp></dt>
  54679. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  54680. By default value 0xf, all planes will be processed.
  54681. </p>
  54682. <p>If the format has 1 or 2 components, then luma is bit 0.
  54683. If the format has 3 or 4 components:
  54684. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  54685. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  54686. If present, the alpha channel is always the last bit.
  54687. </p>
  54688. </dd>
  54689. <dt><samp class="option">inplace</samp></dt>
  54690. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  54691. </p></dd>
  54692. </dl>
  54693. <a class="anchor" id="unsharp"></a></div>
  54694. <div class="section-level-extent" id="unsharp-1">
  54695. <h3 class="section"><span>39.269 unsharp<a class="copiable-link" href="#unsharp-1"> &para;</a></span></h3>
  54696. <p>Sharpen or blur the input video.
  54697. </p>
  54698. <p>It accepts the following parameters:
  54699. </p>
  54700. <dl class="table">
  54701. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  54702. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  54703. 3 and 23. The default value is 5.
  54704. </p>
  54705. </dd>
  54706. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  54707. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  54708. and 23. The default value is 5.
  54709. </p>
  54710. </dd>
  54711. <dt><samp class="option">luma_amount, la</samp></dt>
  54712. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  54713. values lay between -1.5 and 1.5.
  54714. </p>
  54715. <p>Negative values will blur the input video, while positive values will
  54716. sharpen it, a value of zero will disable the effect.
  54717. </p>
  54718. <p>Default value is 1.0.
  54719. </p>
  54720. </dd>
  54721. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  54722. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  54723. between 3 and 23. The default value is 5.
  54724. </p>
  54725. </dd>
  54726. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  54727. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  54728. between 3 and 23. The default value is 5.
  54729. </p>
  54730. </dd>
  54731. <dt><samp class="option">chroma_amount, ca</samp></dt>
  54732. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  54733. values lay between -1.5 and 1.5.
  54734. </p>
  54735. <p>Negative values will blur the input video, while positive values will
  54736. sharpen it, a value of zero will disable the effect.
  54737. </p>
  54738. <p>Default value is 0.0.
  54739. </p>
  54740. </dd>
  54741. <dt><samp class="option">alpha_msize_x, ax</samp></dt>
  54742. <dd><p>Set the alpha matrix horizontal size. It must be an odd integer
  54743. between 3 and 23. The default value is 5.
  54744. </p>
  54745. </dd>
  54746. <dt><samp class="option">alpha_msize_y, ay</samp></dt>
  54747. <dd><p>Set the alpha matrix vertical size. It must be an odd integer
  54748. between 3 and 23. The default value is 5.
  54749. </p>
  54750. </dd>
  54751. <dt><samp class="option">alpha_amount, aa</samp></dt>
  54752. <dd><p>Set the alpha effect strength. It must be a floating point number, reasonable
  54753. values lay between -1.5 and 1.5.
  54754. </p>
  54755. <p>Negative values will blur the input video, while positive values will
  54756. sharpen it, a value of zero will disable the effect.
  54757. </p>
  54758. <p>Default value is 0.0.
  54759. </p>
  54760. </dd>
  54761. </dl>
  54762. <p>All parameters are optional and default to the equivalent of the
  54763. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  54764. </p>
  54765. <ul class="mini-toc">
  54766. <li><a href="#Examples-175" accesskey="1">Examples</a></li>
  54767. </ul>
  54768. <div class="subsection-level-extent" id="Examples-175">
  54769. <h4 class="subsection"><span>39.269.1 Examples<a class="copiable-link" href="#Examples-175"> &para;</a></span></h4>
  54770. <ul class="itemize mark-bullet">
  54771. <li>Apply strong luma sharpen effect:
  54772. <div class="example">
  54773. <pre class="example-preformatted">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  54774. </pre></div>
  54775. </li><li>Apply a strong blur of both luma and chroma parameters:
  54776. <div class="example">
  54777. <pre class="example-preformatted">unsharp=7:7:-2:7:7:-2
  54778. </pre></div>
  54779. </li></ul>
  54780. <a class="anchor" id="untile"></a></div>
  54781. </div>
  54782. <div class="section-level-extent" id="untile-1">
  54783. <h3 class="section"><span>39.270 untile<a class="copiable-link" href="#untile-1"> &para;</a></span></h3>
  54784. <p>Decompose a video made of tiled images into the individual images.
  54785. </p>
  54786. <p>The frame rate of the output video is the frame rate of the input video
  54787. multiplied by the number of tiles.
  54788. </p>
  54789. <p>This filter does the reverse of <a class="ref" href="#tile">tile</a>.
  54790. </p>
  54791. <p>The filter accepts the following options:
  54792. </p>
  54793. <dl class="table">
  54794. <dt><samp class="option">layout</samp></dt>
  54795. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  54796. this option, check the
  54797. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  54798. </p></dd>
  54799. </dl>
  54800. <ul class="mini-toc">
  54801. <li><a href="#Examples-176" accesskey="1">Examples</a></li>
  54802. </ul>
  54803. <div class="subsection-level-extent" id="Examples-176">
  54804. <h4 class="subsection"><span>39.270.1 Examples<a class="copiable-link" href="#Examples-176"> &para;</a></span></h4>
  54805. <ul class="itemize mark-bullet">
  54806. <li>Produce a 1-second video from a still image file made of 25 frames stacked
  54807. vertically, like an analogic film reel:
  54808. <div class="example">
  54809. <pre class="example-preformatted">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  54810. </pre></div>
  54811. </li></ul>
  54812. </div>
  54813. </div>
  54814. <div class="section-level-extent" id="uspp">
  54815. <h3 class="section"><span>39.271 uspp<a class="copiable-link" href="#uspp"> &para;</a></span></h3>
  54816. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  54817. the image at several (or - in the case of <samp class="option">quality</samp> level <code class="code">8</code> - all)
  54818. shifts and average the results.
  54819. </p>
  54820. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  54821. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  54822. DCT similar to MJPEG.
  54823. </p>
  54824. <p>This filter is only available in ffmpeg version 4.4 or earlier.
  54825. </p>
  54826. <p>The filter accepts the following options:
  54827. </p>
  54828. <dl class="table">
  54829. <dt><samp class="option">quality</samp></dt>
  54830. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  54831. an integer in the range 0-8. If set to <code class="code">0</code>, the filter will have no
  54832. effect. A value of <code class="code">8</code> means the higher quality. For each increment of
  54833. that value the speed drops by a factor of approximately 2. Default value is
  54834. <code class="code">3</code>.
  54835. </p>
  54836. </dd>
  54837. <dt><samp class="option">qp</samp></dt>
  54838. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  54839. from the video stream (if available).
  54840. </p>
  54841. </dd>
  54842. <dt><samp class="option">codec</samp></dt>
  54843. <dd><p>Use specified codec instead of snow.
  54844. </p></dd>
  54845. </dl>
  54846. </div>
  54847. <div class="section-level-extent" id="v360">
  54848. <h3 class="section"><span>39.272 v360<a class="copiable-link" href="#v360"> &para;</a></span></h3>
  54849. <p>Convert 360 videos between various formats.
  54850. </p>
  54851. <p>The filter accepts the following options:
  54852. </p>
  54853. <dl class="table">
  54854. <dt><samp class="option">input</samp></dt>
  54855. <dt><samp class="option">output</samp></dt>
  54856. <dd><p>Set format of the input/output video.
  54857. </p>
  54858. <p>Available formats:
  54859. </p>
  54860. <dl class="table">
  54861. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  54862. <dt>&lsquo;<samp class="samp">equirect</samp>&rsquo;</dt>
  54863. <dd><p>Equirectangular projection.
  54864. </p>
  54865. </dd>
  54866. <dt>&lsquo;<samp class="samp">c3x2</samp>&rsquo;</dt>
  54867. <dt>&lsquo;<samp class="samp">c6x1</samp>&rsquo;</dt>
  54868. <dt>&lsquo;<samp class="samp">c1x6</samp>&rsquo;</dt>
  54869. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  54870. </p>
  54871. <p>Format specific options:
  54872. </p>
  54873. <dl class="table">
  54874. <dt><samp class="option">in_pad</samp></dt>
  54875. <dt><samp class="option">out_pad</samp></dt>
  54876. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  54877. </p>
  54878. <p>Example values:
  54879. </p><dl class="table">
  54880. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  54881. <dd><p>No padding.
  54882. </p></dd>
  54883. <dt>&lsquo;<samp class="samp">0.01</samp>&rsquo;</dt>
  54884. <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)
  54885. </p></dd>
  54886. </dl>
  54887. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>.
  54888. Maximum value is <b class="b">&lsquo;<samp class="samp">0.1</samp>&rsquo;</b>.
  54889. </p>
  54890. </dd>
  54891. <dt><samp class="option">fin_pad</samp></dt>
  54892. <dt><samp class="option">fout_pad</samp></dt>
  54893. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  54894. </p>
  54895. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  54896. </p>
  54897. </dd>
  54898. <dt><samp class="option">in_forder</samp></dt>
  54899. <dt><samp class="option">out_forder</samp></dt>
  54900. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  54901. </p>
  54902. <p>Designation of directions:
  54903. </p><dl class="table">
  54904. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  54905. <dd><p>right
  54906. </p></dd>
  54907. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  54908. <dd><p>left
  54909. </p></dd>
  54910. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  54911. <dd><p>up
  54912. </p></dd>
  54913. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  54914. <dd><p>down
  54915. </p></dd>
  54916. <dt>&lsquo;<samp class="samp">f</samp>&rsquo;</dt>
  54917. <dd><p>forward
  54918. </p></dd>
  54919. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  54920. <dd><p>back
  54921. </p></dd>
  54922. </dl>
  54923. <p>Default value is <b class="b">&lsquo;<samp class="samp">rludfb</samp>&rsquo;</b>.
  54924. </p>
  54925. </dd>
  54926. <dt><samp class="option">in_frot</samp></dt>
  54927. <dt><samp class="option">out_frot</samp></dt>
  54928. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  54929. </p>
  54930. <p>Designation of angles:
  54931. </p><dl class="table">
  54932. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  54933. <dd><p>0 degrees clockwise
  54934. </p></dd>
  54935. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  54936. <dd><p>90 degrees clockwise
  54937. </p></dd>
  54938. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  54939. <dd><p>180 degrees clockwise
  54940. </p></dd>
  54941. <dt>&lsquo;<samp class="samp">3</samp>&rsquo;</dt>
  54942. <dd><p>270 degrees clockwise
  54943. </p></dd>
  54944. </dl>
  54945. <p>Default value is <b class="b">&lsquo;<samp class="samp">000000</samp>&rsquo;</b>.
  54946. </p></dd>
  54947. </dl>
  54948. </dd>
  54949. <dt>&lsquo;<samp class="samp">eac</samp>&rsquo;</dt>
  54950. <dd><p>Equi-Angular Cubemap.
  54951. </p>
  54952. </dd>
  54953. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  54954. <dt>&lsquo;<samp class="samp">gnomonic</samp>&rsquo;</dt>
  54955. <dt>&lsquo;<samp class="samp">rectilinear</samp>&rsquo;</dt>
  54956. <dd><p>Regular video.
  54957. </p>
  54958. <p>Format specific options:
  54959. </p><dl class="table">
  54960. <dt><samp class="option">h_fov</samp></dt>
  54961. <dt><samp class="option">v_fov</samp></dt>
  54962. <dt><samp class="option">d_fov</samp></dt>
  54963. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  54964. </p>
  54965. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  54966. </p>
  54967. </dd>
  54968. <dt><samp class="option">ih_fov</samp></dt>
  54969. <dt><samp class="option">iv_fov</samp></dt>
  54970. <dt><samp class="option">id_fov</samp></dt>
  54971. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  54972. </p>
  54973. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  54974. </p></dd>
  54975. </dl>
  54976. </dd>
  54977. <dt>&lsquo;<samp class="samp">dfisheye</samp>&rsquo;</dt>
  54978. <dd><p>Dual fisheye.
  54979. </p>
  54980. <p>Format specific options:
  54981. </p><dl class="table">
  54982. <dt><samp class="option">h_fov</samp></dt>
  54983. <dt><samp class="option">v_fov</samp></dt>
  54984. <dt><samp class="option">d_fov</samp></dt>
  54985. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  54986. </p>
  54987. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  54988. </p>
  54989. </dd>
  54990. <dt><samp class="option">ih_fov</samp></dt>
  54991. <dt><samp class="option">iv_fov</samp></dt>
  54992. <dt><samp class="option">id_fov</samp></dt>
  54993. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  54994. </p>
  54995. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  54996. </p></dd>
  54997. </dl>
  54998. </dd>
  54999. <dt>&lsquo;<samp class="samp">barrel</samp>&rsquo;</dt>
  55000. <dt>&lsquo;<samp class="samp">fb</samp>&rsquo;</dt>
  55001. <dt>&lsquo;<samp class="samp">barrelsplit</samp>&rsquo;</dt>
  55002. <dd><p>Facebook&rsquo;s 360 formats.
  55003. </p>
  55004. </dd>
  55005. <dt>&lsquo;<samp class="samp">sg</samp>&rsquo;</dt>
  55006. <dd><p>Stereographic format.
  55007. </p>
  55008. <p>Format specific options:
  55009. </p><dl class="table">
  55010. <dt><samp class="option">h_fov</samp></dt>
  55011. <dt><samp class="option">v_fov</samp></dt>
  55012. <dt><samp class="option">d_fov</samp></dt>
  55013. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  55014. </p>
  55015. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55016. </p>
  55017. </dd>
  55018. <dt><samp class="option">ih_fov</samp></dt>
  55019. <dt><samp class="option">iv_fov</samp></dt>
  55020. <dt><samp class="option">id_fov</samp></dt>
  55021. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  55022. </p>
  55023. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55024. </p></dd>
  55025. </dl>
  55026. </dd>
  55027. <dt>&lsquo;<samp class="samp">mercator</samp>&rsquo;</dt>
  55028. <dd><p>Mercator format.
  55029. </p>
  55030. </dd>
  55031. <dt>&lsquo;<samp class="samp">ball</samp>&rsquo;</dt>
  55032. <dd><p>Ball format, gives significant distortion toward the back.
  55033. </p>
  55034. </dd>
  55035. <dt>&lsquo;<samp class="samp">hammer</samp>&rsquo;</dt>
  55036. <dd><p>Hammer-Aitoff map projection format.
  55037. </p>
  55038. </dd>
  55039. <dt>&lsquo;<samp class="samp">sinusoidal</samp>&rsquo;</dt>
  55040. <dd><p>Sinusoidal map projection format.
  55041. </p>
  55042. </dd>
  55043. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  55044. <dd><p>Fisheye projection.
  55045. </p>
  55046. <p>Format specific options:
  55047. </p><dl class="table">
  55048. <dt><samp class="option">h_fov</samp></dt>
  55049. <dt><samp class="option">v_fov</samp></dt>
  55050. <dt><samp class="option">d_fov</samp></dt>
  55051. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  55052. </p>
  55053. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55054. </p>
  55055. </dd>
  55056. <dt><samp class="option">ih_fov</samp></dt>
  55057. <dt><samp class="option">iv_fov</samp></dt>
  55058. <dt><samp class="option">id_fov</samp></dt>
  55059. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  55060. </p>
  55061. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55062. </p></dd>
  55063. </dl>
  55064. </dd>
  55065. <dt>&lsquo;<samp class="samp">pannini</samp>&rsquo;</dt>
  55066. <dd><p>Pannini projection.
  55067. </p>
  55068. <p>Format specific options:
  55069. </p><dl class="table">
  55070. <dt><samp class="option">h_fov</samp></dt>
  55071. <dd><p>Set output pannini parameter.
  55072. </p>
  55073. </dd>
  55074. <dt><samp class="option">ih_fov</samp></dt>
  55075. <dd><p>Set input pannini parameter.
  55076. </p></dd>
  55077. </dl>
  55078. </dd>
  55079. <dt>&lsquo;<samp class="samp">cylindrical</samp>&rsquo;</dt>
  55080. <dd><p>Cylindrical projection.
  55081. </p>
  55082. <p>Format specific options:
  55083. </p><dl class="table">
  55084. <dt><samp class="option">h_fov</samp></dt>
  55085. <dt><samp class="option">v_fov</samp></dt>
  55086. <dt><samp class="option">d_fov</samp></dt>
  55087. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  55088. </p>
  55089. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55090. </p>
  55091. </dd>
  55092. <dt><samp class="option">ih_fov</samp></dt>
  55093. <dt><samp class="option">iv_fov</samp></dt>
  55094. <dt><samp class="option">id_fov</samp></dt>
  55095. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  55096. </p>
  55097. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55098. </p></dd>
  55099. </dl>
  55100. </dd>
  55101. <dt>&lsquo;<samp class="samp">perspective</samp>&rsquo;</dt>
  55102. <dd><p>Perspective projection. <i class="i">(output only)</i>
  55103. </p>
  55104. <p>Format specific options:
  55105. </p><dl class="table">
  55106. <dt><samp class="option">v_fov</samp></dt>
  55107. <dd><p>Set perspective parameter.
  55108. </p></dd>
  55109. </dl>
  55110. </dd>
  55111. <dt>&lsquo;<samp class="samp">tetrahedron</samp>&rsquo;</dt>
  55112. <dd><p>Tetrahedron projection.
  55113. </p>
  55114. </dd>
  55115. <dt>&lsquo;<samp class="samp">tsp</samp>&rsquo;</dt>
  55116. <dd><p>Truncated square pyramid projection.
  55117. </p>
  55118. </dd>
  55119. <dt>&lsquo;<samp class="samp">he</samp>&rsquo;</dt>
  55120. <dt>&lsquo;<samp class="samp">hequirect</samp>&rsquo;</dt>
  55121. <dd><p>Half equirectangular projection.
  55122. </p>
  55123. </dd>
  55124. <dt>&lsquo;<samp class="samp">equisolid</samp>&rsquo;</dt>
  55125. <dd><p>Equisolid format.
  55126. </p>
  55127. <p>Format specific options:
  55128. </p><dl class="table">
  55129. <dt><samp class="option">h_fov</samp></dt>
  55130. <dt><samp class="option">v_fov</samp></dt>
  55131. <dt><samp class="option">d_fov</samp></dt>
  55132. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  55133. </p>
  55134. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55135. </p>
  55136. </dd>
  55137. <dt><samp class="option">ih_fov</samp></dt>
  55138. <dt><samp class="option">iv_fov</samp></dt>
  55139. <dt><samp class="option">id_fov</samp></dt>
  55140. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  55141. </p>
  55142. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55143. </p></dd>
  55144. </dl>
  55145. </dd>
  55146. <dt>&lsquo;<samp class="samp">og</samp>&rsquo;</dt>
  55147. <dd><p>Orthographic format.
  55148. </p>
  55149. <p>Format specific options:
  55150. </p><dl class="table">
  55151. <dt><samp class="option">h_fov</samp></dt>
  55152. <dt><samp class="option">v_fov</samp></dt>
  55153. <dt><samp class="option">d_fov</samp></dt>
  55154. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  55155. </p>
  55156. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55157. </p>
  55158. </dd>
  55159. <dt><samp class="option">ih_fov</samp></dt>
  55160. <dt><samp class="option">iv_fov</samp></dt>
  55161. <dt><samp class="option">id_fov</samp></dt>
  55162. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  55163. </p>
  55164. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  55165. </p></dd>
  55166. </dl>
  55167. </dd>
  55168. <dt>&lsquo;<samp class="samp">octahedron</samp>&rsquo;</dt>
  55169. <dd><p>Octahedron projection.
  55170. </p>
  55171. </dd>
  55172. <dt>&lsquo;<samp class="samp">cylindricalea</samp>&rsquo;</dt>
  55173. <dd><p>Cylindrical Equal Area projection.
  55174. </p></dd>
  55175. </dl>
  55176. </dd>
  55177. <dt><samp class="option">interp</samp></dt>
  55178. <dd><p>Set interpolation method.<br>
  55179. <i class="i">Note: more complex interpolation methods require much more memory to run.</i>
  55180. </p>
  55181. <p>Available methods:
  55182. </p>
  55183. <dl class="table">
  55184. <dt>&lsquo;<samp class="samp">near</samp>&rsquo;</dt>
  55185. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  55186. <dd><p>Nearest neighbour.
  55187. </p></dd>
  55188. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  55189. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  55190. <dd><p>Bilinear interpolation.
  55191. </p></dd>
  55192. <dt>&lsquo;<samp class="samp">lagrange9</samp>&rsquo;</dt>
  55193. <dd><p>Lagrange9 interpolation.
  55194. </p></dd>
  55195. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  55196. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  55197. <dd><p>Bicubic interpolation.
  55198. </p></dd>
  55199. <dt>&lsquo;<samp class="samp">lanc</samp>&rsquo;</dt>
  55200. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  55201. <dd><p>Lanczos interpolation.
  55202. </p></dd>
  55203. <dt>&lsquo;<samp class="samp">sp16</samp>&rsquo;</dt>
  55204. <dt>&lsquo;<samp class="samp">spline16</samp>&rsquo;</dt>
  55205. <dd><p>Spline16 interpolation.
  55206. </p></dd>
  55207. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  55208. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  55209. <dd><p>Gaussian interpolation.
  55210. </p></dd>
  55211. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  55212. <dd><p>Mitchell interpolation.
  55213. </p></dd>
  55214. </dl>
  55215. <p>Default value is <b class="b">&lsquo;<samp class="samp">line</samp>&rsquo;</b>.
  55216. </p>
  55217. </dd>
  55218. <dt><samp class="option">w</samp></dt>
  55219. <dt><samp class="option">h</samp></dt>
  55220. <dd><p>Set the output video resolution.
  55221. </p>
  55222. <p>Default resolution depends on formats.
  55223. </p>
  55224. </dd>
  55225. <dt><samp class="option">in_stereo</samp></dt>
  55226. <dt><samp class="option">out_stereo</samp></dt>
  55227. <dd><p>Set the input/output stereo format.
  55228. </p>
  55229. <dl class="table">
  55230. <dt>&lsquo;<samp class="samp">2d</samp>&rsquo;</dt>
  55231. <dd><p>2D mono
  55232. </p></dd>
  55233. <dt>&lsquo;<samp class="samp">sbs</samp>&rsquo;</dt>
  55234. <dd><p>Side by side
  55235. </p></dd>
  55236. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  55237. <dd><p>Top bottom
  55238. </p></dd>
  55239. </dl>
  55240. <p>Default value is <b class="b">&lsquo;<samp class="samp">2d</samp>&rsquo;</b> for input and output format.
  55241. </p>
  55242. </dd>
  55243. <dt><samp class="option">yaw</samp></dt>
  55244. <dt><samp class="option">pitch</samp></dt>
  55245. <dt><samp class="option">roll</samp></dt>
  55246. <dd><p>Set rotation for the output video. Values in degrees.
  55247. </p>
  55248. </dd>
  55249. <dt><samp class="option">rorder</samp></dt>
  55250. <dd><p>Set rotation order for the output video. Choose one item for each position.
  55251. </p>
  55252. <dl class="table">
  55253. <dt>&lsquo;<samp class="samp">y, Y</samp>&rsquo;</dt>
  55254. <dd><p>yaw
  55255. </p></dd>
  55256. <dt>&lsquo;<samp class="samp">p, P</samp>&rsquo;</dt>
  55257. <dd><p>pitch
  55258. </p></dd>
  55259. <dt>&lsquo;<samp class="samp">r, R</samp>&rsquo;</dt>
  55260. <dd><p>roll
  55261. </p></dd>
  55262. </dl>
  55263. <p>Default value is <b class="b">&lsquo;<samp class="samp">ypr</samp>&rsquo;</b>.
  55264. </p>
  55265. </dd>
  55266. <dt><samp class="option">h_flip</samp></dt>
  55267. <dt><samp class="option">v_flip</samp></dt>
  55268. <dt><samp class="option">d_flip</samp></dt>
  55269. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  55270. </p>
  55271. </dd>
  55272. <dt><samp class="option">ih_flip</samp></dt>
  55273. <dt><samp class="option">iv_flip</samp></dt>
  55274. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  55275. </p>
  55276. </dd>
  55277. <dt><samp class="option">in_trans</samp></dt>
  55278. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  55279. </p>
  55280. </dd>
  55281. <dt><samp class="option">out_trans</samp></dt>
  55282. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  55283. </p>
  55284. </dd>
  55285. <dt><samp class="option">h_offset</samp></dt>
  55286. <dt><samp class="option">v_offset</samp></dt>
  55287. <dd><p>Set output horizontal/vertical off-axis offset. Default is set to 0.
  55288. Allowed range is from -1 to 1.
  55289. </p>
  55290. </dd>
  55291. <dt><samp class="option">alpha_mask</samp></dt>
  55292. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  55293. </p>
  55294. </dd>
  55295. <dt><samp class="option">reset_rot</samp></dt>
  55296. <dd><p>Reset rotation of output video. Boolean value, by default disabled.
  55297. </p></dd>
  55298. </dl>
  55299. <ul class="mini-toc">
  55300. <li><a href="#Examples-177" accesskey="1">Examples</a></li>
  55301. <li><a href="#Commands-150" accesskey="2">Commands</a></li>
  55302. </ul>
  55303. <div class="subsection-level-extent" id="Examples-177">
  55304. <h4 class="subsection"><span>39.272.1 Examples<a class="copiable-link" href="#Examples-177"> &para;</a></span></h4>
  55305. <ul class="itemize mark-bullet">
  55306. <li>Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  55307. <div class="example">
  55308. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  55309. </pre></div>
  55310. </li><li>Extract back view of Equi-Angular Cubemap:
  55311. <div class="example">
  55312. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  55313. </pre></div>
  55314. </li><li>Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  55315. <div class="example">
  55316. <pre class="example-preformatted">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  55317. </pre></div>
  55318. </li></ul>
  55319. </div>
  55320. <div class="subsection-level-extent" id="Commands-150">
  55321. <h4 class="subsection"><span>39.272.2 Commands<a class="copiable-link" href="#Commands-150"> &para;</a></span></h4>
  55322. <p>This filter supports subset of above options as <a class="ref" href="#commands">commands</a>.
  55323. </p>
  55324. </div>
  55325. </div>
  55326. <div class="section-level-extent" id="vaguedenoiser">
  55327. <h3 class="section"><span>39.273 vaguedenoiser<a class="copiable-link" href="#vaguedenoiser"> &para;</a></span></h3>
  55328. <p>Apply a wavelet based denoiser.
  55329. </p>
  55330. <p>It transforms each frame from the video input into the wavelet domain,
  55331. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  55332. the obtained coefficients. It does an inverse wavelet transform after.
  55333. Due to wavelet properties, it should give a nice smoothed result, and
  55334. reduced noise, without blurring picture features.
  55335. </p>
  55336. <p>This filter accepts the following options:
  55337. </p>
  55338. <dl class="table">
  55339. <dt><samp class="option">threshold</samp></dt>
  55340. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  55341. Hard thresholding can use a higher threshold than soft thresholding
  55342. before the video looks overfiltered. Default value is 2.
  55343. </p>
  55344. </dd>
  55345. <dt><samp class="option">method</samp></dt>
  55346. <dd><p>The filtering method the filter will use.
  55347. </p>
  55348. <p>It accepts the following values:
  55349. </p><dl class="table">
  55350. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  55351. <dd><p>All values under the threshold will be zeroed.
  55352. </p>
  55353. </dd>
  55354. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  55355. <dd><p>All values under the threshold will be zeroed. All values above will be
  55356. reduced by the threshold.
  55357. </p>
  55358. </dd>
  55359. <dt>&lsquo;<samp class="samp">garrote</samp>&rsquo;</dt>
  55360. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  55361. (less) hard thresholding.
  55362. </p></dd>
  55363. </dl>
  55364. <p>Default is garrote.
  55365. </p>
  55366. </dd>
  55367. <dt><samp class="option">nsteps</samp></dt>
  55368. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  55369. be decomposed beyond a particular point (typically, 8 for a 640x480
  55370. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  55371. </p>
  55372. </dd>
  55373. <dt><samp class="option">percent</samp></dt>
  55374. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  55375. </p>
  55376. </dd>
  55377. <dt><samp class="option">planes</samp></dt>
  55378. <dd><p>A list of the planes to process. By default all planes are processed.
  55379. </p>
  55380. </dd>
  55381. <dt><samp class="option">type</samp></dt>
  55382. <dd><p>The threshold type the filter will use.
  55383. </p>
  55384. <p>It accepts the following values:
  55385. </p><dl class="table">
  55386. <dt>&lsquo;<samp class="samp">universal</samp>&rsquo;</dt>
  55387. <dd><p>Threshold used is same for all decompositions.
  55388. </p>
  55389. </dd>
  55390. <dt>&lsquo;<samp class="samp">bayes</samp>&rsquo;</dt>
  55391. <dd><p>Threshold used depends also on each decomposition coefficients.
  55392. </p></dd>
  55393. </dl>
  55394. <p>Default is universal.
  55395. </p></dd>
  55396. </dl>
  55397. </div>
  55398. <div class="section-level-extent" id="varblur">
  55399. <h3 class="section"><span>39.274 varblur<a class="copiable-link" href="#varblur"> &para;</a></span></h3>
  55400. <p>Apply variable blur filter by using 2nd video stream to set blur radius.
  55401. The 2nd stream must have the same dimensions.
  55402. </p>
  55403. <p>This filter accepts the following options:
  55404. </p>
  55405. <dl class="table">
  55406. <dt><samp class="option">min_r</samp></dt>
  55407. <dd><p>Set min allowed radius. Allowed range is from 0 to 254. Default is 0.
  55408. </p></dd>
  55409. <dt><samp class="option">max_r</samp></dt>
  55410. <dd><p>Set max allowed radius. Allowed range is from 1 to 255. Default is 8.
  55411. </p></dd>
  55412. <dt><samp class="option">planes</samp></dt>
  55413. <dd><p>Set which planes to process. By default, all are used.
  55414. </p></dd>
  55415. </dl>
  55416. <p>The <code class="code">varblur</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  55417. </p>
  55418. <ul class="mini-toc">
  55419. <li><a href="#Commands-151" accesskey="1">Commands</a></li>
  55420. </ul>
  55421. <div class="subsection-level-extent" id="Commands-151">
  55422. <h4 class="subsection"><span>39.274.1 Commands<a class="copiable-link" href="#Commands-151"> &para;</a></span></h4>
  55423. <p>This filter supports all the above options as <a class="ref" href="#commands">commands</a>.
  55424. </p>
  55425. </div>
  55426. </div>
  55427. <div class="section-level-extent" id="vectorscope">
  55428. <h3 class="section"><span>39.275 vectorscope<a class="copiable-link" href="#vectorscope"> &para;</a></span></h3>
  55429. <p>Display 2 color component values in the two dimensional graph (which is called
  55430. a vectorscope).
  55431. </p>
  55432. <p>This filter accepts the following options:
  55433. </p>
  55434. <dl class="table">
  55435. <dt><samp class="option">mode, m</samp></dt>
  55436. <dd><p>Set vectorscope mode.
  55437. </p>
  55438. <p>It accepts the following values:
  55439. </p><dl class="table">
  55440. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  55441. <dt>&lsquo;<samp class="samp">tint</samp>&rsquo;</dt>
  55442. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  55443. same component color value on location in graph. This is the default mode.
  55444. </p>
  55445. </dd>
  55446. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  55447. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  55448. present in video frame are drawn in gradient of 2 color components which are
  55449. set by option <code class="code">x</code> and <code class="code">y</code>. The 3rd color component is static.
  55450. </p>
  55451. </dd>
  55452. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  55453. <dd><p>Actual color components values present in video frame are displayed on graph.
  55454. </p>
  55455. </dd>
  55456. <dt>&lsquo;<samp class="samp">color3</samp>&rsquo;</dt>
  55457. <dd><p>Similar as color2 but higher frequency of same values <code class="code">x</code> and <code class="code">y</code>
  55458. on graph increases value of another color component, which is luminance by
  55459. default values of <code class="code">x</code> and <code class="code">y</code>.
  55460. </p>
  55461. </dd>
  55462. <dt>&lsquo;<samp class="samp">color4</samp>&rsquo;</dt>
  55463. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  55464. colors map to same position on graph then color with higher value of component
  55465. not present in graph is picked.
  55466. </p>
  55467. </dd>
  55468. <dt>&lsquo;<samp class="samp">color5</samp>&rsquo;</dt>
  55469. <dd><p>Gray values are displayed on graph. Similar to <code class="code">color</code> but with 3rd color
  55470. component picked from radial gradient.
  55471. </p></dd>
  55472. </dl>
  55473. </dd>
  55474. <dt><samp class="option">x</samp></dt>
  55475. <dd><p>Set which color component will be represented on X-axis. Default is <code class="code">1</code>.
  55476. </p>
  55477. </dd>
  55478. <dt><samp class="option">y</samp></dt>
  55479. <dd><p>Set which color component will be represented on Y-axis. Default is <code class="code">2</code>.
  55480. </p>
  55481. </dd>
  55482. <dt><samp class="option">intensity, i</samp></dt>
  55483. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  55484. of color component which represents frequency of (X, Y) location in graph.
  55485. </p>
  55486. </dd>
  55487. <dt><samp class="option">envelope, e</samp></dt>
  55488. <dd><dl class="table">
  55489. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  55490. <dd><p>No envelope, this is default.
  55491. </p>
  55492. </dd>
  55493. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  55494. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  55495. </p>
  55496. </dd>
  55497. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  55498. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  55499. can still spot out of range values without constantly looking at vectorscope.
  55500. </p>
  55501. </dd>
  55502. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  55503. <dd><p>Peak and instant envelope combined together.
  55504. </p></dd>
  55505. </dl>
  55506. </dd>
  55507. <dt><samp class="option">graticule, g</samp></dt>
  55508. <dd><p>Set what kind of graticule to draw.
  55509. </p><dl class="table">
  55510. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  55511. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  55512. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  55513. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  55514. </dl>
  55515. </dd>
  55516. <dt><samp class="option">opacity, o</samp></dt>
  55517. <dd><p>Set graticule opacity.
  55518. </p>
  55519. </dd>
  55520. <dt><samp class="option">flags, f</samp></dt>
  55521. <dd><p>Set graticule flags.
  55522. </p>
  55523. <dl class="table">
  55524. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  55525. <dd><p>Draw graticule for white point.
  55526. </p>
  55527. </dd>
  55528. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  55529. <dd><p>Draw graticule for black point.
  55530. </p>
  55531. </dd>
  55532. <dt>&lsquo;<samp class="samp">name</samp>&rsquo;</dt>
  55533. <dd><p>Draw color points short names.
  55534. </p></dd>
  55535. </dl>
  55536. </dd>
  55537. <dt><samp class="option">bgopacity, b</samp></dt>
  55538. <dd><p>Set background opacity.
  55539. </p>
  55540. </dd>
  55541. <dt><samp class="option">lthreshold, l</samp></dt>
  55542. <dd><p>Set low threshold for color component not represented on X or Y axis.
  55543. Values lower than this value will be ignored. Default is 0.
  55544. Note this value is multiplied with actual max possible value one pixel component
  55545. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  55546. is 0.1 * 255 = 25.
  55547. </p>
  55548. </dd>
  55549. <dt><samp class="option">hthreshold, h</samp></dt>
  55550. <dd><p>Set high threshold for color component not represented on X or Y axis.
  55551. Values higher than this value will be ignored. Default is 1.
  55552. Note this value is multiplied with actual max possible value one pixel component
  55553. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  55554. is 0.9 * 255 = 230.
  55555. </p>
  55556. </dd>
  55557. <dt><samp class="option">colorspace, c</samp></dt>
  55558. <dd><p>Set what kind of colorspace to use when drawing graticule.
  55559. </p><dl class="table">
  55560. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  55561. <dt>&lsquo;<samp class="samp">601</samp>&rsquo;</dt>
  55562. <dt>&lsquo;<samp class="samp">709</samp>&rsquo;</dt>
  55563. </dl>
  55564. <p>Default is auto.
  55565. </p>
  55566. </dd>
  55567. <dt><samp class="option">tint0, t0</samp></dt>
  55568. <dt><samp class="option">tint1, t1</samp></dt>
  55569. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  55570. This means no tint, and output will remain gray.
  55571. </p></dd>
  55572. </dl>
  55573. <a class="anchor" id="vidstabdetect"></a></div>
  55574. <div class="section-level-extent" id="vidstabdetect-1">
  55575. <h3 class="section"><span>39.276 vidstabdetect<a class="copiable-link" href="#vidstabdetect-1"> &para;</a></span></h3>
  55576. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  55577. <a class="ref" href="#vidstabtransform">vidstabtransform</a> for pass 2.
  55578. </p>
  55579. <p>This filter generates a file with relative translation and rotation
  55580. transform information about subsequent frames, which is then used by
  55581. the <a class="ref" href="#vidstabtransform">vidstabtransform</a> filter.
  55582. </p>
  55583. <p>To enable compilation of this filter you need to configure FFmpeg with
  55584. <code class="code">--enable-libvidstab</code>.
  55585. </p>
  55586. <p>This filter accepts the following options:
  55587. </p>
  55588. <dl class="table">
  55589. <dt><samp class="option">result</samp></dt>
  55590. <dd><p>Set the path to the file used to write the transforms information.
  55591. Default value is <samp class="file">transforms.trf</samp>.
  55592. </p>
  55593. </dd>
  55594. <dt><samp class="option">shakiness</samp></dt>
  55595. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  55596. integer in the range 1-10, a value of 1 means little shakiness, a
  55597. value of 10 means strong shakiness. Default value is 5.
  55598. </p>
  55599. </dd>
  55600. <dt><samp class="option">accuracy</samp></dt>
  55601. <dd><p>Set the accuracy of the detection process. It must be a value in the
  55602. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  55603. accuracy. Default value is 15.
  55604. </p>
  55605. </dd>
  55606. <dt><samp class="option">stepsize</samp></dt>
  55607. <dd><p>Set stepsize of the search process. The region around minimum is
  55608. scanned with 1 pixel resolution. Default value is 6.
  55609. </p>
  55610. </dd>
  55611. <dt><samp class="option">mincontrast</samp></dt>
  55612. <dd><p>Set minimum contrast. Below this value a local measurement field is
  55613. discarded. Must be a floating point value in the range 0-1. Default
  55614. value is 0.3.
  55615. </p>
  55616. </dd>
  55617. <dt><samp class="option">tripod</samp></dt>
  55618. <dd><p>Set reference frame number for tripod mode.
  55619. </p>
  55620. <p>If enabled, the motion of the frames is compared to a reference frame
  55621. in the filtered stream, identified by the specified number. The idea
  55622. is to compensate all movements in a more-or-less static scene and keep
  55623. the camera view absolutely still.
  55624. </p>
  55625. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  55626. </p>
  55627. </dd>
  55628. <dt><samp class="option">show</samp></dt>
  55629. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  55630. integer in the range 0-2. Default value is 0, which disables any
  55631. visualization.
  55632. </p>
  55633. </dd>
  55634. <dt><samp class="option">fileformat</samp></dt>
  55635. <dd><p>Format for the transforms data file to be written.
  55636. Acceptable values are
  55637. </p>
  55638. <dl class="table">
  55639. <dt>&lsquo;<samp class="samp">ascii</samp>&rsquo;</dt>
  55640. <dd><p>Human-readable plain text
  55641. </p>
  55642. </dd>
  55643. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  55644. <dd><p>Binary format, roughly 40% smaller than <code class="code">ascii</code>. (<em class="emph">default</em>)
  55645. </p></dd>
  55646. </dl>
  55647. </dd>
  55648. </dl>
  55649. <ul class="mini-toc">
  55650. <li><a href="#Examples-178" accesskey="1">Examples</a></li>
  55651. </ul>
  55652. <div class="subsection-level-extent" id="Examples-178">
  55653. <h4 class="subsection"><span>39.276.1 Examples<a class="copiable-link" href="#Examples-178"> &para;</a></span></h4>
  55654. <ul class="itemize mark-bullet">
  55655. <li>Use default values:
  55656. <div class="example">
  55657. <pre class="example-preformatted">vidstabdetect
  55658. </pre></div>
  55659. </li><li>Analyze strongly shaky movie and put the results in file
  55660. <samp class="file">mytransforms.trf</samp>:
  55661. <div class="example">
  55662. <pre class="example-preformatted">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  55663. </pre></div>
  55664. </li><li>Visualize the result of internal transformations in the resulting
  55665. video:
  55666. <div class="example">
  55667. <pre class="example-preformatted">vidstabdetect=show=1
  55668. </pre></div>
  55669. </li><li>Analyze a video with medium shakiness using <code class="command">ffmpeg</code>:
  55670. <div class="example">
  55671. <pre class="example-preformatted">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  55672. </pre></div>
  55673. </li></ul>
  55674. <a class="anchor" id="vidstabtransform"></a></div>
  55675. </div>
  55676. <div class="section-level-extent" id="vidstabtransform-1">
  55677. <h3 class="section"><span>39.277 vidstabtransform<a class="copiable-link" href="#vidstabtransform-1"> &para;</a></span></h3>
  55678. <p>Video stabilization/deshaking: pass 2 of 2,
  55679. see <a class="ref" href="#vidstabdetect">vidstabdetect</a> for pass 1.
  55680. </p>
  55681. <p>Read a file with transform information for each frame and
  55682. apply/compensate them. Together with the <a class="ref" href="#vidstabdetect">vidstabdetect</a>
  55683. filter this can be used to deshake videos. See also
  55684. <a class="url" href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  55685. the <a class="ref" href="#unsharp">unsharp</a> filter, see below.
  55686. </p>
  55687. <p>To enable compilation of this filter you need to configure FFmpeg with
  55688. <code class="code">--enable-libvidstab</code>.
  55689. </p>
  55690. <ul class="mini-toc">
  55691. <li><a href="#Options-115" accesskey="1">Options</a></li>
  55692. <li><a href="#Examples-179" accesskey="2">Examples</a></li>
  55693. </ul>
  55694. <div class="subsection-level-extent" id="Options-115">
  55695. <h4 class="subsection"><span>39.277.1 Options<a class="copiable-link" href="#Options-115"> &para;</a></span></h4>
  55696. <dl class="table">
  55697. <dt><samp class="option">input</samp></dt>
  55698. <dd><p>Set path to the file used to read the transforms. Default value is
  55699. <samp class="file">transforms.trf</samp>.
  55700. </p>
  55701. </dd>
  55702. <dt><samp class="option">smoothing</samp></dt>
  55703. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  55704. camera movements. Default value is 10.
  55705. </p>
  55706. <p>For example a number of 10 means that 21 frames are used (10 in the
  55707. past and 10 in the future) to smoothen the motion in the video. A
  55708. larger value leads to a smoother video, but limits the acceleration of
  55709. the camera (pan/tilt movements). 0 is a special case where a static
  55710. camera is simulated.
  55711. </p>
  55712. </dd>
  55713. <dt><samp class="option">optalgo</samp></dt>
  55714. <dd><p>Set the camera path optimization algorithm.
  55715. </p>
  55716. <p>Accepted values are:
  55717. </p><dl class="table">
  55718. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  55719. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  55720. </p></dd>
  55721. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  55722. <dd><p>averaging on transformations
  55723. </p></dd>
  55724. </dl>
  55725. </dd>
  55726. <dt><samp class="option">maxshift</samp></dt>
  55727. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  55728. meaning no limit.
  55729. </p>
  55730. </dd>
  55731. <dt><samp class="option">maxangle</samp></dt>
  55732. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  55733. value is -1, meaning no limit.
  55734. </p>
  55735. </dd>
  55736. <dt><samp class="option">crop</samp></dt>
  55737. <dd><p>Specify how to deal with borders that may be visible due to movement
  55738. compensation.
  55739. </p>
  55740. <p>Available values are:
  55741. </p><dl class="table">
  55742. <dt>&lsquo;<samp class="samp">keep</samp>&rsquo;</dt>
  55743. <dd><p>keep image information from previous frame (default)
  55744. </p></dd>
  55745. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  55746. <dd><p>fill the border black
  55747. </p></dd>
  55748. </dl>
  55749. </dd>
  55750. <dt><samp class="option">invert</samp></dt>
  55751. <dd><p>Invert transforms if set to 1. Default value is 0.
  55752. </p>
  55753. </dd>
  55754. <dt><samp class="option">relative</samp></dt>
  55755. <dd><p>Consider transforms as relative to previous frame if set to 1,
  55756. absolute if set to 0. Default value is 0.
  55757. </p>
  55758. </dd>
  55759. <dt><samp class="option">zoom</samp></dt>
  55760. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  55761. effect, a negative value in a zoom-out effect. Default value is 0 (no
  55762. zoom).
  55763. </p>
  55764. </dd>
  55765. <dt><samp class="option">optzoom</samp></dt>
  55766. <dd><p>Set optimal zooming to avoid borders.
  55767. </p>
  55768. <p>Accepted values are:
  55769. </p><dl class="table">
  55770. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  55771. <dd><p>disabled
  55772. </p></dd>
  55773. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  55774. <dd><p>optimal static zoom value is determined (only very strong movements
  55775. will lead to visible borders) (default)
  55776. </p></dd>
  55777. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  55778. <dd><p>optimal adaptive zoom value is determined (no borders will be
  55779. visible), see <samp class="option">zoomspeed</samp>
  55780. </p></dd>
  55781. </dl>
  55782. <p>Note that the value given at zoom is added to the one calculated here.
  55783. </p>
  55784. </dd>
  55785. <dt><samp class="option">zoomspeed</samp></dt>
  55786. <dd><p>Set percent to zoom maximally each frame (enabled when
  55787. <samp class="option">optzoom</samp> is set to 2). Range is from 0 to 5, default value is
  55788. 0.25.
  55789. </p>
  55790. </dd>
  55791. <dt><samp class="option">interpol</samp></dt>
  55792. <dd><p>Specify type of interpolation.
  55793. </p>
  55794. <p>Available values are:
  55795. </p><dl class="table">
  55796. <dt>&lsquo;<samp class="samp">no</samp>&rsquo;</dt>
  55797. <dd><p>no interpolation
  55798. </p></dd>
  55799. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  55800. <dd><p>linear only horizontal
  55801. </p></dd>
  55802. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  55803. <dd><p>linear in both directions (default)
  55804. </p></dd>
  55805. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  55806. <dd><p>cubic in both directions (slow)
  55807. </p></dd>
  55808. </dl>
  55809. </dd>
  55810. <dt><samp class="option">tripod</samp></dt>
  55811. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  55812. <code class="code">relative=0:smoothing=0</code>. Default value is 0.
  55813. </p>
  55814. <p>Use also <code class="code">tripod</code> option of <a class="ref" href="#vidstabdetect">vidstabdetect</a>.
  55815. </p>
  55816. </dd>
  55817. <dt><samp class="option">debug</samp></dt>
  55818. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  55819. are written to the temporary file <samp class="file">global_motions.trf</samp>. Default
  55820. value is 0.
  55821. </p></dd>
  55822. </dl>
  55823. </div>
  55824. <div class="subsection-level-extent" id="Examples-179">
  55825. <h4 class="subsection"><span>39.277.2 Examples<a class="copiable-link" href="#Examples-179"> &para;</a></span></h4>
  55826. <ul class="itemize mark-bullet">
  55827. <li>Use <code class="command">ffmpeg</code> for a typical stabilization with default values:
  55828. <div class="example">
  55829. <pre class="example-preformatted">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  55830. </pre></div>
  55831. <p>Note the use of the <a class="ref" href="#unsharp">unsharp</a> filter which is always recommended.
  55832. </p>
  55833. </li><li>Zoom in a bit more and load transform data from a given file:
  55834. <div class="example">
  55835. <pre class="example-preformatted">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  55836. </pre></div>
  55837. </li><li>Smoothen the video even more:
  55838. <div class="example">
  55839. <pre class="example-preformatted">vidstabtransform=smoothing=30
  55840. </pre></div>
  55841. </li></ul>
  55842. </div>
  55843. </div>
  55844. <div class="section-level-extent" id="vflip">
  55845. <h3 class="section"><span>39.278 vflip<a class="copiable-link" href="#vflip"> &para;</a></span></h3>
  55846. <p>Flip the input video vertically.
  55847. </p>
  55848. <p>For example, to vertically flip a video with <code class="command">ffmpeg</code>:
  55849. </p><div class="example">
  55850. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  55851. </pre></div>
  55852. </div>
  55853. <div class="section-level-extent" id="vfrdet">
  55854. <h3 class="section"><span>39.279 vfrdet<a class="copiable-link" href="#vfrdet"> &para;</a></span></h3>
  55855. <p>Detect variable frame rate video.
  55856. </p>
  55857. <p>This filter tries to detect if the input is variable or constant frame rate.
  55858. </p>
  55859. <p>At end it will output number of frames detected as having variable delta pts,
  55860. and ones with constant delta pts.
  55861. If there was frames with variable delta, than it will also show min, max and
  55862. average delta encountered.
  55863. </p>
  55864. </div>
  55865. <div class="section-level-extent" id="vibrance">
  55866. <h3 class="section"><span>39.280 vibrance<a class="copiable-link" href="#vibrance"> &para;</a></span></h3>
  55867. <p>Boost or alter saturation.
  55868. </p>
  55869. <p>The filter accepts the following options:
  55870. </p><dl class="table">
  55871. <dt><samp class="option">intensity</samp></dt>
  55872. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  55873. Default is 0. Allowed range is from -2 to 2.
  55874. </p>
  55875. </dd>
  55876. <dt><samp class="option">rbal</samp></dt>
  55877. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  55878. </p>
  55879. </dd>
  55880. <dt><samp class="option">gbal</samp></dt>
  55881. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  55882. </p>
  55883. </dd>
  55884. <dt><samp class="option">bbal</samp></dt>
  55885. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  55886. </p>
  55887. </dd>
  55888. <dt><samp class="option">rlum</samp></dt>
  55889. <dd><p>Set the red luma coefficient.
  55890. </p>
  55891. </dd>
  55892. <dt><samp class="option">glum</samp></dt>
  55893. <dd><p>Set the green luma coefficient.
  55894. </p>
  55895. </dd>
  55896. <dt><samp class="option">blum</samp></dt>
  55897. <dd><p>Set the blue luma coefficient.
  55898. </p>
  55899. </dd>
  55900. <dt><samp class="option">alternate</samp></dt>
  55901. <dd><p>If <code class="code">intensity</code> is negative and this is set to 1, colors will change,
  55902. otherwise colors will be less saturated, more towards gray.
  55903. </p></dd>
  55904. </dl>
  55905. <ul class="mini-toc">
  55906. <li><a href="#Commands-152" accesskey="1">Commands</a></li>
  55907. </ul>
  55908. <div class="subsection-level-extent" id="Commands-152">
  55909. <h4 class="subsection"><span>39.280.1 Commands<a class="copiable-link" href="#Commands-152"> &para;</a></span></h4>
  55910. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  55911. </p>
  55912. </div>
  55913. </div>
  55914. <div class="section-level-extent" id="vif">
  55915. <h3 class="section"><span>39.281 vif<a class="copiable-link" href="#vif"> &para;</a></span></h3>
  55916. <p>Obtain the average VIF (Visual Information Fidelity) between two input videos.
  55917. </p>
  55918. <p>This filter takes two input videos.
  55919. </p>
  55920. <p>Both input videos must have the same resolution and pixel format for
  55921. this filter to work correctly. Also it assumes that both inputs
  55922. have the same number of frames, which are compared one by one.
  55923. </p>
  55924. <p>The obtained average VIF score is printed through the logging system.
  55925. </p>
  55926. <p>The filter stores the calculated VIF score of each frame.
  55927. </p>
  55928. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  55929. </p>
  55930. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  55931. with the reference file <samp class="file">ref.mpg</samp>.
  55932. </p>
  55933. <div class="example">
  55934. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
  55935. </pre></div>
  55936. <a class="anchor" id="vignette"></a></div>
  55937. <div class="section-level-extent" id="vignette-1">
  55938. <h3 class="section"><span>39.282 vignette<a class="copiable-link" href="#vignette-1"> &para;</a></span></h3>
  55939. <p>Make or reverse a natural vignetting effect.
  55940. </p>
  55941. <p>The filter accepts the following options:
  55942. </p>
  55943. <dl class="table">
  55944. <dt><samp class="option">angle, a</samp></dt>
  55945. <dd><p>Set lens angle expression as a number of radians.
  55946. </p>
  55947. <p>The value is clipped in the <code class="code">[0,PI/2]</code> range.
  55948. </p>
  55949. <p>Default value: <code class="code">&quot;PI/5&quot;</code>
  55950. </p>
  55951. </dd>
  55952. <dt><samp class="option">x0</samp></dt>
  55953. <dt><samp class="option">y0</samp></dt>
  55954. <dd><p>Set center coordinates expressions. Respectively <code class="code">&quot;w/2&quot;</code> and <code class="code">&quot;h/2&quot;</code>
  55955. by default.
  55956. </p>
  55957. </dd>
  55958. <dt><samp class="option">mode</samp></dt>
  55959. <dd><p>Set forward/backward mode.
  55960. </p>
  55961. <p>Available modes are:
  55962. </p><dl class="table">
  55963. <dt>&lsquo;<samp class="samp">forward</samp>&rsquo;</dt>
  55964. <dd><p>The larger the distance from the central point, the darker the image becomes.
  55965. </p>
  55966. </dd>
  55967. <dt>&lsquo;<samp class="samp">backward</samp>&rsquo;</dt>
  55968. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  55969. This can be used to reverse a vignette effect, though there is no automatic
  55970. detection to extract the lens <samp class="option">angle</samp> and other settings (yet). It can
  55971. also be used to create a burning effect.
  55972. </p></dd>
  55973. </dl>
  55974. <p>Default value is &lsquo;<samp class="samp">forward</samp>&rsquo;.
  55975. </p>
  55976. </dd>
  55977. <dt><samp class="option">eval</samp></dt>
  55978. <dd><p>Set evaluation mode for the expressions (<samp class="option">angle</samp>, <samp class="option">x0</samp>, <samp class="option">y0</samp>).
  55979. </p>
  55980. <p>It accepts the following values:
  55981. </p><dl class="table">
  55982. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  55983. <dd><p>Evaluate expressions only once during the filter initialization.
  55984. </p>
  55985. </dd>
  55986. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  55987. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  55988. &lsquo;<samp class="samp">init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  55989. allows advanced dynamic expressions.
  55990. </p></dd>
  55991. </dl>
  55992. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  55993. </p>
  55994. </dd>
  55995. <dt><samp class="option">dither</samp></dt>
  55996. <dd><p>Set dithering to reduce the circular banding effects. Default is <code class="code">1</code>
  55997. (enabled).
  55998. </p>
  55999. </dd>
  56000. <dt><samp class="option">aspect</samp></dt>
  56001. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  56002. Setting this value to the SAR of the input will make a rectangular vignetting
  56003. following the dimensions of the video.
  56004. </p>
  56005. <p>Default is <code class="code">1/1</code>.
  56006. </p></dd>
  56007. </dl>
  56008. <ul class="mini-toc">
  56009. <li><a href="#Expressions" accesskey="1">Expressions</a></li>
  56010. <li><a href="#Examples-180" accesskey="2">Examples</a></li>
  56011. </ul>
  56012. <div class="subsection-level-extent" id="Expressions">
  56013. <h4 class="subsection"><span>39.282.1 Expressions<a class="copiable-link" href="#Expressions"> &para;</a></span></h4>
  56014. <p>The <samp class="option">alpha</samp>, <samp class="option">x0</samp> and <samp class="option">y0</samp> expressions can contain the
  56015. following parameters.
  56016. </p>
  56017. <dl class="table">
  56018. <dt><samp class="option">w</samp></dt>
  56019. <dt><samp class="option">h</samp></dt>
  56020. <dd><p>input width and height
  56021. </p>
  56022. </dd>
  56023. <dt><samp class="option">n</samp></dt>
  56024. <dd><p>the number of input frame, starting from 0
  56025. </p>
  56026. </dd>
  56027. <dt><samp class="option">pts</samp></dt>
  56028. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  56029. <var class="var">TB</var> units, NAN if undefined
  56030. </p>
  56031. </dd>
  56032. <dt><samp class="option">r</samp></dt>
  56033. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  56034. </p>
  56035. </dd>
  56036. <dt><samp class="option">t</samp></dt>
  56037. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  56038. expressed in seconds, NAN if undefined
  56039. </p>
  56040. </dd>
  56041. <dt><samp class="option">tb</samp></dt>
  56042. <dd><p>time base of the input video
  56043. </p></dd>
  56044. </dl>
  56045. </div>
  56046. <div class="subsection-level-extent" id="Examples-180">
  56047. <h4 class="subsection"><span>39.282.2 Examples<a class="copiable-link" href="#Examples-180"> &para;</a></span></h4>
  56048. <ul class="itemize mark-bullet">
  56049. <li>Apply simple strong vignetting effect:
  56050. <div class="example">
  56051. <pre class="example-preformatted">vignette=PI/4
  56052. </pre></div>
  56053. </li><li>Make a flickering vignetting:
  56054. <div class="example">
  56055. <pre class="example-preformatted">vignette='PI/4+random(1)*PI/50':eval=frame
  56056. </pre></div>
  56057. </li></ul>
  56058. </div>
  56059. </div>
  56060. <div class="section-level-extent" id="vmafmotion">
  56061. <h3 class="section"><span>39.283 vmafmotion<a class="copiable-link" href="#vmafmotion"> &para;</a></span></h3>
  56062. <p>Obtain the average VMAF motion score of a video.
  56063. It is one of the component metrics of VMAF.
  56064. </p>
  56065. <p>The obtained average motion score is printed through the logging system.
  56066. </p>
  56067. <p>The filter accepts the following options:
  56068. </p>
  56069. <dl class="table">
  56070. <dt><samp class="option">stats_file</samp></dt>
  56071. <dd><p>If specified, the filter will use the named file to save the motion score of
  56072. each frame with respect to the previous frame.
  56073. When filename equals &quot;-&quot; the data is sent to standard output.
  56074. </p></dd>
  56075. </dl>
  56076. <p>Example:
  56077. </p><div class="example">
  56078. <pre class="example-preformatted">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  56079. </pre></div>
  56080. <a class="anchor" id="vstack"></a></div>
  56081. <div class="section-level-extent" id="vstack-1">
  56082. <h3 class="section"><span>39.284 vstack<a class="copiable-link" href="#vstack-1"> &para;</a></span></h3>
  56083. <p>Stack input videos vertically.
  56084. </p>
  56085. <p>All streams must be of same pixel format and of same width.
  56086. </p>
  56087. <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
  56088. to create same output.
  56089. </p>
  56090. <p>The filter accepts the following options:
  56091. </p>
  56092. <dl class="table">
  56093. <dt><samp class="option">inputs</samp></dt>
  56094. <dd><p>Set number of input streams. Default is 2.
  56095. </p>
  56096. </dd>
  56097. <dt><samp class="option">shortest</samp></dt>
  56098. <dd><p>If set to 1, force the output to terminate when the shortest input
  56099. terminates. Default value is 0.
  56100. </p></dd>
  56101. </dl>
  56102. </div>
  56103. <div class="section-level-extent" id="w3fdif">
  56104. <h3 class="section"><span>39.285 w3fdif<a class="copiable-link" href="#w3fdif"> &para;</a></span></h3>
  56105. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  56106. Deinterlacing Filter&quot;).
  56107. </p>
  56108. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  56109. implemented based on the de-interlace algorithm written by Jim
  56110. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  56111. uses filter coefficients calculated by BBC R&amp;D.
  56112. </p>
  56113. <p>This filter uses field-dominance information in frame to decide which
  56114. of each pair of fields to place first in the output.
  56115. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">w3fdif</code> filter.
  56116. </p>
  56117. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  56118. and &quot;complex&quot;. Which set of filter coefficients is used can
  56119. be set by passing an optional parameter:
  56120. </p>
  56121. <dl class="table">
  56122. <dt><samp class="option">filter</samp></dt>
  56123. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  56124. </p>
  56125. <dl class="table">
  56126. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  56127. <dd><p>Simple filter coefficient set.
  56128. </p></dd>
  56129. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  56130. <dd><p>More-complex filter coefficient set.
  56131. </p></dd>
  56132. </dl>
  56133. <p>Default value is &lsquo;<samp class="samp">complex</samp>&rsquo;.
  56134. </p>
  56135. </dd>
  56136. <dt><samp class="option">mode</samp></dt>
  56137. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  56138. </p>
  56139. <dl class="table">
  56140. <dt><samp class="option">frame</samp></dt>
  56141. <dd><p>Output one frame for each frame.
  56142. </p></dd>
  56143. <dt><samp class="option">field</samp></dt>
  56144. <dd><p>Output one frame for each field.
  56145. </p></dd>
  56146. </dl>
  56147. <p>The default value is <code class="code">field</code>.
  56148. </p>
  56149. </dd>
  56150. <dt><samp class="option">parity</samp></dt>
  56151. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  56152. of the following values:
  56153. </p>
  56154. <dl class="table">
  56155. <dt><samp class="option">tff</samp></dt>
  56156. <dd><p>Assume the top field is first.
  56157. </p></dd>
  56158. <dt><samp class="option">bff</samp></dt>
  56159. <dd><p>Assume the bottom field is first.
  56160. </p></dd>
  56161. <dt><samp class="option">auto</samp></dt>
  56162. <dd><p>Enable automatic detection of field parity.
  56163. </p></dd>
  56164. </dl>
  56165. <p>The default value is <code class="code">auto</code>.
  56166. If the interlacing is unknown or the decoder does not export this information,
  56167. top field first will be assumed.
  56168. </p>
  56169. </dd>
  56170. <dt><samp class="option">deint</samp></dt>
  56171. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  56172. </p>
  56173. <dl class="table">
  56174. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  56175. <dd><p>Deinterlace all frames,
  56176. </p></dd>
  56177. <dt>&lsquo;<samp class="samp">interlaced</samp>&rsquo;</dt>
  56178. <dd><p>Only deinterlace frames marked as interlaced.
  56179. </p></dd>
  56180. </dl>
  56181. <p>Default value is &lsquo;<samp class="samp">all</samp>&rsquo;.
  56182. </p></dd>
  56183. </dl>
  56184. <ul class="mini-toc">
  56185. <li><a href="#Commands-153" accesskey="1">Commands</a></li>
  56186. </ul>
  56187. <div class="subsection-level-extent" id="Commands-153">
  56188. <h4 class="subsection"><span>39.285.1 Commands<a class="copiable-link" href="#Commands-153"> &para;</a></span></h4>
  56189. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  56190. </p>
  56191. </div>
  56192. </div>
  56193. <div class="section-level-extent" id="waveform">
  56194. <h3 class="section"><span>39.286 waveform<a class="copiable-link" href="#waveform"> &para;</a></span></h3>
  56195. <p>Video waveform monitor.
  56196. </p>
  56197. <p>The waveform monitor plots color component intensity. By default luma
  56198. only. Each column of the waveform corresponds to a column of pixels in the
  56199. source video.
  56200. </p>
  56201. <p>It accepts the following options:
  56202. </p>
  56203. <dl class="table">
  56204. <dt><samp class="option">mode, m</samp></dt>
  56205. <dd><p>Can be either <code class="code">row</code>, or <code class="code">column</code>. Default is <code class="code">column</code>.
  56206. In row mode, the graph on the left side represents color component value 0 and
  56207. the right side represents value = 255. In column mode, the top side represents
  56208. color component value = 0 and bottom side represents value = 255.
  56209. </p>
  56210. </dd>
  56211. <dt><samp class="option">intensity, i</samp></dt>
  56212. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  56213. luminance are distributed across input rows/columns.
  56214. Default value is <code class="code">0.04</code>. Allowed range is [0, 1].
  56215. </p>
  56216. </dd>
  56217. <dt><samp class="option">mirror, r</samp></dt>
  56218. <dd><p>Set mirroring mode. <code class="code">0</code> means unmirrored, <code class="code">1</code> means mirrored.
  56219. In mirrored mode, higher values will be represented on the left
  56220. side for <code class="code">row</code> mode and at the top for <code class="code">column</code> mode. Default is
  56221. <code class="code">1</code> (mirrored).
  56222. </p>
  56223. </dd>
  56224. <dt><samp class="option">display, d</samp></dt>
  56225. <dd><p>Set display mode.
  56226. It accepts the following values:
  56227. </p><dl class="table">
  56228. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  56229. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  56230. that the graphs representing color components are superimposed directly
  56231. over one another.
  56232. </p>
  56233. <p>This display mode makes it easier to spot relative differences or similarities
  56234. in overlapping areas of the color components that are supposed to be identical,
  56235. such as neutral whites, grays, or blacks.
  56236. </p>
  56237. </dd>
  56238. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  56239. <dd><p>Display separate graph for the color components side by side in
  56240. <code class="code">row</code> mode or one below the other in <code class="code">column</code> mode.
  56241. </p>
  56242. </dd>
  56243. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  56244. <dd><p>Display separate graph for the color components side by side in
  56245. <code class="code">column</code> mode or one below the other in <code class="code">row</code> mode.
  56246. </p>
  56247. <p>Using this display mode makes it easy to spot color casts in the highlights
  56248. and shadows of an image, by comparing the contours of the top and the bottom
  56249. graphs of each waveform. Since whites, grays, and blacks are characterized
  56250. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  56251. should display three waveforms of roughly equal width/height. If not, the
  56252. correction is easy to perform by making level adjustments the three waveforms.
  56253. </p></dd>
  56254. </dl>
  56255. <p>Default is <code class="code">stack</code>.
  56256. </p>
  56257. </dd>
  56258. <dt><samp class="option">components, c</samp></dt>
  56259. <dd><p>Set which color components to display. Default is 1, which means only luma
  56260. or red color component if input is in RGB colorspace. If is set for example to
  56261. 7 it will display all 3 (if) available color components.
  56262. </p>
  56263. </dd>
  56264. <dt><samp class="option">envelope, e</samp></dt>
  56265. <dd><dl class="table">
  56266. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  56267. <dd><p>No envelope, this is default.
  56268. </p>
  56269. </dd>
  56270. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  56271. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  56272. visible even with small <code class="code">step</code> value.
  56273. </p>
  56274. </dd>
  56275. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  56276. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  56277. can still spot out of range values without constantly looking at waveforms.
  56278. </p>
  56279. </dd>
  56280. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  56281. <dd><p>Peak and instant envelope combined together.
  56282. </p></dd>
  56283. </dl>
  56284. </dd>
  56285. <dt><samp class="option">filter, f</samp></dt>
  56286. <dd><dl class="table">
  56287. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  56288. <dd><p>No filtering, this is default.
  56289. </p>
  56290. </dd>
  56291. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  56292. <dd><p>Luma and chroma combined together.
  56293. </p>
  56294. </dd>
  56295. <dt>&lsquo;<samp class="samp">aflat</samp>&rsquo;</dt>
  56296. <dd><p>Similar as above, but shows difference between blue and red chroma.
  56297. </p>
  56298. </dd>
  56299. <dt>&lsquo;<samp class="samp">xflat</samp>&rsquo;</dt>
  56300. <dd><p>Similar as above, but use different colors.
  56301. </p>
  56302. </dd>
  56303. <dt>&lsquo;<samp class="samp">yflat</samp>&rsquo;</dt>
  56304. <dd><p>Similar as above, but again with different colors.
  56305. </p>
  56306. </dd>
  56307. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  56308. <dd><p>Displays only chroma.
  56309. </p>
  56310. </dd>
  56311. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  56312. <dd><p>Displays actual color value on waveform.
  56313. </p>
  56314. </dd>
  56315. <dt>&lsquo;<samp class="samp">acolor</samp>&rsquo;</dt>
  56316. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  56317. </p></dd>
  56318. </dl>
  56319. </dd>
  56320. <dt><samp class="option">graticule, g</samp></dt>
  56321. <dd><p>Set which graticule to display.
  56322. </p>
  56323. <dl class="table">
  56324. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  56325. <dd><p>Do not display graticule.
  56326. </p>
  56327. </dd>
  56328. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  56329. <dd><p>Display green graticule showing legal broadcast ranges.
  56330. </p>
  56331. </dd>
  56332. <dt>&lsquo;<samp class="samp">orange</samp>&rsquo;</dt>
  56333. <dd><p>Display orange graticule showing legal broadcast ranges.
  56334. </p>
  56335. </dd>
  56336. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  56337. <dd><p>Display invert graticule showing legal broadcast ranges.
  56338. </p></dd>
  56339. </dl>
  56340. </dd>
  56341. <dt><samp class="option">opacity, o</samp></dt>
  56342. <dd><p>Set graticule opacity.
  56343. </p>
  56344. </dd>
  56345. <dt><samp class="option">flags, fl</samp></dt>
  56346. <dd><p>Set graticule flags.
  56347. </p>
  56348. <dl class="table">
  56349. <dt>&lsquo;<samp class="samp">numbers</samp>&rsquo;</dt>
  56350. <dd><p>Draw numbers above lines. By default enabled.
  56351. </p>
  56352. </dd>
  56353. <dt>&lsquo;<samp class="samp">dots</samp>&rsquo;</dt>
  56354. <dd><p>Draw dots instead of lines.
  56355. </p></dd>
  56356. </dl>
  56357. </dd>
  56358. <dt><samp class="option">scale, s</samp></dt>
  56359. <dd><p>Set scale used for displaying graticule.
  56360. </p>
  56361. <dl class="table">
  56362. <dt>&lsquo;<samp class="samp">digital</samp>&rsquo;</dt>
  56363. <dt>&lsquo;<samp class="samp">millivolts</samp>&rsquo;</dt>
  56364. <dt>&lsquo;<samp class="samp">ire</samp>&rsquo;</dt>
  56365. </dl>
  56366. <p>Default is digital.
  56367. </p>
  56368. </dd>
  56369. <dt><samp class="option">bgopacity, b</samp></dt>
  56370. <dd><p>Set background opacity.
  56371. </p>
  56372. </dd>
  56373. <dt><samp class="option">tint0, t0</samp></dt>
  56374. <dt><samp class="option">tint1, t1</samp></dt>
  56375. <dd><p>Set tint for output.
  56376. Only used with lowpass filter and when display is not overlay and input
  56377. pixel formats are not RGB.
  56378. </p>
  56379. </dd>
  56380. <dt><samp class="option">fitmode, fm</samp></dt>
  56381. <dd><p>Set sample aspect ratio of video output frames.
  56382. Can be used to configure waveform so it is not
  56383. streched too much in one of directions.
  56384. </p>
  56385. <dl class="table">
  56386. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  56387. <dd><p>Set sample aspect ration to 1/1.
  56388. </p></dd>
  56389. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  56390. <dd><p>Set sample aspect ratio to match input size of video
  56391. </p></dd>
  56392. </dl>
  56393. <p>Default is &lsquo;<samp class="samp">none</samp>&rsquo;.
  56394. </p>
  56395. </dd>
  56396. <dt><samp class="option">input</samp></dt>
  56397. <dd><p>Set input formats for filter to pick from.
  56398. Can be &lsquo;<samp class="samp">all</samp>&rsquo;, for selecting from all available formats,
  56399. or &lsquo;<samp class="samp">first</samp>&rsquo;, for selecting first available format.
  56400. Default is &lsquo;<samp class="samp">first</samp>&rsquo;.
  56401. </p></dd>
  56402. </dl>
  56403. </div>
  56404. <div class="section-level-extent" id="weave_002c-doubleweave">
  56405. <h3 class="section"><span>39.287 weave, doubleweave<a class="copiable-link" href="#weave_002c-doubleweave"> &para;</a></span></h3>
  56406. <p>The <code class="code">weave</code> takes a field-based video input and join
  56407. each two sequential fields into single frame, producing a new double
  56408. height clip with half the frame rate and half the frame count.
  56409. </p>
  56410. <p>The <code class="code">doubleweave</code> works same as <code class="code">weave</code> but without
  56411. halving frame rate and frame count.
  56412. </p>
  56413. <p>It accepts the following option:
  56414. </p>
  56415. <dl class="table">
  56416. <dt><samp class="option">first_field</samp></dt>
  56417. <dd><p>Set first field. Available values are:
  56418. </p>
  56419. <dl class="table">
  56420. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  56421. <dd><p>Set the frame as top-field-first.
  56422. </p>
  56423. </dd>
  56424. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  56425. <dd><p>Set the frame as bottom-field-first.
  56426. </p></dd>
  56427. </dl>
  56428. </dd>
  56429. </dl>
  56430. <ul class="mini-toc">
  56431. <li><a href="#Examples-181" accesskey="1">Examples</a></li>
  56432. </ul>
  56433. <div class="subsection-level-extent" id="Examples-181">
  56434. <h4 class="subsection"><span>39.287.1 Examples<a class="copiable-link" href="#Examples-181"> &para;</a></span></h4>
  56435. <ul class="itemize mark-bullet">
  56436. <li>Interlace video using <a class="ref" href="#select">select</a> and <a class="ref" href="#separatefields">separatefields</a> filter:
  56437. <div class="example">
  56438. <pre class="example-preformatted">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  56439. </pre></div>
  56440. </li></ul>
  56441. </div>
  56442. </div>
  56443. <div class="section-level-extent" id="xbr">
  56444. <h3 class="section"><span>39.288 xbr<a class="copiable-link" href="#xbr"> &para;</a></span></h3>
  56445. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  56446. art. It follows a set of edge-detection rules, see
  56447. <a class="url" href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  56448. </p>
  56449. <p>It accepts the following option:
  56450. </p>
  56451. <dl class="table">
  56452. <dt><samp class="option">n</samp></dt>
  56453. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xBR</code>, <code class="code">3</code> for
  56454. <code class="code">3xBR</code> and <code class="code">4</code> for <code class="code">4xBR</code>.
  56455. Default is <code class="code">3</code>.
  56456. </p></dd>
  56457. </dl>
  56458. </div>
  56459. <div class="section-level-extent" id="xcorrelate">
  56460. <h3 class="section"><span>39.289 xcorrelate<a class="copiable-link" href="#xcorrelate"> &para;</a></span></h3>
  56461. <p>Apply normalized cross-correlation between first and second input video stream.
  56462. </p>
  56463. <p>Second input video stream dimensions must be lower than first input video stream.
  56464. </p>
  56465. <p>The filter accepts the following options:
  56466. </p>
  56467. <dl class="table">
  56468. <dt><samp class="option">planes</samp></dt>
  56469. <dd><p>Set which planes to process.
  56470. </p>
  56471. </dd>
  56472. <dt><samp class="option">secondary</samp></dt>
  56473. <dd><p>Set which secondary video frames will be processed from second input video stream,
  56474. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  56475. </p></dd>
  56476. </dl>
  56477. <p>The <code class="code">xcorrelate</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  56478. </p>
  56479. </div>
  56480. <div class="section-level-extent" id="xfade">
  56481. <h3 class="section"><span>39.290 xfade<a class="copiable-link" href="#xfade"> &para;</a></span></h3>
  56482. <p>Apply cross fade from one input video stream to another input video stream.
  56483. The cross fade is applied for specified duration.
  56484. </p>
  56485. <p>Both inputs must be constant frame-rate and have the same resolution, pixel format,
  56486. frame rate and timebase.
  56487. </p>
  56488. <p>The filter accepts the following options:
  56489. </p>
  56490. <dl class="table">
  56491. <dt><samp class="option">transition</samp></dt>
  56492. <dd><p>Set one of available transition effects:
  56493. </p>
  56494. <dl class="table">
  56495. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  56496. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  56497. <dt>&lsquo;<samp class="samp">wipeleft</samp>&rsquo;</dt>
  56498. <dt>&lsquo;<samp class="samp">wiperight</samp>&rsquo;</dt>
  56499. <dt>&lsquo;<samp class="samp">wipeup</samp>&rsquo;</dt>
  56500. <dt>&lsquo;<samp class="samp">wipedown</samp>&rsquo;</dt>
  56501. <dt>&lsquo;<samp class="samp">slideleft</samp>&rsquo;</dt>
  56502. <dt>&lsquo;<samp class="samp">slideright</samp>&rsquo;</dt>
  56503. <dt>&lsquo;<samp class="samp">slideup</samp>&rsquo;</dt>
  56504. <dt>&lsquo;<samp class="samp">slidedown</samp>&rsquo;</dt>
  56505. <dt>&lsquo;<samp class="samp">circlecrop</samp>&rsquo;</dt>
  56506. <dt>&lsquo;<samp class="samp">rectcrop</samp>&rsquo;</dt>
  56507. <dt>&lsquo;<samp class="samp">distance</samp>&rsquo;</dt>
  56508. <dt>&lsquo;<samp class="samp">fadeblack</samp>&rsquo;</dt>
  56509. <dt>&lsquo;<samp class="samp">fadewhite</samp>&rsquo;</dt>
  56510. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  56511. <dt>&lsquo;<samp class="samp">smoothleft</samp>&rsquo;</dt>
  56512. <dt>&lsquo;<samp class="samp">smoothright</samp>&rsquo;</dt>
  56513. <dt>&lsquo;<samp class="samp">smoothup</samp>&rsquo;</dt>
  56514. <dt>&lsquo;<samp class="samp">smoothdown</samp>&rsquo;</dt>
  56515. <dt>&lsquo;<samp class="samp">circleopen</samp>&rsquo;</dt>
  56516. <dt>&lsquo;<samp class="samp">circleclose</samp>&rsquo;</dt>
  56517. <dt>&lsquo;<samp class="samp">vertopen</samp>&rsquo;</dt>
  56518. <dt>&lsquo;<samp class="samp">vertclose</samp>&rsquo;</dt>
  56519. <dt>&lsquo;<samp class="samp">horzopen</samp>&rsquo;</dt>
  56520. <dt>&lsquo;<samp class="samp">horzclose</samp>&rsquo;</dt>
  56521. <dt>&lsquo;<samp class="samp">dissolve</samp>&rsquo;</dt>
  56522. <dt>&lsquo;<samp class="samp">pixelize</samp>&rsquo;</dt>
  56523. <dt>&lsquo;<samp class="samp">diagtl</samp>&rsquo;</dt>
  56524. <dt>&lsquo;<samp class="samp">diagtr</samp>&rsquo;</dt>
  56525. <dt>&lsquo;<samp class="samp">diagbl</samp>&rsquo;</dt>
  56526. <dt>&lsquo;<samp class="samp">diagbr</samp>&rsquo;</dt>
  56527. <dt>&lsquo;<samp class="samp">hlslice</samp>&rsquo;</dt>
  56528. <dt>&lsquo;<samp class="samp">hrslice</samp>&rsquo;</dt>
  56529. <dt>&lsquo;<samp class="samp">vuslice</samp>&rsquo;</dt>
  56530. <dt>&lsquo;<samp class="samp">vdslice</samp>&rsquo;</dt>
  56531. <dt>&lsquo;<samp class="samp">hblur</samp>&rsquo;</dt>
  56532. <dt>&lsquo;<samp class="samp">fadegrays</samp>&rsquo;</dt>
  56533. <dt>&lsquo;<samp class="samp">wipetl</samp>&rsquo;</dt>
  56534. <dt>&lsquo;<samp class="samp">wipetr</samp>&rsquo;</dt>
  56535. <dt>&lsquo;<samp class="samp">wipebl</samp>&rsquo;</dt>
  56536. <dt>&lsquo;<samp class="samp">wipebr</samp>&rsquo;</dt>
  56537. <dt>&lsquo;<samp class="samp">squeezeh</samp>&rsquo;</dt>
  56538. <dt>&lsquo;<samp class="samp">squeezev</samp>&rsquo;</dt>
  56539. <dt>&lsquo;<samp class="samp">zoomin</samp>&rsquo;</dt>
  56540. <dt>&lsquo;<samp class="samp">fadefast</samp>&rsquo;</dt>
  56541. <dt>&lsquo;<samp class="samp">fadeslow</samp>&rsquo;</dt>
  56542. <dt>&lsquo;<samp class="samp">hlwind</samp>&rsquo;</dt>
  56543. <dt>&lsquo;<samp class="samp">hrwind</samp>&rsquo;</dt>
  56544. <dt>&lsquo;<samp class="samp">vuwind</samp>&rsquo;</dt>
  56545. <dt>&lsquo;<samp class="samp">vdwind</samp>&rsquo;</dt>
  56546. <dt>&lsquo;<samp class="samp">coverleft</samp>&rsquo;</dt>
  56547. <dt>&lsquo;<samp class="samp">coverright</samp>&rsquo;</dt>
  56548. <dt>&lsquo;<samp class="samp">coverup</samp>&rsquo;</dt>
  56549. <dt>&lsquo;<samp class="samp">coverdown</samp>&rsquo;</dt>
  56550. <dt>&lsquo;<samp class="samp">revealleft</samp>&rsquo;</dt>
  56551. <dt>&lsquo;<samp class="samp">revealright</samp>&rsquo;</dt>
  56552. <dt>&lsquo;<samp class="samp">revealup</samp>&rsquo;</dt>
  56553. <dt>&lsquo;<samp class="samp">revealdown</samp>&rsquo;</dt>
  56554. </dl>
  56555. <p>Default transition effect is fade.
  56556. </p>
  56557. </dd>
  56558. <dt><samp class="option">duration</samp></dt>
  56559. <dd><p>Set cross fade duration in seconds.
  56560. Range is 0 to 60 seconds.
  56561. Default duration is 1 second.
  56562. </p>
  56563. </dd>
  56564. <dt><samp class="option">offset</samp></dt>
  56565. <dd><p>Set cross fade start relative to first input stream in seconds.
  56566. Default offset is 0.
  56567. </p>
  56568. </dd>
  56569. <dt><samp class="option">expr</samp></dt>
  56570. <dd><p>Set expression for custom transition effect.
  56571. </p>
  56572. <p>The expressions can use the following variables and functions:
  56573. </p>
  56574. <dl class="table">
  56575. <dt><samp class="option">X</samp></dt>
  56576. <dt><samp class="option">Y</samp></dt>
  56577. <dd><p>The coordinates of the current sample.
  56578. </p>
  56579. </dd>
  56580. <dt><samp class="option">W</samp></dt>
  56581. <dt><samp class="option">H</samp></dt>
  56582. <dd><p>The width and height of the image.
  56583. </p>
  56584. </dd>
  56585. <dt><samp class="option">P</samp></dt>
  56586. <dd><p>Progress of transition effect.
  56587. </p>
  56588. </dd>
  56589. <dt><samp class="option">PLANE</samp></dt>
  56590. <dd><p>Currently processed plane.
  56591. </p>
  56592. </dd>
  56593. <dt><samp class="option">A</samp></dt>
  56594. <dd><p>Return value of first input at current location and plane.
  56595. </p>
  56596. </dd>
  56597. <dt><samp class="option">B</samp></dt>
  56598. <dd><p>Return value of second input at current location and plane.
  56599. </p>
  56600. </dd>
  56601. <dt><samp class="option">a0(x, y)</samp></dt>
  56602. <dt><samp class="option">a1(x, y)</samp></dt>
  56603. <dt><samp class="option">a2(x, y)</samp></dt>
  56604. <dt><samp class="option">a3(x, y)</samp></dt>
  56605. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  56606. first/second/third/fourth component of first input.
  56607. </p>
  56608. </dd>
  56609. <dt><samp class="option">b0(x, y)</samp></dt>
  56610. <dt><samp class="option">b1(x, y)</samp></dt>
  56611. <dt><samp class="option">b2(x, y)</samp></dt>
  56612. <dt><samp class="option">b3(x, y)</samp></dt>
  56613. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  56614. first/second/third/fourth component of second input.
  56615. </p></dd>
  56616. </dl>
  56617. </dd>
  56618. </dl>
  56619. <ul class="mini-toc">
  56620. <li><a href="#Examples-182" accesskey="1">Examples</a></li>
  56621. </ul>
  56622. <div class="subsection-level-extent" id="Examples-182">
  56623. <h4 class="subsection"><span>39.290.1 Examples<a class="copiable-link" href="#Examples-182"> &para;</a></span></h4>
  56624. <ul class="itemize mark-bullet">
  56625. <li>Cross fade from one input video to another input video, with fade transition and duration of transition
  56626. of 2 seconds starting at offset of 5 seconds:
  56627. <div class="example">
  56628. <pre class="example-preformatted">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  56629. </pre></div>
  56630. </li></ul>
  56631. </div>
  56632. </div>
  56633. <div class="section-level-extent" id="xmedian">
  56634. <h3 class="section"><span>39.291 xmedian<a class="copiable-link" href="#xmedian"> &para;</a></span></h3>
  56635. <p>Pick median pixels from several input videos.
  56636. </p>
  56637. <p>The filter accepts the following options:
  56638. </p>
  56639. <dl class="table">
  56640. <dt><samp class="option">inputs</samp></dt>
  56641. <dd><p>Set number of inputs.
  56642. Default is 3. Allowed range is from 3 to 255.
  56643. If number of inputs is even number, than result will be mean value between two median values.
  56644. </p>
  56645. </dd>
  56646. <dt><samp class="option">planes</samp></dt>
  56647. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  56648. </p>
  56649. </dd>
  56650. <dt><samp class="option">percentile</samp></dt>
  56651. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  56652. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  56653. minimum values, and <code class="code">1</code> maximum values.
  56654. </p></dd>
  56655. </dl>
  56656. <ul class="mini-toc">
  56657. <li><a href="#Commands-154" accesskey="1">Commands</a></li>
  56658. </ul>
  56659. <div class="subsection-level-extent" id="Commands-154">
  56660. <h4 class="subsection"><span>39.291.1 Commands<a class="copiable-link" href="#Commands-154"> &para;</a></span></h4>
  56661. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">inputs</code>.
  56662. </p>
  56663. <a class="anchor" id="xstack"></a></div>
  56664. </div>
  56665. <div class="section-level-extent" id="xstack-1">
  56666. <h3 class="section"><span>39.292 xstack<a class="copiable-link" href="#xstack-1"> &para;</a></span></h3>
  56667. <p>Stack video inputs into custom layout.
  56668. </p>
  56669. <p>All streams must be of same pixel format.
  56670. </p>
  56671. <p>The filter accepts the following options:
  56672. </p>
  56673. <dl class="table">
  56674. <dt><samp class="option">inputs</samp></dt>
  56675. <dd><p>Set number of input streams. Default is 2.
  56676. </p>
  56677. </dd>
  56678. <dt><samp class="option">layout</samp></dt>
  56679. <dd><p>Specify layout of inputs.
  56680. This option requires the desired layout configuration to be explicitly set by the user.
  56681. This sets position of each video input in output. Each input
  56682. is separated by &rsquo;|&rsquo;.
  56683. The first number represents the column, and the second number represents the row.
  56684. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  56685. where X is video input from which to take width or height.
  56686. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  56687. case values are summed together.
  56688. </p>
  56689. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  56690. the output video frame will be filled. Similarly, videos can overlap each
  56691. other if their position doesn&rsquo;t leave enough space for the full frame of
  56692. adjoining videos.
  56693. </p>
  56694. <p>For 2 inputs, a default layout of <code class="code">0_0|w0_0</code> (equivalent to
  56695. <code class="code">grid=2x1</code>) is set. In all other cases, a layout or a grid must be set by
  56696. the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  56697. Specifying both will result in an error.
  56698. </p>
  56699. </dd>
  56700. <dt><samp class="option">grid</samp></dt>
  56701. <dd><p>Specify a fixed size grid of inputs.
  56702. This option is used to create a fixed size grid of the input streams. Set the
  56703. grid size in the form <code class="code">COLUMNSxROWS</code>. There must be <code class="code">ROWS * COLUMNS</code>
  56704. input streams and they will be arranged as a grid with <code class="code">ROWS</code> rows and
  56705. <code class="code">COLUMNS</code> columns. When using this option, each input stream within a row
  56706. must have the same height and all the rows must have the same width.
  56707. </p>
  56708. <p>If <code class="code">grid</code> is set, then <code class="code">inputs</code> option is ignored and is implicitly
  56709. set to <code class="code">ROWS * COLUMNS</code>.
  56710. </p>
  56711. <p>For 2 inputs, a default grid of <code class="code">2x1</code> (equivalent to
  56712. <code class="code">layout=0_0|w0_0</code>) is set. In all other cases, a layout or a grid must be
  56713. set by the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  56714. Specifying both will result in an error.
  56715. </p>
  56716. </dd>
  56717. <dt><samp class="option">shortest</samp></dt>
  56718. <dd><p>If set to 1, force the output to terminate when the shortest input
  56719. terminates. Default value is 0.
  56720. </p>
  56721. </dd>
  56722. <dt><samp class="option">fill</samp></dt>
  56723. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  56724. By default fill is set to none, so it is disabled.
  56725. </p></dd>
  56726. </dl>
  56727. <ul class="mini-toc">
  56728. <li><a href="#Examples-183" accesskey="1">Examples</a></li>
  56729. </ul>
  56730. <div class="subsection-level-extent" id="Examples-183">
  56731. <h4 class="subsection"><span>39.292.1 Examples<a class="copiable-link" href="#Examples-183"> &para;</a></span></h4>
  56732. <ul class="itemize mark-bullet">
  56733. <li>Display 4 inputs into 2x2 grid.
  56734. <p>Layout:
  56735. </p><div class="example">
  56736. <pre class="example-preformatted">input1(0, 0) | input3(w0, 0)
  56737. input2(0, h0) | input4(w0, h0)
  56738. </pre></div>
  56739. <div class="example">
  56740. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  56741. </pre></div>
  56742. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  56743. </p>
  56744. </li><li>Display 4 inputs into 1x4 grid.
  56745. <p>Layout:
  56746. </p><div class="example">
  56747. <pre class="example-preformatted">input1(0, 0)
  56748. input2(0, h0)
  56749. input3(0, h0+h1)
  56750. input4(0, h0+h1+h2)
  56751. </pre></div>
  56752. <div class="example">
  56753. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  56754. </pre></div>
  56755. <p>Note that if inputs are of different widths, unused space will appear.
  56756. </p>
  56757. </li><li>Display 9 inputs into 3x3 grid.
  56758. <p>Layout:
  56759. </p><div class="example">
  56760. <pre class="example-preformatted">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  56761. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  56762. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  56763. </pre></div>
  56764. <div class="example">
  56765. <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
  56766. </pre></div>
  56767. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  56768. </p>
  56769. </li><li>Display 16 inputs into 4x4 grid.
  56770. <p>Layout:
  56771. </p><div class="example">
  56772. <pre class="example-preformatted">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  56773. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  56774. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  56775. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  56776. </pre></div>
  56777. <div class="example">
  56778. <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|
  56779. 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
  56780. </pre></div>
  56781. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  56782. </p>
  56783. </li></ul>
  56784. <a class="anchor" id="yadif"></a></div>
  56785. </div>
  56786. <div class="section-level-extent" id="yadif-1">
  56787. <h3 class="section"><span>39.293 yadif<a class="copiable-link" href="#yadif-1"> &para;</a></span></h3>
  56788. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  56789. filter&quot;).
  56790. </p>
  56791. <p>It accepts the following parameters:
  56792. </p>
  56793. <dl class="table">
  56794. <dt><samp class="option">mode</samp></dt>
  56795. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  56796. </p>
  56797. <dl class="table">
  56798. <dt><samp class="option">0, send_frame</samp></dt>
  56799. <dd><p>Output one frame for each frame.
  56800. </p></dd>
  56801. <dt><samp class="option">1, send_field</samp></dt>
  56802. <dd><p>Output one frame for each field.
  56803. </p></dd>
  56804. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  56805. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  56806. </p></dd>
  56807. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  56808. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  56809. </p></dd>
  56810. </dl>
  56811. <p>The default value is <code class="code">send_frame</code>.
  56812. </p>
  56813. </dd>
  56814. <dt><samp class="option">parity</samp></dt>
  56815. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  56816. of the following values:
  56817. </p>
  56818. <dl class="table">
  56819. <dt><samp class="option">0, tff</samp></dt>
  56820. <dd><p>Assume the top field is first.
  56821. </p></dd>
  56822. <dt><samp class="option">1, bff</samp></dt>
  56823. <dd><p>Assume the bottom field is first.
  56824. </p></dd>
  56825. <dt><samp class="option">-1, auto</samp></dt>
  56826. <dd><p>Enable automatic detection of field parity.
  56827. </p></dd>
  56828. </dl>
  56829. <p>The default value is <code class="code">auto</code>.
  56830. If the interlacing is unknown or the decoder does not export this information,
  56831. top field first will be assumed.
  56832. </p>
  56833. </dd>
  56834. <dt><samp class="option">deint</samp></dt>
  56835. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  56836. values:
  56837. </p>
  56838. <dl class="table">
  56839. <dt><samp class="option">0, all</samp></dt>
  56840. <dd><p>Deinterlace all frames.
  56841. </p></dd>
  56842. <dt><samp class="option">1, interlaced</samp></dt>
  56843. <dd><p>Only deinterlace frames marked as interlaced.
  56844. </p></dd>
  56845. </dl>
  56846. <p>The default value is <code class="code">all</code>.
  56847. </p></dd>
  56848. </dl>
  56849. </div>
  56850. <div class="section-level-extent" id="yadif_005fcuda">
  56851. <h3 class="section"><span>39.294 yadif_cuda<a class="copiable-link" href="#yadif_005fcuda"> &para;</a></span></h3>
  56852. <p>Deinterlace the input video using the <a class="ref" href="#yadif">yadif</a> algorithm, but implemented
  56853. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  56854. and/or nvenc.
  56855. </p>
  56856. <p>It accepts the following parameters:
  56857. </p>
  56858. <dl class="table">
  56859. <dt><samp class="option">mode</samp></dt>
  56860. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  56861. </p>
  56862. <dl class="table">
  56863. <dt><samp class="option">0, send_frame</samp></dt>
  56864. <dd><p>Output one frame for each frame.
  56865. </p></dd>
  56866. <dt><samp class="option">1, send_field</samp></dt>
  56867. <dd><p>Output one frame for each field.
  56868. </p></dd>
  56869. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  56870. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  56871. </p></dd>
  56872. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  56873. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  56874. </p></dd>
  56875. </dl>
  56876. <p>The default value is <code class="code">send_frame</code>.
  56877. </p>
  56878. </dd>
  56879. <dt><samp class="option">parity</samp></dt>
  56880. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  56881. of the following values:
  56882. </p>
  56883. <dl class="table">
  56884. <dt><samp class="option">0, tff</samp></dt>
  56885. <dd><p>Assume the top field is first.
  56886. </p></dd>
  56887. <dt><samp class="option">1, bff</samp></dt>
  56888. <dd><p>Assume the bottom field is first.
  56889. </p></dd>
  56890. <dt><samp class="option">-1, auto</samp></dt>
  56891. <dd><p>Enable automatic detection of field parity.
  56892. </p></dd>
  56893. </dl>
  56894. <p>The default value is <code class="code">auto</code>.
  56895. If the interlacing is unknown or the decoder does not export this information,
  56896. top field first will be assumed.
  56897. </p>
  56898. </dd>
  56899. <dt><samp class="option">deint</samp></dt>
  56900. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  56901. values:
  56902. </p>
  56903. <dl class="table">
  56904. <dt><samp class="option">0, all</samp></dt>
  56905. <dd><p>Deinterlace all frames.
  56906. </p></dd>
  56907. <dt><samp class="option">1, interlaced</samp></dt>
  56908. <dd><p>Only deinterlace frames marked as interlaced.
  56909. </p></dd>
  56910. </dl>
  56911. <p>The default value is <code class="code">all</code>.
  56912. </p></dd>
  56913. </dl>
  56914. </div>
  56915. <div class="section-level-extent" id="yaepblur">
  56916. <h3 class="section"><span>39.295 yaepblur<a class="copiable-link" href="#yaepblur"> &para;</a></span></h3>
  56917. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  56918. The algorithm is described in
  56919. &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;
  56920. </p>
  56921. <p>It accepts the following parameters:
  56922. </p>
  56923. <dl class="table">
  56924. <dt><samp class="option">radius, r</samp></dt>
  56925. <dd><p>Set the window radius. Default value is 3.
  56926. </p>
  56927. </dd>
  56928. <dt><samp class="option">planes, p</samp></dt>
  56929. <dd><p>Set which planes to filter. Default is only the first plane.
  56930. </p>
  56931. </dd>
  56932. <dt><samp class="option">sigma, s</samp></dt>
  56933. <dd><p>Set blur strength. Default value is 128.
  56934. </p></dd>
  56935. </dl>
  56936. <ul class="mini-toc">
  56937. <li><a href="#Commands-155" accesskey="1">Commands</a></li>
  56938. </ul>
  56939. <div class="subsection-level-extent" id="Commands-155">
  56940. <h4 class="subsection"><span>39.295.1 Commands<a class="copiable-link" href="#Commands-155"> &para;</a></span></h4>
  56941. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  56942. </p>
  56943. </div>
  56944. </div>
  56945. <div class="section-level-extent" id="zoompan">
  56946. <h3 class="section"><span>39.296 zoompan<a class="copiable-link" href="#zoompan"> &para;</a></span></h3>
  56947. <p>Apply Zoom &amp; Pan effect.
  56948. </p>
  56949. <p>This filter accepts the following options:
  56950. </p>
  56951. <dl class="table">
  56952. <dt><samp class="option">zoom, z</samp></dt>
  56953. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  56954. </p>
  56955. </dd>
  56956. <dt><samp class="option">x</samp></dt>
  56957. <dt><samp class="option">y</samp></dt>
  56958. <dd><p>Set the x and y expression. Default is 0.
  56959. </p>
  56960. </dd>
  56961. <dt><samp class="option">d</samp></dt>
  56962. <dd><p>Set the duration expression in number of frames.
  56963. This sets for how many number of frames effect will last for
  56964. single input image. Default is 90.
  56965. </p>
  56966. </dd>
  56967. <dt><samp class="option">s</samp></dt>
  56968. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  56969. </p>
  56970. </dd>
  56971. <dt><samp class="option">fps</samp></dt>
  56972. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  56973. </p></dd>
  56974. </dl>
  56975. <p>Each expression can contain the following constants:
  56976. </p>
  56977. <dl class="table">
  56978. <dt><samp class="option">in_w, iw</samp></dt>
  56979. <dd><p>Input width.
  56980. </p>
  56981. </dd>
  56982. <dt><samp class="option">in_h, ih</samp></dt>
  56983. <dd><p>Input height.
  56984. </p>
  56985. </dd>
  56986. <dt><samp class="option">out_w, ow</samp></dt>
  56987. <dd><p>Output width.
  56988. </p>
  56989. </dd>
  56990. <dt><samp class="option">out_h, oh</samp></dt>
  56991. <dd><p>Output height.
  56992. </p>
  56993. </dd>
  56994. <dt><samp class="option">in</samp></dt>
  56995. <dd><p>Input frame count.
  56996. </p>
  56997. </dd>
  56998. <dt><samp class="option">on</samp></dt>
  56999. <dd><p>Output frame count.
  57000. </p>
  57001. </dd>
  57002. <dt><samp class="option">in_time, it</samp></dt>
  57003. <dd><p>The input timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  57004. </p>
  57005. </dd>
  57006. <dt><samp class="option">out_time, time, ot</samp></dt>
  57007. <dd><p>The output timestamp expressed in seconds.
  57008. </p>
  57009. </dd>
  57010. <dt><samp class="option">x</samp></dt>
  57011. <dt><samp class="option">y</samp></dt>
  57012. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  57013. for current input frame.
  57014. </p>
  57015. </dd>
  57016. <dt><samp class="option">px</samp></dt>
  57017. <dt><samp class="option">py</samp></dt>
  57018. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  57019. not yet such frame (first input frame).
  57020. </p>
  57021. </dd>
  57022. <dt><samp class="option">zoom</samp></dt>
  57023. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  57024. </p>
  57025. </dd>
  57026. <dt><samp class="option">pzoom</samp></dt>
  57027. <dd><p>Last calculated zoom of last output frame of previous input frame.
  57028. </p>
  57029. </dd>
  57030. <dt><samp class="option">duration</samp></dt>
  57031. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  57032. for each input frame.
  57033. </p>
  57034. </dd>
  57035. <dt><samp class="option">pduration</samp></dt>
  57036. <dd><p>number of output frames created for previous input frame
  57037. </p>
  57038. </dd>
  57039. <dt><samp class="option">a</samp></dt>
  57040. <dd><p>Rational number: input width / input height
  57041. </p>
  57042. </dd>
  57043. <dt><samp class="option">sar</samp></dt>
  57044. <dd><p>sample aspect ratio
  57045. </p>
  57046. </dd>
  57047. <dt><samp class="option">dar</samp></dt>
  57048. <dd><p>display aspect ratio
  57049. </p>
  57050. </dd>
  57051. </dl>
  57052. <ul class="mini-toc">
  57053. <li><a href="#Examples-184" accesskey="1">Examples</a></li>
  57054. </ul>
  57055. <div class="subsection-level-extent" id="Examples-184">
  57056. <h4 class="subsection"><span>39.296.1 Examples<a class="copiable-link" href="#Examples-184"> &para;</a></span></h4>
  57057. <ul class="itemize mark-bullet">
  57058. <li>Zoom in up to 1.5x and pan at same time to some spot near center of picture:
  57059. <div class="example">
  57060. <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
  57061. </pre></div>
  57062. </li><li>Zoom in up to 1.5x and pan always at center of picture:
  57063. <div class="example">
  57064. <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)'
  57065. </pre></div>
  57066. </li><li>Same as above but without pausing:
  57067. <div class="example">
  57068. <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)'
  57069. </pre></div>
  57070. </li><li>Zoom in 2x into center of picture only for the first second of the input video:
  57071. <div class="example">
  57072. <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)'
  57073. </pre></div>
  57074. </li></ul>
  57075. <a class="anchor" id="zscale"></a></div>
  57076. </div>
  57077. <div class="section-level-extent" id="zscale-1">
  57078. <h3 class="section"><span>39.297 zscale<a class="copiable-link" href="#zscale-1"> &para;</a></span></h3>
  57079. <p>Scale (resize) the input video, using the z.lib library:
  57080. <a class="url" href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  57081. filter, you need to configure FFmpeg with <code class="code">--enable-libzimg</code>.
  57082. </p>
  57083. <p>The zscale filter forces the output display aspect ratio to be the same
  57084. as the input, by changing the output sample aspect ratio.
  57085. </p>
  57086. <p>If the input image format is different from the format requested by
  57087. the next filter, the zscale filter will convert the input to the
  57088. requested format.
  57089. </p>
  57090. <ul class="mini-toc">
  57091. <li><a href="#Options-116" accesskey="1">Options</a></li>
  57092. <li><a href="#Commands-156" accesskey="2">Commands</a></li>
  57093. </ul>
  57094. <div class="subsection-level-extent" id="Options-116">
  57095. <h4 class="subsection"><span>39.297.1 Options<a class="copiable-link" href="#Options-116"> &para;</a></span></h4>
  57096. <p>The filter accepts the following options.
  57097. </p>
  57098. <dl class="table">
  57099. <dt><samp class="option">width, w</samp></dt>
  57100. <dt><samp class="option">height, h</samp></dt>
  57101. <dd><p>Set the output video dimension expression. Default value is the input
  57102. dimension.
  57103. </p>
  57104. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  57105. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  57106. is used for the output.
  57107. </p>
  57108. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  57109. will use a value that maintains the aspect ratio of the input image,
  57110. calculated from the other specified dimension. After that it will,
  57111. however, make sure that the calculated dimension is divisible by n and
  57112. adjust the value if necessary.
  57113. </p>
  57114. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  57115. both values being set to 0 as previously detailed.
  57116. </p>
  57117. <p>See below for the list of accepted constants for use in the dimension
  57118. expression.
  57119. </p>
  57120. </dd>
  57121. <dt><samp class="option">size, s</samp></dt>
  57122. <dd><p>Set the video size. For the syntax of this option, check the
  57123. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  57124. </p>
  57125. </dd>
  57126. <dt><samp class="option">dither, d</samp></dt>
  57127. <dd><p>Set the dither type.
  57128. </p>
  57129. <p>Possible values are:
  57130. </p><dl class="table">
  57131. <dt><var class="var">none</var></dt>
  57132. <dt><var class="var">ordered</var></dt>
  57133. <dt><var class="var">random</var></dt>
  57134. <dt><var class="var">error_diffusion</var></dt>
  57135. </dl>
  57136. <p>Default is none.
  57137. </p>
  57138. </dd>
  57139. <dt><samp class="option">filter, f</samp></dt>
  57140. <dd><p>Set the resize filter type.
  57141. </p>
  57142. <p>Possible values are:
  57143. </p><dl class="table">
  57144. <dt><var class="var">point</var></dt>
  57145. <dt><var class="var">bilinear</var></dt>
  57146. <dt><var class="var">bicubic</var></dt>
  57147. <dt><var class="var">spline16</var></dt>
  57148. <dt><var class="var">spline36</var></dt>
  57149. <dt><var class="var">lanczos</var></dt>
  57150. </dl>
  57151. <p>Default is bilinear.
  57152. </p>
  57153. </dd>
  57154. <dt><samp class="option">range, r</samp></dt>
  57155. <dd><p>Set the color range.
  57156. </p>
  57157. <p>Possible values are:
  57158. </p><dl class="table">
  57159. <dt><var class="var">input</var></dt>
  57160. <dt><var class="var">limited</var></dt>
  57161. <dt><var class="var">full</var></dt>
  57162. </dl>
  57163. <p>Default is same as input.
  57164. </p>
  57165. </dd>
  57166. <dt><samp class="option">primaries, p</samp></dt>
  57167. <dd><p>Set the color primaries.
  57168. </p>
  57169. <p>Possible values are:
  57170. </p><dl class="table">
  57171. <dt><var class="var">input</var></dt>
  57172. <dt><var class="var">709</var></dt>
  57173. <dt><var class="var">unspecified</var></dt>
  57174. <dt><var class="var">170m</var></dt>
  57175. <dt><var class="var">240m</var></dt>
  57176. <dt><var class="var">2020</var></dt>
  57177. </dl>
  57178. <p>Default is same as input.
  57179. </p>
  57180. </dd>
  57181. <dt><samp class="option">transfer, t</samp></dt>
  57182. <dd><p>Set the transfer characteristics.
  57183. </p>
  57184. <p>Possible values are:
  57185. </p><dl class="table">
  57186. <dt><var class="var">input</var></dt>
  57187. <dt><var class="var">709</var></dt>
  57188. <dt><var class="var">unspecified</var></dt>
  57189. <dt><var class="var">601</var></dt>
  57190. <dt><var class="var">linear</var></dt>
  57191. <dt><var class="var">2020_10</var></dt>
  57192. <dt><var class="var">2020_12</var></dt>
  57193. <dt><var class="var">smpte2084</var></dt>
  57194. <dt><var class="var">iec61966-2-1</var></dt>
  57195. <dt><var class="var">arib-std-b67</var></dt>
  57196. </dl>
  57197. <p>Default is same as input.
  57198. </p>
  57199. </dd>
  57200. <dt><samp class="option">matrix, m</samp></dt>
  57201. <dd><p>Set the colorspace matrix.
  57202. </p>
  57203. <p>Possible value are:
  57204. </p><dl class="table">
  57205. <dt><var class="var">input</var></dt>
  57206. <dt><var class="var">709</var></dt>
  57207. <dt><var class="var">unspecified</var></dt>
  57208. <dt><var class="var">470bg</var></dt>
  57209. <dt><var class="var">170m</var></dt>
  57210. <dt><var class="var">2020_ncl</var></dt>
  57211. <dt><var class="var">2020_cl</var></dt>
  57212. </dl>
  57213. <p>Default is same as input.
  57214. </p>
  57215. </dd>
  57216. <dt><samp class="option">rangein, rin</samp></dt>
  57217. <dd><p>Set the input color range.
  57218. </p>
  57219. <p>Possible values are:
  57220. </p><dl class="table">
  57221. <dt><var class="var">input</var></dt>
  57222. <dt><var class="var">limited</var></dt>
  57223. <dt><var class="var">full</var></dt>
  57224. </dl>
  57225. <p>Default is same as input.
  57226. </p>
  57227. </dd>
  57228. <dt><samp class="option">primariesin, pin</samp></dt>
  57229. <dd><p>Set the input color primaries.
  57230. </p>
  57231. <p>Possible values are:
  57232. </p><dl class="table">
  57233. <dt><var class="var">input</var></dt>
  57234. <dt><var class="var">709</var></dt>
  57235. <dt><var class="var">unspecified</var></dt>
  57236. <dt><var class="var">170m</var></dt>
  57237. <dt><var class="var">240m</var></dt>
  57238. <dt><var class="var">2020</var></dt>
  57239. </dl>
  57240. <p>Default is same as input.
  57241. </p>
  57242. </dd>
  57243. <dt><samp class="option">transferin, tin</samp></dt>
  57244. <dd><p>Set the input transfer characteristics.
  57245. </p>
  57246. <p>Possible values are:
  57247. </p><dl class="table">
  57248. <dt><var class="var">input</var></dt>
  57249. <dt><var class="var">709</var></dt>
  57250. <dt><var class="var">unspecified</var></dt>
  57251. <dt><var class="var">601</var></dt>
  57252. <dt><var class="var">linear</var></dt>
  57253. <dt><var class="var">2020_10</var></dt>
  57254. <dt><var class="var">2020_12</var></dt>
  57255. </dl>
  57256. <p>Default is same as input.
  57257. </p>
  57258. </dd>
  57259. <dt><samp class="option">matrixin, min</samp></dt>
  57260. <dd><p>Set the input colorspace matrix.
  57261. </p>
  57262. <p>Possible value are:
  57263. </p><dl class="table">
  57264. <dt><var class="var">input</var></dt>
  57265. <dt><var class="var">709</var></dt>
  57266. <dt><var class="var">unspecified</var></dt>
  57267. <dt><var class="var">470bg</var></dt>
  57268. <dt><var class="var">170m</var></dt>
  57269. <dt><var class="var">2020_ncl</var></dt>
  57270. <dt><var class="var">2020_cl</var></dt>
  57271. </dl>
  57272. </dd>
  57273. <dt><samp class="option">chromal, c</samp></dt>
  57274. <dd><p>Set the output chroma location.
  57275. </p>
  57276. <p>Possible values are:
  57277. </p><dl class="table">
  57278. <dt><var class="var">input</var></dt>
  57279. <dt><var class="var">left</var></dt>
  57280. <dt><var class="var">center</var></dt>
  57281. <dt><var class="var">topleft</var></dt>
  57282. <dt><var class="var">top</var></dt>
  57283. <dt><var class="var">bottomleft</var></dt>
  57284. <dt><var class="var">bottom</var></dt>
  57285. </dl>
  57286. </dd>
  57287. <dt><samp class="option">chromalin, cin</samp></dt>
  57288. <dd><p>Set the input chroma location.
  57289. </p>
  57290. <p>Possible values are:
  57291. </p><dl class="table">
  57292. <dt><var class="var">input</var></dt>
  57293. <dt><var class="var">left</var></dt>
  57294. <dt><var class="var">center</var></dt>
  57295. <dt><var class="var">topleft</var></dt>
  57296. <dt><var class="var">top</var></dt>
  57297. <dt><var class="var">bottomleft</var></dt>
  57298. <dt><var class="var">bottom</var></dt>
  57299. </dl>
  57300. </dd>
  57301. <dt><samp class="option">npl</samp></dt>
  57302. <dd><p>Set the nominal peak luminance.
  57303. </p>
  57304. </dd>
  57305. <dt><samp class="option">param_a</samp></dt>
  57306. <dd><p>Parameter A for scaling filters. Parameter &quot;b&quot; for bicubic, and the number of
  57307. filter taps for lanczos.
  57308. </p>
  57309. </dd>
  57310. <dt><samp class="option">param_b</samp></dt>
  57311. <dd><p>Parameter B for scaling filters. Parameter &quot;c&quot; for bicubic.
  57312. </p></dd>
  57313. </dl>
  57314. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  57315. containing the following constants:
  57316. </p>
  57317. <dl class="table">
  57318. <dt><var class="var">in_w</var></dt>
  57319. <dt><var class="var">in_h</var></dt>
  57320. <dd><p>The input width and height
  57321. </p>
  57322. </dd>
  57323. <dt><var class="var">iw</var></dt>
  57324. <dt><var class="var">ih</var></dt>
  57325. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  57326. </p>
  57327. </dd>
  57328. <dt><var class="var">out_w</var></dt>
  57329. <dt><var class="var">out_h</var></dt>
  57330. <dd><p>The output (scaled) width and height
  57331. </p>
  57332. </dd>
  57333. <dt><var class="var">ow</var></dt>
  57334. <dt><var class="var">oh</var></dt>
  57335. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  57336. </p>
  57337. </dd>
  57338. <dt><var class="var">a</var></dt>
  57339. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  57340. </p>
  57341. </dd>
  57342. <dt><var class="var">sar</var></dt>
  57343. <dd><p>input sample aspect ratio
  57344. </p>
  57345. </dd>
  57346. <dt><var class="var">dar</var></dt>
  57347. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  57348. </p>
  57349. </dd>
  57350. <dt><var class="var">hsub</var></dt>
  57351. <dt><var class="var">vsub</var></dt>
  57352. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  57353. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  57354. </p>
  57355. </dd>
  57356. <dt><var class="var">ohsub</var></dt>
  57357. <dt><var class="var">ovsub</var></dt>
  57358. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  57359. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  57360. </p></dd>
  57361. </dl>
  57362. </div>
  57363. <div class="subsection-level-extent" id="Commands-156">
  57364. <h4 class="subsection"><span>39.297.2 Commands<a class="copiable-link" href="#Commands-156"> &para;</a></span></h4>
  57365. <p>This filter supports the following commands:
  57366. </p><dl class="table">
  57367. <dt><samp class="option">width, w</samp></dt>
  57368. <dt><samp class="option">height, h</samp></dt>
  57369. <dd><p>Set the output video dimension expression.
  57370. The command accepts the same syntax of the corresponding option.
  57371. </p>
  57372. <p>If the specified expression is not valid, it is kept at its current
  57373. value.
  57374. </p></dd>
  57375. </dl>
  57376. </div>
  57377. </div>
  57378. </div>
  57379. <div class="chapter-level-extent" id="OpenCL-Video-Filters">
  57380. <h2 class="chapter"><span>40 OpenCL Video Filters<a class="copiable-link" href="#OpenCL-Video-Filters"> &para;</a></span></h2>
  57381. <p>Below is a description of the currently available OpenCL video filters.
  57382. </p>
  57383. <p>To enable compilation of these filters you need to configure FFmpeg with
  57384. <code class="code">--enable-opencl</code>.
  57385. </p>
  57386. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  57387. </p><dl class="table">
  57388. <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>
  57389. <dd><p>Initialise a new hardware device of type <var class="var">opencl</var> called <var class="var">name</var>, using the
  57390. given device parameters.
  57391. </p>
  57392. </dd>
  57393. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  57394. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  57395. </p>
  57396. </dd>
  57397. </dl>
  57398. <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>
  57399. </p>
  57400. <ul class="itemize mark-bullet">
  57401. <li>Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  57402. <div class="example">
  57403. <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
  57404. </pre></div>
  57405. </li></ul>
  57406. <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.
  57407. </p>
  57408. <ul class="mini-toc">
  57409. <li><a href="#avgblur_005fopencl" accesskey="1">avgblur_opencl</a></li>
  57410. <li><a href="#boxblur_005fopencl" accesskey="2">boxblur_opencl</a></li>
  57411. <li><a href="#colorkey_005fopencl" accesskey="3">colorkey_opencl</a></li>
  57412. <li><a href="#convolution_005fopencl" accesskey="4">convolution_opencl</a></li>
  57413. <li><a href="#erosion_005fopencl" accesskey="5">erosion_opencl</a></li>
  57414. <li><a href="#deshake_005fopencl" accesskey="6">deshake_opencl</a></li>
  57415. <li><a href="#dilation_005fopencl" accesskey="7">dilation_opencl</a></li>
  57416. <li><a href="#nlmeans_005fopencl-1" accesskey="8">nlmeans_opencl</a></li>
  57417. <li><a href="#overlay_005fopencl" accesskey="9">overlay_opencl</a></li>
  57418. <li><a href="#pad_005fopencl">pad_opencl</a></li>
  57419. <li><a href="#prewitt_005fopencl">prewitt_opencl</a></li>
  57420. <li><a href="#program_005fopencl-1">program_opencl</a></li>
  57421. <li><a href="#remap_005fopencl">remap_opencl</a></li>
  57422. <li><a href="#roberts_005fopencl">roberts_opencl</a></li>
  57423. <li><a href="#sobel_005fopencl">sobel_opencl</a></li>
  57424. <li><a href="#tonemap_005fopencl">tonemap_opencl</a></li>
  57425. <li><a href="#unsharp_005fopencl">unsharp_opencl</a></li>
  57426. <li><a href="#xfade_005fopencl">xfade_opencl</a></li>
  57427. </ul>
  57428. <div class="section-level-extent" id="avgblur_005fopencl">
  57429. <h3 class="section"><span>40.1 avgblur_opencl<a class="copiable-link" href="#avgblur_005fopencl"> &para;</a></span></h3>
  57430. <p>Apply average blur filter.
  57431. </p>
  57432. <p>The filter accepts the following options:
  57433. </p>
  57434. <dl class="table">
  57435. <dt><samp class="option">sizeX</samp></dt>
  57436. <dd><p>Set horizontal radius size.
  57437. Range is <code class="code">[1, 1024]</code> and default value is <code class="code">1</code>.
  57438. </p>
  57439. </dd>
  57440. <dt><samp class="option">planes</samp></dt>
  57441. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  57442. </p>
  57443. </dd>
  57444. <dt><samp class="option">sizeY</samp></dt>
  57445. <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.
  57446. </p></dd>
  57447. </dl>
  57448. <ul class="mini-toc">
  57449. <li><a href="#Example-11" accesskey="1">Example</a></li>
  57450. </ul>
  57451. <div class="subsection-level-extent" id="Example-11">
  57452. <h4 class="subsection"><span>40.1.1 Example<a class="copiable-link" href="#Example-11"> &para;</a></span></h4>
  57453. <ul class="itemize mark-bullet">
  57454. <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.
  57455. <div class="example">
  57456. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  57457. </pre></div>
  57458. </li></ul>
  57459. </div>
  57460. </div>
  57461. <div class="section-level-extent" id="boxblur_005fopencl">
  57462. <h3 class="section"><span>40.2 boxblur_opencl<a class="copiable-link" href="#boxblur_005fopencl"> &para;</a></span></h3>
  57463. <p>Apply a boxblur algorithm to the input video.
  57464. </p>
  57465. <p>It accepts the following parameters:
  57466. </p>
  57467. <dl class="table">
  57468. <dt><samp class="option">luma_radius, lr</samp></dt>
  57469. <dt><samp class="option">luma_power, lp</samp></dt>
  57470. <dt><samp class="option">chroma_radius, cr</samp></dt>
  57471. <dt><samp class="option">chroma_power, cp</samp></dt>
  57472. <dt><samp class="option">alpha_radius, ar</samp></dt>
  57473. <dt><samp class="option">alpha_power, ap</samp></dt>
  57474. </dl>
  57475. <p>A description of the accepted options follows.
  57476. </p>
  57477. <dl class="table">
  57478. <dt><samp class="option">luma_radius, lr</samp></dt>
  57479. <dt><samp class="option">chroma_radius, cr</samp></dt>
  57480. <dt><samp class="option">alpha_radius, ar</samp></dt>
  57481. <dd><p>Set an expression for the box radius in pixels used for blurring the
  57482. corresponding input plane.
  57483. </p>
  57484. <p>The radius value must be a non-negative number, and must not be
  57485. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  57486. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  57487. planes.
  57488. </p>
  57489. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  57490. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  57491. corresponding value set for <samp class="option">luma_radius</samp>.
  57492. </p>
  57493. <p>The expressions can contain the following constants:
  57494. </p><dl class="table">
  57495. <dt><samp class="option">w</samp></dt>
  57496. <dt><samp class="option">h</samp></dt>
  57497. <dd><p>The input width and height in pixels.
  57498. </p>
  57499. </dd>
  57500. <dt><samp class="option">cw</samp></dt>
  57501. <dt><samp class="option">ch</samp></dt>
  57502. <dd><p>The input chroma image width and height in pixels.
  57503. </p>
  57504. </dd>
  57505. <dt><samp class="option">hsub</samp></dt>
  57506. <dt><samp class="option">vsub</samp></dt>
  57507. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  57508. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  57509. </p></dd>
  57510. </dl>
  57511. </dd>
  57512. <dt><samp class="option">luma_power, lp</samp></dt>
  57513. <dt><samp class="option">chroma_power, cp</samp></dt>
  57514. <dt><samp class="option">alpha_power, ap</samp></dt>
  57515. <dd><p>Specify how many times the boxblur filter is applied to the
  57516. corresponding plane.
  57517. </p>
  57518. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  57519. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  57520. corresponding value set for <samp class="option">luma_power</samp>.
  57521. </p>
  57522. <p>A value of 0 will disable the effect.
  57523. </p></dd>
  57524. </dl>
  57525. <ul class="mini-toc">
  57526. <li><a href="#Examples-185" accesskey="1">Examples</a></li>
  57527. </ul>
  57528. <div class="subsection-level-extent" id="Examples-185">
  57529. <h4 class="subsection"><span>40.2.1 Examples<a class="copiable-link" href="#Examples-185"> &para;</a></span></h4>
  57530. <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.
  57531. </p>
  57532. <ul class="itemize mark-bullet">
  57533. <li>Apply a boxblur filter with the luma, chroma, and alpha radius
  57534. 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.
  57535. <div class="example">
  57536. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  57537. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  57538. </pre></div>
  57539. </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.
  57540. <p>For the luma plane, a 2x2 box radius will be run once.
  57541. </p>
  57542. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  57543. </p>
  57544. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  57545. </p><div class="example">
  57546. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  57547. </pre></div>
  57548. </li></ul>
  57549. </div>
  57550. </div>
  57551. <div class="section-level-extent" id="colorkey_005fopencl">
  57552. <h3 class="section"><span>40.3 colorkey_opencl<a class="copiable-link" href="#colorkey_005fopencl"> &para;</a></span></h3>
  57553. <p>RGB colorspace color keying.
  57554. </p>
  57555. <p>The filter accepts the following options:
  57556. </p>
  57557. <dl class="table">
  57558. <dt><samp class="option">color</samp></dt>
  57559. <dd><p>The color which will be replaced with transparency.
  57560. </p>
  57561. </dd>
  57562. <dt><samp class="option">similarity</samp></dt>
  57563. <dd><p>Similarity percentage with the key color.
  57564. </p>
  57565. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  57566. </p>
  57567. </dd>
  57568. <dt><samp class="option">blend</samp></dt>
  57569. <dd><p>Blend percentage.
  57570. </p>
  57571. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  57572. </p>
  57573. <p>Higher values result in semi-transparent pixels, with a higher transparency
  57574. the more similar the pixels color is to the key color.
  57575. </p></dd>
  57576. </dl>
  57577. <ul class="mini-toc">
  57578. <li><a href="#Examples-186" accesskey="1">Examples</a></li>
  57579. </ul>
  57580. <div class="subsection-level-extent" id="Examples-186">
  57581. <h4 class="subsection"><span>40.3.1 Examples<a class="copiable-link" href="#Examples-186"> &para;</a></span></h4>
  57582. <ul class="itemize mark-bullet">
  57583. <li>Make every semi-green pixel in the input transparent with some slight blending:
  57584. <div class="example">
  57585. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  57586. </pre></div>
  57587. </li></ul>
  57588. </div>
  57589. </div>
  57590. <div class="section-level-extent" id="convolution_005fopencl">
  57591. <h3 class="section"><span>40.4 convolution_opencl<a class="copiable-link" href="#convolution_005fopencl"> &para;</a></span></h3>
  57592. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  57593. </p>
  57594. <p>The filter accepts the following options:
  57595. </p>
  57596. <dl class="table">
  57597. <dt><samp class="option">0m</samp></dt>
  57598. <dt><samp class="option">1m</samp></dt>
  57599. <dt><samp class="option">2m</samp></dt>
  57600. <dt><samp class="option">3m</samp></dt>
  57601. <dd><p>Set matrix for each plane.
  57602. Matrix is sequence of 9, 25 or 49 signed numbers.
  57603. Default value for each plane is <code class="code">0 0 0 0 1 0 0 0 0</code>.
  57604. </p>
  57605. </dd>
  57606. <dt><samp class="option">0rdiv</samp></dt>
  57607. <dt><samp class="option">1rdiv</samp></dt>
  57608. <dt><samp class="option">2rdiv</samp></dt>
  57609. <dt><samp class="option">3rdiv</samp></dt>
  57610. <dd><p>Set multiplier for calculated value for each plane.
  57611. If unset or 0, it will be sum of all matrix elements.
  57612. 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>.
  57613. </p>
  57614. </dd>
  57615. <dt><samp class="option">0bias</samp></dt>
  57616. <dt><samp class="option">1bias</samp></dt>
  57617. <dt><samp class="option">2bias</samp></dt>
  57618. <dt><samp class="option">3bias</samp></dt>
  57619. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  57620. Useful for making the overall image brighter or darker.
  57621. 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>.
  57622. </p>
  57623. </dd>
  57624. </dl>
  57625. <ul class="mini-toc">
  57626. <li><a href="#Examples-187" accesskey="1">Examples</a></li>
  57627. </ul>
  57628. <div class="subsection-level-extent" id="Examples-187">
  57629. <h4 class="subsection"><span>40.4.1 Examples<a class="copiable-link" href="#Examples-187"> &para;</a></span></h4>
  57630. <ul class="itemize mark-bullet">
  57631. <li>Apply sharpen:
  57632. <div class="example">
  57633. <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
  57634. </pre></div>
  57635. </li><li>Apply blur:
  57636. <div class="example">
  57637. <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
  57638. </pre></div>
  57639. </li><li>Apply edge enhance:
  57640. <div class="example">
  57641. <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
  57642. </pre></div>
  57643. </li><li>Apply edge detect:
  57644. <div class="example">
  57645. <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
  57646. </pre></div>
  57647. </li><li>Apply laplacian edge detector which includes diagonals:
  57648. <div class="example">
  57649. <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
  57650. </pre></div>
  57651. </li><li>Apply emboss:
  57652. <div class="example">
  57653. <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
  57654. </pre></div>
  57655. </li></ul>
  57656. </div>
  57657. </div>
  57658. <div class="section-level-extent" id="erosion_005fopencl">
  57659. <h3 class="section"><span>40.5 erosion_opencl<a class="copiable-link" href="#erosion_005fopencl"> &para;</a></span></h3>
  57660. <p>Apply erosion effect to the video.
  57661. </p>
  57662. <p>This filter replaces the pixel by the local(3x3) minimum.
  57663. </p>
  57664. <p>It accepts the following options:
  57665. </p>
  57666. <dl class="table">
  57667. <dt><samp class="option">threshold0</samp></dt>
  57668. <dt><samp class="option">threshold1</samp></dt>
  57669. <dt><samp class="option">threshold2</samp></dt>
  57670. <dt><samp class="option">threshold3</samp></dt>
  57671. <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>.
  57672. If <code class="code">0</code>, plane will remain unchanged.
  57673. </p>
  57674. </dd>
  57675. <dt><samp class="option">coordinates</samp></dt>
  57676. <dd><p>Flag which specifies the pixel to refer to.
  57677. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  57678. </p>
  57679. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  57680. </p>
  57681. <p>1 2 3
  57682. </p>
  57683. <p>4 x 5
  57684. </p>
  57685. <p>6 7 8
  57686. </p></dd>
  57687. </dl>
  57688. <ul class="mini-toc">
  57689. <li><a href="#Example-12" accesskey="1">Example</a></li>
  57690. </ul>
  57691. <div class="subsection-level-extent" id="Example-12">
  57692. <h4 class="subsection"><span>40.5.1 Example<a class="copiable-link" href="#Example-12"> &para;</a></span></h4>
  57693. <ul class="itemize mark-bullet">
  57694. <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.
  57695. <div class="example">
  57696. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  57697. </pre></div>
  57698. </li></ul>
  57699. </div>
  57700. </div>
  57701. <div class="section-level-extent" id="deshake_005fopencl">
  57702. <h3 class="section"><span>40.6 deshake_opencl<a class="copiable-link" href="#deshake_005fopencl"> &para;</a></span></h3>
  57703. <p>Feature-point based video stabilization filter.
  57704. </p>
  57705. <p>The filter accepts the following options:
  57706. </p>
  57707. <dl class="table">
  57708. <dt><samp class="option">tripod</samp></dt>
  57709. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code class="code">0</code>.
  57710. </p>
  57711. </dd>
  57712. <dt><samp class="option">debug</samp></dt>
  57713. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  57714. </p>
  57715. <p>Note that in order to see console debug output you will also need to pass <code class="code">-v verbose</code> to ffmpeg.
  57716. </p>
  57717. <p>Viewing point matches in the output video is only supported for RGB input.
  57718. </p>
  57719. <p>Defaults to <code class="code">0</code>.
  57720. </p>
  57721. </dd>
  57722. <dt><samp class="option">adaptive_crop</samp></dt>
  57723. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  57724. </p>
  57725. <p>Defaults to <code class="code">1</code>.
  57726. </p>
  57727. </dd>
  57728. <dt><samp class="option">refine_features</samp></dt>
  57729. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  57730. </p>
  57731. <p>This can be turned off for a slight performance gain at the cost of precision.
  57732. </p>
  57733. <p>Defaults to <code class="code">1</code>.
  57734. </p>
  57735. </dd>
  57736. <dt><samp class="option">smooth_strength</samp></dt>
  57737. <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>.
  57738. </p>
  57739. <p><code class="code">1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  57740. </p>
  57741. <p><code class="code">0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  57742. </p>
  57743. <p>Defaults to <code class="code">0.0</code>.
  57744. </p>
  57745. </dd>
  57746. <dt><samp class="option">smooth_window_multiplier</samp></dt>
  57747. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  57748. </p>
  57749. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  57750. </p>
  57751. <p>Acceptable values range from <code class="code">0.1</code> to <code class="code">10.0</code>.
  57752. </p>
  57753. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  57754. potentially improving smoothness, but also increase latency and memory usage.
  57755. </p>
  57756. <p>Defaults to <code class="code">2.0</code>.
  57757. </p>
  57758. </dd>
  57759. </dl>
  57760. <ul class="mini-toc">
  57761. <li><a href="#Examples-188" accesskey="1">Examples</a></li>
  57762. </ul>
  57763. <div class="subsection-level-extent" id="Examples-188">
  57764. <h4 class="subsection"><span>40.6.1 Examples<a class="copiable-link" href="#Examples-188"> &para;</a></span></h4>
  57765. <ul class="itemize mark-bullet">
  57766. <li>Stabilize a video with a fixed, medium smoothing strength:
  57767. <div class="example">
  57768. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  57769. </pre></div>
  57770. </li><li>Stabilize a video with debugging (both in console and in rendered video):
  57771. <div class="example">
  57772. <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
  57773. </pre></div>
  57774. </li></ul>
  57775. </div>
  57776. </div>
  57777. <div class="section-level-extent" id="dilation_005fopencl">
  57778. <h3 class="section"><span>40.7 dilation_opencl<a class="copiable-link" href="#dilation_005fopencl"> &para;</a></span></h3>
  57779. <p>Apply dilation effect to the video.
  57780. </p>
  57781. <p>This filter replaces the pixel by the local(3x3) maximum.
  57782. </p>
  57783. <p>It accepts the following options:
  57784. </p>
  57785. <dl class="table">
  57786. <dt><samp class="option">threshold0</samp></dt>
  57787. <dt><samp class="option">threshold1</samp></dt>
  57788. <dt><samp class="option">threshold2</samp></dt>
  57789. <dt><samp class="option">threshold3</samp></dt>
  57790. <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>.
  57791. If <code class="code">0</code>, plane will remain unchanged.
  57792. </p>
  57793. </dd>
  57794. <dt><samp class="option">coordinates</samp></dt>
  57795. <dd><p>Flag which specifies the pixel to refer to.
  57796. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  57797. </p>
  57798. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  57799. </p>
  57800. <p>1 2 3
  57801. </p>
  57802. <p>4 x 5
  57803. </p>
  57804. <p>6 7 8
  57805. </p></dd>
  57806. </dl>
  57807. <ul class="mini-toc">
  57808. <li><a href="#Example-13" accesskey="1">Example</a></li>
  57809. </ul>
  57810. <div class="subsection-level-extent" id="Example-13">
  57811. <h4 class="subsection"><span>40.7.1 Example<a class="copiable-link" href="#Example-13"> &para;</a></span></h4>
  57812. <ul class="itemize mark-bullet">
  57813. <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.
  57814. <div class="example">
  57815. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  57816. </pre></div>
  57817. </li></ul>
  57818. <a class="anchor" id="nlmeans_005fopencl"></a></div>
  57819. </div>
  57820. <div class="section-level-extent" id="nlmeans_005fopencl-1">
  57821. <h3 class="section"><span>40.8 nlmeans_opencl<a class="copiable-link" href="#nlmeans_005fopencl-1"> &para;</a></span></h3>
  57822. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a class="ref" href="#nlmeans">nlmeans</a>.
  57823. </p>
  57824. </div>
  57825. <div class="section-level-extent" id="overlay_005fopencl">
  57826. <h3 class="section"><span>40.9 overlay_opencl<a class="copiable-link" href="#overlay_005fopencl"> &para;</a></span></h3>
  57827. <p>Overlay one video on top of another.
  57828. </p>
  57829. <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.
  57830. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  57831. </p>
  57832. <p>The filter accepts the following options:
  57833. </p>
  57834. <dl class="table">
  57835. <dt><samp class="option">x</samp></dt>
  57836. <dd><p>Set the x coordinate of the overlaid video on the main video.
  57837. Default value is <code class="code">0</code>.
  57838. </p>
  57839. </dd>
  57840. <dt><samp class="option">y</samp></dt>
  57841. <dd><p>Set the y coordinate of the overlaid video on the main video.
  57842. Default value is <code class="code">0</code>.
  57843. </p>
  57844. </dd>
  57845. </dl>
  57846. <ul class="mini-toc">
  57847. <li><a href="#Examples-189" accesskey="1">Examples</a></li>
  57848. </ul>
  57849. <div class="subsection-level-extent" id="Examples-189">
  57850. <h4 class="subsection"><span>40.9.1 Examples<a class="copiable-link" href="#Examples-189"> &para;</a></span></h4>
  57851. <ul class="itemize mark-bullet">
  57852. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  57853. <div class="example">
  57854. <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
  57855. </pre></div>
  57856. </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.
  57857. <div class="example">
  57858. <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
  57859. </pre></div>
  57860. </li></ul>
  57861. </div>
  57862. </div>
  57863. <div class="section-level-extent" id="pad_005fopencl">
  57864. <h3 class="section"><span>40.10 pad_opencl<a class="copiable-link" href="#pad_005fopencl"> &para;</a></span></h3>
  57865. <p>Add paddings to the input image, and place the original input at the
  57866. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  57867. </p>
  57868. <p>It accepts the following options:
  57869. </p>
  57870. <dl class="table">
  57871. <dt><samp class="option">width, w</samp></dt>
  57872. <dt><samp class="option">height, h</samp></dt>
  57873. <dd><p>Specify an expression for the size of the output image with the
  57874. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  57875. corresponding input size is used for the output.
  57876. </p>
  57877. <p>The <var class="var">width</var> expression can reference the value set by the
  57878. <var class="var">height</var> expression, and vice versa.
  57879. </p>
  57880. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  57881. </p>
  57882. </dd>
  57883. <dt><samp class="option">x</samp></dt>
  57884. <dt><samp class="option">y</samp></dt>
  57885. <dd><p>Specify the offsets to place the input image at within the padded area,
  57886. with respect to the top/left border of the output image.
  57887. </p>
  57888. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  57889. expression, and vice versa.
  57890. </p>
  57891. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  57892. </p>
  57893. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  57894. so the input image is centered on the padded area.
  57895. </p>
  57896. </dd>
  57897. <dt><samp class="option">color</samp></dt>
  57898. <dd><p>Specify the color of the padded area. For the syntax of this option,
  57899. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  57900. manual</a>.
  57901. </p>
  57902. </dd>
  57903. <dt><samp class="option">aspect</samp></dt>
  57904. <dd><p>Pad to an aspect instead to a resolution.
  57905. </p></dd>
  57906. </dl>
  57907. <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>
  57908. options are expressions containing the following constants:
  57909. </p>
  57910. <dl class="table">
  57911. <dt><samp class="option">in_w</samp></dt>
  57912. <dt><samp class="option">in_h</samp></dt>
  57913. <dd><p>The input video width and height.
  57914. </p>
  57915. </dd>
  57916. <dt><samp class="option">iw</samp></dt>
  57917. <dt><samp class="option">ih</samp></dt>
  57918. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  57919. </p>
  57920. </dd>
  57921. <dt><samp class="option">out_w</samp></dt>
  57922. <dt><samp class="option">out_h</samp></dt>
  57923. <dd><p>The output width and height (the size of the padded area), as
  57924. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  57925. </p>
  57926. </dd>
  57927. <dt><samp class="option">ow</samp></dt>
  57928. <dt><samp class="option">oh</samp></dt>
  57929. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  57930. </p>
  57931. </dd>
  57932. <dt><samp class="option">x</samp></dt>
  57933. <dt><samp class="option">y</samp></dt>
  57934. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  57935. expressions, or NAN if not yet specified.
  57936. </p>
  57937. </dd>
  57938. <dt><samp class="option">a</samp></dt>
  57939. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  57940. </p>
  57941. </dd>
  57942. <dt><samp class="option">sar</samp></dt>
  57943. <dd><p>input sample aspect ratio
  57944. </p>
  57945. </dd>
  57946. <dt><samp class="option">dar</samp></dt>
  57947. <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>
  57948. </p></dd>
  57949. </dl>
  57950. </div>
  57951. <div class="section-level-extent" id="prewitt_005fopencl">
  57952. <h3 class="section"><span>40.11 prewitt_opencl<a class="copiable-link" href="#prewitt_005fopencl"> &para;</a></span></h3>
  57953. <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.
  57954. </p>
  57955. <p>The filter accepts the following option:
  57956. </p>
  57957. <dl class="table">
  57958. <dt><samp class="option">planes</samp></dt>
  57959. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  57960. </p>
  57961. </dd>
  57962. <dt><samp class="option">scale</samp></dt>
  57963. <dd><p>Set value which will be multiplied with filtered result.
  57964. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  57965. </p>
  57966. </dd>
  57967. <dt><samp class="option">delta</samp></dt>
  57968. <dd><p>Set value which will be added to filtered result.
  57969. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  57970. </p></dd>
  57971. </dl>
  57972. <ul class="mini-toc">
  57973. <li><a href="#Example-14" accesskey="1">Example</a></li>
  57974. </ul>
  57975. <div class="subsection-level-extent" id="Example-14">
  57976. <h4 class="subsection"><span>40.11.1 Example<a class="copiable-link" href="#Example-14"> &para;</a></span></h4>
  57977. <ul class="itemize mark-bullet">
  57978. <li>Apply the Prewitt operator with scale set to 2 and delta set to 10.
  57979. <div class="example">
  57980. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  57981. </pre></div>
  57982. </li></ul>
  57983. <a class="anchor" id="program_005fopencl"></a></div>
  57984. </div>
  57985. <div class="section-level-extent" id="program_005fopencl-1">
  57986. <h3 class="section"><span>40.12 program_opencl<a class="copiable-link" href="#program_005fopencl-1"> &para;</a></span></h3>
  57987. <p>Filter video using an OpenCL program.
  57988. </p>
  57989. <dl class="table">
  57990. <dt><samp class="option">source</samp></dt>
  57991. <dd><p>OpenCL program source file.
  57992. </p>
  57993. </dd>
  57994. <dt><samp class="option">kernel</samp></dt>
  57995. <dd><p>Kernel name in program.
  57996. </p>
  57997. </dd>
  57998. <dt><samp class="option">inputs</samp></dt>
  57999. <dd><p>Number of inputs to the filter. Defaults to 1.
  58000. </p>
  58001. </dd>
  58002. <dt><samp class="option">size, s</samp></dt>
  58003. <dd><p>Size of output frames. Defaults to the same as the first input.
  58004. </p>
  58005. </dd>
  58006. </dl>
  58007. <p>The <code class="code">program_opencl</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  58008. </p>
  58009. <p>The program source file must contain a kernel function with the given name,
  58010. which will be run once for each plane of the output. Each run on a plane
  58011. gets enqueued as a separate 2D global NDRange with one work-item for each
  58012. pixel to be generated. The global ID offset for each work-item is therefore
  58013. the coordinates of a pixel in the destination image.
  58014. </p>
  58015. <p>The kernel function needs to take the following arguments:
  58016. </p><ul class="itemize mark-bullet">
  58017. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  58018. <p>This image will become the output; the kernel should write all of it.
  58019. </p></li><li>Frame index, <var class="var">unsigned int</var>.
  58020. <p>This is a counter starting from zero and increasing by one for each frame.
  58021. </p></li><li>Source images, <var class="var">__read_only image2d_t</var>.
  58022. <p>These are the most recent images on each input. The kernel may read from
  58023. them to generate the output, but they can&rsquo;t be written to.
  58024. </p></li></ul>
  58025. <p>Example programs:
  58026. </p>
  58027. <ul class="itemize mark-bullet">
  58028. <li>Copy the input to the output (output must be the same size as the input).
  58029. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  58030. unsigned int index,
  58031. __read_only image2d_t source)
  58032. {
  58033. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  58034. int2 location = (int2)(get_global_id(0), get_global_id(1));
  58035. float4 value = read_imagef(source, sampler, location);
  58036. write_imagef(destination, location, value);
  58037. }
  58038. </pre>
  58039. </li><li>Apply a simple transformation, rotating the input by an amount increasing
  58040. with the index counter. Pixel values are linearly interpolated by the
  58041. sampler, and the output need not have the same dimensions as the input.
  58042. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  58043. unsigned int index,
  58044. __read_only image2d_t src)
  58045. {
  58046. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  58047. CLK_FILTER_LINEAR);
  58048. float angle = (float)index / 100.0f;
  58049. float2 dst_dim = convert_float2(get_image_dim(dst));
  58050. float2 src_dim = convert_float2(get_image_dim(src));
  58051. float2 dst_cen = dst_dim / 2.0f;
  58052. float2 src_cen = src_dim / 2.0f;
  58053. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  58054. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  58055. float2 src_pos = {
  58056. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  58057. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  58058. };
  58059. src_pos = src_pos * src_dim / dst_dim;
  58060. float2 src_loc = src_pos + src_cen;
  58061. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  58062. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  58063. write_imagef(dst, dst_loc, 0.5f);
  58064. else
  58065. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  58066. }
  58067. </pre>
  58068. </li><li>Blend two inputs together, with the amount of each input used varying
  58069. with the index counter.
  58070. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  58071. unsigned int index,
  58072. __read_only image2d_t src1,
  58073. __read_only image2d_t src2)
  58074. {
  58075. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  58076. CLK_FILTER_LINEAR);
  58077. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  58078. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  58079. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  58080. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  58081. float4 val1 = read_imagef(src1, sampler, src1_loc);
  58082. float4 val2 = read_imagef(src2, sampler, src2_loc);
  58083. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  58084. }
  58085. </pre>
  58086. </li></ul>
  58087. </div>
  58088. <div class="section-level-extent" id="remap_005fopencl">
  58089. <h3 class="section"><span>40.13 remap_opencl<a class="copiable-link" href="#remap_005fopencl"> &para;</a></span></h3>
  58090. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  58091. </p>
  58092. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  58093. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  58094. value for pixel will be used for destination pixel.
  58095. </p>
  58096. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  58097. will have Xmap/Ymap video stream dimensions.
  58098. Xmap and Ymap input video streams are 32bit float pixel format, single channel.
  58099. </p>
  58100. <dl class="table">
  58101. <dt><samp class="option">interp</samp></dt>
  58102. <dd><p>Specify interpolation used for remapping of pixels.
  58103. Allowed values are <code class="code">near</code> and <code class="code">linear</code>.
  58104. Default value is <code class="code">linear</code>.
  58105. </p>
  58106. </dd>
  58107. <dt><samp class="option">fill</samp></dt>
  58108. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  58109. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  58110. manual</a>. Default color is <code class="code">black</code>.
  58111. </p></dd>
  58112. </dl>
  58113. </div>
  58114. <div class="section-level-extent" id="roberts_005fopencl">
  58115. <h3 class="section"><span>40.14 roberts_opencl<a class="copiable-link" href="#roberts_005fopencl"> &para;</a></span></h3>
  58116. <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.
  58117. </p>
  58118. <p>The filter accepts the following option:
  58119. </p>
  58120. <dl class="table">
  58121. <dt><samp class="option">planes</samp></dt>
  58122. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  58123. </p>
  58124. </dd>
  58125. <dt><samp class="option">scale</samp></dt>
  58126. <dd><p>Set value which will be multiplied with filtered result.
  58127. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  58128. </p>
  58129. </dd>
  58130. <dt><samp class="option">delta</samp></dt>
  58131. <dd><p>Set value which will be added to filtered result.
  58132. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  58133. </p></dd>
  58134. </dl>
  58135. <ul class="mini-toc">
  58136. <li><a href="#Example-15" accesskey="1">Example</a></li>
  58137. </ul>
  58138. <div class="subsection-level-extent" id="Example-15">
  58139. <h4 class="subsection"><span>40.14.1 Example<a class="copiable-link" href="#Example-15"> &para;</a></span></h4>
  58140. <ul class="itemize mark-bullet">
  58141. <li>Apply the Roberts cross operator with scale set to 2 and delta set to 10
  58142. <div class="example">
  58143. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  58144. </pre></div>
  58145. </li></ul>
  58146. </div>
  58147. </div>
  58148. <div class="section-level-extent" id="sobel_005fopencl">
  58149. <h3 class="section"><span>40.15 sobel_opencl<a class="copiable-link" href="#sobel_005fopencl"> &para;</a></span></h3>
  58150. <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.
  58151. </p>
  58152. <p>The filter accepts the following option:
  58153. </p>
  58154. <dl class="table">
  58155. <dt><samp class="option">planes</samp></dt>
  58156. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  58157. </p>
  58158. </dd>
  58159. <dt><samp class="option">scale</samp></dt>
  58160. <dd><p>Set value which will be multiplied with filtered result.
  58161. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  58162. </p>
  58163. </dd>
  58164. <dt><samp class="option">delta</samp></dt>
  58165. <dd><p>Set value which will be added to filtered result.
  58166. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  58167. </p></dd>
  58168. </dl>
  58169. <ul class="mini-toc">
  58170. <li><a href="#Example-16" accesskey="1">Example</a></li>
  58171. </ul>
  58172. <div class="subsection-level-extent" id="Example-16">
  58173. <h4 class="subsection"><span>40.15.1 Example<a class="copiable-link" href="#Example-16"> &para;</a></span></h4>
  58174. <ul class="itemize mark-bullet">
  58175. <li>Apply sobel operator with scale set to 2 and delta set to 10
  58176. <div class="example">
  58177. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  58178. </pre></div>
  58179. </li></ul>
  58180. </div>
  58181. </div>
  58182. <div class="section-level-extent" id="tonemap_005fopencl">
  58183. <h3 class="section"><span>40.16 tonemap_opencl<a class="copiable-link" href="#tonemap_005fopencl"> &para;</a></span></h3>
  58184. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  58185. </p>
  58186. <p>It accepts the following parameters:
  58187. </p>
  58188. <dl class="table">
  58189. <dt><samp class="option">tonemap</samp></dt>
  58190. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a class="ref" href="#tonemap">tonemap</a>.
  58191. </p>
  58192. </dd>
  58193. <dt><samp class="option">param</samp></dt>
  58194. <dd><p>Tune the tone mapping algorithm. same as param option in <a class="ref" href="#tonemap">tonemap</a>.
  58195. </p>
  58196. </dd>
  58197. <dt><samp class="option">desat</samp></dt>
  58198. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  58199. higher the parameter, the more color information will be preserved. This
  58200. setting helps prevent unnaturally blown-out colors for super-highlights, by
  58201. (smoothly) turning into white instead. This makes images feel more natural,
  58202. at the cost of reducing information about out-of-range colors.
  58203. </p>
  58204. <p>The default value is 0.5, and the algorithm here is a little different from
  58205. the cpu version tonemap currently. A setting of 0.0 disables this option.
  58206. </p>
  58207. </dd>
  58208. <dt><samp class="option">threshold</samp></dt>
  58209. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  58210. is used to detect whether the scene has changed or not. If the distance between
  58211. the current frame average brightness and the current running average exceeds
  58212. a threshold value, we would re-calculate scene average and peak brightness.
  58213. The default value is 0.2.
  58214. </p>
  58215. </dd>
  58216. <dt><samp class="option">format</samp></dt>
  58217. <dd><p>Specify the output pixel format.
  58218. </p>
  58219. <p>Currently supported formats are:
  58220. </p><dl class="table">
  58221. <dt><var class="var">p010</var></dt>
  58222. <dt><var class="var">nv12</var></dt>
  58223. </dl>
  58224. </dd>
  58225. <dt><samp class="option">range, r</samp></dt>
  58226. <dd><p>Set the output color range.
  58227. </p>
  58228. <p>Possible values are:
  58229. </p><dl class="table">
  58230. <dt><var class="var">tv/mpeg</var></dt>
  58231. <dt><var class="var">pc/jpeg</var></dt>
  58232. </dl>
  58233. <p>Default is same as input.
  58234. </p>
  58235. </dd>
  58236. <dt><samp class="option">primaries, p</samp></dt>
  58237. <dd><p>Set the output color primaries.
  58238. </p>
  58239. <p>Possible values are:
  58240. </p><dl class="table">
  58241. <dt><var class="var">bt709</var></dt>
  58242. <dt><var class="var">bt2020</var></dt>
  58243. </dl>
  58244. <p>Default is same as input.
  58245. </p>
  58246. </dd>
  58247. <dt><samp class="option">transfer, t</samp></dt>
  58248. <dd><p>Set the output transfer characteristics.
  58249. </p>
  58250. <p>Possible values are:
  58251. </p><dl class="table">
  58252. <dt><var class="var">bt709</var></dt>
  58253. <dt><var class="var">bt2020</var></dt>
  58254. </dl>
  58255. <p>Default is bt709.
  58256. </p>
  58257. </dd>
  58258. <dt><samp class="option">matrix, m</samp></dt>
  58259. <dd><p>Set the output colorspace matrix.
  58260. </p>
  58261. <p>Possible value are:
  58262. </p><dl class="table">
  58263. <dt><var class="var">bt709</var></dt>
  58264. <dt><var class="var">bt2020</var></dt>
  58265. </dl>
  58266. <p>Default is same as input.
  58267. </p>
  58268. </dd>
  58269. </dl>
  58270. <ul class="mini-toc">
  58271. <li><a href="#Example-17" accesskey="1">Example</a></li>
  58272. </ul>
  58273. <div class="subsection-level-extent" id="Example-17">
  58274. <h4 class="subsection"><span>40.16.1 Example<a class="copiable-link" href="#Example-17"> &para;</a></span></h4>
  58275. <ul class="itemize mark-bullet">
  58276. <li>Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  58277. <div class="example">
  58278. <pre class="example-preformatted">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  58279. </pre></div>
  58280. </li></ul>
  58281. </div>
  58282. </div>
  58283. <div class="section-level-extent" id="unsharp_005fopencl">
  58284. <h3 class="section"><span>40.17 unsharp_opencl<a class="copiable-link" href="#unsharp_005fopencl"> &para;</a></span></h3>
  58285. <p>Sharpen or blur the input video.
  58286. </p>
  58287. <p>It accepts the following parameters:
  58288. </p>
  58289. <dl class="table">
  58290. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  58291. <dd><p>Set the luma matrix horizontal size.
  58292. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  58293. </p>
  58294. </dd>
  58295. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  58296. <dd><p>Set the luma matrix vertical size.
  58297. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  58298. </p>
  58299. </dd>
  58300. <dt><samp class="option">luma_amount, la</samp></dt>
  58301. <dd><p>Set the luma effect strength.
  58302. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">1.0</code>.
  58303. </p>
  58304. <p>Negative values will blur the input video, while positive values will
  58305. sharpen it, a value of zero will disable the effect.
  58306. </p>
  58307. </dd>
  58308. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  58309. <dd><p>Set the chroma matrix horizontal size.
  58310. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  58311. </p>
  58312. </dd>
  58313. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  58314. <dd><p>Set the chroma matrix vertical size.
  58315. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  58316. </p>
  58317. </dd>
  58318. <dt><samp class="option">chroma_amount, ca</samp></dt>
  58319. <dd><p>Set the chroma effect strength.
  58320. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">0.0</code>.
  58321. </p>
  58322. <p>Negative values will blur the input video, while positive values will
  58323. sharpen it, a value of zero will disable the effect.
  58324. </p>
  58325. </dd>
  58326. </dl>
  58327. <p>All parameters are optional and default to the equivalent of the
  58328. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  58329. </p>
  58330. <ul class="mini-toc">
  58331. <li><a href="#Examples-190" accesskey="1">Examples</a></li>
  58332. </ul>
  58333. <div class="subsection-level-extent" id="Examples-190">
  58334. <h4 class="subsection"><span>40.17.1 Examples<a class="copiable-link" href="#Examples-190"> &para;</a></span></h4>
  58335. <ul class="itemize mark-bullet">
  58336. <li>Apply strong luma sharpen effect:
  58337. <div class="example">
  58338. <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
  58339. </pre></div>
  58340. </li><li>Apply a strong blur of both luma and chroma parameters:
  58341. <div class="example">
  58342. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  58343. </pre></div>
  58344. </li></ul>
  58345. </div>
  58346. </div>
  58347. <div class="section-level-extent" id="xfade_005fopencl">
  58348. <h3 class="section"><span>40.18 xfade_opencl<a class="copiable-link" href="#xfade_005fopencl"> &para;</a></span></h3>
  58349. <p>Cross fade two videos with custom transition effect by using OpenCL.
  58350. </p>
  58351. <p>It accepts the following options:
  58352. </p>
  58353. <dl class="table">
  58354. <dt><samp class="option">transition</samp></dt>
  58355. <dd><p>Set one of possible transition effects.
  58356. </p>
  58357. <dl class="table">
  58358. <dt><samp class="option">custom</samp></dt>
  58359. <dd><p>Select custom transition effect, the actual transition description
  58360. will be picked from source and kernel options.
  58361. </p>
  58362. </dd>
  58363. <dt><samp class="option">fade</samp></dt>
  58364. <dt><samp class="option">wipeleft</samp></dt>
  58365. <dt><samp class="option">wiperight</samp></dt>
  58366. <dt><samp class="option">wipeup</samp></dt>
  58367. <dt><samp class="option">wipedown</samp></dt>
  58368. <dt><samp class="option">slideleft</samp></dt>
  58369. <dt><samp class="option">slideright</samp></dt>
  58370. <dt><samp class="option">slideup</samp></dt>
  58371. <dt><samp class="option">slidedown</samp></dt>
  58372. <dd>
  58373. <p>Default transition is fade.
  58374. </p></dd>
  58375. </dl>
  58376. </dd>
  58377. <dt><samp class="option">source</samp></dt>
  58378. <dd><p>OpenCL program source file for custom transition.
  58379. </p>
  58380. </dd>
  58381. <dt><samp class="option">kernel</samp></dt>
  58382. <dd><p>Set name of kernel to use for custom transition from program source file.
  58383. </p>
  58384. </dd>
  58385. <dt><samp class="option">duration</samp></dt>
  58386. <dd><p>Set duration of video transition.
  58387. </p>
  58388. </dd>
  58389. <dt><samp class="option">offset</samp></dt>
  58390. <dd><p>Set time of start of transition relative to first video.
  58391. </p></dd>
  58392. </dl>
  58393. <p>The program source file must contain a kernel function with the given name,
  58394. which will be run once for each plane of the output. Each run on a plane
  58395. gets enqueued as a separate 2D global NDRange with one work-item for each
  58396. pixel to be generated. The global ID offset for each work-item is therefore
  58397. the coordinates of a pixel in the destination image.
  58398. </p>
  58399. <p>The kernel function needs to take the following arguments:
  58400. </p><ul class="itemize mark-bullet">
  58401. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  58402. <p>This image will become the output; the kernel should write all of it.
  58403. </p>
  58404. </li><li>First Source image, <var class="var">__read_only image2d_t</var>.
  58405. Second Source image, <var class="var">__read_only image2d_t</var>.
  58406. <p>These are the most recent images on each input. The kernel may read from
  58407. them to generate the output, but they can&rsquo;t be written to.
  58408. </p>
  58409. </li><li>Transition progress, <var class="var">float</var>. This value is always between 0 and 1 inclusive.
  58410. </li></ul>
  58411. <p>Example programs:
  58412. </p>
  58413. <ul class="itemize mark-bullet">
  58414. <li>Apply dots curtain transition effect:
  58415. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  58416. __read_only image2d_t src1,
  58417. __read_only image2d_t src2,
  58418. float progress)
  58419. {
  58420. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  58421. CLK_FILTER_LINEAR);
  58422. int2 p = (int2)(get_global_id(0), get_global_id(1));
  58423. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  58424. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  58425. rp = rp / dim;
  58426. float2 dots = (float2)(20.0, 20.0);
  58427. float2 center = (float2)(0,0);
  58428. float2 unused;
  58429. float4 val1 = read_imagef(src1, sampler, p);
  58430. float4 val2 = read_imagef(src2, sampler, p);
  58431. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  58432. write_imagef(dst, p, next ? val1 : val2);
  58433. }
  58434. </pre>
  58435. </li></ul>
  58436. </div>
  58437. </div>
  58438. <div class="chapter-level-extent" id="VAAPI-Video-Filters">
  58439. <h2 class="chapter"><span>41 VAAPI Video Filters<a class="copiable-link" href="#VAAPI-Video-Filters"> &para;</a></span></h2>
  58440. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  58441. </p>
  58442. <p>To enable compilation of these filters you need to configure FFmpeg with
  58443. <code class="code">--enable-vaapi</code>.
  58444. </p>
  58445. <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>
  58446. </p>
  58447. <ul class="mini-toc">
  58448. <li><a href="#overlay_005fvaapi" accesskey="1">overlay_vaapi</a></li>
  58449. <li><a href="#tonemap_005fvaapi" accesskey="2">tonemap_vaapi</a></li>
  58450. <li><a href="#hstack_005fvaapi" accesskey="3">hstack_vaapi</a></li>
  58451. <li><a href="#vstack_005fvaapi" accesskey="4">vstack_vaapi</a></li>
  58452. <li><a href="#xstack_005fvaapi" accesskey="5">xstack_vaapi</a></li>
  58453. </ul>
  58454. <div class="section-level-extent" id="overlay_005fvaapi">
  58455. <h3 class="section"><span>41.1 overlay_vaapi<a class="copiable-link" href="#overlay_005fvaapi"> &para;</a></span></h3>
  58456. <p>Overlay one video on the top of another.
  58457. </p>
  58458. <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.
  58459. </p>
  58460. <p>The filter accepts the following options:
  58461. </p>
  58462. <dl class="table">
  58463. <dt><samp class="option">x</samp></dt>
  58464. <dt><samp class="option">y</samp></dt>
  58465. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  58466. on the main video.
  58467. </p>
  58468. <p>Default value is &quot;0&quot; for both expressions.
  58469. </p>
  58470. </dd>
  58471. <dt><samp class="option">w</samp></dt>
  58472. <dt><samp class="option">h</samp></dt>
  58473. <dd><p>Set expressions for the width and height the overlaid video
  58474. on the main video.
  58475. </p>
  58476. <p>Default values are &rsquo;overlay_iw&rsquo; for &rsquo;w&rsquo; and &rsquo;overlay_ih*w/overlay_iw&rsquo; for &rsquo;h&rsquo;.
  58477. </p>
  58478. <p>The expressions can contain the following parameters:
  58479. </p>
  58480. <dl class="table">
  58481. <dt><samp class="option">main_w, W</samp></dt>
  58482. <dt><samp class="option">main_h, H</samp></dt>
  58483. <dd><p>The main input width and height.
  58484. </p>
  58485. </dd>
  58486. <dt><samp class="option">overlay_iw</samp></dt>
  58487. <dt><samp class="option">overlay_ih</samp></dt>
  58488. <dd><p>The overlay input width and height.
  58489. </p>
  58490. </dd>
  58491. <dt><samp class="option">overlay_w, w</samp></dt>
  58492. <dt><samp class="option">overlay_h, h</samp></dt>
  58493. <dd><p>The overlay output width and height.
  58494. </p>
  58495. </dd>
  58496. <dt><samp class="option">overlay_x, x</samp></dt>
  58497. <dt><samp class="option">overlay_y, y</samp></dt>
  58498. <dd><p>Position of the overlay layer inside of main
  58499. </p>
  58500. </dd>
  58501. </dl>
  58502. </dd>
  58503. <dt><samp class="option">alpha</samp></dt>
  58504. <dd><p>Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
  58505. Higher value means lower transparency.
  58506. Default value is <code class="code">1.0</code>.
  58507. </p>
  58508. </dd>
  58509. <dt><samp class="option">eof_action</samp></dt>
  58510. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  58511. </p>
  58512. </dd>
  58513. <dt><samp class="option">shortest</samp></dt>
  58514. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  58515. </p>
  58516. </dd>
  58517. <dt><samp class="option">repeatlast</samp></dt>
  58518. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  58519. </p>
  58520. </dd>
  58521. </dl>
  58522. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  58523. </p><ul class="mini-toc">
  58524. <li><a href="#Examples-191" accesskey="1">Examples</a></li>
  58525. </ul>
  58526. <div class="subsection-level-extent" id="Examples-191">
  58527. <h4 class="subsection"><span>41.1.1 Examples<a class="copiable-link" href="#Examples-191"> &para;</a></span></h4>
  58528. <ul class="itemize mark-bullet">
  58529. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format.
  58530. <div class="example">
  58531. <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
  58532. </pre></div>
  58533. </li><li>Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video.
  58534. The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  58535. <div class="example">
  58536. <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
  58537. </pre></div>
  58538. </li></ul>
  58539. </div>
  58540. </div>
  58541. <div class="section-level-extent" id="tonemap_005fvaapi">
  58542. <h3 class="section"><span>41.2 tonemap_vaapi<a class="copiable-link" href="#tonemap_005fvaapi"> &para;</a></span></h3>
  58543. <p>Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
  58544. It maps the dynamic range of HDR10 content to the SDR content.
  58545. It currently only accepts HDR10 as input.
  58546. </p>
  58547. <p>It accepts the following parameters:
  58548. </p>
  58549. <dl class="table">
  58550. <dt><samp class="option">format</samp></dt>
  58551. <dd><p>Specify the output pixel format.
  58552. </p>
  58553. <p>Currently supported formats are:
  58554. </p><dl class="table">
  58555. <dt><var class="var">p010</var></dt>
  58556. <dt><var class="var">nv12</var></dt>
  58557. </dl>
  58558. <p>Default is nv12.
  58559. </p>
  58560. </dd>
  58561. <dt><samp class="option">primaries, p</samp></dt>
  58562. <dd><p>Set the output color primaries.
  58563. </p>
  58564. <p>Default is same as input.
  58565. </p>
  58566. </dd>
  58567. <dt><samp class="option">transfer, t</samp></dt>
  58568. <dd><p>Set the output transfer characteristics.
  58569. </p>
  58570. <p>Default is bt709.
  58571. </p>
  58572. </dd>
  58573. <dt><samp class="option">matrix, m</samp></dt>
  58574. <dd><p>Set the output colorspace matrix.
  58575. </p>
  58576. <p>Default is same as input.
  58577. </p>
  58578. </dd>
  58579. </dl>
  58580. <ul class="mini-toc">
  58581. <li><a href="#Example-18" accesskey="1">Example</a></li>
  58582. </ul>
  58583. <div class="subsection-level-extent" id="Example-18">
  58584. <h4 class="subsection"><span>41.2.1 Example<a class="copiable-link" href="#Example-18"> &para;</a></span></h4>
  58585. <ul class="itemize mark-bullet">
  58586. <li>Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  58587. <div class="example">
  58588. <pre class="example-preformatted">tonemap_vaapi=format=p010:t=bt2020-10
  58589. </pre></div>
  58590. </li></ul>
  58591. </div>
  58592. </div>
  58593. <div class="section-level-extent" id="hstack_005fvaapi">
  58594. <h3 class="section"><span>41.3 hstack_vaapi<a class="copiable-link" href="#hstack_005fvaapi"> &para;</a></span></h3>
  58595. <p>Stack input videos horizontally.
  58596. </p>
  58597. <p>This is the VA-API variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  58598. have different height, this filter will scale down/up each input stream while
  58599. keeping the original aspect.
  58600. </p>
  58601. <p>It accepts the following options:
  58602. </p>
  58603. <dl class="table">
  58604. <dt><samp class="option">inputs</samp></dt>
  58605. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  58606. </p>
  58607. </dd>
  58608. <dt><samp class="option">shortest</samp></dt>
  58609. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  58610. </p>
  58611. </dd>
  58612. <dt><samp class="option">height</samp></dt>
  58613. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  58614. height of the first input stream. Default value is 0.
  58615. </p></dd>
  58616. </dl>
  58617. </div>
  58618. <div class="section-level-extent" id="vstack_005fvaapi">
  58619. <h3 class="section"><span>41.4 vstack_vaapi<a class="copiable-link" href="#vstack_005fvaapi"> &para;</a></span></h3>
  58620. <p>Stack input videos vertically.
  58621. </p>
  58622. <p>This is the VA-API variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  58623. have different width, this filter will scale down/up each input stream while
  58624. keeping the original aspect.
  58625. </p>
  58626. <p>It accepts the following options:
  58627. </p>
  58628. <dl class="table">
  58629. <dt><samp class="option">inputs</samp></dt>
  58630. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  58631. </p>
  58632. </dd>
  58633. <dt><samp class="option">shortest</samp></dt>
  58634. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  58635. </p>
  58636. </dd>
  58637. <dt><samp class="option">width</samp></dt>
  58638. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  58639. width of the first input stream. Default value is 0.
  58640. </p></dd>
  58641. </dl>
  58642. </div>
  58643. <div class="section-level-extent" id="xstack_005fvaapi">
  58644. <h3 class="section"><span>41.5 xstack_vaapi<a class="copiable-link" href="#xstack_005fvaapi"> &para;</a></span></h3>
  58645. <p>Stack video inputs into custom layout.
  58646. </p>
  58647. <p>This is the VA-API variant of the <a class="ref" href="#xstack">xstack</a> filter, each input stream may
  58648. have different size, this filter will scale down/up each input stream to the
  58649. given output size, or the size of the first input stream.
  58650. </p>
  58651. <p>It accepts the following options:
  58652. </p>
  58653. <dl class="table">
  58654. <dt><samp class="option">inputs</samp></dt>
  58655. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58656. </p>
  58657. </dd>
  58658. <dt><samp class="option">shortest</samp></dt>
  58659. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58660. </p>
  58661. </dd>
  58662. <dt><samp class="option">layout</samp></dt>
  58663. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58664. Moreover, this permits the user to supply output size for each input stream.
  58665. </p><div class="example">
  58666. <pre class="example-preformatted">xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  58667. </pre></div>
  58668. </dd>
  58669. <dt><samp class="option">grid</samp></dt>
  58670. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58671. </p>
  58672. </dd>
  58673. <dt><samp class="option">grid_tile_size</samp></dt>
  58674. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  58675. is not set, this filter will set output size by default to the size of the
  58676. first input stream. For the syntax of this option, check the
  58677. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  58678. </p>
  58679. </dd>
  58680. <dt><samp class="option">fill</samp></dt>
  58681. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  58682. </p></dd>
  58683. </dl>
  58684. </div>
  58685. </div>
  58686. <div class="chapter-level-extent" id="Vulkan-Video-Filters">
  58687. <h2 class="chapter"><span>42 Vulkan Video Filters<a class="copiable-link" href="#Vulkan-Video-Filters"> &para;</a></span></h2>
  58688. <p>Below is a description of the currently available Vulkan video filters.
  58689. </p>
  58690. <p>To enable compilation of these filters you need to configure FFmpeg with
  58691. <code class="code">--enable-vulkan</code> and either <code class="code">--enable-libglslang</code> or <code class="code">--enable-libshaderc</code>.
  58692. </p>
  58693. <p>Running Vulkan filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  58694. </p><dl class="table">
  58695. <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>
  58696. <dd><p>Initialise a new hardware device of type <var class="var">vulkan</var> called <var class="var">name</var>, using the
  58697. given device parameters and options in <var class="var">key=value</var>. The following options
  58698. are supported:
  58699. </p>
  58700. <dl class="table">
  58701. <dt><samp class="option">debug</samp></dt>
  58702. <dd><p>Switches validation layers on if set to 1.
  58703. </p>
  58704. </dd>
  58705. <dt><samp class="option">linear_images</samp></dt>
  58706. <dd><p>Allocates linear images. Does not apply to decoding.
  58707. </p>
  58708. </dd>
  58709. <dt><samp class="option">disable_multiplane</samp></dt>
  58710. <dd><p>Disables multiplane images. Does not apply to decoding.
  58711. </p></dd>
  58712. </dl>
  58713. </dd>
  58714. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  58715. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  58716. </p>
  58717. </dd>
  58718. </dl>
  58719. <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>
  58720. </p>
  58721. <ul class="itemize mark-bullet">
  58722. <li>Example of choosing the first device and running nlmeans_vulkan filter with default parameters on it.
  58723. <div class="example">
  58724. <pre class="example-preformatted">-init_hw_device vulkan=vk:0 -filter_hw_device vk -i INPUT -vf &quot;hwupload,nlmeans_vulkan,hwdownload&quot; OUTPUT
  58725. </pre></div>
  58726. </li></ul>
  58727. <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.
  58728. </p>
  58729. <ul class="mini-toc">
  58730. <li><a href="#avgblur_005fvulkan" accesskey="1">avgblur_vulkan</a></li>
  58731. <li><a href="#blend_005fvulkan" accesskey="2">blend_vulkan</a></li>
  58732. <li><a href="#bwdif_005fvulkan" accesskey="3">bwdif_vulkan</a></li>
  58733. <li><a href="#chromaber_005fvulkan" accesskey="4">chromaber_vulkan</a></li>
  58734. <li><a href="#color_005fvulkan" accesskey="5">color_vulkan</a></li>
  58735. <li><a href="#vflip_005fvulkan" accesskey="6">vflip_vulkan</a></li>
  58736. <li><a href="#hflip_005fvulkan" accesskey="7">hflip_vulkan</a></li>
  58737. <li><a href="#flip_005fvulkan" accesskey="8">flip_vulkan</a></li>
  58738. <li><a href="#gblur_005fvulkan" accesskey="9">gblur_vulkan</a></li>
  58739. <li><a href="#nlmeans_005fvulkan">nlmeans_vulkan</a></li>
  58740. <li><a href="#overlay_005fvulkan">overlay_vulkan</a></li>
  58741. <li><a href="#transpose_005fvt">transpose_vt</a></li>
  58742. <li><a href="#transpose_005fvulkan">transpose_vulkan</a></li>
  58743. </ul>
  58744. <div class="section-level-extent" id="avgblur_005fvulkan">
  58745. <h3 class="section"><span>42.1 avgblur_vulkan<a class="copiable-link" href="#avgblur_005fvulkan"> &para;</a></span></h3>
  58746. <p>Apply an average blur filter, implemented on the GPU using Vulkan.
  58747. </p>
  58748. <p>The filter accepts the following options:
  58749. </p>
  58750. <dl class="table">
  58751. <dt><samp class="option">sizeX</samp></dt>
  58752. <dd><p>Set horizontal radius size.
  58753. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  58754. </p>
  58755. </dd>
  58756. <dt><samp class="option">sizeY</samp></dt>
  58757. <dd><p>Set vertical radius size. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  58758. </p>
  58759. </dd>
  58760. <dt><samp class="option">planes</samp></dt>
  58761. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  58762. </p></dd>
  58763. </dl>
  58764. </div>
  58765. <div class="section-level-extent" id="blend_005fvulkan">
  58766. <h3 class="section"><span>42.2 blend_vulkan<a class="copiable-link" href="#blend_005fvulkan"> &para;</a></span></h3>
  58767. <p>Blend two Vulkan frames into each other.
  58768. </p>
  58769. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  58770. stream, the first input is the &quot;top&quot; layer and second input is
  58771. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  58772. </p>
  58773. <p>A description of the accepted options follows.
  58774. </p>
  58775. <dl class="table">
  58776. <dt><samp class="option">c0_mode</samp></dt>
  58777. <dt><samp class="option">c1_mode</samp></dt>
  58778. <dt><samp class="option">c2_mode</samp></dt>
  58779. <dt><samp class="option">c3_mode</samp></dt>
  58780. <dt><samp class="option">all_mode</samp></dt>
  58781. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  58782. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  58783. </p>
  58784. <p>Available values for component modes are:
  58785. </p><dl class="table">
  58786. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  58787. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  58788. </dl>
  58789. </dd>
  58790. </dl>
  58791. </div>
  58792. <div class="section-level-extent" id="bwdif_005fvulkan">
  58793. <h3 class="section"><span>42.3 bwdif_vulkan<a class="copiable-link" href="#bwdif_005fvulkan"> &para;</a></span></h3>
  58794. <p>Deinterlacer using <a class="ref" href="#bwdif">bwdif</a>, the &quot;Bob Weaver Deinterlacing Filter&quot; algorithm, implemented
  58795. on the GPU using Vulkan.
  58796. </p>
  58797. <p>It accepts the following parameters:
  58798. </p>
  58799. <dl class="table">
  58800. <dt><samp class="option">mode</samp></dt>
  58801. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  58802. </p>
  58803. <dl class="table">
  58804. <dt><samp class="option">0, send_frame</samp></dt>
  58805. <dd><p>Output one frame for each frame.
  58806. </p></dd>
  58807. <dt><samp class="option">1, send_field</samp></dt>
  58808. <dd><p>Output one frame for each field.
  58809. </p></dd>
  58810. </dl>
  58811. <p>The default value is <code class="code">send_field</code>.
  58812. </p>
  58813. </dd>
  58814. <dt><samp class="option">parity</samp></dt>
  58815. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  58816. of the following values:
  58817. </p>
  58818. <dl class="table">
  58819. <dt><samp class="option">0, tff</samp></dt>
  58820. <dd><p>Assume the top field is first.
  58821. </p></dd>
  58822. <dt><samp class="option">1, bff</samp></dt>
  58823. <dd><p>Assume the bottom field is first.
  58824. </p></dd>
  58825. <dt><samp class="option">-1, auto</samp></dt>
  58826. <dd><p>Enable automatic detection of field parity.
  58827. </p></dd>
  58828. </dl>
  58829. <p>The default value is <code class="code">auto</code>.
  58830. If the interlacing is unknown or the decoder does not export this information,
  58831. top field first will be assumed.
  58832. </p>
  58833. </dd>
  58834. <dt><samp class="option">deint</samp></dt>
  58835. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  58836. values:
  58837. </p>
  58838. <dl class="table">
  58839. <dt><samp class="option">0, all</samp></dt>
  58840. <dd><p>Deinterlace all frames.
  58841. </p></dd>
  58842. <dt><samp class="option">1, interlaced</samp></dt>
  58843. <dd><p>Only deinterlace frames marked as interlaced.
  58844. </p></dd>
  58845. </dl>
  58846. <p>The default value is <code class="code">all</code>.
  58847. </p></dd>
  58848. </dl>
  58849. </div>
  58850. <div class="section-level-extent" id="chromaber_005fvulkan">
  58851. <h3 class="section"><span>42.4 chromaber_vulkan<a class="copiable-link" href="#chromaber_005fvulkan"> &para;</a></span></h3>
  58852. <p>Apply an effect that emulates chromatic aberration. Works best with RGB inputs,
  58853. but provides a similar effect with YCbCr inputs too.
  58854. </p>
  58855. <dl class="table">
  58856. <dt><samp class="option">dist_x</samp></dt>
  58857. <dd><p>Horizontal displacement multiplier. Each chroma pixel&rsquo;s position will be multiplied
  58858. by this amount, starting from the center of the image. Default is <code class="code">0</code>.
  58859. </p>
  58860. </dd>
  58861. <dt><samp class="option">dist_y</samp></dt>
  58862. <dd><p>Similarly, this sets the vertical displacement multiplier. Default is <code class="code">0</code>.
  58863. </p>
  58864. </dd>
  58865. </dl>
  58866. </div>
  58867. <div class="section-level-extent" id="color_005fvulkan">
  58868. <h3 class="section"><span>42.5 color_vulkan<a class="copiable-link" href="#color_005fvulkan"> &para;</a></span></h3>
  58869. <p>Video source that creates a Vulkan frame of a solid color.
  58870. Useful for benchmarking, or overlaying.
  58871. </p>
  58872. <p>It accepts the following parameters:
  58873. </p>
  58874. <dl class="table">
  58875. <dt><samp class="option">color</samp></dt>
  58876. <dd><p>The color to use. Either a name, or a hexadecimal value.
  58877. The default value is <code class="code">black</code>.
  58878. </p>
  58879. </dd>
  58880. <dt><samp class="option">size</samp></dt>
  58881. <dd><p>The size of the output frame. Default value is <code class="code">1920x1080</code>.
  58882. </p>
  58883. </dd>
  58884. <dt><samp class="option">rate</samp></dt>
  58885. <dd><p>The framerate to output at. Default value is <code class="code">60</code> frames per second.
  58886. </p>
  58887. </dd>
  58888. <dt><samp class="option">duration</samp></dt>
  58889. <dd><p>The video duration. Default value is <code class="code">-0.000001</code>.
  58890. </p>
  58891. </dd>
  58892. <dt><samp class="option">sar</samp></dt>
  58893. <dd><p>The video signal aspect ratio. Default value is <code class="code">1/1</code>.
  58894. </p>
  58895. </dd>
  58896. <dt><samp class="option">format</samp></dt>
  58897. <dd><p>The pixel format of the output Vulkan frames. Default value is <code class="code">yuv444p</code>.
  58898. </p>
  58899. </dd>
  58900. <dt><samp class="option">out_range</samp></dt>
  58901. <dd><p>Set the output YCbCr sample range.
  58902. </p>
  58903. <p>This allows the autodetected value to be overridden as well as allows forcing
  58904. a specific value used for the output and encoder. If not specified, the
  58905. range depends on the pixel format. Possible values:
  58906. </p>
  58907. <dl class="table">
  58908. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  58909. <dd><p>Choose automatically.
  58910. </p>
  58911. </dd>
  58912. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  58913. <dd><p>Set full range (0-255 in case of 8-bit luma).
  58914. </p>
  58915. </dd>
  58916. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  58917. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  58918. </p></dd>
  58919. </dl>
  58920. </dd>
  58921. </dl>
  58922. </div>
  58923. <div class="section-level-extent" id="vflip_005fvulkan">
  58924. <h3 class="section"><span>42.6 vflip_vulkan<a class="copiable-link" href="#vflip_005fvulkan"> &para;</a></span></h3>
  58925. <p>Flips an image vertically.
  58926. </p>
  58927. </div>
  58928. <div class="section-level-extent" id="hflip_005fvulkan">
  58929. <h3 class="section"><span>42.7 hflip_vulkan<a class="copiable-link" href="#hflip_005fvulkan"> &para;</a></span></h3>
  58930. <p>Flips an image horizontally.
  58931. </p>
  58932. </div>
  58933. <div class="section-level-extent" id="flip_005fvulkan">
  58934. <h3 class="section"><span>42.8 flip_vulkan<a class="copiable-link" href="#flip_005fvulkan"> &para;</a></span></h3>
  58935. <p>Flips an image along both the vertical and horizontal axis.
  58936. </p>
  58937. </div>
  58938. <div class="section-level-extent" id="gblur_005fvulkan">
  58939. <h3 class="section"><span>42.9 gblur_vulkan<a class="copiable-link" href="#gblur_005fvulkan"> &para;</a></span></h3>
  58940. <p>Apply Gaussian blur filter on Vulkan frames.
  58941. </p>
  58942. <p>The filter accepts the following options:
  58943. </p>
  58944. <dl class="table">
  58945. <dt><samp class="option">sigma</samp></dt>
  58946. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  58947. </p>
  58948. </dd>
  58949. <dt><samp class="option">sigmaV</samp></dt>
  58950. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  58951. Default is <code class="code">-1</code>.
  58952. </p>
  58953. </dd>
  58954. <dt><samp class="option">planes</samp></dt>
  58955. <dd><p>Set which planes to filter. By default all planes are filtered.
  58956. </p>
  58957. </dd>
  58958. <dt><samp class="option">size</samp></dt>
  58959. <dd><p>Set the kernel size along the horizontal axis. Default is <code class="code">19</code>.
  58960. </p>
  58961. </dd>
  58962. <dt><samp class="option">sizeV</samp></dt>
  58963. <dd><p>Set the kernel size along the vertical axis. Default is <code class="code">0</code>,
  58964. which sets to use the same value as <var class="var">size</var>.
  58965. </p>
  58966. </dd>
  58967. </dl>
  58968. </div>
  58969. <div class="section-level-extent" id="nlmeans_005fvulkan">
  58970. <h3 class="section"><span>42.10 nlmeans_vulkan<a class="copiable-link" href="#nlmeans_005fvulkan"> &para;</a></span></h3>
  58971. <p>Denoise frames using Non-Local Means algorithm, implemented on the GPU using
  58972. Vulkan.
  58973. Supports more pixel formats than <a class="ref" href="#nlmeans">nlmeans</a> or <a class="ref" href="#nlmeans_005fopencl">nlmeans_opencl</a>, including
  58974. alpha channel support.
  58975. </p>
  58976. <p>The filter accepts the following options.
  58977. </p>
  58978. <dl class="table">
  58979. <dt><samp class="option">s</samp></dt>
  58980. <dd><p>Set denoising strength for all components. Default is 1.0. Must be in range [1.0, 100.0].
  58981. </p>
  58982. </dd>
  58983. <dt><samp class="option">p</samp></dt>
  58984. <dd><p>Set patch size for all planes. Default is 7. Must be odd number in range [0, 99].
  58985. </p>
  58986. </dd>
  58987. <dt><samp class="option">r</samp></dt>
  58988. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  58989. </p>
  58990. </dd>
  58991. <dt><samp class="option">t</samp></dt>
  58992. <dd><p>Set parallelism. Default is 36. Must be a number in the range [1, 168].
  58993. Larger values may speed up processing, at the cost of more VRAM.
  58994. Lower values will slow it down, reducing VRAM usage.
  58995. Only supported on GPUs with atomic float operations (RDNA3+, Ampere+).
  58996. </p>
  58997. </dd>
  58998. <dt><samp class="option">s0</samp></dt>
  58999. <dt><samp class="option">s1</samp></dt>
  59000. <dt><samp class="option">s2</samp></dt>
  59001. <dt><samp class="option">s3</samp></dt>
  59002. <dd><p>Set denoising strength for a specific component. Default is <var class="var">1</var>, equal to <samp class="option">s</samp>.
  59003. Must be odd number in range [1, 100].
  59004. </p>
  59005. </dd>
  59006. <dt><samp class="option">p0</samp></dt>
  59007. <dt><samp class="option">p1</samp></dt>
  59008. <dt><samp class="option">p2</samp></dt>
  59009. <dt><samp class="option">p3</samp></dt>
  59010. <dd><p>Set patch size for a specific component. Default is <var class="var">7</var>, equal to <samp class="option">p</samp>.
  59011. Must be odd number in range [0, 99].
  59012. </p>
  59013. </dd>
  59014. </dl>
  59015. </div>
  59016. <div class="section-level-extent" id="overlay_005fvulkan">
  59017. <h3 class="section"><span>42.11 overlay_vulkan<a class="copiable-link" href="#overlay_005fvulkan"> &para;</a></span></h3>
  59018. <p>Overlay one video on top of another.
  59019. </p>
  59020. <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.
  59021. This filter requires all inputs to use the same pixel format. So, format conversion may be needed.
  59022. </p>
  59023. <p>The filter accepts the following options:
  59024. </p>
  59025. <dl class="table">
  59026. <dt><samp class="option">x</samp></dt>
  59027. <dd><p>Set the x coordinate of the overlaid video on the main video.
  59028. Default value is <code class="code">0</code>.
  59029. </p>
  59030. </dd>
  59031. <dt><samp class="option">y</samp></dt>
  59032. <dd><p>Set the y coordinate of the overlaid video on the main video.
  59033. Default value is <code class="code">0</code>.
  59034. </p>
  59035. </dd>
  59036. </dl>
  59037. </div>
  59038. <div class="section-level-extent" id="transpose_005fvt">
  59039. <h3 class="section"><span>42.12 transpose_vt<a class="copiable-link" href="#transpose_005fvt"> &para;</a></span></h3>
  59040. <p>Transpose rows with columns in the input video and optionally flip it.
  59041. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  59042. </p>
  59043. <p>It accepts the following parameters:
  59044. </p>
  59045. <dl class="table">
  59046. <dt><samp class="option">dir</samp></dt>
  59047. <dd><p>Specify the transposition direction.
  59048. </p>
  59049. <p>Can assume the following values:
  59050. </p><dl class="table">
  59051. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  59052. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  59053. </p>
  59054. </dd>
  59055. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  59056. <dd><p>Rotate by 90 degrees clockwise.
  59057. </p>
  59058. </dd>
  59059. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  59060. <dd><p>Rotate by 90 degrees counterclockwise.
  59061. </p>
  59062. </dd>
  59063. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  59064. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  59065. </p>
  59066. </dd>
  59067. <dt>&lsquo;<samp class="samp">hflip</samp>&rsquo;</dt>
  59068. <dd><p>Flip the input video horizontally.
  59069. </p>
  59070. </dd>
  59071. <dt>&lsquo;<samp class="samp">vflip</samp>&rsquo;</dt>
  59072. <dd><p>Flip the input video vertically.
  59073. </p>
  59074. </dd>
  59075. </dl>
  59076. </dd>
  59077. <dt><samp class="option">passthrough</samp></dt>
  59078. <dd><p>Do not apply the transposition if the input geometry matches the one
  59079. specified by the specified value. It accepts the following values:
  59080. </p><dl class="table">
  59081. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  59082. <dd><p>Always apply transposition. (default)
  59083. </p></dd>
  59084. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  59085. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  59086. </p></dd>
  59087. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  59088. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  59089. </p></dd>
  59090. </dl>
  59091. </dd>
  59092. </dl>
  59093. </div>
  59094. <div class="section-level-extent" id="transpose_005fvulkan">
  59095. <h3 class="section"><span>42.13 transpose_vulkan<a class="copiable-link" href="#transpose_005fvulkan"> &para;</a></span></h3>
  59096. <p>Transpose rows with columns in the input video and optionally flip it.
  59097. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  59098. </p>
  59099. <p>It accepts the following parameters:
  59100. </p>
  59101. <dl class="table">
  59102. <dt><samp class="option">dir</samp></dt>
  59103. <dd><p>Specify the transposition direction.
  59104. </p>
  59105. <p>Can assume the following values:
  59106. </p><dl class="table">
  59107. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  59108. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  59109. </p>
  59110. </dd>
  59111. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  59112. <dd><p>Rotate by 90 degrees clockwise.
  59113. </p>
  59114. </dd>
  59115. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  59116. <dd><p>Rotate by 90 degrees counterclockwise.
  59117. </p>
  59118. </dd>
  59119. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  59120. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  59121. </p></dd>
  59122. </dl>
  59123. </dd>
  59124. <dt><samp class="option">passthrough</samp></dt>
  59125. <dd><p>Do not apply the transposition if the input geometry matches the one
  59126. specified by the specified value. It accepts the following values:
  59127. </p><dl class="table">
  59128. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  59129. <dd><p>Always apply transposition. (default)
  59130. </p></dd>
  59131. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  59132. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  59133. </p></dd>
  59134. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  59135. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  59136. </p></dd>
  59137. </dl>
  59138. </dd>
  59139. </dl>
  59140. </div>
  59141. </div>
  59142. <div class="chapter-level-extent" id="QSV-Video-Filters">
  59143. <h2 class="chapter"><span>43 QSV Video Filters<a class="copiable-link" href="#QSV-Video-Filters"> &para;</a></span></h2>
  59144. <p>Below is a description of the currently available QSV video filters.
  59145. </p>
  59146. <p>To enable compilation of these filters you need to configure FFmpeg with
  59147. <code class="code">--enable-libmfx</code> or <code class="code">--enable-libvpl</code>.
  59148. </p>
  59149. <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>
  59150. </p>
  59151. <ul class="mini-toc">
  59152. <li><a href="#hstack_005fqsv" accesskey="1">hstack_qsv</a></li>
  59153. <li><a href="#vstack_005fqsv" accesskey="2">vstack_qsv</a></li>
  59154. <li><a href="#xstack_005fqsv" accesskey="3">xstack_qsv</a></li>
  59155. </ul>
  59156. <div class="section-level-extent" id="hstack_005fqsv">
  59157. <h3 class="section"><span>43.1 hstack_qsv<a class="copiable-link" href="#hstack_005fqsv"> &para;</a></span></h3>
  59158. <p>Stack input videos horizontally.
  59159. </p>
  59160. <p>This is the QSV variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  59161. have different height, this filter will scale down/up each input stream while
  59162. keeping the original aspect.
  59163. </p>
  59164. <p>It accepts the following options:
  59165. </p>
  59166. <dl class="table">
  59167. <dt><samp class="option">inputs</samp></dt>
  59168. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  59169. </p>
  59170. </dd>
  59171. <dt><samp class="option">shortest</samp></dt>
  59172. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  59173. </p>
  59174. </dd>
  59175. <dt><samp class="option">height</samp></dt>
  59176. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  59177. height of the first input stream. Default value is 0.
  59178. </p></dd>
  59179. </dl>
  59180. </div>
  59181. <div class="section-level-extent" id="vstack_005fqsv">
  59182. <h3 class="section"><span>43.2 vstack_qsv<a class="copiable-link" href="#vstack_005fqsv"> &para;</a></span></h3>
  59183. <p>Stack input videos vertically.
  59184. </p>
  59185. <p>This is the QSV variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  59186. have different width, this filter will scale down/up each input stream while
  59187. keeping the original aspect.
  59188. </p>
  59189. <p>It accepts the following options:
  59190. </p>
  59191. <dl class="table">
  59192. <dt><samp class="option">inputs</samp></dt>
  59193. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  59194. </p>
  59195. </dd>
  59196. <dt><samp class="option">shortest</samp></dt>
  59197. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  59198. </p>
  59199. </dd>
  59200. <dt><samp class="option">width</samp></dt>
  59201. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  59202. width of the first input stream. Default value is 0.
  59203. </p></dd>
  59204. </dl>
  59205. </div>
  59206. <div class="section-level-extent" id="xstack_005fqsv">
  59207. <h3 class="section"><span>43.3 xstack_qsv<a class="copiable-link" href="#xstack_005fqsv"> &para;</a></span></h3>
  59208. <p>Stack video inputs into custom layout.
  59209. </p>
  59210. <p>This is the QSV variant of the <a class="ref" href="#xstack">xstack</a> filter.
  59211. </p>
  59212. <p>It accepts the following options:
  59213. </p>
  59214. <dl class="table">
  59215. <dt><samp class="option">inputs</samp></dt>
  59216. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  59217. </p>
  59218. </dd>
  59219. <dt><samp class="option">shortest</samp></dt>
  59220. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  59221. </p>
  59222. </dd>
  59223. <dt><samp class="option">layout</samp></dt>
  59224. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  59225. Moreover, this permits the user to supply output size for each input stream.
  59226. </p><div class="example">
  59227. <pre class="example-preformatted">xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  59228. </pre></div>
  59229. </dd>
  59230. <dt><samp class="option">grid</samp></dt>
  59231. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  59232. </p>
  59233. </dd>
  59234. <dt><samp class="option">grid_tile_size</samp></dt>
  59235. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  59236. is not set, this filter will set output size by default to the size of the
  59237. first input stream. For the syntax of this option, check the
  59238. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59239. </p>
  59240. </dd>
  59241. <dt><samp class="option">fill</samp></dt>
  59242. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  59243. </p></dd>
  59244. </dl>
  59245. </div>
  59246. </div>
  59247. <div class="chapter-level-extent" id="Video-Sources">
  59248. <h2 class="chapter"><span>44 Video Sources<a class="copiable-link" href="#Video-Sources"> &para;</a></span></h2>
  59249. <p>Below is a description of the currently available video sources.
  59250. </p>
  59251. <ul class="mini-toc">
  59252. <li><a href="#buffer" accesskey="1">buffer</a></li>
  59253. <li><a href="#cellauto" accesskey="2">cellauto</a></li>
  59254. <li><a href="#coreimagesrc-1" accesskey="3">coreimagesrc</a></li>
  59255. <li><a href="#ddagrab" accesskey="4">ddagrab</a></li>
  59256. <li><a href="#gradients" accesskey="5">gradients</a></li>
  59257. <li><a href="#mandelbrot" accesskey="6">mandelbrot</a></li>
  59258. <li><a href="#mptestsrc" accesskey="7">mptestsrc</a></li>
  59259. <li><a href="#frei0r_005fsrc" accesskey="8">frei0r_src</a></li>
  59260. <li><a href="#life" accesskey="9">life</a></li>
  59261. <li><a href="#qrencodesrc">qrencodesrc</a></li>
  59262. <li><a href="#allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a></li>
  59263. <li><a href="#openclsrc">openclsrc</a></li>
  59264. <li><a href="#sierpinski">sierpinski</a></li>
  59265. <li><a href="#zoneplate">zoneplate</a></li>
  59266. </ul>
  59267. <div class="section-level-extent" id="buffer">
  59268. <h3 class="section"><span>44.1 buffer<a class="copiable-link" href="#buffer"> &para;</a></span></h3>
  59269. <p>Buffer video frames, and make them available to the filter chain.
  59270. </p>
  59271. <p>This source is mainly intended for a programmatic use, in particular
  59272. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  59273. </p>
  59274. <p>It accepts the following parameters:
  59275. </p>
  59276. <dl class="table">
  59277. <dt><samp class="option">video_size</samp></dt>
  59278. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  59279. syntax of this option, check the
  59280. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59281. </p>
  59282. </dd>
  59283. <dt><samp class="option">width</samp></dt>
  59284. <dd><p>The input video width.
  59285. </p>
  59286. </dd>
  59287. <dt><samp class="option">height</samp></dt>
  59288. <dd><p>The input video height.
  59289. </p>
  59290. </dd>
  59291. <dt><samp class="option">pix_fmt</samp></dt>
  59292. <dd><p>A string representing the pixel format of the buffered video frames.
  59293. It may be a number corresponding to a pixel format, or a pixel format
  59294. name.
  59295. </p>
  59296. </dd>
  59297. <dt><samp class="option">time_base</samp></dt>
  59298. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  59299. </p>
  59300. </dd>
  59301. <dt><samp class="option">frame_rate</samp></dt>
  59302. <dd><p>Specify the frame rate expected for the video stream.
  59303. </p>
  59304. </dd>
  59305. <dt><samp class="option">colorspace</samp></dt>
  59306. <dd><p>A string representing the color space of the buffered video frames.
  59307. It may be a number corresponding to a color space, or a color space
  59308. name.
  59309. </p>
  59310. </dd>
  59311. <dt><samp class="option">range</samp></dt>
  59312. <dd><p>A string representing the color range of the buffered video frames.
  59313. It may be a number corresponding to a color range, or a color range
  59314. name.
  59315. </p>
  59316. </dd>
  59317. <dt><samp class="option">pixel_aspect, sar</samp></dt>
  59318. <dd><p>The sample (pixel) aspect ratio of the input video.
  59319. </p>
  59320. </dd>
  59321. <dt><samp class="option">hw_frames_ctx</samp></dt>
  59322. <dd><p>When using a hardware pixel format, this should be a reference to an
  59323. AVHWFramesContext describing input frames.
  59324. </p></dd>
  59325. </dl>
  59326. <p>For example:
  59327. </p><div class="example">
  59328. <pre class="example-preformatted">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  59329. </pre></div>
  59330. <p>will instruct the source to accept video frames with size 320x240 and
  59331. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  59332. square pixels (1:1 sample aspect ratio).
  59333. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  59334. (check the enum AVPixelFormat definition in <samp class="file">libavutil/pixfmt.h</samp>),
  59335. this example corresponds to:
  59336. </p><div class="example">
  59337. <pre class="example-preformatted">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  59338. </pre></div>
  59339. <p>Alternatively, the options can be specified as a flat string, but this
  59340. syntax is deprecated:
  59341. </p>
  59342. <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>
  59343. </p>
  59344. </div>
  59345. <div class="section-level-extent" id="cellauto">
  59346. <h3 class="section"><span>44.2 cellauto<a class="copiable-link" href="#cellauto"> &para;</a></span></h3>
  59347. <p>Create a pattern generated by an elementary cellular automaton.
  59348. </p>
  59349. <p>The initial state of the cellular automaton can be defined through the
  59350. <samp class="option">filename</samp> and <samp class="option">pattern</samp> options. If such options are
  59351. not specified an initial state is created randomly.
  59352. </p>
  59353. <p>At each new frame a new row in the video is filled with the result of
  59354. the cellular automaton next generation. The behavior when the whole
  59355. frame is filled is defined by the <samp class="option">scroll</samp> option.
  59356. </p>
  59357. <p>This source accepts the following options:
  59358. </p>
  59359. <dl class="table">
  59360. <dt><samp class="option">filename, f</samp></dt>
  59361. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  59362. the specified file.
  59363. In the file, each non-whitespace character is considered an alive
  59364. cell, a newline will terminate the row, and further characters in the
  59365. file will be ignored.
  59366. </p>
  59367. </dd>
  59368. <dt><samp class="option">pattern, p</samp></dt>
  59369. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  59370. the specified string.
  59371. </p>
  59372. <p>Each non-whitespace character in the string is considered an alive
  59373. cell, a newline will terminate the row, and further characters in the
  59374. string will be ignored.
  59375. </p>
  59376. </dd>
  59377. <dt><samp class="option">rate, r</samp></dt>
  59378. <dd><p>Set the video rate, that is the number of frames generated per second.
  59379. Default is 25.
  59380. </p>
  59381. </dd>
  59382. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  59383. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  59384. is a floating point number value ranging from 0 to 1, defaults to
  59385. 1/PHI.
  59386. </p>
  59387. <p>This option is ignored when a file or a pattern is specified.
  59388. </p>
  59389. </dd>
  59390. <dt><samp class="option">random_seed, seed</samp></dt>
  59391. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  59392. included between 0 and UINT32_MAX. If not specified, or if explicitly
  59393. set to -1, the filter will try to use a good random seed on a best
  59394. effort basis.
  59395. </p>
  59396. </dd>
  59397. <dt><samp class="option">rule</samp></dt>
  59398. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  59399. Default value is 110.
  59400. </p>
  59401. </dd>
  59402. <dt><samp class="option">size, s</samp></dt>
  59403. <dd><p>Set the size of the output video. For the syntax of this option, check the
  59404. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59405. </p>
  59406. <p>If <samp class="option">filename</samp> or <samp class="option">pattern</samp> is specified, the size is set
  59407. by default to the width of the specified initial state row, and the
  59408. height is set to <var class="var">width</var> * PHI.
  59409. </p>
  59410. <p>If <samp class="option">size</samp> is set, it must contain the width of the specified
  59411. pattern string, and the specified pattern will be centered in the
  59412. larger row.
  59413. </p>
  59414. <p>If a filename or a pattern string is not specified, the size value
  59415. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  59416. </p>
  59417. </dd>
  59418. <dt><samp class="option">scroll</samp></dt>
  59419. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  59420. have been already filled. If set to 0, the new generated row will be
  59421. written over the top row just after the bottom row is filled.
  59422. Defaults to 1.
  59423. </p>
  59424. </dd>
  59425. <dt><samp class="option">start_full, full</samp></dt>
  59426. <dd><p>If set to 1, completely fill the output with generated rows before
  59427. outputting the first frame.
  59428. This is the default behavior, for disabling set the value to 0.
  59429. </p>
  59430. </dd>
  59431. <dt><samp class="option">stitch</samp></dt>
  59432. <dd><p>If set to 1, stitch the left and right row edges together.
  59433. This is the default behavior, for disabling set the value to 0.
  59434. </p></dd>
  59435. </dl>
  59436. <ul class="mini-toc">
  59437. <li><a href="#Examples-192" accesskey="1">Examples</a></li>
  59438. </ul>
  59439. <div class="subsection-level-extent" id="Examples-192">
  59440. <h4 class="subsection"><span>44.2.1 Examples<a class="copiable-link" href="#Examples-192"> &para;</a></span></h4>
  59441. <ul class="itemize mark-bullet">
  59442. <li>Read the initial state from <samp class="file">pattern</samp>, and specify an output of
  59443. size 200x400.
  59444. <div class="example">
  59445. <pre class="example-preformatted">cellauto=f=pattern:s=200x400
  59446. </pre></div>
  59447. </li><li>Generate a random initial row with a width of 200 cells, with a fill
  59448. ratio of 2/3:
  59449. <div class="example">
  59450. <pre class="example-preformatted">cellauto=ratio=2/3:s=200x200
  59451. </pre></div>
  59452. </li><li>Create a pattern generated by rule 18 starting by a single alive cell
  59453. centered on an initial row with width 100:
  59454. <div class="example">
  59455. <pre class="example-preformatted">cellauto=p=@:s=100x400:full=0:rule=18
  59456. </pre></div>
  59457. </li><li>Specify a more elaborated initial pattern:
  59458. <div class="example">
  59459. <pre class="example-preformatted">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  59460. </pre></div>
  59461. </li></ul>
  59462. <a class="anchor" id="coreimagesrc"></a></div>
  59463. </div>
  59464. <div class="section-level-extent" id="coreimagesrc-1">
  59465. <h3 class="section"><span>44.3 coreimagesrc<a class="copiable-link" href="#coreimagesrc-1"> &para;</a></span></h3>
  59466. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  59467. </p>
  59468. <p>This video source is a specialized version of the <a class="ref" href="#coreimage">coreimage</a> video filter.
  59469. Use a core image generator at the beginning of the applied filterchain to
  59470. generate the content.
  59471. </p>
  59472. <p>The coreimagesrc video source accepts the following options:
  59473. </p><dl class="table">
  59474. <dt><samp class="option">list_generators</samp></dt>
  59475. <dd><p>List all available generators along with all their respective options as well as
  59476. possible minimum and maximum values along with the default values.
  59477. </p><div class="example">
  59478. <pre class="example-preformatted">list_generators=true
  59479. </pre></div>
  59480. </dd>
  59481. <dt><samp class="option">size, s</samp></dt>
  59482. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  59483. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59484. The default value is <code class="code">320x240</code>.
  59485. </p>
  59486. </dd>
  59487. <dt><samp class="option">rate, r</samp></dt>
  59488. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  59489. generated per second. It has to be a string in the format
  59490. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  59491. number or a valid video frame rate abbreviation. The default value is
  59492. &quot;25&quot;.
  59493. </p>
  59494. </dd>
  59495. <dt><samp class="option">sar</samp></dt>
  59496. <dd><p>Set the sample aspect ratio of the sourced video.
  59497. </p>
  59498. </dd>
  59499. <dt><samp class="option">duration, d</samp></dt>
  59500. <dd><p>Set the duration of the sourced video. See
  59501. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  59502. for the accepted syntax.
  59503. </p>
  59504. <p>If not specified, or the expressed duration is negative, the video is
  59505. supposed to be generated forever.
  59506. </p></dd>
  59507. </dl>
  59508. <p>Additionally, all options of the <a class="ref" href="#coreimage">coreimage</a> video filter are accepted.
  59509. A complete filterchain can be used for further processing of the
  59510. generated input without CPU-HOST transfer. See <a class="ref" href="#coreimage">coreimage</a> documentation
  59511. and examples for details.
  59512. </p>
  59513. <ul class="mini-toc">
  59514. <li><a href="#Examples-193" accesskey="1">Examples</a></li>
  59515. </ul>
  59516. <div class="subsection-level-extent" id="Examples-193">
  59517. <h4 class="subsection"><span>44.3.1 Examples<a class="copiable-link" href="#Examples-193"> &para;</a></span></h4>
  59518. <ul class="itemize mark-bullet">
  59519. <li>Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  59520. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  59521. <div class="example">
  59522. <pre class="example-preformatted">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  59523. </pre></div>
  59524. <p>This example is equivalent to the QRCode example of <a class="ref" href="#coreimage">coreimage</a> without the
  59525. need for a nullsrc video source.
  59526. </p></li></ul>
  59527. </div>
  59528. </div>
  59529. <div class="section-level-extent" id="ddagrab">
  59530. <h3 class="section"><span>44.4 ddagrab<a class="copiable-link" href="#ddagrab"> &para;</a></span></h3>
  59531. <p>Captures the Windows Desktop via Desktop Duplication API.
  59532. </p>
  59533. <p>The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding
  59534. or processing. So an explicit <a class="ref" href="#hwdownload">hwdownload</a> is needed for any kind of
  59535. software processing.
  59536. </p>
  59537. <p>It accepts the following options:
  59538. </p>
  59539. <dl class="table">
  59540. <dt><samp class="option">output_idx</samp></dt>
  59541. <dd><p>DXGI Output Index to capture.
  59542. </p>
  59543. <p>Usually corresponds to the index Windows has given the screen minus one,
  59544. so it&rsquo;s starting at 0.
  59545. </p>
  59546. <p>Defaults to output 0.
  59547. </p>
  59548. </dd>
  59549. <dt><samp class="option">draw_mouse</samp></dt>
  59550. <dd><p>Whether to draw the mouse cursor.
  59551. </p>
  59552. <p>Defaults to true.
  59553. </p>
  59554. <p>Only affects hardware cursors. If a game or application renders its own cursor,
  59555. it&rsquo;ll always be captured.
  59556. </p>
  59557. </dd>
  59558. <dt><samp class="option">framerate</samp></dt>
  59559. <dd><p>Maximum framerate at which the desktop will be captured - the interval between
  59560. successive frames will not be smaller than the inverse of the framerate. When
  59561. <var class="var">dup_frames</var> is true (the default) and the desktop is not being updated
  59562. often enough, the filter will duplicate a previous frame. Note that there is no
  59563. background buffering going on, so when the filter is not polled often enough
  59564. then the actual inter-frame interval may be significantly larger.
  59565. </p>
  59566. <p>Defaults to 30 FPS.
  59567. </p>
  59568. </dd>
  59569. <dt><samp class="option">video_size</samp></dt>
  59570. <dd><p>Specify the size of the captured video.
  59571. </p>
  59572. <p>Defaults to the full size of the screen.
  59573. </p>
  59574. <p>Cropped from the bottom/right if smaller than screen size.
  59575. </p>
  59576. </dd>
  59577. <dt><samp class="option">offset_x</samp></dt>
  59578. <dd><p>Horizontal offset of the captured video.
  59579. </p>
  59580. </dd>
  59581. <dt><samp class="option">offset_y</samp></dt>
  59582. <dd><p>Vertical offset of the captured video.
  59583. </p>
  59584. </dd>
  59585. <dt><samp class="option">output_fmt</samp></dt>
  59586. <dd><p>Desired filter output format.
  59587. Defaults to 8 Bit BGRA.
  59588. </p>
  59589. <p>It accepts the following values:
  59590. </p><dl class="table">
  59591. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  59592. <dd><p>Passes all supported output formats to DDA and returns what DDA decides to use.
  59593. </p></dd>
  59594. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  59595. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  59596. <dd><p>8 Bit formats always work, and DDA will convert to them if necessary.
  59597. </p></dd>
  59598. <dt>&lsquo;<samp class="samp">10bit</samp>&rsquo;</dt>
  59599. <dt>&lsquo;<samp class="samp">x2bgr10</samp>&rsquo;</dt>
  59600. <dd><p>Filter initialization will fail if 10 bit format is requested but unavailable.
  59601. </p></dd>
  59602. </dl>
  59603. </dd>
  59604. <dt><samp class="option">dup_frames</samp></dt>
  59605. <dd><p>When this option is set to true (the default), the filter will duplicate frames
  59606. when the desktop has not been updated in order to maintain approximately
  59607. constant target framerate. When this option is set to false, the filter will
  59608. wait for the desktop to be updated (inter-frame intervals may vary significantly
  59609. in this case).
  59610. </p>
  59611. </dd>
  59612. </dl>
  59613. <ul class="mini-toc">
  59614. <li><a href="#Examples-194" accesskey="1">Examples</a></li>
  59615. </ul>
  59616. <div class="subsection-level-extent" id="Examples-194">
  59617. <h4 class="subsection"><span>44.4.1 Examples<a class="copiable-link" href="#Examples-194"> &para;</a></span></h4>
  59618. <p>Capture primary screen and encode using nvenc:
  59619. </p><div class="example">
  59620. <pre class="example-preformatted">ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
  59621. </pre></div>
  59622. <p>You can also skip the lavfi device and directly use the filter.
  59623. Also demonstrates downloading the frame and encoding with libx264.
  59624. Explicit output format specification is required in this case:
  59625. </p><div class="example">
  59626. <pre class="example-preformatted">ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
  59627. </pre></div>
  59628. <p>If you want to capture only a subsection of the desktop, this can be achieved
  59629. by specifying a smaller size and its offsets into the screen:
  59630. </p><div class="example">
  59631. <pre class="example-preformatted">ddagrab=video_size=800x600:offset_x=100:offset_y=100
  59632. </pre></div>
  59633. </div>
  59634. </div>
  59635. <div class="section-level-extent" id="gradients">
  59636. <h3 class="section"><span>44.5 gradients<a class="copiable-link" href="#gradients"> &para;</a></span></h3>
  59637. <p>Generate several gradients.
  59638. </p>
  59639. <dl class="table">
  59640. <dt><samp class="option">size, s</samp></dt>
  59641. <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
  59642. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  59643. </p>
  59644. </dd>
  59645. <dt><samp class="option">rate, r</samp></dt>
  59646. <dd><p>Set frame rate, expressed as number of frames per second. Default
  59647. value is &quot;25&quot;.
  59648. </p>
  59649. </dd>
  59650. <dt><samp class="option">c0, c1, c2, c3, c4, c5, c6, c7</samp></dt>
  59651. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  59652. </p>
  59653. </dd>
  59654. <dt><samp class="option">x0, y0, y0, y1</samp></dt>
  59655. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  59656. are picked.
  59657. </p>
  59658. </dd>
  59659. <dt><samp class="option">nb_colors, n</samp></dt>
  59660. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  59661. </p>
  59662. </dd>
  59663. <dt><samp class="option">seed</samp></dt>
  59664. <dd><p>Set seed for picking gradient line points.
  59665. </p>
  59666. </dd>
  59667. <dt><samp class="option">duration, d</samp></dt>
  59668. <dd><p>Set the duration of the sourced video. See
  59669. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  59670. for the accepted syntax.
  59671. </p>
  59672. <p>If not specified, or the expressed duration is negative, the video is
  59673. supposed to be generated forever.
  59674. </p>
  59675. </dd>
  59676. <dt><samp class="option">speed</samp></dt>
  59677. <dd><p>Set speed of gradients rotation.
  59678. </p>
  59679. </dd>
  59680. <dt><samp class="option">type, t</samp></dt>
  59681. <dd><p>Set type of gradients.
  59682. Available values are:
  59683. </p><dl class="table">
  59684. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  59685. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  59686. <dt>&lsquo;<samp class="samp">circular</samp>&rsquo;</dt>
  59687. <dt>&lsquo;<samp class="samp">spiral</samp>&rsquo;</dt>
  59688. <dt>&lsquo;<samp class="samp">square</samp>&rsquo;</dt>
  59689. </dl>
  59690. <p>Default type is <var class="var">linear</var>.
  59691. </p></dd>
  59692. </dl>
  59693. <ul class="mini-toc">
  59694. <li><a href="#Commands-157" accesskey="1">Commands</a></li>
  59695. </ul>
  59696. <div class="subsection-level-extent" id="Commands-157">
  59697. <h4 class="subsection"><span>44.5.1 Commands<a class="copiable-link" href="#Commands-157"> &para;</a></span></h4>
  59698. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  59699. </p>
  59700. </div>
  59701. </div>
  59702. <div class="section-level-extent" id="mandelbrot">
  59703. <h3 class="section"><span>44.6 mandelbrot<a class="copiable-link" href="#mandelbrot"> &para;</a></span></h3>
  59704. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  59705. point specified with <var class="var">start_x</var> and <var class="var">start_y</var>.
  59706. </p>
  59707. <p>This source accepts the following options:
  59708. </p>
  59709. <dl class="table">
  59710. <dt><samp class="option">end_pts</samp></dt>
  59711. <dd><p>Set the terminal pts value. Default value is 400.
  59712. </p>
  59713. </dd>
  59714. <dt><samp class="option">end_scale</samp></dt>
  59715. <dd><p>Set the terminal scale value.
  59716. Must be a floating point value. Default value is 0.3.
  59717. </p>
  59718. </dd>
  59719. <dt><samp class="option">inner</samp></dt>
  59720. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  59721. Mandelbrot fractal internal region.
  59722. </p>
  59723. <p>It shall assume one of the following values:
  59724. </p><dl class="table">
  59725. <dt><samp class="option">black</samp></dt>
  59726. <dd><p>Set black mode.
  59727. </p></dd>
  59728. <dt><samp class="option">convergence</samp></dt>
  59729. <dd><p>Show time until convergence.
  59730. </p></dd>
  59731. <dt><samp class="option">mincol</samp></dt>
  59732. <dd><p>Set color based on point closest to the origin of the iterations.
  59733. </p></dd>
  59734. <dt><samp class="option">period</samp></dt>
  59735. <dd><p>Set period mode.
  59736. </p></dd>
  59737. </dl>
  59738. <p>Default value is <var class="var">mincol</var>.
  59739. </p>
  59740. </dd>
  59741. <dt><samp class="option">bailout</samp></dt>
  59742. <dd><p>Set the bailout value. Default value is 10.0.
  59743. </p>
  59744. </dd>
  59745. <dt><samp class="option">maxiter</samp></dt>
  59746. <dd><p>Set the maximum of iterations performed by the rendering
  59747. algorithm. Default value is 7189.
  59748. </p>
  59749. </dd>
  59750. <dt><samp class="option">outer</samp></dt>
  59751. <dd><p>Set outer coloring mode.
  59752. It shall assume one of following values:
  59753. </p><dl class="table">
  59754. <dt><samp class="option">iteration_count</samp></dt>
  59755. <dd><p>Set iteration count mode.
  59756. </p></dd>
  59757. <dt><samp class="option">normalized_iteration_count</samp></dt>
  59758. <dd><p>set normalized iteration count mode.
  59759. </p></dd>
  59760. </dl>
  59761. <p>Default value is <var class="var">normalized_iteration_count</var>.
  59762. </p>
  59763. </dd>
  59764. <dt><samp class="option">rate, r</samp></dt>
  59765. <dd><p>Set frame rate, expressed as number of frames per second. Default
  59766. value is &quot;25&quot;.
  59767. </p>
  59768. </dd>
  59769. <dt><samp class="option">size, s</samp></dt>
  59770. <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
  59771. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  59772. </p>
  59773. </dd>
  59774. <dt><samp class="option">start_scale</samp></dt>
  59775. <dd><p>Set the initial scale value. Default value is 3.0.
  59776. </p>
  59777. </dd>
  59778. <dt><samp class="option">start_x</samp></dt>
  59779. <dd><p>Set the initial x position. Must be a floating point value between
  59780. -100 and 100. Default value is -0.743643887037158704752191506114774.
  59781. </p>
  59782. </dd>
  59783. <dt><samp class="option">start_y</samp></dt>
  59784. <dd><p>Set the initial y position. Must be a floating point value between
  59785. -100 and 100. Default value is -0.131825904205311970493132056385139.
  59786. </p></dd>
  59787. </dl>
  59788. </div>
  59789. <div class="section-level-extent" id="mptestsrc">
  59790. <h3 class="section"><span>44.7 mptestsrc<a class="copiable-link" href="#mptestsrc"> &para;</a></span></h3>
  59791. <p>Generate various test patterns, as generated by the MPlayer test filter.
  59792. </p>
  59793. <p>The size of the generated video is fixed, and is 256x256.
  59794. This source is useful in particular for testing encoding features.
  59795. </p>
  59796. <p>This source accepts the following options:
  59797. </p>
  59798. <dl class="table">
  59799. <dt><samp class="option">rate, r</samp></dt>
  59800. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  59801. generated per second. It has to be a string in the format
  59802. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  59803. number or a valid video frame rate abbreviation. The default value is
  59804. &quot;25&quot;.
  59805. </p>
  59806. </dd>
  59807. <dt><samp class="option">duration, d</samp></dt>
  59808. <dd><p>Set the duration of the sourced video. See
  59809. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  59810. for the accepted syntax.
  59811. </p>
  59812. <p>If not specified, or the expressed duration is negative, the video is
  59813. supposed to be generated forever.
  59814. </p>
  59815. </dd>
  59816. <dt><samp class="option">test, t</samp></dt>
  59817. <dd>
  59818. <p>Set the number or the name of the test to perform. Supported tests are:
  59819. </p><dl class="table">
  59820. <dt><samp class="option">dc_luma</samp></dt>
  59821. <dt><samp class="option">dc_chroma</samp></dt>
  59822. <dt><samp class="option">freq_luma</samp></dt>
  59823. <dt><samp class="option">freq_chroma</samp></dt>
  59824. <dt><samp class="option">amp_luma</samp></dt>
  59825. <dt><samp class="option">amp_chroma</samp></dt>
  59826. <dt><samp class="option">cbp</samp></dt>
  59827. <dt><samp class="option">mv</samp></dt>
  59828. <dt><samp class="option">ring1</samp></dt>
  59829. <dt><samp class="option">ring2</samp></dt>
  59830. <dt><samp class="option">all</samp></dt>
  59831. <dt><samp class="option">max_frames, m</samp></dt>
  59832. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  59833. </p>
  59834. </dd>
  59835. </dl>
  59836. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  59837. </p></dd>
  59838. </dl>
  59839. <p>Some examples:
  59840. </p><div class="example">
  59841. <pre class="example-preformatted">mptestsrc=t=dc_luma
  59842. </pre></div>
  59843. <p>will generate a &quot;dc_luma&quot; test pattern.
  59844. </p>
  59845. </div>
  59846. <div class="section-level-extent" id="frei0r_005fsrc">
  59847. <h3 class="section"><span>44.8 frei0r_src<a class="copiable-link" href="#frei0r_005fsrc"> &para;</a></span></h3>
  59848. <p>Provide a frei0r source.
  59849. </p>
  59850. <p>To enable compilation of this filter you need to install the frei0r
  59851. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  59852. </p>
  59853. <p>This source accepts the following parameters:
  59854. </p>
  59855. <dl class="table">
  59856. <dt><samp class="option">size</samp></dt>
  59857. <dd><p>The size of the video to generate. For the syntax of this option, check the
  59858. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59859. </p>
  59860. </dd>
  59861. <dt><samp class="option">framerate</samp></dt>
  59862. <dd><p>The framerate of the generated video. It may be a string of the form
  59863. <var class="var">num</var>/<var class="var">den</var> or a frame rate abbreviation.
  59864. </p>
  59865. </dd>
  59866. <dt><samp class="option">filter_name</samp></dt>
  59867. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  59868. how to set the parameters, read the <a class="ref" href="#frei0r">frei0r</a> section in the video filters
  59869. documentation.
  59870. </p>
  59871. </dd>
  59872. <dt><samp class="option">filter_params</samp></dt>
  59873. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  59874. </p>
  59875. </dd>
  59876. </dl>
  59877. <p>For example, to generate a frei0r partik0l source with size 200x200
  59878. and frame rate 10 which is overlaid on the overlay filter main input:
  59879. </p><div class="example">
  59880. <pre class="example-preformatted">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  59881. </pre></div>
  59882. </div>
  59883. <div class="section-level-extent" id="life">
  59884. <h3 class="section"><span>44.9 life<a class="copiable-link" href="#life"> &para;</a></span></h3>
  59885. <p>Generate a life pattern.
  59886. </p>
  59887. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  59888. </p>
  59889. <p>The sourced input represents a life grid, each pixel represents a cell
  59890. which can be in one of two possible states, alive or dead. Every cell
  59891. interacts with its eight neighbours, which are the cells that are
  59892. horizontally, vertically, or diagonally adjacent.
  59893. </p>
  59894. <p>At each interaction the grid evolves according to the adopted rule,
  59895. which specifies the number of neighbor alive cells which will make a
  59896. cell stay alive or born. The <samp class="option">rule</samp> option allows one to specify
  59897. the rule to adopt.
  59898. </p>
  59899. <p>This source accepts the following options:
  59900. </p>
  59901. <dl class="table">
  59902. <dt><samp class="option">filename, f</samp></dt>
  59903. <dd><p>Set the file from which to read the initial grid state. In the file,
  59904. each non-whitespace character is considered an alive cell, and newline
  59905. is used to delimit the end of each row.
  59906. </p>
  59907. <p>If this option is not specified, the initial grid is generated
  59908. randomly.
  59909. </p>
  59910. </dd>
  59911. <dt><samp class="option">rate, r</samp></dt>
  59912. <dd><p>Set the video rate, that is the number of frames generated per second.
  59913. Default is 25.
  59914. </p>
  59915. </dd>
  59916. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  59917. <dd><p>Set the random fill ratio for the initial random grid. It is a
  59918. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  59919. It is ignored when a file is specified.
  59920. </p>
  59921. </dd>
  59922. <dt><samp class="option">random_seed, seed</samp></dt>
  59923. <dd><p>Set the seed for filling the initial random grid, must be an integer
  59924. included between 0 and UINT32_MAX. If not specified, or if explicitly
  59925. set to -1, the filter will try to use a good random seed on a best
  59926. effort basis.
  59927. </p>
  59928. </dd>
  59929. <dt><samp class="option">rule</samp></dt>
  59930. <dd><p>Set the life rule.
  59931. </p>
  59932. <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;,
  59933. where <var class="var">NS</var> and <var class="var">NB</var> are sequences of numbers in the range 0-8,
  59934. <var class="var">NS</var> specifies the number of alive neighbor cells which make a
  59935. live cell stay alive, and <var class="var">NB</var> the number of alive neighbor cells
  59936. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  59937. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  59938. </p>
  59939. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  59940. high order bits are used to encode the next cell state if it is alive
  59941. for each number of neighbor alive cells, the low order bits specify
  59942. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  59943. higher number of neighbor cells.
  59944. For example the number 6153 = <code class="code">(12&lt;&lt;9)+9</code> specifies a stay alive
  59945. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  59946. </p>
  59947. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  59948. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  59949. cells, and will born a new cell if there are three alive cells around
  59950. a dead cell.
  59951. </p>
  59952. </dd>
  59953. <dt><samp class="option">size, s</samp></dt>
  59954. <dd><p>Set the size of the output video. For the syntax of this option, check the
  59955. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  59956. </p>
  59957. <p>If <samp class="option">filename</samp> is specified, the size is set by default to the
  59958. same size of the input file. If <samp class="option">size</samp> is set, it must contain
  59959. the size specified in the input file, and the initial grid defined in
  59960. that file is centered in the larger resulting area.
  59961. </p>
  59962. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  59963. (used for a randomly generated initial grid).
  59964. </p>
  59965. </dd>
  59966. <dt><samp class="option">stitch</samp></dt>
  59967. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  59968. top and bottom edges also. Defaults to 1.
  59969. </p>
  59970. </dd>
  59971. <dt><samp class="option">mold</samp></dt>
  59972. <dd><p>Set cell mold speed. If set, a dead cell will go from <samp class="option">death_color</samp> to
  59973. <samp class="option">mold_color</samp> with a step of <samp class="option">mold</samp>. <samp class="option">mold</samp> can have a
  59974. value from 0 to 255.
  59975. </p>
  59976. </dd>
  59977. <dt><samp class="option">life_color</samp></dt>
  59978. <dd><p>Set the color of living (or new born) cells.
  59979. </p>
  59980. </dd>
  59981. <dt><samp class="option">death_color</samp></dt>
  59982. <dd><p>Set the color of dead cells. If <samp class="option">mold</samp> is set, this is the first color
  59983. used to represent a dead cell.
  59984. </p>
  59985. </dd>
  59986. <dt><samp class="option">mold_color</samp></dt>
  59987. <dd><p>Set mold color, for definitely dead and moldy cells.
  59988. </p>
  59989. <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
  59990. ffmpeg-utils manual</a>.
  59991. </p></dd>
  59992. </dl>
  59993. <ul class="mini-toc">
  59994. <li><a href="#Examples-195" accesskey="1">Examples</a></li>
  59995. </ul>
  59996. <div class="subsection-level-extent" id="Examples-195">
  59997. <h4 class="subsection"><span>44.9.1 Examples<a class="copiable-link" href="#Examples-195"> &para;</a></span></h4>
  59998. <ul class="itemize mark-bullet">
  59999. <li>Read a grid from <samp class="file">pattern</samp>, and center it on a grid of size
  60000. 300x300 pixels:
  60001. <div class="example">
  60002. <pre class="example-preformatted">life=f=pattern:s=300x300
  60003. </pre></div>
  60004. </li><li>Generate a random grid of size 200x200, with a fill ratio of 2/3:
  60005. <div class="example">
  60006. <pre class="example-preformatted">life=ratio=2/3:s=200x200
  60007. </pre></div>
  60008. </li><li>Specify a custom rule for evolving a randomly generated grid:
  60009. <div class="example">
  60010. <pre class="example-preformatted">life=rule=S14/B34
  60011. </pre></div>
  60012. </li><li>Full example with slow death effect (mold) using <code class="command">ffplay</code>:
  60013. <div class="example">
  60014. <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
  60015. </pre></div>
  60016. </li></ul>
  60017. </div>
  60018. </div>
  60019. <div class="section-level-extent" id="qrencodesrc">
  60020. <h3 class="section"><span>44.10 qrencodesrc<a class="copiable-link" href="#qrencodesrc"> &para;</a></span></h3>
  60021. <p>Generate a QR code using the libqrencode library (see
  60022. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>).
  60023. </p>
  60024. <p>To enable the compilation of this source, you need to configure FFmpeg with
  60025. <code class="code">--enable-libqrencode</code>.
  60026. </p>
  60027. <p>The QR code is generated from the provided text or text pattern. The
  60028. corresponding QR code is scaled and put in the video output according to the
  60029. specified output size options.
  60030. </p>
  60031. <p>In case no text is specified, the QR code is not generated, but an empty colored
  60032. output is returned instead.
  60033. </p>
  60034. <p>This source accepts the following options:
  60035. </p>
  60036. <dl class="table">
  60037. <dt><samp class="option">qrcode_width, q</samp></dt>
  60038. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  60039. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  60040. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  60041. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  60042. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  60043. there is no padding.
  60044. </p>
  60045. <p>These expressions are evaluated only once, when initializing the source.
  60046. See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  60047. </p>
  60048. <p>Note that some of the constants are missing for the source (for example the
  60049. <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
  60050. expression for each frame rather than at initialization time.
  60051. </p>
  60052. </dd>
  60053. <dt><samp class="option">rate, r</samp></dt>
  60054. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  60055. generated per second. It has to be a string in the format
  60056. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  60057. number or a valid video frame rate abbreviation. The default value is
  60058. &quot;25&quot;.
  60059. </p>
  60060. </dd>
  60061. <dt><samp class="option">case_sensitive, cs</samp></dt>
  60062. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  60063. default. This can be disabled to reduce the QR encoding size.
  60064. </p>
  60065. </dd>
  60066. <dt><samp class="option">level, l</samp></dt>
  60067. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  60068. the encoding size will increase but the code will be more robust to corruption.
  60069. Lower level is <var class="var">L</var>.
  60070. </p>
  60071. <p>It accepts the following values:
  60072. </p><dl class="table">
  60073. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  60074. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  60075. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  60076. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  60077. </dl>
  60078. </dd>
  60079. <dt><samp class="option">expansion</samp></dt>
  60080. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  60081. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  60082. section for details.
  60083. </p>
  60084. </dd>
  60085. <dt><samp class="option">text</samp></dt>
  60086. <dt><samp class="option">textfile</samp></dt>
  60087. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  60088. (just an empty colored frame).
  60089. </p>
  60090. <p>In case expansion is enabled, the text is treated as a text template, using the
  60091. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  60092. Text expansion</a> section for details.
  60093. </p>
  60094. </dd>
  60095. <dt><samp class="option">background_color, bc</samp></dt>
  60096. <dt><samp class="option">foreground_color, fc</samp></dt>
  60097. <dd><p>Set the QR code and background color. The default value of
  60098. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  60099. is &quot;white&quot;.
  60100. </p>
  60101. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  60102. section in the ffmpeg-utils manual</a>.
  60103. </p></dd>
  60104. </dl>
  60105. <ul class="mini-toc">
  60106. <li><a href="#Examples-196" accesskey="1">Examples</a></li>
  60107. </ul>
  60108. <div class="subsection-level-extent" id="Examples-196">
  60109. <h4 class="subsection"><span>44.10.1 Examples<a class="copiable-link" href="#Examples-196"> &para;</a></span></h4>
  60110. <ul class="itemize mark-bullet">
  60111. <li>Generate a QR code encoding the specified text with the default size:
  60112. <div class="example">
  60113. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org
  60114. </pre></div>
  60115. </li><li>Same as below, but select blue on pink colors:
  60116. <div class="example">
  60117. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:bc=pink:fc=blue
  60118. </pre></div>
  60119. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  60120. 4/3 of the QR code width:
  60121. <div class="example">
  60122. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:q=200:Q=4/3*q
  60123. </pre></div>
  60124. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  60125. code width 3/4 of the padded width:
  60126. <div class="example">
  60127. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:Q=200:q=3/4*Q
  60128. </pre></div>
  60129. </li><li>Generate a QR code encoding the frame number:
  60130. <div class="example">
  60131. <pre class="example-preformatted">qrencodesrc=text=%{n}
  60132. </pre></div>
  60133. </li><li>Generate a QR code encoding the GMT timestamp:
  60134. <div class="example">
  60135. <pre class="example-preformatted">qrencodesrc=text=%{gmtime}
  60136. </pre></div>
  60137. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  60138. <div class="example">
  60139. <pre class="example-preformatted">qrencodesrc=text=%{pts}
  60140. </pre></div>
  60141. </li></ul>
  60142. <a class="anchor" id="allrgb"></a><a class="anchor" id="allyuv"></a><a class="anchor" id="color"></a><a class="anchor" id="colorchart"></a><a class="anchor" id="colorspectrum"></a><a class="anchor" id="haldclutsrc"></a><a class="anchor" id="nullsrc"></a><a class="anchor" id="pal75bars"></a><a class="anchor" id="pal100bars"></a><a class="anchor" id="rgbtestsrc"></a><a class="anchor" id="smptebars"></a><a class="anchor" id="smptehdbars"></a><a class="anchor" id="testsrc"></a><a class="anchor" id="testsrc2"></a><a class="anchor" id="yuvtestsrc"></a></div>
  60143. </div>
  60144. <div class="section-level-extent" id="allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">
  60145. <h3 class="section"><span>44.11 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc<a class="copiable-link" href="#allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc"> &para;</a></span></h3>
  60146. <p>The <code class="code">allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  60147. </p>
  60148. <p>The <code class="code">allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  60149. </p>
  60150. <p>The <code class="code">color</code> source provides an uniformly colored input.
  60151. </p>
  60152. <p>The <code class="code">colorchart</code> source provides a colors checker chart.
  60153. </p>
  60154. <p>The <code class="code">colorspectrum</code> source provides a color spectrum input.
  60155. </p>
  60156. <p>The <code class="code">haldclutsrc</code> source provides an identity Hald CLUT. See also
  60157. <a class="ref" href="#haldclut">haldclut</a> filter.
  60158. </p>
  60159. <p>The <code class="code">nullsrc</code> source returns unprocessed video frames. It is
  60160. mainly useful to be employed in analysis / debugging tools, or as the
  60161. source for filters which ignore the input data.
  60162. </p>
  60163. <p>The <code class="code">pal75bars</code> source generates a color bars pattern, based on
  60164. EBU PAL recommendations with 75% color levels.
  60165. </p>
  60166. <p>The <code class="code">pal100bars</code> source generates a color bars pattern, based on
  60167. EBU PAL recommendations with 100% color levels.
  60168. </p>
  60169. <p>The <code class="code">rgbtestsrc</code> source generates an RGB test pattern useful for
  60170. detecting RGB vs BGR issues. You should see a red, green and blue
  60171. stripe from top to bottom.
  60172. </p>
  60173. <p>The <code class="code">smptebars</code> source generates a color bars pattern, based on
  60174. the SMPTE Engineering Guideline EG 1-1990.
  60175. </p>
  60176. <p>The <code class="code">smptehdbars</code> source generates a color bars pattern, based on
  60177. the SMPTE RP 219-2002.
  60178. </p>
  60179. <p>The <code class="code">testsrc</code> source generates a test video pattern, showing a
  60180. color pattern, a scrolling gradient and a timestamp. This is mainly
  60181. intended for testing purposes.
  60182. </p>
  60183. <p>The <code class="code">testsrc2</code> source is similar to testsrc, but supports more
  60184. pixel formats instead of just <code class="code">rgb24</code>. This allows using it as an
  60185. input for other tests without requiring a format conversion.
  60186. </p>
  60187. <p>The <code class="code">yuvtestsrc</code> source generates an YUV test pattern. You should
  60188. see a y, cb and cr stripe from top to bottom.
  60189. </p>
  60190. <p>The sources accept the following parameters:
  60191. </p>
  60192. <dl class="table">
  60193. <dt><samp class="option">level</samp></dt>
  60194. <dd><p>Specify the level of the Hald CLUT, only available in the <code class="code">haldclutsrc</code>
  60195. 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>
  60196. pixels to be used as identity matrix for 3D lookup tables. Each component is
  60197. coded on a <code class="code">1/(N*N)</code> scale.
  60198. </p>
  60199. </dd>
  60200. <dt><samp class="option">color, c</samp></dt>
  60201. <dd><p>Specify the color of the source, only available in the <code class="code">color</code>
  60202. source. For the syntax of this option, check the
  60203. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  60204. </p>
  60205. </dd>
  60206. <dt><samp class="option">size, s</samp></dt>
  60207. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  60208. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60209. The default value is <code class="code">320x240</code>.
  60210. </p>
  60211. <p>This option is not available with the <code class="code">allrgb</code>, <code class="code">allyuv</code>, and
  60212. <code class="code">haldclutsrc</code> filters.
  60213. </p>
  60214. </dd>
  60215. <dt><samp class="option">rate, r</samp></dt>
  60216. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  60217. generated per second. It has to be a string in the format
  60218. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  60219. number or a valid video frame rate abbreviation. The default value is
  60220. &quot;25&quot;.
  60221. </p>
  60222. </dd>
  60223. <dt><samp class="option">duration, d</samp></dt>
  60224. <dd><p>Set the duration of the sourced video. See
  60225. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  60226. for the accepted syntax.
  60227. </p>
  60228. <p>If not specified, or the expressed duration is negative, the video is
  60229. supposed to be generated forever.
  60230. </p>
  60231. <p>Since the frame rate is used as time base, all frames including the last one
  60232. will have their full duration. If the specified duration is not a multiple
  60233. of the frame duration, it will be rounded up.
  60234. </p>
  60235. </dd>
  60236. <dt><samp class="option">sar</samp></dt>
  60237. <dd><p>Set the sample aspect ratio of the sourced video.
  60238. </p>
  60239. </dd>
  60240. <dt><samp class="option">alpha</samp></dt>
  60241. <dd><p>Specify the alpha (opacity) of the background, only available in the
  60242. <code class="code">testsrc2</code> source. The value must be between 0 (fully transparent) and
  60243. 255 (fully opaque, the default).
  60244. </p>
  60245. </dd>
  60246. <dt><samp class="option">decimals, n</samp></dt>
  60247. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  60248. <code class="code">testsrc</code> source.
  60249. </p>
  60250. <p>The displayed timestamp value will correspond to the original
  60251. timestamp value multiplied by the power of 10 of the specified
  60252. value. Default value is 0.
  60253. </p>
  60254. </dd>
  60255. <dt><samp class="option">type</samp></dt>
  60256. <dd><p>Set the type of the color spectrum, only available in the
  60257. <code class="code">colorspectrum</code> source. Can be one of the following:
  60258. </p>
  60259. <dl class="table">
  60260. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  60261. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  60262. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  60263. </dl>
  60264. </dd>
  60265. <dt><samp class="option">patch_size</samp></dt>
  60266. <dd><p>Set patch size of single color patch, only available in the
  60267. <code class="code">colorchart</code> source. Default is <code class="code">64x64</code>.
  60268. </p>
  60269. </dd>
  60270. <dt><samp class="option">preset</samp></dt>
  60271. <dd><p>Set colorchecker colors preset, only available in the
  60272. <code class="code">colorchart</code> source.
  60273. </p>
  60274. <p>Available values are:
  60275. </p><dl class="table">
  60276. <dt>&lsquo;<samp class="samp">reference</samp>&rsquo;</dt>
  60277. <dt>&lsquo;<samp class="samp">skintones</samp>&rsquo;</dt>
  60278. </dl>
  60279. <p>Default value is <code class="code">reference</code>.
  60280. </p></dd>
  60281. </dl>
  60282. <ul class="mini-toc">
  60283. <li><a href="#Examples-197" accesskey="1">Examples</a></li>
  60284. <li><a href="#Commands-158" accesskey="2">Commands</a></li>
  60285. </ul>
  60286. <div class="subsection-level-extent" id="Examples-197">
  60287. <h4 class="subsection"><span>44.11.1 Examples<a class="copiable-link" href="#Examples-197"> &para;</a></span></h4>
  60288. <ul class="itemize mark-bullet">
  60289. <li>Generate a video with a duration of 5.3 seconds, with size
  60290. 176x144 and a frame rate of 10 frames per second:
  60291. <div class="example">
  60292. <pre class="example-preformatted">testsrc=duration=5.3:size=qcif:rate=10
  60293. </pre></div>
  60294. </li><li>The following graph description will generate a red source
  60295. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  60296. frames per second:
  60297. <div class="example">
  60298. <pre class="example-preformatted">color=c=red@0.2:s=qcif:r=10
  60299. </pre></div>
  60300. </li><li>If the input content is to be ignored, <code class="code">nullsrc</code> can be used. The
  60301. following command generates noise in the luma plane by employing
  60302. the <code class="code">geq</code> filter:
  60303. <div class="example">
  60304. <pre class="example-preformatted">nullsrc=s=256x256, geq=random(1)*255:128:128
  60305. </pre></div>
  60306. </li></ul>
  60307. </div>
  60308. <div class="subsection-level-extent" id="Commands-158">
  60309. <h4 class="subsection"><span>44.11.2 Commands<a class="copiable-link" href="#Commands-158"> &para;</a></span></h4>
  60310. <p>The <code class="code">color</code> source supports the following commands:
  60311. </p>
  60312. <dl class="table">
  60313. <dt><samp class="option">c, color</samp></dt>
  60314. <dd><p>Set the color of the created image. Accepts the same syntax of the
  60315. corresponding <samp class="option">color</samp> option.
  60316. </p></dd>
  60317. </dl>
  60318. </div>
  60319. </div>
  60320. <div class="section-level-extent" id="openclsrc">
  60321. <h3 class="section"><span>44.12 openclsrc<a class="copiable-link" href="#openclsrc"> &para;</a></span></h3>
  60322. <p>Generate video using an OpenCL program.
  60323. </p>
  60324. <dl class="table">
  60325. <dt><samp class="option">source</samp></dt>
  60326. <dd><p>OpenCL program source file.
  60327. </p>
  60328. </dd>
  60329. <dt><samp class="option">kernel</samp></dt>
  60330. <dd><p>Kernel name in program.
  60331. </p>
  60332. </dd>
  60333. <dt><samp class="option">size, s</samp></dt>
  60334. <dd><p>Size of frames to generate. This must be set.
  60335. </p>
  60336. </dd>
  60337. <dt><samp class="option">format</samp></dt>
  60338. <dd><p>Pixel format to use for the generated frames. This must be set.
  60339. </p>
  60340. </dd>
  60341. <dt><samp class="option">rate, r</samp></dt>
  60342. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  60343. </p>
  60344. </dd>
  60345. </dl>
  60346. <p>For details of how the program loading works, see the <a class="ref" href="#program_005fopencl">program_opencl</a>
  60347. filter.
  60348. </p>
  60349. <p>Example programs:
  60350. </p>
  60351. <ul class="itemize mark-bullet">
  60352. <li>Generate a colour ramp by setting pixel values from the position of the pixel
  60353. in the output image. (Note that this will work with all pixel formats, but
  60354. the generated output will not be the same.)
  60355. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  60356. unsigned int index)
  60357. {
  60358. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  60359. float4 val;
  60360. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  60361. write_imagef(dst, loc, val);
  60362. }
  60363. </pre>
  60364. </li><li>Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  60365. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  60366. unsigned int index)
  60367. {
  60368. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  60369. float4 value = 0.0f;
  60370. int x = loc.x + index;
  60371. int y = loc.y + index;
  60372. while (x &gt; 0 || y &gt; 0) {
  60373. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  60374. value = 1.0f;
  60375. break;
  60376. }
  60377. x /= 3;
  60378. y /= 3;
  60379. }
  60380. write_imagef(dst, loc, value);
  60381. }
  60382. </pre>
  60383. </li></ul>
  60384. </div>
  60385. <div class="section-level-extent" id="sierpinski">
  60386. <h3 class="section"><span>44.13 sierpinski<a class="copiable-link" href="#sierpinski"> &para;</a></span></h3>
  60387. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  60388. </p>
  60389. <p>This source accepts the following options:
  60390. </p>
  60391. <dl class="table">
  60392. <dt><samp class="option">size, s</samp></dt>
  60393. <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
  60394. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  60395. </p>
  60396. </dd>
  60397. <dt><samp class="option">rate, r</samp></dt>
  60398. <dd><p>Set frame rate, expressed as number of frames per second. Default
  60399. value is &quot;25&quot;.
  60400. </p>
  60401. </dd>
  60402. <dt><samp class="option">seed</samp></dt>
  60403. <dd><p>Set seed which is used for random panning.
  60404. </p>
  60405. </dd>
  60406. <dt><samp class="option">jump</samp></dt>
  60407. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  60408. </p>
  60409. </dd>
  60410. <dt><samp class="option">type</samp></dt>
  60411. <dd><p>Set fractal type, can be default <code class="code">carpet</code> or <code class="code">triangle</code>.
  60412. </p></dd>
  60413. </dl>
  60414. </div>
  60415. <div class="section-level-extent" id="zoneplate">
  60416. <h3 class="section"><span>44.14 zoneplate<a class="copiable-link" href="#zoneplate"> &para;</a></span></h3>
  60417. <p>Generate a zoneplate test video pattern.
  60418. </p>
  60419. <p>This source accepts the following options:
  60420. </p>
  60421. <dl class="table">
  60422. <dt><samp class="option">size, s</samp></dt>
  60423. <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
  60424. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;320x240&quot;.
  60425. </p>
  60426. </dd>
  60427. <dt><samp class="option">rate, r</samp></dt>
  60428. <dd><p>Set frame rate, expressed as number of frames per second. Default
  60429. value is &quot;25&quot;.
  60430. </p>
  60431. </dd>
  60432. <dt><samp class="option">duration, d</samp></dt>
  60433. <dd><p>Set the duration of the sourced video. See
  60434. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  60435. for the accepted syntax.
  60436. </p>
  60437. <p>If not specified, or the expressed duration is negative, the video is
  60438. supposed to be generated forever.
  60439. </p>
  60440. </dd>
  60441. <dt><samp class="option">sar</samp></dt>
  60442. <dd><p>Set the sample aspect ratio of the sourced video.
  60443. </p>
  60444. </dd>
  60445. <dt><samp class="option">precision</samp></dt>
  60446. <dd><p>Set precision in bits for look-up table for sine calculations. Default value is 10.
  60447. Allowed range is from 4 to 16.
  60448. </p>
  60449. </dd>
  60450. <dt><samp class="option">xo</samp></dt>
  60451. <dd><p>Set horizontal axis offset for output signal. Default value is 0.
  60452. </p>
  60453. </dd>
  60454. <dt><samp class="option">yo</samp></dt>
  60455. <dd><p>Set vertical axis offset for output signal. Default value is 0.
  60456. </p>
  60457. </dd>
  60458. <dt><samp class="option">to</samp></dt>
  60459. <dd><p>Set time axis offset for output signal. Default value is 0.
  60460. </p>
  60461. </dd>
  60462. <dt><samp class="option">k0</samp></dt>
  60463. <dd><p>Set 0-order, constant added to signal phase. Default value is 0.
  60464. </p>
  60465. </dd>
  60466. <dt><samp class="option">kx</samp></dt>
  60467. <dd><p>Set 1-order, phase factor multiplier for horizontal axis. Default value is 0.
  60468. </p>
  60469. </dd>
  60470. <dt><samp class="option">ky</samp></dt>
  60471. <dd><p>Set 1-order, phase factor multiplier for vertical axis. Default value is 0.
  60472. </p>
  60473. </dd>
  60474. <dt><samp class="option">kt</samp></dt>
  60475. <dd><p>Set 1-order, phase factor multiplier for time axis. Default value is 0.
  60476. </p>
  60477. </dd>
  60478. <dt><samp class="option">kxt, kyt, kxy</samp></dt>
  60479. <dd><p>Set phase factor multipliers for combination of spatial and temporal axis.
  60480. Default value is 0.
  60481. </p>
  60482. </dd>
  60483. <dt><samp class="option">kx2</samp></dt>
  60484. <dd><p>Set 2-order, phase factor multiplier for horizontal axis. Default value is 0.
  60485. </p>
  60486. </dd>
  60487. <dt><samp class="option">ky2</samp></dt>
  60488. <dd><p>Set 2-order, phase factor multiplier for vertical axis. Default value is 0.
  60489. </p>
  60490. </dd>
  60491. <dt><samp class="option">kt2</samp></dt>
  60492. <dd><p>Set 2-order, phase factor multiplier for time axis. Default value is 0.
  60493. </p>
  60494. </dd>
  60495. <dt><samp class="option">ku</samp></dt>
  60496. <dd><p>Set the constant added to final phase to produce chroma-blue component of signal.
  60497. Default value is 0.
  60498. </p>
  60499. </dd>
  60500. <dt><samp class="option">kv</samp></dt>
  60501. <dd><p>Set the constant added to final phase to produce chroma-red component of signal.
  60502. Default value is 0.
  60503. </p></dd>
  60504. </dl>
  60505. <ul class="mini-toc">
  60506. <li><a href="#Commands-159" accesskey="1">Commands</a></li>
  60507. <li><a href="#Examples-198" accesskey="2">Examples</a></li>
  60508. </ul>
  60509. <div class="subsection-level-extent" id="Commands-159">
  60510. <h4 class="subsection"><span>44.14.1 Commands<a class="copiable-link" href="#Commands-159"> &para;</a></span></h4>
  60511. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  60512. </p>
  60513. </div>
  60514. <div class="subsection-level-extent" id="Examples-198">
  60515. <h4 class="subsection"><span>44.14.2 Examples<a class="copiable-link" href="#Examples-198"> &para;</a></span></h4>
  60516. <ul class="itemize mark-bullet">
  60517. <li>Generate horizontal color sine sweep:
  60518. <div class="example">
  60519. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
  60520. </pre></div>
  60521. </li><li>Generate vertical color sine sweep:
  60522. <div class="example">
  60523. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
  60524. </pre></div>
  60525. </li><li>Generate circular zone-plate:
  60526. <div class="example">
  60527. <pre class="example-preformatted">zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
  60528. </pre></div>
  60529. </li></ul>
  60530. </div>
  60531. </div>
  60532. </div>
  60533. <div class="chapter-level-extent" id="Video-Sinks">
  60534. <h2 class="chapter"><span>45 Video Sinks<a class="copiable-link" href="#Video-Sinks"> &para;</a></span></h2>
  60535. <p>Below is a description of the currently available video sinks.
  60536. </p>
  60537. <ul class="mini-toc">
  60538. <li><a href="#buffersink" accesskey="1">buffersink</a></li>
  60539. <li><a href="#nullsink" accesskey="2">nullsink</a></li>
  60540. </ul>
  60541. <div class="section-level-extent" id="buffersink">
  60542. <h3 class="section"><span>45.1 buffersink<a class="copiable-link" href="#buffersink"> &para;</a></span></h3>
  60543. <p>Buffer video frames, and make them available to the end of the filter
  60544. graph.
  60545. </p>
  60546. <p>This sink is mainly intended for programmatic use, in particular
  60547. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  60548. or the options system.
  60549. </p>
  60550. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  60551. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  60552. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  60553. </p>
  60554. </div>
  60555. <div class="section-level-extent" id="nullsink">
  60556. <h3 class="section"><span>45.2 nullsink<a class="copiable-link" href="#nullsink"> &para;</a></span></h3>
  60557. <p>Null video sink: do absolutely nothing with the input video. It is
  60558. mainly useful as a template and for use in analysis / debugging
  60559. tools.
  60560. </p>
  60561. </div>
  60562. </div>
  60563. <div class="chapter-level-extent" id="Multimedia-Filters">
  60564. <h2 class="chapter"><span>46 Multimedia Filters<a class="copiable-link" href="#Multimedia-Filters"> &para;</a></span></h2>
  60565. <p>Below is a description of the currently available multimedia filters.
  60566. </p>
  60567. <ul class="mini-toc">
  60568. <li><a href="#a3dscope" accesskey="1">a3dscope</a></li>
  60569. <li><a href="#abitscope" accesskey="2">abitscope</a></li>
  60570. <li><a href="#adrawgraph" accesskey="3">adrawgraph</a></li>
  60571. <li><a href="#agraphmonitor" accesskey="4">agraphmonitor</a></li>
  60572. <li><a href="#ahistogram" accesskey="5">ahistogram</a></li>
  60573. <li><a href="#aphasemeter" accesskey="6">aphasemeter</a></li>
  60574. <li><a href="#avectorscope" accesskey="7">avectorscope</a></li>
  60575. <li><a href="#bench_002c-abench" accesskey="8">bench, abench</a></li>
  60576. <li><a href="#concat-3" accesskey="9">concat</a></li>
  60577. <li><a href="#ebur128-1">ebur128</a></li>
  60578. <li><a href="#interleave_002c-ainterleave">interleave, ainterleave</a></li>
  60579. <li><a href="#latency_002c-alatency">latency, alatency</a></li>
  60580. <li><a href="#metadata_002c-ametadata">metadata, ametadata</a></li>
  60581. <li><a href="#perms_002c-aperms">perms, aperms</a></li>
  60582. <li><a href="#realtime_002c-arealtime">realtime, arealtime</a></li>
  60583. <li><a href="#segment_002c-asegment">segment, asegment</a></li>
  60584. <li><a href="#select_002c-aselect">select, aselect</a></li>
  60585. <li><a href="#sendcmd_002c-asendcmd">sendcmd, asendcmd</a></li>
  60586. <li><a href="#setpts_002c-asetpts">setpts, asetpts</a></li>
  60587. <li><a href="#setrange">setrange</a></li>
  60588. <li><a href="#settb_002c-asettb">settb, asettb</a></li>
  60589. <li><a href="#showcqt">showcqt</a></li>
  60590. <li><a href="#showcwt">showcwt</a></li>
  60591. <li><a href="#showfreqs">showfreqs</a></li>
  60592. <li><a href="#showspatial">showspatial</a></li>
  60593. <li><a href="#showspectrum-1">showspectrum</a></li>
  60594. <li><a href="#showspectrumpic">showspectrumpic</a></li>
  60595. <li><a href="#showvolume">showvolume</a></li>
  60596. <li><a href="#showwaves">showwaves</a></li>
  60597. <li><a href="#showwavespic">showwavespic</a></li>
  60598. <li><a href="#sidedata_002c-asidedata">sidedata, asidedata</a></li>
  60599. <li><a href="#spectrumsynth">spectrumsynth</a></li>
  60600. <li><a href="#split_002c-asplit">split, asplit</a></li>
  60601. <li><a href="#zmq_002c-azmq">zmq, azmq</a></li>
  60602. </ul>
  60603. <div class="section-level-extent" id="a3dscope">
  60604. <h3 class="section"><span>46.1 a3dscope<a class="copiable-link" href="#a3dscope"> &para;</a></span></h3>
  60605. <p>Convert input audio to 3d scope video output.
  60606. </p>
  60607. <p>The filter accepts the following options:
  60608. </p>
  60609. <dl class="table">
  60610. <dt><samp class="option">rate, r</samp></dt>
  60611. <dd><p>Set frame rate, expressed as number of frames per second. Default
  60612. value is &quot;25&quot;.
  60613. </p>
  60614. </dd>
  60615. <dt><samp class="option">size, s</samp></dt>
  60616. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  60617. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60618. Default value is <code class="code">hd720</code>.
  60619. </p>
  60620. </dd>
  60621. <dt><samp class="option">fov</samp></dt>
  60622. <dd><p>Set the camera field of view. Default is 90 degrees.
  60623. Allowed range is from 40 to 150.
  60624. </p>
  60625. </dd>
  60626. <dt><samp class="option">roll</samp></dt>
  60627. <dd><p>Set the camera roll.
  60628. </p>
  60629. </dd>
  60630. <dt><samp class="option">pitch</samp></dt>
  60631. <dd><p>Set the camera pitch.
  60632. </p>
  60633. </dd>
  60634. <dt><samp class="option">yaw</samp></dt>
  60635. <dd><p>Set the camera yaw.
  60636. </p>
  60637. </dd>
  60638. <dt><samp class="option">xzoom</samp></dt>
  60639. <dd><p>Set the camera zoom on X-axis.
  60640. </p>
  60641. </dd>
  60642. <dt><samp class="option">yzoom</samp></dt>
  60643. <dd><p>Set the camera zoom on Y-axis.
  60644. </p>
  60645. </dd>
  60646. <dt><samp class="option">zzoom</samp></dt>
  60647. <dd><p>Set the camera zoom on Z-axis.
  60648. </p>
  60649. </dd>
  60650. <dt><samp class="option">xpos</samp></dt>
  60651. <dd><p>Set the camera position on X-axis.
  60652. </p>
  60653. </dd>
  60654. <dt><samp class="option">ypos</samp></dt>
  60655. <dd><p>Set the camera position on Y-axis.
  60656. </p>
  60657. </dd>
  60658. <dt><samp class="option">zpos</samp></dt>
  60659. <dd><p>Set the camera position on Z-axis.
  60660. </p>
  60661. </dd>
  60662. <dt><samp class="option">length</samp></dt>
  60663. <dd><p>Set the length of displayed audio waves in number of frames.
  60664. </p></dd>
  60665. </dl>
  60666. <ul class="mini-toc">
  60667. <li><a href="#Commands-160" accesskey="1">Commands</a></li>
  60668. </ul>
  60669. <div class="subsection-level-extent" id="Commands-160">
  60670. <h4 class="subsection"><span>46.1.1 Commands<a class="copiable-link" href="#Commands-160"> &para;</a></span></h4>
  60671. <p>Filter supports the some above options as <a class="ref" href="#commands">commands</a>.
  60672. </p>
  60673. </div>
  60674. </div>
  60675. <div class="section-level-extent" id="abitscope">
  60676. <h3 class="section"><span>46.2 abitscope<a class="copiable-link" href="#abitscope"> &para;</a></span></h3>
  60677. <p>Convert input audio to a video output, displaying the audio bit scope.
  60678. </p>
  60679. <p>The filter accepts the following options:
  60680. </p>
  60681. <dl class="table">
  60682. <dt><samp class="option">rate, r</samp></dt>
  60683. <dd><p>Set frame rate, expressed as number of frames per second. Default
  60684. value is &quot;25&quot;.
  60685. </p>
  60686. </dd>
  60687. <dt><samp class="option">size, s</samp></dt>
  60688. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  60689. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60690. Default value is <code class="code">1024x256</code>.
  60691. </p>
  60692. </dd>
  60693. <dt><samp class="option">colors</samp></dt>
  60694. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  60695. draw channels. Unrecognized or missing colors will be replaced
  60696. by white color.
  60697. </p>
  60698. </dd>
  60699. <dt><samp class="option">mode, m</samp></dt>
  60700. <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>.
  60701. </p></dd>
  60702. </dl>
  60703. </div>
  60704. <div class="section-level-extent" id="adrawgraph">
  60705. <h3 class="section"><span>46.3 adrawgraph<a class="copiable-link" href="#adrawgraph"> &para;</a></span></h3>
  60706. <p>Draw a graph using input audio metadata.
  60707. </p>
  60708. <p>See <a class="ref" href="#drawgraph">drawgraph</a>
  60709. </p>
  60710. </div>
  60711. <div class="section-level-extent" id="agraphmonitor">
  60712. <h3 class="section"><span>46.4 agraphmonitor<a class="copiable-link" href="#agraphmonitor"> &para;</a></span></h3>
  60713. <p>See <a class="ref" href="#graphmonitor">graphmonitor</a>.
  60714. </p>
  60715. </div>
  60716. <div class="section-level-extent" id="ahistogram">
  60717. <h3 class="section"><span>46.5 ahistogram<a class="copiable-link" href="#ahistogram"> &para;</a></span></h3>
  60718. <p>Convert input audio to a video output, displaying the volume histogram.
  60719. </p>
  60720. <p>The filter accepts the following options:
  60721. </p>
  60722. <dl class="table">
  60723. <dt><samp class="option">dmode</samp></dt>
  60724. <dd><p>Specify how histogram is calculated.
  60725. </p>
  60726. <p>It accepts the following values:
  60727. </p><dl class="table">
  60728. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  60729. <dd><p>Use single histogram for all channels.
  60730. </p></dd>
  60731. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  60732. <dd><p>Use separate histogram for each channel.
  60733. </p></dd>
  60734. </dl>
  60735. <p>Default is <code class="code">single</code>.
  60736. </p>
  60737. </dd>
  60738. <dt><samp class="option">rate, r</samp></dt>
  60739. <dd><p>Set frame rate, expressed as number of frames per second. Default
  60740. value is &quot;25&quot;.
  60741. </p>
  60742. </dd>
  60743. <dt><samp class="option">size, s</samp></dt>
  60744. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  60745. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60746. Default value is <code class="code">hd720</code>.
  60747. </p>
  60748. </dd>
  60749. <dt><samp class="option">scale</samp></dt>
  60750. <dd><p>Set display scale.
  60751. </p>
  60752. <p>It accepts the following values:
  60753. </p><dl class="table">
  60754. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  60755. <dd><p>logarithmic
  60756. </p></dd>
  60757. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  60758. <dd><p>square root
  60759. </p></dd>
  60760. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  60761. <dd><p>cubic root
  60762. </p></dd>
  60763. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  60764. <dd><p>linear
  60765. </p></dd>
  60766. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  60767. <dd><p>reverse logarithmic
  60768. </p></dd>
  60769. </dl>
  60770. <p>Default is <code class="code">log</code>.
  60771. </p>
  60772. </dd>
  60773. <dt><samp class="option">ascale</samp></dt>
  60774. <dd><p>Set amplitude scale.
  60775. </p>
  60776. <p>It accepts the following values:
  60777. </p><dl class="table">
  60778. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  60779. <dd><p>logarithmic
  60780. </p></dd>
  60781. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  60782. <dd><p>linear
  60783. </p></dd>
  60784. </dl>
  60785. <p>Default is <code class="code">log</code>.
  60786. </p>
  60787. </dd>
  60788. <dt><samp class="option">acount</samp></dt>
  60789. <dd><p>Set how much frames to accumulate in histogram.
  60790. Default is 1. Setting this to -1 accumulates all frames.
  60791. </p>
  60792. </dd>
  60793. <dt><samp class="option">rheight</samp></dt>
  60794. <dd><p>Set histogram ratio of window height.
  60795. </p>
  60796. </dd>
  60797. <dt><samp class="option">slide</samp></dt>
  60798. <dd><p>Set sonogram sliding.
  60799. </p>
  60800. <p>It accepts the following values:
  60801. </p><dl class="table">
  60802. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  60803. <dd><p>replace old rows with new ones.
  60804. </p></dd>
  60805. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  60806. <dd><p>scroll from top to bottom.
  60807. </p></dd>
  60808. </dl>
  60809. <p>Default is <code class="code">replace</code>.
  60810. </p>
  60811. </dd>
  60812. <dt><samp class="option">hmode</samp></dt>
  60813. <dd><p>Set histogram mode.
  60814. </p>
  60815. <p>It accepts the following values:
  60816. </p><dl class="table">
  60817. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  60818. <dd><p>Use absolute values of samples.
  60819. </p></dd>
  60820. <dt>&lsquo;<samp class="samp">sign</samp>&rsquo;</dt>
  60821. <dd><p>Use untouched values of samples.
  60822. </p></dd>
  60823. </dl>
  60824. <p>Default is <code class="code">abs</code>.
  60825. </p></dd>
  60826. </dl>
  60827. </div>
  60828. <div class="section-level-extent" id="aphasemeter">
  60829. <h3 class="section"><span>46.6 aphasemeter<a class="copiable-link" href="#aphasemeter"> &para;</a></span></h3>
  60830. <p>Measures phase of input audio, which is exported as metadata <code class="code">lavfi.aphasemeter.phase</code>,
  60831. representing mean phase of current audio frame. A video output can also be produced and is
  60832. enabled by default. The audio is passed through as first output.
  60833. </p>
  60834. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  60835. range <code class="code">[-1, 1]</code> where <code class="code">-1</code> means left and right channels are completely out of phase
  60836. and <code class="code">1</code> means channels are in phase.
  60837. </p>
  60838. <p>The filter accepts the following options, all related to its video output:
  60839. </p>
  60840. <dl class="table">
  60841. <dt><samp class="option">rate, r</samp></dt>
  60842. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  60843. </p>
  60844. </dd>
  60845. <dt><samp class="option">size, s</samp></dt>
  60846. <dd><p>Set the video size for the output. For the syntax of this option, check the
  60847. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60848. Default value is <code class="code">800x400</code>.
  60849. </p>
  60850. </dd>
  60851. <dt><samp class="option">rc</samp></dt>
  60852. <dt><samp class="option">gc</samp></dt>
  60853. <dt><samp class="option">bc</samp></dt>
  60854. <dd><p>Specify the red, green, blue contrast. Default values are <code class="code">2</code>,
  60855. <code class="code">7</code> and <code class="code">1</code>.
  60856. Allowed range is <code class="code">[0, 255]</code>.
  60857. </p>
  60858. </dd>
  60859. <dt><samp class="option">mpc</samp></dt>
  60860. <dd><p>Set color which will be used for drawing median phase. If color is
  60861. <code class="code">none</code> which is default, no median phase value will be drawn.
  60862. </p>
  60863. </dd>
  60864. <dt><samp class="option">video</samp></dt>
  60865. <dd><p>Enable video output. Default is enabled.
  60866. </p></dd>
  60867. </dl>
  60868. <ul class="mini-toc">
  60869. <li><a href="#phasing-detection" accesskey="1">phasing detection</a></li>
  60870. <li><a href="#Examples-199" accesskey="2">Examples</a></li>
  60871. </ul>
  60872. <div class="subsection-level-extent" id="phasing-detection">
  60873. <h4 class="subsection"><span>46.6.1 phasing detection<a class="copiable-link" href="#phasing-detection"> &para;</a></span></h4>
  60874. <p>The filter also detects out of phase and mono sequences in stereo streams.
  60875. It logs the sequence start, end and duration when it lasts longer or as long as the minimum set.
  60876. </p>
  60877. <p>The filter accepts the following options for this detection:
  60878. </p>
  60879. <dl class="table">
  60880. <dt><samp class="option">phasing</samp></dt>
  60881. <dd><p>Enable mono and out of phase detection. Default is disabled.
  60882. </p>
  60883. </dd>
  60884. <dt><samp class="option">tolerance, t</samp></dt>
  60885. <dd><p>Set phase tolerance for mono detection, in amplitude ratio. Default is <code class="code">0</code>.
  60886. Allowed range is <code class="code">[0, 1]</code>.
  60887. </p>
  60888. </dd>
  60889. <dt><samp class="option">angle, a</samp></dt>
  60890. <dd><p>Set angle threshold for out of phase detection, in degree. Default is <code class="code">170</code>.
  60891. Allowed range is <code class="code">[90, 180]</code>.
  60892. </p>
  60893. </dd>
  60894. <dt><samp class="option">duration, d</samp></dt>
  60895. <dd><p>Set mono or out of phase duration until notification, expressed in seconds. Default is <code class="code">2</code>.
  60896. </p></dd>
  60897. </dl>
  60898. </div>
  60899. <div class="subsection-level-extent" id="Examples-199">
  60900. <h4 class="subsection"><span>46.6.2 Examples<a class="copiable-link" href="#Examples-199"> &para;</a></span></h4>
  60901. <ul class="itemize mark-bullet">
  60902. <li>Complete example with <code class="command">ffmpeg</code> to detect 1 second of mono with 0.001 phase tolerance:
  60903. <div class="example">
  60904. <pre class="example-preformatted">ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
  60905. </pre></div>
  60906. </li></ul>
  60907. </div>
  60908. </div>
  60909. <div class="section-level-extent" id="avectorscope">
  60910. <h3 class="section"><span>46.7 avectorscope<a class="copiable-link" href="#avectorscope"> &para;</a></span></h3>
  60911. <p>Convert input audio to a video output, representing the audio vector
  60912. scope.
  60913. </p>
  60914. <p>The filter is used to measure the difference between channels of stereo
  60915. audio stream. A monaural signal, consisting of identical left and right
  60916. signal, results in straight vertical line. Any stereo separation is visible
  60917. as a deviation from this line, creating a Lissajous figure.
  60918. If the straight (or deviation from it) but horizontal line appears this
  60919. indicates that the left and right channels are out of phase.
  60920. </p>
  60921. <p>The filter accepts the following options:
  60922. </p>
  60923. <dl class="table">
  60924. <dt><samp class="option">mode, m</samp></dt>
  60925. <dd><p>Set the vectorscope mode.
  60926. </p>
  60927. <p>Available values are:
  60928. </p><dl class="table">
  60929. <dt>&lsquo;<samp class="samp">lissajous</samp>&rsquo;</dt>
  60930. <dd><p>Lissajous rotated by 45 degrees.
  60931. </p>
  60932. </dd>
  60933. <dt>&lsquo;<samp class="samp">lissajous_xy</samp>&rsquo;</dt>
  60934. <dd><p>Same as above but not rotated.
  60935. </p>
  60936. </dd>
  60937. <dt>&lsquo;<samp class="samp">polar</samp>&rsquo;</dt>
  60938. <dd><p>Shape resembling half of circle.
  60939. </p></dd>
  60940. </dl>
  60941. <p>Default value is &lsquo;<samp class="samp">lissajous</samp>&rsquo;.
  60942. </p>
  60943. </dd>
  60944. <dt><samp class="option">size, s</samp></dt>
  60945. <dd><p>Set the video size for the output. For the syntax of this option, check the
  60946. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  60947. Default value is <code class="code">400x400</code>.
  60948. </p>
  60949. </dd>
  60950. <dt><samp class="option">rate, r</samp></dt>
  60951. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  60952. </p>
  60953. </dd>
  60954. <dt><samp class="option">rc</samp></dt>
  60955. <dt><samp class="option">gc</samp></dt>
  60956. <dt><samp class="option">bc</samp></dt>
  60957. <dt><samp class="option">ac</samp></dt>
  60958. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code class="code">40</code>,
  60959. <code class="code">160</code>, <code class="code">80</code> and <code class="code">255</code>.
  60960. Allowed range is <code class="code">[0, 255]</code>.
  60961. </p>
  60962. </dd>
  60963. <dt><samp class="option">rf</samp></dt>
  60964. <dt><samp class="option">gf</samp></dt>
  60965. <dt><samp class="option">bf</samp></dt>
  60966. <dt><samp class="option">af</samp></dt>
  60967. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code class="code">15</code>,
  60968. <code class="code">10</code>, <code class="code">5</code> and <code class="code">5</code>.
  60969. Allowed range is <code class="code">[0, 255]</code>.
  60970. </p>
  60971. </dd>
  60972. <dt><samp class="option">zoom</samp></dt>
  60973. <dd><p>Set the zoom factor. Default value is <code class="code">1</code>. Allowed range is <code class="code">[0, 10]</code>.
  60974. Values lower than <var class="var">1</var> will auto adjust zoom factor to maximal possible value.
  60975. </p>
  60976. </dd>
  60977. <dt><samp class="option">draw</samp></dt>
  60978. <dd><p>Set the vectorscope drawing mode.
  60979. </p>
  60980. <p>Available values are:
  60981. </p><dl class="table">
  60982. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  60983. <dd><p>Draw dot for each sample.
  60984. </p>
  60985. </dd>
  60986. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  60987. <dd><p>Draw line between previous and current sample.
  60988. </p>
  60989. </dd>
  60990. <dt>&lsquo;<samp class="samp">aaline</samp>&rsquo;</dt>
  60991. <dd><p>Draw anti-aliased line between previous and current sample.
  60992. </p></dd>
  60993. </dl>
  60994. <p>Default value is &lsquo;<samp class="samp">dot</samp>&rsquo;.
  60995. </p>
  60996. </dd>
  60997. <dt><samp class="option">scale</samp></dt>
  60998. <dd><p>Specify amplitude scale of audio samples.
  60999. </p>
  61000. <p>Available values are:
  61001. </p><dl class="table">
  61002. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  61003. <dd><p>Linear.
  61004. </p>
  61005. </dd>
  61006. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  61007. <dd><p>Square root.
  61008. </p>
  61009. </dd>
  61010. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  61011. <dd><p>Cubic root.
  61012. </p>
  61013. </dd>
  61014. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  61015. <dd><p>Logarithmic.
  61016. </p></dd>
  61017. </dl>
  61018. </dd>
  61019. <dt><samp class="option">swap</samp></dt>
  61020. <dd><p>Swap left channel axis with right channel axis.
  61021. </p>
  61022. </dd>
  61023. <dt><samp class="option">mirror</samp></dt>
  61024. <dd><p>Mirror axis.
  61025. </p>
  61026. <dl class="table">
  61027. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  61028. <dd><p>No mirror.
  61029. </p>
  61030. </dd>
  61031. <dt>&lsquo;<samp class="samp">x</samp>&rsquo;</dt>
  61032. <dd><p>Mirror only x axis.
  61033. </p>
  61034. </dd>
  61035. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  61036. <dd><p>Mirror only y axis.
  61037. </p>
  61038. </dd>
  61039. <dt>&lsquo;<samp class="samp">xy</samp>&rsquo;</dt>
  61040. <dd><p>Mirror both axis.
  61041. </p></dd>
  61042. </dl>
  61043. </dd>
  61044. </dl>
  61045. <ul class="mini-toc">
  61046. <li><a href="#Examples-200" accesskey="1">Examples</a></li>
  61047. <li><a href="#Commands-161" accesskey="2">Commands</a></li>
  61048. </ul>
  61049. <div class="subsection-level-extent" id="Examples-200">
  61050. <h4 class="subsection"><span>46.7.1 Examples<a class="copiable-link" href="#Examples-200"> &para;</a></span></h4>
  61051. <ul class="itemize mark-bullet">
  61052. <li>Complete example using <code class="command">ffplay</code>:
  61053. <div class="example">
  61054. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  61055. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  61056. </pre></div>
  61057. </li></ul>
  61058. </div>
  61059. <div class="subsection-level-extent" id="Commands-161">
  61060. <h4 class="subsection"><span>46.7.2 Commands<a class="copiable-link" href="#Commands-161"> &para;</a></span></h4>
  61061. <p>This filter supports the all above options as commands except options <code class="code">size</code> and <code class="code">rate</code>.
  61062. </p>
  61063. </div>
  61064. </div>
  61065. <div class="section-level-extent" id="bench_002c-abench">
  61066. <h3 class="section"><span>46.8 bench, abench<a class="copiable-link" href="#bench_002c-abench"> &para;</a></span></h3>
  61067. <p>Benchmark part of a filtergraph.
  61068. </p>
  61069. <p>The filter accepts the following options:
  61070. </p>
  61071. <dl class="table">
  61072. <dt><samp class="option">action</samp></dt>
  61073. <dd><p>Start or stop a timer.
  61074. </p>
  61075. <p>Available values are:
  61076. </p><dl class="table">
  61077. <dt>&lsquo;<samp class="samp">start</samp>&rsquo;</dt>
  61078. <dd><p>Get the current time, set it as frame metadata (using the key
  61079. <code class="code">lavfi.bench.start_time</code>), and forward the frame to the next filter.
  61080. </p>
  61081. </dd>
  61082. <dt>&lsquo;<samp class="samp">stop</samp>&rsquo;</dt>
  61083. <dd><p>Get the current time and fetch the <code class="code">lavfi.bench.start_time</code> metadata from
  61084. the input frame metadata to get the time difference. Time difference, average,
  61085. maximum and minimum time (respectively <code class="code">t</code>, <code class="code">avg</code>, <code class="code">max</code> and
  61086. <code class="code">min</code>) are then printed. The timestamps are expressed in seconds.
  61087. </p></dd>
  61088. </dl>
  61089. </dd>
  61090. </dl>
  61091. <ul class="mini-toc">
  61092. <li><a href="#Examples-201" accesskey="1">Examples</a></li>
  61093. </ul>
  61094. <div class="subsection-level-extent" id="Examples-201">
  61095. <h4 class="subsection"><span>46.8.1 Examples<a class="copiable-link" href="#Examples-201"> &para;</a></span></h4>
  61096. <ul class="itemize mark-bullet">
  61097. <li>Benchmark <a class="ref" href="#selectivecolor">selectivecolor</a> filter:
  61098. <div class="example">
  61099. <pre class="example-preformatted">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  61100. </pre></div>
  61101. </li></ul>
  61102. </div>
  61103. </div>
  61104. <div class="section-level-extent" id="concat-3">
  61105. <h3 class="section"><span>46.9 concat<a class="copiable-link" href="#concat-3"> &para;</a></span></h3>
  61106. <p>Concatenate audio and video streams, joining them together one after the
  61107. other.
  61108. </p>
  61109. <p>The filter works on segments of synchronized video and audio streams. All
  61110. segments must have the same number of streams of each type, and that will
  61111. also be the number of streams at output.
  61112. </p>
  61113. <p>The filter accepts the following options:
  61114. </p>
  61115. <dl class="table">
  61116. <dt><samp class="option">n</samp></dt>
  61117. <dd><p>Set the number of segments. Default is 2.
  61118. </p>
  61119. </dd>
  61120. <dt><samp class="option">v</samp></dt>
  61121. <dd><p>Set the number of output video streams, that is also the number of video
  61122. streams in each segment. Default is 1.
  61123. </p>
  61124. </dd>
  61125. <dt><samp class="option">a</samp></dt>
  61126. <dd><p>Set the number of output audio streams, that is also the number of audio
  61127. streams in each segment. Default is 0.
  61128. </p>
  61129. </dd>
  61130. <dt><samp class="option">unsafe</samp></dt>
  61131. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  61132. </p>
  61133. </dd>
  61134. </dl>
  61135. <p>The filter has <var class="var">v</var>+<var class="var">a</var> outputs: first <var class="var">v</var> video outputs, then
  61136. <var class="var">a</var> audio outputs.
  61137. </p>
  61138. <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
  61139. segment, in the same order as the outputs, then the inputs for the second
  61140. segment, etc.
  61141. </p>
  61142. <p>Related streams do not always have exactly the same duration, for various
  61143. reasons including codec frame size or sloppy authoring. For that reason,
  61144. related synchronized streams (e.g. a video and its audio track) should be
  61145. concatenated at once. The concat filter will use the duration of the longest
  61146. stream in each segment (except the last one), and if necessary pad shorter
  61147. audio streams with silence.
  61148. </p>
  61149. <p>For this filter to work correctly, all segments must start at timestamp 0.
  61150. </p>
  61151. <p>All corresponding streams must have the same parameters in all segments; the
  61152. filtering system will automatically select a common pixel format for video
  61153. streams, and a common sample format, sample rate and channel layout for
  61154. audio streams, but other settings, such as resolution, must be converted
  61155. explicitly by the user.
  61156. </p>
  61157. <p>Different frame rates are acceptable but will result in variable frame rate
  61158. at output; be sure to configure the output file to handle it.
  61159. </p>
  61160. <ul class="mini-toc">
  61161. <li><a href="#Examples-202" accesskey="1">Examples</a></li>
  61162. <li><a href="#Commands-162" accesskey="2">Commands</a></li>
  61163. </ul>
  61164. <div class="subsection-level-extent" id="Examples-202">
  61165. <h4 class="subsection"><span>46.9.1 Examples<a class="copiable-link" href="#Examples-202"> &para;</a></span></h4>
  61166. <ul class="itemize mark-bullet">
  61167. <li>Concatenate an opening, an episode and an ending, all in bilingual version
  61168. (video in stream 0, audio in streams 1 and 2):
  61169. <div class="example">
  61170. <pre class="example-preformatted">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  61171. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  61172. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  61173. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  61174. </pre></div>
  61175. </li><li>Concatenate two parts, handling audio and video separately, using the
  61176. (a)movie sources, and adjusting the resolution:
  61177. <div class="example">
  61178. <pre class="example-preformatted">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  61179. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  61180. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  61181. </pre></div>
  61182. <p>Note that a desync will happen at the stitch if the audio and video streams
  61183. do not have exactly the same duration in the first file.
  61184. </p>
  61185. </li></ul>
  61186. </div>
  61187. <div class="subsection-level-extent" id="Commands-162">
  61188. <h4 class="subsection"><span>46.9.2 Commands<a class="copiable-link" href="#Commands-162"> &para;</a></span></h4>
  61189. <p>This filter supports the following commands:
  61190. </p><dl class="table">
  61191. <dt><samp class="option">next</samp></dt>
  61192. <dd><p>Close the current segment and step to the next one
  61193. </p></dd>
  61194. </dl>
  61195. <a class="anchor" id="ebur128"></a></div>
  61196. </div>
  61197. <div class="section-level-extent" id="ebur128-1">
  61198. <h3 class="section"><span>46.10 ebur128<a class="copiable-link" href="#ebur128-1"> &para;</a></span></h3>
  61199. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  61200. level. By default, it logs a message at a frequency of 10Hz with the
  61201. Momentary loudness (identified by <code class="code">M</code>), Short-term loudness (<code class="code">S</code>),
  61202. Integrated loudness (<code class="code">I</code>) and Loudness Range (<code class="code">LRA</code>).
  61203. </p>
  61204. <p>The filter can only analyze streams which have
  61205. sample format is double-precision floating point. The input stream will be converted to
  61206. this specification, if needed. Users may need to insert aformat and/or aresample filters
  61207. after this filter to obtain the original parameters.
  61208. </p>
  61209. <p>The filter also has a video output (see the <var class="var">video</var> option) with a real
  61210. time graph to observe the loudness evolution. The graphic contains the logged
  61211. message mentioned above, so it is not printed anymore when this option is set,
  61212. unless the verbose logging is set. The main graphing area contains the
  61213. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  61214. the momentary loudness (400 milliseconds), but can optionally be configured
  61215. to instead display short-term loudness (see <var class="var">gauge</var>).
  61216. </p>
  61217. <p>The green area marks a +/- 1LU target range around the target loudness
  61218. (-23LUFS by default, unless modified through <var class="var">target</var>).
  61219. </p>
  61220. <p>More information about the Loudness Recommendation EBU R128 on
  61221. <a class="url" href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  61222. </p>
  61223. <p>The filter accepts the following options:
  61224. </p>
  61225. <dl class="table">
  61226. <dt><samp class="option">video</samp></dt>
  61227. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  61228. option is set or no. The video stream will be the first output stream if
  61229. activated. Default is <code class="code">0</code>.
  61230. </p>
  61231. </dd>
  61232. <dt><samp class="option">size</samp></dt>
  61233. <dd><p>Set the video size. This option is for video only. For the syntax of this
  61234. option, check the
  61235. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  61236. Default and minimum resolution is <code class="code">640x480</code>.
  61237. </p>
  61238. </dd>
  61239. <dt><samp class="option">meter</samp></dt>
  61240. <dd><p>Set the EBU scale meter. Default is <code class="code">9</code>. Common values are <code class="code">9</code> and
  61241. <code class="code">18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  61242. other integer value between this range is allowed.
  61243. </p>
  61244. </dd>
  61245. <dt><samp class="option">metadata</samp></dt>
  61246. <dd><p>Set metadata injection. If set to <code class="code">1</code>, the audio input will be segmented
  61247. into 100ms output frames, each of them containing various loudness information
  61248. in metadata. All the metadata keys are prefixed with <code class="code">lavfi.r128.</code>.
  61249. </p>
  61250. <p>Default is <code class="code">0</code>.
  61251. </p>
  61252. </dd>
  61253. <dt><samp class="option">framelog</samp></dt>
  61254. <dd><p>Force the frame logging level.
  61255. </p>
  61256. <p>Available values are:
  61257. </p><dl class="table">
  61258. <dt>&lsquo;<samp class="samp">quiet</samp>&rsquo;</dt>
  61259. <dd><p>logging disabled
  61260. </p></dd>
  61261. <dt>&lsquo;<samp class="samp">info</samp>&rsquo;</dt>
  61262. <dd><p>information logging level
  61263. </p></dd>
  61264. <dt>&lsquo;<samp class="samp">verbose</samp>&rsquo;</dt>
  61265. <dd><p>verbose logging level
  61266. </p></dd>
  61267. </dl>
  61268. <p>By default, the logging level is set to <var class="var">info</var>. If the <samp class="option">video</samp> or
  61269. the <samp class="option">metadata</samp> options are set, it switches to <var class="var">verbose</var>.
  61270. </p>
  61271. </dd>
  61272. <dt><samp class="option">peak</samp></dt>
  61273. <dd><p>Set peak mode(s).
  61274. </p>
  61275. <p>Available modes can be cumulated (the option is a <code class="code">flag</code> type). Possible
  61276. values are:
  61277. </p><dl class="table">
  61278. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  61279. <dd><p>Disable any peak mode (default).
  61280. </p></dd>
  61281. <dt>&lsquo;<samp class="samp">sample</samp>&rsquo;</dt>
  61282. <dd><p>Enable sample-peak mode.
  61283. </p>
  61284. <p>Simple peak mode looking for the higher sample value. It logs a message
  61285. for sample-peak (identified by <code class="code">SPK</code>).
  61286. </p></dd>
  61287. <dt>&lsquo;<samp class="samp">true</samp>&rsquo;</dt>
  61288. <dd><p>Enable true-peak mode.
  61289. </p>
  61290. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  61291. stream for better peak accuracy. It logs a message for true-peak.
  61292. (identified by <code class="code">TPK</code>) and true-peak per frame (identified by <code class="code">FTPK</code>).
  61293. This mode requires a build with <code class="code">libswresample</code>.
  61294. </p></dd>
  61295. </dl>
  61296. </dd>
  61297. <dt><samp class="option">dualmono</samp></dt>
  61298. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  61299. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  61300. If set to <code class="code">true</code>, this option will compensate for this effect.
  61301. Multi-channel input files are not affected by this option.
  61302. </p>
  61303. </dd>
  61304. <dt><samp class="option">panlaw</samp></dt>
  61305. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  61306. This parameter is optional, and has a default value of -3.01dB.
  61307. </p>
  61308. </dd>
  61309. <dt><samp class="option">target</samp></dt>
  61310. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  61311. This parameter is optional and has a default value of -23LUFS as specified
  61312. by EBU R128. However, material published online may prefer a level of -16LUFS
  61313. (e.g. for use with podcasts or video platforms).
  61314. </p>
  61315. </dd>
  61316. <dt><samp class="option">gauge</samp></dt>
  61317. <dd><p>Set the value displayed by the gauge. Valid values are <code class="code">momentary</code> and s
  61318. <code class="code">shortterm</code>. By default the momentary value will be used, but in certain
  61319. scenarios it may be more useful to observe the short term value instead (e.g.
  61320. live mixing).
  61321. </p>
  61322. </dd>
  61323. <dt><samp class="option">scale</samp></dt>
  61324. <dd><p>Sets the display scale for the loudness. Valid parameters are <code class="code">absolute</code>
  61325. (in LUFS) or <code class="code">relative</code> (LU) relative to the target. This only affects the
  61326. video output, not the summary or continuous log output.
  61327. </p>
  61328. </dd>
  61329. <dt><samp class="option">integrated</samp></dt>
  61330. <dd><p>Read-only exported value for measured integrated loudness, in LUFS.
  61331. </p>
  61332. </dd>
  61333. <dt><samp class="option">range</samp></dt>
  61334. <dd><p>Read-only exported value for measured loudness range, in LU.
  61335. </p>
  61336. </dd>
  61337. <dt><samp class="option">lra_low</samp></dt>
  61338. <dd><p>Read-only exported value for measured LRA low, in LUFS.
  61339. </p>
  61340. </dd>
  61341. <dt><samp class="option">lra_high</samp></dt>
  61342. <dd><p>Read-only exported value for measured LRA high, in LUFS.
  61343. </p>
  61344. </dd>
  61345. <dt><samp class="option">sample_peak</samp></dt>
  61346. <dd><p>Read-only exported value for measured sample peak, in dBFS.
  61347. </p>
  61348. </dd>
  61349. <dt><samp class="option">true_peak</samp></dt>
  61350. <dd><p>Read-only exported value for measured true peak, in dBFS.
  61351. </p></dd>
  61352. </dl>
  61353. <ul class="mini-toc">
  61354. <li><a href="#Examples-203" accesskey="1">Examples</a></li>
  61355. </ul>
  61356. <div class="subsection-level-extent" id="Examples-203">
  61357. <h4 class="subsection"><span>46.10.1 Examples<a class="copiable-link" href="#Examples-203"> &para;</a></span></h4>
  61358. <ul class="itemize mark-bullet">
  61359. <li>Real-time graph using <code class="command">ffplay</code>, with a EBU scale meter +18:
  61360. <div class="example">
  61361. <pre class="example-preformatted">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  61362. </pre></div>
  61363. </li><li>Run an analysis with <code class="command">ffmpeg</code>:
  61364. <div class="example">
  61365. <pre class="example-preformatted">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  61366. </pre></div>
  61367. </li></ul>
  61368. </div>
  61369. </div>
  61370. <div class="section-level-extent" id="interleave_002c-ainterleave">
  61371. <h3 class="section"><span>46.11 interleave, ainterleave<a class="copiable-link" href="#interleave_002c-ainterleave"> &para;</a></span></h3>
  61372. <p>Temporally interleave frames from several inputs.
  61373. </p>
  61374. <p><code class="code">interleave</code> works with video inputs, <code class="code">ainterleave</code> with audio.
  61375. </p>
  61376. <p>These filters read frames from several inputs and send the oldest
  61377. queued frame to the output.
  61378. </p>
  61379. <p>Input streams must have well defined, monotonically increasing frame
  61380. timestamp values.
  61381. </p>
  61382. <p>In order to submit one frame to output, these filters need to enqueue
  61383. at least one frame for each input, so they cannot work in case one
  61384. input is not yet terminated and will not receive incoming frames.
  61385. </p>
  61386. <p>For example consider the case when one input is a <code class="code">select</code> filter
  61387. which always drops input frames. The <code class="code">interleave</code> filter will keep
  61388. reading from that input, but it will never be able to send new frames
  61389. to output until the input sends an end-of-stream signal.
  61390. </p>
  61391. <p>Also, depending on inputs synchronization, the filters will drop
  61392. frames in case one input receives more frames than the other ones, and
  61393. the queue is already filled.
  61394. </p>
  61395. <p>These filters accept the following options:
  61396. </p>
  61397. <dl class="table">
  61398. <dt><samp class="option">nb_inputs, n</samp></dt>
  61399. <dd><p>Set the number of different inputs, it is 2 by default.
  61400. </p>
  61401. </dd>
  61402. <dt><samp class="option">duration</samp></dt>
  61403. <dd><p>How to determine the end-of-stream.
  61404. </p>
  61405. <dl class="table">
  61406. <dt><samp class="option">longest</samp></dt>
  61407. <dd><p>The duration of the longest input. (default)
  61408. </p>
  61409. </dd>
  61410. <dt><samp class="option">shortest</samp></dt>
  61411. <dd><p>The duration of the shortest input.
  61412. </p>
  61413. </dd>
  61414. <dt><samp class="option">first</samp></dt>
  61415. <dd><p>The duration of the first input.
  61416. </p></dd>
  61417. </dl>
  61418. </dd>
  61419. </dl>
  61420. <ul class="mini-toc">
  61421. <li><a href="#Examples-204" accesskey="1">Examples</a></li>
  61422. </ul>
  61423. <div class="subsection-level-extent" id="Examples-204">
  61424. <h4 class="subsection"><span>46.11.1 Examples<a class="copiable-link" href="#Examples-204"> &para;</a></span></h4>
  61425. <ul class="itemize mark-bullet">
  61426. <li>Interleave frames belonging to different streams using <code class="command">ffmpeg</code>:
  61427. <div class="example">
  61428. <pre class="example-preformatted">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  61429. </pre></div>
  61430. </li><li>Add flickering blur effect:
  61431. <div class="example">
  61432. <pre class="example-preformatted">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  61433. </pre></div>
  61434. </li></ul>
  61435. </div>
  61436. </div>
  61437. <div class="section-level-extent" id="latency_002c-alatency">
  61438. <h3 class="section"><span>46.12 latency, alatency<a class="copiable-link" href="#latency_002c-alatency"> &para;</a></span></h3>
  61439. <p>Measure filtering latency.
  61440. </p>
  61441. <p>Report previous filter filtering latency, delay in number of audio samples for audio filters
  61442. or number of video frames for video filters.
  61443. </p>
  61444. <p>On end of input stream, filter will report min and max measured latency for previous running filter
  61445. in filtergraph.
  61446. </p>
  61447. </div>
  61448. <div class="section-level-extent" id="metadata_002c-ametadata">
  61449. <h3 class="section"><span>46.13 metadata, ametadata<a class="copiable-link" href="#metadata_002c-ametadata"> &para;</a></span></h3>
  61450. <p>Manipulate frame metadata.
  61451. </p>
  61452. <p>This filter accepts the following options:
  61453. </p>
  61454. <dl class="table">
  61455. <dt><samp class="option">mode</samp></dt>
  61456. <dd><p>Set mode of operation of the filter.
  61457. </p>
  61458. <p>Can be one of the following:
  61459. </p>
  61460. <dl class="table">
  61461. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  61462. <dd><p>If both <code class="code">value</code> and <code class="code">key</code> is set, select frames
  61463. which have such metadata. If only <code class="code">key</code> is set, select
  61464. every frame that has such key in metadata.
  61465. </p>
  61466. </dd>
  61467. <dt>&lsquo;<samp class="samp">add</samp>&rsquo;</dt>
  61468. <dd><p>Add new metadata <code class="code">key</code> and <code class="code">value</code>. If key is already available
  61469. do nothing.
  61470. </p>
  61471. </dd>
  61472. <dt>&lsquo;<samp class="samp">modify</samp>&rsquo;</dt>
  61473. <dd><p>Modify value of already present key.
  61474. </p>
  61475. </dd>
  61476. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  61477. <dd><p>If <code class="code">value</code> is set, delete only keys that have such value.
  61478. Otherwise, delete key. If <code class="code">key</code> is not set, delete all metadata values in
  61479. the frame.
  61480. </p>
  61481. </dd>
  61482. <dt>&lsquo;<samp class="samp">print</samp>&rsquo;</dt>
  61483. <dd><p>Print key and its value if metadata was found. If <code class="code">key</code> is not set print all
  61484. metadata values available in frame.
  61485. </p></dd>
  61486. </dl>
  61487. </dd>
  61488. <dt><samp class="option">key</samp></dt>
  61489. <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>.
  61490. </p>
  61491. </dd>
  61492. <dt><samp class="option">value</samp></dt>
  61493. <dd><p>Set metadata value which will be used. This option is mandatory for
  61494. <code class="code">modify</code> and <code class="code">add</code> mode.
  61495. </p>
  61496. </dd>
  61497. <dt><samp class="option">function</samp></dt>
  61498. <dd><p>Which function to use when comparing metadata value and <code class="code">value</code>.
  61499. </p>
  61500. <p>Can be one of following:
  61501. </p>
  61502. <dl class="table">
  61503. <dt>&lsquo;<samp class="samp">same_str</samp>&rsquo;</dt>
  61504. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code class="code">value</code>.
  61505. </p>
  61506. </dd>
  61507. <dt>&lsquo;<samp class="samp">starts_with</samp>&rsquo;</dt>
  61508. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  61509. the <code class="code">value</code> option string.
  61510. </p>
  61511. </dd>
  61512. <dt>&lsquo;<samp class="samp">less</samp>&rsquo;</dt>
  61513. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code class="code">value</code>.
  61514. </p>
  61515. </dd>
  61516. <dt>&lsquo;<samp class="samp">equal</samp>&rsquo;</dt>
  61517. <dd><p>Values are interpreted as floats, returns true if <code class="code">value</code> is equal with metadata value.
  61518. </p>
  61519. </dd>
  61520. <dt>&lsquo;<samp class="samp">greater</samp>&rsquo;</dt>
  61521. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code class="code">value</code>.
  61522. </p>
  61523. </dd>
  61524. <dt>&lsquo;<samp class="samp">expr</samp>&rsquo;</dt>
  61525. <dd><p>Values are interpreted as floats, returns true if expression from option <code class="code">expr</code>
  61526. evaluates to true.
  61527. </p>
  61528. </dd>
  61529. <dt>&lsquo;<samp class="samp">ends_with</samp>&rsquo;</dt>
  61530. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  61531. the <code class="code">value</code> option string.
  61532. </p></dd>
  61533. </dl>
  61534. </dd>
  61535. <dt><samp class="option">expr</samp></dt>
  61536. <dd><p>Set expression which is used when <code class="code">function</code> is set to <code class="code">expr</code>.
  61537. The expression is evaluated through the eval API and can contain the following
  61538. constants:
  61539. </p>
  61540. <dl class="table">
  61541. <dt><samp class="option">VALUE1, FRAMEVAL</samp></dt>
  61542. <dd><p>Float representation of <code class="code">value</code> from metadata key.
  61543. </p>
  61544. </dd>
  61545. <dt><samp class="option">VALUE2, USERVAL</samp></dt>
  61546. <dd><p>Float representation of <code class="code">value</code> as supplied by user in <code class="code">value</code> option.
  61547. </p></dd>
  61548. </dl>
  61549. </dd>
  61550. <dt><samp class="option">file</samp></dt>
  61551. <dd><p>If specified in <code class="code">print</code> mode, output is written to the named file. Instead of
  61552. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  61553. for standard output. If <code class="code">file</code> option is not set, output is written to the log
  61554. with AV_LOG_INFO loglevel.
  61555. </p>
  61556. </dd>
  61557. <dt><samp class="option">direct</samp></dt>
  61558. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var class="var">file</var>.
  61559. </p>
  61560. </dd>
  61561. </dl>
  61562. <ul class="mini-toc">
  61563. <li><a href="#Examples-205" accesskey="1">Examples</a></li>
  61564. </ul>
  61565. <div class="subsection-level-extent" id="Examples-205">
  61566. <h4 class="subsection"><span>46.13.1 Examples<a class="copiable-link" href="#Examples-205"> &para;</a></span></h4>
  61567. <ul class="itemize mark-bullet">
  61568. <li>Print all metadata values for frames with key <code class="code">lavfi.signalstats.YDIF</code> with values
  61569. between 0 and 1.
  61570. <div class="example">
  61571. <pre class="example-preformatted">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  61572. </pre></div>
  61573. </li><li>Print silencedetect output to file <samp class="file">metadata.txt</samp>.
  61574. <div class="example">
  61575. <pre class="example-preformatted">silencedetect,ametadata=mode=print:file=metadata.txt
  61576. </pre></div>
  61577. </li><li>Direct all metadata to a pipe with file descriptor 4.
  61578. <div class="example">
  61579. <pre class="example-preformatted">metadata=mode=print:file='pipe\:4'
  61580. </pre></div>
  61581. </li></ul>
  61582. </div>
  61583. </div>
  61584. <div class="section-level-extent" id="perms_002c-aperms">
  61585. <h3 class="section"><span>46.14 perms, aperms<a class="copiable-link" href="#perms_002c-aperms"> &para;</a></span></h3>
  61586. <p>Set read/write permissions for the output frames.
  61587. </p>
  61588. <p>These filters are mainly aimed at developers to test direct path in the
  61589. following filter in the filtergraph.
  61590. </p>
  61591. <p>The filters accept the following options:
  61592. </p>
  61593. <dl class="table">
  61594. <dt><samp class="option">mode</samp></dt>
  61595. <dd><p>Select the permissions mode.
  61596. </p>
  61597. <p>It accepts the following values:
  61598. </p><dl class="table">
  61599. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  61600. <dd><p>Do nothing. This is the default.
  61601. </p></dd>
  61602. <dt>&lsquo;<samp class="samp">ro</samp>&rsquo;</dt>
  61603. <dd><p>Set all the output frames read-only.
  61604. </p></dd>
  61605. <dt>&lsquo;<samp class="samp">rw</samp>&rsquo;</dt>
  61606. <dd><p>Set all the output frames directly writable.
  61607. </p></dd>
  61608. <dt>&lsquo;<samp class="samp">toggle</samp>&rsquo;</dt>
  61609. <dd><p>Make the frame read-only if writable, and writable if read-only.
  61610. </p></dd>
  61611. <dt>&lsquo;<samp class="samp">random</samp>&rsquo;</dt>
  61612. <dd><p>Set each output frame read-only or writable randomly.
  61613. </p></dd>
  61614. </dl>
  61615. </dd>
  61616. <dt><samp class="option">seed</samp></dt>
  61617. <dd><p>Set the seed for the <var class="var">random</var> mode, must be an integer included between
  61618. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  61619. <code class="code">-1</code>, the filter will try to use a good random seed on a best effort
  61620. basis.
  61621. </p></dd>
  61622. </dl>
  61623. <p>Note: in case of auto-inserted filter between the permission filter and the
  61624. following one, the permission might not be received as expected in that
  61625. following filter. Inserting a <a class="ref" href="#format">format</a> or <a class="ref" href="#aformat">aformat</a> filter before the
  61626. perms/aperms filter can avoid this problem.
  61627. </p>
  61628. </div>
  61629. <div class="section-level-extent" id="realtime_002c-arealtime">
  61630. <h3 class="section"><span>46.15 realtime, arealtime<a class="copiable-link" href="#realtime_002c-arealtime"> &para;</a></span></h3>
  61631. <p>Slow down filtering to match real time approximately.
  61632. </p>
  61633. <p>These filters will pause the filtering for a variable amount of time to
  61634. match the output rate with the input timestamps.
  61635. They are similar to the <samp class="option">re</samp> option to <code class="code">ffmpeg</code>.
  61636. </p>
  61637. <p>They accept the following options:
  61638. </p>
  61639. <dl class="table">
  61640. <dt><samp class="option">limit</samp></dt>
  61641. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  61642. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  61643. </p></dd>
  61644. <dt><samp class="option">speed</samp></dt>
  61645. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  61646. Values larger than 1.0 will result in faster than realtime processing,
  61647. smaller will slow processing down. The <var class="var">limit</var> is automatically adapted
  61648. accordingly. Default is 1.0.
  61649. </p>
  61650. <p>A processing speed faster than what is possible without these filters cannot
  61651. be achieved.
  61652. </p></dd>
  61653. </dl>
  61654. <ul class="mini-toc">
  61655. <li><a href="#Commands-163" accesskey="1">Commands</a></li>
  61656. </ul>
  61657. <div class="subsection-level-extent" id="Commands-163">
  61658. <h4 class="subsection"><span>46.15.1 Commands<a class="copiable-link" href="#Commands-163"> &para;</a></span></h4>
  61659. <p>Both filters supports the all above options as <a class="ref" href="#commands">commands</a>.
  61660. </p>
  61661. </div>
  61662. </div>
  61663. <div class="section-level-extent" id="segment_002c-asegment">
  61664. <h3 class="section"><span>46.16 segment, asegment<a class="copiable-link" href="#segment_002c-asegment"> &para;</a></span></h3>
  61665. <p>Split single input stream into multiple streams.
  61666. </p>
  61667. <p>This filter does opposite of concat filters.
  61668. </p>
  61669. <p><code class="code">segment</code> works on video frames, <code class="code">asegment</code> on audio samples.
  61670. </p>
  61671. <p>This filter accepts the following options:
  61672. </p>
  61673. <dl class="table">
  61674. <dt><samp class="option">timestamps</samp></dt>
  61675. <dd><p>Timestamps of output segments separated by &rsquo;|&rsquo;. The first segment will run
  61676. from the beginning of the input stream. The last segment will run until
  61677. the end of the input stream
  61678. </p>
  61679. </dd>
  61680. <dt><samp class="option">frames, samples</samp></dt>
  61681. <dd><p>Exact frame/sample count to split the segments.
  61682. </p></dd>
  61683. </dl>
  61684. <p>In all cases, prefixing an each segment with &rsquo;+&rsquo; will make it relative to the
  61685. previous segment.
  61686. </p>
  61687. <ul class="mini-toc">
  61688. <li><a href="#Examples-206" accesskey="1">Examples</a></li>
  61689. </ul>
  61690. <div class="subsection-level-extent" id="Examples-206">
  61691. <h4 class="subsection"><span>46.16.1 Examples<a class="copiable-link" href="#Examples-206"> &para;</a></span></h4>
  61692. <ul class="itemize mark-bullet">
  61693. <li>Split input audio stream into three output audio streams, starting at start of input audio stream
  61694. and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd
  61695. output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream:
  61696. <div class="example">
  61697. <pre class="example-preformatted">asegment=timestamps=&quot;60|150&quot;
  61698. </pre></div>
  61699. </li></ul>
  61700. <a class="anchor" id="select"></a></div>
  61701. </div>
  61702. <div class="section-level-extent" id="select_002c-aselect">
  61703. <h3 class="section"><span>46.17 select, aselect<a class="copiable-link" href="#select_002c-aselect"> &para;</a></span></h3>
  61704. <p>Select frames to pass in output.
  61705. </p>
  61706. <p>This filter accepts the following options:
  61707. </p>
  61708. <dl class="table">
  61709. <dt><samp class="option">expr, e</samp></dt>
  61710. <dd><p>Set expression, which is evaluated for each input frame.
  61711. </p>
  61712. <p>If the expression is evaluated to zero, the frame is discarded.
  61713. </p>
  61714. <p>If the evaluation result is negative or NaN, the frame is sent to the
  61715. first output; otherwise it is sent to the output with index
  61716. <code class="code">ceil(val)-1</code>, assuming that the input index starts from 0.
  61717. </p>
  61718. <p>For example a value of <code class="code">1.2</code> corresponds to the output with index
  61719. <code class="code">ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  61720. </p>
  61721. </dd>
  61722. <dt><samp class="option">outputs, n</samp></dt>
  61723. <dd><p>Set the number of outputs. The output to which to send the selected
  61724. frame is based on the result of the evaluation. Default value is 1.
  61725. </p></dd>
  61726. </dl>
  61727. <p>The expression can contain the following constants:
  61728. </p>
  61729. <dl class="table">
  61730. <dt><samp class="option">n</samp></dt>
  61731. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  61732. </p>
  61733. </dd>
  61734. <dt><samp class="option">selected_n</samp></dt>
  61735. <dd><p>The (sequential) number of the selected frame, starting from 0.
  61736. </p>
  61737. </dd>
  61738. <dt><samp class="option">prev_selected_n</samp></dt>
  61739. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  61740. </p>
  61741. </dd>
  61742. <dt><samp class="option">TB</samp></dt>
  61743. <dd><p>The timebase of the input timestamps.
  61744. </p>
  61745. </dd>
  61746. <dt><samp class="option">pts</samp></dt>
  61747. <dd><p>The PTS (Presentation TimeStamp) of the filtered frame,
  61748. expressed in <var class="var">TB</var> units. It&rsquo;s NAN if undefined.
  61749. </p>
  61750. </dd>
  61751. <dt><samp class="option">t</samp></dt>
  61752. <dd><p>The PTS of the filtered frame,
  61753. expressed in seconds. It&rsquo;s NAN if undefined.
  61754. </p>
  61755. </dd>
  61756. <dt><samp class="option">prev_pts</samp></dt>
  61757. <dd><p>The PTS of the previously filtered frame. It&rsquo;s NAN if undefined.
  61758. </p>
  61759. </dd>
  61760. <dt><samp class="option">prev_selected_pts</samp></dt>
  61761. <dd><p>The PTS of the last previously filtered frame. It&rsquo;s NAN if undefined.
  61762. </p>
  61763. </dd>
  61764. <dt><samp class="option">prev_selected_t</samp></dt>
  61765. <dd><p>The PTS of the last previously selected frame, expressed in seconds. It&rsquo;s NAN if undefined.
  61766. </p>
  61767. </dd>
  61768. <dt><samp class="option">start_pts</samp></dt>
  61769. <dd><p>The first PTS in the stream which is not NAN. It remains NAN if not found.
  61770. </p>
  61771. </dd>
  61772. <dt><samp class="option">start_t</samp></dt>
  61773. <dd><p>The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found.
  61774. </p>
  61775. </dd>
  61776. <dt><samp class="option">pict_type <em class="emph">(video only)</em></samp></dt>
  61777. <dd><p>The type of the filtered frame. It can assume one of the following
  61778. values:
  61779. </p><dl class="table">
  61780. <dt><samp class="option">I</samp></dt>
  61781. <dt><samp class="option">P</samp></dt>
  61782. <dt><samp class="option">B</samp></dt>
  61783. <dt><samp class="option">S</samp></dt>
  61784. <dt><samp class="option">SI</samp></dt>
  61785. <dt><samp class="option">SP</samp></dt>
  61786. <dt><samp class="option">BI</samp></dt>
  61787. </dl>
  61788. </dd>
  61789. <dt><samp class="option">interlace_type <em class="emph">(video only)</em></samp></dt>
  61790. <dd><p>The frame interlace type. It can assume one of the following values:
  61791. </p><dl class="table">
  61792. <dt><samp class="option">PROGRESSIVE</samp></dt>
  61793. <dd><p>The frame is progressive (not interlaced).
  61794. </p></dd>
  61795. <dt><samp class="option">TOPFIRST</samp></dt>
  61796. <dd><p>The frame is top-field-first.
  61797. </p></dd>
  61798. <dt><samp class="option">BOTTOMFIRST</samp></dt>
  61799. <dd><p>The frame is bottom-field-first.
  61800. </p></dd>
  61801. </dl>
  61802. </dd>
  61803. <dt><samp class="option">consumed_sample_n <em class="emph">(audio only)</em></samp></dt>
  61804. <dd><p>the number of selected samples before the current frame
  61805. </p>
  61806. </dd>
  61807. <dt><samp class="option">samples_n <em class="emph">(audio only)</em></samp></dt>
  61808. <dd><p>the number of samples in the current frame
  61809. </p>
  61810. </dd>
  61811. <dt><samp class="option">sample_rate <em class="emph">(audio only)</em></samp></dt>
  61812. <dd><p>the input sample rate
  61813. </p>
  61814. </dd>
  61815. <dt><samp class="option">key</samp></dt>
  61816. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  61817. </p>
  61818. </dd>
  61819. <dt><samp class="option">pos</samp></dt>
  61820. <dd><p>the position in the file of the filtered frame, -1 if the information
  61821. is not available (e.g. for synthetic video); deprecated, do not use
  61822. </p>
  61823. </dd>
  61824. <dt><samp class="option">scene <em class="emph">(video only)</em></samp></dt>
  61825. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  61826. probability for the current frame to introduce a new scene, while a higher
  61827. value means the current frame is more likely to be one (see the example below)
  61828. </p>
  61829. </dd>
  61830. <dt><samp class="option">concatdec_select</samp></dt>
  61831. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  61832. inpoint and an outpoint, but the output packets may not be entirely contained
  61833. in the selected interval. By using this variable, it is possible to skip frames
  61834. generated by the concat demuxer which are not exactly contained in the selected
  61835. interval.
  61836. </p>
  61837. <p>This works by comparing the frame pts against the <var class="var">lavf.concat.start_time</var>
  61838. and the <var class="var">lavf.concat.duration</var> packet metadata values which are also
  61839. present in the decoded frames.
  61840. </p>
  61841. <p>The <var class="var">concatdec_select</var> variable is -1 if the frame pts is at least
  61842. start_time and either the duration metadata is missing or the frame pts is less
  61843. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  61844. missing.
  61845. </p>
  61846. <p>That basically means that an input frame is selected if its pts is within the
  61847. interval set by the concat demuxer.
  61848. </p>
  61849. </dd>
  61850. </dl>
  61851. <p>The default value of the select expression is &quot;1&quot;.
  61852. </p>
  61853. <ul class="mini-toc">
  61854. <li><a href="#Examples-207" accesskey="1">Examples</a></li>
  61855. </ul>
  61856. <div class="subsection-level-extent" id="Examples-207">
  61857. <h4 class="subsection"><span>46.17.1 Examples<a class="copiable-link" href="#Examples-207"> &para;</a></span></h4>
  61858. <ul class="itemize mark-bullet">
  61859. <li>Select all frames in input:
  61860. <div class="example">
  61861. <pre class="example-preformatted">select
  61862. </pre></div>
  61863. <p>The example above is the same as:
  61864. </p><div class="example">
  61865. <pre class="example-preformatted">select=1
  61866. </pre></div>
  61867. </li><li>Skip all frames:
  61868. <div class="example">
  61869. <pre class="example-preformatted">select=0
  61870. </pre></div>
  61871. </li><li>Select only I-frames:
  61872. <div class="example">
  61873. <pre class="example-preformatted">select='eq(pict_type\,I)'
  61874. </pre></div>
  61875. </li><li>Select one frame every 100:
  61876. <div class="example">
  61877. <pre class="example-preformatted">select='not(mod(n\,100))'
  61878. </pre></div>
  61879. </li><li>Select only frames contained in the 10-20 time interval:
  61880. <div class="example">
  61881. <pre class="example-preformatted">select=between(t\,10\,20)
  61882. </pre></div>
  61883. </li><li>Select only I-frames contained in the 10-20 time interval:
  61884. <div class="example">
  61885. <pre class="example-preformatted">select=between(t\,10\,20)*eq(pict_type\,I)
  61886. </pre></div>
  61887. </li><li>Select frames with a minimum distance of 10 seconds:
  61888. <div class="example">
  61889. <pre class="example-preformatted">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  61890. </pre></div>
  61891. </li><li>Use aselect to select only audio frames with samples number &gt; 100:
  61892. <div class="example">
  61893. <pre class="example-preformatted">aselect='gt(samples_n\,100)'
  61894. </pre></div>
  61895. </li><li>Create a mosaic of the first scenes:
  61896. <div class="example">
  61897. <pre class="example-preformatted">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  61898. </pre></div>
  61899. <p>Comparing <var class="var">scene</var> against a value between 0.3 and 0.5 is generally a sane
  61900. choice.
  61901. </p>
  61902. </li><li>Send even and odd frames to separate outputs, and compose them:
  61903. <div class="example">
  61904. <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
  61905. </pre></div>
  61906. </li><li>Select useful frames from an ffconcat file which is using inpoints and
  61907. outpoints but where the source files are not intra frame only.
  61908. <div class="example">
  61909. <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
  61910. </pre></div>
  61911. </li></ul>
  61912. </div>
  61913. </div>
  61914. <div class="section-level-extent" id="sendcmd_002c-asendcmd">
  61915. <h3 class="section"><span>46.18 sendcmd, asendcmd<a class="copiable-link" href="#sendcmd_002c-asendcmd"> &para;</a></span></h3>
  61916. <p>Send commands to filters in the filtergraph.
  61917. </p>
  61918. <p>These filters read commands to be sent to other filters in the
  61919. filtergraph.
  61920. </p>
  61921. <p><code class="code">sendcmd</code> must be inserted between two video filters,
  61922. <code class="code">asendcmd</code> must be inserted between two audio filters, but apart
  61923. from that they act the same way.
  61924. </p>
  61925. <p>The specification of commands can be provided in the filter arguments
  61926. with the <var class="var">commands</var> option, or in a file specified by the
  61927. <var class="var">filename</var> option.
  61928. </p>
  61929. <p>These filters accept the following options:
  61930. </p><dl class="table">
  61931. <dt><samp class="option">commands, c</samp></dt>
  61932. <dd><p>Set the commands to be read and sent to the other filters.
  61933. </p></dd>
  61934. <dt><samp class="option">filename, f</samp></dt>
  61935. <dd><p>Set the filename of the commands to be read and sent to the other
  61936. filters.
  61937. </p></dd>
  61938. </dl>
  61939. <ul class="mini-toc">
  61940. <li><a href="#Commands-syntax" accesskey="1">Commands syntax</a></li>
  61941. <li><a href="#Examples-208" accesskey="2">Examples</a></li>
  61942. </ul>
  61943. <div class="subsection-level-extent" id="Commands-syntax">
  61944. <h4 class="subsection"><span>46.18.1 Commands syntax<a class="copiable-link" href="#Commands-syntax"> &para;</a></span></h4>
  61945. <p>A commands description consists of a sequence of interval
  61946. specifications, comprising a list of commands to be executed when a
  61947. particular event related to that interval occurs. The occurring event
  61948. is typically the current frame time entering or leaving a given time
  61949. interval.
  61950. </p>
  61951. <p>An interval is specified by the following syntax:
  61952. </p><div class="example">
  61953. <pre class="example-preformatted"><var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>;
  61954. </pre></div>
  61955. <p>The time interval is specified by the <var class="var">START</var> and <var class="var">END</var> times.
  61956. <var class="var">END</var> is optional and defaults to the maximum time.
  61957. </p>
  61958. <p>The current frame time is considered within the specified interval if
  61959. it is included in the interval [<var class="var">START</var>, <var class="var">END</var>), that is when
  61960. the time is greater or equal to <var class="var">START</var> and is lesser than
  61961. <var class="var">END</var>.
  61962. </p>
  61963. <p><var class="var">COMMANDS</var> consists of a sequence of one or more command
  61964. specifications, separated by &quot;,&quot;, relating to that interval. The
  61965. syntax of a command specification is given by:
  61966. </p><div class="example">
  61967. <pre class="example-preformatted">[<var class="var">FLAGS</var>] <var class="var">TARGET</var> <var class="var">COMMAND</var> <var class="var">ARG</var>
  61968. </pre></div>
  61969. <p><var class="var">FLAGS</var> is optional and specifies the type of events relating to
  61970. the time interval which enable sending the specified command, and must
  61971. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  61972. enclosed between &quot;[&quot; and &quot;]&quot;.
  61973. </p>
  61974. <p>The following flags are recognized:
  61975. </p><dl class="table">
  61976. <dt><samp class="option">enter</samp></dt>
  61977. <dd><p>The command is sent when the current frame timestamp enters the
  61978. specified interval. In other words, the command is sent when the
  61979. previous frame timestamp was not in the given interval, and the
  61980. current is.
  61981. </p>
  61982. </dd>
  61983. <dt><samp class="option">leave</samp></dt>
  61984. <dd><p>The command is sent when the current frame timestamp leaves the
  61985. specified interval. In other words, the command is sent when the
  61986. previous frame timestamp was in the given interval, and the
  61987. current is not.
  61988. </p>
  61989. </dd>
  61990. <dt><samp class="option">expr</samp></dt>
  61991. <dd><p>The command <var class="var">ARG</var> is interpreted as expression and result of
  61992. expression is passed as <var class="var">ARG</var>.
  61993. </p>
  61994. <p>The expression is evaluated through the eval API and can contain the following
  61995. constants:
  61996. </p>
  61997. <dl class="table">
  61998. <dt><samp class="option">POS</samp></dt>
  61999. <dd><p>Original position in the file of the frame, or undefined if undefined
  62000. for the current frame. Deprecated, do not use.
  62001. </p>
  62002. </dd>
  62003. <dt><samp class="option">PTS</samp></dt>
  62004. <dd><p>The presentation timestamp in input.
  62005. </p>
  62006. </dd>
  62007. <dt><samp class="option">N</samp></dt>
  62008. <dd><p>The count of the input frame for video or audio, starting from 0.
  62009. </p>
  62010. </dd>
  62011. <dt><samp class="option">T</samp></dt>
  62012. <dd><p>The time in seconds of the current frame.
  62013. </p>
  62014. </dd>
  62015. <dt><samp class="option">TS</samp></dt>
  62016. <dd><p>The start time in seconds of the current command interval.
  62017. </p>
  62018. </dd>
  62019. <dt><samp class="option">TE</samp></dt>
  62020. <dd><p>The end time in seconds of the current command interval.
  62021. </p>
  62022. </dd>
  62023. <dt><samp class="option">TI</samp></dt>
  62024. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  62025. </p>
  62026. </dd>
  62027. <dt><samp class="option">W</samp></dt>
  62028. <dd><p>The video frame width.
  62029. </p>
  62030. </dd>
  62031. <dt><samp class="option">H</samp></dt>
  62032. <dd><p>The video frame height.
  62033. </p></dd>
  62034. </dl>
  62035. </dd>
  62036. </dl>
  62037. <p>If <var class="var">FLAGS</var> is not specified, a default value of <code class="code">[enter]</code> is
  62038. assumed.
  62039. </p>
  62040. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  62041. the filter class or a specific filter instance name.
  62042. </p>
  62043. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  62044. </p>
  62045. <p><var class="var">ARG</var> is optional and specifies the optional list of argument for
  62046. the given <var class="var">COMMAND</var>.
  62047. </p>
  62048. <p>Between one interval specification and another, whitespaces, or
  62049. sequences of characters starting with <code class="code">#</code> until the end of line,
  62050. are ignored and can be used to annotate comments.
  62051. </p>
  62052. <p>A simplified BNF description of the commands specification syntax
  62053. follows:
  62054. </p><div class="example">
  62055. <pre class="example-preformatted"><var class="var">COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  62056. <var class="var">COMMAND_FLAGS</var> ::= <var class="var">COMMAND_FLAG</var> [(+|&quot;|&quot;)<var class="var">COMMAND_FLAG</var>]
  62057. <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>]
  62058. <var class="var">COMMANDS</var> ::= <var class="var">COMMAND</var> [,<var class="var">COMMANDS</var>]
  62059. <var class="var">INTERVAL</var> ::= <var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>
  62060. <var class="var">INTERVALS</var> ::= <var class="var">INTERVAL</var>[;<var class="var">INTERVALS</var>]
  62061. </pre></div>
  62062. </div>
  62063. <div class="subsection-level-extent" id="Examples-208">
  62064. <h4 class="subsection"><span>46.18.2 Examples<a class="copiable-link" href="#Examples-208"> &para;</a></span></h4>
  62065. <ul class="itemize mark-bullet">
  62066. <li>Specify audio tempo change at second 4:
  62067. <div class="example">
  62068. <pre class="example-preformatted">asendcmd=c='4.0 atempo tempo 1.5',atempo
  62069. </pre></div>
  62070. </li><li>Target a specific filter instance:
  62071. <div class="example">
  62072. <pre class="example-preformatted">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  62073. </pre></div>
  62074. </li><li>Specify a list of drawtext and hue commands in a file.
  62075. <div class="example">
  62076. <pre class="example-preformatted"># show text in the interval 5-10
  62077. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  62078. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  62079. # desaturate the image in the interval 15-20
  62080. 15.0-20.0 [enter] hue s 0,
  62081. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  62082. [leave] hue s 1,
  62083. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  62084. # apply an exponential saturation fade-out effect, starting from time 25
  62085. 25 [enter] hue s exp(25-t)
  62086. </pre></div>
  62087. <p>A filtergraph allowing to read and process the above command list
  62088. stored in a file <samp class="file">test.cmd</samp>, can be specified with:
  62089. </p><div class="example">
  62090. <pre class="example-preformatted">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  62091. </pre></div>
  62092. </li></ul>
  62093. <a class="anchor" id="setpts"></a></div>
  62094. </div>
  62095. <div class="section-level-extent" id="setpts_002c-asetpts">
  62096. <h3 class="section"><span>46.19 setpts, asetpts<a class="copiable-link" href="#setpts_002c-asetpts"> &para;</a></span></h3>
  62097. <p>Change the PTS (presentation timestamp) of the input frames.
  62098. </p>
  62099. <p><code class="code">setpts</code> works on video frames, <code class="code">asetpts</code> on audio frames.
  62100. </p>
  62101. <p>This filter accepts the following options:
  62102. </p>
  62103. <dl class="table">
  62104. <dt><samp class="option">expr</samp></dt>
  62105. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  62106. </p>
  62107. </dd>
  62108. </dl>
  62109. <p>The expression is evaluated through the eval API and can contain the following
  62110. constants:
  62111. </p>
  62112. <dl class="table">
  62113. <dt><samp class="option">FRAME_RATE, FR</samp></dt>
  62114. <dd><p>frame rate, only defined for constant frame-rate video
  62115. </p>
  62116. </dd>
  62117. <dt><samp class="option">PTS</samp></dt>
  62118. <dd><p>The presentation timestamp in input
  62119. </p>
  62120. </dd>
  62121. <dt><samp class="option">N</samp></dt>
  62122. <dd><p>The count of the input frame for video or the number of consumed samples,
  62123. not including the current frame for audio, starting from 0.
  62124. </p>
  62125. </dd>
  62126. <dt><samp class="option">NB_CONSUMED_SAMPLES</samp></dt>
  62127. <dd><p>The number of consumed samples, not including the current frame (only
  62128. audio)
  62129. </p>
  62130. </dd>
  62131. <dt><samp class="option">NB_SAMPLES, S</samp></dt>
  62132. <dd><p>The number of samples in the current frame (only audio)
  62133. </p>
  62134. </dd>
  62135. <dt><samp class="option">SAMPLE_RATE, SR</samp></dt>
  62136. <dd><p>The audio sample rate.
  62137. </p>
  62138. </dd>
  62139. <dt><samp class="option">STARTPTS</samp></dt>
  62140. <dd><p>The PTS of the first frame.
  62141. </p>
  62142. </dd>
  62143. <dt><samp class="option">STARTT</samp></dt>
  62144. <dd><p>the time in seconds of the first frame
  62145. </p>
  62146. </dd>
  62147. <dt><samp class="option">INTERLACED</samp></dt>
  62148. <dd><p>State whether the current frame is interlaced.
  62149. </p>
  62150. </dd>
  62151. <dt><samp class="option">T</samp></dt>
  62152. <dd><p>the time in seconds of the current frame
  62153. </p>
  62154. </dd>
  62155. <dt><samp class="option">POS</samp></dt>
  62156. <dd><p>original position in the file of the frame, or undefined if undefined
  62157. for the current frame; deprecated, do not use
  62158. </p>
  62159. </dd>
  62160. <dt><samp class="option">PREV_INPTS</samp></dt>
  62161. <dd><p>The previous input PTS.
  62162. </p>
  62163. </dd>
  62164. <dt><samp class="option">PREV_INT</samp></dt>
  62165. <dd><p>previous input time in seconds
  62166. </p>
  62167. </dd>
  62168. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  62169. <dd><p>The previous output PTS.
  62170. </p>
  62171. </dd>
  62172. <dt><samp class="option">PREV_OUTT</samp></dt>
  62173. <dd><p>previous output time in seconds
  62174. </p>
  62175. </dd>
  62176. <dt><samp class="option">RTCTIME</samp></dt>
  62177. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  62178. instead.
  62179. </p>
  62180. </dd>
  62181. <dt><samp class="option">RTCSTART</samp></dt>
  62182. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  62183. </p>
  62184. </dd>
  62185. <dt><samp class="option">TB</samp></dt>
  62186. <dd><p>The timebase of the input timestamps.
  62187. </p>
  62188. </dd>
  62189. <dt><samp class="option">T_CHANGE</samp></dt>
  62190. <dd><p>Time of the first frame after command was applied or time of the first frame if no commands.
  62191. </p>
  62192. </dd>
  62193. </dl>
  62194. <ul class="mini-toc">
  62195. <li><a href="#Examples-209" accesskey="1">Examples</a></li>
  62196. <li><a href="#Commands-164" accesskey="2">Commands</a></li>
  62197. </ul>
  62198. <div class="subsection-level-extent" id="Examples-209">
  62199. <h4 class="subsection"><span>46.19.1 Examples<a class="copiable-link" href="#Examples-209"> &para;</a></span></h4>
  62200. <ul class="itemize mark-bullet">
  62201. <li>Start counting PTS from zero
  62202. <div class="example">
  62203. <pre class="example-preformatted">setpts=PTS-STARTPTS
  62204. </pre></div>
  62205. </li><li>Apply fast motion effect:
  62206. <div class="example">
  62207. <pre class="example-preformatted">setpts=0.5*PTS
  62208. </pre></div>
  62209. </li><li>Apply slow motion effect:
  62210. <div class="example">
  62211. <pre class="example-preformatted">setpts=2.0*PTS
  62212. </pre></div>
  62213. </li><li>Set fixed rate of 25 frames per second:
  62214. <div class="example">
  62215. <pre class="example-preformatted">setpts=N/(25*TB)
  62216. </pre></div>
  62217. </li><li>Apply a random jitter effect of +/-100 TB units:
  62218. <div class="example">
  62219. <pre class="example-preformatted">setpts=PTS+randomi(0, -100\,100)
  62220. </pre></div>
  62221. </li><li>Set fixed rate 25 fps with some jitter:
  62222. <div class="example">
  62223. <pre class="example-preformatted">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  62224. </pre></div>
  62225. </li><li>Apply an offset of 10 seconds to the input PTS:
  62226. <div class="example">
  62227. <pre class="example-preformatted">setpts=PTS+10/TB
  62228. </pre></div>
  62229. </li><li>Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  62230. <div class="example">
  62231. <pre class="example-preformatted">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  62232. </pre></div>
  62233. </li><li>Generate timestamps by counting samples:
  62234. <div class="example">
  62235. <pre class="example-preformatted">asetpts=N/SR/TB
  62236. </pre></div>
  62237. </li></ul>
  62238. </div>
  62239. <div class="subsection-level-extent" id="Commands-164">
  62240. <h4 class="subsection"><span>46.19.2 Commands<a class="copiable-link" href="#Commands-164"> &para;</a></span></h4>
  62241. <p>Both filters support all above options as <a class="ref" href="#commands">commands</a>.
  62242. </p>
  62243. </div>
  62244. </div>
  62245. <div class="section-level-extent" id="setrange">
  62246. <h3 class="section"><span>46.20 setrange<a class="copiable-link" href="#setrange"> &para;</a></span></h3>
  62247. <p>Force color range for the output video frame.
  62248. </p>
  62249. <p>The <code class="code">setrange</code> filter marks the color range property for the
  62250. output frames. It does not change the input frame, but only sets the
  62251. corresponding property, which affects how the frame is treated by
  62252. following filters.
  62253. </p>
  62254. <p>The filter accepts the following options:
  62255. </p>
  62256. <dl class="table">
  62257. <dt><samp class="option">range</samp></dt>
  62258. <dd><p>Available values are:
  62259. </p>
  62260. <dl class="table">
  62261. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  62262. <dd><p>Keep the same color range property.
  62263. </p>
  62264. </dd>
  62265. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  62266. <dd><p>Set the color range as unspecified.
  62267. </p>
  62268. </dd>
  62269. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  62270. <dd><p>Set the color range as limited.
  62271. </p>
  62272. </dd>
  62273. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  62274. <dd><p>Set the color range as full.
  62275. </p></dd>
  62276. </dl>
  62277. </dd>
  62278. </dl>
  62279. </div>
  62280. <div class="section-level-extent" id="settb_002c-asettb">
  62281. <h3 class="section"><span>46.21 settb, asettb<a class="copiable-link" href="#settb_002c-asettb"> &para;</a></span></h3>
  62282. <p>Set the timebase to use for the output frames timestamps.
  62283. It is mainly useful for testing timebase configuration.
  62284. </p>
  62285. <p>It accepts the following parameters:
  62286. </p>
  62287. <dl class="table">
  62288. <dt><samp class="option">expr, tb</samp></dt>
  62289. <dd><p>The expression which is evaluated into the output timebase.
  62290. </p>
  62291. </dd>
  62292. </dl>
  62293. <p>The value for <samp class="option">tb</samp> is an arithmetic expression representing a
  62294. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  62295. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  62296. audio only). Default value is &quot;intb&quot;.
  62297. </p>
  62298. <ul class="mini-toc">
  62299. <li><a href="#Examples-210" accesskey="1">Examples</a></li>
  62300. </ul>
  62301. <div class="subsection-level-extent" id="Examples-210">
  62302. <h4 class="subsection"><span>46.21.1 Examples<a class="copiable-link" href="#Examples-210"> &para;</a></span></h4>
  62303. <ul class="itemize mark-bullet">
  62304. <li>Set the timebase to 1/25:
  62305. <div class="example">
  62306. <pre class="example-preformatted">settb=expr=1/25
  62307. </pre></div>
  62308. </li><li>Set the timebase to 1/10:
  62309. <div class="example">
  62310. <pre class="example-preformatted">settb=expr=0.1
  62311. </pre></div>
  62312. </li><li>Set the timebase to 1001/1000:
  62313. <div class="example">
  62314. <pre class="example-preformatted">settb=1+0.001
  62315. </pre></div>
  62316. </li><li>Set the timebase to 2*intb:
  62317. <div class="example">
  62318. <pre class="example-preformatted">settb=2*intb
  62319. </pre></div>
  62320. </li><li>Set the default timebase value:
  62321. <div class="example">
  62322. <pre class="example-preformatted">settb=AVTB
  62323. </pre></div>
  62324. </li></ul>
  62325. </div>
  62326. </div>
  62327. <div class="section-level-extent" id="showcqt">
  62328. <h3 class="section"><span>46.22 showcqt<a class="copiable-link" href="#showcqt"> &para;</a></span></h3>
  62329. <p>Convert input audio to a video output representing frequency spectrum
  62330. logarithmically using Brown-Puckette constant Q transform algorithm with
  62331. direct frequency domain coefficient calculation (but the transform itself
  62332. is not really constant Q, instead the Q factor is actually variable/clamped),
  62333. with musical tone scale, from E0 to D#10.
  62334. </p>
  62335. <p>The filter accepts the following options:
  62336. </p>
  62337. <dl class="table">
  62338. <dt><samp class="option">size, s</samp></dt>
  62339. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  62340. 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>.
  62341. Default value is <code class="code">1920x1080</code>.
  62342. </p>
  62343. </dd>
  62344. <dt><samp class="option">fps, rate, r</samp></dt>
  62345. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  62346. </p>
  62347. </dd>
  62348. <dt><samp class="option">bar_h</samp></dt>
  62349. <dd><p>Set the bargraph height. It must be even. Default value is <code class="code">-1</code> which
  62350. computes the bargraph height automatically.
  62351. </p>
  62352. </dd>
  62353. <dt><samp class="option">axis_h</samp></dt>
  62354. <dd><p>Set the axis height. It must be even. Default value is <code class="code">-1</code> which computes
  62355. the axis height automatically.
  62356. </p>
  62357. </dd>
  62358. <dt><samp class="option">sono_h</samp></dt>
  62359. <dd><p>Set the sonogram height. It must be even. Default value is <code class="code">-1</code> which
  62360. computes the sonogram height automatically.
  62361. </p>
  62362. </dd>
  62363. <dt><samp class="option">fullhd</samp></dt>
  62364. <dd><p>Set the fullhd resolution. This option is deprecated, use <var class="var">size</var>, <var class="var">s</var>
  62365. instead. Default value is <code class="code">1</code>.
  62366. </p>
  62367. </dd>
  62368. <dt><samp class="option">sono_v, volume</samp></dt>
  62369. <dd><p>Specify the sonogram volume expression. It can contain variables:
  62370. </p><dl class="table">
  62371. <dt><samp class="option">bar_v</samp></dt>
  62372. <dd><p>the <var class="var">bar_v</var> evaluated expression
  62373. </p></dd>
  62374. <dt><samp class="option">frequency, freq, f</samp></dt>
  62375. <dd><p>the frequency where it is evaluated
  62376. </p></dd>
  62377. <dt><samp class="option">timeclamp, tc</samp></dt>
  62378. <dd><p>the value of <var class="var">timeclamp</var> option
  62379. </p></dd>
  62380. </dl>
  62381. <p>and functions:
  62382. </p><dl class="table">
  62383. <dt><samp class="option">a_weighting(f)</samp></dt>
  62384. <dd><p>A-weighting of equal loudness
  62385. </p></dd>
  62386. <dt><samp class="option">b_weighting(f)</samp></dt>
  62387. <dd><p>B-weighting of equal loudness
  62388. </p></dd>
  62389. <dt><samp class="option">c_weighting(f)</samp></dt>
  62390. <dd><p>C-weighting of equal loudness.
  62391. </p></dd>
  62392. </dl>
  62393. <p>Default value is <code class="code">16</code>.
  62394. </p>
  62395. </dd>
  62396. <dt><samp class="option">bar_v, volume2</samp></dt>
  62397. <dd><p>Specify the bargraph volume expression. It can contain variables:
  62398. </p><dl class="table">
  62399. <dt><samp class="option">sono_v</samp></dt>
  62400. <dd><p>the <var class="var">sono_v</var> evaluated expression
  62401. </p></dd>
  62402. <dt><samp class="option">frequency, freq, f</samp></dt>
  62403. <dd><p>the frequency where it is evaluated
  62404. </p></dd>
  62405. <dt><samp class="option">timeclamp, tc</samp></dt>
  62406. <dd><p>the value of <var class="var">timeclamp</var> option
  62407. </p></dd>
  62408. </dl>
  62409. <p>and functions:
  62410. </p><dl class="table">
  62411. <dt><samp class="option">a_weighting(f)</samp></dt>
  62412. <dd><p>A-weighting of equal loudness
  62413. </p></dd>
  62414. <dt><samp class="option">b_weighting(f)</samp></dt>
  62415. <dd><p>B-weighting of equal loudness
  62416. </p></dd>
  62417. <dt><samp class="option">c_weighting(f)</samp></dt>
  62418. <dd><p>C-weighting of equal loudness.
  62419. </p></dd>
  62420. </dl>
  62421. <p>Default value is <code class="code">sono_v</code>.
  62422. </p>
  62423. </dd>
  62424. <dt><samp class="option">sono_g, gamma</samp></dt>
  62425. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  62426. higher gamma makes the spectrum having more range. Default value is <code class="code">3</code>.
  62427. Acceptable range is <code class="code">[1, 7]</code>.
  62428. </p>
  62429. </dd>
  62430. <dt><samp class="option">bar_g, gamma2</samp></dt>
  62431. <dd><p>Specify the bargraph gamma. Default value is <code class="code">1</code>. Acceptable range is
  62432. <code class="code">[1, 7]</code>.
  62433. </p>
  62434. </dd>
  62435. <dt><samp class="option">bar_t</samp></dt>
  62436. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  62437. Default value is <code class="code">1</code>. Acceptable range is <code class="code">[0, 1]</code>.
  62438. </p>
  62439. </dd>
  62440. <dt><samp class="option">timeclamp, tc</samp></dt>
  62441. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  62442. accuracy in time domain and frequency domain. If timeclamp is lower,
  62443. event in time domain is represented more accurately (such as fast bass drum),
  62444. otherwise event in frequency domain is represented more accurately
  62445. (such as bass guitar). Acceptable range is <code class="code">[0.002, 1]</code>. Default value is <code class="code">0.17</code>.
  62446. </p>
  62447. </dd>
  62448. <dt><samp class="option">attack</samp></dt>
  62449. <dd><p>Set attack time in seconds. The default is <code class="code">0</code> (disabled). Otherwise, it
  62450. limits future samples by applying asymmetric windowing in time domain, useful
  62451. when low latency is required. Accepted range is <code class="code">[0, 1]</code>.
  62452. </p>
  62453. </dd>
  62454. <dt><samp class="option">basefreq</samp></dt>
  62455. <dd><p>Specify the transform base frequency. Default value is <code class="code">20.01523126408007475</code>,
  62456. which is frequency 50 cents below E0. Acceptable range is <code class="code">[10, 100000]</code>.
  62457. </p>
  62458. </dd>
  62459. <dt><samp class="option">endfreq</samp></dt>
  62460. <dd><p>Specify the transform end frequency. Default value is <code class="code">20495.59681441799654</code>,
  62461. which is frequency 50 cents above D#10. Acceptable range is <code class="code">[10, 100000]</code>.
  62462. </p>
  62463. </dd>
  62464. <dt><samp class="option">coeffclamp</samp></dt>
  62465. <dd><p>This option is deprecated and ignored.
  62466. </p>
  62467. </dd>
  62468. <dt><samp class="option">tlength</samp></dt>
  62469. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  62470. trade-off between time domain and frequency domain at every frequency sample.
  62471. It can contain variables:
  62472. </p><dl class="table">
  62473. <dt><samp class="option">frequency, freq, f</samp></dt>
  62474. <dd><p>the frequency where it is evaluated
  62475. </p></dd>
  62476. <dt><samp class="option">timeclamp, tc</samp></dt>
  62477. <dd><p>the value of <var class="var">timeclamp</var> option.
  62478. </p></dd>
  62479. </dl>
  62480. <p>Default value is <code class="code">384*tc/(384+tc*f)</code>.
  62481. </p>
  62482. </dd>
  62483. <dt><samp class="option">count</samp></dt>
  62484. <dd><p>Specify the transform count for every video frame. Default value is <code class="code">6</code>.
  62485. Acceptable range is <code class="code">[1, 30]</code>.
  62486. </p>
  62487. </dd>
  62488. <dt><samp class="option">fcount</samp></dt>
  62489. <dd><p>Specify the transform count for every single pixel. Default value is <code class="code">0</code>,
  62490. which makes it computed automatically. Acceptable range is <code class="code">[0, 10]</code>.
  62491. </p>
  62492. </dd>
  62493. <dt><samp class="option">fontfile</samp></dt>
  62494. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  62495. use embedded font. Note that drawing with font file or embedded font is not
  62496. implemented with custom <var class="var">basefreq</var> and <var class="var">endfreq</var>, use <var class="var">axisfile</var>
  62497. option instead.
  62498. </p>
  62499. </dd>
  62500. <dt><samp class="option">font</samp></dt>
  62501. <dd><p>Specify fontconfig pattern. This has lower priority than <var class="var">fontfile</var>. The
  62502. <code class="code">:</code> in the pattern may be replaced by <code class="code">|</code> to avoid unnecessary
  62503. escaping.
  62504. </p>
  62505. </dd>
  62506. <dt><samp class="option">fontcolor</samp></dt>
  62507. <dd><p>Specify font color expression. This is arithmetic expression that should return
  62508. integer value 0xRRGGBB. It can contain variables:
  62509. </p><dl class="table">
  62510. <dt><samp class="option">frequency, freq, f</samp></dt>
  62511. <dd><p>the frequency where it is evaluated
  62512. </p></dd>
  62513. <dt><samp class="option">timeclamp, tc</samp></dt>
  62514. <dd><p>the value of <var class="var">timeclamp</var> option
  62515. </p></dd>
  62516. </dl>
  62517. <p>and functions:
  62518. </p><dl class="table">
  62519. <dt><samp class="option">midi(f)</samp></dt>
  62520. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  62521. </p></dd>
  62522. <dt><samp class="option">r(x), g(x), b(x)</samp></dt>
  62523. <dd><p>red, green, and blue value of intensity x.
  62524. </p></dd>
  62525. </dl>
  62526. <p>Default value is <code class="code">st(0, (midi(f)-59.5)/12);
  62527. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  62528. r(1-ld(1)) + b(ld(1))</code>.
  62529. </p>
  62530. </dd>
  62531. <dt><samp class="option">axisfile</samp></dt>
  62532. <dd><p>Specify image file to draw the axis. This option override <var class="var">fontfile</var> and
  62533. <var class="var">fontcolor</var> option.
  62534. </p>
  62535. </dd>
  62536. <dt><samp class="option">axis, text</samp></dt>
  62537. <dd><p>Enable/disable drawing text to the axis. If it is set to <code class="code">0</code>, drawing to
  62538. the axis is disabled, ignoring <var class="var">fontfile</var> and <var class="var">axisfile</var> option.
  62539. Default value is <code class="code">1</code>.
  62540. </p>
  62541. </dd>
  62542. <dt><samp class="option">csp</samp></dt>
  62543. <dd><p>Set colorspace. The accepted values are:
  62544. </p><dl class="table">
  62545. <dt>&lsquo;<samp class="samp">unspecified</samp>&rsquo;</dt>
  62546. <dd><p>Unspecified (default)
  62547. </p>
  62548. </dd>
  62549. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  62550. <dd><p>BT.709
  62551. </p>
  62552. </dd>
  62553. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  62554. <dd><p>FCC
  62555. </p>
  62556. </dd>
  62557. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  62558. <dd><p>BT.470BG or BT.601-6 625
  62559. </p>
  62560. </dd>
  62561. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  62562. <dd><p>SMPTE-170M or BT.601-6 525
  62563. </p>
  62564. </dd>
  62565. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  62566. <dd><p>SMPTE-240M
  62567. </p>
  62568. </dd>
  62569. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  62570. <dd><p>BT.2020 with non-constant luminance
  62571. </p>
  62572. </dd>
  62573. </dl>
  62574. </dd>
  62575. <dt><samp class="option">cscheme</samp></dt>
  62576. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  62577. <code class="code">left_r|left_g|left_b|right_r|right_g|right_b</code>.
  62578. The default is <code class="code">1|0.5|0|0|0.5|1</code>.
  62579. </p>
  62580. </dd>
  62581. </dl>
  62582. <ul class="mini-toc">
  62583. <li><a href="#Examples-211" accesskey="1">Examples</a></li>
  62584. </ul>
  62585. <div class="subsection-level-extent" id="Examples-211">
  62586. <h4 class="subsection"><span>46.22.1 Examples<a class="copiable-link" href="#Examples-211"> &para;</a></span></h4>
  62587. <ul class="itemize mark-bullet">
  62588. <li>Playing audio while showing the spectrum:
  62589. <div class="example">
  62590. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  62591. </pre></div>
  62592. </li><li>Same as above, but with frame rate 30 fps:
  62593. <div class="example">
  62594. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  62595. </pre></div>
  62596. </li><li>Playing at 1280x720:
  62597. <div class="example">
  62598. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  62599. </pre></div>
  62600. </li><li>Disable sonogram display:
  62601. <div class="example">
  62602. <pre class="example-preformatted">sono_h=0
  62603. </pre></div>
  62604. </li><li>A1 and its harmonics: A1, A2, (near)E3, A3:
  62605. <div class="example">
  62606. <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),
  62607. asplit[a][out1]; [a] showcqt [out0]'
  62608. </pre></div>
  62609. </li><li>Same as above, but with more accuracy in frequency domain:
  62610. <div class="example">
  62611. <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),
  62612. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  62613. </pre></div>
  62614. </li><li>Custom volume:
  62615. <div class="example">
  62616. <pre class="example-preformatted">bar_v=10:sono_v=bar_v*a_weighting(f)
  62617. </pre></div>
  62618. </li><li>Custom gamma, now spectrum is linear to the amplitude.
  62619. <div class="example">
  62620. <pre class="example-preformatted">bar_g=2:sono_g=2
  62621. </pre></div>
  62622. </li><li>Custom tlength equation:
  62623. <div class="example">
  62624. <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)))'
  62625. </pre></div>
  62626. </li><li>Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  62627. <div class="example">
  62628. <pre class="example-preformatted">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  62629. </pre></div>
  62630. </li><li>Custom font using fontconfig:
  62631. <div class="example">
  62632. <pre class="example-preformatted">font='Courier New,Monospace,mono|bold'
  62633. </pre></div>
  62634. </li><li>Custom frequency range with custom axis using image file:
  62635. <div class="example">
  62636. <pre class="example-preformatted">axisfile=myaxis.png:basefreq=40:endfreq=10000
  62637. </pre></div>
  62638. </li></ul>
  62639. </div>
  62640. </div>
  62641. <div class="section-level-extent" id="showcwt">
  62642. <h3 class="section"><span>46.23 showcwt<a class="copiable-link" href="#showcwt"> &para;</a></span></h3>
  62643. <p>Convert input audio to video output representing frequency spectrum
  62644. using Continuous Wavelet Transform and Morlet wavelet.
  62645. </p>
  62646. <p>The filter accepts the following options:
  62647. </p>
  62648. <dl class="table">
  62649. <dt><samp class="option">size, s</samp></dt>
  62650. <dd><p>Specify the video size for the output. For the syntax of this option,
  62651. 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>.
  62652. Default value is <code class="code">640x512</code>.
  62653. </p>
  62654. </dd>
  62655. <dt><samp class="option">rate, r</samp></dt>
  62656. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  62657. </p>
  62658. </dd>
  62659. <dt><samp class="option">scale</samp></dt>
  62660. <dd><p>Set the frequency scale used. Allowed values are:
  62661. </p>
  62662. <dl class="table">
  62663. <dt><samp class="option">linear</samp></dt>
  62664. <dt><samp class="option">log</samp></dt>
  62665. <dt><samp class="option">bark</samp></dt>
  62666. <dt><samp class="option">mel</samp></dt>
  62667. <dt><samp class="option">erbs</samp></dt>
  62668. <dt><samp class="option">sqrt</samp></dt>
  62669. <dt><samp class="option">cbrt</samp></dt>
  62670. <dt><samp class="option">qdrt</samp></dt>
  62671. <dt><samp class="option">fm</samp></dt>
  62672. </dl>
  62673. <p>Default value is <code class="code">linear</code>.
  62674. </p>
  62675. </dd>
  62676. <dt><samp class="option">iscale</samp></dt>
  62677. <dd><p>Set the intensity scale used. Allowed values are:
  62678. </p>
  62679. <dl class="table">
  62680. <dt><samp class="option">linear</samp></dt>
  62681. <dt><samp class="option">log</samp></dt>
  62682. <dt><samp class="option">sqrt</samp></dt>
  62683. <dt><samp class="option">cbrt</samp></dt>
  62684. <dt><samp class="option">qdrt</samp></dt>
  62685. </dl>
  62686. <p>Default value is <code class="code">log</code>.
  62687. </p>
  62688. </dd>
  62689. <dt><samp class="option">min</samp></dt>
  62690. <dd><p>Set the minimum frequency that will be used in output.
  62691. Default is <code class="code">20</code> Hz.
  62692. </p>
  62693. </dd>
  62694. <dt><samp class="option">max</samp></dt>
  62695. <dd><p>Set the maximum frequency that will be used in output.
  62696. Default is <code class="code">20000</code> Hz. The real frequency upper limit
  62697. depends on input audio&rsquo;s sample rate and such will be enforced
  62698. on this value when it is set to value greater than Nyquist frequency.
  62699. </p>
  62700. </dd>
  62701. <dt><samp class="option">imin</samp></dt>
  62702. <dd><p>Set the minimum intensity that will be used in output.
  62703. </p>
  62704. </dd>
  62705. <dt><samp class="option">imax</samp></dt>
  62706. <dd><p>Set the maximum intensity that will be used in output.
  62707. </p>
  62708. </dd>
  62709. <dt><samp class="option">logb</samp></dt>
  62710. <dd><p>Set the logarithmic basis for brightness strength when
  62711. mapping calculated magnitude values to pixel values.
  62712. Allowed range is from <code class="code">0</code> to <code class="code">1</code>.
  62713. Default value is <code class="code">0.0001</code>.
  62714. </p>
  62715. </dd>
  62716. <dt><samp class="option">deviation</samp></dt>
  62717. <dd><p>Set the frequency deviation.
  62718. Lower values than <code class="code">1</code> are more frequency oriented,
  62719. while higher values than <code class="code">1</code> are more time oriented.
  62720. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  62721. Default value is <code class="code">1</code>.
  62722. </p>
  62723. </dd>
  62724. <dt><samp class="option">pps</samp></dt>
  62725. <dd><p>Set the number of pixel output per each second in one row.
  62726. Allowed range is from <code class="code">1</code> to <code class="code">1024</code>.
  62727. Default value is <code class="code">64</code>.
  62728. </p>
  62729. </dd>
  62730. <dt><samp class="option">mode</samp></dt>
  62731. <dd><p>Set the output visual mode. Allowed values are:
  62732. </p>
  62733. <dl class="table">
  62734. <dt><samp class="option">magnitude</samp></dt>
  62735. <dd><p>Show magnitude.
  62736. </p></dd>
  62737. <dt><samp class="option">phase</samp></dt>
  62738. <dd><p>Show only phase.
  62739. </p></dd>
  62740. <dt><samp class="option">magphase</samp></dt>
  62741. <dd><p>Show combination of magnitude and phase.
  62742. Magnitude is mapped to brightness and phase to color.
  62743. </p></dd>
  62744. <dt><samp class="option">channel</samp></dt>
  62745. <dd><p>Show unique color per channel magnitude.
  62746. </p></dd>
  62747. <dt><samp class="option">stereo</samp></dt>
  62748. <dd><p>Show unique color per stereo difference.
  62749. </p></dd>
  62750. </dl>
  62751. <p>Default value is <code class="code">magnitude</code>.
  62752. </p>
  62753. </dd>
  62754. <dt><samp class="option">slide</samp></dt>
  62755. <dd><p>Set the output slide method. Allowed values are:
  62756. </p>
  62757. <dl class="table">
  62758. <dt><samp class="option">replace</samp></dt>
  62759. <dt><samp class="option">scroll</samp></dt>
  62760. <dt><samp class="option">frame</samp></dt>
  62761. </dl>
  62762. </dd>
  62763. <dt><samp class="option">direction</samp></dt>
  62764. <dd><p>Set the direction method for output slide method. Allowed values are:
  62765. </p>
  62766. <dl class="table">
  62767. <dt><samp class="option">lr</samp></dt>
  62768. <dd><p>Direction from left to right.
  62769. </p></dd>
  62770. <dt><samp class="option">rl</samp></dt>
  62771. <dd><p>Direction from right to left.
  62772. </p></dd>
  62773. <dt><samp class="option">ud</samp></dt>
  62774. <dd><p>Direction from up to down.
  62775. </p></dd>
  62776. <dt><samp class="option">du</samp></dt>
  62777. <dd><p>Direction from down to up.
  62778. </p></dd>
  62779. </dl>
  62780. </dd>
  62781. <dt><samp class="option">bar</samp></dt>
  62782. <dd><p>Set the ratio of bargraph display to display size. Default is 0.
  62783. </p>
  62784. </dd>
  62785. <dt><samp class="option">rotation</samp></dt>
  62786. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  62787. Default value is <code class="code">0</code>.
  62788. </p></dd>
  62789. </dl>
  62790. </div>
  62791. <div class="section-level-extent" id="showfreqs">
  62792. <h3 class="section"><span>46.24 showfreqs<a class="copiable-link" href="#showfreqs"> &para;</a></span></h3>
  62793. <p>Convert input audio to video output representing the audio power spectrum.
  62794. Audio amplitude is on Y-axis while frequency is on X-axis.
  62795. </p>
  62796. <p>The filter accepts the following options:
  62797. </p>
  62798. <dl class="table">
  62799. <dt><samp class="option">size, s</samp></dt>
  62800. <dd><p>Specify size of video. For the syntax of this option, check the
  62801. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  62802. Default is <code class="code">1024x512</code>.
  62803. </p>
  62804. </dd>
  62805. <dt><samp class="option">rate, r</samp></dt>
  62806. <dd><p>Set video rate. Default is <code class="code">25</code>.
  62807. </p>
  62808. </dd>
  62809. <dt><samp class="option">mode</samp></dt>
  62810. <dd><p>Set display mode.
  62811. This set how each frequency bin will be represented.
  62812. </p>
  62813. <p>It accepts the following values:
  62814. </p><dl class="table">
  62815. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  62816. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  62817. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  62818. </dl>
  62819. <p>Default is <code class="code">bar</code>.
  62820. </p>
  62821. </dd>
  62822. <dt><samp class="option">ascale</samp></dt>
  62823. <dd><p>Set amplitude scale.
  62824. </p>
  62825. <p>It accepts the following values:
  62826. </p><dl class="table">
  62827. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62828. <dd><p>Linear scale.
  62829. </p>
  62830. </dd>
  62831. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  62832. <dd><p>Square root scale.
  62833. </p>
  62834. </dd>
  62835. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  62836. <dd><p>Cubic root scale.
  62837. </p>
  62838. </dd>
  62839. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62840. <dd><p>Logarithmic scale.
  62841. </p></dd>
  62842. </dl>
  62843. <p>Default is <code class="code">log</code>.
  62844. </p>
  62845. </dd>
  62846. <dt><samp class="option">fscale</samp></dt>
  62847. <dd><p>Set frequency scale.
  62848. </p>
  62849. <p>It accepts the following values:
  62850. </p><dl class="table">
  62851. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  62852. <dd><p>Linear scale.
  62853. </p>
  62854. </dd>
  62855. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  62856. <dd><p>Logarithmic scale.
  62857. </p>
  62858. </dd>
  62859. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  62860. <dd><p>Reverse logarithmic scale.
  62861. </p></dd>
  62862. </dl>
  62863. <p>Default is <code class="code">lin</code>.
  62864. </p>
  62865. </dd>
  62866. <dt><samp class="option">win_size</samp></dt>
  62867. <dd><p>Set window size. Allowed range is from 16 to 65536.
  62868. </p>
  62869. <p>Default is <code class="code">2048</code>
  62870. </p>
  62871. </dd>
  62872. <dt><samp class="option">win_func</samp></dt>
  62873. <dd><p>Set windowing function.
  62874. </p>
  62875. <p>It accepts the following values:
  62876. </p><dl class="table">
  62877. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  62878. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  62879. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  62880. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  62881. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  62882. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  62883. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  62884. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  62885. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  62886. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  62887. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  62888. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  62889. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  62890. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  62891. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  62892. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  62893. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  62894. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  62895. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  62896. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  62897. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  62898. </dl>
  62899. <p>Default is <code class="code">hanning</code>.
  62900. </p>
  62901. </dd>
  62902. <dt><samp class="option">overlap</samp></dt>
  62903. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  62904. which means optimal overlap for selected window function will be picked.
  62905. </p>
  62906. </dd>
  62907. <dt><samp class="option">averaging</samp></dt>
  62908. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  62909. Default is <code class="code">1</code>, which means time averaging is disabled.
  62910. </p>
  62911. </dd>
  62912. <dt><samp class="option">colors</samp></dt>
  62913. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  62914. draw channel frequencies. Unrecognized or missing colors will be replaced
  62915. by white color.
  62916. </p>
  62917. </dd>
  62918. <dt><samp class="option">cmode</samp></dt>
  62919. <dd><p>Set channel display mode.
  62920. </p>
  62921. <p>It accepts the following values:
  62922. </p><dl class="table">
  62923. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  62924. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  62925. </dl>
  62926. <p>Default is <code class="code">combined</code>.
  62927. </p>
  62928. </dd>
  62929. <dt><samp class="option">minamp</samp></dt>
  62930. <dd><p>Set minimum amplitude used in <code class="code">log</code> amplitude scaler.
  62931. </p>
  62932. </dd>
  62933. <dt><samp class="option">data</samp></dt>
  62934. <dd><p>Set data display mode.
  62935. </p>
  62936. <p>It accepts the following values:
  62937. </p><dl class="table">
  62938. <dt>&lsquo;<samp class="samp">magnitude</samp>&rsquo;</dt>
  62939. <dt>&lsquo;<samp class="samp">phase</samp>&rsquo;</dt>
  62940. <dt>&lsquo;<samp class="samp">delay</samp>&rsquo;</dt>
  62941. </dl>
  62942. <p>Default is <code class="code">magnitude</code>.
  62943. </p>
  62944. </dd>
  62945. <dt><samp class="option">channels</samp></dt>
  62946. <dd><p>Set channels to use when processing audio. By default all are processed.
  62947. </p></dd>
  62948. </dl>
  62949. </div>
  62950. <div class="section-level-extent" id="showspatial">
  62951. <h3 class="section"><span>46.25 showspatial<a class="copiable-link" href="#showspatial"> &para;</a></span></h3>
  62952. <p>Convert stereo input audio to a video output, representing the spatial relationship
  62953. between two channels.
  62954. </p>
  62955. <p>The filter accepts the following options:
  62956. </p>
  62957. <dl class="table">
  62958. <dt><samp class="option">size, s</samp></dt>
  62959. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  62960. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  62961. Default value is <code class="code">512x512</code>.
  62962. </p>
  62963. </dd>
  62964. <dt><samp class="option">win_size</samp></dt>
  62965. <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>.
  62966. </p>
  62967. </dd>
  62968. <dt><samp class="option">win_func</samp></dt>
  62969. <dd><p>Set window function.
  62970. </p>
  62971. <p>It accepts the following values:
  62972. </p><dl class="table">
  62973. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  62974. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  62975. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  62976. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  62977. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  62978. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  62979. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  62980. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  62981. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  62982. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  62983. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  62984. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  62985. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  62986. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  62987. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  62988. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  62989. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  62990. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  62991. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  62992. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  62993. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  62994. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  62995. </dl>
  62996. <p>Default value is <code class="code">hann</code>.
  62997. </p>
  62998. </dd>
  62999. <dt><samp class="option">rate, r</samp></dt>
  63000. <dd><p>Set output framerate.
  63001. </p></dd>
  63002. </dl>
  63003. <a class="anchor" id="showspectrum"></a></div>
  63004. <div class="section-level-extent" id="showspectrum-1">
  63005. <h3 class="section"><span>46.26 showspectrum<a class="copiable-link" href="#showspectrum-1"> &para;</a></span></h3>
  63006. <p>Convert input audio to a video output, representing the audio frequency
  63007. spectrum.
  63008. </p>
  63009. <p>The filter accepts the following options:
  63010. </p>
  63011. <dl class="table">
  63012. <dt><samp class="option">size, s</samp></dt>
  63013. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  63014. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  63015. Default value is <code class="code">640x512</code>.
  63016. </p>
  63017. </dd>
  63018. <dt><samp class="option">slide</samp></dt>
  63019. <dd><p>Specify how the spectrum should slide along the window.
  63020. </p>
  63021. <p>It accepts the following values:
  63022. </p><dl class="table">
  63023. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  63024. <dd><p>the samples start again on the left when they reach the right
  63025. </p></dd>
  63026. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  63027. <dd><p>the samples scroll from right to left
  63028. </p></dd>
  63029. <dt>&lsquo;<samp class="samp">fullframe</samp>&rsquo;</dt>
  63030. <dd><p>frames are only produced when the samples reach the right
  63031. </p></dd>
  63032. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  63033. <dd><p>the samples scroll from left to right
  63034. </p></dd>
  63035. <dt>&lsquo;<samp class="samp">lreplace</samp>&rsquo;</dt>
  63036. <dd><p>the samples start again on the right when they reach the left
  63037. </p></dd>
  63038. </dl>
  63039. <p>Default value is <code class="code">replace</code>.
  63040. </p>
  63041. </dd>
  63042. <dt><samp class="option">mode</samp></dt>
  63043. <dd><p>Specify display mode.
  63044. </p>
  63045. <p>It accepts the following values:
  63046. </p><dl class="table">
  63047. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  63048. <dd><p>all channels are displayed in the same row
  63049. </p></dd>
  63050. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  63051. <dd><p>all channels are displayed in separate rows
  63052. </p></dd>
  63053. </dl>
  63054. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  63055. </p>
  63056. </dd>
  63057. <dt><samp class="option">color</samp></dt>
  63058. <dd><p>Specify display color mode.
  63059. </p>
  63060. <p>It accepts the following values:
  63061. </p><dl class="table">
  63062. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  63063. <dd><p>each channel is displayed in a separate color
  63064. </p></dd>
  63065. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  63066. <dd><p>each channel is displayed using the same color scheme
  63067. </p></dd>
  63068. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  63069. <dd><p>each channel is displayed using the rainbow color scheme
  63070. </p></dd>
  63071. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  63072. <dd><p>each channel is displayed using the moreland color scheme
  63073. </p></dd>
  63074. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  63075. <dd><p>each channel is displayed using the nebulae color scheme
  63076. </p></dd>
  63077. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  63078. <dd><p>each channel is displayed using the fire color scheme
  63079. </p></dd>
  63080. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  63081. <dd><p>each channel is displayed using the fiery color scheme
  63082. </p></dd>
  63083. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  63084. <dd><p>each channel is displayed using the fruit color scheme
  63085. </p></dd>
  63086. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  63087. <dd><p>each channel is displayed using the cool color scheme
  63088. </p></dd>
  63089. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  63090. <dd><p>each channel is displayed using the magma color scheme
  63091. </p></dd>
  63092. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  63093. <dd><p>each channel is displayed using the green color scheme
  63094. </p></dd>
  63095. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  63096. <dd><p>each channel is displayed using the viridis color scheme
  63097. </p></dd>
  63098. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  63099. <dd><p>each channel is displayed using the plasma color scheme
  63100. </p></dd>
  63101. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  63102. <dd><p>each channel is displayed using the cividis color scheme
  63103. </p></dd>
  63104. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  63105. <dd><p>each channel is displayed using the terrain color scheme
  63106. </p></dd>
  63107. </dl>
  63108. <p>Default value is &lsquo;<samp class="samp">channel</samp>&rsquo;.
  63109. </p>
  63110. </dd>
  63111. <dt><samp class="option">scale</samp></dt>
  63112. <dd><p>Specify scale used for calculating intensity color values.
  63113. </p>
  63114. <p>It accepts the following values:
  63115. </p><dl class="table">
  63116. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  63117. <dd><p>linear
  63118. </p></dd>
  63119. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  63120. <dd><p>square root, default
  63121. </p></dd>
  63122. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  63123. <dd><p>cubic root
  63124. </p></dd>
  63125. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  63126. <dd><p>logarithmic
  63127. </p></dd>
  63128. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  63129. <dd><p>4th root
  63130. </p></dd>
  63131. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  63132. <dd><p>5th root
  63133. </p></dd>
  63134. </dl>
  63135. <p>Default value is &lsquo;<samp class="samp">sqrt</samp>&rsquo;.
  63136. </p>
  63137. </dd>
  63138. <dt><samp class="option">fscale</samp></dt>
  63139. <dd><p>Specify frequency scale.
  63140. </p>
  63141. <p>It accepts the following values:
  63142. </p><dl class="table">
  63143. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  63144. <dd><p>linear
  63145. </p></dd>
  63146. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  63147. <dd><p>logarithmic
  63148. </p></dd>
  63149. </dl>
  63150. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  63151. </p>
  63152. </dd>
  63153. <dt><samp class="option">saturation</samp></dt>
  63154. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  63155. alternative color scheme. <code class="code">0</code> is no saturation at all.
  63156. Saturation must be in [-10.0, 10.0] range.
  63157. Default value is <code class="code">1</code>.
  63158. </p>
  63159. </dd>
  63160. <dt><samp class="option">win_func</samp></dt>
  63161. <dd><p>Set window function.
  63162. </p>
  63163. <p>It accepts the following values:
  63164. </p><dl class="table">
  63165. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  63166. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  63167. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  63168. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  63169. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  63170. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  63171. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  63172. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  63173. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  63174. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  63175. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  63176. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  63177. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  63178. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  63179. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  63180. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  63181. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  63182. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  63183. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  63184. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  63185. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  63186. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  63187. </dl>
  63188. <p>Default value is <code class="code">hann</code>.
  63189. </p>
  63190. </dd>
  63191. <dt><samp class="option">orientation</samp></dt>
  63192. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  63193. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  63194. </p>
  63195. </dd>
  63196. <dt><samp class="option">overlap</samp></dt>
  63197. <dd><p>Set ratio of overlap window. Default value is <code class="code">0</code>.
  63198. When value is <code class="code">1</code> overlap is set to recommended size for specific
  63199. window function currently used.
  63200. </p>
  63201. </dd>
  63202. <dt><samp class="option">gain</samp></dt>
  63203. <dd><p>Set scale gain for calculating intensity color values.
  63204. Default value is <code class="code">1</code>.
  63205. </p>
  63206. </dd>
  63207. <dt><samp class="option">data</samp></dt>
  63208. <dd><p>Set which data to display. Can be <code class="code">magnitude</code>, default or <code class="code">phase</code>,
  63209. or unwrapped phase: <code class="code">uphase</code>.
  63210. </p>
  63211. </dd>
  63212. <dt><samp class="option">rotation</samp></dt>
  63213. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  63214. Default value is <code class="code">0</code>.
  63215. </p>
  63216. </dd>
  63217. <dt><samp class="option">start</samp></dt>
  63218. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  63219. </p>
  63220. </dd>
  63221. <dt><samp class="option">stop</samp></dt>
  63222. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  63223. </p>
  63224. </dd>
  63225. <dt><samp class="option">fps</samp></dt>
  63226. <dd><p>Set upper frame rate limit. Default is <code class="code">auto</code>, unlimited.
  63227. </p>
  63228. </dd>
  63229. <dt><samp class="option">legend</samp></dt>
  63230. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  63231. </p>
  63232. </dd>
  63233. <dt><samp class="option">drange</samp></dt>
  63234. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  63235. Allowed range is from 10 to 200.
  63236. </p>
  63237. </dd>
  63238. <dt><samp class="option">limit</samp></dt>
  63239. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  63240. Allowed range is from -100 to 100.
  63241. </p>
  63242. </dd>
  63243. <dt><samp class="option">opacity</samp></dt>
  63244. <dd><p>Set opacity strength when using pixel format output with alpha component.
  63245. </p></dd>
  63246. </dl>
  63247. <p>The usage is very similar to the showwaves filter; see the examples in that
  63248. section.
  63249. </p>
  63250. <ul class="mini-toc">
  63251. <li><a href="#Examples-212" accesskey="1">Examples</a></li>
  63252. </ul>
  63253. <div class="subsection-level-extent" id="Examples-212">
  63254. <h4 class="subsection"><span>46.26.1 Examples<a class="copiable-link" href="#Examples-212"> &para;</a></span></h4>
  63255. <ul class="itemize mark-bullet">
  63256. <li>Large window with logarithmic color scaling:
  63257. <div class="example">
  63258. <pre class="example-preformatted">showspectrum=s=1280x480:scale=log
  63259. </pre></div>
  63260. </li><li>Complete example for a colored and sliding spectrum per channel using <code class="command">ffplay</code>:
  63261. <div class="example">
  63262. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  63263. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  63264. </pre></div>
  63265. </li></ul>
  63266. </div>
  63267. </div>
  63268. <div class="section-level-extent" id="showspectrumpic">
  63269. <h3 class="section"><span>46.27 showspectrumpic<a class="copiable-link" href="#showspectrumpic"> &para;</a></span></h3>
  63270. <p>Convert input audio to a single video frame, representing the audio frequency
  63271. spectrum.
  63272. </p>
  63273. <p>The filter accepts the following options:
  63274. </p>
  63275. <dl class="table">
  63276. <dt><samp class="option">size, s</samp></dt>
  63277. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  63278. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  63279. Default value is <code class="code">4096x2048</code>.
  63280. </p>
  63281. </dd>
  63282. <dt><samp class="option">mode</samp></dt>
  63283. <dd><p>Specify display mode.
  63284. </p>
  63285. <p>It accepts the following values:
  63286. </p><dl class="table">
  63287. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  63288. <dd><p>all channels are displayed in the same row
  63289. </p></dd>
  63290. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  63291. <dd><p>all channels are displayed in separate rows
  63292. </p></dd>
  63293. </dl>
  63294. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  63295. </p>
  63296. </dd>
  63297. <dt><samp class="option">color</samp></dt>
  63298. <dd><p>Specify display color mode.
  63299. </p>
  63300. <p>It accepts the following values:
  63301. </p><dl class="table">
  63302. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  63303. <dd><p>each channel is displayed in a separate color
  63304. </p></dd>
  63305. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  63306. <dd><p>each channel is displayed using the same color scheme
  63307. </p></dd>
  63308. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  63309. <dd><p>each channel is displayed using the rainbow color scheme
  63310. </p></dd>
  63311. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  63312. <dd><p>each channel is displayed using the moreland color scheme
  63313. </p></dd>
  63314. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  63315. <dd><p>each channel is displayed using the nebulae color scheme
  63316. </p></dd>
  63317. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  63318. <dd><p>each channel is displayed using the fire color scheme
  63319. </p></dd>
  63320. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  63321. <dd><p>each channel is displayed using the fiery color scheme
  63322. </p></dd>
  63323. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  63324. <dd><p>each channel is displayed using the fruit color scheme
  63325. </p></dd>
  63326. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  63327. <dd><p>each channel is displayed using the cool color scheme
  63328. </p></dd>
  63329. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  63330. <dd><p>each channel is displayed using the magma color scheme
  63331. </p></dd>
  63332. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  63333. <dd><p>each channel is displayed using the green color scheme
  63334. </p></dd>
  63335. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  63336. <dd><p>each channel is displayed using the viridis color scheme
  63337. </p></dd>
  63338. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  63339. <dd><p>each channel is displayed using the plasma color scheme
  63340. </p></dd>
  63341. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  63342. <dd><p>each channel is displayed using the cividis color scheme
  63343. </p></dd>
  63344. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  63345. <dd><p>each channel is displayed using the terrain color scheme
  63346. </p></dd>
  63347. </dl>
  63348. <p>Default value is &lsquo;<samp class="samp">intensity</samp>&rsquo;.
  63349. </p>
  63350. </dd>
  63351. <dt><samp class="option">scale</samp></dt>
  63352. <dd><p>Specify scale used for calculating intensity color values.
  63353. </p>
  63354. <p>It accepts the following values:
  63355. </p><dl class="table">
  63356. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  63357. <dd><p>linear
  63358. </p></dd>
  63359. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  63360. <dd><p>square root, default
  63361. </p></dd>
  63362. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  63363. <dd><p>cubic root
  63364. </p></dd>
  63365. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  63366. <dd><p>logarithmic
  63367. </p></dd>
  63368. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  63369. <dd><p>4th root
  63370. </p></dd>
  63371. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  63372. <dd><p>5th root
  63373. </p></dd>
  63374. </dl>
  63375. <p>Default value is &lsquo;<samp class="samp">log</samp>&rsquo;.
  63376. </p>
  63377. </dd>
  63378. <dt><samp class="option">fscale</samp></dt>
  63379. <dd><p>Specify frequency scale.
  63380. </p>
  63381. <p>It accepts the following values:
  63382. </p><dl class="table">
  63383. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  63384. <dd><p>linear
  63385. </p></dd>
  63386. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  63387. <dd><p>logarithmic
  63388. </p></dd>
  63389. </dl>
  63390. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  63391. </p>
  63392. </dd>
  63393. <dt><samp class="option">saturation</samp></dt>
  63394. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  63395. alternative color scheme. <code class="code">0</code> is no saturation at all.
  63396. Saturation must be in [-10.0, 10.0] range.
  63397. Default value is <code class="code">1</code>.
  63398. </p>
  63399. </dd>
  63400. <dt><samp class="option">win_func</samp></dt>
  63401. <dd><p>Set window function.
  63402. </p>
  63403. <p>It accepts the following values:
  63404. </p><dl class="table">
  63405. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  63406. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  63407. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  63408. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  63409. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  63410. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  63411. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  63412. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  63413. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  63414. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  63415. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  63416. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  63417. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  63418. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  63419. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  63420. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  63421. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  63422. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  63423. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  63424. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  63425. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  63426. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  63427. </dl>
  63428. <p>Default value is <code class="code">hann</code>.
  63429. </p>
  63430. </dd>
  63431. <dt><samp class="option">orientation</samp></dt>
  63432. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  63433. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  63434. </p>
  63435. </dd>
  63436. <dt><samp class="option">gain</samp></dt>
  63437. <dd><p>Set scale gain for calculating intensity color values.
  63438. Default value is <code class="code">1</code>.
  63439. </p>
  63440. </dd>
  63441. <dt><samp class="option">legend</samp></dt>
  63442. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  63443. </p>
  63444. </dd>
  63445. <dt><samp class="option">rotation</samp></dt>
  63446. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  63447. Default value is <code class="code">0</code>.
  63448. </p>
  63449. </dd>
  63450. <dt><samp class="option">start</samp></dt>
  63451. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  63452. </p>
  63453. </dd>
  63454. <dt><samp class="option">stop</samp></dt>
  63455. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  63456. </p>
  63457. </dd>
  63458. <dt><samp class="option">drange</samp></dt>
  63459. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  63460. Allowed range is from 10 to 200.
  63461. </p>
  63462. </dd>
  63463. <dt><samp class="option">limit</samp></dt>
  63464. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  63465. Allowed range is from -100 to 100.
  63466. </p>
  63467. </dd>
  63468. <dt><samp class="option">opacity</samp></dt>
  63469. <dd><p>Set opacity strength when using pixel format output with alpha component.
  63470. </p></dd>
  63471. </dl>
  63472. <ul class="mini-toc">
  63473. <li><a href="#Examples-213" accesskey="1">Examples</a></li>
  63474. </ul>
  63475. <div class="subsection-level-extent" id="Examples-213">
  63476. <h4 class="subsection"><span>46.27.1 Examples<a class="copiable-link" href="#Examples-213"> &para;</a></span></h4>
  63477. <ul class="itemize mark-bullet">
  63478. <li>Extract an audio spectrogram of a whole audio track
  63479. in a 1024x1024 picture using <code class="command">ffmpeg</code>:
  63480. <div class="example">
  63481. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  63482. </pre></div>
  63483. </li></ul>
  63484. </div>
  63485. </div>
  63486. <div class="section-level-extent" id="showvolume">
  63487. <h3 class="section"><span>46.28 showvolume<a class="copiable-link" href="#showvolume"> &para;</a></span></h3>
  63488. <p>Convert input audio volume to a video output.
  63489. </p>
  63490. <p>The filter accepts the following options:
  63491. </p>
  63492. <dl class="table">
  63493. <dt><samp class="option">rate, r</samp></dt>
  63494. <dd><p>Set video rate.
  63495. </p>
  63496. </dd>
  63497. <dt><samp class="option">b</samp></dt>
  63498. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  63499. </p>
  63500. </dd>
  63501. <dt><samp class="option">w</samp></dt>
  63502. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  63503. </p>
  63504. </dd>
  63505. <dt><samp class="option">h</samp></dt>
  63506. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  63507. </p>
  63508. </dd>
  63509. <dt><samp class="option">f</samp></dt>
  63510. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  63511. </p>
  63512. </dd>
  63513. <dt><samp class="option">c</samp></dt>
  63514. <dd><p>Set volume color expression.
  63515. </p>
  63516. <p>The expression can use the following variables:
  63517. </p>
  63518. <dl class="table">
  63519. <dt><samp class="option">VOLUME</samp></dt>
  63520. <dd><p>Current max volume of channel in dB.
  63521. </p>
  63522. </dd>
  63523. <dt><samp class="option">PEAK</samp></dt>
  63524. <dd><p>Current peak.
  63525. </p>
  63526. </dd>
  63527. <dt><samp class="option">CHANNEL</samp></dt>
  63528. <dd><p>Current channel number, starting from 0.
  63529. </p></dd>
  63530. </dl>
  63531. </dd>
  63532. <dt><samp class="option">t</samp></dt>
  63533. <dd><p>If set, displays channel names. Default is enabled.
  63534. </p>
  63535. </dd>
  63536. <dt><samp class="option">v</samp></dt>
  63537. <dd><p>If set, displays volume values. Default is enabled.
  63538. </p>
  63539. </dd>
  63540. <dt><samp class="option">o</samp></dt>
  63541. <dd><p>Set orientation, can be horizontal: <code class="code">h</code> or vertical: <code class="code">v</code>,
  63542. default is <code class="code">h</code>.
  63543. </p>
  63544. </dd>
  63545. <dt><samp class="option">s</samp></dt>
  63546. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  63547. step is disabled.
  63548. </p>
  63549. </dd>
  63550. <dt><samp class="option">p</samp></dt>
  63551. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  63552. </p>
  63553. </dd>
  63554. <dt><samp class="option">m</samp></dt>
  63555. <dd><p>Set metering mode, can be peak: <code class="code">p</code> or rms: <code class="code">r</code>,
  63556. default is <code class="code">p</code>.
  63557. </p>
  63558. </dd>
  63559. <dt><samp class="option">ds</samp></dt>
  63560. <dd><p>Set display scale, can be linear: <code class="code">lin</code> or log: <code class="code">log</code>,
  63561. default is <code class="code">lin</code>.
  63562. </p>
  63563. </dd>
  63564. <dt><samp class="option">dm</samp></dt>
  63565. <dd><p>In second.
  63566. If set to &gt; 0., display a line for the max level
  63567. in the previous seconds.
  63568. default is disabled: <code class="code">0.</code>
  63569. </p>
  63570. </dd>
  63571. <dt><samp class="option">dmc</samp></dt>
  63572. <dd><p>The color of the max line. Use when <code class="code">dm</code> option is set to &gt; 0.
  63573. default is: <code class="code">orange</code>
  63574. </p></dd>
  63575. </dl>
  63576. </div>
  63577. <div class="section-level-extent" id="showwaves">
  63578. <h3 class="section"><span>46.29 showwaves<a class="copiable-link" href="#showwaves"> &para;</a></span></h3>
  63579. <p>Convert input audio to a video output, representing the samples waves.
  63580. </p>
  63581. <p>The filter accepts the following options:
  63582. </p>
  63583. <dl class="table">
  63584. <dt><samp class="option">size, s</samp></dt>
  63585. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  63586. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  63587. Default value is <code class="code">600x240</code>.
  63588. </p>
  63589. </dd>
  63590. <dt><samp class="option">mode</samp></dt>
  63591. <dd><p>Set display mode.
  63592. </p>
  63593. <p>Available values are:
  63594. </p><dl class="table">
  63595. <dt>&lsquo;<samp class="samp">point</samp>&rsquo;</dt>
  63596. <dd><p>Draw a point for each sample.
  63597. </p>
  63598. </dd>
  63599. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  63600. <dd><p>Draw a vertical line for each sample.
  63601. </p>
  63602. </dd>
  63603. <dt>&lsquo;<samp class="samp">p2p</samp>&rsquo;</dt>
  63604. <dd><p>Draw a point for each sample and a line between them.
  63605. </p>
  63606. </dd>
  63607. <dt>&lsquo;<samp class="samp">cline</samp>&rsquo;</dt>
  63608. <dd><p>Draw a centered vertical line for each sample.
  63609. </p></dd>
  63610. </dl>
  63611. <p>Default value is <code class="code">point</code>.
  63612. </p>
  63613. </dd>
  63614. <dt><samp class="option">n</samp></dt>
  63615. <dd><p>Set the number of samples which are printed on the same column. A
  63616. larger value will decrease the frame rate. Must be a positive
  63617. integer. This option can be set only if the value for <var class="var">rate</var>
  63618. is not explicitly specified.
  63619. </p>
  63620. </dd>
  63621. <dt><samp class="option">rate, r</samp></dt>
  63622. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  63623. option <var class="var">n</var>. Default value is &quot;25&quot;.
  63624. </p>
  63625. </dd>
  63626. <dt><samp class="option">split_channels</samp></dt>
  63627. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  63628. </p>
  63629. </dd>
  63630. <dt><samp class="option">colors</samp></dt>
  63631. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  63632. </p>
  63633. </dd>
  63634. <dt><samp class="option">scale</samp></dt>
  63635. <dd><p>Set amplitude scale.
  63636. </p>
  63637. <p>Available values are:
  63638. </p><dl class="table">
  63639. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  63640. <dd><p>Linear.
  63641. </p>
  63642. </dd>
  63643. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  63644. <dd><p>Logarithmic.
  63645. </p>
  63646. </dd>
  63647. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  63648. <dd><p>Square root.
  63649. </p>
  63650. </dd>
  63651. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  63652. <dd><p>Cubic root.
  63653. </p></dd>
  63654. </dl>
  63655. <p>Default is linear.
  63656. </p>
  63657. </dd>
  63658. <dt><samp class="option">draw</samp></dt>
  63659. <dd><p>Set the draw mode. This is mostly useful to set for high <var class="var">n</var>.
  63660. </p>
  63661. <p>Available values are:
  63662. </p><dl class="table">
  63663. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  63664. <dd><p>Scale pixel values for each drawn sample.
  63665. </p>
  63666. </dd>
  63667. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  63668. <dd><p>Draw every sample directly.
  63669. </p></dd>
  63670. </dl>
  63671. <p>Default value is <code class="code">scale</code>.
  63672. </p></dd>
  63673. </dl>
  63674. <ul class="mini-toc">
  63675. <li><a href="#Examples-214" accesskey="1">Examples</a></li>
  63676. </ul>
  63677. <div class="subsection-level-extent" id="Examples-214">
  63678. <h4 class="subsection"><span>46.29.1 Examples<a class="copiable-link" href="#Examples-214"> &para;</a></span></h4>
  63679. <ul class="itemize mark-bullet">
  63680. <li>Output the input file audio and the corresponding video representation
  63681. at the same time:
  63682. <div class="example">
  63683. <pre class="example-preformatted">amovie=a.mp3,asplit[out0],showwaves[out1]
  63684. </pre></div>
  63685. </li><li>Create a synthetic signal and show it with showwaves, forcing a
  63686. frame rate of 30 frames per second:
  63687. <div class="example">
  63688. <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]
  63689. </pre></div>
  63690. </li></ul>
  63691. </div>
  63692. </div>
  63693. <div class="section-level-extent" id="showwavespic">
  63694. <h3 class="section"><span>46.30 showwavespic<a class="copiable-link" href="#showwavespic"> &para;</a></span></h3>
  63695. <p>Convert input audio to a single video frame, representing the samples waves.
  63696. </p>
  63697. <p>The filter accepts the following options:
  63698. </p>
  63699. <dl class="table">
  63700. <dt><samp class="option">size, s</samp></dt>
  63701. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  63702. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  63703. Default value is <code class="code">600x240</code>.
  63704. </p>
  63705. </dd>
  63706. <dt><samp class="option">split_channels</samp></dt>
  63707. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  63708. </p>
  63709. </dd>
  63710. <dt><samp class="option">colors</samp></dt>
  63711. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  63712. </p>
  63713. </dd>
  63714. <dt><samp class="option">scale</samp></dt>
  63715. <dd><p>Set amplitude scale.
  63716. </p>
  63717. <p>Available values are:
  63718. </p><dl class="table">
  63719. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  63720. <dd><p>Linear.
  63721. </p>
  63722. </dd>
  63723. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  63724. <dd><p>Logarithmic.
  63725. </p>
  63726. </dd>
  63727. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  63728. <dd><p>Square root.
  63729. </p>
  63730. </dd>
  63731. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  63732. <dd><p>Cubic root.
  63733. </p></dd>
  63734. </dl>
  63735. <p>Default is linear.
  63736. </p>
  63737. </dd>
  63738. <dt><samp class="option">draw</samp></dt>
  63739. <dd><p>Set the draw mode.
  63740. </p>
  63741. <p>Available values are:
  63742. </p><dl class="table">
  63743. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  63744. <dd><p>Scale pixel values for each drawn sample.
  63745. </p>
  63746. </dd>
  63747. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  63748. <dd><p>Draw every sample directly.
  63749. </p></dd>
  63750. </dl>
  63751. <p>Default value is <code class="code">scale</code>.
  63752. </p>
  63753. </dd>
  63754. <dt><samp class="option">filter</samp></dt>
  63755. <dd><p>Set the filter mode.
  63756. </p>
  63757. <p>Available values are:
  63758. </p><dl class="table">
  63759. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  63760. <dd><p>Use average samples values for each drawn sample.
  63761. </p>
  63762. </dd>
  63763. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  63764. <dd><p>Use peak samples values for each drawn sample.
  63765. </p></dd>
  63766. </dl>
  63767. <p>Default value is <code class="code">average</code>.
  63768. </p></dd>
  63769. </dl>
  63770. <ul class="mini-toc">
  63771. <li><a href="#Examples-215" accesskey="1">Examples</a></li>
  63772. </ul>
  63773. <div class="subsection-level-extent" id="Examples-215">
  63774. <h4 class="subsection"><span>46.30.1 Examples<a class="copiable-link" href="#Examples-215"> &para;</a></span></h4>
  63775. <ul class="itemize mark-bullet">
  63776. <li>Extract a channel split representation of the wave form of a whole audio track
  63777. in a 1024x800 picture using <code class="command">ffmpeg</code>:
  63778. <div class="example">
  63779. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  63780. </pre></div>
  63781. </li></ul>
  63782. </div>
  63783. </div>
  63784. <div class="section-level-extent" id="sidedata_002c-asidedata">
  63785. <h3 class="section"><span>46.31 sidedata, asidedata<a class="copiable-link" href="#sidedata_002c-asidedata"> &para;</a></span></h3>
  63786. <p>Delete frame side data, or select frames based on it.
  63787. </p>
  63788. <p>This filter accepts the following options:
  63789. </p>
  63790. <dl class="table">
  63791. <dt><samp class="option">mode</samp></dt>
  63792. <dd><p>Set mode of operation of the filter.
  63793. </p>
  63794. <p>Can be one of the following:
  63795. </p>
  63796. <dl class="table">
  63797. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  63798. <dd><p>Select every frame with side data of <code class="code">type</code>.
  63799. </p>
  63800. </dd>
  63801. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  63802. <dd><p>Delete side data of <code class="code">type</code>. If <code class="code">type</code> is not set, delete all side
  63803. data in the frame.
  63804. </p>
  63805. </dd>
  63806. </dl>
  63807. </dd>
  63808. <dt><samp class="option">type</samp></dt>
  63809. <dd><p>Set side data type used with all modes. Must be set for <code class="code">select</code> mode. For
  63810. the list of frame side data types, refer to the <code class="code">AVFrameSideDataType</code> enum
  63811. in <samp class="file">libavutil/frame.h</samp>. For example, to choose
  63812. <code class="code">AV_FRAME_DATA_PANSCAN</code> side data, you must specify <code class="code">PANSCAN</code>.
  63813. </p>
  63814. </dd>
  63815. </dl>
  63816. </div>
  63817. <div class="section-level-extent" id="spectrumsynth">
  63818. <h3 class="section"><span>46.32 spectrumsynth<a class="copiable-link" href="#spectrumsynth"> &para;</a></span></h3>
  63819. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  63820. magnitude across time and second represents phase across time.
  63821. The filter will transform from frequency domain as displayed in videos back
  63822. to time domain as presented in audio output.
  63823. </p>
  63824. <p>This filter is primarily created for reversing processed <a class="ref" href="#showspectrum">showspectrum</a>
  63825. filter outputs, but can synthesize sound from other spectrograms too.
  63826. But in such case results are going to be poor if the phase data is not
  63827. available, because in such cases phase data need to be recreated, usually
  63828. it&rsquo;s just recreated from random noise.
  63829. For best results use gray only output (<code class="code">channel</code> color mode in
  63830. <a class="ref" href="#showspectrum">showspectrum</a> filter) and <code class="code">log</code> scale for magnitude video and
  63831. <code class="code">lin</code> scale for phase video. To produce phase, for 2nd video, use
  63832. <code class="code">data</code> option. Inputs videos should generally use <code class="code">fullframe</code>
  63833. slide mode as that saves resources needed for decoding video.
  63834. </p>
  63835. <p>The filter accepts the following options:
  63836. </p>
  63837. <dl class="table">
  63838. <dt><samp class="option">sample_rate</samp></dt>
  63839. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  63840. spectrum was generated may differ.
  63841. </p>
  63842. </dd>
  63843. <dt><samp class="option">channels</samp></dt>
  63844. <dd><p>Set number of channels represented in input video spectrums.
  63845. </p>
  63846. </dd>
  63847. <dt><samp class="option">scale</samp></dt>
  63848. <dd><p>Set scale which was used when generating magnitude input spectrum.
  63849. Can be <code class="code">lin</code> or <code class="code">log</code>. Default is <code class="code">log</code>.
  63850. </p>
  63851. </dd>
  63852. <dt><samp class="option">slide</samp></dt>
  63853. <dd><p>Set slide which was used when generating inputs spectrums.
  63854. Can be <code class="code">replace</code>, <code class="code">scroll</code>, <code class="code">fullframe</code> or <code class="code">rscroll</code>.
  63855. Default is <code class="code">fullframe</code>.
  63856. </p>
  63857. </dd>
  63858. <dt><samp class="option">win_func</samp></dt>
  63859. <dd><p>Set window function used for resynthesis.
  63860. </p>
  63861. </dd>
  63862. <dt><samp class="option">overlap</samp></dt>
  63863. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  63864. which means optimal overlap for selected window function will be picked.
  63865. </p>
  63866. </dd>
  63867. <dt><samp class="option">orientation</samp></dt>
  63868. <dd><p>Set orientation of input videos. Can be <code class="code">vertical</code> or <code class="code">horizontal</code>.
  63869. Default is <code class="code">vertical</code>.
  63870. </p></dd>
  63871. </dl>
  63872. <ul class="mini-toc">
  63873. <li><a href="#Examples-216" accesskey="1">Examples</a></li>
  63874. </ul>
  63875. <div class="subsection-level-extent" id="Examples-216">
  63876. <h4 class="subsection"><span>46.32.1 Examples<a class="copiable-link" href="#Examples-216"> &para;</a></span></h4>
  63877. <ul class="itemize mark-bullet">
  63878. <li>First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  63879. then resynthesize videos back to audio with spectrumsynth:
  63880. <div class="example">
  63881. <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
  63882. 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
  63883. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  63884. </pre></div>
  63885. </li></ul>
  63886. </div>
  63887. </div>
  63888. <div class="section-level-extent" id="split_002c-asplit">
  63889. <h3 class="section"><span>46.33 split, asplit<a class="copiable-link" href="#split_002c-asplit"> &para;</a></span></h3>
  63890. <p>Split input into several identical outputs.
  63891. </p>
  63892. <p><code class="code">asplit</code> works with audio input, <code class="code">split</code> with video.
  63893. </p>
  63894. <p>The filter accepts a single parameter which specifies the number of outputs. If
  63895. unspecified, it defaults to 2.
  63896. </p>
  63897. <ul class="mini-toc">
  63898. <li><a href="#Examples-217" accesskey="1">Examples</a></li>
  63899. </ul>
  63900. <div class="subsection-level-extent" id="Examples-217">
  63901. <h4 class="subsection"><span>46.33.1 Examples<a class="copiable-link" href="#Examples-217"> &para;</a></span></h4>
  63902. <ul class="itemize mark-bullet">
  63903. <li>Create two separate outputs from the same input:
  63904. <div class="example">
  63905. <pre class="example-preformatted">[in] split [out0][out1]
  63906. </pre></div>
  63907. </li><li>To create 3 or more outputs, you need to specify the number of
  63908. outputs, like in:
  63909. <div class="example">
  63910. <pre class="example-preformatted">[in] asplit=3 [out0][out1][out2]
  63911. </pre></div>
  63912. </li><li>Create two separate outputs from the same input, one cropped and
  63913. one padded:
  63914. <div class="example">
  63915. <pre class="example-preformatted">[in] split [splitout1][splitout2];
  63916. [splitout1] crop=100:100:0:0 [cropout];
  63917. [splitout2] pad=200:200:100:100 [padout];
  63918. </pre></div>
  63919. </li><li>Create 5 copies of the input audio with <code class="command">ffmpeg</code>:
  63920. <div class="example">
  63921. <pre class="example-preformatted">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  63922. </pre></div>
  63923. </li></ul>
  63924. </div>
  63925. </div>
  63926. <div class="section-level-extent" id="zmq_002c-azmq">
  63927. <h3 class="section"><span>46.34 zmq, azmq<a class="copiable-link" href="#zmq_002c-azmq"> &para;</a></span></h3>
  63928. <p>Receive commands sent through a libzmq client, and forward them to
  63929. filters in the filtergraph.
  63930. </p>
  63931. <p><code class="code">zmq</code> and <code class="code">azmq</code> work as a pass-through filters. <code class="code">zmq</code>
  63932. must be inserted between two video filters, <code class="code">azmq</code> between two
  63933. audio filters. Both are capable to send messages to any filter type.
  63934. </p>
  63935. <p>To enable these filters you need to install the libzmq library and
  63936. headers and configure FFmpeg with <code class="code">--enable-libzmq</code>.
  63937. </p>
  63938. <p>For more information about libzmq see:
  63939. <a class="url" href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  63940. </p>
  63941. <p>The <code class="code">zmq</code> and <code class="code">azmq</code> filters work as a libzmq server, which
  63942. receives messages sent through a network interface defined by the
  63943. <samp class="option">bind_address</samp> (or the abbreviation &quot;<samp class="option">b</samp>&quot;) option.
  63944. Default value of this option is <samp class="file">tcp://localhost:5555</samp>. You may
  63945. want to alter this value to your needs, but do not forget to escape any
  63946. &rsquo;:&rsquo; signs (see <a class="ref" href="#filtergraph-escaping">filtergraph escaping</a>).
  63947. </p>
  63948. <p>The received message must be in the form:
  63949. </p><div class="example">
  63950. <pre class="example-preformatted"><var class="var">TARGET</var> <var class="var">COMMAND</var> [<var class="var">ARG</var>]
  63951. </pre></div>
  63952. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  63953. the filter class or a specific filter instance name. The default
  63954. filter instance name uses the pattern &lsquo;<samp class="samp">Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  63955. but you can override this by using the &lsquo;<samp class="samp">filter_name@id</samp>&rsquo; syntax
  63956. (see <a class="ref" href="#Filtergraph-syntax">Filtergraph syntax</a>).
  63957. </p>
  63958. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  63959. </p>
  63960. <p><var class="var">ARG</var> is optional and specifies the optional argument list for the
  63961. given <var class="var">COMMAND</var>.
  63962. </p>
  63963. <p>Upon reception, the message is processed and the corresponding command
  63964. is injected into the filtergraph. Depending on the result, the filter
  63965. will send a reply to the client, adopting the format:
  63966. </p><div class="example">
  63967. <pre class="example-preformatted"><var class="var">ERROR_CODE</var> <var class="var">ERROR_REASON</var>
  63968. <var class="var">MESSAGE</var>
  63969. </pre></div>
  63970. <p><var class="var">MESSAGE</var> is optional.
  63971. </p>
  63972. <ul class="mini-toc">
  63973. <li><a href="#Examples-218" accesskey="1">Examples</a></li>
  63974. </ul>
  63975. <div class="subsection-level-extent" id="Examples-218">
  63976. <h4 class="subsection"><span>46.34.1 Examples<a class="copiable-link" href="#Examples-218"> &para;</a></span></h4>
  63977. <p>Look at <samp class="file">tools/zmqsend</samp> for an example of a zmq client which can
  63978. be used to send commands processed by these filters.
  63979. </p>
  63980. <p>Consider the following filtergraph generated by <code class="command">ffplay</code>.
  63981. In this example the last overlay filter has an instance name. All other
  63982. filters will have default instance names.
  63983. </p>
  63984. <div class="example">
  63985. <pre class="example-preformatted">ffplay -dumpgraph 1 -f lavfi &quot;
  63986. color=s=100x100:c=red [l];
  63987. color=s=100x100:c=blue [r];
  63988. nullsrc=s=200x100, zmq [bg];
  63989. [bg][l] overlay [bg+l];
  63990. [bg+l][r] overlay@my=x=100 &quot;
  63991. </pre></div>
  63992. <p>To change the color of the left side of the video, the following
  63993. command can be used:
  63994. </p><div class="example">
  63995. <pre class="example-preformatted">echo Parsed_color_0 c yellow | tools/zmqsend
  63996. </pre></div>
  63997. <p>To change the right side:
  63998. </p><div class="example">
  63999. <pre class="example-preformatted">echo Parsed_color_1 c pink | tools/zmqsend
  64000. </pre></div>
  64001. <p>To change the position of the right side:
  64002. </p><div class="example">
  64003. <pre class="example-preformatted">echo overlay@my x 150 | tools/zmqsend
  64004. </pre></div>
  64005. </div>
  64006. </div>
  64007. </div>
  64008. <div class="chapter-level-extent" id="Multimedia-Sources">
  64009. <h2 class="chapter"><span>47 Multimedia Sources<a class="copiable-link" href="#Multimedia-Sources"> &para;</a></span></h2>
  64010. <p>Below is a description of the currently available multimedia sources.
  64011. </p>
  64012. <ul class="mini-toc">
  64013. <li><a href="#amovie" accesskey="1">amovie</a></li>
  64014. <li><a href="#avsynctest" accesskey="2">avsynctest</a></li>
  64015. <li><a href="#movie-1" accesskey="3">movie</a></li>
  64016. </ul>
  64017. <div class="section-level-extent" id="amovie">
  64018. <h3 class="section"><span>47.1 amovie<a class="copiable-link" href="#amovie"> &para;</a></span></h3>
  64019. <p>This is the same as <a class="ref" href="#movie">movie</a> source, except it selects an audio
  64020. stream by default.
  64021. </p>
  64022. </div>
  64023. <div class="section-level-extent" id="avsynctest">
  64024. <h3 class="section"><span>47.2 avsynctest<a class="copiable-link" href="#avsynctest"> &para;</a></span></h3>
  64025. <p>Generate an Audio/Video Sync Test.
  64026. </p>
  64027. <p>Generated stream periodically shows flash video frame and emits beep in audio.
  64028. Useful to inspect A/V sync issues.
  64029. </p>
  64030. <p>It accepts the following options:
  64031. </p>
  64032. <dl class="table">
  64033. <dt><samp class="option">size, s</samp></dt>
  64034. <dd><p>Set output video size. Default value is <code class="code">hd720</code>.
  64035. </p>
  64036. </dd>
  64037. <dt><samp class="option">framerate, fr</samp></dt>
  64038. <dd><p>Set output video frame rate. Default value is <code class="code">30</code>.
  64039. </p>
  64040. </dd>
  64041. <dt><samp class="option">samplerate, sr</samp></dt>
  64042. <dd><p>Set output audio sample rate. Default value is <code class="code">44100</code>.
  64043. </p>
  64044. </dd>
  64045. <dt><samp class="option">amplitude, a</samp></dt>
  64046. <dd><p>Set output audio beep amplitude. Default value is <code class="code">0.7</code>.
  64047. </p>
  64048. </dd>
  64049. <dt><samp class="option">period, p</samp></dt>
  64050. <dd><p>Set output audio beep period in seconds. Default value is <code class="code">3</code>.
  64051. </p>
  64052. </dd>
  64053. <dt><samp class="option">delay, dl</samp></dt>
  64054. <dd><p>Set output video flash delay in number of frames. Default value is <code class="code">0</code>.
  64055. </p>
  64056. </dd>
  64057. <dt><samp class="option">cycle, c</samp></dt>
  64058. <dd><p>Enable cycling of video delays, by default is disabled.
  64059. </p>
  64060. </dd>
  64061. <dt><samp class="option">duration, d</samp></dt>
  64062. <dd><p>Set stream output duration. By default duration is unlimited.
  64063. </p>
  64064. </dd>
  64065. <dt><samp class="option">fg, bg, ag</samp></dt>
  64066. <dd><p>Set foreground/background/additional color.
  64067. </p></dd>
  64068. </dl>
  64069. <ul class="mini-toc">
  64070. <li><a href="#Commands-165" accesskey="1">Commands</a></li>
  64071. </ul>
  64072. <div class="subsection-level-extent" id="Commands-165">
  64073. <h4 class="subsection"><span>47.2.1 Commands<a class="copiable-link" href="#Commands-165"> &para;</a></span></h4>
  64074. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  64075. </p>
  64076. <a class="anchor" id="movie"></a></div>
  64077. </div>
  64078. <div class="section-level-extent" id="movie-1">
  64079. <h3 class="section"><span>47.3 movie<a class="copiable-link" href="#movie-1"> &para;</a></span></h3>
  64080. <p>Read audio and/or video stream(s) from a movie container.
  64081. </p>
  64082. <p>It accepts the following parameters:
  64083. </p>
  64084. <dl class="table">
  64085. <dt><samp class="option">filename</samp></dt>
  64086. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  64087. device or a stream accessed through some protocol).
  64088. </p>
  64089. </dd>
  64090. <dt><samp class="option">format_name, f</samp></dt>
  64091. <dd><p>Specifies the format assumed for the movie to read, and can be either
  64092. the name of a container or an input device. If not specified, the
  64093. format is guessed from <var class="var">movie_name</var> or by probing.
  64094. </p>
  64095. </dd>
  64096. <dt><samp class="option">seek_point, sp</samp></dt>
  64097. <dd><p>Specifies the seek point in seconds. The frames will be output
  64098. starting from this seek point. The parameter is evaluated with
  64099. <code class="code">av_strtod</code>, so the numerical value may be suffixed by an IS
  64100. postfix. The default value is &quot;0&quot;.
  64101. </p>
  64102. </dd>
  64103. <dt><samp class="option">streams, s</samp></dt>
  64104. <dd><p>Specifies the streams to read. Several streams can be specified,
  64105. separated by &quot;+&quot;. The source will then have as many outputs, in the
  64106. same order. The syntax is explained in the <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">&quot;Stream specifiers&quot;
  64107. section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  64108. respectively the default (best suited) video and audio stream. Default
  64109. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  64110. </p>
  64111. </dd>
  64112. <dt><samp class="option">stream_index, si</samp></dt>
  64113. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  64114. the most suitable video stream will be automatically selected. The default
  64115. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  64116. audio instead of video.
  64117. </p>
  64118. </dd>
  64119. <dt><samp class="option">loop</samp></dt>
  64120. <dd><p>Specifies how many times to read the stream in sequence.
  64121. If the value is 0, the stream will be looped infinitely.
  64122. Default value is &quot;1&quot;.
  64123. </p>
  64124. <p>Note that when the movie is looped the source timestamps are not
  64125. changed, so it will generate non monotonically increasing timestamps.
  64126. </p>
  64127. </dd>
  64128. <dt><samp class="option">discontinuity</samp></dt>
  64129. <dd><p>Specifies the time difference between frames above which the point is
  64130. considered a timestamp discontinuity which is removed by adjusting the later
  64131. timestamps.
  64132. </p>
  64133. </dd>
  64134. <dt><samp class="option">dec_threads</samp></dt>
  64135. <dd><p>Specifies the number of threads for decoding
  64136. </p>
  64137. </dd>
  64138. <dt><samp class="option">format_opts</samp></dt>
  64139. <dd><p>Specify format options for the opened file. Format options can be specified
  64140. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  64141. shows how to add protocol_whitelist and protocol_blacklist options:
  64142. </p><div class="example">
  64143. <pre class="example-preformatted">ffplay -f lavfi
  64144. &quot;movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'&quot;
  64145. </pre></div>
  64146. </dd>
  64147. </dl>
  64148. <p>It allows overlaying a second video on top of the main input of
  64149. a filtergraph, as shown in this graph:
  64150. </p><div class="example">
  64151. <pre class="example-preformatted">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  64152. ^
  64153. |
  64154. movie --&gt; scale--&gt; deltapts1 -------+
  64155. </pre></div>
  64156. <ul class="mini-toc">
  64157. <li><a href="#Examples-219" accesskey="1">Examples</a></li>
  64158. <li><a href="#Commands-166" accesskey="2">Commands</a></li>
  64159. </ul>
  64160. <div class="subsection-level-extent" id="Examples-219">
  64161. <h4 class="subsection"><span>47.3.1 Examples<a class="copiable-link" href="#Examples-219"> &para;</a></span></h4>
  64162. <ul class="itemize mark-bullet">
  64163. <li>Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  64164. on top of the input labelled &quot;in&quot;:
  64165. <div class="example">
  64166. <pre class="example-preformatted">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  64167. [in] setpts=PTS-STARTPTS [main];
  64168. [main][over] overlay=16:16 [out]
  64169. </pre></div>
  64170. </li><li>Read from a video4linux2 device, and overlay it on top of the input
  64171. labelled &quot;in&quot;:
  64172. <div class="example">
  64173. <pre class="example-preformatted">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  64174. [in] setpts=PTS-STARTPTS [main];
  64175. [main][over] overlay=16:16 [out]
  64176. </pre></div>
  64177. </li><li>Read the first video stream and the audio stream with id 0x81 from
  64178. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  64179. connected to the pad named &quot;audio&quot;:
  64180. <div class="example">
  64181. <pre class="example-preformatted">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  64182. </pre></div>
  64183. </li></ul>
  64184. </div>
  64185. <div class="subsection-level-extent" id="Commands-166">
  64186. <h4 class="subsection"><span>47.3.2 Commands<a class="copiable-link" href="#Commands-166"> &para;</a></span></h4>
  64187. <p>Both movie and amovie support the following commands:
  64188. </p><dl class="table">
  64189. <dt><samp class="option">seek</samp></dt>
  64190. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  64191. The syntax is: seek <var class="var">stream_index</var>|<var class="var">timestamp</var>|<var class="var">flags</var>
  64192. </p><ul class="itemize mark-bullet">
  64193. <li><var class="var">stream_index</var>: If stream_index is -1, a default
  64194. stream is selected, and <var class="var">timestamp</var> is automatically converted
  64195. from AV_TIME_BASE units to the stream specific time_base.
  64196. </li><li><var class="var">timestamp</var>: Timestamp in AVStream.time_base units
  64197. or, if no stream is specified, in AV_TIME_BASE units.
  64198. </li><li><var class="var">flags</var>: Flags which select direction and seeking mode.
  64199. </li></ul>
  64200. </dd>
  64201. <dt><samp class="option">get_duration</samp></dt>
  64202. <dd><p>Get movie duration in AV_TIME_BASE units.
  64203. </p>
  64204. </dd>
  64205. </dl>
  64206. </div>
  64207. </div>
  64208. </div>
  64209. <div class="chapter-level-extent" id="External-libraries">
  64210. <h2 class="chapter"><span>48 External libraries<a class="copiable-link" href="#External-libraries"> &para;</a></span></h2>
  64211. <p>FFmpeg can be hooked up with a number of external libraries to add support
  64212. for more formats. None of them are used by default, their use has to be
  64213. explicitly requested by passing the appropriate flags to
  64214. <code class="command">./configure</code>.
  64215. </p>
  64216. <ul class="mini-toc">
  64217. <li><a href="#Alliance-for-Open-Media-_0028AOM_0029" accesskey="1">Alliance for Open Media (AOM)</a></li>
  64218. <li><a href="#AMD-AMF_002fVCE" accesskey="2">AMD AMF/VCE</a></li>
  64219. <li><a href="#AviSynth" accesskey="3">AviSynth</a></li>
  64220. <li><a href="#Chromaprint" accesskey="4">Chromaprint</a></li>
  64221. <li><a href="#codec2-1" accesskey="5">codec2</a></li>
  64222. <li><a href="#dav1d" accesskey="6">dav1d</a></li>
  64223. <li><a href="#davs2" accesskey="7">davs2</a></li>
  64224. <li><a href="#uavs3d" accesskey="8">uavs3d</a></li>
  64225. <li><a href="#Game-Music-Emu" accesskey="9">Game Music Emu</a></li>
  64226. <li><a href="#Intel-QuickSync-Video">Intel QuickSync Video</a></li>
  64227. <li><a href="#Kvazaar">Kvazaar</a></li>
  64228. <li><a href="#LAME">LAME</a></li>
  64229. <li><a href="#libilbc-1">libilbc</a></li>
  64230. <li><a href="#libjxl-1">libjxl</a></li>
  64231. <li><a href="#libvpx-1">libvpx</a></li>
  64232. <li><a href="#ModPlug">ModPlug</a></li>
  64233. <li><a href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">OpenCORE, VisualOn, and Fraunhofer libraries</a></li>
  64234. <li><a href="#OpenH264">OpenH264</a></li>
  64235. <li><a href="#OpenJPEG">OpenJPEG</a></li>
  64236. <li><a href="#rav1e">rav1e</a></li>
  64237. <li><a href="#SVT_002dAV1">SVT-AV1</a></li>
  64238. <li><a href="#TwoLAME">TwoLAME</a></li>
  64239. <li><a href="#VapourSynth">VapourSynth</a></li>
  64240. <li><a href="#x264">x264</a></li>
  64241. <li><a href="#x265">x265</a></li>
  64242. <li><a href="#xavs">xavs</a></li>
  64243. <li><a href="#xavs2">xavs2</a></li>
  64244. <li><a href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029">eXtra-fast Essential Video Encoder (XEVE)</a></li>
  64245. <li><a href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029">eXtra-fast Essential Video Decoder (XEVD)</a></li>
  64246. <li><a href="#ZVBI">ZVBI</a></li>
  64247. </ul>
  64248. <div class="section-level-extent" id="Alliance-for-Open-Media-_0028AOM_0029">
  64249. <h3 class="section"><span>48.1 Alliance for Open Media (AOM)<a class="copiable-link" href="#Alliance-for-Open-Media-_0028AOM_0029"> &para;</a></span></h3>
  64250. <p>FFmpeg can make use of the AOM library for AV1 decoding and encoding.
  64251. </p>
  64252. <p>Go to <a class="url" href="http://aomedia.org/">http://aomedia.org/</a> and follow the instructions for
  64253. installing the library. Then pass <code class="code">--enable-libaom</code> to configure to
  64254. enable it.
  64255. </p>
  64256. </div>
  64257. <div class="section-level-extent" id="AMD-AMF_002fVCE">
  64258. <h3 class="section"><span>48.2 AMD AMF/VCE<a class="copiable-link" href="#AMD-AMF_002fVCE"> &para;</a></span></h3>
  64259. <p>FFmpeg can use the AMD Advanced Media Framework library
  64260. for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE).
  64261. </p>
  64262. <p>To enable support you must obtain the AMF framework header files(version 1.4.9+) from
  64263. <a class="url" href="https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git">https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git</a>.
  64264. </p>
  64265. <p>Create an <code class="code">AMF/</code> directory in the system include path.
  64266. Copy the contents of <code class="code">AMF/amf/public/include/</code> into that directory.
  64267. Then configure FFmpeg with <code class="code">--enable-amf</code>.
  64268. </p>
  64269. <p>Initialization of amf encoder occurs in this order:
  64270. 1) trying to initialize through dx11(only windows)
  64271. 2) trying to initialize through dx9(only windows)
  64272. 3) trying to initialize through vulkan
  64273. </p>
  64274. <p>To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro
  64275. package(amdgru-pro contains, but does not install automatically) are required.
  64276. </p>
  64277. <p>This driver can be installed using amdgpu-pro-install script in official amd driver archive.
  64278. </p>
  64279. </div>
  64280. <div class="section-level-extent" id="AviSynth">
  64281. <h3 class="section"><span>48.3 AviSynth<a class="copiable-link" href="#AviSynth"> &para;</a></span></h3>
  64282. <p>FFmpeg can read AviSynth scripts as input. To enable support, pass
  64283. <code class="code">--enable-avisynth</code> to configure after installing the headers
  64284. provided by <a class="url" href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>.
  64285. AviSynth+ can be configured to install only the headers by either
  64286. passing <code class="code">-DHEADERS_ONLY:bool=on</code> to the normal CMake-based build
  64287. system, or by using the supplied <code class="code">GNUmakefile</code>.
  64288. </p>
  64289. <p>For Windows, supported AviSynth variants are
  64290. <a class="url" href="http://avisynth.nl">AviSynth 2.6 RC1 or higher</a> for 32-bit builds and
  64291. <a class="url" href="http://avisynth.nl/index.php/AviSynth+">AviSynth+ r1718 or higher</a> for 32-bit and 64-bit builds.
  64292. </p>
  64293. <p>For Linux, macOS, and BSD, the only supported AviSynth variant is
  64294. <a class="url" href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>, starting with version 3.5.
  64295. </p>
  64296. <div class="info">
  64297. <p>In 2016, AviSynth+ added support for building with GCC. However, due to
  64298. the eccentricities of Windows&rsquo; calling conventions, 32-bit GCC builds
  64299. of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg.
  64300. </p>
  64301. <p>By default, FFmpeg assumes compatibility with 32-bit MSVC builds of
  64302. AviSynth+ since that is the most widely-used and entrenched build
  64303. configuration. Users can override this and enable support for 32-bit
  64304. GCC builds of AviSynth+ by passing <code class="code">-DAVSC_WIN32_GCC32</code> to
  64305. <code class="code">--extra-cflags</code> when configuring FFmpeg.
  64306. </p>
  64307. <p>64-bit builds of FFmpeg are not affected, and can use either MSVC or
  64308. GCC builds of AviSynth+ without any special flags.
  64309. </p></div>
  64310. <div class="info">
  64311. <p>AviSynth(+) is loaded dynamically. Distributors can build FFmpeg
  64312. with <code class="code">--enable-avisynth</code>, and the binaries will work regardless
  64313. of the end user having AviSynth installed. If/when an end user
  64314. would like to use AviSynth scripts, then they can install AviSynth(+)
  64315. and FFmpeg will be able to find and use it to open scripts.
  64316. </p></div>
  64317. </div>
  64318. <div class="section-level-extent" id="Chromaprint">
  64319. <h3 class="section"><span>48.4 Chromaprint<a class="copiable-link" href="#Chromaprint"> &para;</a></span></h3>
  64320. <p>FFmpeg can make use of the Chromaprint library for generating audio fingerprints.
  64321. Pass <code class="code">--enable-chromaprint</code> to configure to
  64322. enable it. See <a class="url" href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>.
  64323. </p>
  64324. </div>
  64325. <div class="section-level-extent" id="codec2-1">
  64326. <h3 class="section"><span>48.5 codec2<a class="copiable-link" href="#codec2-1"> &para;</a></span></h3>
  64327. <p>FFmpeg can make use of the codec2 library for codec2 decoding and encoding.
  64328. There is currently no native decoder, so libcodec2 must be used for decoding.
  64329. </p>
  64330. <p>Go to <a class="url" href="http://freedv.org/">http://freedv.org/</a>, download &quot;Codec 2 source archive&quot;.
  64331. Build and install using CMake. Debian users can install the libcodec2-dev package instead.
  64332. Once libcodec2 is installed you can pass <code class="code">--enable-libcodec2</code> to configure to enable it.
  64333. </p>
  64334. <p>The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding.
  64335. To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option:
  64336. <code class="code">ffmpeg -i input.wav -mode 700C output.c2</code>.
  64337. Playback is as simple as <code class="code">ffplay output.c2</code>.
  64338. For a list of supported modes, run <code class="code">ffmpeg -h encoder=libcodec2</code>.
  64339. Raw codec2 files are also supported.
  64340. To make sense of them the mode in use needs to be specified as a format option:
  64341. <code class="code">ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav</code>.
  64342. </p>
  64343. </div>
  64344. <div class="section-level-extent" id="dav1d">
  64345. <h3 class="section"><span>48.6 dav1d<a class="copiable-link" href="#dav1d"> &para;</a></span></h3>
  64346. <p>FFmpeg can make use of the dav1d library for AV1 video decoding.
  64347. </p>
  64348. <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
  64349. installing the library. Then pass <code class="code">--enable-libdav1d</code> to configure to enable it.
  64350. </p>
  64351. </div>
  64352. <div class="section-level-extent" id="davs2">
  64353. <h3 class="section"><span>48.7 davs2<a class="copiable-link" href="#davs2"> &para;</a></span></h3>
  64354. <p>FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding.
  64355. </p>
  64356. <p>Go to <a class="url" href="https://github.com/pkuvcl/davs2">https://github.com/pkuvcl/davs2</a> and follow the instructions for
  64357. installing the library. Then pass <code class="code">--enable-libdavs2</code> to configure to
  64358. enable it.
  64359. </p>
  64360. <div class="info">
  64361. <p>libdavs2 is under the GNU Public License Version 2 or later
  64362. (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
  64363. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  64364. </p></div>
  64365. </div>
  64366. <div class="section-level-extent" id="uavs3d">
  64367. <h3 class="section"><span>48.8 uavs3d<a class="copiable-link" href="#uavs3d"> &para;</a></span></h3>
  64368. <p>FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding.
  64369. </p>
  64370. <p>Go to <a class="url" href="https://github.com/uavs3/uavs3d">https://github.com/uavs3/uavs3d</a> and follow the instructions for
  64371. installing the library. Then pass <code class="code">--enable-libuavs3d</code> to configure to
  64372. enable it.
  64373. </p>
  64374. </div>
  64375. <div class="section-level-extent" id="Game-Music-Emu">
  64376. <h3 class="section"><span>48.9 Game Music Emu<a class="copiable-link" href="#Game-Music-Emu"> &para;</a></span></h3>
  64377. <p>FFmpeg can make use of the Game Music Emu library to read audio from supported video game
  64378. music file formats. Pass <code class="code">--enable-libgme</code> to configure to
  64379. enable it. See <a class="url" href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a>.
  64380. </p>
  64381. </div>
  64382. <div class="section-level-extent" id="Intel-QuickSync-Video">
  64383. <h3 class="section"><span>48.10 Intel QuickSync Video<a class="copiable-link" href="#Intel-QuickSync-Video"> &para;</a></span></h3>
  64384. <p>FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding
  64385. of multiple codecs. To use QSV, FFmpeg must be linked against the <code class="code">libmfx</code>
  64386. dispatcher, which loads the actual decoding libraries.
  64387. </p>
  64388. <p>The dispatcher is open source and can be downloaded from
  64389. <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
  64390. with the <code class="code">--enable-libmfx</code> option and <code class="code">pkg-config</code> needs to be able to
  64391. locate the dispatcher&rsquo;s <code class="code">.pc</code> files.
  64392. </p>
  64393. </div>
  64394. <div class="section-level-extent" id="Kvazaar">
  64395. <h3 class="section"><span>48.11 Kvazaar<a class="copiable-link" href="#Kvazaar"> &para;</a></span></h3>
  64396. <p>FFmpeg can make use of the Kvazaar library for HEVC encoding.
  64397. </p>
  64398. <p>Go to <a class="url" href="https://github.com/ultravideo/kvazaar">https://github.com/ultravideo/kvazaar</a> and follow the
  64399. instructions for installing the library. Then pass
  64400. <code class="code">--enable-libkvazaar</code> to configure to enable it.
  64401. </p>
  64402. </div>
  64403. <div class="section-level-extent" id="LAME">
  64404. <h3 class="section"><span>48.12 LAME<a class="copiable-link" href="#LAME"> &para;</a></span></h3>
  64405. <p>FFmpeg can make use of the LAME library for MP3 encoding.
  64406. </p>
  64407. <p>Go to <a class="url" href="http://lame.sourceforge.net/">http://lame.sourceforge.net/</a> and follow the
  64408. instructions for installing the library.
  64409. Then pass <code class="code">--enable-libmp3lame</code> to configure to enable it.
  64410. </p>
  64411. </div>
  64412. <div class="section-level-extent" id="libilbc-1">
  64413. <h3 class="section"><span>48.13 libilbc<a class="copiable-link" href="#libilbc-1"> &para;</a></span></h3>
  64414. <p>iLBC is a narrowband speech codec that has been made freely available
  64415. by Google as part of the WebRTC project. libilbc is a packaging friendly
  64416. copy of the iLBC codec. FFmpeg can make use of the libilbc library for
  64417. iLBC decoding and encoding.
  64418. </p>
  64419. <p>Go to <a class="url" href="https://github.com/TimothyGu/libilbc">https://github.com/TimothyGu/libilbc</a> and follow the instructions for
  64420. installing the library. Then pass <code class="code">--enable-libilbc</code> to configure to
  64421. enable it.
  64422. </p>
  64423. </div>
  64424. <div class="section-level-extent" id="libjxl-1">
  64425. <h3 class="section"><span>48.14 libjxl<a class="copiable-link" href="#libjxl-1"> &para;</a></span></h3>
  64426. <p>JPEG XL is an image format intended to fully replace legacy JPEG for an extended
  64427. period of life. See <a class="url" href="https://jpegxl.info/">https://jpegxl.info/</a> for more information, and see
  64428. <a class="url" href="https://github.com/libjxl/libjxl">https://github.com/libjxl/libjxl</a> for the library source. You can pass
  64429. <code class="code">--enable-libjxl</code> to configure in order enable the libjxl wrapper.
  64430. </p>
  64431. </div>
  64432. <div class="section-level-extent" id="libvpx-1">
  64433. <h3 class="section"><span>48.15 libvpx<a class="copiable-link" href="#libvpx-1"> &para;</a></span></h3>
  64434. <p>FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding.
  64435. </p>
  64436. <p>Go to <a class="url" href="http://www.webmproject.org/">http://www.webmproject.org/</a> and follow the instructions for
  64437. installing the library. Then pass <code class="code">--enable-libvpx</code> to configure to
  64438. enable it.
  64439. </p>
  64440. </div>
  64441. <div class="section-level-extent" id="ModPlug">
  64442. <h3 class="section"><span>48.16 ModPlug<a class="copiable-link" href="#ModPlug"> &para;</a></span></h3>
  64443. <p>FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files.
  64444. 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
  64445. enable it.
  64446. </p>
  64447. </div>
  64448. <div class="section-level-extent" id="OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">
  64449. <h3 class="section"><span>48.17 OpenCORE, VisualOn, and Fraunhofer libraries<a class="copiable-link" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries"> &para;</a></span></h3>
  64450. <p>Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer
  64451. libraries provide encoders for a number of audio codecs.
  64452. </p>
  64453. <div class="info">
  64454. <p>OpenCORE and VisualOn libraries are under the Apache License 2.0
  64455. (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
  64456. incompatible to the LGPL version 2.1 and GPL version 2. You have to
  64457. upgrade FFmpeg&rsquo;s license to LGPL version 3 (or if you have enabled
  64458. GPL components, GPL version 3) by passing <code class="code">--enable-version3</code> to configure in
  64459. order to use it.
  64460. </p>
  64461. <p>The license of the Fraunhofer AAC library is incompatible with the GPL.
  64462. Therefore, for GPL builds, you have to pass <code class="code">--enable-nonfree</code> to
  64463. configure in order to use it. To the best of our knowledge, it is
  64464. compatible with the LGPL.
  64465. </p></div>
  64466. <ul class="mini-toc">
  64467. <li><a href="#OpenCORE-AMR" accesskey="1">OpenCORE AMR</a></li>
  64468. <li><a href="#VisualOn-AMR_002dWB-encoder-library" accesskey="2">VisualOn AMR-WB encoder library</a></li>
  64469. <li><a href="#Fraunhofer-AAC-library" accesskey="3">Fraunhofer AAC library</a></li>
  64470. </ul>
  64471. <div class="subsection-level-extent" id="OpenCORE-AMR">
  64472. <h4 class="subsection"><span>48.17.1 OpenCORE AMR<a class="copiable-link" href="#OpenCORE-AMR"> &para;</a></span></h4>
  64473. <p>FFmpeg can make use of the OpenCORE libraries for AMR-NB
  64474. decoding/encoding and AMR-WB decoding.
  64475. </p>
  64476. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  64477. instructions for installing the libraries.
  64478. Then pass <code class="code">--enable-libopencore-amrnb</code> and/or
  64479. <code class="code">--enable-libopencore-amrwb</code> to configure to enable them.
  64480. </p>
  64481. </div>
  64482. <div class="subsection-level-extent" id="VisualOn-AMR_002dWB-encoder-library">
  64483. <h4 class="subsection"><span>48.17.2 VisualOn AMR-WB encoder library<a class="copiable-link" href="#VisualOn-AMR_002dWB-encoder-library"> &para;</a></span></h4>
  64484. <p>FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
  64485. </p>
  64486. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  64487. instructions for installing the library.
  64488. Then pass <code class="code">--enable-libvo-amrwbenc</code> to configure to enable it.
  64489. </p>
  64490. </div>
  64491. <div class="subsection-level-extent" id="Fraunhofer-AAC-library">
  64492. <h4 class="subsection"><span>48.17.3 Fraunhofer AAC library<a class="copiable-link" href="#Fraunhofer-AAC-library"> &para;</a></span></h4>
  64493. <p>FFmpeg can make use of the Fraunhofer AAC library for AAC decoding &amp; encoding.
  64494. </p>
  64495. <p>Go to <a class="url" href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  64496. instructions for installing the library.
  64497. Then pass <code class="code">--enable-libfdk-aac</code> to configure to enable it.
  64498. </p>
  64499. </div>
  64500. </div>
  64501. <div class="section-level-extent" id="OpenH264">
  64502. <h3 class="section"><span>48.18 OpenH264<a class="copiable-link" href="#OpenH264"> &para;</a></span></h3>
  64503. <p>FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding.
  64504. </p>
  64505. <p>Go to <a class="url" href="http://www.openh264.org/">http://www.openh264.org/</a> and follow the instructions for
  64506. installing the library. Then pass <code class="code">--enable-libopenh264</code> to configure to
  64507. enable it.
  64508. </p>
  64509. <p>For decoding, this library is much more limited than the built-in decoder
  64510. in libavcodec; currently, this library lacks support for decoding B-frames
  64511. and some other main/high profile features. (It currently only supports
  64512. constrained baseline profile and CABAC.) Using it is mostly useful for
  64513. testing and for taking advantage of Cisco&rsquo;s patent portfolio license
  64514. (<a class="url" href="http://www.openh264.org/BINARY_LICENSE.txt">http://www.openh264.org/BINARY_LICENSE.txt</a>).
  64515. </p>
  64516. </div>
  64517. <div class="section-level-extent" id="OpenJPEG">
  64518. <h3 class="section"><span>48.19 OpenJPEG<a class="copiable-link" href="#OpenJPEG"> &para;</a></span></h3>
  64519. <p>FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to
  64520. <a class="url" href="http://www.openjpeg.org/">http://www.openjpeg.org/</a> to get the libraries and follow the installation
  64521. instructions. To enable using OpenJPEG in FFmpeg, pass <code class="code">--enable-libopenjpeg</code> to
  64522. <samp class="file">./configure</samp>.
  64523. </p>
  64524. </div>
  64525. <div class="section-level-extent" id="rav1e">
  64526. <h3 class="section"><span>48.20 rav1e<a class="copiable-link" href="#rav1e"> &para;</a></span></h3>
  64527. <p>FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos.
  64528. Go to <a class="url" href="https://github.com/xiph/rav1e/">https://github.com/xiph/rav1e/</a> and follow the instructions to build
  64529. the C library. To enable using rav1e in FFmpeg, pass <code class="code">--enable-librav1e</code>
  64530. to <samp class="file">./configure</samp>.
  64531. </p>
  64532. </div>
  64533. <div class="section-level-extent" id="SVT_002dAV1">
  64534. <h3 class="section"><span>48.21 SVT-AV1<a class="copiable-link" href="#SVT_002dAV1"> &para;</a></span></h3>
  64535. <p>FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding.
  64536. </p>
  64537. <p>Go to <a class="url" href="https://gitlab.com/AOMediaCodec/SVT-AV1/">https://gitlab.com/AOMediaCodec/SVT-AV1/</a> and follow the instructions
  64538. for installing the library. Then pass <code class="code">--enable-libsvtav1</code> to configure to
  64539. enable it.
  64540. </p>
  64541. </div>
  64542. <div class="section-level-extent" id="TwoLAME">
  64543. <h3 class="section"><span>48.22 TwoLAME<a class="copiable-link" href="#TwoLAME"> &para;</a></span></h3>
  64544. <p>FFmpeg can make use of the TwoLAME library for MP2 encoding.
  64545. </p>
  64546. <p>Go to <a class="url" href="http://www.twolame.org/">http://www.twolame.org/</a> and follow the
  64547. instructions for installing the library.
  64548. Then pass <code class="code">--enable-libtwolame</code> to configure to enable it.
  64549. </p>
  64550. </div>
  64551. <div class="section-level-extent" id="VapourSynth">
  64552. <h3 class="section"><span>48.23 VapourSynth<a class="copiable-link" href="#VapourSynth"> &para;</a></span></h3>
  64553. <p>FFmpeg can read VapourSynth scripts as input. To enable support, pass
  64554. <code class="code">--enable-vapoursynth</code> to configure. Vapoursynth is detected via
  64555. <code class="code">pkg-config</code>. Versions 42 or greater supported.
  64556. See <a class="url" href="http://www.vapoursynth.com/">http://www.vapoursynth.com/</a>.
  64557. </p>
  64558. <p>Due to security concerns, Vapoursynth scripts will not
  64559. be autodetected so the input format has to be forced. For ff* CLI tools,
  64560. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  64561. </p>
  64562. </div>
  64563. <div class="section-level-extent" id="x264">
  64564. <h3 class="section"><span>48.24 x264<a class="copiable-link" href="#x264"> &para;</a></span></h3>
  64565. <p>FFmpeg can make use of the x264 library for H.264 encoding.
  64566. </p>
  64567. <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
  64568. instructions for installing the library. Then pass <code class="code">--enable-libx264</code> to
  64569. configure to enable it.
  64570. </p>
  64571. <div class="info">
  64572. <p>x264 is under the GNU Public License Version 2 or later
  64573. (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
  64574. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  64575. </p></div>
  64576. </div>
  64577. <div class="section-level-extent" id="x265">
  64578. <h3 class="section"><span>48.25 x265<a class="copiable-link" href="#x265"> &para;</a></span></h3>
  64579. <p>FFmpeg can make use of the x265 library for HEVC encoding.
  64580. </p>
  64581. <p>Go to <a class="url" href="http://x265.org/developers.html">http://x265.org/developers.html</a> and follow the instructions
  64582. for installing the library. Then pass <code class="code">--enable-libx265</code> to configure
  64583. to enable it.
  64584. </p>
  64585. <div class="info">
  64586. <p>x265 is under the GNU Public License Version 2 or later
  64587. (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
  64588. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  64589. </p></div>
  64590. </div>
  64591. <div class="section-level-extent" id="xavs">
  64592. <h3 class="section"><span>48.26 xavs<a class="copiable-link" href="#xavs"> &para;</a></span></h3>
  64593. <p>FFmpeg can make use of the xavs library for AVS encoding.
  64594. </p>
  64595. <p>Go to <a class="url" href="http://xavs.sf.net/">http://xavs.sf.net/</a> and follow the instructions for
  64596. installing the library. Then pass <code class="code">--enable-libxavs</code> to configure to
  64597. enable it.
  64598. </p>
  64599. </div>
  64600. <div class="section-level-extent" id="xavs2">
  64601. <h3 class="section"><span>48.27 xavs2<a class="copiable-link" href="#xavs2"> &para;</a></span></h3>
  64602. <p>FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding.
  64603. </p>
  64604. <p>Go to <a class="url" href="https://github.com/pkuvcl/xavs2">https://github.com/pkuvcl/xavs2</a> and follow the instructions for
  64605. installing the library. Then pass <code class="code">--enable-libxavs2</code> to configure to
  64606. enable it.
  64607. </p>
  64608. <div class="info">
  64609. <p>libxavs2 is under the GNU Public License Version 2 or later
  64610. (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
  64611. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  64612. </p></div>
  64613. </div>
  64614. <div class="section-level-extent" id="eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029">
  64615. <h3 class="section"><span>48.28 eXtra-fast Essential Video Encoder (XEVE)<a class="copiable-link" href="#eXtra_002dfast-Essential-Video-Encoder-_0028XEVE_0029"> &para;</a></span></h3>
  64616. <p>FFmpeg can make use of the XEVE library for EVC video encoding.
  64617. </p>
  64618. <p>Go to <a class="url" href="https://github.com/mpeg5/xeve">https://github.com/mpeg5/xeve</a> and follow the instructions for
  64619. installing the XEVE library. Then pass <code class="code">--enable-libxeve</code> to configure to
  64620. enable it.
  64621. </p>
  64622. </div>
  64623. <div class="section-level-extent" id="eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029">
  64624. <h3 class="section"><span>48.29 eXtra-fast Essential Video Decoder (XEVD)<a class="copiable-link" href="#eXtra_002dfast-Essential-Video-Decoder-_0028XEVD_0029"> &para;</a></span></h3>
  64625. <p>FFmpeg can make use of the XEVD library for EVC video decoding.
  64626. </p>
  64627. <p>Go to <a class="url" href="https://github.com/mpeg5/xevd">https://github.com/mpeg5/xevd</a> and follow the instructions for
  64628. installing the XEVD library. Then pass <code class="code">--enable-libxevd</code> to configure to
  64629. enable it.
  64630. </p>
  64631. </div>
  64632. <div class="section-level-extent" id="ZVBI">
  64633. <h3 class="section"><span>48.30 ZVBI<a class="copiable-link" href="#ZVBI"> &para;</a></span></h3>
  64634. <p>ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB
  64635. teletext pages and DVB teletext subtitles.
  64636. </p>
  64637. <p>Go to <a class="url" href="http://sourceforge.net/projects/zapping/">http://sourceforge.net/projects/zapping/</a> and follow the instructions for
  64638. installing the library. Then pass <code class="code">--enable-libzvbi</code> to configure to
  64639. enable it.
  64640. </p>
  64641. </div>
  64642. </div>
  64643. <div class="chapter-level-extent" id="Supported-File-Formats_002c-Codecs-or-Features">
  64644. <h2 class="chapter"><span>49 Supported File Formats, Codecs or Features<a class="copiable-link" href="#Supported-File-Formats_002c-Codecs-or-Features"> &para;</a></span></h2>
  64645. <p>You can use the <code class="code">-formats</code> and <code class="code">-codecs</code> options to have an exhaustive list.
  64646. </p>
  64647. <ul class="mini-toc">
  64648. <li><a href="#File-Formats" accesskey="1">File Formats</a></li>
  64649. <li><a href="#Image-Formats" accesskey="2">Image Formats</a></li>
  64650. <li><a href="#Video-Codecs" accesskey="3">Video Codecs</a></li>
  64651. <li><a href="#Audio-Codecs" accesskey="4">Audio Codecs</a></li>
  64652. <li><a href="#Subtitle-Formats" accesskey="5">Subtitle Formats</a></li>
  64653. <li><a href="#Network-Protocols" accesskey="6">Network Protocols</a></li>
  64654. <li><a href="#Input_002fOutput-Devices" accesskey="7">Input/Output Devices</a></li>
  64655. <li><a href="#Timecode" accesskey="8">Timecode</a></li>
  64656. </ul>
  64657. <div class="section-level-extent" id="File-Formats">
  64658. <h3 class="section"><span>49.1 File Formats<a class="copiable-link" href="#File-Formats"> &para;</a></span></h3>
  64659. <p>FFmpeg supports the following file formats through the <code class="code">libavformat</code>
  64660. library:
  64661. </p>
  64662. <table class="multitable">
  64663. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  64664. <tr><td width="40%">3dostr</td><td width="10%"></td><td width="10%">X</td></tr>
  64665. <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>
  64666. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  64667. <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>
  64668. <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>
  64669. <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>
  64670. <tr><td width="40%">Adobe Filmstrip</td><td width="10%">X</td><td width="10%">X</td></tr>
  64671. <tr><td width="40%">Audio IFF (AIFF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64672. <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>
  64673. <tr><td width="40%">3GPP AMR</td><td width="10%">X</td><td width="10%">X</td></tr>
  64674. <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>
  64675. <tr><td width="40%">Apple HTTP Live Streaming</td><td width="10%"></td><td width="10%">X</td></tr>
  64676. <tr><td width="40%">Artworx Data Format</td><td width="10%"></td><td width="10%">X</td></tr>
  64677. <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>
  64678. <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>
  64679. <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>
  64680. <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>
  64681. <tr><td width="40%">APNG</td><td width="10%">X</td><td width="10%">X</td></tr>
  64682. <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>
  64683. <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>
  64684. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  64685. <tr><td width="40%">AviSynth</td><td width="10%"></td><td width="10%">X</td></tr>
  64686. <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>
  64687. <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>
  64688. <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>
  64689. <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>
  64690. <tr><td width="40%">Binary text</td><td width="10%"></td><td width="10%">X</td></tr>
  64691. <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>
  64692. <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>
  64693. <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>
  64694. <tr><td width="40%">BRP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Argonaut Games format.</td></tr>
  64695. <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>
  64696. <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>
  64697. <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>
  64698. <tr><td width="40%">BW64</td><td width="10%"></td><td width="10%">X</td><td width="40%">Broadcast Wave 64bit.</td></tr>
  64699. <tr><td width="40%">BWF</td><td width="10%">X</td><td width="10%">X</td></tr>
  64700. <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>
  64701. <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>
  64702. <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>
  64703. <tr><td width="40%">CRI AIX</td><td width="10%"></td><td width="10%">X</td></tr>
  64704. <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>
  64705. <tr><td width="40%">Discworld II BMV</td><td width="10%"></td><td width="10%">X</td></tr>
  64706. <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>
  64707. <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>
  64708. <tr><td width="40%">Digital Speech Standard (DSS)</td><td width="10%"></td><td width="10%">X</td></tr>
  64709. <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>
  64710. <tr><td width="40%">Phantom Cine</td><td width="10%"></td><td width="10%">X</td></tr>
  64711. <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>
  64712. <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>
  64713. <tr><td width="40%">CRC testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  64714. <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>
  64715. <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>
  64716. <tr><td width="40%">D-Cinema audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  64717. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  64718. <tr><td width="40%">DCSTR</td><td width="10%"></td><td width="10%">X</td></tr>
  64719. <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>
  64720. <tr><td width="40%">DirectDraw Surface</td><td width="10%"></td><td width="10%">X</td></tr>
  64721. <tr><td width="40%">DSD Stream File (DSF)</td><td width="10%"></td><td width="10%">X</td></tr>
  64722. <tr><td width="40%">DV video</td><td width="10%">X</td><td width="10%">X</td></tr>
  64723. <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
  64724. game and different game cutscenes repacked for use with ScummVM.</td></tr>
  64725. <tr><td width="40%">Electronic Arts cdata</td><td width="10%"></td><td width="10%">X</td></tr>
  64726. <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>
  64727. <tr><td width="40%">Ensoniq Paris Audio File</td><td width="10%"></td><td width="10%">X</td></tr>
  64728. <tr><td width="40%">FFM (FFserver live feed)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64729. <tr><td width="40%">Flash (SWF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64730. <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>
  64731. <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>
  64732. <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>
  64733. <tr><td width="40%">framecrc testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  64734. <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>
  64735. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  64736. <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>
  64737. <tr><td width="40%">G.729 BIT</td><td width="10%">X</td><td width="10%">X</td></tr>
  64738. <tr><td width="40%">G.729 raw</td><td width="10%"></td><td width="10%">X</td></tr>
  64739. <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>
  64740. <tr><td width="40%">GIF Animation</td><td width="10%">X</td><td width="10%">X</td></tr>
  64741. <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
  64742. playout servers.</td></tr>
  64743. <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>
  64744. <tr><td width="40%">iCEDraw File</td><td width="10%"></td><td width="10%">X</td></tr>
  64745. <tr><td width="40%">ICO</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft Windows ICO</td></tr>
  64746. <tr><td width="40%">id Quake II CIN video</td><td width="10%"></td><td width="10%">X</td></tr>
  64747. <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>
  64748. <tr><td width="40%">IEC61937 encapsulation</td><td width="10%">X</td><td width="10%">X</td></tr>
  64749. <tr><td width="40%">IFF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Interchange File Format</td></tr>
  64750. <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>
  64751. <tr><td width="40%">iLBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  64752. <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>
  64753. <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>
  64754. <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>
  64755. <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>
  64756. <tr><td width="40%">Internet Video Recording</td><td width="10%"></td><td width="10%">X</td></tr>
  64757. <tr><td width="40%">IRCAM</td><td width="10%">X</td><td width="10%">X</td></tr>
  64758. <tr><td width="40%">LAF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Limitless Audio Format</td></tr>
  64759. <tr><td width="40%">LATM</td><td width="10%">X</td><td width="10%">X</td></tr>
  64760. <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>
  64761. <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>
  64762. <tr><td width="40%">LRC</td><td width="10%">X</td><td width="10%">X</td></tr>
  64763. <tr><td width="40%">LVF</td><td width="10%"></td><td width="10%">X</td></tr>
  64764. <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>
  64765. <tr><td width="40%">Magic Lantern Video (MLV)</td><td width="10%"></td><td width="10%">X</td></tr>
  64766. <tr><td width="40%">Matroska</td><td width="10%">X</td><td width="10%">X</td></tr>
  64767. <tr><td width="40%">Matroska audio</td><td width="10%">X</td><td width="10%"></td></tr>
  64768. <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>
  64769. <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>
  64770. <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>
  64771. <tr><td width="40%">MD Studio</td><td width="10%"></td><td width="10%">X</td></tr>
  64772. <tr><td width="40%">Metal Gear Solid: The Twin Snakes</td><td width="10%"></td><td width="10%">X</td></tr>
  64773. <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>
  64774. <tr><td width="40%">MobiClip MODS</td><td width="10%"></td><td width="10%">X</td></tr>
  64775. <tr><td width="40%">MobiClip MOFLEX</td><td width="10%"></td><td width="10%">X</td></tr>
  64776. <tr><td width="40%">Mobotix .mxg</td><td width="10%"></td><td width="10%">X</td></tr>
  64777. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  64778. <tr><td width="40%">Motion Pixels MVI</td><td width="10%"></td><td width="10%">X</td></tr>
  64779. <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>
  64780. <tr><td width="40%">MP2</td><td width="10%">X</td><td width="10%">X</td></tr>
  64781. <tr><td width="40%">MP3</td><td width="10%">X</td><td width="10%">X</td></tr>
  64782. <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>
  64783. <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>
  64784. <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>
  64785. <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>
  64786. <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>
  64787. <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>
  64788. <tr><td width="40%">MIDI Sample Dump Standard</td><td width="10%"></td><td width="10%">X</td></tr>
  64789. <tr><td width="40%">MIME multipart JPEG</td><td width="10%">X</td><td width="10%"></td></tr>
  64790. <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>
  64791. <tr><td width="40%">MTV</td><td width="10%"></td><td width="10%">X</td></tr>
  64792. <tr><td width="40%">Musepack</td><td width="10%"></td><td width="10%">X</td></tr>
  64793. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  64794. <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>
  64795. <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>
  64796. <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>
  64797. <tr><td width="40%">NIST SPeech HEader REsources</td><td width="10%"></td><td width="10%">X</td></tr>
  64798. <tr><td width="40%">Computerized Speech Lab NSP</td><td width="10%"></td><td width="10%">X</td></tr>
  64799. <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>
  64800. <tr><td width="40%">Nullsoft Streaming Video</td><td width="10%"></td><td width="10%">X</td></tr>
  64801. <tr><td width="40%">NuppelVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  64802. <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>
  64803. <tr><td width="40%">Ogg</td><td width="10%">X</td><td width="10%">X</td></tr>
  64804. <tr><td width="40%">Playstation Portable PMP</td><td width="10%"></td><td width="10%">X</td></tr>
  64805. <tr><td width="40%">Portable Voice Format</td><td width="10%"></td><td width="10%">X</td></tr>
  64806. <tr><td width="40%">RK Audio (RKA)</td><td width="10%"></td><td width="10%">X</td></tr>
  64807. <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>
  64808. <tr><td width="40%">QCP</td><td width="10%"></td><td width="10%">X</td></tr>
  64809. <tr><td width="40%">raw ADTS (AAC)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64810. <tr><td width="40%">raw AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  64811. <tr><td width="40%">raw AMR-NB</td><td width="10%"></td><td width="10%">X</td></tr>
  64812. <tr><td width="40%">raw AMR-WB</td><td width="10%"></td><td width="10%">X</td></tr>
  64813. <tr><td width="40%">raw APAC</td><td width="10%"></td><td width="10%">X</td></tr>
  64814. <tr><td width="40%">raw aptX</td><td width="10%">X</td><td width="10%">X</td></tr>
  64815. <tr><td width="40%">raw aptX HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  64816. <tr><td width="40%">raw Bonk</td><td width="10%"></td><td width="10%">X</td></tr>
  64817. <tr><td width="40%">raw Chinese AVS video</td><td width="10%">X</td><td width="10%">X</td></tr>
  64818. <tr><td width="40%">raw DFPWM</td><td width="10%">X</td><td width="10%">X</td></tr>
  64819. <tr><td width="40%">raw Dirac</td><td width="10%">X</td><td width="10%">X</td></tr>
  64820. <tr><td width="40%">raw DNxHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  64821. <tr><td width="40%">raw DTS</td><td width="10%">X</td><td width="10%">X</td></tr>
  64822. <tr><td width="40%">raw DTS-HD</td><td width="10%"></td><td width="10%">X</td></tr>
  64823. <tr><td width="40%">raw E-AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  64824. <tr><td width="40%">raw EVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  64825. <tr><td width="40%">raw FLAC</td><td width="10%">X</td><td width="10%">X</td></tr>
  64826. <tr><td width="40%">raw GSM</td><td width="10%"></td><td width="10%">X</td></tr>
  64827. <tr><td width="40%">raw H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  64828. <tr><td width="40%">raw H.263</td><td width="10%">X</td><td width="10%">X</td></tr>
  64829. <tr><td width="40%">raw H.264</td><td width="10%">X</td><td width="10%">X</td></tr>
  64830. <tr><td width="40%">raw HEVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  64831. <tr><td width="40%">raw Ingenient MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  64832. <tr><td width="40%">raw MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  64833. <tr><td width="40%">raw MLP</td><td width="10%"></td><td width="10%">X</td></tr>
  64834. <tr><td width="40%">raw MPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  64835. <tr><td width="40%">raw MPEG-1</td><td width="10%"></td><td width="10%">X</td></tr>
  64836. <tr><td width="40%">raw MPEG-2</td><td width="10%"></td><td width="10%">X</td></tr>
  64837. <tr><td width="40%">raw MPEG-4</td><td width="10%">X</td><td width="10%">X</td></tr>
  64838. <tr><td width="40%">raw NULL</td><td width="10%">X</td><td width="10%"></td></tr>
  64839. <tr><td width="40%">raw video</td><td width="10%">X</td><td width="10%">X</td></tr>
  64840. <tr><td width="40%">raw id RoQ</td><td width="10%">X</td><td width="10%"></td></tr>
  64841. <tr><td width="40%">raw OBU</td><td width="10%">X</td><td width="10%">X</td></tr>
  64842. <tr><td width="40%">raw OSQ</td><td width="10%"></td><td width="10%">X</td></tr>
  64843. <tr><td width="40%">raw SBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  64844. <tr><td width="40%">raw Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  64845. <tr><td width="40%">raw TAK</td><td width="10%"></td><td width="10%">X</td></tr>
  64846. <tr><td width="40%">raw TrueHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  64847. <tr><td width="40%">raw VC-1</td><td width="10%">X</td><td width="10%">X</td></tr>
  64848. <tr><td width="40%">raw PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  64849. <tr><td width="40%">raw PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  64850. <tr><td width="40%">raw PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  64851. <tr><td width="40%">raw PCM signed 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64852. <tr><td width="40%">raw PCM signed 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64853. <tr><td width="40%">raw PCM signed 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64854. <tr><td width="40%">raw PCM signed 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64855. <tr><td width="40%">raw PCM signed 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64856. <tr><td width="40%">raw PCM signed 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64857. <tr><td width="40%">raw PCM signed 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64858. <tr><td width="40%">raw PCM signed 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64859. <tr><td width="40%">raw PCM signed 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64860. <tr><td width="40%">raw PCM unsigned 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  64861. <tr><td width="40%">raw PCM unsigned 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64862. <tr><td width="40%">raw PCM unsigned 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64863. <tr><td width="40%">raw PCM unsigned 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64864. <tr><td width="40%">raw PCM unsigned 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64865. <tr><td width="40%">raw PCM unsigned 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64866. <tr><td width="40%">raw PCM unsigned 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64867. <tr><td width="40%">raw PCM 16.8 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  64868. <tr><td width="40%">raw PCM 24.0 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  64869. <tr><td width="40%">raw PCM floating-point 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64870. <tr><td width="40%">raw PCM floating-point 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64871. <tr><td width="40%">raw PCM floating-point 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64872. <tr><td width="40%">raw PCM floating-point 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  64873. <tr><td width="40%">RDT</td><td width="10%"></td><td width="10%">X</td></tr>
  64874. <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>
  64875. <tr><td width="40%">RealMedia</td><td width="10%">X</td><td width="10%">X</td></tr>
  64876. <tr><td width="40%">Redirector</td><td width="10%"></td><td width="10%">X</td></tr>
  64877. <tr><td width="40%">RedSpark</td><td width="10%"></td><td width="10%">X</td></tr>
  64878. <tr><td width="40%">Renderware TeXture Dictionary</td><td width="10%"></td><td width="10%">X</td></tr>
  64879. <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>
  64880. <tr><td width="40%">RF64</td><td width="10%"></td><td width="10%">X</td></tr>
  64881. <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>
  64882. <tr><td width="40%">RPL/ARMovie</td><td width="10%"></td><td width="10%">X</td></tr>
  64883. <tr><td width="40%">Lego Mindstorms RSO</td><td width="10%">X</td><td width="10%">X</td></tr>
  64884. <tr><td width="40%">RSD</td><td width="10%"></td><td width="10%">X</td></tr>
  64885. <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>
  64886. <tr><td width="40%">RTP</td><td width="10%">X</td><td width="10%">X</td></tr>
  64887. <tr><td width="40%">RTSP</td><td width="10%">X</td><td width="10%">X</td></tr>
  64888. <tr><td width="40%">Sample Dump eXchange</td><td width="10%"></td><td width="10%">X</td></tr>
  64889. <tr><td width="40%">SAP</td><td width="10%">X</td><td width="10%">X</td></tr>
  64890. <tr><td width="40%">SBG</td><td width="10%"></td><td width="10%">X</td></tr>
  64891. <tr><td width="40%">SDNS</td><td width="10%"></td><td width="10%">X</td></tr>
  64892. <tr><td width="40%">SDP</td><td width="10%"></td><td width="10%">X</td></tr>
  64893. <tr><td width="40%">SER</td><td width="10%"></td><td width="10%">X</td></tr>
  64894. <tr><td width="40%">Digital Pictures SGA</td><td width="10%"></td><td width="10%">X</td></tr>
  64895. <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>
  64896. <tr><td width="40%">Silicon Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  64897. <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>
  64898. <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>
  64899. <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>
  64900. <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>
  64901. <tr><td width="40%">SMPTE 337M encapsulation</td><td width="10%"></td><td width="10%">X</td></tr>
  64902. <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>
  64903. <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>
  64904. <tr><td width="40%">Sony PlayStation STR</td><td width="10%"></td><td width="10%">X</td></tr>
  64905. <tr><td width="40%">Sony Wave64 (W64)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64906. <tr><td width="40%">SoX native format</td><td width="10%">X</td><td width="10%">X</td></tr>
  64907. <tr><td width="40%">SUN AU format</td><td width="10%">X</td><td width="10%">X</td></tr>
  64908. <tr><td width="40%">SUP raw PGS subtitles</td><td width="10%">X</td><td width="10%">X</td></tr>
  64909. <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>
  64910. <tr><td width="40%">TDSC</td><td width="10%"></td><td width="10%">X</td></tr>
  64911. <tr><td width="40%">Text files</td><td width="10%"></td><td width="10%">X</td></tr>
  64912. <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>
  64913. <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>
  64914. <tr><td width="40%">True Audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  64915. <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>
  64916. <tr><td width="40%">VC-1 test bitstream</td><td width="10%">X</td><td width="10%">X</td></tr>
  64917. <tr><td width="40%">Vidvox Hap</td><td width="10%">X</td><td width="10%">X</td></tr>
  64918. <tr><td width="40%">Vivo</td><td width="10%"></td><td width="10%">X</td></tr>
  64919. <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>
  64920. <tr><td width="40%">Marble WADY</td><td width="10%"></td><td width="10%">X</td></tr>
  64921. <tr><td width="40%">WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  64922. <tr><td width="40%">Waveform Archiver</td><td width="10%"></td><td width="10%">X</td></tr>
  64923. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  64924. <tr><td width="40%">WebM</td><td width="10%">X</td><td width="10%">X</td></tr>
  64925. <tr><td width="40%">Windows Televison (WTV)</td><td width="10%">X</td><td width="10%">X</td></tr>
  64926. <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>
  64927. <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>
  64928. <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>
  64929. <tr><td width="40%">Wideband Single-bit Data (WSD)</td><td width="10%"></td><td width="10%">X</td></tr>
  64930. <tr><td width="40%">WVE</td><td width="10%"></td><td width="10%">X</td></tr>
  64931. <tr><td width="40%">Konami XMD</td><td width="10%"></td><td width="10%">X</td></tr>
  64932. <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>
  64933. <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>
  64934. <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>
  64935. <tr><td width="40%">eXtended BINary text (XBIN)</td><td width="10%"></td><td width="10%">X</td></tr>
  64936. <tr><td width="40%">YUV4MPEG pipe</td><td width="10%">X</td><td width="10%">X</td></tr>
  64937. <tr><td width="40%">Psygnosis YOP</td><td width="10%"></td><td width="10%">X</td></tr>
  64938. </tbody>
  64939. </table>
  64940. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  64941. </p>
  64942. </div>
  64943. <div class="section-level-extent" id="Image-Formats">
  64944. <h3 class="section"><span>49.2 Image Formats<a class="copiable-link" href="#Image-Formats"> &para;</a></span></h3>
  64945. <p>FFmpeg can read and write images for each frame of a video sequence. The
  64946. following image formats are supported:
  64947. </p>
  64948. <table class="multitable">
  64949. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  64950. <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>
  64951. <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>
  64952. <tr><td width="40%">animated GIF</td><td width="10%">X</td><td width="10%">X</td></tr>
  64953. <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>
  64954. <tr><td width="40%">BMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft BMP image</td></tr>
  64955. <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>
  64956. <tr><td width="40%">CRI</td><td width="10%"></td><td width="10%">X</td><td width="40%">Cintel RAW</td></tr>
  64957. <tr><td width="40%">DPX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Digital Picture Exchange</td></tr>
  64958. <tr><td width="40%">EXR</td><td width="10%"></td><td width="10%">X</td><td width="40%">OpenEXR</td></tr>
  64959. <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>
  64960. <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>
  64961. <tr><td width="40%">IMG</td><td width="10%"></td><td width="10%">X</td><td width="40%">GEM Raster image</td></tr>
  64962. <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>
  64963. <tr><td width="40%">JPEG 2000</td><td width="10%">X</td><td width="10%">X</td></tr>
  64964. <tr><td width="40%">JPEG-LS</td><td width="10%">X</td><td width="10%">X</td></tr>
  64965. <tr><td width="40%">LJPEG</td><td width="10%">X</td><td width="10%"></td><td width="40%">Lossless JPEG</td></tr>
  64966. <tr><td width="40%">Media 100</td><td width="10%"></td><td width="10%">X</td></tr>
  64967. <tr><td width="40%">MSP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Microsoft Paint image</td></tr>
  64968. <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>
  64969. <tr><td width="40%">PBM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable BitMap image</td></tr>
  64970. <tr><td width="40%">PCD</td><td width="10%"></td><td width="10%">X</td><td width="40%">PhotoCD</td></tr>
  64971. <tr><td width="40%">PCX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PC Paintbrush</td></tr>
  64972. <tr><td width="40%">PFM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable FloatMap image</td></tr>
  64973. <tr><td width="40%">PGM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable GrayMap image</td></tr>
  64974. <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>
  64975. <tr><td width="40%">PGX</td><td width="10%"></td><td width="10%">X</td><td width="40%">PGX file decoder</td></tr>
  64976. <tr><td width="40%">PHM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable HalfFloatMap image</td></tr>
  64977. <tr><td width="40%">PIC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Pictor/PC Paint</td></tr>
  64978. <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>
  64979. <tr><td width="40%">PPM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable PixelMap image</td></tr>
  64980. <tr><td width="40%">PSD</td><td width="10%"></td><td width="10%">X</td><td width="40%">Photoshop</td></tr>
  64981. <tr><td width="40%">PTX</td><td width="10%"></td><td width="10%">X</td><td width="40%">V.Flash PTX format</td></tr>
  64982. <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>
  64983. <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>
  64984. <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>
  64985. <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>
  64986. <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>
  64987. <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>
  64988. <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>
  64989. <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>
  64990. <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>
  64991. <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>
  64992. <tr><td width="40%">XPM</td><td width="10%"></td><td width="10%">X</td><td width="40%">X PixMap image format</td></tr>
  64993. <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>
  64994. </tbody>
  64995. </table>
  64996. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  64997. </p>
  64998. <p><code class="code">E</code> means that support is provided through an external library.
  64999. </p>
  65000. </div>
  65001. <div class="section-level-extent" id="Video-Codecs">
  65002. <h3 class="section"><span>49.3 Video Codecs<a class="copiable-link" href="#Video-Codecs"> &para;</a></span></h3>
  65003. <table class="multitable">
  65004. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  65005. <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>
  65006. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  65007. <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>
  65008. <tr><td width="40%">Amazing Studio PAF Video</td><td width="10%"></td><td width="10%">X</td></tr>
  65009. <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>
  65010. <tr><td width="40%">Amuse Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  65011. <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>
  65012. <tr><td width="40%">ANSI/ASCII art</td><td width="10%"></td><td width="10%">X</td></tr>
  65013. <tr><td width="40%">Apple Intermediate Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  65014. <tr><td width="40%">Apple MJPEG-B</td><td width="10%"></td><td width="10%">X</td></tr>
  65015. <tr><td width="40%">Apple Pixlet</td><td width="10%"></td><td width="10%">X</td></tr>
  65016. <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>
  65017. <tr><td width="40%">Apple QuickDraw</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: qdrw</td></tr>
  65018. <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>
  65019. <tr><td width="40%">Asus v1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV1</td></tr>
  65020. <tr><td width="40%">Asus v2</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV2</td></tr>
  65021. <tr><td width="40%">ATI VCR1</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR1</td></tr>
  65022. <tr><td width="40%">ATI VCR2</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR2</td></tr>
  65023. <tr><td width="40%">Auravision Aura</td><td width="10%"></td><td width="10%">X</td></tr>
  65024. <tr><td width="40%">Auravision Aura 2</td><td width="10%"></td><td width="10%">X</td></tr>
  65025. <tr><td width="40%">Autodesk Animator Flic video</td><td width="10%"></td><td width="10%">X</td></tr>
  65026. <tr><td width="40%">Autodesk RLE</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: AASC</td></tr>
  65027. <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>
  65028. <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>
  65029. <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>
  65030. <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>
  65031. <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>
  65032. <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>
  65033. <tr><td width="40%">Beam Software VB</td><td width="10%"></td><td width="10%">X</td></tr>
  65034. <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>
  65035. <tr><td width="40%">Bink Video</td><td width="10%"></td><td width="10%">X</td></tr>
  65036. <tr><td width="40%">BitJazz SheerVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  65037. <tr><td width="40%">Bitmap Brothers JV video</td><td width="10%"></td><td width="10%">X</td></tr>
  65038. <tr><td width="40%">y41p Brooktree uncompressed 4:1:1 12-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  65039. <tr><td width="40%">Brooktree ProSumer Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: BT20</td></tr>
  65040. <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>
  65041. <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>
  65042. <tr><td width="40%">CamStudio</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: CSCD</td></tr>
  65043. <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>
  65044. <tr><td width="40%">CDXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">Amiga CD video codec</td></tr>
  65045. <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>
  65046. <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>
  65047. <tr><td width="40%">Discworld II BMV Video</td><td width="10%"></td><td width="10%">X</td></tr>
  65048. <tr><td width="40%">CineForm HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  65049. <tr><td width="40%">Canopus HQ</td><td width="10%"></td><td width="10%">X</td></tr>
  65050. <tr><td width="40%">Canopus HQA</td><td width="10%"></td><td width="10%">X</td></tr>
  65051. <tr><td width="40%">Canopus HQX</td><td width="10%"></td><td width="10%">X</td></tr>
  65052. <tr><td width="40%">Canopus Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  65053. <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>
  65054. <tr><td width="40%">Cinepak</td><td width="10%"></td><td width="10%">X</td></tr>
  65055. <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>
  65056. <tr><td width="40%">CPiA Video Format</td><td width="10%"></td><td width="10%">X</td></tr>
  65057. <tr><td width="40%">Creative YUV (CYUV)</td><td width="10%"></td><td width="10%">X</td></tr>
  65058. <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>
  65059. <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>
  65060. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  65061. <tr><td width="40%">DNxHD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">aka SMPTE VC3</td></tr>
  65062. <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>
  65063. <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>
  65064. <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>
  65065. <tr><td width="40%">DV (Digital Video)</td><td width="10%">X</td><td width="10%">X</td></tr>
  65066. <tr><td width="40%">Dxtory capture format</td><td width="10%"></td><td width="10%">X</td></tr>
  65067. <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>
  65068. <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>
  65069. <tr><td width="40%">Electronic Arts Madcow video</td><td width="10%"></td><td width="10%">X</td></tr>
  65070. <tr><td width="40%">Electronic Arts TGV video</td><td width="10%"></td><td width="10%">X</td></tr>
  65071. <tr><td width="40%">Electronic Arts TGQ video</td><td width="10%"></td><td width="10%">X</td></tr>
  65072. <tr><td width="40%">Electronic Arts TQI video</td><td width="10%"></td><td width="10%">X</td></tr>
  65073. <tr><td width="40%">Escape 124</td><td width="10%"></td><td width="10%">X</td></tr>
  65074. <tr><td width="40%">Escape 130</td><td width="10%"></td><td width="10%">X</td></tr>
  65075. <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>
  65076. <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>
  65077. <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>
  65078. <tr><td width="40%">Flash Screen Video v2</td><td width="10%">X</td><td width="10%">X</td></tr>
  65079. <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>
  65080. <tr><td width="40%">FM Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  65081. <tr><td width="40%">Forward Uncompressed</td><td width="10%"></td><td width="10%">X</td></tr>
  65082. <tr><td width="40%">Fraps</td><td width="10%"></td><td width="10%">X</td></tr>
  65083. <tr><td width="40%">Go2Meeting</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M2, G2M3</td></tr>
  65084. <tr><td width="40%">Go2Webinar</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M4</td></tr>
  65085. <tr><td width="40%">Gremlin Digital Video</td><td width="10%"></td><td width="10%">X</td></tr>
  65086. <tr><td width="40%">H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  65087. <tr><td width="40%">H.263 / H.263-1996</td><td width="10%">X</td><td width="10%">X</td></tr>
  65088. <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>
  65089. <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>
  65090. <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>
  65091. <tr><td width="40%">HNM version 4</td><td width="10%"></td><td width="10%">X</td></tr>
  65092. <tr><td width="40%">HuffYUV</td><td width="10%">X</td><td width="10%">X</td></tr>
  65093. <tr><td width="40%">HuffYUV FFmpeg variant</td><td width="10%">X</td><td width="10%">X</td></tr>
  65094. <tr><td width="40%">IBM Ultimotion</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: ULTI</td></tr>
  65095. <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>
  65096. <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>
  65097. <tr><td width="40%">IFF ILBM</td><td width="10%"></td><td width="10%">X</td><td width="40%">IFF interleaved bitmap</td></tr>
  65098. <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>
  65099. <tr><td width="40%">Infinity IMM4</td><td width="10%"></td><td width="10%">X</td></tr>
  65100. <tr><td width="40%">Intel H.263</td><td width="10%"></td><td width="10%">X</td></tr>
  65101. <tr><td width="40%">Intel Indeo 2</td><td width="10%"></td><td width="10%">X</td></tr>
  65102. <tr><td width="40%">Intel Indeo 3</td><td width="10%"></td><td width="10%">X</td></tr>
  65103. <tr><td width="40%">Intel Indeo 4</td><td width="10%"></td><td width="10%">X</td></tr>
  65104. <tr><td width="40%">Intel Indeo 5</td><td width="10%"></td><td width="10%">X</td></tr>
  65105. <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>
  65106. <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>
  65107. <tr><td width="40%">J2K</td><td width="10%">X</td><td width="10%">X</td></tr>
  65108. <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>
  65109. <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>
  65110. <tr><td width="40%">Lagarith</td><td width="10%"></td><td width="10%">X</td></tr>
  65111. <tr><td width="40%">LCL (LossLess Codec Library) MSZH</td><td width="10%"></td><td width="10%">X</td></tr>
  65112. <tr><td width="40%">LCL (LossLess Codec Library) ZLIB</td><td width="10%">E</td><td width="10%">E</td></tr>
  65113. <tr><td width="40%">LEAD MCMP</td><td width="10%"></td><td width="10%">X</td></tr>
  65114. <tr><td width="40%">LOCO</td><td width="10%"></td><td width="10%">X</td></tr>
  65115. <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>
  65116. <tr><td width="40%">lossless MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  65117. <tr><td width="40%">MagicYUV Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  65118. <tr><td width="40%">Mandsoft Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  65119. <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>
  65120. <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>
  65121. <tr><td width="40%">Microsoft RLE</td><td width="10%">X</td><td width="10%">X</td></tr>
  65122. <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>
  65123. <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>
  65124. <tr><td width="40%">Microsoft Video 1</td><td width="10%"></td><td width="10%">X</td></tr>
  65125. <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>
  65126. <tr><td width="40%">Miro VideoXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VIXL</td></tr>
  65127. <tr><td width="40%">MJPEG (Motion JPEG)</td><td width="10%">X</td><td width="10%">X</td></tr>
  65128. <tr><td width="40%">Mobotix MxPEG video</td><td width="10%"></td><td width="10%">X</td></tr>
  65129. <tr><td width="40%">Motion Pixels video</td><td width="10%"></td><td width="10%">X</td></tr>
  65130. <tr><td width="40%">MPEG-1 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  65131. <tr><td width="40%">MPEG-2 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  65132. <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>
  65133. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 1</td><td width="10%"></td><td width="10%">X</td></tr>
  65134. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  65135. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 3</td><td width="10%">X</td><td width="10%">X</td></tr>
  65136. <tr><td width="40%">Newtek SpeedHQ</td><td width="10%">X</td><td width="10%">X</td></tr>
  65137. <tr><td width="40%">Nintendo Gamecube THP video</td><td width="10%"></td><td width="10%">X</td></tr>
  65138. <tr><td width="40%">NotchLC</td><td width="10%"></td><td width="10%">X</td></tr>
  65139. <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>
  65140. <tr><td width="40%">On2 VP3</td><td width="10%"></td><td width="10%">X</td><td width="40%">still experimental</td></tr>
  65141. <tr><td width="40%">On2 VP4</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP40</td></tr>
  65142. <tr><td width="40%">On2 VP5</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP50</td></tr>
  65143. <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>
  65144. <tr><td width="40%">On2 VP7</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP70,VP71</td></tr>
  65145. <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>
  65146. <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>
  65147. <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>
  65148. <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>
  65149. <tr><td width="40%">QuickTime 8BPS video</td><td width="10%"></td><td width="10%">X</td></tr>
  65150. <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>
  65151. <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>
  65152. <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>
  65153. <tr><td width="40%">R10K AJA Kona 10-bit RGB Codec</td><td width="10%">X</td><td width="10%">X</td></tr>
  65154. <tr><td width="40%">R210 Quicktime Uncompressed RGB 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  65155. <tr><td width="40%">Raw Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  65156. <tr><td width="40%">RealVideo 1.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  65157. <tr><td width="40%">RealVideo 2.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  65158. <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>
  65159. <tr><td width="40%">RealVideo 4.0</td><td width="10%"></td><td width="10%">X</td></tr>
  65160. <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>
  65161. <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>
  65162. <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>
  65163. <tr><td width="40%">ScreenPressor</td><td width="10%"></td><td width="10%">X</td></tr>
  65164. <tr><td width="40%">Screenpresso</td><td width="10%"></td><td width="10%">X</td></tr>
  65165. <tr><td width="40%">Screen Recorder Gold Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  65166. <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>
  65167. <tr><td width="40%">Silicon Graphics Motion Video Compressor 1 (MVC1)</td><td width="10%"></td><td width="10%">X</td></tr>
  65168. <tr><td width="40%">Silicon Graphics Motion Video Compressor 2 (MVC2)</td><td width="10%"></td><td width="10%">X</td></tr>
  65169. <tr><td width="40%">Silicon Graphics RLE 8-bit video</td><td width="10%"></td><td width="10%">X</td></tr>
  65170. <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>
  65171. <tr><td width="40%">SMPTE VC-1</td><td width="10%"></td><td width="10%">X</td></tr>
  65172. <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>
  65173. <tr><td width="40%">Sony PlayStation MDEC (Motion DECoder)</td><td width="10%"></td><td width="10%">X</td></tr>
  65174. <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>
  65175. <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>
  65176. <tr><td width="40%">Sunplus JPEG (SP5X)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: SP5X</td></tr>
  65177. <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>
  65178. <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>
  65179. <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>
  65180. <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>
  65181. <tr><td width="40%">Ut Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  65182. <tr><td width="40%">v210 QuickTime uncompressed 4:2:2 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  65183. <tr><td width="40%">v308 QuickTime uncompressed 4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  65184. <tr><td width="40%">v408 QuickTime uncompressed 4:4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  65185. <tr><td width="40%">v410 QuickTime uncompressed 4:4:4 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  65186. <tr><td width="40%">VBLE Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  65187. <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>
  65188. <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>
  65189. <tr><td width="40%">Westwood Studios VQA (Vector Quantized Animation) video</td><td width="10%"></td><td width="10%">X</td></tr>
  65190. <tr><td width="40%">Windows Media Image</td><td width="10%"></td><td width="10%">X</td></tr>
  65191. <tr><td width="40%">Windows Media Video 7</td><td width="10%">X</td><td width="10%">X</td></tr>
  65192. <tr><td width="40%">Windows Media Video 8</td><td width="10%">X</td><td width="10%">X</td></tr>
  65193. <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>
  65194. <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>
  65195. <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>
  65196. <tr><td width="40%">Winnov WNV1</td><td width="10%"></td><td width="10%">X</td></tr>
  65197. <tr><td width="40%">WMV7</td><td width="10%">X</td><td width="10%">X</td></tr>
  65198. <tr><td width="40%">YAMAHA SMAF</td><td width="10%">X</td><td width="10%">X</td></tr>
  65199. <tr><td width="40%">Psygnosis YOP Video</td><td width="10%"></td><td width="10%">X</td></tr>
  65200. <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>
  65201. <tr><td width="40%">ZeroCodec Lossless Video</td><td width="10%"></td><td width="10%">X</td></tr>
  65202. <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>
  65203. <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>
  65204. </tbody>
  65205. </table>
  65206. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  65207. </p>
  65208. <p><code class="code">E</code> means that support is provided through an external library.
  65209. </p>
  65210. </div>
  65211. <div class="section-level-extent" id="Audio-Codecs">
  65212. <h3 class="section"><span>49.4 Audio Codecs<a class="copiable-link" href="#Audio-Codecs"> &para;</a></span></h3>
  65213. <table class="multitable">
  65214. <tbody><tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  65215. <tr><td width="40%">8SVX exponential</td><td width="10%"></td><td width="10%">X</td></tr>
  65216. <tr><td width="40%">8SVX fibonacci</td><td width="10%"></td><td width="10%">X</td></tr>
  65217. <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>
  65218. <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>
  65219. <tr><td width="40%">AC-3</td><td width="10%">IX</td><td width="10%">IX</td></tr>
  65220. <tr><td width="40%">ACELP.KELVIN</td><td width="10%"></td><td width="10%">X</td></tr>
  65221. <tr><td width="40%">ADPCM 4X Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  65222. <tr><td width="40%">ADPCM Yamaha AICA</td><td width="10%"></td><td width="10%">X</td></tr>
  65223. <tr><td width="40%">ADPCM AmuseGraphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  65224. <tr><td width="40%">ADPCM Argonaut Games</td><td width="10%">X</td><td width="10%">X</td></tr>
  65225. <tr><td width="40%">ADPCM CDROM XA</td><td width="10%"></td><td width="10%">X</td></tr>
  65226. <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>
  65227. <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>
  65228. <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>
  65229. <tr><td width="40%">ADPCM Electronic Arts R1</td><td width="10%"></td><td width="10%">X</td></tr>
  65230. <tr><td width="40%">ADPCM Electronic Arts R2</td><td width="10%"></td><td width="10%">X</td></tr>
  65231. <tr><td width="40%">ADPCM Electronic Arts R3</td><td width="10%"></td><td width="10%">X</td></tr>
  65232. <tr><td width="40%">ADPCM Electronic Arts XAS</td><td width="10%"></td><td width="10%">X</td></tr>
  65233. <tr><td width="40%">ADPCM G.722</td><td width="10%">X</td><td width="10%">X</td></tr>
  65234. <tr><td width="40%">ADPCM G.726</td><td width="10%">X</td><td width="10%">X</td></tr>
  65235. <tr><td width="40%">ADPCM IMA Acorn Replay</td><td width="10%"></td><td width="10%">X</td></tr>
  65236. <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>
  65237. <tr><td width="40%">ADPCM IMA Cunning Developments</td><td width="10%"></td><td width="10%">X</td></tr>
  65238. <tr><td width="40%">ADPCM IMA Electronic Arts EACS</td><td width="10%"></td><td width="10%">X</td></tr>
  65239. <tr><td width="40%">ADPCM IMA Electronic Arts SEAD</td><td width="10%"></td><td width="10%">X</td></tr>
  65240. <tr><td width="40%">ADPCM IMA Funcom</td><td width="10%"></td><td width="10%">X</td></tr>
  65241. <tr><td width="40%">ADPCM IMA High Voltage Software ALP</td><td width="10%">X</td><td width="10%">X</td></tr>
  65242. <tr><td width="40%">ADPCM IMA Mobiclip MOFLEX</td><td width="10%"></td><td width="10%">X</td></tr>
  65243. <tr><td width="40%">ADPCM IMA QuickTime</td><td width="10%">X</td><td width="10%">X</td></tr>
  65244. <tr><td width="40%">ADPCM IMA Simon &amp; Schuster Interactive</td><td width="10%">X</td><td width="10%">X</td></tr>
  65245. <tr><td width="40%">ADPCM IMA Ubisoft APM</td><td width="10%">X</td><td width="10%">X</td></tr>
  65246. <tr><td width="40%">ADPCM IMA Loki SDL MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  65247. <tr><td width="40%">ADPCM IMA WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  65248. <tr><td width="40%">ADPCM IMA Westwood</td><td width="10%"></td><td width="10%">X</td></tr>
  65249. <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>
  65250. <tr><td width="40%">ADPCM IMA Dialogic</td><td width="10%"></td><td width="10%">X</td></tr>
  65251. <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>
  65252. <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>
  65253. <tr><td width="40%">ADPCM IMA Radical</td><td width="10%"></td><td width="10%">X</td></tr>
  65254. <tr><td width="40%">ADPCM Microsoft</td><td width="10%">X</td><td width="10%">X</td></tr>
  65255. <tr><td width="40%">ADPCM MS IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  65256. <tr><td width="40%">ADPCM Nintendo Gamecube AFC</td><td width="10%"></td><td width="10%">X</td></tr>
  65257. <tr><td width="40%">ADPCM Nintendo Gamecube DTK</td><td width="10%"></td><td width="10%">X</td></tr>
  65258. <tr><td width="40%">ADPCM Nintendo THP</td><td width="10%"></td><td width="10%">X</td></tr>
  65259. <tr><td width="40%">ADPCM Playstation</td><td width="10%"></td><td width="10%">X</td></tr>
  65260. <tr><td width="40%">ADPCM QT IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  65261. <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>
  65262. <tr><td width="40%">ADPCM Shockwave Flash</td><td width="10%">X</td><td width="10%">X</td></tr>
  65263. <tr><td width="40%">ADPCM Sound Blaster Pro 2-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  65264. <tr><td width="40%">ADPCM Sound Blaster Pro 2.6-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  65265. <tr><td width="40%">ADPCM Sound Blaster Pro 4-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  65266. <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>
  65267. <tr><td width="40%">ADPCM Konami XMD</td><td width="10%"></td><td width="10%">X</td></tr>
  65268. <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>
  65269. <tr><td width="40%">ADPCM Yamaha</td><td width="10%">X</td><td width="10%">X</td></tr>
  65270. <tr><td width="40%">ADPCM Zork</td><td width="10%"></td><td width="10%">X</td></tr>
  65271. <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>
  65272. <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>
  65273. <tr><td width="40%">Amazing Studio PAF Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  65274. <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>
  65275. <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>
  65276. <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>
  65277. <tr><td width="40%">ATRAC1</td><td width="10%"></td><td width="10%">X</td></tr>
  65278. <tr><td width="40%">ATRAC3</td><td width="10%"></td><td width="10%">X</td></tr>
  65279. <tr><td width="40%">ATRAC3+</td><td width="10%"></td><td width="10%">X</td></tr>
  65280. <tr><td width="40%">ATRAC9</td><td width="10%"></td><td width="10%">X</td></tr>
  65281. <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>
  65282. <tr><td width="40%">Bonk audio</td><td width="10%"></td><td width="10%">X</td></tr>
  65283. <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>
  65284. <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>
  65285. <tr><td width="40%">CRI HCA</td><td width="10%"></td><td width="10%">X</td></tr>
  65286. <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>
  65287. <tr><td width="40%">DFPWM</td><td width="10%">X</td><td width="10%">X</td></tr>
  65288. <tr><td width="40%">Digital Speech Standard - Standard Play mode (DSS SP)</td><td width="10%"></td><td width="10%">X</td></tr>
  65289. <tr><td width="40%">Discworld II BMV Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  65290. <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>
  65291. <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>
  65292. <tr><td width="40%">Dolby E</td><td width="10%"></td><td width="10%">X</td></tr>
  65293. <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>
  65294. <tr><td width="40%">DPCM Gremlin</td><td width="10%"></td><td width="10%">X</td></tr>
  65295. <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>
  65296. <tr><td width="40%">DPCM Marble WADY</td><td width="10%"></td><td width="10%">X</td></tr>
  65297. <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>
  65298. <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>
  65299. <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>
  65300. <tr><td width="40%">DPCM Sol</td><td width="10%"></td><td width="10%">X</td></tr>
  65301. <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>
  65302. <tr><td width="40%">DPCM Xilam DERF</td><td width="10%"></td><td width="10%">X</td></tr>
  65303. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  65304. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  65305. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  65306. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  65307. <tr><td width="40%">DSP Group TrueSpeech</td><td width="10%"></td><td width="10%">X</td></tr>
  65308. <tr><td width="40%">DST (Direct Stream Transfer)</td><td width="10%"></td><td width="10%">X</td></tr>
  65309. <tr><td width="40%">DV audio</td><td width="10%"></td><td width="10%">X</td></tr>
  65310. <tr><td width="40%">Enhanced AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  65311. <tr><td width="40%">EVRC (Enhanced Variable Rate Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  65312. <tr><td width="40%">FLAC (Free Lossless Audio Codec)</td><td width="10%">X</td><td width="10%">IX</td></tr>
  65313. <tr><td width="40%">FTR Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  65314. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  65315. <tr><td width="40%">G.729</td><td width="10%"></td><td width="10%">X</td></tr>
  65316. <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>
  65317. <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>
  65318. <tr><td width="40%">IAC (Indeo Audio Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  65319. <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>
  65320. <tr><td width="40%">IMC (Intel Music Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  65321. <tr><td width="40%">Interplay ACM</td><td width="10%"></td><td width="10%">X</td></tr>
  65322. <tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 3:1</td><td width="10%"></td><td width="10%">X</td></tr>
  65323. <tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 6:1</td><td width="10%"></td><td width="10%">X</td></tr>
  65324. <tr><td width="40%">Marian&rsquo;s A-pac audio</td><td width="10%"></td><td width="10%">X</td></tr>
  65325. <tr><td width="40%">MI-SC4 (Micronas SC-4 Audio)</td><td width="10%"></td><td width="10%">X</td></tr>
  65326. <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>
  65327. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  65328. <tr><td width="40%">MP1 (MPEG audio layer 1)</td><td width="10%"></td><td width="10%">IX</td></tr>
  65329. <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>
  65330. <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>
  65331. <tr><td width="40%">MPEG-4 Audio Lossless Coding (ALS)</td><td width="10%"></td><td width="10%">X</td></tr>
  65332. <tr><td width="40%">MobiClip FastAudio</td><td width="10%"></td><td width="10%">X</td></tr>
  65333. <tr><td width="40%">Musepack SV7</td><td width="10%"></td><td width="10%">X</td></tr>
  65334. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  65335. <tr><td width="40%">Nellymoser Asao</td><td width="10%">X</td><td width="10%">X</td></tr>
  65336. <tr><td width="40%">On2 AVC (Audio for Video Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  65337. <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>
  65338. <tr><td width="40%">OSQ (Original Sound Quality)</td><td width="10%"></td><td width="10%">X</td></tr>
  65339. <tr><td width="40%">PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  65340. <tr><td width="40%">PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  65341. <tr><td width="40%">PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  65342. <tr><td width="40%">PCM signed 8-bit planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  65343. <tr><td width="40%">PCM signed 16-bit big-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  65344. <tr><td width="40%">PCM signed 16-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  65345. <tr><td width="40%">PCM signed 24-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  65346. <tr><td width="40%">PCM signed 32-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  65347. <tr><td width="40%">PCM 32-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65348. <tr><td width="40%">PCM 32-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65349. <tr><td width="40%">PCM 64-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65350. <tr><td width="40%">PCM 64-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65351. <tr><td width="40%">PCM D-Cinema audio signed 24-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  65352. <tr><td width="40%">PCM signed 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  65353. <tr><td width="40%">PCM signed 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65354. <tr><td width="40%">PCM signed 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65355. <tr><td width="40%">PCM signed 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65356. <tr><td width="40%">PCM signed 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65357. <tr><td width="40%">PCM signed 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65358. <tr><td width="40%">PCM signed 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65359. <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>
  65360. <tr><td width="40%">PCM unsigned 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  65361. <tr><td width="40%">PCM unsigned 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65362. <tr><td width="40%">PCM unsigned 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65363. <tr><td width="40%">PCM unsigned 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65364. <tr><td width="40%">PCM unsigned 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65365. <tr><td width="40%">PCM unsigned 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65366. <tr><td width="40%">PCM unsigned 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  65367. <tr><td width="40%">PCM SGA</td><td width="10%"></td><td width="10%">X</td></tr>
  65368. <tr><td width="40%">QCELP / PureVoice</td><td width="10%"></td><td width="10%">X</td></tr>
  65369. <tr><td width="40%">QDesign Music Codec 1</td><td width="10%"></td><td width="10%">X</td></tr>
  65370. <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>
  65371. <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>
  65372. <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>
  65373. <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>
  65374. <tr><td width="40%">RealAudio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  65375. <tr><td width="40%">RealAudio SIPR / ACELP.NET</td><td width="10%"></td><td width="10%">X</td></tr>
  65376. <tr><td width="40%">RK Audio (RKA)</td><td width="10%"></td><td width="10%">X</td></tr>
  65377. <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>
  65378. <tr><td width="40%">Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  65379. <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>
  65380. <tr><td width="40%">Smacker audio</td><td width="10%"></td><td width="10%">X</td></tr>
  65381. <tr><td width="40%">SMPTE 302M AES3 audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  65382. <tr><td width="40%">Sonic</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  65383. <tr><td width="40%">Sonic lossless</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  65384. <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>
  65385. <tr><td width="40%">TAK (Tom&rsquo;s lossless Audio Kompressor)</td><td width="10%"></td><td width="10%">X</td></tr>
  65386. <tr><td width="40%">True Audio (TTA)</td><td width="10%">X</td><td width="10%">X</td></tr>
  65387. <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>
  65388. <tr><td width="40%">TwinVQ (VQF flavor)</td><td width="10%"></td><td width="10%">X</td></tr>
  65389. <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>
  65390. <tr><td width="40%">ViewQuest VQC</td><td width="10%"></td><td width="10%">X</td></tr>
  65391. <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>
  65392. <tr><td width="40%">Voxware MetaSound</td><td width="10%"></td><td width="10%">X</td></tr>
  65393. <tr><td width="40%">Waveform Archiver</td><td width="10%"></td><td width="10%">X</td></tr>
  65394. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  65395. <tr><td width="40%">Westwood Audio (SND1)</td><td width="10%"></td><td width="10%">X</td></tr>
  65396. <tr><td width="40%">Windows Media Audio 1</td><td width="10%">X</td><td width="10%">X</td></tr>
  65397. <tr><td width="40%">Windows Media Audio 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  65398. <tr><td width="40%">Windows Media Audio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  65399. <tr><td width="40%">Windows Media Audio Pro</td><td width="10%"></td><td width="10%">X</td></tr>
  65400. <tr><td width="40%">Windows Media Audio Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  65401. <tr><td width="40%">Xbox Media Audio 1</td><td width="10%"></td><td width="10%">X</td></tr>
  65402. <tr><td width="40%">Xbox Media Audio 2</td><td width="10%"></td><td width="10%">X</td></tr>
  65403. </tbody>
  65404. </table>
  65405. <p><code class="code">X</code> means that the feature in that column (encoding / decoding) is supported.
  65406. </p>
  65407. <p><code class="code">E</code> means that support is provided through an external library.
  65408. </p>
  65409. <p><code class="code">I</code> means that an integer-only version is available, too (ensures high
  65410. performance on systems without hardware floating point support).
  65411. </p>
  65412. </div>
  65413. <div class="section-level-extent" id="Subtitle-Formats">
  65414. <h3 class="section"><span>49.5 Subtitle Formats<a class="copiable-link" href="#Subtitle-Formats"> &para;</a></span></h3>
  65415. <table class="multitable">
  65416. <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>
  65417. <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>
  65418. <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>
  65419. <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>
  65420. <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>
  65421. <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>
  65422. <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>
  65423. <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>
  65424. <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>
  65425. <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>
  65426. <tr><td width="40%">PGS</td><td width="10%"></td><td width="10%"></td><td width="10%"></td><td width="10%">X</td></tr>
  65427. <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>
  65428. <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>
  65429. <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>
  65430. <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>
  65431. <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>
  65432. <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>
  65433. <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>
  65434. <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>
  65435. <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>
  65436. <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>
  65437. <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>
  65438. <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>
  65439. <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>
  65440. <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>
  65441. </tbody>
  65442. </table>
  65443. <p><code class="code">X</code> means that the feature is supported.
  65444. </p>
  65445. <p><code class="code">E</code> means that support is provided through an external library.
  65446. </p>
  65447. </div>
  65448. <div class="section-level-extent" id="Network-Protocols">
  65449. <h3 class="section"><span>49.6 Network Protocols<a class="copiable-link" href="#Network-Protocols"> &para;</a></span></h3>
  65450. <table class="multitable">
  65451. <tbody><tr><td width="40%">Name</td><td width="10%">Support</td></tr>
  65452. <tr><td width="40%">AMQP</td><td width="10%">E</td></tr>
  65453. <tr><td width="40%">file</td><td width="10%">X</td></tr>
  65454. <tr><td width="40%">FTP</td><td width="10%">X</td></tr>
  65455. <tr><td width="40%">Gopher</td><td width="10%">X</td></tr>
  65456. <tr><td width="40%">Gophers</td><td width="10%">X</td></tr>
  65457. <tr><td width="40%">HLS</td><td width="10%">X</td></tr>
  65458. <tr><td width="40%">HTTP</td><td width="10%">X</td></tr>
  65459. <tr><td width="40%">HTTPS</td><td width="10%">X</td></tr>
  65460. <tr><td width="40%">Icecast</td><td width="10%">X</td></tr>
  65461. <tr><td width="40%">MMSH</td><td width="10%">X</td></tr>
  65462. <tr><td width="40%">MMST</td><td width="10%">X</td></tr>
  65463. <tr><td width="40%">pipe</td><td width="10%">X</td></tr>
  65464. <tr><td width="40%">Pro-MPEG FEC</td><td width="10%">X</td></tr>
  65465. <tr><td width="40%">RTMP</td><td width="10%">X</td></tr>
  65466. <tr><td width="40%">RTMPE</td><td width="10%">X</td></tr>
  65467. <tr><td width="40%">RTMPS</td><td width="10%">X</td></tr>
  65468. <tr><td width="40%">RTMPT</td><td width="10%">X</td></tr>
  65469. <tr><td width="40%">RTMPTE</td><td width="10%">X</td></tr>
  65470. <tr><td width="40%">RTMPTS</td><td width="10%">X</td></tr>
  65471. <tr><td width="40%">RTP</td><td width="10%">X</td></tr>
  65472. <tr><td width="40%">SAMBA</td><td width="10%">E</td></tr>
  65473. <tr><td width="40%">SCTP</td><td width="10%">X</td></tr>
  65474. <tr><td width="40%">SFTP</td><td width="10%">E</td></tr>
  65475. <tr><td width="40%">TCP</td><td width="10%">X</td></tr>
  65476. <tr><td width="40%">TLS</td><td width="10%">X</td></tr>
  65477. <tr><td width="40%">UDP</td><td width="10%">X</td></tr>
  65478. <tr><td width="40%">ZMQ</td><td width="10%">E</td></tr>
  65479. </tbody>
  65480. </table>
  65481. <p><code class="code">X</code> means that the protocol is supported.
  65482. </p>
  65483. <p><code class="code">E</code> means that support is provided through an external library.
  65484. </p>
  65485. </div>
  65486. <div class="section-level-extent" id="Input_002fOutput-Devices">
  65487. <h3 class="section"><span>49.7 Input/Output Devices<a class="copiable-link" href="#Input_002fOutput-Devices"> &para;</a></span></h3>
  65488. <table class="multitable">
  65489. <tbody><tr><td width="40%">Name</td><td width="10%">Input</td><td width="10%">Output</td></tr>
  65490. <tr><td width="40%">ALSA</td><td width="10%">X</td><td width="10%">X</td></tr>
  65491. <tr><td width="40%">BKTR</td><td width="10%">X</td><td width="10%"></td></tr>
  65492. <tr><td width="40%">caca</td><td width="10%"></td><td width="10%">X</td></tr>
  65493. <tr><td width="40%">DV1394</td><td width="10%">X</td><td width="10%"></td></tr>
  65494. <tr><td width="40%">Lavfi virtual device</td><td width="10%">X</td><td width="10%"></td></tr>
  65495. <tr><td width="40%">Linux framebuffer</td><td width="10%">X</td><td width="10%">X</td></tr>
  65496. <tr><td width="40%">JACK</td><td width="10%">X</td><td width="10%"></td></tr>
  65497. <tr><td width="40%">LIBCDIO</td><td width="10%">X</td></tr>
  65498. <tr><td width="40%">LIBDC1394</td><td width="10%">X</td><td width="10%"></td></tr>
  65499. <tr><td width="40%">OpenAL</td><td width="10%">X</td></tr>
  65500. <tr><td width="40%">OpenGL</td><td width="10%"></td><td width="10%">X</td></tr>
  65501. <tr><td width="40%">OSS</td><td width="10%">X</td><td width="10%">X</td></tr>
  65502. <tr><td width="40%">PulseAudio</td><td width="10%">X</td><td width="10%">X</td></tr>
  65503. <tr><td width="40%">SDL</td><td width="10%"></td><td width="10%">X</td></tr>
  65504. <tr><td width="40%">Video4Linux2</td><td width="10%">X</td><td width="10%">X</td></tr>
  65505. <tr><td width="40%">VfW capture</td><td width="10%">X</td><td width="10%"></td></tr>
  65506. <tr><td width="40%">X11 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  65507. <tr><td width="40%">Win32 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  65508. </tbody>
  65509. </table>
  65510. <p><code class="code">X</code> means that input/output is supported.
  65511. </p>
  65512. </div>
  65513. <div class="section-level-extent" id="Timecode">
  65514. <h3 class="section"><span>49.8 Timecode<a class="copiable-link" href="#Timecode"> &para;</a></span></h3>
  65515. <table class="multitable">
  65516. <tbody><tr><td width="40%">Codec/format</td><td width="10%">Read</td><td width="10%">Write</td></tr>
  65517. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  65518. <tr><td width="40%">DV</td><td width="10%">X</td><td width="10%">X</td></tr>
  65519. <tr><td width="40%">GXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  65520. <tr><td width="40%">MOV</td><td width="10%">X</td><td width="10%">X</td></tr>
  65521. <tr><td width="40%">MPEG1/2</td><td width="10%">X</td><td width="10%">X</td></tr>
  65522. <tr><td width="40%">MXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  65523. </tbody>
  65524. </table>
  65525. </div>
  65526. </div>
  65527. <div class="chapter-level-extent" id="See-Also">
  65528. <h2 class="chapter"><span>50 See Also<a class="copiable-link" href="#See-Also"> &para;</a></span></h2>
  65529. <p><a class="url" href="ffmpeg.html">ffmpeg</a>
  65530. <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
  65531. <a class="url" href="ffmpeg-utils.html">ffmpeg-utils</a>,
  65532. <a class="url" href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
  65533. <a class="url" href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
  65534. <a class="url" href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
  65535. <a class="url" href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
  65536. <a class="url" href="ffmpeg-formats.html">ffmpeg-formats</a>,
  65537. <a class="url" href="ffmpeg-devices.html">ffmpeg-devices</a>,
  65538. <a class="url" href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
  65539. <a class="url" href="ffmpeg-filters.html">ffmpeg-filters</a>
  65540. </p>
  65541. </div>
  65542. <div class="chapter-level-extent" id="Authors">
  65543. <h2 class="chapter"><span>51 Authors<a class="copiable-link" href="#Authors"> &para;</a></span></h2>
  65544. <p>The FFmpeg developers.
  65545. </p>
  65546. <p>For details about the authorship, see the Git history of the project
  65547. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  65548. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  65549. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  65550. </p>
  65551. <p>Maintainers for the specific components are listed in the file
  65552. <samp class="file">MAINTAINERS</samp> in the source code tree.
  65553. </p>
  65554. </div>
  65555. </div>
  65556. <p style="font-size: small;">
  65557. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  65558. </p>
  65559. </div>
  65560. </body>
  65561. </html>